blob: 28ec3e3fef5dd4f69cc669ba677014f2fa9b0637 [file]
#! /bin/sh
# Test to make sure config.h can be in subdir.
# Also, make sure config.h is properly rebuilt.
. $srcdir/defs || exit 1
# Fail gracefully if no autoconf.
$needs_autoconf
cat > configure.in << 'END'
AC_INIT
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
AM_CONFIG_HEADER(subdir/config.h:subdir/config.hin)
AC_OUTPUT(Makefile subdir/Makefile)
END
cat > Makefile.am << 'END'
SUBDIRS = subdir
END
mkdir subdir
cat > subdir/Makefile.am << 'END'
END
echo 'Before.' > subdir/config.hin
$ACLOCAL || exit 1
$AUTOMAKE || exit 1
# Make sure subdir Makefile.in doesn't itself look in the subdir.
# One line is allowed though:
#
# cd $(top_builddir) && $(SHELL) ./config.status subdir/config.h
(fgrep 'subdir/config.h' subdir/Makefile.in |
fgrep -v 'cd $(top_builddir)') && exit 1
autoconf || exit 1
./configure || exit 1
fgrep 'Before.' subdir/config.h
sleep 1
echo 'After.' > subdir/config.hin
make || exit 1
fgrep 'After.' subdir/config.h || exit 1
exit 0