]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.in (%ignored_configure_vars): New variable.
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 9 Apr 2006 07:46:56 +0000 (07:46 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 9 Apr 2006 07:46:56 +0000 (07:46 +0000)
(scan_autoconf_traces): Trace for _AM_SUBST_NOTMAKE and fill
%ignored_configure_vars.
(define_configure_variable): Declare ignored configure variables
as VAR_SILENT.  Do not special-case AMDEPBACKSLASH and ANSI2KNR
w.r.t. VAR_SILENT.
* m4/substign.m4: New file.
* m4/Makefile.am (dist_m4data_DATA): Add substign.m4.
* m4/cond.m4: _AM_SUBST_IGNORE $1_TRUE and $1_FALSE (PR automake/477).
* m4/depend.m4: _AM_SUBST_IGNORE AMDEPBACKSLASH.
* m4/protos.m4: _AM_SUBST_IGNORE ANSI2KNR.
* tests/cond.test: Make sure TEST_FALSE and TEST_TRUE are not defined.
* tests/amsubst.test: New file.
* tests/Makefile.am (TESTS): Add it.

14 files changed:
ChangeLog
automake.in
doc/stamp-vti
doc/version.texi
m4/Makefile.am
m4/Makefile.in
m4/cond.m4
m4/depend.m4
m4/protos.m4
m4/substnot.m4 [new file with mode: 0644]
tests/Makefile.am
tests/Makefile.in
tests/amsubst.test [new file with mode: 0755]
tests/cond.test

index 080802f297e382d8410fd50c1cbe1c9e517373fd..3610681ed221d7d1034dc9bffb7221160371e5a3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2006-04-09  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * automake.in (%ignored_configure_vars): New variable.
+       (scan_autoconf_traces): Trace for _AM_SUBST_NOTMAKE and fill
+       %ignored_configure_vars.
+       (define_configure_variable): Declare ignored configure variables
+       as VAR_SILENT.  Do not special-case AMDEPBACKSLASH and ANSI2KNR
+       w.r.t. VAR_SILENT.
+       * m4/substign.m4: New file.
+       * m4/Makefile.am (dist_m4data_DATA): Add substign.m4.
+       * m4/cond.m4: _AM_SUBST_IGNORE $1_TRUE and $1_FALSE (PR automake/477).
+       * m4/depend.m4: _AM_SUBST_IGNORE AMDEPBACKSLASH.
+       * m4/protos.m4: _AM_SUBST_IGNORE ANSI2KNR.
+       * tests/cond.test: Make sure TEST_FALSE and TEST_TRUE are not defined.
+       * tests/amsubst.test: New file.
+       * tests/Makefile.am (TESTS): Add it.
+
 2006-04-09  Stepan Kasal  <kasal@ucw.cz>
            Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
index 2ba82fc2857c6e991394b2d42bbf62c634d59ca6..8c2269240700b5f7ad0127eb6bb4e5911ac8b3bb 100755 (executable)
@@ -390,6 +390,10 @@ my $seen_automake_version = 0;
 # generation.
 my %configure_vars = ();
 
+# Ignored configure substitutions (i.e., variables not to be output in
+# Makefile.in)
+my %ignored_configure_vars = ();
+
 # Files included by $configure_ac.
 my @configure_deps = ();
 
@@ -4808,6 +4812,7 @@ sub scan_autoconf_traces ($)
                AM_INIT_AUTOMAKE => 0,
                AM_MAINTAINER_MODE => 0,
                AM_PROG_CC_C_O => 0,
+                _AM_SUBST_NOTMAKE => 1,
                LT_SUPPORTED_TAG => 1,
                _LT_AC_TAGCONFIG => 0,
                m4_include => 1,
@@ -4919,6 +4924,12 @@ sub scan_autoconf_traces ($)
        {
          $libsources{$args[1]} = $here;
        }
+      elsif ($macro eq 'AC_REQUIRE_AUX_FILE')
+       {
+          # Only remember the first time a file is required.
+         $required_aux_file{$args[1]} = $where
+            unless exists $required_aux_file{$args[1]};
+       }
       elsif ($macro eq 'AC_SUBST_TRACE')
        {
          # Just check for alphanumeric in AC_SUBST_TRACE.  If you do
@@ -4976,11 +4987,9 @@ sub scan_autoconf_traces ($)
        {
          $seen_cc_c_o = $where;
        }
-      elsif ($macro eq 'AC_REQUIRE_AUX_FILE')
+      elsif ($macro eq '_AM_SUBST_NOTMAKE')
        {
-          # Only remember the first time a file is required.
-         $required_aux_file{$args[1]} = $where
-            unless exists $required_aux_file{$args[1]};
+         $ignored_configure_vars{$args[1]} = $where;
        }
       elsif ($macro eq 'm4_include'
             || $macro eq 'm4_sinclude'
@@ -5874,16 +5883,16 @@ sub define_configure_variable ($)
   my $pretty = VAR_ASIS;
   my $owner = VAR_CONFIGURE;
 
-  # Do not output the ANSI2KNR configure variable -- we AC_SUBST
-  # it in protos.m4, but later redefine it elsewhere.  This is
-  # pretty hacky.  We also don't output AMDEPBACKSLASH: it might
-  # be subst'd by `\', which certainly would not be appreciated by
-  # Make.
-  if ($var eq 'ANSI2KNR' || $var eq 'AMDEPBACKSLASH')
-    {
-      $pretty = VAR_SILENT;
-      $owner = VAR_AUTOMAKE;
-    }
+  # Some variables we do not want to output.  For instance it
+  # would be a bad idea to output `U = @U@` when `@U@` can be
+  # substituted as `\`.
+  $pretty = VAR_SILENT if exists $ignored_configure_vars{$var};
+
+  # ANSI2KNR is a variable that Automake wants to redefine, so
+  # it must be owned by Automake.  (It is also used as a proof
+  # that AM_C_PROTOTYPES has been run, that's why we do not simply
+  # omit the AC_SUBST.)
+  $owner = VAR_AUTOMAKE if $var eq 'ANSI2KNR';
 
   Automake::Variable::define ($var, $owner, '', TRUE, subst $var,
                              '', $configure_vars{$var}, $pretty);
index c1479715084d4b9abee9d74719ff6c96e7356b2a..73fcf7acf84c296d6db73be2b6a1026109516641 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 25 March 2006
-@set UPDATED-MONTH March 2006
+@set UPDATED 9 April 2006
+@set UPDATED-MONTH April 2006
 @set EDITION 1.9a
 @set VERSION 1.9a
index c1479715084d4b9abee9d74719ff6c96e7356b2a..73fcf7acf84c296d6db73be2b6a1026109516641 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 25 March 2006
-@set UPDATED-MONTH March 2006
+@set UPDATED 9 April 2006
+@set UPDATED-MONTH April 2006
 @set EDITION 1.9a
 @set VERSION 1.9a
index 3866cf77acb8e18efde6d167d001a2cc61daf712..adc77e68751b5c86117a4dd129f4f952250db1f7 100644 (file)
@@ -2,7 +2,7 @@
 
 ## Makefile for Automake m4.
 
-## Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
+## Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2006
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -54,6 +54,7 @@ regex.m4 \
 runlog.m4 \
 sanity.m4 \
 strip.m4 \
+substnot.m4 \
 tar.m4
 
 EXTRA_DIST = dirlist amversion.in
index c3078fdeb90ba5e74405f4bd1a0fa92c1ec9c5e6..244fbe664620b973ba820c76af7dec50f633326a 100644 (file)
@@ -174,6 +174,7 @@ regex.m4 \
 runlog.m4 \
 sanity.m4 \
 strip.m4 \
+substnot.m4 \
 tar.m4
 
 EXTRA_DIST = dirlist amversion.in
index a8131aeea463779da0c8f743342a65aa90b36a44..d9a58d2f39adfc28def27112953aba0885b69104 100644 (file)
@@ -1,13 +1,13 @@
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
+# serial 8
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
@@ -16,8 +16,10 @@ AC_DEFUN([AM_CONDITIONAL],
 [AC_PREREQ(2.52)dnl
  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
 if $2; then
   $1_TRUE=
   $1_FALSE='#'
index b733ad30395749092a7c6e419b634286935c2f85..85abd9305b4365acd62e0ffc5a8cf9c844448333 100644 (file)
@@ -1,13 +1,12 @@
 ##                                                          -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
+# serial 9
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -152,5 +151,6 @@ if test "x$enable_dependency_tracking" != xno; then
   AMDEPBACKSLASH='\'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 ])
index fdc4916523783c0273647c83f5dca0c8b23c51cb..427193b931ef031df4bb78c884f17a6ce71ce27c 100644 (file)
@@ -2,14 +2,14 @@
 ## Check for function prototypes.  ##
 ## From Franc,ois Pinard           ##
 ## ------------------------------- ##
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005
+# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 AC_DEFUN([AM_C_PROTOTYPES],
 [AC_REQUIRE([AC_C_PROTOTYPES])
@@ -20,9 +20,10 @@ else
 fi
 # Ensure some checks needed by ansi2knr itself.
 AC_REQUIRE([AC_HEADER_STDC])
-AC_CHECK_HEADERS(string.h)
-AC_SUBST(U)dnl
-AC_SUBST(ANSI2KNR)dnl
+AC_CHECK_HEADERS([string.h])
+AC_SUBST([U])dnl
+AC_SUBST([ANSI2KNR])dnl
+_AM_SUBST_NOTMAKE([ANSI2KNR])dnl
 ])
 
 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
diff --git a/m4/substnot.m4 b/m4/substnot.m4
new file mode 100644 (file)
index 0000000..27d3f1f
--- /dev/null
@@ -0,0 +1,12 @@
+##                                                          -*- Autoconf -*-
+# Copyright (C) 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
index d987f20f1dfb8382fa087c2a49a288eaef8ef2ec..7043468f5b6b5b6094a4bfa089b10c272726e53a 100644 (file)
@@ -39,6 +39,7 @@ alpha.test \
 alpha2.test \
 amassign.test \
 ammissing.test \
+amsubst.test \
 ansi.test \
 ansi2.test \
 ansi3.test \
index 6a825df16e2005b344303da4d1ac8075a080bdbd..7032e1826368d7a0cf6da204abebf71c4cd7915c 100644 (file)
@@ -38,30 +38,30 @@ TESTS = aclibobj.test aclocal.test aclocal3.test aclocal4.test \
        acloca21.test acoutnoq.test acoutpt.test acoutpt2.test \
        acoutqnl.test acoutbs.test acsilent.test acsubst.test \
        acsubst2.test all.test alloca.test alloca2.test alpha.test \
-       alpha2.test amassign.test ammissing.test ansi.test ansi2.test \
-       ansi3.test ansi3b.test ansi4.test ansi5.test ansi6.test \
-       ansi7.test ansi8.test ansi9.test ansi10.test ar.test ar2.test \
-       asm.test autohdr.test autohdr2.test autohdr3.test \
-       autohdr4.test automake.test auxdir.test auxdir2.test \
-       auxdir3.test auxdir4.test backsl.test backsl2.test \
-       backsl3.test backsl4.test badline.test badprog.test block.test \
-       bsource.test canon.test canon2.test canon3.test canon4.test \
-       canon5.test ccnoco.test ccnoco2.test check.test check2.test \
-       check3.test check4.test check5.test checkall.test clean.test \
-       clean2.test colneq.test colneq2.test colon.test colon2.test \
-       colon3.test colon4.test colon5.test colon6.test colon7.test \
-       comment.test comment2.test comment3.test comment4.test \
-       comment5.test comment6.test comment7.test comment8.test \
-       comment9.test commen10.test compile.test \
-       compile_f90_c_cxx.test compile_f_c_cxx.test cond.test \
-       cond2.test cond3.test cond4.test cond5.test cond6.test \
-       cond7.test cond8.test cond9.test cond10.test cond11.test \
-       cond13.test cond14.test cond15.test cond16.test cond17.test \
-       cond18.test cond19.test cond20.test cond21.test cond22.test \
-       cond23.test cond24.test cond25.test cond26.test cond27.test \
-       cond28.test cond29.test cond30.test cond31.test cond32.test \
-       cond33.test cond34.test cond35.test cond36.test cond37.test \
-       cond38.test condd.test condhook.test condinc.test \
+       alpha2.test amassign.test ammissing.test amsubst.test \
+       ansi.test ansi2.test ansi3.test ansi3b.test ansi4.test \
+       ansi5.test ansi6.test ansi7.test ansi8.test ansi9.test \
+       ansi10.test ar.test ar2.test asm.test autohdr.test \
+       autohdr2.test autohdr3.test autohdr4.test automake.test \
+       auxdir.test auxdir2.test auxdir3.test auxdir4.test backsl.test \
+       backsl2.test backsl3.test backsl4.test badline.test \
+       badprog.test block.test bsource.test canon.test canon2.test \
+       canon3.test canon4.test canon5.test ccnoco.test ccnoco2.test \
+       check.test check2.test check3.test check4.test check5.test \
+       checkall.test clean.test clean2.test colneq.test colneq2.test \
+       colon.test colon2.test colon3.test colon4.test colon5.test \
+       colon6.test colon7.test comment.test comment2.test \
+       comment3.test comment4.test comment5.test comment6.test \
+       comment7.test comment8.test comment9.test commen10.test \
+       compile.test compile_f90_c_cxx.test compile_f_c_cxx.test \
+       cond.test cond2.test cond3.test cond4.test cond5.test \
+       cond6.test cond7.test cond8.test cond9.test cond10.test \
+       cond11.test cond13.test cond14.test cond15.test cond16.test \
+       cond17.test cond18.test cond19.test cond20.test cond21.test \
+       cond22.test cond23.test cond24.test cond25.test cond26.test \
+       cond27.test cond28.test cond29.test cond30.test cond31.test \
+       cond32.test cond33.test cond34.test cond35.test cond36.test \
+       cond37.test cond38.test condd.test condhook.test condinc.test \
        condinc2.test condlib.test condman.test condman2.test \
        conf2.test confdeps.test conff.test conff2.test confh.test \
        confh4.test confh5.test config.test confincl.test conflnk.test \
diff --git a/tests/amsubst.test b/tests/amsubst.test
new file mode 100755 (executable)
index 0000000..158f8db
--- /dev/null
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Copyright (C) 2006  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., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Check for _AM_SUBST_NOTMAKE.
+
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_SUBST([backslash], "\\")
+_AM_SUBST_NOTMAKE([backslash])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+test:
+       @echo $(backslash) @backslash@$$
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+# If _AM_SUBST_NOTMAKE is not honored, the backslash
+# variable will not be empty.
+$MAKE test | grep '^[$]$'
index 583fc024d61a9110ae0c97c5628c41ec9b011f04..3ca915a51361c671c56594d717e3aed5d930bb79 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1997, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1997, 2001, 2002, 2006  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
 
 . ./defs || exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
 AM_CONDITIONAL(TEST, true)
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -37,11 +37,10 @@ VAR = false
 endif
 END
 
-set -e
-$ACLOCAL || exit 1
+$ACLOCAL
 $AUTOMAKE
 
+grep '^TEST_FALSE' Makefile.in && exit 1
+grep '^TEST_TRUE' Makefile.in && exit 1
 grep '^@TEST_TRUE@VAR = true$' Makefile.in
 grep '^@TEST_FALSE@VAR = false$' Makefile.in
-
-exit 0