automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.1


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.1-534-g31893f6
Date: Sat, 30 Jun 2012 20:16:23 +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=31893f6ebc3e41182e5a811cea25410bd2c1170f

The branch, ng/master has been updated
       via  31893f6ebc3e41182e5a811cea25410bd2c1170f (commit)
       via  a211c68653dcd9bca99c0b8d00c3664218de0ec2 (commit)
       via  58e7287ebea30a82ee5cade0a424d55f64be2fb9 (commit)
       via  5621ff7b5ac49b19ac91c0dd1fac2e895abdaaba (commit)
      from  7a3a1b6d8b030312203c22e137f1d387566487b4 (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 31893f6ebc3e41182e5a811cea25410bd2c1170f
Author: Stefano Lattarini <address@hidden>
Date:   Sat Jun 30 21:58:28 2012 +0200

    [ng] remake: use '.am/nil' target instead of 'am--refresh'
    
    * lib/am/configure.am: Here.  No need to define another do-nothing
    target (i.e., 'am--refresh') now that already have a generic one
    (i.e., '.am/nil').
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit a211c68653dcd9bca99c0b8d00c3664218de0ec2
Author: Stefano Lattarini <address@hidden>
Date:   Sat Jun 30 21:53:30 2012 +0200

    [ng] gitignore: ignore '.am/' directories
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 58e7287ebea30a82ee5cade0a424d55f64be2fb9
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 27 18:05:06 2012 +0200

    [ng] warns: fix checks against typos in vars (e.g., _LDADD and _SOURCES)
    
    After commit v1.12.1-302-g67d6102 of 2012-06-05, "[ng] warns: typos in
    _SOURCES etc. reported at make runtime", the checks against typos in use
    of few special variables (like 'bar_SOURCES' or 'libfoo_a_LIBADD') are
    done at make runtime rather than at automake runtime.
    
    Such checks have so far been running unconditionally every time make was
    invoked, thus creating a noticeable performance degradation in null or
    almost-null builds of packages that, like GNU coreutils, have a lot of
    programs and/or use several recursive make invocations.
    
    What is worse, such checks have been unable to interact well with the
    Makefile automatic remake rules.  Say that a user encounters a failure
    in those checks; he then fixes his 'Makefile.am' accordingly, and re-run
    "make", expecting the situation to be sorted out by the automatic remake
    rules (as was the case for mainline Automake).  But that doesn't happen,
    because those same checks will run again *before* giving the remake rules
    a chance to kick in -- thus "make" would fail again, exactly as before,
    because the Makefile hasn't been rebuilt, and thus hasn't changed.
    So the user would forced to re-run automake and config.status *by hand* to
    get back a consistent, correct status in its build system!  Such situation
    is utterly unacceptable.
    
    The present change takes care at once of both of the performance and the
    correctness problems.
    
    On the performance side, after this change, the time for a null build
    on GNU coreutils (bootstrapped with Automake-NG) has gone down from ~8
    seconds to ~2 seconds.  Not bad!
    
    * automake.in (generate_makefile): Pass the '%MAKEFILE%' transform
    when processing 'check-typos.am'.
    * lib/am/check-typos.am: Take advantage of the GNU make automatic restart
    capabilities to re-implement the  existing check in a more "lazy" way:
    they should be re-run only when Makefile has changes, and only after the
    automatic remake rules has rebuilt it (if it needs to be rebuilt).
    * lib/am/header-vars.am (.am/nil): New do-nothing target, for now used
    only by 'check-typos.am'.
    * t/am-dir.sh: Adjust.
    * t/maken.sh: Likewise.
    * t/output6.sh: Likewise.
    * t/spell.sh: Likewise.
    * t/spell2.sh: Likewise.
    * t/vartypos-whitelist.sh: Likewise.
    * t/vartypos.sh: Likewise.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 5621ff7b5ac49b19ac91c0dd1fac2e895abdaaba
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 27 18:05:05 2012 +0200

    [ng] perf: disable GNU make builtin rules, for performance reasons
    
    * lib/am/header-vars (MAKEFLAGS): Append '--no-builtin-rules'.  This
    enhance performance by removing GNU make builtin rules that would be
    rather irrelevant (e.g., rules to automatically check out files from
    from RCS or SCCS repositories), or overridden by Automake (e.g., rules
    to compile C or C++ files).  With this simple tweak, the null-build
    time on GNU coreutils on an aging Debian system goes down from ~ 20
    seconds to ~ 9 seconds.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

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

Summary of changes:
 .gitignore              |    1 +
 automake.in             |    3 +-
 lib/am/check-typos.am   |   55 ++++++++++++++++++++++++++++++++++++++++++----
 lib/am/configure.am     |   26 ++++++---------------
 lib/am/header-vars.am   |   13 +++++++++++
 t/am-dir.sh             |    3 +-
 t/maken.sh              |    6 ++--
 t/output6.sh            |    8 +++++-
 t/spell.sh              |    4 +-
 t/spell2.sh             |    4 +-
 t/vartypos-whitelist.sh |   20 ++++++++++++----
 t/vartypos.sh           |   13 ++++++++--
 12 files changed, 114 insertions(+), 42 deletions(-)

diff --git a/.gitignore b/.gitignore
index e7af2a5..74ec0d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,6 +49,7 @@
 /t/pm/*.trs
 /t/perf/*.log
 /t/perf/*.trs
+.am/
 cscope.files
 cscope.in.out
 cscope.out
diff --git a/automake.in b/automake.in
index 4879602..97ccdab 100644
--- a/automake.in
+++ b/automake.in
@@ -6945,7 +6945,8 @@ sub generate_makefile ($$)
 
   my $output_checks = '';
   # See if any _SOURCES (or _LIBADD, or ...) variable were misspelled.
-  $output_checks .= preprocess_file ("$libdir/am/check-typos.am");
+  $output_checks .= preprocess_file ("$libdir/am/check-typos.am",
+                                     MAKEFILE => basename ($makefile));
   # Report errors (if any) seen at make runtime.
   $output_checks .= '$(if $(am__seen_error),' .
                     '$(error Some Automake-NG error occurred))' .
diff --git a/lib/am/check-typos.am b/lib/am/check-typos.am
index 71769c9..6e4b804 100644
--- a/lib/am/check-typos.am
+++ b/lib/am/check-typos.am
@@ -18,13 +18,29 @@
 ##    bin_PROGRAMS = bar
 ##    baz_SOURCES = main.c  # Should be bar_SOURCES.
 
-## FIXME: With this, we impose runtime penalty to all make runs.  Maybe we
-## FIXME: should make all these checks conditional to whether the user sets
-## FIXME: a AM_SANITY_CHECKS variable or something?
-
 ## FIXME: We should document the '.am/' namespace as reserved for automake
 ## FIXME: internals somewhere.
 
+## FIXME: we should document the user-settable AM_FORCE_SANITY_CHECKS
+## FIXME: variable, and its semantics.
+
+# Running these checks unconditionally can be quite wasteful, especially
+# for projects with lots of programs.  So run them only when the values
+# of the checked variables has possibly changed.  For the moment, we assume
+# this can only happen if the Makefile has been updated since the later
+# check.  And to give user more control, we also allow him to require these
+# checks run unconditionally, by setting AM_FORCE_SANITY_CHECKS to "yes".
+
+# The idiom we employ to implement our "lazy checking" relies on recursive
+# make invocations and creation of an auxiliary makefile fragments, and
+# such an approach do not interact very well with "make -n"; in such a case,
+# it's simpler and safer to go for "greedy checking".
+ifeq ($(am__make_dryrun),true)
+AM_FORCE_SANITY_CHECKS ?= yes
+endif
+
+ifeq ($(AM_FORCE_SANITY_CHECKS),yes)
+
 # Variables with these suffixes are candidates for typo checking.
 .am/vartypos/suffixes := _SOURCES _LIBADD _LDADD _LDFLAGS _DEPENDENCIES
 
@@ -49,7 +65,7 @@ ifeq "$(am__using_parallel_tests)" "yes"
 endif
 
 # Allow the user to add his own whitelist.
-# FIXME: this is still undocumtend!
+# FIXME: this is still undocumented!
 .am/vartypos/whitelisted-vars += $(AM_VARTYPOS_WHITELIST)
 
 # Canonicalized names of programs and libraries (vanilla or libtool) that
@@ -86,3 +102,32 @@ endef
 # separator" error from GNU make.
 $(eval $(foreach v,$(.am/vartypos/candidate-vars), \
                    $(call .am/vartypos/check,$v)))
+
+else # $(AM_FORCE_SANITY_CHECKS) != yes
+
+# We use "-include" rather than "include" to avoid getting, on the first
+# make run in a clean tree, the following annoying warning:
+#    Makefile: .am/check-typos-stamp.mk: No such file or directory
+# Although such a warning would *not* be an error in our setup, it still
+# is ugly and annoying enough to justify ...
+-include $(am__dir)/check-typos-stamp.mk
+
+# ... this workaround; which is required by the fact that, if a recipe
+# meant to rebuild a file included with "-include" file fails, the make
+# run itself is not considered failed (this is quite consistent with
+# the "-include" semantics).
+ifdef .am/sanity-checks-failed
+$(shell rm -f $(am__dir)/check-typos-stamp.mk)
+$(error Some Automake-NG sanity checks failed)
+else
+$(am__dir)/check-typos-stamp.mk: %MAKEFILE% | $(am__dir)
+       @if \
+         $(MAKE) --no-print-directory AM_FORCE_SANITY_CHECKS=yes .am/nil; \
+       then \
+         echo "# stamp" > $@; \
+       else \
+         echo ".am/sanity-checks-failed = yes" > $@; \
+       fi
+endif
+
+endif # $(AM_FORCE_SANITY_CHECKS) != yes
diff --git a/lib/am/configure.am b/lib/am/configure.am
index 7024e7b..ec276b9 100644
--- a/lib/am/configure.am
+++ b/lib/am/configure.am
@@ -14,16 +14,6 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-
-## This dummy rule is called from subdirectories whenever one of the
-## top-level Makefile's dependencies must be updated; it relies on
-## the fact that GNU make always make sure the Makefile is updated
-## before considering the other rules.
-if %?TOPDIR_P%
-.PHONY: am--refresh
-am--refresh:
-endif %?TOPDIR_P%
-
 ## --------------------- ##
 ## Building Makefile.*.  ##
 ## --------------------- ##
@@ -40,11 +30,11 @@ endif %?TOPDIR_P%
 ?TOPDIR_P?           echo ' cd $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS%'; \
 ?TOPDIR_P?           cd $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS% \
 ?TOPDIR_P?             && exit 0; \
-?!TOPDIR_P?          ( cd $(top_builddir) && $(MAKE) am--refresh ) \
+?!TOPDIR_P?          ( cd $(top_builddir) && $(MAKE) .am/nil ) \
 ## If on the other hand, subdir/Makefile.in has been removed, then toplevel
-## am--refresh will not be aware of any need to run.  We still invoke it
-## due to $? listing all prerequisites.  Fix up for it by running the rebuild
-## rule for this file only, below.
+## .am/nil will not be aware of any need to run.  We still invoke it due to
+## $? listing all prerequisites.  Fix up for it by running the rebuild rule
+## for this file only, below.
 ?!TOPDIR_P?            && { if test -f $@; then exit 0; else break; fi; }; \
              exit 1;; \
          esac; \
@@ -72,7 +62,7 @@ endif %?TOPDIR_P%
          *config.status*) \
 ?TOPDIR_P?         echo ' $(SHELL) ./config.status'; \
 ?TOPDIR_P?         $(SHELL) ./config.status;; \
-?!TOPDIR_P?        cd $(top_builddir) && $(MAKE) am--refresh;; \
+?!TOPDIR_P?        cd $(top_builddir) && $(MAKE) .am/nil;; \
          *) \
            echo ' cd $(top_builddir) && $(SHELL) ./config.status 
%CONFIG-MAKEFILE%'; \
            cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE%;; \
@@ -98,11 +88,11 @@ endif %?TOPDIR_P%
 
 $(top_builddir)/config.status: $(top_srcdir)/configure 
$(CONFIG_STATUS_DEPENDENCIES)
 ?TOPDIR_P?     $(SHELL) ./config.status --recheck
-?!TOPDIR_P?    cd $(top_builddir) && $(MAKE) am--refresh
+?!TOPDIR_P?    cd $(top_builddir) && $(MAKE) .am/nil
 
 $(top_srcdir)/configure: %MAINTAINER-MODE% $(am__configure_deps)
 ?TOPDIR_P?     cd $(srcdir) && $(AUTOCONF)
-?!TOPDIR_P?    cd $(top_builddir) && $(MAKE) am--refresh
+?!TOPDIR_P?    cd $(top_builddir) && $(MAKE) .am/nil
 
 
 ## ------------ ##
@@ -119,7 +109,7 @@ $(top_srcdir)/configure: %MAINTAINER-MODE% 
$(am__configure_deps)
 if %?REGEN-ACLOCAL-M4%
 $(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps)
 ?TOPDIR_P?     cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-?!TOPDIR_P?    cd $(top_builddir) && $(MAKE) am--refresh
+?!TOPDIR_P?    cd $(top_builddir) && $(MAKE) .am/nil
 
 ## Avoid the "deleted header file" problem for the dependencies.
 $(am__aclocal_m4_deps):
diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index eccfec5..d2486b6 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -16,6 +16,19 @@
 
 VPATH = @srcdir@
 
+## Enhance performance by removing GNU make builtin rules that would be
+## rather irrelevant (e.g., rules to automatically check out files from
+## from RCS or SCCS repositories), or overridden by Automake (e.g., rules
+## to compile C or C++ files).  For larger packages (like GNU coreutils),
+## this can greatly speed up null or almost-null builds, up to even 50%!
+MAKEFLAGS += --no-builtin-rules
+
+# For when we need a do-nothing target.  Add an actual rule to it to avoid
+# the annoying message "make[1]: Nothing to be done for .am/nil" from make.
+.PHONY: .am/nil
+.am/nil:
+       @:
+
 ## Declare an error, without immediately terminating the execution (proper
 ## code will take care later of that).  This will allow us to diagnose more
 ## issues at once, rather than stopping at the first one.
diff --git a/t/am-dir.sh b/t/am-dir.sh
index 373fa4f..fa101b3 100755
--- a/t/am-dir.sh
+++ b/t/am-dir.sh
@@ -70,7 +70,8 @@ do_check ()
   srcdir=$1
   $srcdir/configure
   $MAKE
-  find $d xsrc/$d | sort > got
+  # The grep is to ignore files used internally by Automake-NG.
+  find $d xsrc/$d | grep -v '\.mk$' | sort > got
   cat $srcdir/exp
   cat got
   diff $srcdir/exp got
diff --git a/t/maken.sh b/t/maken.sh
index 0caa12c..ec992bf 100755
--- a/t/maken.sh
+++ b/t/maken.sh
@@ -47,14 +47,14 @@ $AUTOCONF
 $AUTOMAKE
 ./configure
 
-echo stamp > stampfile
-$sleep
 for target in dist distcheck; do
+  echo stamp > stampfile
+  $sleep
   $MAKE -n $target
   $MAKE -n $target | grep stamp-sub-dist-hook
-  $MAKE test-no-distdir
   # No file has been actually touched or created.
   is_newest stampfile $(find .)
+  $MAKE test-no-distdir
 done
 
 :
diff --git a/t/output6.sh b/t/output6.sh
index bcba3a7..dcec358 100755
--- a/t/output6.sh
+++ b/t/output6.sh
@@ -51,12 +51,16 @@ EOF
 
 echo 'd = D' > d.in
 
+cat > GNUmakefile << 'END'
+include foo
+END
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
+
 ./configure
-$MAKE -f foo test1
+$MAKE test1
 
 $sleep
 cat >b.in <<'EOF'
@@ -66,6 +70,6 @@ c = F
 d = F
 EOF
 
-$MAKE -f foo test2
+$MAKE test2
 
 :
diff --git a/t/spell.sh b/t/spell.sh
index 9946691..0c339b6 100755
--- a/t/spell.sh
+++ b/t/spell.sh
@@ -41,12 +41,12 @@ $AUTOMAKE
 $MAKE 2>stderr && { cat stderr >&2; exit 1; }
 cat stderr >&2
 
-LC_ALL=C sed 's/^Makefile:[0-9][0-9]*: //' stderr > got
+LC_ALL=C sed -e 's/^Makefile:[0-9][0-9]*: //' \
+             -e '/^\*\*\*.*Automake-NG/d' stderr > got
 
 cat > exp << 'END'
 variable 'boo_SOURCES' is defined but no program
   or library has 'boo' as canonical name
-*** Some Automake-NG error occurred.  Stop.
 END
 
 diff exp got
diff --git a/t/spell2.sh b/t/spell2.sh
index 6bc7e11..368080b 100755
--- a/t/spell2.sh
+++ b/t/spell2.sh
@@ -41,12 +41,12 @@ $AUTOMAKE
 $MAKE 2>stderr && { cat stderr >&2; exit 1; }
 cat stderr >&2
 
-LC_ALL=C sed 's/^Makefile:[0-9][0-9]*: //' stderr > got
+LC_ALL=C sed -e 's/^Makefile:[0-9][0-9]*: //' \
+             -e '/^\*\*\*.*Automake-NG/d' stderr > got
 
 cat > exp << 'END'
 variable 'qardoz_LDADD' is defined but no program
   or library has 'qardoz' as canonical name
-*** Some Automake-NG error occurred.  Stop.
 END
 
 diff exp got
diff --git a/t/vartypos-whitelist.sh b/t/vartypos-whitelist.sh
index e886fc3..dba624c 100755
--- a/t/vartypos-whitelist.sh
+++ b/t/vartypos-whitelist.sh
@@ -21,6 +21,12 @@
 required=cc
 . ./defs || exit 1
 
+edit ()
+{
+  file=$1; shift
+  "$@" <$file >t && mv -f t $file || fatal_ "editing $file"
+}
+
 cat >> configure.ac << 'END'
 AC_PROG_CC
 AM_PROG_AR
@@ -93,17 +99,21 @@ $AUTOMAKE -a
 ./configure
 $MAKE
 
+# Sanity check the distribution.
+$MAKE distcheck
+
 # If we remove the whitelisting, failure ensues.
-$MAKE AM_VARTYPOS_WHITELIST= 2>stderr && { cat stderr; exit 1; }
+sed '/^AM_VARTYPOS_WHITELIST *=/d' <Makefile.am >t && mv -f t Makefile.am \
+  || fatal_ "editing Makefile.am"
+$MAKE 2>stderr && { cat stderr; exit 1; }
 cat stderr >&2
 grep "'copy_LDADD' is defined but no program" stderr
 grep "'remove_LDADD' is defined but no program" stderr
-$MAKE AM_VARTYPOS_WHITELIST=remove_LDADD 2>stderr && { cat stderr; exit 1; }
+
+$MAKE AM_VARTYPOS_WHITELIST=remove_LDADD AM_FORCE_SANITY_CHECK=yes \
+  2>stderr && { cat stderr; exit 1; }
 cat stderr >&2
 grep "'copy_LDADD' is defined but no program" stderr
 grep "remove_LDADD" stderr && exit 1
 
-# Sanity check the distribution.
-$MAKE distcheck
-
 :
diff --git a/t/vartypos.sh b/t/vartypos.sh
index 9048c20..f612a0b 100755
--- a/t/vartypos.sh
+++ b/t/vartypos.sh
@@ -101,9 +101,16 @@ lib_LIBRARIES = libfoo.a
 lib_LTLIBRARIES = libbar.la
 END
 
-# FIXME!  We have to remake the Makefile by hand!  This is unacceptable.
-$AUTOMAKE Makefile
-./config.status Makefile
 $MAKE nihil
 
+# If further errors are introduced, they are reported.
+$sleep
+echo none_SOURCES = >> Makefile.am
+
+$MAKE nihil 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+
+grep "variable 'none_SOURCES'" stderr
+grep "'none' as canonical name" stderr
+
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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