Reword the copyright notices to match what's suggested in GPLv3.
[automake/plouj.git] / tests / ansi7.test
blob9afea75278baed5330103c71cc10ae8e96caa57b
1 #! /bin/sh
2 # Copyright (C) 2002 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 # Check ansi2knr on a source file in subdirectory.
18 # ansi6.test is the same test without subdir-objects.
19 # From Kevin Ryde.
21 required=gcc
22 . ./defs || exit 1
24 cat > configure.in << 'END'
25 AC_INIT(ansi6, 1.0)
26 AM_INIT_AUTOMAKE
27 AC_PROG_CC
28 AC_PROG_CC_STDC
29 AM_PROG_CC_C_O
30 AM_C_PROTOTYPES
31 AC_EXEEXT
32 AC_OBJEXT
33 AC_CONFIG_FILES(Makefile)
34 AC_OUTPUT
35 END
37 cat > Makefile.am << 'END'
38 AUTOMAKE_OPTIONS = ansi2knr subdir-objects
39 bin_PROGRAMS = hello
40 hello_SOURCES = hello.c sub/dir.c
41 END
43 cat > hello.c << 'END'
44 #include <stdio.h>
46 extern int foo ();
48 int
49 main (int argc, char **argv)
51 printf ("%d\n", foo ());
53 END
55 mkdir sub
57 cat > sub/dir.c << 'END'
58 int
59 foo ()
61 return 23;
63 END
65 set -e
67 $ACLOCAL
68 $AUTOCONF
69 $AUTOMAKE -a
71 # Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
72 test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
74 ./configure ac_cv_prog_cc_stdc=no
75 $MAKE
77 test -f hello_.c
78 test -f sub/dir_.c # Must be in sub directory, unlike ansi6.test.
79 test ! -f dir_.c
80 $MAKE distclean
81 test ! -f hello_.c
82 test ! -f sub/dir_.c
84 # Also run without forcing ansi2knr, so we make sure the
85 # rules work with ANSI compilers.
86 # Report from Andreas Schwab.
88 ./configure
89 $MAKE