summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-05-03 09:51:18 +0200
committerAkim Demaille <akim.demaille@gmail.com>2020-05-03 10:32:32 +0200
commit392f3caef6c3be1496b2e7d8377db111ca1b8e5b (patch)
tree941c95eec7aad6adade35771a00f341003a4f19d /examples
parentccaa8e29f92170a92ef2d38128d122aec59e6dbe (diff)
downloadbison-392f3caef6c3be1496b2e7d8377db111ca1b8e5b.tar.gz
examples: beware of the portability of flex --header-file
The option --header was introduced in version 2.5.6. The option --header-file was introduced in version 2.6.4. Reported by Bruno Haible. https://lists.gnu.org/r/bug-bison/2020-05/msg00013.html So use --header, and do bother with versions that don't support it. * m4/flex.m4: Check whether flex supports --header. * configure.ac (FLEX_WORKS, FLEX_CXX_WORKS): Set to false if it doesn't. * * examples/c/reccalc/local.mk, examples/c/reccalc/Makefile: Use --header rather than --header-file.
Diffstat (limited to 'examples')
-rw-r--r--examples/c/reccalc/Makefile2
-rw-r--r--examples/c/reccalc/local.mk4
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/c/reccalc/Makefile b/examples/c/reccalc/Makefile
index 84fbd3ee..a64ceedb 100644
--- a/examples/c/reccalc/Makefile
+++ b/examples/c/reccalc/Makefile
@@ -12,7 +12,7 @@ all: $(BASE)
$(BISON) $(BISONFLAGS) --defines --xml --graph=$*.gv -o $*.c $<
%.c %.h: %.l
- $(FLEX) $(FLEXFLAGS) -o$*.c --header-file=$*.h $<
+ $(FLEX) $(FLEXFLAGS) -o$*.c --header=$*.h $<
scan.o: parse.h
parse.o: scan.h
diff --git a/examples/c/reccalc/local.mk b/examples/c/reccalc/local.mk
index de889789..0538f120 100644
--- a/examples/c/reccalc/local.mk
+++ b/examples/c/reccalc/local.mk
@@ -69,7 +69,9 @@ DASH = -
$(AM_V_LEX)rm -f $@ $@.tmp
$(AM_V_at)$(MKDIR_P) %D%
$(AM_V_at)touch $@.tmp
- $(AM_V_at)$(LEX) $(AM_LFLAGS) $(LFLAGS) -o%D%/scan.c --header-file=%D%/scan.h $(srcdir)/%D%/scan.l
+## --header introduced in 2.5.6, renamed as --header-file in 2.6.4.
+## Backward compatibility ensured since --header is an unambiguous prefix.
+ $(AM_V_at)$(LEX) $(AM_LFLAGS) $(LFLAGS) -o%D%/scan.c --header=%D%/scan.h $(srcdir)/%D%/scan.l
$(AM_V_at)mv $@.tmp $@