automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-610-g


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-610-gcec3f32
Date: Fri, 30 Dec 2011 12:50:36 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=cec3f327d5b70c8dba59485f221813e281cc972c

The branch, maint has been updated
       via  cec3f327d5b70c8dba59485f221813e281cc972c (commit)
       via  c87ceb55d579658ff47f1d99dfc23ca985fc1cd6 (commit)
       via  a2a44d35b70dbd65d6e019134780461c94a16db2 (commit)
       via  0eaa8781bf043b34aaae0309f17aeb7943dbe4c7 (commit)
       via  8493499b54da3694f820fa7eab5e58ef44448b66 (commit)
      from  5f71f2b5b631f59f9244ec2ef93d6705a76aa917 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cec3f327d5b70c8dba59485f221813e281cc972c
Merge: 5f71f2b c87ceb5
Author: Stefano Lattarini <address@hidden>
Date:   Fri Dec 30 13:47:57 2011 +0100

    Merge remote-tracking branch 'silent-fixes' into maint
    
    * origin/silent-fixes:
      fix: last entry in ChangeLog
      tests: tweak tests on silent-rules for makes without nested vars
      silent-rules: fallback for makes without nested vars

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog.11                  |   63 +++++++++++++++++
 NEWS                          |    7 ++
 automake.in                   |    9 ++-
 doc/automake.texi             |   25 ++++---
 m4/silent.m4                  |   34 +++++++++-
 tests/Makefile.am             |    1 +
 tests/silent-nested-vars.test |  149 +++++++++++++++++++++++++++++++++++++++++
 tests/silent6.test            |   14 +++-
 8 files changed, 283 insertions(+), 19 deletions(-)
 create mode 100755 tests/silent-nested-vars.test

diff --git a/ChangeLog.11 b/ChangeLog.11
index 0c37e16..234bf2f 100644
--- a/ChangeLog.11
+++ b/ChangeLog.11
@@ -72,6 +72,69 @@
        respectively.
        * NEWS: Update.
 
+2011-12-26  Stefano Lattarini  <address@hidden>
+
+       tests: tweak tests on silent-rules for makes without nested vars
+       * tests/silent-nested-vars.test: Define $MAKE to `./mymake' in
+       the environment, so that it will be automatically picked up by
+       configure.  Related tweaks and simplifications.
+       Remove the checks verifying that silent rules are respected also
+       when the 'subdir-objects' option is set, the checks testing the
+       old syntax for user-defined silent rules, and the tests using
+       the default $MAKE programs: they are redundant w.r.t. other test
+       cases.  Related simplifications.
+       Remove the temporary files used in a sanity check as soon as they
+       are not needed anymore.
+       Do not capture also the standard error of configure: we only want
+       to grep its standard output.
+       Consistently use `stdout' for the name of files where to save the
+       standard output captured from make and configure, for consistency
+       with other tests.
+       Make grepping of configure output and of the generated Makefile
+       stricter.
+       Improve and tweak the `mymake' script a little.
+       * tests/silent6.test: Make grepping of make stdout slightly
+       stricter.  After having configured with silent rules disabled,
+       try to force the use silent rules with `make V=1'.
+
+2011-12-25  Paul Eggert  <address@hidden>
+
+       silent-rules: fallback for makes without nested vars
+
+       This fixes two problems reported for Automake (Bug#9928, Bug#10237)
+       and is in response to a bug report for building coreutils on HP
+       NonStop OS (Bug#10234).  The problem is that HP NonStop 'make'
+       treats a line like "AM_V_CC = $(am__v_CC_$(V))" as one that
+       expands a macro with the funny name am__v_CC_$(V instead of the
+       desired name am__v_CC_1 or am__v_CC_0, and since the funny macro
+       is not defined the line is equivalent to "AM_V_CC = )"; this
+       inserts a stray ")" when $(AM_V_CC) is used, which eventually
+       causes 'make' to fail.
+
+       The basic idea is that instead of generating Makefile.in lines like
+       "AM_V_CC = $(am__v_CC_$(V))", we generate
+       "AM_V_CC = $(address@hidden@)".  We then AC_SUBST $(V) for @AM_V@
+       in the usual case where `make' supports nested variables,
+       and substitute 1 (or 0) otherwise.  Similarly for usages like
+       $(am__v_CC_$(AM_DEFAULT_VERBOSITY)).
+
+       With this change, make implementations that doesn't grasp nested
+       variable expansions will still be able to run Makefiles generated
+       using the silent-rules option.  They won't allow the user to
+       override the make verbosity at runtime through redefinition of
+       $(V) (as in "make V=0"); but this is still an improvement over not
+       being able to work at all.
+
+       * NEWS: Document this.
+       * automake.in (define_verbose_var): When defining the variables,
+       use @AM_V@ rather than $(V), and use @AM_DEFAULT_V@ rather than
+       $(AM_DEFAULT_VERBOSITY).
+       * doc/automake.texi (Automake silent-rules Option): Explain new system.
+       * m4/silent.m4 (AM_SILENT_RULES): Check whether `make' supports
+       nested variables, and substitute AM_V and AM_DEFAULT_V accordingly.
+       * tests/silent-nested-vars.test: New test.
+       * tests/Makefile.am (TESTS): Add it.
+
 2011-12-24  Stefano Lattarini  <address@hidden>
 
        gitignore: use only one .gitignore file, in the top-level directory
diff --git a/NEWS b/NEWS
index f6eb29f..0c0a2dc 100644
--- a/NEWS
+++ b/NEWS
@@ -90,6 +90,13 @@ Bugs fixed in 1.11.0a:
     not used, `make' output no longer contains spurious backslash-only
     lines, thus once again matching what Automake did before 1.11.
 
+  - The `silent-rules' option now generates working makefiles even for
+    the uncommon `make' implementations that do not support the
+    nested-variables extension to POSIX 2008.  For such `make'
+    implementations, whether a build is silent is determined at
+    configure time, and cannot be overridden at make time with
+    `make V=0' or `make V=1'.
+
   - The AM_COND_IF macro also works if the shell expression for the conditional
     is no longer valid for the condition.
 
diff --git a/automake.in b/automake.in
index 309eade..7efb7d5 100644
--- a/automake.in
+++ b/automake.in
@@ -1161,9 +1161,12 @@ sub define_verbose_var ($$)
     my $silent_var = $pvar . '_0';
     if (option 'silent-rules')
       {
-       # Using `$V' instead of `$(V)' breaks IRIX make.
-       define_variable ($var, '$(' . $pvar . '_$(V))', INTERNAL);
-       define_variable ($pvar . '_', '$(' . $pvar . 
'_$(AM_DEFAULT_VERBOSITY))', INTERNAL);
+       # For typical `make's, `configure' replaces AM_V (inside @@) with $(V)
+       # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY).
+       # For strict POSIX 2008 `make's, it replaces them with 0 or 1 instead.
+       # See AM_SILENT_RULES in m4/silent.m4.
+       define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL);
+       define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)', 
INTERNAL);
        Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE, $val,
                                    '', INTERNAL, VAR_ASIS)
          if (! vardef ($silent_var, TRUE));
diff --git a/doc/automake.texi b/doc/automake.texi
index bd8ffbe..e155fd1 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -10138,18 +10138,23 @@ For portability to different @command{make} 
implementations, package authors
 are advised to not set the variable @code{V} inside the @file{Makefile.am}
 file, to allow the user to override the value for subdirectories as well.
 
-The current implementation of this feature relies on a non-POSIX, but in
-practice rather widely supported @file{Makefile} construct of nested
-variable expansion @samp{$(@var{var1}$(V))}.  Do not use the
address@hidden option if your package needs to build with
address@hidden implementations that do not support it.  The
address@hidden option turns off warnings about recursive variable
-expansion, which are in turn enabled by @option{-Wportability}
-(@pxref{automake Invocation}).
+The current implementation of this feature normally uses nested
+variable expansion @samp{$(@var{var1}$(V))}, a @file{Makefile} feature
+that is not required by POSIX 2008 but is widely supported in
+practice.  The @option{silent-rules} option thus turns off warnings
+about recursive variable expansion, which are in turn enabled by
address@hidden (@pxref{automake Invocation}).  On the rare
address@hidden implementations that do not support nested variable
+expansion, whether rules are silent is always determined at configure
+time, and cannot be overridden at make time.  Future versions of POSIX
+are likely to require nested variable expansion, so this minor
+limitation should go away with time.
 
 @vindex @code{AM_V_GEN}
 @vindex @code{AM_V_at}
 @vindex @code{AM_DEFAULT_VERBOSITY}
address@hidden @code{AM_V}
address@hidden @code{AM_DEFAULT_V}
 To extend the silent mode to your own rules, you have two choices:
 
 @itemize @bullet
@@ -10165,8 +10170,8 @@ The following snippet shows how you would define your 
own equivalent of
 @code{AM_V_GEN}:
 
 @example
-pkg_verbose = $(pkg_verbose_$(V))
-pkg_verbose_ = $(pkg_verbose_$(AM_DEFAULT_VERBOSITY))
+pkg_verbose = $(pkg_verbose_@@AM_V@@)
+pkg_verbose_ = $(pkg_verbose_@@AM_DEFAULT_V@@)
 pkg_verbose_0 = @@echo PKG-GEN $@@;
 
 foo: foo.in
diff --git a/m4/silent.m4 b/m4/silent.m4
index 6d2a1a2..8bd931b 100644
--- a/m4/silent.m4
+++ b/m4/silent.m4
@@ -1,11 +1,11 @@
 ##                                                          -*- Autoconf -*-
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009, 2011  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 1
+# serial 2
 
 # AM_SILENT_RULES([DEFAULT])
 # --------------------------
@@ -20,6 +20,36 @@ yes) AM_DEFAULT_VERBOSITY=0;;
 no)  AM_DEFAULT_VERBOSITY=1;;
 *)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
 esac
+dnl
+dnl A few `make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using `$V' instead of `$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
 AM_BACKSLASH='\'
 AC_SUBST([AM_BACKSLASH])dnl
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6ce7c53..21afdf4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -760,6 +760,7 @@ silent-many-gcc.test \
 silent-many-generic.test \
 silent-lex-gcc.test \
 silent-lex-generic.test \
+silent-nested-vars.test \
 silent-yacc-gcc.test \
 silent-yacc-generic.test \
 silent-configsite.test \
diff --git a/tests/silent-nested-vars.test b/tests/silent-nested-vars.test
new file mode 100755
index 0000000..0024b5d
--- /dev/null
+++ b/tests/silent-nested-vars.test
@@ -0,0 +1,149 @@
+#!/bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program 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.
+#
+# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check silent-rules mode, on 'make' implementations that do not
+# support nested variables (Bug#9928, Bug#10237).
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo bar
+bar_CFLAGS = $(AM_CFLAGS)
+
+# Check that AM_V and AM_DEFAULT_V work as advertised.
+pkg_verbose = $(address@hidden@)
+pkg_verbose_ = $(address@hidden@)
+pkg_verbose_0 = @echo PKG-GEN $@;
+
+bin_SCRIPTS = oop
+oop:
+       $(pkg_verbose)echo $@ >$@
+
+mostlyclean-local:
+       rm -f oop
+EOF
+
+cat > foo.c <<'EOF'
+int main ()
+{
+  return 0;
+}
+EOF
+cp foo.c bar.c
+
+cat >mymake <<'EOF'
+#! /bin/sh
+makerules=
+
+case $1 in
+  -f)
+    makefile=$2
+    case $2 in
+      -) makerules=`cat` || exit ;;
+    esac ;;
+  *)
+    for makefile in makefile Makefile; do
+      test -f $makefile && break
+    done ;;
+esac
+
+nested_var_pat='^[^#].*\$([^)]*\$'
+if
+  case $makefile in
+    -) printf '%s\n' "$makerules" | grep "$nested_var_pat";;
+    *) grep "$nested_var_pat" $makefile;;
+  esac
+then
+  echo >&2 "mymake: $makefile contains nested variables"
+  exit 1
+fi
+
+case $makefile in
+  -) printf '%s\n' "$makerules" | $mymake_MAKE "$@";;
+  *) exec $mymake_MAKE "$@";;
+esac
+EOF
+chmod a+x mymake
+mymake_MAKE=${MAKE-make}
+MAKE=./mymake
+export MAKE mymake_MAKE
+
+# As a sanity check, verify that `mymake' rejects Makefiles that
+# use nested variables.
+cat > Makefile <<'END'
+a = $(b$(c))
+all:
+       touch bar
+END
+$MAKE && Exit 99
+mv -f Makefile foo.mk
+$MAKE -f foo.mk && Exit 99
+cat foo.mk | $MAKE -f - && Exit 99
+test -f bar && Exit 99
+sed '/a =/d' foo.mk > Makefile
+$MAKE && test -f bar || Exit 99
+rm -f bar Makefile foo.mk
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure --enable-silent-rules >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^checking whether \./mymake supports nested variables\.\.\. no *$' \
+  stdout
+$EGREP 'CC|AM_V|GEN' Makefile # For debugging.
+grep '^AM_V_CC =  *\$(am__v_CC_0) *$' Makefile
+grep '^AM_V_GEN =  *\$(am__v_GEN_0) *$' Makefile
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+$EGREP ' (-c|-o)' stdout && Exit 1
+grep 'mv ' stdout && Exit 1
+grep 'echo .*oop' stdout && Exit 1
+grep 'CC .*foo\.' stdout
+grep 'CC .*bar\.' stdout
+grep 'CCLD .*foo' stdout
+grep 'CCLD .*bar' stdout
+grep 'PKG-GEN .*oop' stdout
+$MAKE distclean
+
+./configure --disable-silent-rules > stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^checking whether \./mymake supports nested variables\.\.\. no *$' \
+  stdout
+$EGREP 'CC|AM_V|GEN' Makefile # For debugging.
+grep '^AM_V_CC =  *\$(am__v_CC_1) *$' Makefile
+grep '^AM_V_GEN =  *\$(am__v_GEN_1) *$' Makefile
+
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout
+grep ' -o foo' stdout
+grep ' -o bar' stdout
+grep 'echo .*>oop' stdout
+$EGREP '(CC|LD) ' stdout && Exit 1
+
+:
diff --git a/tests/silent6.test b/tests/silent6.test
index acd9cea..0e474af 100755
--- a/tests/silent6.test
+++ b/tests/silent6.test
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -47,14 +47,14 @@ $AUTOCONF
 ./configure --enable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'GEN foo' stdout
+grep '^ *GEN foo *$' stdout
 grep 'cp ' stdout && Exit 1
 
 $MAKE clean
 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'GEN ' stdout && Exit 1
-grep 'cp ' stdout
+grep 'cp \.*/foo\.in foo' stdout
 
 $MAKE distclean
 
@@ -62,7 +62,13 @@ $MAKE distclean
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'GEN ' stdout && Exit 1
-grep 'cp ' stdout
+grep 'cp \.*/foo\.in foo' stdout
+
+$MAKE clean
+$MAKE V=0 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^ *GEN foo *$' stdout
+grep 'cp ' stdout && Exit 1
 
 $MAKE distclean
 


hooks/post-receive
-- 
GNU Automake



reply via email to

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