2 # Copyright (C) 1999-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 # Test to make sure intermediate .h file is not generated nor removed
18 # if (AM_)?YFLAGS do not contain -d. Requested by Jim Meyering.
19 # See also the related semantic test 'yacc-d-basic.test'.
23 cat >> configure.ac << 'END'
28 # Run it here once and for all, since we are not going to modify
29 # configure.ac anymore.
32 cat > Makefile.am <<'END'
34 zardoz_SOURCES = zardoz.y
37 # Don't redefine several times the same variable.
38 cp Makefile.am Makefile.src
41 # If zardoz.h IS mentioned, fail.
42 $FGREP 'zardoz.h' Makefile.in && exit 1
44 cp Makefile.src Makefile.am
45 echo 'AM_YFLAGS = -d' >> Makefile.am
47 # If zardoz.h is NOT mentioned, fail.
48 $FGREP 'zardoz.h' Makefile.in
50 cp Makefile.src Makefile.am
51 echo 'AM_YFLAGS = ' >> Makefile.am
53 # If zardoz.h IS mentioned, fail.
54 $FGREP 'zardoz.h' Makefile.in && exit 1
56 cp Makefile.src Makefile.am
57 echo 'YFLAGS = -d' >> Makefile.am
58 # YFLAGS is a user variable.
60 grep 'YFLAGS.* user variable' stderr
61 grep 'AM_YFLAGS.* instead' stderr
63 # If zardoz.h is NOT mentioned, fail.
64 $FGREP 'zardoz.h' Makefile.in
66 cp Makefile.src Makefile.am
67 echo 'YFLAGS = ' >> Makefile.am
69 # If zardoz.h IS mentioned, fail.
70 $FGREP 'zardoz.h' Makefile.in && exit 1