Reword the copyright notices to match what's suggested in GPLv3.
[automake/plouj.git] / tests / mmodely.test
blob6f1249df2de7329749523283b94366d0f0f98639
1 #! /bin/sh
2 # Copyright (C) 2004, 2006, 2007 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 3, or (at your option)
7 # any later version.
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.
21 required=gcc
22 . ./defs || exit 1
24 set -e
26 cat >> configure.in << 'END'
27 AM_MAINTAINER_MODE
28 AC_PROG_CC
29 AM_PROG_LEX
30 AC_PROG_YACC
31 AC_OUTPUT
32 END
34 cat > Makefile.am <<'END'
35 YACC = false
36 LEX = false
37 bin_PROGRAMS = zardoz
38 zardoz_SOURCES = zardoz.y joe.l
39 LDADD = @LEXLIB@
40 END
42 # The point of this test is that it is not dependant on a working lex or yacc.
43 cat > joe.c <<EOF
44 int joe (int arg)
46 return arg * 2;
48 EOF
49 cat > zardoz.c <<EOF
50 int joe (int arg);
51 int main (int argc, char **argv)
53 exit (joe (argc));
55 EOF
57 # Ensure a later timestamp for our Lex & Yacc sources.
58 $sleep
59 : > joe.l
60 : > zardoz.y
62 $ACLOCAL
63 $AUTOCONF
64 $AUTOMAKE -a
66 ./configure
67 $MAKE
69 cat >myyacc.sh <<'END'
70 #! /bin/sh
71 echo "$@" >y.tab.c
72 END
73 cat >mylex.sh <<'END'
74 echo "$@" >lex.yy.c
75 END
76 chmod +x myyacc.sh mylex.sh
77 PATH="`pwd`:$PATH"
79 # make maintainer-clean; ./configure; make should always work,
80 # per GNU Standard.
81 $MAKE maintainer-clean
82 ./configure
83 YACC="myyacc.sh" LEX="mylex.sh" \
84 LEX_OUTPUT_ROOT='lex.yy' $MAKE -e zardoz.c joe.c
85 grep zardoz.y zardoz.c
86 grep joe.l joe.c