2 # Copyright (C) 1996-2024 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 <https://www.gnu.org/licenses/>.
17 # Some grep-based checks on yacc support:
19 # - Make sure intermediate .c file is built from yacc source.
20 # Report from Thomas Morgan.
22 # - Make sure intermediate .h file is not generated nor removed
23 # if (AM_)?YFLAGS do not contain '-d'.
24 # Requested by Jim Meyering.
28 cat >> configure.ac
<< 'END'
33 # Run it here once and for all, since we are not going to modify
34 # configure.ac anymore.
37 cat > Makefile.am
<<'END'
38 AM_LFLAGS = --never-interactive
41 zardoz_SOURCES = zardoz.y
44 # Don't redefine several times the same variable.
45 cp Makefile.am Makefile.src
48 $FGREP 'zardoz.c' Makefile.
in
49 # If zardoz.h IS mentioned, fail.
50 $FGREP 'zardoz.h' Makefile.
in && exit 1
52 cp Makefile.src Makefile.am
53 echo 'AM_YFLAGS = -d' >> Makefile.am
55 $FGREP 'zardoz.c' Makefile.
in
56 # If zardoz.h is NOT mentioned, fail.
57 $FGREP 'zardoz.h' Makefile.
in
59 cp Makefile.src Makefile.am
60 echo 'AM_YFLAGS = ' >> Makefile.am
62 $FGREP 'zardoz.c' Makefile.
in
63 # If zardoz.h IS mentioned, fail.
64 $FGREP 'zardoz.h' Makefile.
in && exit 1
66 cp Makefile.src Makefile.am
67 echo 'YFLAGS = -d' >> Makefile.am
68 # YFLAGS is a user variable.
70 grep 'YFLAGS.* user variable' stderr
71 grep 'AM_YFLAGS.* instead' stderr
73 # If zardoz.h is NOT mentioned, fail.
74 $FGREP 'zardoz.h' Makefile.
in
76 cp Makefile.src Makefile.am
77 echo 'YFLAGS = ' >> Makefile.am
79 # If zardoz.h IS mentioned, fail.
80 $FGREP 'zardoz.h' Makefile.
in && exit 1