2 # Copyright (C) 2004, 2006, 2007, 2009, 2010 Free Software Foundation,
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Verify that intermediate files are only built from Yacc and Lex
19 # sources in maintainer mode.
20 # From Derek R. Price.
27 cat >> configure.in << 'END'
35 cat > Makefile.am <<'END'
39 zardoz_SOURCES = zardoz.y joe.l
43 # The point of this test is that it is not dependent on a working lex or yacc.
50 # On systems which link in libraries non-lazily and whose linkers
51 # complain about unresolved symbols by default, such as Solaris, an
52 # yylex function needs to be defined to avoid an error due to an
60 int main (int argc, char **argv)
66 # Ensure a later timestamp for our Lex & Yacc sources.
78 cat >myyacc.sh <<'END'
85 chmod +x myyacc.sh mylex.sh
86 PATH="`pwd`$PATH_SEPARATOR$PATH"
88 # make maintainer-clean; ./configure; make should always work,
90 $MAKE maintainer-clean
92 YACC="myyacc.sh" LEX="mylex.sh" \
93 LEX_OUTPUT_ROOT='lex.yy' $MAKE -e zardoz.c joe.c
94 grep zardoz.y zardoz.c