Index: ChangeLog =================================================================== RCS file: /cvs/automake/automake/ChangeLog,v retrieving revision 1.1414 diff -u -r1.1414 ChangeLog --- ChangeLog 2001/06/04 15:53:02 1.1414 +++ ChangeLog 2001/06/06 01:13:38 @@ -1,3 +1,10 @@ +2001-06-06 Richard Boulton
+ + * (variable_conditions_reduce): Remove pure TRUE conditions unless + they are the only condition present. + * tests/Makefile.am (TESTS): Added cond11.test. + * tests/cond11.test: New file. + 2001-06-04 Kevin Dalley * lib/am/dejagnu.am (site.exp): Fix typo. Index: automake.in =================================================================== RCS file: /cvs/automake/automake/automake.in,v retrieving revision 1.1136 diff -u -r1.1136 automake.in --- automake.in 2001/06/03 17:16:40 1.1136 +++ automake.in 2001/06/06 01:13:53 @@ -5896,6 +5896,7 @@ { my (@conds) = @_; my @ret = (); + my $havetrue = 0; foreach my $cond (@conds) { # FALSE is absorbent. @@ -5903,10 +5904,19 @@ { return ('FALSE'); } + # TRUE is tautologous (unless its the only thing) + if ($cond eq 'TRUE') + { + $havetrue = 1; + } elsif (conditionals_true_when (($cond), (@ret))) { push (@ret, $cond); } + } + if ($havetrue && ! @ret) + { + push (@ret, 'TRUE'); } return @ret; Index: tests/Makefile.am =================================================================== RCS file: /cvs/automake/automake/tests/Makefile.am,v retrieving revision 1.306 diff -u -r1.306 Makefile.am --- Makefile.am 2001/06/03 17:16:40 1.306 +++ Makefile.am 2001/06/06 01:13:54 @@ -62,6 +62,7 @@ cond8.test \ cond9.test \ cond10.test \ +cond11.test \ condincl.test \ condincl2.test \ condlib.test \ Index: tests/Makefile.in =================================================================== RCS file: /cvs/automake/automake/tests/Makefile.in,v retrieving revision 1.405 diff -u -r1.405 Makefile.in --- Makefile.in 2001/06/03 17:16:40 1.405 +++ Makefile.in 2001/06/06 01:13:54 @@ -128,6 +128,7 @@ cond8.test \ cond9.test \ cond10.test \ +cond11.test \ condincl.test \ condincl2.test \ condlib.test \ Index: tests/cond11.test =================================================================== RCS file: cond11.test diff -N cond11.test --- /dev/null Tue May 5 13:32:27 1998 +++ cond11.test Tue Jun 5 18:13:54 2001 @@ -0,0 +1,41 @@ +#! /bin/sh + +# Test for bug in conditionals. From Richard Boulton. +# This checks that, if LDADD is set from a conditional variable +# and an AC_SUBST, the _DEPENDENCIES variable is set correctly. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AC_INIT(Makefile.am) +AM_INIT_AUTOMAKE(foo,0.0) +AC_PROG_CC +AM_CONDITIONAL(USE_A,[test x = x]) +AC_OUTPUT(Makefile) +AC_SUBST(SUBSTVAR) +END + +cat > Makefile.am << 'END' + +if USE_A +foolibs=faz.la +else +foolibs= +endif + +noinst_PROGRAMS = foo +foo_SOURCES = foo.c +LDADD = $(SUBSTVAR) $(foolibs) +END + +: > config.guess +: > config.sub +: > compile + +$ACLOCAL || exit 1 +$AUTOMAKE || exit 1 + +#Should be two dependency setting lines +count=`grep 'foo_DEPENDENCIES =' Makefile.in | wc -l|sed 's/ //g'` +test "x$count" == "x2" && + grep '^.USE_A_TRUE.foo_DEPENDENCIES =' Makefile.in