From b8dcfd7925de398ceeb59bf8f947bd65c78f750a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 30 Dec 2001 20:07:36 +0000 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ m4/cond.m4 | 7 ++++++- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/pr220.test | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+), 1 deletion(-) create mode 100755 tests/pr220.test diff --git a/ChangeLog b/ChangeLog index 952e9ec..bd03a8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2001-12-30 Tom Tromey + 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. diff --git a/m4/cond.m4 b/m4/cond.m4 index 21537a4..04ca58f 100644 --- a/m4/cond.m4 +++ b/m4/cond.m4 @@ -35,4 +35,9 @@ if $2; then 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])]) diff --git a/tests/Makefile.am b/tests/Makefile.am index d3ffdd4..f5d82ec 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -239,6 +239,7 @@ pluseq7.test \ pluseq8.test \ ppf77.test \ pr2.test \ +pr220.test \ pr266.test \ pr279.test \ pr279-2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index e166e5c..32266a2 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -312,6 +312,7 @@ pluseq7.test \ pluseq8.test \ ppf77.test \ pr2.test \ +pr220.test \ pr266.test \ pr279.test \ pr279-2.test \ diff --git a/tests/pr220.test b/tests/pr220.test new file mode 100755 index 0000000..c151201 --- /dev/null +++ b/tests/pr220.test @@ -0,0 +1,49 @@ +#! /bin/sh + +# Test for PR automake/220. + +. $srcdir/defs || exit 1 + +cat >main.c < 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 -- 2.7.4