Avoid leaking TEST_LOG_COMPILER in environment of test scripts.
[automake.git] / tests / stdinc.test
blobff914f3d3a7131e034242811b12a85db432b6f71
1 #! /bin/sh
2 # Copyright (C) 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 2, 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 # Test to make sure the standard include order is stable.
18 # Report by Kent Boortz.
20 . ./defs || Exit 1
22 set -e
24 cat >> configure.in << 'END'
25 AC_PROG_CC
26 AC_CONFIG_HEADERS([sub/config.h])
27 AC_CONFIG_FILES([sub/bar.h])
28 AC_OUTPUT
29 END
31 cat > Makefile.am << 'END'
32 bin_PROGRAMS = foo
33 foo_SOURCES = foo.c
34 BUILT_SOURCES = bar.h
35 END
37 mkdir sub
39 cat >foo.c <<'END'
40 #include <config.h>
41 #include <bar.h>
42 int main() { return bar (); }
43 END
44 cat >bar.h <<'END'
45 int bar () { return 0; }
46 END
47 cat >sub/bar.h.in <<'END'
48 choke me
49 END
51 $ACLOCAL
52 $AUTOCONF
53 $AUTOHEADER
54 $AUTOMAKE
56 mkdir build
57 cd build
58 ../configure -C
59 $MAKE
61 cd ..
62 ./configure -C
63 $MAKE