Re: compile order of LDFLAGS and LIBS

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

 



On Wed, 21 Jan 2004, Brian White wrote:

> Package: autoconf
> Version: 2.53
>
> When testing for the existance of functions in libraries, the LIBS
> variable is located after the LDFLAGS variable.  I was wondering if it
> would make more sense to always put the LDFLAGS variable at the end.
>
> Currently:
>
> ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
>
> Suggested:
>
> ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS conftest.$ac_ext $LIBS $LDFLAGS >&5'
>
> The reason for this is some LDFLAGS (such as "-lc" required for uclinux)
> have to be at the end of the line.

LDFLAGS should be reserved for linker flags.  All libraries should be
specified via LIBS.

> I tried setting the LIBS variable to "-lc" on the command line (while
> removing it from the LDFLAGS variable) and that worked for the initial
> configure but failed if I did ./config-status --recheck because the
> LIBS varible was not saved and re-set (though CFLAGS and LDFLAGS were).

That sounds like a bug.

Bob
======================================
Bob Friesenhahn
bfriesen@xxxxxxxxxxxxxxxxxxx
http://www.simplesystems.org/users/bfriesen




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

  Powered by Linux