2002-09-30 Alexandre Duret-Lutz <duret_g@epita.fr>
+ * automake.in (require_variables): The fix introduced in 2002-09-19
+ is imcomplete. Rewrite the conditional variable definition check
+ using &variable_not_always_defined_in_cond.
+ * tests/cond26.test, tests/cond27.test, tests/cond28.test: New file.
+ * tests/Makefile.am (TESTS): Add cond26.test, cond27.test, and
+ cond28.test.
+ Reported by Juergen Keil.
+
* automake.in (INTERNAL): Redefine as an empty location,
so that internal locations get displayed as `automake:'.
Joshua Cowan jcowan@jcowan.reslife.okstate.edu
js pendry js.pendry@msdw.com
Juergen A. Erhard jae@laden.ilk.de
+Juergen Keil jk@tools.de
Karl Berry kb@cs.umb.edu
Karl Heuer kwzh@gnu.org
Kevin Dalley kevin@aimnet.com
if ((exists $var_value{$var} && exists $var_value{$var}{$cond})
|| exists $configure_vars{$var});
- # If the variable exists but was not defined in $cond,
- # look for any definition implied by $cond.
- if (exists $var_value{$var})
+ my @undef_cond = variable_not_always_defined_in_cond $var, $cond;
+ next VARIABLE
+ unless @undef_cond;
+
+ my $text = "$reason`$var' is undefined\n";
+ if (@undef_cond && $undef_cond[0] ne 'TRUE')
{
- for my $vcond (keys %{$var_value{$var}})
- {
- next VARIABLE
- if (conditional_true_when ($vcond, $cond));
- }
+ $text .= ("in the following conditions:\n "
+ . join ("\n ", @undef_cond));
}
++$res;
- my $text = "$reason`$var' is undefined.";
if (exists $am_macro_for_var{$var})
{
$text .= "\nThe usual way to define `$var' is to add "
cond23.test \
cond24.test \
cond25.test \
+cond26.test \
+cond27.test \
+cond28.test \
condd.test \
condincl.test \
condincl2.test \
cond23.test \
cond24.test \
cond25.test \
+cond26.test \
+cond27.test \
+cond28.test \
condd.test \
condincl.test \
condincl2.test \
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with autoconf; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check that non-conditional primaries can use conditional directories.
+# Reported by Juergen Keil.
+
+. ./defs
+
+set -e
+
+cat >>configure.in << 'EOF'
+AM_CONDITIONAL([USE_FOO], [true])
+EOF
+
+cat >Makefile.am << 'EOF'
+if USE_FOO
+mydir = /foo
+else
+mydir = /bar
+endif
+my_DATA = foo
+EOF
+
+$ACLOCAL
+$AUTOMAKE
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with autoconf; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check that non-conditional primaries cannot use directories defined
+# in some conditions (but not others).
+
+. ./defs
+
+set -e
+
+cat >>configure.in << 'EOF'
+AM_CONDITIONAL([USE_FOO], [true])
+EOF
+
+cat >Makefile.am << 'EOF'
+if USE_FOO
+mydir = /foo
+endif
+my_DATA = foo
+EOF
+
+$ACLOCAL
+$AUTOMAKE 2>stderr && exit 1
+cat stderr
+grep USE_FOO_TRUE stderr && exit 1
+grep USE_FOO_FALSE stderr
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with autoconf; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check that conditional primaries can use directories defined
+# in the same conditions (but not others).
+
+. ./defs
+
+set -e
+
+cat >>configure.in << 'EOF'
+AM_CONDITIONAL([USE_FOO], [true])
+EOF
+
+cat >Makefile.am << 'EOF'
+if USE_FOO
+mydir = /foo
+endif
+if USE_FOO
+my_DATA = foo
+endif
+EOF
+
+$ACLOCAL
+$AUTOMAKE