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