automake-patches
[Top][All Lists]
Advanced

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

FYI: disallow redefinitions of AC_SUBST (or Automake) variables in *diff


From: Alexandre Duret-Lutz
Subject: FYI: disallow redefinitions of AC_SUBST (or Automake) variables in *different* conditions
Date: 19 Jun 2002 21:32:10 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Running `make check' on HEAD after this fix, I've found many test failing
because CCDEPMODE is 
  1. AC_SUBST'ed from depend.m4
  2. defined conditionally from lang-compile.am
So I've removed this second definition.  It's useless since we trace.

I'm checking in this on HEAD and (without the lang-compile.am
chunk) branch-1-6.

2002-06-19  Alexandre Duret-Lutz  <address@hidden>

        * lib/am/lang-compile.am (%FPFX%DEPMODE): Delete.  This is now
        traced from configure.ac.

        * automake.in (macro_define): Don't accept to override an AC_SUBST
        or Automake variable in a new condition.
        * tests/cond23.test, tests/cond24.test: New file.
        * tests/Makefile.am (TESTS): Add cond23.test and cond24.test.
        Reported by Patrik Weiskirchre.

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.178
diff -u -r1.178 THANKS
--- THANKS      11 Jun 2002 12:31:45 -0000      1.178
+++ THANKS      19 Jun 2002 19:18:55 -0000
@@ -136,6 +136,7 @@
 Olivier Louchart-Fletcher address@hidden
 Olly Betts             address@hidden
 Patrick Welche         address@hidden
+Patrik Weiskircher     address@hidden
 Paul Berrevoets                address@hidden
 Paul D. Smith          address@hidden
 Paul Eggert            address@hidden
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1306
diff -u -r1.1306 automake.in
--- automake.in 17 Jun 2002 12:20:16 -0000      1.1306
+++ automake.in 19 Jun 2002 19:19:17 -0000
@@ -5911,10 +5911,12 @@
       else
        {
          # There must be no previous value unless the user is redefining
-         # an Automake variable or an AC_SUBST variable.
+         # an Automake variable or an AC_SUBST variable for an existing
+         # condition.
          check_ambiguous_conditional ($var, $cond)
-           unless ($var_is_am{$var} && !$var_is_am
-                   || exists $configure_vars{$var});
+           unless (($var_is_am{$var} && !$var_is_am
+                    || exists $configure_vars{$var})
+                   && exists $var_value{$var}{$cond});
 
          $var_value{$var}{$cond} = $value;
        }
Index: lib/am/lang-compile.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/lang-compile.am,v
retrieving revision 1.1
diff -u -r1.1 lang-compile.am
--- lib/am/lang-compile.am      13 May 2001 17:19:18 -0000      1.1
+++ lib/am/lang-compile.am      19 Jun 2002 19:19:17 -0000
@@ -18,17 +18,6 @@
 
 ## This file is read once per *language*, not per extension.
 
-## ----------------------------- ##
-## Common to all the languages.  ##
-## ----------------------------- ##
-
-## Dependency tracking.
-if %AMDEP%
-%FPFX%DEPMODE = @%FPFX%DEPMODE@
-endif %AMDEP%
-
-
-
 ## ------------------------- ##
 ## Preprocessed Fortran 77.  ##
 ## ------------------------- ##
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.409
diff -u -r1.409 Makefile.am
--- tests/Makefile.am   17 Jun 2002 12:20:23 -0000      1.409
+++ tests/Makefile.am   19 Jun 2002 19:19:19 -0000
@@ -86,6 +86,8 @@
 cond20.test \
 cond21.test \
 cond22.test \
+cond23.test \
+cond24.test \
 condd.test \
 condincl.test \
 condincl2.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.527
diff -u -r1.527 Makefile.in
--- tests/Makefile.in   17 Jun 2002 12:20:24 -0000      1.527
+++ tests/Makefile.in   19 Jun 2002 19:19:19 -0000
@@ -172,6 +172,8 @@
 cond20.test \
 cond21.test \
 cond22.test \
+cond23.test \
+cond24.test \
 condd.test \
 condincl.test \
 condincl2.test \
Index: tests/cond23.test
===================================================================
RCS file: tests/cond23.test
diff -N tests/cond23.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/cond23.test   19 Jun 2002 19:19:20 -0000
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Check that conditional redefinitions of AC_SUBST'ed variables are detected.
+# Report from Patrik Weiskircher
+
+. $srcdir/defs
+
+set -e
+
+cat >>configure.in <<EOF
+AM_CONDITIONAL([COND], [true])
+AC_OUTPUT
+EOF
+
+cat >Makefile.am <<EOF
+if COND
+libdir = mumble
+endif
+EOF
+
+$ACLOCAL
+$AUTOMAKE 2>stderr && exit 1
+grep 'libdir was already defined' stderr
Index: tests/cond24.test
===================================================================
RCS file: tests/cond24.test
diff -N tests/cond24.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/cond24.test   19 Jun 2002 19:19:20 -0000
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Check that conditional redefinitions of AC_SUBST'ed variables are detected.
+# Report from Patrik Weiskircher
+
+. $srcdir/defs
+
+set -e
+
+cat >>configure.in <<EOF
+AC_SUBST([foo], [bar])
+AM_CONDITIONAL([COND], [true])
+AC_OUTPUT
+EOF
+
+cat >Makefile.am <<EOF
+if COND
+foo = baz
+endif
+EOF
+
+$ACLOCAL
+$AUTOMAKE 2>stderr && exit 1
+grep 'foo was already defined' stderr

-- 
Alexandre Duret-Lutz




reply via email to

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