bug-automake
[Top][All Lists]
Advanced

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

Re: AM_PROG_LEX does not set LEXLIB properly


From: Pete Ryland
Subject: Re: AM_PROG_LEX does not set LEXLIB properly
Date: 23 Jan 2003 10:29:09 +0000

On Wed, 2003-01-22 at 23:37, Alexandre Duret-Lutz wrote:
> AM_PROG_LEX is just a wrapper around AC_PROG_LEX, an Autoconf
> macro; Automake itself does not set LEXLIB.  Could you show us
> the `config.log' excerpt related to the flex/-lfl tests?  It's
> dubious that this test passes if libfl is not in your ld path.

configure:7919: checking for flex
configure:7935: found /opt/sfw/bin/flex
configure:7945: result: flex
configure:7958: checking for yywrap in -lfl
configure:7989: gcc -o conftest -g -O2   conftest.c -lfl   >&5
configure:7992: $? = 0
configure:7995: test -s conftest
configure:7998: $? = 0
configure:8010: result: yes
configure:8078: checking lex output file root
configure:8089: flex conftest.l
configure:8092: $? = 0
configure:8104: result: lex.yy
configure:8109: checking whether yytext is a pointer
configure:8125: gcc -o conftest -g -O2   conftest.c  -lfl >&5
configure:8128: $? = 0
configure:8131: test -s conftest
configure:8134: $? = 0
configure:8147: result: yes

It's only when doing explicit linking does it fail it seems.

>  Pete> I'm thinking that it may be a good idea to have LEXLIB also include a
>  Pete> -L/path/to/libfl.a option.  Or am I just confused?
> 
> I'd say users should run 
>   ./configure LDFLAGS=-L/any/non-standard/place

This is what I'm doing for that system.

> or this sytem could have a PREFIX/share/config.site (see the Autoconf manual)

ok, I'll look into that.  I have installed the latest auto{conf,make}
and libtool to ~/local/ now so I should be able to set this myself. 
Actually, I've also installed flex there too now, in part to get around
this.

> I can't see how AC_PROG_LEX could guess this path.  

Something like: "$(dirname $(which $LEX))/../lib" maybe?

>  Pete> And BTW, when I try to set LD to gld (the name of the binary for GNU ld
>  Pete> on the system) it again works for the conftests, but then reverts back
>  Pete> to /usr/ccs/bin/ld for the actual compilation.
> 
> That works for me.  The ld used during linking comes from Libtool:
> 
> % ./configure LD=gld 
> [...]
> % grep LD= ./libtool
> LD="gld"

ok, after ./configure LD=gld, I too get:

$ grep LD= libtool 
LD="gld"

but then:

$ make
...
/bin/bash ../libtool --mode=link gcc  -g -O2    -o libpsfp.la -rpath 
/home/peter/local/lib  psfp_parser.lo psfp_scanner.lo -L/home/peter/local/lib 
-L/home/peter/local/lib/mysql -lmysqlclient -L/home/peter/local/lib -lpcre 
-lmysqlclient -lpcre
rm -fr .libs/libpsfp.la .libs/libpsfp.* .libs/libpsfp.*
gcc -shared  psfp_parser.lo psfp_scanner.lo  -Wl,--rpath 
-Wl,/home/peter/local/lib/mysql -Wl,--rpath -Wl,/home/peter/local/lib 
-Wl,--rpath -Wl,/home/peter/local/lib/mysql -Wl,--rpath 
-Wl,/home/peter/local/lib  -L/home/peter/local/lib 
-L/home/peter/local/lib/mysql /home/peter/local/lib/mysql/libmysqlclient.so 
/home/peter/local/lib/libpcre.so -lc  -Wl,-soname -Wl,libpsfp.so.0 -o 
.libs/libpsfp.so.0.0.0
/usr/ccs/bin/ld: illegal option -- -
/usr/ccs/bin/ld: illegal option -- -
/usr/ccs/bin/ld: illegal option -- -
/usr/ccs/bin/ld: illegal option -- -
ld: warning: option -o appears more than once, first setting taken
usage: ld [-6:abc:d:e:f:h:il:mo:p:rstu:z:B:CD:F:GI:L:M:N:P:Q:R:S:VY:?] file(s)
...

The relevant part of config.log is:

configure:3405: checking for ld used by GCC
configure:3468: result: gld
configure:3477: checking if the linker (gld) is GNU ld
GNU ld version 2.11 (with BFD 2.11)
configure:3489: result: yes
configure:3494: checking for gld option to reload object files
configure:3501: result: -r

whereas without that option, it would look like this:

configure:3405: checking for ld used by GCC
configure:3468: result: /usr/ccs/bin/ld
configure:3477: checking if the linker (/usr/ccs/bin/ld) is GNU ld
configure:3489: result: no
configure:3494: checking for /usr/ccs/bin/ld option to reload object files
configure:3501: result: -r

This is now with:
ltmain.sh (GNU libtool) 1.4.3 (1.922.2.110 2002/10/23 01:39:54)
autoconf (GNU Autoconf) 2.57
automake (GNU automake) 1.7.2

Thanks,
Pete

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________




reply via email to

[Prev in Thread] Current Thread [Next in Thread]