autoconf
[Top][All Lists]
Advanced

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

Re: how to use AC_CHECK_LIB without LDFLAGS?


From: Braden McDaniel
Subject: Re: how to use AC_CHECK_LIB without LDFLAGS?
Date: Thu, 04 Nov 2004 23:09:52 -0500
User-agent: Mozilla Thunderbird 0.9 (Windows/20041103)

Harald Dunkel wrote:
I am new to autoconf and automake, so please excuse if you
heard this too often.


My question is: How can I use AC_CHECK_LIB without setting
a global LDFLAGS?

Yes; but of course, then the compiler's defaults will be used. Presumably that's not what you want either.

Using automake I can specify linker flags per program, e.g.

foo_LDFLAGS = -L/somepath/mylibs1
bar_LDFLAGS = -L/someotherpath/mylibs2

But since AC_CHECK_LIB does not allow me to specify linker
flags for the test program except by setting LDFLAGS (AFAIK),
a broken search path for either foo or bar sneaks into my
generated Makefile :-(.

I don't fully understand the problem you're describing; but perhaps you want to do something like this:

save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Lwhatever"
AC_CHECK_LIB(...)
LDFLAGS="$save_LDFLAGS"

Braden




reply via email to

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