summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-07-16 09:46:28 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-07-16 09:49:14 -0700
commiteb4a1d7fafde8e6d00ab0db3ea369c3927754e21 (patch)
tree929147c7247eafa549e45c267eeafcecefa7ee02
parent6677262915917e84a2d12775c176ee0c3d2edaf9 (diff)
downloadautoconf-eb4a1d7fafde8e6d00ab0db3ea369c3927754e21.tar.gz
Fix AC_PROG_LEX regression
Problem reported by Ross Burton in: https://savannah.gnu.org/support/?110269 * lib/autoconf/programs.m4 (_AC_PROG_LEX_YYTEXT_DECL): If tests indicate that LEX or LEXLIB does not work, set LEX to ":" and LEXLIB empty, instead of failing out of 'configure' entirely.
-rw-r--r--lib/autoconf/programs.m413
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4
index 43f3b14e..4f910fb0 100644
--- a/lib/autoconf/programs.m4
+++ b/lib/autoconf/programs.m4
@@ -740,15 +740,17 @@ main (void)
return ! yylex () + ! yywrap ();
}
]_ACEOF
-_AC_DO_VAR(LEX conftest.l)
AC_CACHE_CHECK([for lex output file root], [ac_cv_prog_lex_root], [
+ac_cv_prog_lex_root=unknown
+_AC_DO_VAR(LEX conftest.l) &&
if test -f lex.yy.c; then
ac_cv_prog_lex_root=lex.yy
elif test -f lexyy.c; then
ac_cv_prog_lex_root=lexyy
-else
- AC_MSG_ERROR([cannot find output from $LEX; giving up])
fi])
+AS_IF([test "$ac_cv_prog_lex_root" = unknown],
+ [AC_MSG_WARN([cannot find output from $LEX; giving up on $LEX])
+ LEX=: LEXLIB=])
AC_SUBST([LEX_OUTPUT_ROOT], [$ac_cv_prog_lex_root])dnl
AS_VAR_SET_IF([LEXLIB], [], [
@@ -765,13 +767,15 @@ AS_VAR_SET_IF([LEXLIB], [], [
])
AS_IF(
[test "$ac_cv_lib_lex" = 'not found'],
- [AC_MSG_ERROR([required lex library not found])],
+ [AC_MSG_WARN([required lex library not found; giving up on $LEX])
+ LEX=: LEXLIB=],
[test "$ac_cv_lib_lex" = 'none needed'],
[LEXLIB=''],
[LEXLIB=$ac_cv_lib_lex])
])
AC_SUBST(LEXLIB)
+AS_IF([test "$LEX" != :], [
AC_CACHE_CHECK(whether yytext is a pointer, ac_cv_prog_lex_yytext_pointer,
[# POSIX says lex can declare yytext either as a pointer or an array; the
# default is implementation-dependent. Figure out which it is, since
@@ -791,6 +795,7 @@ if test $ac_cv_prog_lex_yytext_pointer = yes; then
[Define to 1 if `lex' declares `yytext' as a `char *' by default,
not a `char[]'.])
fi
+])
rm -f conftest.l $LEX_OUTPUT_ROOT.c
])# _AC_PROG_LEX_YYTEXT_DECL