#509 Proposed bison does not build flex

bison (2)


This is not properly a bug, since bison is not supposed
to build OOTB. However it might be useful to have bison,
and there is a proposed version which can be
downloaded from sf.net; the proposed version of
bison.exe however does not find /usr/bin/m4 and fails.

small test case demonstrating the bug:

the case which I encountered is the process of building
flex.exe. Here is a little excerpt of the output:


[AVATAR:flex-2.5.4]$ ./configure --prefix=/mingw

(... all goes OK)

[AVATAR:flex-2.5.4]$ make
bison -y -d ./parse.y
C:\Development\mingw-3.1\bin\bison.exe: _spawnvp:
No such file or directory
make: *** [parse.c] Error 1


A q&d modified version of bison, which prints out argv[0]
in create_subpipe (lib/subpipe.c), reports:


[AVATAR:flex-2.5.4]$ make
bison -y -d ./parse.y
_spawnvp: /usr/bin/m4.exe: No such file or directory
make: *** [parse.c] Error 1


even specifying that m4 is /usr/bin/m4.exe instead
of /usr/bin/m4 (which actually does not exist). I think
that _spawnvp is a "true" windows function, and
therefore should not search for m4.exe in /usr/bin, but
in <drive>:\\path\\to\\mingw32\\bin! In fact, the only
way to have flex.exe working has been to hardcode (in
my case) the following line

#define M4 "C:\\Development\\msys-1.0\\bin\\m4.exe"

in the file config.h generated after bison configuration. I
could not specify something like

[AVATAR:bison-1.875]$ M4="C:\\Development\\msys-1.0
\\bin\\m4.exe" ./configure

because I get an error:


checking for gm4... C:\Development\msys-1.0
checking whether m4 supports frozen files... no
configure: error: GNU M4 1.4 is required


in the configuration phase. There should be some really
dirty hack to get the real path of a subcommand to pass
to _spawnvp, or maybe something more elegant... I do
not know absolutely the MinGW code, otherwise I would
be glad to help.

Here are some details about my installation:

OS version: XP Home
gcc version: gcc version 3.2.3 (mingw special 20030504-
ld version: GNU ld version 2.13.90 20030111
mingw version: MinGW-3.1.0-1.exe
build environment: MSYS, MINGW32_NT-5.1 AVATAR
1.0.9(0.46/3/2) 2003-07-03 07:26 i686 unknown
mingw-runtime version: 3.1
MinGW root: C:\Development\mingw-3.1
MSYS root: C:\Development\msys-1.0

Thank you for the great work,



  • Earnie Boyd

    Earnie Boyd - 2012-10-26
    • milestone: 258437 --> Aged_issue
    • status: open --> closed-out-of-date
  • Earnie Boyd

    Earnie Boyd - 2013-01-28
    • labels: non-mingw --> bison
    • status: closed-out-of-date --> closed
    • resolution: --> out-of-date
    • category: --> Unknown
    • milestone: --> OTHER