Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / autohdr4.test
blobf7859986d0d6bb0b4f5c392ae9cc13fbb101a9f8
1 #!/bin/sh
2 # Copyright (C) 2003, 2005 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 rebuild rules for AC_CONFIG_HEADERS.
18 # (This should also work without GNU Make.)
20 required=gcc
21 . ./defs
23 set -e
25 cat >>configure.in <<'EOF'
26 AC_PROG_CC
27 AC_SUBST([BOT], [bot])
28 AC_CONFIG_HEADERS([defs.h config.h:sub1/config.top:sub2/config.${BOT}],,
29 [BOT=$BOT])
30 AC_CONFIG_FILES([sub3/Makefile])
31 AC_OUTPUT
32 EOF
34 mkdir sub1 sub2 sub3
36 : > sub1/config.top
37 echo '#define NAME "grepme1"' >sub2/config.bot
38 echo SUBDIRS = sub3 >Makefile.am
39 echo noinst_PROGRAMS = run >sub3/Makefile.am
41 cat >sub3/run.c <<'EOF'
42 #include <defs.h>
43 #include <config.h>
44 #include <stdio.h>
46 int
47 main ()
49 puts (NAME); /* from config.h */
50 puts (PACKAGE); /* from defs.h */
52 EOF
55 $ACLOCAL
56 $AUTOCONF
57 $AUTOHEADER
58 $AUTOMAKE
60 ./configure
61 $MAKE
62 sub3/run | grep grepme1
64 $sleep
65 echo '#define NAME "grepme2"' > sub2/config.bot
66 $MAKE
67 sub3/run | grep grepme2
69 $MAKE distcheck