updated comment
[platform/upstream/automake.git] / tests / pr87.test
1 #! /bin/sh
2
3 # Test for PR automake/87.
4
5 . $srcdir/defs || exit 1
6
7 subdirs="foo bar"
8
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
19
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
28
29 # Fail gracefully if no autoconf.
30 $needs_autoconf
31
32 # Likewise for gcc.
33 (gcc -v) > /dev/null 2>&1 || exit 0
34
35 touch README NEWS AUTHORS ChangeLog
36
37 mkdir build
38
39 rm missing install-sh mkinstalldirs
40
41 # Regression test for bug where `.c.o:' is followed by blank line.
42 (while read line; do
43     if test "$line" = ".c.o:"; then
44        read next
45        if test -z "$next"; then
46           exit 1
47        fi
48        break
49     fi
50  done) < foo/Makefile.in || exit 1
51
52 # We use gcc and not gcc -traditional as the latter fails on some
53 # Linux boxes (Red Hat 5.1 in particular).
54 $ACLOCAL \
55    && $AUTOCONF \
56    && $AUTOMAKE -a \
57    && cd build \
58    && CC='gcc' ../configure \
59    && $MAKE distcheck