[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Order of arguments when calling the C compiler
From: |
Stephane Bortzmeyer |
Subject: |
Order of arguments when calling the C compiler |
Date: |
Wed, 24 Jan 2001 16:12:12 +0100 |
There is apparently a bug in autoconf: when calling AC_CHECK_LIB, it uses -l
and -L in the wrong order. It does not disturb gcc or Tru64's cc, but it fails
with Sun's cc.
With the configure.in attached, this fails:
./configure --with-ssl=$HOME
with the following config.log:
configure:795: cc -o conftest -g -I/home/bortz/include conftest.c -lssl
-lcrypto
-L/home/bortz/lib 1>&5
ld: fatal: library -lssl: not found
ld: fatal: library -lcrypto: not found
Because -L was put too late. If I run cc by hand with the right order, SSL is
detected.
Indeed, the fault seems to be in acgeneral.m4, when defining AC_CHECK_LIB:
LIBS="-l$1 $5 $LIBS"
IMHO, it should be:
LIBS="$LIBS -l$1 $5"
% autoconf --version
Autoconf version 2.13
(Debian 2.2 package)
configure.in
Description: configure.in
- Order of arguments when calling the C compiler,
Stephane Bortzmeyer <=