mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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:
16
m4/flex.m4
16
m4/flex.m4
@@ -41,6 +41,22 @@ else
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
AC_CACHE_CHECK([whether flex supports --header=FILE],
|
||||
[ac_cv_prog_lex_supports_header_opt],
|
||||
[if _AC_DO_VAR([LEX --header=conftest.h conftest.l]); then
|
||||
ac_cv_prog_lex_supports_header_opt=yes
|
||||
else
|
||||
ac_cv_prog_lex_supports_header_opt=no
|
||||
fi
|
||||
])
|
||||
if test "$ac_cv_prog_lex_supports_header_opt" = yes; then
|
||||
FLEX_SUPPORTS_HEADER_OPT=true
|
||||
else
|
||||
FLEX_SUPPORTS_HEADER_OPT=false
|
||||
fi
|
||||
|
||||
|
||||
cat >conftest.l <<_ACEOF[
|
||||
%%
|
||||
a { ECHO; }
|
||||
|
||||
Reference in New Issue
Block a user