Hi Bernd,

On Thu, 2014-11-20 14:34:00 +0100, Bernd Edlinger <bernd.edlin...@hotmail.de> 
wrote:
> > This patch updates the files taken from Automake.  Committed.
>
> the updated version of "missing" will confuse the gmp-4.3.2 configure
> script if it is installed in-tree with "contrib/download_prerequisites"
> and flex is not installed:
> 
> ...
> checking readline detected... no
> checking for bison... (cached) /home/ed/gnu/gcc-5-20141116/missing bison -y
> checking for flex... (cached) /home/ed/gnu/gcc-5-20141116/missing flex
> checking lex output file root... configure: error: cannot find output from 
> /home/ed/gnu/gcc-5-20141116/missing flex; giving up
> make[3]: *** [config.status] Error 1
> make[3]: Leaving directory `/home/ed/gnu/gcc-build-arm-linux-gnueabihf/gmp'
> make[2]: *** [all-stage1-gmp] Error 2
> make[2]: Leaving directory `/home/ed/gnu/gcc-build-arm-linux-gnueabihf'
> make[1]: *** [stage1-bubble] Error 2
> make[1]: Leaving directory `/home/ed/gnu/gcc-build-arm-linux-gnueabihf'
> make: *** [all] Error 2
> 
> previous version of missing flex produced a dummy lex.yy.c,
> as does the version in the gmp package, but unfortunately it is
> overwritten by the "missing" script in the gcc tree.

"Overridden" actually by setting/exporting $FLEX and $LEX to GCC's own
file and calling GMP's `configure' that way.

> That's probably just not a supported configuration anymore,
> but all previous GCC releases worked without a installed flex tool.

I don't think something change wrt. the GMP version, see
https://gcc.gnu.org/install/prerequisites.html. (And it's the same problem with
current gmp-6.0.0a, so even updating GMP wouldn't help.)

> mAYBE the problem goes away if a newer version of gmp is used,
> or if the "missing flex" is not passed down to the gmp configure script,
> somehow.  Actually, it is not really needed by gmp at all.

It seems the only flex'able source file (in both GMP-4.3.2 and current
6.0.0a) is a demo file.

> I tried to add this hunk from the old version and it made, the gmp configure
> script worked again:
> 
> --- missing.orig      2014-11-16 14:07:13.000000000 +0000
> +++ missing   2014-11-19 15:01:57.168967538 +0000
> @@ -172,6 +172,21 @@
>        echo "You should only need it if you modified a '.l' file."
>        echo "You may want to install the Fast Lexical Analyzer package:"
>        echo "<$flex_URL>"
> +      rm -f lex.yy.c
> +      if test $# -ne 1; then
> +        eval LASTARG="\${$#}"
> +        case $LASTARG in
> +        *.l)
> +          SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
> +          if test -f "$SRCFILE"; then
> +              cp "$SRCFILE" lex.yy.c
> +          fi
> +        ;;
> +        esac
> +      fi
> +      if test ! -f lex.yy.c; then
> +          echo 'main() { return 0; }'>lex.yy.c
> +      fi
>        ;;
>      help2man*)
>        echo "You should only need it if you modified a dependency" \
> 
> 
> What do you think?

That patch defeats my attempt to re-sync with upstream files. :)  The
Automake guys decided that faking a tool by simulating a successful
run isn't that much of a good idea, and thinking about it, this looks
like a good decision.

  I actually kind of think that this is simply a small bug in GMP. It
shouldn't require a working flex just for potentially building some
demo file. After all, the release tarballs could just contain the .c
file. No need for the lex file at all!

  However, I *think* the real problem is the way flags are passed.
Top-level `configure' doesn't find `flex' (okay) and sets
FLEX="...../missing flex". This $FLEX gets passed by Makefile down to
GMP's `configure', which by now should, IMO, point to a /working/
flex. That way, GMP's `configure' of course will choke finding the
generated output file.

  So what shall we do now?  I'd be quite okay with reverting my
`missing' update for now, until this is actually fixed. However, It
would be nice if we'd discuss that, along with the GMP guys.

  Another fix (or is it a workaround?) would be to not hand down $FLEX
and $LEX:

diff --git a/Makefile.def b/Makefile.def
index 40bbca9..7b988fe 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -229,13 +229,11 @@ flags_to_pass = { flag= CC_FOR_BUILD ; };
 flags_to_pass = { flag= CFLAGS_FOR_BUILD ; };
 flags_to_pass = { flag= CXX_FOR_BUILD ; };
 flags_to_pass = { flag= EXPECT ; };
-flags_to_pass = { flag= FLEX ; };
 flags_to_pass = { flag= INSTALL ; };
 flags_to_pass = { flag= INSTALL_DATA ; };
 flags_to_pass = { flag= INSTALL_PROGRAM ; };
 flags_to_pass = { flag= INSTALL_SCRIPT ; };
 flags_to_pass = { flag= LDFLAGS_FOR_BUILD ; };
-flags_to_pass = { flag= LEX ; };
 flags_to_pass = { flag= M4 ; };
 flags_to_pass = { flag= MAKE ; };
 flags_to_pass = { flag= RUNTEST ; };

(...and regenerate Makefile{,.in}.)


  However, we need to discuss that. I'll head over to the GMP bugs
mailing list and discuss your build error over there.

MfG, JBG

-- 
      Jan-Benedict Glaw      jbg...@lug-owl.de              +49-172-7608481
Signature of:                 Friends are relatives you make for yourself.
the second  :

Attachment: signature.asc
Description: Digital signature

Reply via email to