*** empty log message ***
[automake.git] / tests / lex3.test
blob9133b4a923e39c910928d3cad871c7675fec646d
1 #! /bin/sh
3 # Test associated with PR 19.
4 # From Matthew D. Langston.
6 . $srcdir/defs || exit 1
8 # Likewise for GNU Make (we need VPATH support for `make distcheck').
9 $needs_gnu_make
11 # Likewise for gcc.
12 (gcc -v) > /dev/null 2>&1 || exit 77
14 # Ignore user CFLAGS.
15 CFLAGS=
16 export CFLAGS
18 # Likewise for gzip.
19 (gzip --version) > /dev/null 2>&1 || exit 77
21 cat > configure.in << 'END'
22 AC_INIT
23 dnl Prevent automake from looking in .. and ../..
24 AC_CONFIG_AUX_DIR(.)
25 AM_INIT_AUTOMAKE(am_lex_bug, 0.1.1)
27 dnl Checks for programs.
28 AC_PROG_CC
29 AM_PROG_LEX
30 AC_PROG_YACC
31 AC_OUTPUT(Makefile)
32 END
34 cat > Makefile.am << 'END'
35 AUTOMAKE_OPTIONS = foreign
36 LDADD = @LEXLIB@
38 noinst_PROGRAMS = foo
39 foo_SOURCES = foo.l
40 END
42 cat > foo.l << 'END'
44 "END" return EOF;
47 int
48 main ()
50 while (yylex () != EOF)
53 return 0;
55 END
57 set -e
59 $ACLOCAL
60 $AUTOCONF
61 $AUTOMAKE -a
62 ./configure
63 $MAKE
64 echo 'This is the END' | ./foo
65 $MAKE distcheck
67 # foo.c must be shipped.
68 gunzip am_lex_bug-0.1.1.tar.gz
69 tar tf am_lex_bug-0.1.1.tar | fgrep foo.c