Re: configure scripts and non-standard library paths
From: Dan Espen (daneNO_at_SPAM.mk.telcordia.com)
Date: Fri, 16 Sep 2005 08:50:10 -0400
Lionel B <firstname.lastname@example.org> writes:
> Kilian A. Foth wrote:
>> Lionel B <email@example.com> wrote:
>>> I have some non-standard lib/include paths on my system, which
>>> frequently causes problems when trying to compile tarballs;
>>> specifically, configure scripts often fail to find required
>>> libraries (as far as I can make out, this seems to be due to
>>> failure of the AC_CHECK_LIB and AC_CHECK_HEADER macros).
>>> Not being an autoconf expert, can anyone suggest a "generic hack"
>>> (maybe a configure.in hack?) for telling a configure script to
>>> include additional directories in its library/include search paths,
>>> either for all libraries or just specific libraries?
>> Have you tried a global export CFLAGS="-I/my/strange/path/include
> Right, got it... I find I have to specify flags in the configure
> command line (for some reason just setting/exporting the env vars
> doesn't seem to work):
> ./configure ... LDFLAGS=-L/my/strange/path/lib
> gets me a clean configure/make/make install. Then I also have to add
> /my/strange/path/lib to LD_LIBRARY_PATH (else the binary fails to find
> the dynamic libs) and all is hunk-dory.
Using LD_LIBRARY_PATH is not recommended. (Do some Google searches.)
Try this instead:
LDFLAGS='-L/my/strange/path/lib -Wl,-rpath /my/strange/path/lib'