* configure.in: Upped to version 1.4k.
[automake.git] / tests / subobj3.test
blobbb3b373e607d74f94d8d5249f2bf596e4cb4e1cd
1 #! /bin/sh
3 # Test of subdir objects with C++.
5 . $srcdir/defs || exit 1
7 cat > configure.in << 'END'
8 AC_INIT(sub/hello.c)
9 AM_INIT_AUTOMAKE(hello,0.23)
10 dnl Prevent automake from looking in .. and ../..
11 AC_CONFIG_AUX_DIR(.)
12 AC_PROG_CC
13 AM_PROG_CC_C_O
14 AM_C_PROTOTYPES
15 AC_OUTPUT(Makefile)
16 END
18 cat > Makefile.am << 'END'
19 AUTOMAKE_OPTIONS = subdir-objects
20 bin_PROGRAMS = hello
21 hello_SOURCES = sub/hello.c
22 END
24 mkdir sub
25 cat > sub/hello.c << 'END'
26 #include <stdio.h>
27 int
28 main (int argc, char *argv[])
30 printf ("yeah, yeah\n");
31 return 0;
33 END
35 # Fail gracefully if no autoconf.
36 $needs_autoconf
38 # Likewise for gcc.
39 (gcc -v) > /dev/null 2>&1 || exit 77
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 \
46 && CC='gcc' ./configure \
47 && $MAKE ANSI2KNR=./ansi2knr U=_ \
48 && ./hello