* configure.in: Updated to 1.4d and released.
[automake.git] / tests / pr87.test
blobb6c25f0530ca7270c248bea5167d59b37f170a2f
1 #! /bin/sh
3 # Test for PR automake/87.
5 . $srcdir/defs || exit 1
7 subdirs="foo bar"
9 for i in $subdirs; do
10 mkdir $i
11 cat >$i/$i.c <<EOF
12 int main() { return 0; }
13 EOF
14 cat >$i/Makefile.am <<EOF
15 bin_PROGRAMS = $i
16 ${i}_SOURCES = $i.c
17 EOF
18 done
20 echo "SUBDIRS = $subdirs" > Makefile.am
21 cat >configure.in <<EOF
22 AC_INIT(`echo $subdirs | sed 's|\([a-z][a-z]*\).*|\1/\1.c|'`)
23 AC_CONFIG_AUX_DIR(.)
24 AM_INIT_AUTOMAKE(test_am, 1.0)
25 AC_PROG_CC
26 AC_OUTPUT(Makefile `echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g'`)
27 EOF
29 # Fail gracefully if no autoconf.
30 $needs_autoconf
32 # Likewise for gcc.
33 (gcc -v) > /dev/null 2>&1 || exit 0
35 touch README NEWS AUTHORS ChangeLog
37 mkdir build
39 rm missing install-sh mkinstalldirs
41 # We use gcc and not gcc -traditional as the latter fails on some
42 # Linux boxes (Red Hat 5.1 in particular).
43 $ACLOCAL \
44 && $AUTOCONF \
45 && $AUTOMAKE -a || exit 1
47 # Regression test for bug where `.c.o:' is followed by blank line.
48 (while read line; do
49 if test "$line" = ".c.o:"; then
50 read next
51 if test -z "$next"; then
52 exit 1
54 break
56 done) < foo/Makefile.in || exit 1
58 cd build \
59 && CC='gcc' ../configure \
60 && $MAKE distcheck || exit 1