summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2018-01-18 23:51:49 +0100
committerMathieu Lirzin <mthl@gnu.org>2018-01-19 01:22:11 +0100
commit826408a7f6ca4c39ff7b7ac9952c05f48110748f (patch)
treeb960ae730d576c6a00ceef9a7023c08ba8b746b4
parent74f779b520da95224ec6e7f36fb033f3698661b9 (diff)
downloadautomake-826408a7f6ca4c39ff7b7ac9952c05f48110748f.tar.gz
tests: Fix various 'flex' compilation issues
* 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'.
-rw-r--r--t/lex-clean-cxx.sh4
-rw-r--r--t/lex-depend-cxx.sh2
-rw-r--r--t/silent-many-languages.sh6
3 files changed, 9 insertions, 3 deletions
diff --git a/t/lex-clean-cxx.sh b/t/lex-clean-cxx.sh
index 838e80380..9b27319ad 100644
--- a/t/lex-clean-cxx.sh
+++ b/t/lex-clean-cxx.sh
@@ -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
diff --git a/t/lex-depend-cxx.sh b/t/lex-depend-cxx.sh
index d8b7887be..b6efeb02f 100644
--- a/t/lex-depend-cxx.sh
+++ b/t/lex-depend-cxx.sh
@@ -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; }
%}
diff --git a/t/silent-many-languages.sh b/t/silent-many-languages.sh
index 3fd863819..487ce9285 100644
--- a/t/silent-many-languages.sh
+++ b/t/silent-many-languages.sh
@@ -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