#! /bin/sh # This attempts to `make distcheck' from a separate directory # (i.e. builddir!=srcdir). Before doing `make distcheck' a parser # definition is updated in the srcdir in order to check whether the # archived perser is up-to-date or not. . $srcdir/defs || exit 1 cat > configure.in << 'END' AC_INIT AM_INIT_AUTOMAKE(foo, 0.1) PACKAGE=foo VERSION=0.1 AC_PROG_CC AC_PROG_YACC AC_OUTPUT(Makefile) END cat > Makefile.am << 'END' bin_PROGRAMS= foo foo_SOURCES= parse.y foo.c END cat > parse.y << 'END' %{ int yylex () {return 0;} void yyerror (char *s) {} %} %% foobar : 'f' 'o' 'o' 'b' 'a' 'r' {}; END cat > foo.c << 'END' int main () { return 0; } END # Fail gracefully if no autoconf. $needs_autoconf # Likewise for gcc. (gcc -v) > /dev/null 2>&1 || exit 77 # Remove some files installed by defs. # They will be reinstalled by automake. rm -f install-sh missing mkinstalldirs set -e $ACLOCAL $AUTOCONF $AUTOMAKE -a ./configure $MAKE $MAKE distclean # this should left parse.c in the current directory cat >> parse.y << 'END' fubar : 'f' foobar {}; END mkdir sub cd sub ../configure $MAKE $MAKE distcheck