* automake.texi (Macros): Document AM_PROG_AS.
[automake.git] / tests / pr87.test
blobc43701bfc395b6aa3f69128df5906c47e7047c7c
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 77
35 touch README NEWS AUTHORS ChangeLog
37 mkdir build
39 # We use gcc and not gcc -traditional as the latter fails on some
40 # Linux boxes (Red Hat 5.1 in particular).
41 $ACLOCAL \
42 && $AUTOCONF \
43 && $AUTOMAKE -a || exit 1
45 # Regression test for bug where `.c.o:' is followed by blank line.
46 (while read line; do
47 if test "$line" = ".c.o:"; then
48 read next
49 if test -z "$next"; then
50 exit 1
52 break
54 done) < foo/Makefile.in || exit 1
56 cd build \
57 && CC='gcc' ../configure \
58 && $MAKE distcheck || exit 1