Fix for PR automake/14:
[automake.git] / tests / confh.test
blob63dd433f86e61aaaaf561e5d076e10128efb8f65
1 #! /bin/sh
3 # Test to make sure config.h works in a subdir.
4 # Report from Alexandre Oliva.
6 . $srcdir/defs || exit 1
8 cat > configure.in << 'END'
9 PACKAGE=nonesuch
10 VERSION=nonesuch
11 AC_ARG_PROGRAM
12 AC_PROG_INSTALL
13 AM_CONFIG_HEADER(include/config.h)
14 AC_OUTPUT(Makefile include/Makefile)
15 END
17 : > Makefile.am
18 : > acconfig.h
20 mkdir include
21 : > include/Makefile.am
22 : > include/config.h.in
24 $AUTOMAKE || exit 1
26 (sed -n -e '/^DIST_COMMON =.*\\$/ {
27 :loop
30 /\\$/ b loop
33 }' -e '/^DIST_COMMON =/ p' Makefile.in | grep acconfig.h) || exit 1
35 grep 'stamp-h.in:.*acconfig.h' include/Makefile.in || exit 1
37 # Make sure re-running automake in a different way generates same
38 # Makefile.in.
39 mv Makefile.in save
40 $AUTOMAKE Makefile || exit 1
41 cmp Makefile.in save