gmp/configure within gcc tree vs. flex/m4

Jay jayk123 at hotmail.com
Thu Jul 31 13:06:53 CEST 2008


Hi.

When you stick the gmp source into the gcc tree, gcc
configures gmp such that processor=none.
(I have reported this to gcc folks, perhaps they shouldn't
configure this way? But the larger/clearer problem seems
to be in gmp/configure, not gcc/configure.)

This leads to gmp/configure setting M4=m4-not-needed.

Then gmp/configure runs flex.

Flex sometimes?always runs m4 -- getenv("M4") || "m4".

The attempt to run "m4-not-needed" fails.

Sometimes lex.yy.c has been created, sometimes not.
I'm not sure why "sometimes".

In any case, don't you think maybe setting M4=m4-not-needed
is not a great idea here?

Yacc/lex should be probed for earlier?
Or $M4 cleared once configure is done with it?
Or use a different variable name -- GMP_CONFIGURE_M4?
Or something?

I'm on Cygwin.
With gcc 4.3.1, gmp 4.2.2.

With a gcc source tree with gmp in it, this Python reproduces
the problem.

#! /usr/bin/env python

import os
import sys

def Run(Directory, Command):

    sys.stderr.flush()
    sys.stdout.flush()

    print("cd " + Directory + " && " + Command)

    PreviousDirectory = os.getcwd()
    os.chdir(Directory)

    if os.name == "nt":
        Command = "sh -c \"" + Command + "\""

    sys.stderr.flush()
    sys.stdout.flush()

    ExitCode = os.system(Command)
    os.chdir(PreviousDirectory)

    sys.stderr.flush()
    sys.stdout.flush()

    if ExitCode != 0:
        sys.exit(ExitCode)

if not os.path.isdir("./obj"):
    Run(".", "mkdir ./obj")

if not os.path.isfile("./obj/Makefile"):
    Run("./obj", "../gcc/configure")

Run(".", "rm -rf ./obj/gmp")
Run("./obj", "make configure-gmp")

The "same" thing outside of Python works ok.
I'm still debugging that.
Flex's run of m4 fails either way, but lex.yy.c is created vs. not.

Thanks,
 - Jay


More information about the gmp-bugs mailing list