bug-bison
[Top][All Lists]
Advanced

[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: Sun, 19 May 2019 18:46:10 +0200

Hi Bruno,

Thanks for the report!

> Le 19 mai 2019 à 15:11, Bruno Haible <address@hidden> a écrit :
> 
> Hi Akim,
> 
>  $ make check V=1 2>&1 | tee log3a

This shows:

> /bin/sh ./build-aux/ylwrap `test -f 'examples/c/lexcalc/scan.l' || echo 
> './'`examples/c/lexcalc/scan.l lex.yy.c examples/c/lexcalc/scan.c -- :  

so LEX appears to be `:`, which is coming from configure.ac:

> $LEX_IS_FLEX || test "X$LEX" = X: || {
>   AC_MSG_WARN([bypassing lex because flex is required])
>   LEX=:
> }

Flex should not be needed to build Bison, hence that bit.  But the examples 
that do depend on Flex should definitely skip this.

With the following change, I could './configure LEX=false && make && make 
check' successfully.  Does it work for you?

commit 1934304acf6be6da3b44b65630d734cad6de1b03
Author: Akim Demaille <address@hidden>
Date:   Sun May 19 18:38:02 2019 +0200

    examples: don't run those that require f?lex when it's not available
    
    Reported by Bruno Haible.
    http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00026.html
    
    * configure.ac (FLEX_WORKS): New.
    * examples/c/lexcalc/local.mk, examples/c/reccalc/local.mk: Use it.

diff --git a/configure.ac b/configure.ac
index 38c5683c..83e2c972 100644
--- a/configure.ac
+++ b/configure.ac
@@ -215,6 +215,7 @@ $LEX_IS_FLEX || test "X$LEX" = X: || {
   AC_MSG_WARN([bypassing lex because flex is required])
   LEX=:
 }
+AM_CONDITIONAL([FLEX_WORKS], [$LEX_IS_FLEX])
 AM_CONDITIONAL([FLEX_CXX_WORKS],
   [$LEX_IS_FLEX && test $bison_cv_cxx_works = yes])
 AC_PROG_YACC
diff --git a/examples/c/lexcalc/local.mk b/examples/c/lexcalc/local.mk
index 64cbc9fe..2cd0d647 100644
--- a/examples/c/lexcalc/local.mk
+++ b/examples/c/lexcalc/local.mk
@@ -19,15 +19,17 @@ lexcalcdir = $(docdir)/%D%
 ## Calc.  ##
 ## ------ ##
 
-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
-%D%/parse.c: $(dependencies)
+if FLEX_WORKS
+  check_PROGRAMS += %D%/lexcalc
+  TESTS += %D%/lexcalc.test
+  nodist_%C%_lexcalc_SOURCES = %D%/parse.y %D%/parse.h %D%/scan.l
+  # Don't use gnulib's system headers.
+  %C%_lexcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
+endif FLEX_WORKS
 
-# Don't use gnulib's system headers.
-%C%_lexcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
+%D%/parse.c: $(dependencies)
 
+EXTRA_DIST += %D%/lexcalc.test
 dist_lexcalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
 CLEANFILES += %D%/parse.[ch] %D%/scan.c %D%/parse.output
 CLEANDIRS += %D%/*.dSYM
diff --git a/examples/c/reccalc/local.mk b/examples/c/reccalc/local.mk
index 2fc2bccb..4515f228 100644
--- a/examples/c/reccalc/local.mk
+++ b/examples/c/reccalc/local.mk
@@ -19,11 +19,15 @@ reccalcdir = $(docdir)/%D%
 ## Calc.  ##
 ## ------ ##
 
-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)
+if FLEX_WORKS
+  check_PROGRAMS += %D%/reccalc
+  TESTS += %D%/reccalc.test
+  nodist_%C%_reccalc_SOURCES = %D%/parse.y %D%/scan.h %D%/scan.c
+  BUILT_SOURCES += $(nodist_%C%_reccalc_SOURCES)
+  # Don't use gnulib's system headers.
+  %C%_reccalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
+endif FLEX_WORKS
+
 %D%/parse.c: $(dependencies)
 
 # Tell Make that parse.o depends on scan.h, so that scan.h is built
@@ -44,9 +48,8 @@ DASH = -
        $(AM_V_at)$(LEX) -o%D%/scan.c --header-file=%D%/scan.h 
$(srcdir)/%D%/scan.l
        $(AM_V_at)mv address@hidden $@
 
-# Don't use gnulib's system headers.
-%C%_reccalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
 
+EXTRA_DIST += %D%/reccalc.test %D%/scan.l
 dist_reccalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
 CLEANFILES += %D%/parse.[ch] %D%/parse.output %D%/scan.[ch] %D%/*.stamp
 CLEANDIRS += %D%/*.dSYM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]