3 # This test checks that dependent files are updated before including
4 # in the distribution. `parse.c' depends on `parce.y'. The later is
5 # updated so that `parse.c' should be rebuild. Then we are running
6 # `make' and `make distdir' and check whether the version of `parse.c'
7 # to be distributed is up to date.
9 .
$srcdir/defs ||
exit 1
11 # Fail gracefully if no autoconf.
13 # Likewise for some other tools.
14 (gcc
-v) > /dev
/null
2>&1 ||
exit 77
15 (bison
-V) > /dev
/null
2>&1 ||
exit 77
17 cat > configure.
in << 'END'
19 AC_CONFIG_AUX_DIR
([.
])
20 AM_INIT_AUTOMAKE
(foo
, 0.1)
28 cat > Makefile.am
<< 'END'
30 foo_SOURCES
= parse.y foo.c
33 # Original parser, with `foobar'
34 cat > parse.y
<< 'END'
36 int yylex
() {return 0;}
37 void yyerror
(char
*s
) {}
40 foobar
: 'f' 'o' 'o' 'b' 'a' 'r' {};
44 int main
() { return 0; }
47 # We are not checking Autoconf, so we pick $YACC for it.
64 # A delay is needed to make sure that the new parse.y is indeed newer
65 # than parse.c, i.e. the they don't have the same timestamp.
68 # New parser, with `fubar'
69 cat > ..
/parse.y
<< 'END'
71 int yylex
() {return 0;}
72 void yyerror
(char
*s
) {}
75 fubar
: 'f' 'o' 'o' 'b' 'a' 'r' {};
80 grep fubar foo-0.1
/parse.c
83 # Now check to make sure that `make dist' will rebuild the parser.
86 # A delay is needed to make sure that the new parse.y is indeed newer
87 # than parse.c, i.e. the they don't have the same timestamp.
90 # New parser, with `maude'
91 cat > ..
/parse.y
<< 'END'
93 int yylex
() {return 0;}
94 void yyerror
(char
*s
) {}
97 maude
: 'm' 'a' 'u' 'd' 'e' {};
101 grep maude foo-0.1
/parse.c