* configure.in: Upped to version 1.4k.
[automake.git] / tests / lex3.test
blob98c37ca37d8818a5e4ae469502f0e3cad4ddb6ef
1 #! /bin/sh
3 # Test associated with PR 19.
4 # From Matthew D. Langston.
6 . $srcdir/defs || exit 1
8 # Fail gracefully if no autoconf.
9 $needs_autoconf
11 # Likewise for gcc.
12 (gcc -v) > /dev/null 2>&1 || exit 77
14 # Likewise for gzip.
15 (gzip --version) > /dev/null 2>&1 || exit 77
17 cat > configure.in << 'END'
18 AC_INIT
19 dnl Prevent automake from looking in .. and ../..
20 AC_CONFIG_AUX_DIR(.)
21 AM_INIT_AUTOMAKE(am_lex_bug, 0.1.1)
23 dnl Checks for programs.
24 AC_PROG_CC
25 AM_PROG_LEX
26 AC_PROG_YACC
27 AC_OUTPUT(Makefile)
28 END
30 cat > Makefile.am << 'END'
31 AUTOMAKE_OPTIONS = foreign
32 LDADD = @LEXLIB@
34 noinst_PROGRAMS = foo
35 foo_SOURCES = foo.l
36 END
38 cat > foo.l << 'END'
40 "END" return EOF;
43 int
44 main ()
46 while (yylex () != EOF)
49 return 0;
51 END
53 set -e
55 $ACLOCAL
56 $AUTOCONF
57 $AUTOMAKE -a
58 ./configure
59 $MAKE
60 echo 'This is the END' | ./foo
61 $MAKE distcheck
63 # foo.c must be shipped.
64 gunzip am_lex_bug-0.1.1.tar.gz
65 tar tf am_lex_bug-0.1.1.tar | fgrep foo.c