This change fixes automake bug#11185.
The commit
v1.11-2058-g6f4b08d of 06-03-2012, "tests: explicitly
state that our lexers do not require unistd.h" has broken the tests
'lex-clean-cxx.test' and 'lex-depend-cxx.test' on Solaris, where lex
is not flex and does not understand the "%option never-interactive"
directive. Remove the use of this directive, resorting to defining
a dummy 'isatty()' function instead to keep the flex-generated tests
able to compile also on MinGW/MSYS.
* tests/lex-clean-cxx.test (parsefoo.lxx): Define a dummy 'isatty()'
function.
* tests/lex-depend-cxx.test (joe.ll): Likewise.
* tests/README: Adjust. Fix an unrelated typo since we are at it.
Co-authored-by: Peter Rosin <peda@lysator.liu.se>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
%{
#define YY_NO_UNISTD_H 1
%}
- to accomodate non-ANSI systems, since GNU flex generates code that
+ to accommodate non-ANSI systems, since GNU flex generates code that
includes unistd.h otherwise. Also add:
- %option never-interactive
+ static int isatty (int fd) { return 0; }
to the definitions section if the generated code is to be compiled
by a C++ compiler, for similar reasons (i.e., the isatty(3) function
from that same unistd.h header would be required otherwise).
cat > parsefoo.lxx << 'END'
%{
#define YY_NO_UNISTD_H 1
+static int isatty (int fd) { return 0; }
%}
-%option never-interactive
%%
"GOOD" return EOF;
.
cat > joe.ll << 'END'
%{
#define YY_NO_UNISTD_H 1
+static int isatty (int fd) { return 0; }
%}
-%option never-interactive
%%
"foo" return EOF;
.