bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFC: build: be robust to missing flex


From: Akim Demaille
Subject: RFC: build: be robust to missing flex
Date: Tue, 27 Mar 2012 15:21:00 +0200

I have pushed the following in next, to see what Hydra
thinks about it (the bison-next build does not have
flex available, so it's a perfect place to try this),
but the build does not start.

This patch addresses two different issues:
- actually lex does not suffice, we want flex, so use missing
- if flex is not available, we cannot compile calc++ at all
  (since the compilation of the examples is completely user
  side).

To be applied soon.

From 7998f53250d62f332a95eb195efdbea4d164ebee Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Tue, 27 Mar 2012 08:22:49 +0200
Subject: [PATCH] build: be robust to missing flex.

* configure.ac: We need flex to build bison, lex does not suffice,
so use "missing flex" as back-up
(HAVE_FLEX): New AM conditional.
* examples/calc++/local.mk: Cannot work at all without Flex.
---
 configure.ac             |    9 +++++++++
 examples/calc++/local.mk |    4 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 622da5d..c998d58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,14 @@ AC_SUBST([YACC_LIBRARY])
 
 # Checks for programs.
 AC_PROG_LEX
+if `$LEX --version` 2>/dev/null | grep flex; then
+  have_flex=true
+else
+  have_flex=false
+  LEX="$SHELL $missing_dir/missing flex"
+  AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy])dnl
+  AC_SUBST([LEXLIB], [''])dnl
+fi
 AC_PROG_YACC
 AC_PROG_RANLIB
 AC_PROG_GNU_M4
@@ -156,6 +164,7 @@ AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
 AC_CONFIG_TESTDIR(tests)
 AC_CONFIG_FILES([tests/atlocal])
 AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
+AM_CONDITIONAL([HAVE_FLEX], [$have_flex])
 AC_CHECK_PROGS([VALGRIND], [valgrind])
 AC_PROG_CXX
 BISON_TEST_FOR_WORKING_CXX_COMPILER
diff --git a/examples/calc++/local.mk b/examples/calc++/local.mk
index 16f49c4..af9e612 100644
--- a/examples/calc++/local.mk
+++ b/examples/calc++/local.mk
@@ -64,10 +64,12 @@ calc_sources =                                      \
   $(calc_sources_generated)
 
 if BISON_CXX_WORKS
+if  HAVE_FLEX
 check_PROGRAMS += examples/calc++/calc++
 nodist_examples_calc___calc___SOURCES =                \
   $(calc_sources)
 
 examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++
 dist_TESTS += examples/calc++/calc++.test
-endif
+endif  HAVE_FLEX
+endif BISON_CXX_WORKS
-- 
1.7.9.4





reply via email to

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