]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: Fix various 'flex' compilation issues
authorMathieu Lirzin <mthl@gnu.org>
Thu, 18 Jan 2018 22:51:49 +0000 (23:51 +0100)
committerMathieu Lirzin <mthl@gnu.org>
Fri, 19 Jan 2018 00:22:11 +0000 (01:22 +0100)
* t/lex-clean-cxx.sh (parsefoo.lxx): Declare 'yylex':
(mainfoo.cc): Make declaration compatible with C++.
* t/lex-depend-cxx.sh (joe.ll): Declare 'yylex'.
* t/silent-many-languages.sh (Makefile.am, sub/Makefile.am): Link -lfl only
with 'fo2' and 'sub/ba2' which are the only program needing it.
(foo5.l): Define 'isatty'.
(foo6.y): Declare 'yylex'.

t/lex-clean-cxx.sh
t/lex-depend-cxx.sh
t/silent-many-languages.sh

index 838e80380a28536fceabfe597e8c31500958e95e..9b27319adbc513c4b5c4903002c72ccd377ecf3e 100644 (file)
@@ -53,6 +53,8 @@ END
 
 cat > parsefoo.lxx << 'END'
 %{
+#define YY_DECL int yylex (void)
+extern "C" YY_DECL;
 #define YY_NO_UNISTD_H 1
 int isatty (int fd) { return 0; }
 %}
@@ -69,10 +71,10 @@ cp parsefoo.lxx parsebar.ll
 
 cat > mainfoo.cc << 'END'
 // This file should contain valid C++ but invalid C.
+extern "C" int yylex (void);
 using namespace std;
 int main (int argc, char **argv)
 {
-  extern int yylex (void);
   return yylex ();
 }
 END
index d8b7887be08ce8749a6f735d083e13b669c5f040..b6efeb02f3650a293ef5131ff9356dfbb5cbdf2d 100644 (file)
@@ -46,6 +46,8 @@ END
 
 cat > joe.ll << 'END'
 %{
+#define YY_DECL int yylex (void)
+extern "C" YY_DECL;
 #define YY_NO_UNISTD_H 1
 int isatty (int fd) { return 0; }
 %}
index 3fd8638194510d84741c53cd58790afc9f4a2575..487ce9285f8ef6efb1278b1fb6f0f5d7b99a4e33 100644 (file)
@@ -131,9 +131,9 @@ fo2_FFLAGS = $(AM_FFLAGS)
 fo2_FCFLAGS = $(AM_FCFLAGS)
 fo2_YFLAGS = -v
 fo2_LFLAGS = -n
+fo2_LDADD = $(LEXLIB)
 SUBDIRS = sub
 AM_YFLAGS = -d
-LDADD = $(LEXLIB)
 BUILT_SOURCES = foo6.h
 EOF
 
@@ -149,8 +149,8 @@ ba2_FFLAGS = $(AM_FFLAGS)
 ba2_FCFLAGS = $(AM_FCFLAGS)
 ba2_YFLAGS = -v
 ba2_LFLAGS = -n
+ba2_LDADD = $(LEXLIB)
 AM_YFLAGS = -d
-LDADD = $(LEXLIB)
 BUILT_SOURCES = baz6.h
 EOF
 
@@ -173,6 +173,7 @@ EOF
 cat > foo5.l <<'EOF'
 %{
 #define YY_NO_UNISTD_H 1
+int isatty (int fd) { return 0; }
 %}
 %%
 "END"   return EOF;
@@ -186,6 +187,7 @@ int yywrap (void)
 EOF
 cat > foo6.y <<'EOF'
 %{
+extern int yylex (void);
 void yyerror (char *s) {}
 %}
 %token EOF