automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, java-work, updated. v1.11-4


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, java-work, updated. v1.11-472-gdf73c36
Date: Sat, 10 Sep 2011 22:49:21 +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=df73c36180fe7e822f4dbdfa9de4c460f8c8b795

The branch, java-work has been updated
       via  df73c36180fe7e822f4dbdfa9de4c460f8c8b795 (commit)
       via  5e4631085ef78ab2385429e123006e9daa1e7d7d (commit)
       via  4412308796486424c901342ea9361cd0ce597184 (commit)
       via  2d5a0d87ddeaaab474e4fc1d9816feb275711384 (commit)
       via  30f99cbd07736c96603d15346fc8ad9097a0dddd (commit)
      from  829c04e73e888e8d03371f20707a8e993c217d15 (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 df73c36180fe7e822f4dbdfa9de4c460f8c8b795
Merge: 829c04e 5e46310
Author: Stefano Lattarini <address@hidden>
Date:   Sun Sep 11 00:47:24 2011 +0200

    Merge branch 'maint' into java-work
    
    * maint:
      tests: fix spurious failure on fast machines
      aclocal: better URL reference in error message
      coverage: distcheck-hook to catch missing/outdated *.m4 files
      aclocal: more granularity in acdir overriding

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

Summary of changes:
 ChangeLog                                          |   67 +++++++++++++
 NEWS                                               |    8 ++
 aclocal.in                                         |   76 +++++++--------
 bootstrap                                          |    4 +-
 doc/automake.texi                                  |   58 ++++++------
 m4/Makefile.am                                     |   12 ++-
 m4/Makefile.in                                     |   84 +++++++++++------
 m4/{ => acdir}/dirlist                             |    0
 tests/Makefile.am                                  |    7 ++
 tests/Makefile.in                                  |    9 ++-
 tests/aclocal-acdir.test                           |   97 +++++++++++++++++++
 ...dist-acconfig.test => aclocal-print-acdir.test} |   29 ++----
 tests/aclocal.in                                   |    6 +-
 tests/aclocal.test                                 |    6 +-
 tests/distcheck-hook-m4.am                         |   30 ++++++
 tests/distcheck-missing-m4.test                    |  102 ++++++++++++++++++++
 tests/distcheck-outdated-m4.test                   |   88 +++++++++++++++++
 17 files changed, 555 insertions(+), 128 deletions(-)
 rename m4/{ => acdir}/dirlist (100%)
 create mode 100755 tests/aclocal-acdir.test
 copy tests/{autodist-acconfig.test => aclocal-print-acdir.test} (60%)
 create mode 100644 tests/distcheck-hook-m4.am
 create mode 100755 tests/distcheck-missing-m4.test
 create mode 100755 tests/distcheck-outdated-m4.test

diff --git a/ChangeLog b/ChangeLog
index 793d4cf..758814e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,70 @@
+2011-09-11  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failure on fast machines
+       * tests/aclocal-acdir.test: Avoid spurious failures due to caching
+       issues, by cleaning the autom4te cache between all the aclocal
+       invocations, and by always calling autoconf with the `--force'
+       flag.
+
+2011-09-09  Stefano Lattarini  <address@hidden>
+
+       aclocal: better URL reference in error message
+       * aclocal.in (scan_file): In the error message about underquoted
+       definitions, reference the automake page at `www.gnu.org', not
+       at `sources.redhat.com'.
+
+2011-09-09  Stefano Lattarini  <address@hidden>
+
+       coverage: distcheck-hook to catch missing/outdated *.m4 files
+       Related to automake bug#9037.
+       * tests/distcheck-missing-m4.test: New test.
+       * tests/distcheck-outdated-m4.test: Likewise.
+       * tests/distcheck-hook-m4.am: New data file, used by the new
+       tests.
+       * tests/Makefile.am (distcheck-m4-missing.log,
+       distcheck-m4-outdated.log): Depend on it.
+       (EXTRA_DIST): Distribute it.
+       (TESTS): Add the new tests.
+
+2011-09-06  Stefano Lattarini  <address@hidden>
+
+       aclocal: more granularity in acdir overriding
+       Before this change, using the `--acdir' option caused aclocal to
+       redefine both the directory of automake-provided m4 macros and the
+       directory of third-party system-wide m4 macros.  With this change,
+       we deprecate the `--acdir' aclocal option, and introduce two new
+       options `--automake-acdir' and `--system-acdir', to allow for more
+       granularity.
+       * aclocal.in (@automake_includes, @system_includes,
+       @user_includes): Fix and extend comments.
+       (usage): Update.
+       (handle_acdir_option): New function.
+       (parse_arguments): Recognize new options `--system-acdir' and
+       `automake-acdir', and handle `--acdir' using the new function
+       above.  Simplify logic by assuming that the directory of
+       third-party system-wide m4 files always exists.
+       * tests/aclocal.in: Update to use the new options, instead of
+       the deprecated. `--acdir'.
+       * m4/dirlist: Move ...
+       * m4/acdir/dirlist: ... here.
+       * m4/Makefile.am (EXTRA_DIST): Update.
+       (m4datadir): Rename ...
+       (automake_acdir): ... to this.  Accordingly, ...
+       (dist_m4data_DATA): ... rename this ...
+       (dist_automake_ac_DATA): ... to this.
+       (system_acdir): New, directory.
+       (dist_system_ac_DATA): New, defined to an empty value; this will
+       ensure that the $(system_acdir) directory will be created by
+       "make install".
+       * tests/aclocal.test: Remove check about the `--print-ac-dir'
+       option of aclocal, it has been moved into ...
+       * tests/aclocal-print-acdir.test: ... this new test, and quite
+       extended.
+       * tests/aclocal-acdir.test: New test.
+       * tests/Makefile.am (TESTS): Add the new tests.
+       * NEWS, bootstrap: Update.
+       * doc/automake.texi (aclocal Options, Macro Search Path): Update.
+
 2011-09-05  Peter Rosin  <address@hidden>
 
        * tests/amhello-binpkg.test: Add missing $EXEEXT usage.
diff --git a/NEWS b/NEWS
index 5086f75..776650d 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,14 @@ New in 1.11.0a:
   - The Automake support for automatic de-ANSI-fication will be removed in
     the next major Automake release (1.12).
 
+  - The `--acdir' option of aclocal is deprecated, and will probably be
+    removed in the next major Automake release (1.12).
+
+* Changes to aclocal:
+
+  - The `--acdir' option is deprecated.  Now you should use th new options
+    `--automake-acdir' and `--system-acdir' instead.
+
 * Miscellaneous changes:
 
   - The `lzma' compression scheme and associated automake option `dist-lzma'
diff --git a/aclocal.in b/aclocal.in
index 4b63c1a..ce77e1d 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -54,9 +54,11 @@ $perl_threads = 0;
 # Include paths for searching macros.  We search macros in this order:
 # user-supplied directories first, then the directory containing the
 # automake macros, and finally the system-wide directories for
-# third-party macro.  @user_includes can be augmented with -I.
-# @system_includes can be augmented with the `dirlist' file.  Also
-# --acdir will reset both @automake_includes and @system_includes.
+# third-party macros.
+# @user_includes can be augmented with -I.
+# @automake_includes can be reset with the `--automake-acdir' option.
+# @system_includes can be augmented with the `dirlist' file, and reset
+# with the `--system-acdir' option.
 my @user_includes = ();
 my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
 my @system_includes = ('@datadir@/aclocal');
@@ -562,7 +564,7 @@ sub scan_file ($$$)
            {
              msg ('syntax', "$file:$.", "warning: underquoted definition of $2"
                   . "\n  run info '(automake)Extending aclocal'\n"
-                  . "  or see http://sources.redhat.com/automake/";
+                  . "  or see http://www.gnu.org/software/automake/manual/";
                   . "automake.html#Extending-aclocal")
                unless $underquoted_manual_once;
              $underquoted_manual_once = 1;
@@ -877,7 +879,8 @@ sub usage ($)
 Generate `aclocal.m4' by scanning `configure.ac' or `configure.in'
 
 Options:
-      --acdir=DIR           directory holding config files (for debugging)
+      --automake-acdir=DIR  directory holding automake-provided m4 files
+      --system-acdir=DIR    directory holding third-party system-wide files
       --diff[=COMMAND]      run COMMAND [diff -u] on M4 files that would be
                               changed (implies --install and --dry-run)
       --dry-run             pretend to, but do not actually update any file
@@ -886,7 +889,8 @@ Options:
   -I DIR                    add directory to search list for .m4 files
       --install             copy third-party files to the first -I directory
       --output=FILE         put output in FILE (default aclocal.m4)
-      --print-ac-dir        print name of directory holding m4 files, then exit
+      --print-ac-dir        print name of directory holding system-wide
+                              third-party m4 files, then exit
       --verbose             don't be silent
       --version             print version number, then exit
   -W, --warnings=CATEGORY   report the warnings falling in CATEGORY
@@ -923,6 +927,15 @@ EOF
   exit 0;
 }
 
+# Using --acdir overrides both the automake (versioned) directory and
+# the public (unversioned) system directory.  This usage is obsolete.
+sub handle_acdir_option ($$)
+{
+  msg 'obsolete', '', "`--acdir' is deprecated\n";
+  @system_includes = ($_[1]);
+  @automake_includes = ();
+}
+
 # Parse command line.
 sub parse_arguments ()
 {
@@ -931,12 +944,9 @@ sub parse_arguments ()
 
   my %cli_options =
     (
-     'acdir=s'         => sub # Setting --acdir overrides both the
-                             { # automake (versioned) directory and the
-                              # public (unversioned) system directory.
-                              @automake_includes = ();
-                              @system_includes = ($_[1])
-                            },
+     'acdir=s'         => \&handle_acdir_option,
+     'system-acdir=s'  => sub { shift; @system_includes = @_; },
+     'automake-acdir=s'        => sub { shift; @automake_includes = @_; },
      'diff:s'          => \$diff_command,
      'dry-run'         => \$dry_run,
      'force'           => \$force_output,
@@ -1017,34 +1027,22 @@ sub parse_arguments ()
             . "\nfirst -I option, but no -I was supplied.");
     }
 
-  if (! -d $system_includes[0])
+  # Finally, adds any directory listed in the `dirlist' file.
+  if (open (DIRLIST, "$system_includes[0]/dirlist"))
     {
-      # By default $(datadir)/aclocal doesn't exist.  We don't want to
-      # get an error in the case where we are searching the default
-      # directory and it hasn't been created.  (We know
-      # @system_includes has its default value if @automake_includes
-      # is not empty, because --acdir is the only way to change this.)
-      @system_includes = () if @automake_includes;
-    }
-  else
-    {
-      # Finally, adds any directory listed in the `dirlist' file.
-      if (open (DIRLIST, "$system_includes[0]/dirlist"))
-       {
-         while (<DIRLIST>)
-           {
-             # Ignore '#' lines.
-             next if /^#/;
-             # strip off newlines and end-of-line comments
-             s/\s*\#.*$//;
-             chomp;
-             foreach my $dir (glob)
-               {
-                 push (@system_includes, $dir) if -d $dir;
-               }
-           }
-         close (DIRLIST);
-       }
+      while (<DIRLIST>)
+        {
+          # Ignore '#' lines.
+          next if /^#/;
+          # strip off newlines and end-of-line comments
+          s/\s*\#.*$//;
+          chomp;
+          foreach my $dir (glob)
+            {
+              push (@system_includes, $dir) if -d $dir;
+            }
+        }
+      close (DIRLIST);
     }
 }
 
diff --git a/bootstrap b/bootstrap
index 9f1a8d8..c0043a3 100755
--- a/bootstrap
+++ b/bootstrap
@@ -109,7 +109,9 @@ $BOOTSTRAP_SHELL ./gen-parallel-tests > parallel-tests.am
 cd ..
 
 # Run the autotools.
-$PERL ./aclocal.tmp -I m4
+# Use `-I' here so that our own *.m4 files in m4/ gets included,
+# not copied, in aclocal.m4.
+$PERL ./aclocal.tmp -I m4 --automake-acdir m4 --system-acdir m4/acdir
 $AUTOCONF
 $PERL ./automake.tmp
 
diff --git a/doc/automake.texi b/doc/automake.texi
index 3be8578..bf2c872 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -3186,10 +3186,21 @@ overridden using the @env{AUTOM4TE} environment 
variable.
 @command{aclocal} accepts the following options:
 
 @table @code
address@hidden address@hidden
address@hidden --automake-acdir
+Look for the automake-provided macro files in @var{dir} instead of
+in the installation directory.  This is typically used for debugging.
+
address@hidden address@hidden
address@hidden --system-acdir
+Look for the system-wide third-party macro files (and the special
address@hidden file) in @var{dir} instead of in the installation
+directory.  This is typically used for debugging.
+
 @item address@hidden
 @opindex --acdir
-Look for the macro files in @var{dir} instead of the installation
-directory.  This is typically used for debugging.
address@hidden shorthand for address@hidden@var{dir}
address@hidden''.  Will be removed in future aclocal versions.
 
 @item address@hidden
 @opindex --diff
@@ -3294,7 +3305,7 @@ directories, in this order:
 @item @var{acdir-APIVERSION}
 This is where the @file{.m4} macros distributed with Automake itself
 are stored.  @var{APIVERSION} depends on the Automake release used;
-for Automake 1.6.x, @var{APIVERSION} = @code{1.6}.
+for example, for Automake 1.11.x, @var{APIVERSION} = @code{1.11}.
 
 @item @var{acdir}
 This directory is intended for third party @file{.m4} files, and is
@@ -3305,31 +3316,24 @@ value of @var{acdir}, use the @option{--print-ac-dir} 
option
 (@pxref{aclocal Options}).
 @end table
 
-As an example, suppose that @command{automake-1.6.2} was configured with
+As an example, suppose that @command{automake-1.11.2} was configured with
 @address@hidden/usr/local}.  Then, the search path would be:
 
 @enumerate
address@hidden @file{/usr/local/share/aclocal-1.6/}
address@hidden @file{/usr/local/share/aclocal-1.11.2/}
 @item @file{/usr/local/share/aclocal/}
 @end enumerate
 
+The paths for the @var{acdir} and @var{acdir-APIVERSION} directories can
+be changed respectively through aclocal options @option{--system-acdir}
+and @option{--automake-acdir} (@pxref{aclocal Options}).  Note however
+that these options are only intended for use by the internal Automake
+test suite, or for debugging under highly unusual situations; they are
+not ordinarily needed by end-users.
+
 As explained in (@pxref{aclocal Options}), there are several options that
 can be used to change or extend this search path.
 
address@hidden Modifying the Macro Search Path: @option{--acdir}
-
-The most erroneous option to modify the search path is
address@hidden@var{dir}}, which changes default directory and
-drops the @var{APIVERSION} directory.  For example, if one specifies
address@hidden/opt/private/}, then the search path becomes:
-
address@hidden
address@hidden @file{/opt/private/}
address@hidden enumerate
-
-This option, @option{--acdir}, is intended for use by the internal
-Automake test suite only; it is not ordinarily needed by end-users.
-
 @subsubheading Modifying the Macro Search Path: @samp{-I @var{dir}}
 
 Any extra directories specified using @option{-I} options
@@ -3379,21 +3383,19 @@ Then, the search path would be
 @noindent
 and all directories with path names starting with @code{/test3}.
 
-If the @address@hidden option is used, then @command{aclocal}
-will search for the @file{dirlist} file in @var{dir}.  In the
address@hidden/opt/private/} example above, @command{aclocal} would look
-for @file{/opt/private/dirlist}.  Again, however, the @option{--acdir}
-option is intended for use by the internal Automake test suite only;
address@hidden is not ordinarily needed by end-users.
+If the @address@hidden option is used, then
address@hidden will search for the @file{dirlist} file in
address@hidden; but remember the warnings  above against the use of
address@hidden
 
 @file{dirlist} is useful in the following situation: suppose that
address@hidden version @code{1.6.2} is installed with
address@hidden version @code{1.11.2} is installed with
 @samp{--prefix=/usr} by the system vendor.  Thus, the default search
 directories are
 
 @c @code looks better than @file here
 @enumerate
address@hidden @code{/usr/share/aclocal-1.6/}
address@hidden @code{/usr/share/aclocal-1.11/}
 @item @code{/usr/share/aclocal/}
 @end enumerate
 
@@ -3414,7 +3416,7 @@ Now, the ``default'' search path on the affected system is
 
 @c @code looks better than @file here
 @enumerate
address@hidden @code{/usr/share/aclocal-1.6/}
address@hidden @code{/usr/share/aclocal-1.11/}
 @item @code{/usr/share/aclocal/}
 @item @code{/usr/local/share/aclocal/}
 @end enumerate
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 0cf074b..143df71 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -3,7 +3,7 @@
 ## Makefile for Automake m4.
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 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
@@ -18,9 +18,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-m4datadir = $(datadir)/aclocal-$(APIVERSION)
+automake_acdir = $(datadir)/aclocal-$(APIVERSION)
+system_acdir = $(datadir)/aclocal
 
-dist_m4data_DATA = \
+dist_automake_ac_DATA = \
 $(top_srcdir)/m4/amversion.m4 \
 as.m4 \
 auxdir.m4 \
@@ -59,7 +60,10 @@ tar.m4 \
 upc.m4 \
 vala.m4
 
-EXTRA_DIST = dirlist amversion.in
+# So that $(system_acdir) will be created by "make install".
+dist_system_ac_DATA =
+
+EXTRA_DIST = acdir/dirlist amversion.in
 
 # We build amversion.m4 here, instead of from config.status,
 # because config.status is rerun each time one of configure's
diff --git a/m4/Makefile.in b/m4/Makefile.in
index ff4dd43..2e7e547 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -16,7 +16,7 @@
 @SET_MAKE@
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 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
@@ -50,8 +50,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 subdir = m4
-DIST_COMMON = $(dist_m4data_DATA) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in
+DIST_COMMON = $(dist_automake_ac_DATA) $(dist_system_ac_DATA) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \
@@ -89,8 +89,9 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(m4datadir)"
-DATA = $(dist_m4data_DATA)
+am__installdirs = "$(DESTDIR)$(automake_acdir)" \
+       "$(DESTDIR)$(system_acdir)"
+DATA = $(dist_automake_ac_DATA) $(dist_system_ac_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -185,8 +186,9 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-m4datadir = $(datadir)/aclocal-$(APIVERSION)
-dist_m4data_DATA = \
+automake_acdir = $(datadir)/aclocal-$(APIVERSION)
+system_acdir = $(datadir)/aclocal
+dist_automake_ac_DATA = \
 $(top_srcdir)/m4/amversion.m4 \
 as.m4 \
 auxdir.m4 \
@@ -225,7 +227,10 @@ tar.m4 \
 upc.m4 \
 vala.m4
 
-EXTRA_DIST = dirlist amversion.in
+
+# So that $(system_acdir) will be created by "make install".
+dist_system_ac_DATA = 
+EXTRA_DIST = acdir/dirlist amversion.in
 all: all-am
 
 .SUFFIXES:
@@ -259,26 +264,46 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-install-dist_m4dataDATA: $(dist_m4data_DATA)
+install-dist_automake_acDATA: $(dist_automake_ac_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(automake_acdir)" || $(MKDIR_P) "$(DESTDIR)$(automake_acdir)"
+       @list='$(dist_automake_ac_DATA)'; test -n "$(automake_acdir)" || list=; 
\
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(automake_acdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(automake_acdir)" || exit $$?; \
+       done
+
+uninstall-dist_automake_acDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_automake_ac_DATA)'; test -n "$(automake_acdir)" || list=; 
\
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(automake_acdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(automake_acdir)" && rm -f $$files
+install-dist_system_acDATA: $(dist_system_ac_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(m4datadir)" || $(MKDIR_P) "$(DESTDIR)$(m4datadir)"
-       @list='$(dist_m4data_DATA)'; test -n "$(m4datadir)" || list=; \
+       test -z "$(system_acdir)" || $(MKDIR_P) "$(DESTDIR)$(system_acdir)"
+       @list='$(dist_system_ac_DATA)'; test -n "$(system_acdir)" || list=; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
        done | $(am__base_list) | \
        while read files; do \
-         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4datadir)'"; \
-         $(INSTALL_DATA) $$files "$(DESTDIR)$(m4datadir)" || exit $$?; \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(system_acdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(system_acdir)" || exit $$?; \
        done
 
-uninstall-dist_m4dataDATA:
+uninstall-dist_system_acDATA:
        @$(NORMAL_UNINSTALL)
-       @list='$(dist_m4data_DATA)'; test -n "$(m4datadir)" || list=; \
+       @list='$(dist_system_ac_DATA)'; test -n "$(system_acdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
        test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(m4datadir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(m4datadir)" && rm -f $$files
+       echo " ( cd '$(DESTDIR)$(system_acdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(system_acdir)" && rm -f $$files
 tags: TAGS
 TAGS:
 
@@ -320,7 +345,7 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(DATA)
 installdirs:
-       for dir in "$(DESTDIR)$(m4datadir)"; do \
+       for dir in "$(DESTDIR)$(automake_acdir)" "$(DESTDIR)$(system_acdir)"; 
do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
@@ -373,7 +398,8 @@ info: info-am
 
 info-am:
 
-install-data-am: install-dist_m4dataDATA
+install-data-am: install-dist_automake_acDATA \
+       install-dist_system_acDATA
 
 install-dvi: install-dvi-am
 
@@ -417,21 +443,23 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-dist_m4dataDATA
+uninstall-am: uninstall-dist_automake_acDATA \
+       uninstall-dist_system_acDATA
 
 .MAKE: install-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic distclean \
        distclean-generic distdir dvi dvi-am html html-am info info-am \
        install install-am install-data install-data-am \
-       install-dist_m4dataDATA install-dvi install-dvi-am \
-       install-exec install-exec-am install-html install-html-am \
-       install-info install-info-am install-man install-pdf \
-       install-pdf-am install-ps install-ps-am install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-       pdf-am ps ps-am uninstall uninstall-am \
-       uninstall-dist_m4dataDATA
+       install-dist_automake_acDATA install-dist_system_acDATA \
+       install-dvi install-dvi-am install-exec install-exec-am \
+       install-html install-html-am install-info install-info-am \
+       install-man install-pdf install-pdf-am install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+       uninstall-am uninstall-dist_automake_acDATA \
+       uninstall-dist_system_acDATA
 
 
 # We build amversion.m4 here, instead of from config.status,
diff --git a/m4/dirlist b/m4/acdir/dirlist
similarity index 100%
rename from m4/dirlist
rename to m4/acdir/dirlist
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 41b19f7..ac2adde 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -72,6 +72,8 @@ acloca19.test \
 acloca20.test \
 acloca21.test \
 acloca22.test \
+aclocal-acdir.test \
+aclocal-print-acdir.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
@@ -326,6 +328,8 @@ distcheck-configure-flags-am.test \
 distcheck-configure-flags-subpkg.test \
 distcheck-hook.test \
 distcheck-hook2.test \
+distcheck-missing-m4.test \
+distcheck-outdated-m4.test \
 dmalloc.test \
 doc-parsing-buglets-colneq-subst.test \
 doc-parsing-buglets-tabs.test \
@@ -892,6 +896,9 @@ $(parallel_tests)
 
 EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
 
+distcheck-missing-m4.log distcheck-outdated-m4.log: distcheck-hook-m4.am
+EXTRA_DIST += distcheck-hook-m4.am
+
 # Each test case depends on defs, aclocal, and automake.
 check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
 
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 2cec3a0..02eeddf 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -350,6 +350,8 @@ acloca19.test \
 acloca20.test \
 acloca21.test \
 acloca22.test \
+aclocal-acdir.test \
+aclocal-print-acdir.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
@@ -604,6 +606,8 @@ distcheck-configure-flags-am.test \
 distcheck-configure-flags-subpkg.test \
 distcheck-hook.test \
 distcheck-hook2.test \
+distcheck-missing-m4.test \
+distcheck-outdated-m4.test \
 dmalloc.test \
 doc-parsing-buglets-colneq-subst.test \
 doc-parsing-buglets-tabs.test \
@@ -1168,7 +1172,8 @@ yflags.test \
 yflags2.test \
 $(parallel_tests)
 
-EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
+EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS) \
+       distcheck-hook-m4.am
 
 # Each test case depends on defs, aclocal, and automake.
 check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
@@ -1506,6 +1511,8 @@ $(parallel_tests): $(parallel_tests:-p.test=.test) 
Makefile.am
          < $(srcdir)/$$input >$@
        chmod a+rx $@
 
+distcheck-missing-m4.log distcheck-outdated-m4.log: distcheck-hook-m4.am
+
 clean-local: clean-local-check
 .PHONY: clean-local-check
 clean-local-check:
diff --git a/tests/aclocal-acdir.test b/tests/aclocal-acdir.test
new file mode 100755
index 0000000..e02db30
--- /dev/null
+++ b/tests/aclocal-acdir.test
@@ -0,0 +1,97 @@
+#! /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/>.
+
+# Test aclocal's `--acdir', `--automake-acdir' and `--system-acdir'
+# options.  Also check that stuff in the automake acdir takes precedence
+# over stuff in the system acdir.
+
+. ./defs || Exit 1
+
+set -e
+
+mkdir am sys
+
+cat >> configure.in <<'END'
+MY_MACRO
+END
+
+cat > am/foo.m4 <<'END'
+AC_DEFUN([AM_INIT_AUTOMAKE], [fake--init--automake])
+END
+
+cat > sys/foo.m4 <<'END'
+AC_DEFUN([MY_MACRO], [my--macro])
+END
+
+$ACLOCAL --automake-acdir am
+$AUTOCONF --force
+$FGREP 'fake--init--automake' configure
+$FGREP 'MY_MACRO' configure
+
+rm -rf autom4te*.cache
+
+$ACLOCAL --system-acdir sys
+$AUTOCONF --force
+$FGREP 'am__api_version' configure
+$FGREP 'my--macro' configure
+
+rm -rf autom4te*.cache
+
+$ACLOCAL --automake-acdir am --system-acdir sys
+$AUTOCONF --force
+$FGREP 'fake--init--automake' configure
+$FGREP 'my--macro' configure
+
+rm -rf autom4te*.cache
+
+$ACLOCAL --system-acdir sys --automake-acdir am
+$AUTOCONF --force
+$FGREP 'fake--init--automake' configure
+$FGREP 'my--macro' configure
+
+rm -rf autom4te*.cache
+
+# Stuff in automake acdir takes precedence over stuff in system acdir.
+cat > am/bar.m4 <<'END'
+AC_DEFUN([MY_MACRO], [am--macro])
+END
+$ACLOCAL --automake-acdir am --system-acdir sys
+$AUTOCONF --force
+$FGREP 'fake--init--automake' configure
+$FGREP 'am--macro' configure
+$FGREP 'my--macro' configure && Exit 1 # Just to be sure.
+
+rm -rf autom4te*.cache
+
+# Obsolescent `--acdir' option.
+$ACLOCAL -Wobsolete --acdir am 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep '.*--acdir.*deprecated' stderr
+
+rm -rf autom4te*.cache
+
+$ACLOCAL -Wno-obsolete --acdir am
+$AUTOCONF --force
+$FGREP 'fake--init--automake' configure
+$FGREP 'am--macro' configure
+
+rm -rf autom4te*.cache
+
+$ACLOCAL -Wno-obsolete --acdir sys 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep 'macro .*AM_INIT_AUTOMAKE.* not found' stderr
+
+:
diff --git a/tests/autodist-acconfig.test b/tests/aclocal-print-acdir.test
similarity index 60%
copy from tests/autodist-acconfig.test
copy to tests/aclocal-print-acdir.test
index 49ab2f0..368416c 100755
--- a/tests/autodist-acconfig.test
+++ b/tests/aclocal-print-acdir.test
@@ -14,33 +14,22 @@
 # 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 that `acconfig.h' is automatically distributed if it exists
-# (at automake runtime).
-# Related to automake bug#7819.
+# Test on aclocal's `--print-ac-dir' option.
 
 . ./defs || Exit 1
 
 set -e
 
-cat >> configure.in <<END
-AC_OUTPUT
-END
+$ACLOCAL --print-ac-dir
+test "`$ACLOCAL --print-ac-dir`" = "$testaclocaldir/acdir"
 
-cat > Makefile.am <<'END'
-.PHONY: test
-test: distdir
-       ls -l $(distdir)
-       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]acconfig\.h '
-       test -f $(distdir)/acconfig.h
-END
+$ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir
+test "`$ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir`" = foo
 
-: > acconfig.h
+$ACLOCAL --system-acdir /bar --print-ac-dir
+test "`$ACLOCAL --system-acdir /bar --print-ac-dir`" = /bar
 
-$ACLOCAL
-$AUTOMAKE
-$AUTOCONF
-
-./configure
-$MAKE test
+$ACLOCAL --automake-acdir /bar --print-ac-dir
+test "`$ACLOCAL --automake-acdir /bar --print-ac-dir`" = 
"$testaclocaldir/acdir"
 
 :
diff --git a/tests/aclocal.in b/tests/aclocal.in
index f8aa1a7..5326ad0 100644
--- a/tests/aclocal.in
+++ b/tests/aclocal.in
@@ -12,6 +12,6 @@ fi
 
 perllibdir="@abs_top_builddir@/address@hidden@@abs_top_srcdir@/lib"
 export perllibdir
-# Most of the files are in $srcdir/../m4.  However amversion.m4 is
-# generated in ../m4, so we include that directory in the search path too.
-exec "@abs_top_builddir@/aclocal" "address@hidden@/m4" ${1+"$@"}
+
+exec "@abs_top_builddir@/aclocal" "address@hidden@/m4" \
+     "address@hidden@/m4/acdir" ${1+"$@"}
diff --git a/tests/aclocal.test b/tests/aclocal.test
index da80d08..439faa9 100755
--- a/tests/aclocal.test
+++ b/tests/aclocal.test
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure that aclocal --output works.  Report from
-# Alexandre Oliva.
+# Test on some aclocal options.  Report from Alexandre Oliva.
+
 . ./defs || Exit 1
 
 set -e
@@ -41,6 +41,4 @@ grep '[Tt]ry.*--help.*for more information' stderr
 
 $ACLOCAL --versi
 
-test "`$ACLOCAL --print-ac-dir`" = "$testaclocaldir"
-
 :
diff --git a/tests/distcheck-hook-m4.am b/tests/distcheck-hook-m4.am
new file mode 100644
index 0000000..88681e9
--- /dev/null
+++ b/tests/distcheck-hook-m4.am
@@ -0,0 +1,30 @@
+## Data files for some tests.  Not used in the automake build system.
+##
+## 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/>.
+
+distcheck-hook:
+       @fatal () { echo "$@: $$*" >&2; exit 1; }; \
+       $(am__cd) $(distdir) && chmod u+w . && mkdir _m4 \
+         || fatal "cannot setup distdir"; \
+       $(ACLOCAL) -I _m4 $(ACLOCAL_AMFLAGS) --install --output=_am.m4 \
+         || fatal "cannot regenerate aclocal.m4"; \
+       lst=`ls _m4 | tr '\012\015' '  '`; \
+       if test -n "$$lst"; then \
+         fatal "required m4 files not distributed or outdated: $$lst"; \
+       fi; \
+       $(AUTOCONF) -o /dev/null || fatal "can't remake configure"; \
+       rm -rf _m4 _am.m4 autom4te.cache && chmod a-w . \
+         || fatal "cannot reset distdir"
diff --git a/tests/distcheck-missing-m4.test b/tests/distcheck-missing-m4.test
new file mode 100755
index 0000000..f4e0eda
--- /dev/null
+++ b/tests/distcheck-missing-m4.test
@@ -0,0 +1,102 @@
+#! /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/>.
+
+# Test that we can define a distcheck-hook to diagnose m4 files
+# missing from the dist tarball (interaction with `--install').
+# See automake bug#9037.
+
+. ./defs || Exit 1
+
+set -e
+
+cwd=`pwd` || fatal_ "cannot get current working directory"
+
+cp "$testsrcdir"/distcheck-hook-m4.am . \
+  || fatal_ "cannot fetch makefile fragment \`distcheck-hook-m4.am'"
+
+cat > Makefile.am << 'END'
+## The lack of `--install' here is meant.
+ACLOCAL_AMFLAGS = -I m4
+include $(srcdir)/distcheck-hook-m4.am
+END
+
+cat >> configure.in << 'END'
+dnl We *deliberately* don't use m4_pattern_forbid here.
+AC_OUTPUT
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+mkdir m4 acdir acdir1 acdir2
+
+cat > acdir/dirlist << END
+$cwd/acdir1
+$cwd/acdir2
+END
+
+echo 'AC_DEFUN([MY_FOO], [:])' > m4/foo.m4
+echo 'AC_DEFUN([MY_BAR], [:])' > acdir1/bar.m4
+echo 'AC_DEFUN([MY_BAZ], [:])' > acdir1/baz.m4
+echo 'AC_DEFUN([MY_QUX], [:])' > acdir2/qux.m4
+
+ACLOCAL="$ACLOCAL --system-acdir=$cwd/acdir"; export ACLOCAL
+
+# We don't use `--install' here.  Our distcheck-hook should catch this.
+$ACLOCAL -I m4
+$AUTOCONF
+$EGREP 'MY_(FOO|BAR|BAZ)' configure && Exit 1 # Sanity check.
+$AUTOMAKE
+
+./configure
+
+$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
+cat output
+$EGREP "required m4 file.*not distributed.* bar.m4( |$)" output
+$EGREP "required m4 file.*not distributed.* baz.m4( |$)" output
+# Check that we don't fail for spurious errors.
+$EGREP -i 'mkdir:|autom4te.*\.cache|:.*(permission|denied)' output && Exit 1
+
+# Now we use `--install', and "make distcheck" should pass.
+$ACLOCAL -I m4 --install
+test -f m4/bar.m4 # Sanity check.
+test -f m4/baz.m4 # Likewise.
+using_gmake || $MAKE Makefile
+$MAKE distcheck
+
+# We start to use a new "third-party" macro from a new .m4 file, but forget
+# to re-run "aclocal --install" by hand, relying on automatic remake rules.
+# Our distcheck-hook should catch this too.
+echo MY_QUX >> configure.in
+
+$MAKE
+$EGREP 'MY_(FOO|BAR|BAZ|QUX)' configure && Exit 1 # Sanity check.
+
+$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
+cat output
+$EGREP "required m4 file.*not distributed.* qux.m4( |$)" output
+# Check that we don't fail for spurious errors.
+$EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1
+# Check that we don't complain for files that should have been found.
+grep " ba[rz].m4" output && Exit 1
+
+# Now we again use `--install', and "make distcheck" should pass.
+$ACLOCAL -I m4 --install
+test -f m4/qux.m4 # Sanity check.
+using_gmake || $MAKE Makefile
+$MAKE distcheck
+
+:
diff --git a/tests/distcheck-outdated-m4.test b/tests/distcheck-outdated-m4.test
new file mode 100755
index 0000000..74f2922
--- /dev/null
+++ b/tests/distcheck-outdated-m4.test
@@ -0,0 +1,88 @@
+#! /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/>.
+
+# Test that we can define a distcheck-hook to diagnose outdated m4
+# files in a dist tarball (interaction with `--install').
+# See automake bug#9037.
+
+. ./defs || Exit 1
+
+set -e
+
+cwd=`pwd` || fatal_ "cannot get current working directory"
+
+cp "$testsrcdir"/distcheck-hook-m4.am . \
+  || fatal_ "cannot fetch makefile fragment \`distcheck-hook-m4.am'"
+
+cat > Makefile.am << 'END'
+## The lack of `--install' here is meant.
+ACLOCAL_AMFLAGS = -I m4
+include $(srcdir)/distcheck-hook-m4.am
+END
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+mkdir m4 acdir
+echo 'AC_DEFUN([MY_FOO], [:])' > m4/foo.m4
+echo 'AC_DEFUN([MY_BAR], [:])' > acdir/bar.m4
+cat > acdir/baz.m4 << 'END'
+# serial 1
+AC_DEFUN([MY_BAZ], [:])
+END
+
+ACLOCAL="$ACLOCAL --system-acdir=$cwd/acdir"; export ACLOCAL
+
+# We don't use `--install' here.  Our distcheck-hook should catch this.
+$ACLOCAL -I m4 --install
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE distcheck # Sanity check.
+
+# We start to use a new "third-party" macro in a new version
+# of a pre-existing third-party m4 file, but forget to re-run
+# "aclocal --install" by hand, relying on automatic remake
+# rules.  Our distcheck-hook should catch this too.
+echo MY_ZARDOZ >> configure.in
+
+cat > acdir/baz.m4 << 'END'
+# serial 2
+AC_DEFUN([MY_BAZ], [:])
+AC_DEFUN([MY_ZARDOZ], [:])
+END
+
+$MAKE # Rebuild configure and makefiles.
+$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
+cat output
+
+$EGREP "required m4 file.* outdated.* baz.m4( |$)" output
+# Check that we don't fail for spurious errors.
+$EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1
+# Check that we don't complain for files that should have been found.
+$EGREP " (foo|bar).m4" output && Exit 1
+
+# Now we again use `--install', and "make distcheck" should pass.
+$ACLOCAL -I m4 --install
+using_gmake || $MAKE Makefile
+$MAKE distcheck
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

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