bug-automake
[Top][All Lists]
Advanced

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

Re: Bug report


From: Alexandre Duret-Lutz
Subject: Re: Bug report
Date: Sun, 01 Feb 2004 19:06:21 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

>>> "Elena" == Elena A Vengerova <address@hidden> writes:

 Elena> Hello,

 Elena> it seems that I discovered the bug.

Thanks for catching it!

I'm installing the following fix on HEAD and branch-1-8.  It
will be in Automake 1.8.3.

2004-02-01  Alexandre Duret-Lutz  <address@hidden>

        * lib/Automake/Variable.pm (transform_variable_recursively):
        Define rewritten variables in all conditions not *covered* by user
        definitions, not simply in conditions without a previous
        definition.
        * tests/cond34.test: New file.
        * tests/Makefile.am (TESTS): Add cond34.test.
        Report from Elena A. Vengerova

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.230.2.8
diff -u -r1.230.2.8 THANKS
--- THANKS      28 Jan 2004 20:50:58 -0000      1.230.2.8
+++ THANKS      1 Feb 2004 17:35:08 -0000
@@ -55,6 +55,7 @@
 Doug Evans             address@hidden
 Duncan Gibson          address@hidden
 Eleftherios Gkioulekas address@hidden
+Elena A. Vengerova     address@hidden
 Elmar Hoffmann         address@hidden
 Elrond                 address@hidden
 Enrico Scholz          address@hidden
Index: lib/Automake/Variable.pm
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/Variable.pm,v
retrieving revision 1.27.2.1
diff -u -r1.27.2.1 Variable.pm
--- lib/Automake/Variable.pm    3 Jan 2004 12:42:54 -0000       1.27.2.1
+++ lib/Automake/Variable.pm    1 Feb 2004 17:35:12 -0000
@@ -1510,17 +1510,26 @@
           # we are trying to override a user variable.  Delete
           # the old variable first.
           variable_delete ($varname) if $varname eq $var->name;
-          # Define for all conditions.  Make sure we define
-          # an empty variable in condition TRUE otherwise.
+          # Define an empty variable in condition TRUE if there is no
+          # result.
           @allresults = ([TRUE, '']) unless @allresults;
+          # Define the rewritten variable in all conditions not
+          # already covered by user definitions.
           foreach my $pair (@allresults)
             {
               my ($cond, @result) = @$pair;
-              define ($varname, VAR_AUTOMAKE, '', $cond, "@result",
-                      '', $where, VAR_PRETTY)
-                unless vardef ($varname, $cond);
-              rvardef ($varname, $cond)->set_seen;
+              my $var = var $varname;
+              my @conds = ($var
+                           ? $var->not_always_defined_in_cond ($cond)->conds
+                           : $cond);
+
+              foreach (@conds)
+                {
+                  define ($varname, VAR_AUTOMAKE, '', $_, "@result",
+                          '', $where, VAR_PRETTY);
+                }
             }
+          set_seen $varname;
         }
        return "\$($varname)";
      },
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.539.2.7
diff -u -r1.539.2.7 Makefile.am
--- tests/Makefile.am   31 Jan 2004 14:36:20 -0000      1.539.2.7
+++ tests/Makefile.am   1 Feb 2004 17:35:12 -0000
@@ -120,6 +120,7 @@
 cond31.test \
 cond32.test \
 cond33.test \
+cond34.test \
 condd.test \
 condinc.test \
 condinc2.test \
Index: tests/cond34.test
===================================================================
RCS file: tests/cond34.test
diff -N tests/cond34.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/cond34.test   1 Feb 2004 17:35:12 -0000
@@ -0,0 +1,72 @@
+#!/bin/sh
+# Copyright (C) 2004  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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check for _DEPDENDENCIES definition with conditional _LDADD.
+# Report from Elena A. Vengerova
+
+. ./defs
+
+set -e
+
+cat >>configure.in <<'EOF'
+AM_CONDITIONAL([TWO], test -n "$two")
+AC_PROG_CC
+AC_OUTPUT
+EOF
+
+cat >>Makefile.am <<'EOF'
+OBJEXT=z
+
+bin_PROGRAMS = test1 test2
+
+if TWO
+  test1_LDADD = two.$(OBJEXT)
+  test2_LDADD = two.$(OBJEXT)
+  test2_DEPENDENCIES = $(test2_LDADD) somethingelse.a
+else !TWO
+  test1_LDADD = one.$(OBJEXT)
+  test2_LDADD = three.$(OBJEXT)
+endif !TWO
+
+test1_DEPENDENCIES = $(test1_LDADD) somethingelse.a
+
+dep-test1:
+       echo BEG: $(test1_DEPENDENCIES) :END
+dep-test2:
+       echo BEG: $(test2_DEPENDENCIES) :END
+
+EOF
+
+:> test.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE dep-test1 >out
+grep 'BEG: one.z somethingelse.a :END' out
+$MAKE dep-test2 >out
+grep 'BEG: three.z :END' out
+
+./configure two=2
+$MAKE dep-test1 >out
+grep 'BEG: two.z somethingelse.a :END' out
+$MAKE dep-test2 >out
+grep 'BEG: two.z somethingelse.a :END' out

-- 
Alexandre Duret-Lutz





reply via email to

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