A tarball of current GNU Bison from git, created with "make distcheck"
on a GNU system, fails to build on mingw (and likewise on MSVC):
$ make
CCLD src/bison.exe
GEN ../doc/bison.help
GEN ../doc/cross-options.texi
MAKEINFO ../doc/bison.info
/cygdrive/d/a/ci-check/ci-check/bison-3.8.2.62-c1144-2025-08-10/build-aux/missing:
line 81: makeinfo: command not found
WARNING: 'makeinfo' is missing on your system.
You should only need it if you modified a '.texi' file, or
any other file indirectly affecting the aspect of the manual.
You might want to install the Texinfo package:
<https://www.gnu.org/software/texinfo/>
The spurious makeinfo call might also be the consequence of
using a buggy 'make' (AIX, DU, IRIX), in which case you might
want to install GNU make:
<https://www.gnu.org/software/make/>
make[2]: *** [Makefile:11454: ../doc/bison.info] Error 127
make[2]: Leaving directory
'/cygdrive/d/a/ci-check/ci-check/bison-3.8.2.62-c1144-2025-08-10/build'
make[1]: *** [Makefile:12249: all-recursive] Error 1
make[1]: Leaving directory
'/cygdrive/d/a/ci-check/ci-check/bison-3.8.2.62-c1144-2025-08-10/build'
make: *** [Makefile:4945: all] Error 2
The cause is that
1) the output 'bison --help' contains CRLF newlines rather than LF
newlines as in Unix environments,
2) the Makefile decides, depending on this output, whether bison.info
needs to be remade.
1) is normal. A program compiled for mingw _should_ have CRLFs in its
textual output (--help, --version, stderr etc.).
2) is what needs to be fixed.
Find attached a fix. (Not using the 'nlcanon' module from Gnulib since it
would be overkill for this simple situation.)
This is my last patch in this series. With it, "make" passes on native
Windows. "make check" doesn't pass, in particular because the test suite
passes Cygwin-style file names to a 'bison.exe' executable that expects
native Windows file names. A certain amount of added "cygpath -w" conversions
in the test suite could fix that, but I'm not in the mood for it.
>From 1de80e7e0059d99376c110cf67edf4e6b4d192f1 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 10 Aug 2025 08:42:49 +0200
Subject: [PATCH] build: Fix build failure on native Windows.
* doc/local.mk ($(top_srcdir)/%D%/bison.help): Normalize newlines before
comparing with the previous 'bison --help' output.
---
doc/local.mk | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/doc/local.mk b/doc/local.mk
index 5895916e..4a83695c 100644
--- a/doc/local.mk
+++ b/doc/local.mk
@@ -118,7 +118,10 @@ $(top_srcdir)/%D%/bison.help: src/bison$(EXEEXT)
## Avoid variations in the output depending on whether we are
## on a glibc system.
-e '/translation bugs/d' >>%D%/bison.help.tmp
- $(AM_V_at)$(top_srcdir)/build-aux/move-if-change %D%/bison.help.tmp $@
+## Normalize newlines on native Windows.
+ $(AM_V_at)tr -d '\r' <%D%/bison.help.tmp > %D%/bison.help.tmq
+ $(AM_V_at)rm -f %D%/bison.help.tmp
+ $(AM_V_at)$(top_srcdir)/build-aux/move-if-change %D%/bison.help.tmq $@
endif ! CROSS_COMPILING
--
2.50.1