This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: binutils-2.15 requires flex/lex?


On Tue, 2004-05-18 at 16:08, Daniel Jacobowitz wrote:
> On Tue, May 18, 2004 at 07:00:16AM +0200, Ralf Corsepius wrote:
> > Hi, 
> > 
> > trying to build the original binutils-2.15-tarball on a system without
> > having flex nor lex installed, causes this build error:

Sorry, I had shortened the log too much. Here is a new one:
...
checking for bison... bison -y
checking for flex... no
checking for lex... no
/home/columbo/src/rpms/BUILD/rtems-4.7-sh-rtems4.7-binutils-2.15/binutils-2.15/ld/configure: line 4417: flex: command not foundchecking for flex... lex
checking for yywrap in -ll... no
checking lex output file root...
/home/columbo/src/rpms/BUILD/rtems-4.7-sh-rtems4.7-binutils-2.15/binutils-2.15/ld/configure: line 4505: lex: command not found
configure: error: cannot find output from lex; giving up
make: *** [configure-ld] Error 1

> Please re-run this with sh -x.  I can't see how that happened; what
> should have happened was "checking for flex... no".

As you can see from the log above the there are 2 checks for flex/lex
(Both from AM_PROG_LEX in ld/aclocal.m4).
The first one (originating from AC_CHECK_PROGS) reports "no", the second
one (originating from AC_PROG_LEX) causes the error.

The error referring to line 4417 stems from this (sh -x):
+ test -n ''
+
LEX=/home/columbo/src/rpms/BUILD/rtems-4.7-sh-rtems4.7-binutils-2.15/binutils-2.15/missing
+ flex
/home/columbo/src/rpms/BUILD/rtems-4.7-sh-rtems4.7-binutils-2.15/binutils-2.15/ld/configure: line 4417: flex: command not found

Origin of this is line 4417 in ld/configure:
test -n "$LEX" || LEX=""$missing_dir/missing flex""

AFAIS, the LEX="".."" assignement is not quoted correctly.

Furthermore, comparing automake-1.4's aclocal-1.4/lex.m4 against
automake-1.5's aclocal-1.5/lex.m4 indicates this to be a known bug in
automake:

--- /usr/share/aclocal-1.4/lex.m4       2003-04-26 01:01:45.000000000 +0200
+++ /usr/share/aclocal-1.5/lex.m4       2003-06-06 23:53:29.000000000 +0200
@@ -1,10 +1,10 @@
 ## Replacement for AC_PROG_LEX and AC_DECL_YYTEXT
 ## by Alexandre Oliva <oliva@dcc.unicamp.br>
  
-dnl AM_PROG_LEX
-dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
+# AM_PROG_LEX
+# Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
 AC_DEFUN([AM_PROG_LEX],
-[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
-AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+AC_CHECK_PROGS(LEX, flex lex, [${am_missing_run}flex])
 AC_PROG_LEX
 AC_DECL_YYTEXT])

=> I tripped a bug in the version of automake being used by ld's
configuration.

Potential fixes could be 
* to hack the lex.m4 of the automake you seem to be using for ld.
(1.4p5; The bug still seems to be present in the 1.4p6 shipped with FC1)

Changing lex.m4 this way probably will help:
-AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
+AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex])

* to upgrade to a newer automake.


Ralf




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]