#! /bin/sh # Ensure that generated .h file is distributed iff we have -d in # (AM_)?YFLAGS. . $srcdir/defs || exit 1 cat >> configure.in << 'END' AC_PROG_CC AC_PROG_YACC END cat > Makefile.am <<'END' AUTOMAKE_OPTIONS = no-dependencies bin_PROGRAMS = zardoz zardoz_SOURCES = zardoz.y magic: @echo $(DIST_COMMON) END $ACLOCAL || exit 1 $AUTOMAKE || exit 1 fgrep -v @SET_MAKE@ Makefile.in > Makefile.sed # It should not be disted here grep 'zardoz.h' Makefile.in && exit 1 cp Makefile.am Save # Test all available flags to make sure header is distributed with # `-d'. for flag in YFLAGS AM_YFLAGS zardoz_YFLAGS; do cp Save Makefile.am echo "$flag = -d" >> Makefile.am $AUTOMAKE || exit 1 grep 'zardoz.h' Makefile.in || exit 1 done