GNU bug report logs -
#9728
Incorrect -L flags order for HP-UX
Previous Next
Full log
Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 10/13/2011 05:32 AM, Vincent Lefevre wrote:
> On 2011-10-12 21:52:36 -0500, Peter O'Gorman wrote:
>> If the flags were added by the user, they could set LIBS=-L/opt/gnu/lib
>> instead on some platfroms, but that won't work on HP-UX either because its
>> linker is rather strict that -L flags for paths that contain the library be
>> ordered before the -l flag for that library.
>>
>> Anyway, the problem can be avoided by not putting the -L and -l flags for
>> gmp in LDFLAGS and LIBS, instead put both in e.g. GMP_LIBS,
>> (GMP_LIBS="-L/opt/gnu/lib -lgmp"), then add $(GMP_LIBS) to LDADD.
>
> This doesn't work with autoconf's AC_CHECK_LIB and other tests.
> And using LDFLAGS for autoconf and LDADD in the Makefile would
> be quite hard to maintain due to the risk of inconsistencies.
>
> autoconf and libtool should agree on the way to add -L flags.
>
Hi Vincent,
Well, if this is a bug at all, it is an automake/autoconf one, libtool
does not set the order of flags in Makefile.in, but I don't believe that
it is a bug.
LDFLAGS, CFLAGS, etc are for the user to set. It should be possible for
the user to build a package doing ./configure ..options..; make
LDFLAGS=-fancyflag CPPFLAGS=-I/want/coffee;
http://www.gnu.org/prep/standards/standards.html#Command-Variables
The usual way to get specific flags set to allow this is to save
LDFLAGS, CPPFLAGS etc. before doing an autoconf test, do the test, then
restore the original flags.
Something like the attached patch should work for mpfr.
Peter
[mpfr.diff (text/x-patch, attachment)]
This bug report was last modified 13 years and 247 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.