automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automake: AM_CONDITIONAL failure with automake-1.7, was ok 1.6.3


From: Alexandre Duret-Lutz
Subject: Re: automake: AM_CONDITIONAL failure with automake-1.7, was ok 1.6.3
Date: 30 Sep 2002 20:06:58 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>> "Juergen" == Juergen Keil <address@hidden> writes:

 Juergen> Hi,

 Juergen> it seems there's a regression with automake-1.7.  The
 Juergen> following construct (see also the attached
 Juergen> "cond26.test" test script intended for automake's
 Juergen> tests subdirectory) works OK with automake 1.6.3, but
 Juergen> fails with the error message

 Juergen> Makefile.am:1: `m4data_DATA' is used but `m4datadir' is undefined.

 Juergen> when using automake-1.7

Thanks for reporting this.  

I'm installing the following fix on HEAD and branch-1-7, so it
will appears in Automake 1.7.1.

2002-09-30  Alexandre Duret-Lutz  <address@hidden>

        * 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.

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.186
diff -u -r1.186 THANKS
--- THANKS      22 Sep 2002 19:02:44 -0000      1.186
+++ THANKS      30 Sep 2002 18:04:27 -0000
@@ -95,6 +95,7 @@
 Joshua Cowan           address@hidden
 js pendry              address@hidden
 Juergen A. Erhard      address@hidden
+Juergen Keil           address@hidden
 Karl Berry             address@hidden
 Karl Heuer             address@hidden
 Kevin Dalley           address@hidden
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1365.2.2
diff -u -r1.1365.2.2 automake.in
--- automake.in 30 Sep 2002 12:33:36 -0000      1.1365.2.2
+++ automake.in 30 Sep 2002 18:05:00 -0000
@@ -9033,20 +9033,19 @@
        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: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.443.2.1
diff -u -r1.443.2.1 Makefile.am
--- tests/Makefile.am   29 Sep 2002 10:36:11 -0000      1.443.2.1
+++ tests/Makefile.am   30 Sep 2002 18:05:14 -0000
@@ -91,6 +91,9 @@
 cond23.test \
 cond24.test \
 cond25.test \
+cond26.test \
+cond27.test \
+cond28.test \
 condd.test \
 condincl.test \
 condincl2.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.576.2.3
diff -u -r1.576.2.3 Makefile.in
--- tests/Makefile.in   30 Sep 2002 13:07:04 -0000      1.576.2.3
+++ tests/Makefile.in   30 Sep 2002 18:05:18 -0000
@@ -183,6 +183,9 @@
 cond23.test \
 cond24.test \
 cond25.test \
+cond26.test \
+cond27.test \
+cond28.test \
 condd.test \
 condincl.test \
 condincl2.test \
Index: tests/cond26.test
===================================================================
RCS file: tests/cond26.test
diff -N tests/cond26.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/cond26.test   30 Sep 2002 18:05:18 -0000
@@ -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
Index: tests/cond27.test
===================================================================
RCS file: tests/cond27.test
diff -N tests/cond27.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/cond27.test   30 Sep 2002 18:05:18 -0000
@@ -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
Index: tests/cond28.test
===================================================================
RCS file: tests/cond28.test
diff -N tests/cond28.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/cond28.test   30 Sep 2002 18:05:18 -0000
@@ -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
-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]