]> sourceware.org Git - automake.git/commitdiff
* automake.in (require_variables): The fix introduced in 2002-09-19
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 30 Sep 2002 18:08:06 +0000 (18:08 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 30 Sep 2002 18:08:06 +0000 (18:08 +0000)
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.

ChangeLog
THANKS
automake.in
tests/Makefile.am
tests/Makefile.in
tests/cond26.test [new file with mode: 0755]
tests/cond27.test [new file with mode: 0755]
tests/cond28.test [new file with mode: 0755]

index 7eea841039d61baac44d1da218093301085832c1..1a7949c6178243339c03e1243269c37f595652e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 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:'.
 
diff --git a/THANKS b/THANKS
index 9be301a3988faf0be880cc3fa9cf90d976a74a56..e9e0cad05a4f90c8186ce56d744804dd534c8a7c 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -95,6 +95,7 @@ Josh MacDonald                jmacd@cs.berkeley.edu
 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
index a76fa2312577fe730ee5fdeea1a3826885583945..8b1835116d8bd424fafe04ec562bd3fd65501a10 100755 (executable)
@@ -9172,20 +9172,19 @@ sub require_variables ($$$@)
        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 "
index ca0e322fcb13227373b71949dccfc4cdff50e5af..40a59d7d2cfe953edf598ec79a1aeb79595220b9 100644 (file)
@@ -91,6 +91,9 @@ cond22.test \
 cond23.test \
 cond24.test \
 cond25.test \
+cond26.test \
+cond27.test \
+cond28.test \
 condd.test \
 condincl.test \
 condincl2.test \
index f4cb0a439148aaa9e00a2c12c8d0f7edf047e672..603b986fd502704716d7f1767b9df23733b01204 100644 (file)
@@ -183,6 +183,9 @@ cond22.test \
 cond23.test \
 cond24.test \
 cond25.test \
+cond26.test \
+cond27.test \
+cond28.test \
 condd.test \
 condincl.test \
 condincl2.test \
diff --git a/tests/cond26.test b/tests/cond26.test
new file mode 100755 (executable)
index 0000000..36968ea
--- /dev/null
@@ -0,0 +1,42 @@
+#!/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
diff --git a/tests/cond27.test b/tests/cond27.test
new file mode 100755 (executable)
index 0000000..f43fce3
--- /dev/null
@@ -0,0 +1,43 @@
+#!/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
diff --git a/tests/cond28.test b/tests/cond28.test
new file mode 100755 (executable)
index 0000000..95dfbd6
--- /dev/null
@@ -0,0 +1,42 @@
+#!/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
This page took 0.049154 seconds and 5 git commands to generate.