* 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'.
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; }
%}
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
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; }
%}
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
ba2_FCFLAGS = $(AM_FCFLAGS)
ba2_YFLAGS = -v
ba2_LFLAGS = -n
+ba2_LDADD = $(LEXLIB)
AM_YFLAGS = -d
-LDADD = $(LEXLIB)
BUILT_SOURCES = baz6.h
EOF
cat > foo5.l <<'EOF'
%{
#define YY_NO_UNISTD_H 1
+int isatty (int fd) { return 0; }
%}
%%
"END" return EOF;
EOF
cat > foo6.y <<'EOF'
%{
+extern int yylex (void);
void yyerror (char *s) {}
%}
%token EOF