autoconf-patches
[Top][All Lists]
Advanced

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

[PATCH] Be more lenient in what is accepted in _AC_PROG_LEX_YYTEXT_DECL


From: Ross Burton
Subject: [PATCH] Be more lenient in what is accepted in _AC_PROG_LEX_YYTEXT_DECL
Date: Thu, 16 Jul 2020 17:25:44 +0100

From: Ross Burton <ross.burton@arm.com>

Most users of flex provide their own implementation of yywrap instead of
linking to libfl.so, which simply provides stub main() and yywrap()
implementations.

However the recent change 'Fix logic error in _AC_PROG_LEX_YYTEXT_DECL
(#109320)' means that the flex tool being present but not libfl.so
(which is easy in cross-compilation environments) resullts in
AC_PROG_LEX failing, because the test lexer doesn't provide yywrap().

Add a minimal yywrap() to the test lexer so that the test case is
standalone and correctly uses lexes which don't *need* a separate
library to work (such as flex).
---
 lib/autoconf/programs.m4 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4
index 9deb62e8..c11ea62d 100644
--- a/lib/autoconf/programs.m4
+++ b/lib/autoconf/programs.m4
@@ -739,6 +739,11 @@ main (void)
 {
   return ! yylex () + ! yywrap ();
 }
+int
+yywrap (void)
+{
+  return 1;
+}
 ]_ACEOF
 _AC_DO_VAR(LEX conftest.l)
 AC_CACHE_CHECK([for lex output file root], [ac_cv_prog_lex_root], [
-- 
2.26.2




reply via email to

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