Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / ansi6.test
blob0a37d6b7acda6d8f0fbd2b1398b9e02df22751fe
1 #! /bin/sh
2 # Copyright (C) 2002, 2006, 2008 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 # From Kevin Ryde.
20 required=gcc
21 . ./defs || Exit 1
23 cat > configure.in << 'END'
24 AC_INIT(ansi6, 1.0)
25 AM_INIT_AUTOMAKE
26 AC_PROG_CC
27 AC_PROG_CC_STDC
28 AM_C_PROTOTYPES
29 AC_CONFIG_FILES(Makefile)
30 AC_OUTPUT
31 END
33 cat > Makefile.am << 'END'
34 AUTOMAKE_OPTIONS = ansi2knr
35 bin_PROGRAMS = hello
36 hello_SOURCES = hello.c sub/dir.c
37 END
39 cat > hello.c << 'END'
40 #include <stdio.h>
42 extern int foo ();
44 int
45 main (int argc, char **argv)
47 printf ("%d\n", foo ());
49 END
51 mkdir sub
53 cat > sub/dir.c << 'END'
54 int
55 foo ()
57 return 23;
59 END
61 set -e
63 $ACLOCAL
64 $AUTOCONF
65 $AUTOMAKE -a
67 # Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
68 test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
70 ./configure ac_cv_prog_cc_stdc=no
71 $MAKE
73 test -f hello_.c
74 test -f dir_.c # Must be in current directory.
75 test ! -f sub/dir_.c
76 $MAKE distclean
77 test ! -f hello_.c
78 test ! -f dir_.c
80 # Also run without forcing ansi2knr, so we make sure the
81 # rules work with ANSI compilers.
82 # Report from Andreas Schwab.
84 ./configure
85 $MAKE