m4-not-needed

Torbjorn Granlund tg at gmplib.org
Sat Dec 11 17:16:23 CET 2010


Emmanuel Thomé <Emmanuel.Thome at gmail.com> writes:

  When gmp is configured with no assembly, as is done e.g. when gcc is
  compiled with the gmp source present, the following environment variable
  gets set from within ./configure:
  
      M4=m4-not-needed
  
  Indeed, as there is no assembly code to manipulate with m4, m4 is not
  needed.
  
  However, the M4 variable seems to have an unfortunate effect on flex:
  
  ethome at suno-7:/tmp/gcc-build/gmp$ M4=m4-not-needed flex conftest.l 
  flex: fatal internal error, exec failed
  
  (where conftest.l is the one from the gmp configure, for that matter).
  
Is flex run from within GMP, or is the M4 setting somehow inherited out
from GMP?

  Under *some* circumstances (I come across this deterministically while
  running a gcc compile from a batch job, however I haven't been able to
  reproduce it live), it leads to lex.yy.c not being created, eventually
  causing the configure script to abort (possibly a sigpipe/wait/unlink
  race).
  
I think you have different PATHs in your batch job and 'live', and thus
find different flex commands.

  I see that the mercurial code now leaves the variable M4 untouched in
  case it already exists, which seems more reasonable than overriding it
  with bogus content unconditionally. However I wonder why gmp touches the
  M4 variable in the first place in this case. May I suggest leaving this
  variable untouched instead ? Or is there a compelling reason for setting
  m4-not-needed ?
  
I don't recall why this was made, and I cannot find any helpful
ChangeLog entry.

-- 
Torbjörn


More information about the gmp-bugs mailing list