[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Portably setting library search paths by passing -R or -rpath

From: Ralf Wildenhues
Subject: Re: Portably setting library search paths by passing -R or -rpath
Date: Thu, 5 Mar 2009 20:12:18 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Frank,

* Frank Lahm wrote on Thu, Mar 05, 2009 at 07:39:54PM CET:
> 2009/3/5 Frank Lahm <address@hidden>:
> > In order to properly test and use the library at <path>, we must pass
> > -R <path> or -Wl,-rpath=<path> with LDFLAGS/CFLAGS on some (maybe
> > all?) platforms.

Neither of which is very portable, exactly.

> I have two stages where I must be able to compile, link and run code
> using the lib:
> A. conftest code at configure time
> B. the build product at runtime (of course)
> B is working by means of autoconf/libtool.


> A is giving me problems because afaict as described I must inject -R
> or -rpath depending on the environment.
> Presumably I should be able to use LD_LIBRARY_PATH instead to solve A,
> which afaict should be quite portable.

Good idea.  But the variable may be called differently on other systems.
If you use libtool, and ensure its tests are run before your link test,
you can inspect the $shlibpath_var variable for the name of the variable
to use.

> Correct? Portable?

I think the most flexible set of macros to test for libraries within
configure is provided by the 'havelib' module available in gnulib.

Hope that helps.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]