gmp/configure cpu=none vs. m4 vs. flex

Jay jayk123 at hotmail.com
Wed Aug 6 12:29:45 CEST 2008


Please, in gmp/configure.in:


# Don't demand an m4 unless it's actually needed.
if test $found_asm = yes; then
  GMP_PROG_M4
  GMP_M4_M4WRAP_SPURIOUS
else
  M4=m4-not-needed
fi

Either:
 a) get rid of the else entirely
 b) set M4=m4
 c) move this to after AM_PROG_LEX

It's quite gross what ends up happening asis.
  If you put the gmp source in the gcc tree and end up with cpu=none.
Flex tries to run m4-not-needed. That fails. It prints an error even.
Normally, flex then does a read or write that generates sigpipe and flex dies.
Leaving an empty lex.yy.c for gmp/configure to sniff the name of.
However, if you wrap up your build in Python, as I am doing,
Python, perhaps buggily, does:

 signal(SIGPIPE, SIG_IGN);


so flex gets an error instead of a signal, continues on, and deletes lex.yy.c,
leading to

  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up">&5
echo "$as_me: error: cannot find output from $LEX; giving up">&2;}

A simple repro/simulation is:

echo %%> 1.l
echo %%>>1.l

and run this program:

  #include 
  #include 

  int main()
  {
     signal(SIGPIPE, SIG_IGN);
     putenv("M4=foo");
     system("flex 1.l");
     return 0;
  }

mail keeps removing the includes, they are stdlib.h and signal.h.


 Or, get gcc, put gmp in there, and like  
  mkdir /obj  
  cd /obj  
  python -c "import os;os.system('../gcc/configure && make')" 

it'll take a while longer, but you'll get the above error.

It works on Windows with Win32 Python.
But fails with Cygwin Python or any Posix Python.


Thanks,
  -Jay


More information about the gmp-bugs mailing list