configure: remove an obsolete TODO comment
[platform/upstream/automake.git] / t / yacc4.sh
1 #! /bin/sh
2 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 # Some simple tests of ylwrap functionality.
18
19 required='cc yacc'
20 . test-init.sh
21
22 cat >> configure.ac << 'END'
23 AC_PROG_CC
24 AC_PROG_YACC
25 AC_OUTPUT
26 END
27
28 cat > Makefile.am << 'END'
29 bin_PROGRAMS = foo bar
30 foo_SOURCES = parse.y foo.c
31 bar_SOURCES = bar.y foo.c
32 END
33
34 # First parser.
35 cat > parse.y << 'END'
36 %{
37 int yylex () { return 0; }
38 void yyerror (char *s) {}
39 %}
40 %%
41 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
42 END
43
44 # Second parser.
45 cat > bar.y << 'END'
46 %{
47 int yylex () { return 0; }
48 void yyerror (char *s) {}
49 %}
50 %%
51 fubar : 'f' 'o' 'o' 'b' 'a' 'r' {};
52 END
53
54 cat > foo.c << 'END'
55 int main (void)
56 {
57   return 0;
58 }
59 END
60
61 $ACLOCAL
62 $AUTOCONF
63 $AUTOMAKE -a
64
65 test -f ylwrap
66
67 mkdir sub
68 cd sub
69
70 ../configure
71 $MAKE
72
73 grep '^#.*/sub/\.\./' bar.c && exit 1
74 grep '^#.*/sub/\.\./' parse.c && exit 1
75
76 # Make distclean must not erase bar.c nor parse.c (by GNU standards) ...
77 $MAKE distclean
78 test -f bar.c
79 test -f parse.c
80 # ... but maintainer-clean should.
81 ../configure
82 $MAKE maintainer-clean
83 test ! -e bar.c
84 test ! -e parse.c
85
86 :