[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compile order of LDFLAGS and LIBS
From: |
Bob Friesenhahn |
Subject: |
Re: compile order of LDFLAGS and LIBS |
Date: |
Wed, 21 Jan 2004 10:50:42 -0600 (CST) |
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
address@hidden
http://www.simplesystems.org/users/bfriesen
Re: compile order of LDFLAGS and LIBS, Ralf Corsepius, 2004/01/22