* tests/Makefile.am (TESTS): Added yacc5.test.
[automake.git] / tests / ansi3.test
blobf10b21f160ea3cba05881fb38b48221785d00927
1 #! /bin/sh
3 # Actual test of ansi2knr functionality. Relies on existence
4 # of working gcc.
6 . $srcdir/defs || exit 1
8 cat > configure.in << 'END'
9 AC_INIT(hello.c)
10 AM_INIT_AUTOMAKE(hello,0.23)
11 AC_PROG_CC
12 AM_C_PROTOTYPES
13 AC_OUTPUT(Makefile)
14 END
16 cat > Makefile.am << 'END'
17 AUTOMAKE_OPTIONS = ansi2knr no-dependencies
18 bin_PROGRAMS = hello
19 END
21 cat > hello.c << 'END'
22 #include <stdio.h>
23 int
24 main (int argc, char *argv[])
26 printf ("yeah, yeah\n");
27 return 0;
29 END
31 # Fail gracefully if no autoconf.
32 $needs_autoconf
34 # Likewise for gcc.
35 (gcc -v) > /dev/null 2>&1 || exit 77
37 # We use gcc and not gcc -traditional as the latter fails on some
38 # Linux boxes (Red Hat 5.1 in particular).
39 $ACLOCAL \
40 && $AUTOCONF \
41 && $AUTOMAKE -a \
42 && CC='gcc' ./configure \
43 && $MAKE ANSI2KNR=./ansi2knr U=_ \
44 && ./hello