[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cannot build bison-3.3.90 on Solaris 11.3, even with GNU m4
From: |
Akim Demaille |
Subject: |
Re: cannot build bison-3.3.90 on Solaris 11.3, even with GNU m4 |
Date: |
Wed, 8 May 2019 19:03:18 +0200 |
Hi Bruno,
Thanks for the report!
> Le 5 mai 2019 à 11:30, Bruno Haible <address@hidden> a écrit :
>
> After installing GNU m4 1.4.18, bison 3.3.90 builds but "make check"
> (or "gmake check") fails. See the attached log files.
> log1 - configure
> log2 - make
> log3 - make check
So the problem is (log3):
> CC examples/c/lexcalc/lexcalc-scan.o
> gcc: error: ../examples/c/lexcalc/scan.c: No such file or directory
> gcc: fatal error: no input files
> compilation terminated.
which shows that the scanner was compiled before the parser was
generated, and since the scanner uses parse.h, it fails.
I expect the appended patch to fix your issue. Could you
please give it a try? A tarball with it is available here:
https://www.lrde.epita.fr/~akim/private/bison/bison-3.3.90.16-25dc.tar.gz
https://www.lrde.epita.fr/~akim/private/bison/bison-3.3.90.16-25dc.tar.xz
commit 25dcba664c9d2832d768e297e6851bba20c6dd45
Author: Akim Demaille <address@hidden>
Date: Wed May 8 18:25:23 2019 +0200
build: make sure parse.h is generated before using it
"make check" fails with Solaris' make, because it compiles the scanner
before parse.h is generated.
Reported by Bruno Haible.
http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00001.html
* examples/c/lexcalc/local.mk (%C%_lexcalc_DEPENDENCIES):
We need parse.h.
* examples/c/reccalc/local.mk: Likewise.
(BUILT_SOURCES): Remove.
diff --git a/examples/c/lexcalc/local.mk b/examples/c/lexcalc/local.mk
index 64cbc9fe..8f324c83 100644
--- a/examples/c/lexcalc/local.mk
+++ b/examples/c/lexcalc/local.mk
@@ -15,15 +15,20 @@
lexcalcdir = $(docdir)/%D%
-## ------ ##
-## Calc. ##
-## ------ ##
+## --------- ##
+## LexCalc. ##
+## --------- ##
check_PROGRAMS += %D%/lexcalc
TESTS += %D%/lexcalc.test
EXTRA_DIST += %D%/lexcalc.test
-nodist_%C%_lexcalc_SOURCES = %D%/parse.y %D%/parse.h %D%/scan.l
+nodist_%C%_lexcalc_SOURCES = %D%/parse.y %D%/scan.l
%D%/parse.c: $(dependencies)
+# Make sure parse.h is created before compiling the scanner. Don't
+# use BUILT_SOURCES, since we want to use this bison. Refer to
+# parse.c, not parse.h, since Automake's dependencies don't see that
+# parse.h comes from parse.y.
+%C%_lexcalc_DEPENDENCIES = %D%/parse.c
# Don't use gnulib's system headers.
%C%_lexcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
diff --git a/examples/c/reccalc/local.mk b/examples/c/reccalc/local.mk
index 85296b83..88dc55a5 100644
--- a/examples/c/reccalc/local.mk
+++ b/examples/c/reccalc/local.mk
@@ -15,16 +15,20 @@
reccalcdir = $(docdir)/%D%
-## ------ ##
-## Calc. ##
-## ------ ##
+## --------- ##
+## RecCalc. ##
+## --------- ##
check_PROGRAMS += %D%/reccalc
TESTS += %D%/reccalc.test
EXTRA_DIST += %D%/reccalc.test %D%/scan.l
nodist_%C%_reccalc_SOURCES = %D%/parse.y %D%/scan.h %D%/scan.c
-BUILT_SOURCES += $(nodist_%C%_reccalc_SOURCES)
%D%/parse.c: $(dependencies)
+# Make sure parse.h is created before compiling the scanner. Don't
+# use BUILT_SOURCES, since we want to use this bison. Refer to
+# parse.c, not parse.h, since Automake's dependencies don't see that
+# parse.h comes from parse.y.
+%C%_reccalc_DEPENDENCIES = %D%/parse.c
# Tell Make that parse.o depends on scan.h, so that scan.h is built
# before parse.o. Obfuscate the name of the target, otherwise
- Re: cannot build bison-3.3.90 on Solaris 11.3, even with GNU m4,
Akim Demaille <=