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.
This commit is contained in:
Akim Demaille
2020-05-03 09:51:18 +02:00
parent ccaa8e29f9
commit 392f3caef6
4 changed files with 22 additions and 5 deletions

View File

@@ -261,9 +261,8 @@ if ! "$LEX_IS_FLEX" || test "X$LEX" = X:; then
AC_MSG_WARN([bypassing lex because flex is required])
LEX=:
fi
AM_CONDITIONAL([FLEX_WORKS], [$LEX_IS_FLEX])
AM_CONDITIONAL([FLEX_CXX_WORKS],
[$LEX_IS_FLEX && test $bison_cv_cxx_works = yes])
AM_CONDITIONAL([FLEX_WORKS], [$LEX_IS_FLEX && $FLEX_SUPPORTS_HEADER_OPT])
AM_CONDITIONAL([FLEX_CXX_WORKS], [$LEX_WORKS && test $bison_cv_cxx_works = yes])
AC_PROG_YACC
AC_PROG_RANLIB
AC_PROG_GNU_M4