Re: Issue with AC_LANG_PROGRAM

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

 



On 07/18/2013 06:20 AM, Earnie Boyd wrote:
> On Thu, Jul 18, 2013 at 8:08 AM, Eric Blake wrote:
>> On 07/18/2013 03:36 AM, Miguel Guedes wrote:
>>> Hello,
>>>
>>>
>>> I am using AC_LANG_PROGRAM to test for libboost_system and it invokes
>>> gcc/g++ in the following way:
>>>
>>> configure:3975: g++ -o conftest -g -O2  -lboost_system conftest.cpp
>>>
>>> The above results in a few errors and doesn't link even though the
>>> library in question is present in the system.  This is because the
>>> source file should be at the front in the call to g++, e.g.:
>>>
>>>   g++ conftest.cpp -o conftest -g -O2  -lboost_system
>>
>> That's probably because you put -lboost_system into LDFLAGS instead of
>> the proper LIBS (LDFLAGS is for -L/path, LIBS for -llib).
> 
> That answer is still problematic since I need -L/path to instruct
> where to find my -llib. I.E. LDFLAGS value need to be specified before
> LIB value for the test.

AC_LANG_PROGRAM tests (roughly):
 $CC -o conftest $CFLAGS $LDFLAGS conftest.cpp $LIBS

which does precisely what you want, if you stick -L in LDFLAGS and -l in
LIBS.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux