2001-12-30 Tom Tromey <tromey@redhat.com>
+ For PR automake/220:
+ * tests/Makefile.am (TESTS): Added pr220.test.
+ * tests/pr220.test: New file.
+ * m4/cond.m4 (AM_CONDITIONAL): Cause config.status to fail if
+ conditional was never run.
+
For PR automake/260:
* lib/depcomp (tru64): Correctly handle libtool case.
From doreille@smr.ch.
else
$1_TRUE='#'
$1_FALSE=
-fi])
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([conditional \"$1\" was never defined.
+Usually this means the macro was only invoked conditionally.])
+fi])])
--- /dev/null
+#! /bin/sh
+
+# Test for PR automake/220.
+
+. $srcdir/defs || exit 1
+
+cat >main.c <<EOF
+int main() { return 0; }
+EOF
+
+cat > Makefile.am << 'EOF'
+if NEVER_TRUE
+NEVER_DEFINED = missingfile.c
+endif
+
+bin_PROGRAMS = main
+main_SOURCES = main.c $(NEVER_DEFINED)
+EOF
+
+cat > configure.in << 'EOF'
+AC_INIT(main.c)
+AM_INIT_AUTOMAKE(test_am, 1.0)
+AC_PROG_CC
+AC_ARG_ENABLE(foo,
+[ --enanble-foo Enable foo],
+[ if test "foo" = "bar" ; then
+ AM_CONDITIONAL(NEVER_TRUE, true)
+ else
+ AM_CONDITIONAL(NEVER_TRUE, false)
+ fi
+])
+AC_OUTPUT(Makefile)
+EOF
+
+# Fail gracefully if no gcc.
+(gcc -v) > /dev/null 2>&1 || exit 77
+
+touch README NEWS AUTHORS ChangeLog
+
+mkdir build
+
+$ACLOCAL \
+ && $AUTOCONF \
+ && $AUTOMAKE -a || exit 1
+
+cd build
+# configure should fail since we've done something invalid.
+CC='gcc' ../configure && exit 1
+exit 0