automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, branch-1.11, updated. v1.11


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, branch-1.11, updated. v1.11.3-57-g82b05b7
Date: Sun, 18 Mar 2012 19:20:00 +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=82b05b707f6f21ccc09c703582ede5987d2b5fce

The branch, branch-1.11 has been updated
       via  82b05b707f6f21ccc09c703582ede5987d2b5fce (commit)
       via  368f1c4c295e3cc4c442af986a1cbb0daa16e3ad (commit)
       via  b99b4207ec0eb16ba9a3444bf29cb5d6ea0c7746 (commit)
       via  6743961843f3d810500aabe20cfe2cb0e9ae5839 (commit)
       via  a75a1a52679feed85a181dcf514e32e17117157b (commit)
      from  abec6bdcb2bc63f6a90136ad7dc29b9d176c1318 (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 82b05b707f6f21ccc09c703582ede5987d2b5fce
Merge: b99b420 368f1c4
Author: Stefano Lattarini <address@hidden>
Date:   Sun Mar 18 19:32:19 2012 +0100

    Merge branch 'maint' into branch-1.11
    
    * maint:
      install: don't create empty dirs when an empty 'foo_PRIMARY' is used

commit b99b4207ec0eb16ba9a3444bf29cb5d6ea0c7746
Merge: abec6bd 6743961
Author: Stefano Lattarini <address@hidden>
Date:   Sat Mar 17 09:54:35 2012 +0100

    Merge branch 'maint' into branch-1.11
    
    * maint:
      aclocal: remove a couple of useless imports
      aclocal: create local directory where to install m4 files
    
    Signed-off-by: Stefano Lattarini <address@hidden>

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

Summary of changes:
 HACKING                                            |    3 +
 NEWS                                               |   25 ++++
 THANKS                                             |    3 +
 aclocal.in                                         |   42 +++++--
 lib/am/data.am                                     |   14 ++-
 lib/am/java.am                                     |    6 +-
 lib/am/libs.am                                     |   12 ++-
 lib/am/lisp.am                                     |   11 +-
 lib/am/ltlib.am                                    |   12 ++-
 lib/am/mans.am                                     |   38 +++++--
 lib/am/progs.am                                    |    8 +-
 lib/am/python.am                                   |    9 ++-
 lib/am/scripts.am                                  |    8 +-
 lib/am/texinfos.am                                 |   28 ++++-
 tests/Makefile.am                                  |    2 +-
 tests/aclocal-install-fail.test                    |   65 ++++++++++
 tests/aclocal-install-mkdir.test                   |   72 ++++++++++++
 ...regex.test => aclocal-no-install-no-mkdir.test} |   23 ++--
 ...auxfile-2.test => aclocal-verbose-install.test} |   56 ++++-----
 tests/installdir.test                              |   36 +++++-
 tests/instdir-cond.test                            |    3 +-
 tests/{instdir-empty.test => instdir-cond2.test}   |   47 ++++----
 tests/instdir-no-empty.test                        |  123 ++++++++++++++++++++
 tests/java3.test                                   |    5 +-
 tests/list-of-tests.mk                             |    7 +-
 25 files changed, 527 insertions(+), 131 deletions(-)
 create mode 100755 tests/aclocal-install-fail.test
 create mode 100755 tests/aclocal-install-mkdir.test
 copy tests/{help-regex.test => aclocal-no-install-no-mkdir.test} (66%)
 copy tests/{dist-auxfile-2.test => aclocal-verbose-install.test} (51%)
 rename tests/{instdir-empty.test => instdir-cond2.test} (54%)
 create mode 100755 tests/instdir-no-empty.test

diff --git a/HACKING b/HACKING
index 5420fbc..8b5cdb9 100644
--- a/HACKING
+++ b/HACKING
@@ -75,6 +75,9 @@
   "important" command it runs.  The printed commands should be preceded
   by a single space.
 
+* Ensure install rules do not create any installation directory where
+  nothing is to be actually installed.  See automake bug#11030.
+
 ================================================================
 = Editing automake.in and aclocal.in
 
diff --git a/NEWS b/NEWS
index c352c7d..c71ef84 100644
--- a/NEWS
+++ b/NEWS
@@ -65,6 +65,10 @@ Bugs fixed in 1.11.3a:
     other supported languages (e.g., C++).  Previously, only mixing C and
     Vala sources was supported.
 
+  - If "aclocal --install" is used, and the first directory specified with
+    '-I' is non-existent, aclocal will now create it before trying to copy
+    files in it.
+
 
 New in 1.11.3:
 
@@ -214,6 +218,27 @@ Bugs fixed in 1.11.2:
   - The order of Yacc and Lex flags is fixed to be consistent with other
     languages: $(AM_YFLAGS) comes before $(YFLAGS), and $(AM_LFLAGS) before
     $(LFLAGS), so that the user variables override the developer variables.
+  - An empty declaration of a "foo_PRIMARY" don't cause anymore the
+    generated install rules to create an empty $(foodir) directory;
+    for example, if Makefile.am contains something like:
+
+      pkglibexec_SCRIPTS =
+      if FALSE
+      pkglibexec_SCRIPTS += bar.sh
+      endif
+
+    the $(pkglibexec) directory will not be created upon "make install".
+
+  - It is now possible for a foo_SOURCES variable to hold Vala sources
+    together with C header files, as well as with sources and headers for
+    other supported languages (e.g., C++).  Previously, only mixing C and
+    Vala sources was supported.
+
+  - Vala support now works better in VPATH setups.
+
+  - The "deleted header file problem" for *.am files is avoided by stub
+    rules.  This allows `make' to trigger a rerun of `automake' also if
+    some previously needed `.am' file has been removed.
 
   - "make distcheck" now correctly complains also when "make uninstall"
     leaves one and only one file installed in $(prefix).
diff --git a/THANKS b/THANKS
index 8363126..e0c44d7 100644
--- a/THANKS
+++ b/THANKS
@@ -64,6 +64,7 @@ Christina Gratorp     address@hidden
 Claudio Fontana                address@hidden
 Clifford Wolf          address@hidden
 Dagobert Michelsen     address@hidden
+Daiki Ueno             address@hidden
 Dalibor Topic          address@hidden
 danbp                  address@hidden
 Daniel Jacobowitz      address@hidden
@@ -73,6 +74,7 @@ Dave Brolley          address@hidden
 Dave Korn              address@hidden
 Dave Morrison          address@hidden
 David A. Swierczek     address@hidden
+David A. Wheeler       address@hidden
 David Byron            address@hidden
 Davyd Madeley          address@hidden
 David Pashley          address@hidden
@@ -149,6 +151,7 @@ Janos Farkas                address@hidden
 Jared Davis            address@hidden
 Jason Duell            address@hidden
 Jason Molenda          address@hidden
+Javier Jardón         address@hidden
 Jeff Bailey            address@hidden
 Jeff Garzik            address@hidden
 Jeff Squyres           address@hidden
diff --git a/aclocal.in b/aclocal.in
index ed1d8d9..4764379 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -7,9 +7,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S 
"$0" "$@";; esac'
 
 # aclocal - create aclocal.m4 by scanning configure.ac
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 1996-2012 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
@@ -43,8 +41,7 @@ use Automake::ChannelDefs;
 use Automake::XFile;
 use Automake::FileUtils;
 use File::Basename;
-use File::stat;
-use Cwd;
+use File::Path ();
 
 # Some globals.
 
@@ -181,6 +178,17 @@ sub unlink_tmp
 $SIG{'INT'} = $SIG{'TERM'} = $SIG{'QUIT'} = $SIG{'HUP'} = 'unlink_tmp';
 END { unlink_tmp }
 
+sub xmkdir_p ($)
+{
+  my $dir = shift;
+  local $@ = undef;
+  return
+    if -d $dir or eval { File::Path::mkpath $dir };
+  chomp $@;
+  $@ =~ s/\s+at\s.*\bline\s\d+.*$//;
+  fatal "could not create directory '$dir': $@";
+}
+
 # Check macros in acinclude.m4.  If one is not used, warn.
 sub check_acinclude ()
 {
@@ -210,12 +218,15 @@ sub reset_maps ()
   undef &search;
 }
 
-# install_file ($SRC, $DEST)
+# install_file ($SRC, $DESTDIR)
 sub install_file ($$)
 {
-  my ($src, $dest) = @_;
+  my ($src, $destdir) = @_;
+  my $dest = $destdir . "/" . basename ($src);
   my $diff_dest;
 
+  verb "installing $src to $dest";
+
   if ($force_output
       || !exists $file_contents{$dest}
       || $file_contents{$src} ne $file_contents{$dest})
@@ -268,6 +279,7 @@ sub install_file ($$)
        }
       elsif (!$dry_run)
        {
+          xmkdir_p ($destdir);
          xsystem ('cp', $src, $dest);
        }
     }
@@ -307,6 +319,7 @@ sub list_compare (address@hidden@)
 # --------------------------
 # Scan all M4 files installed in @DIRS for new macro definitions.
 # Register each file as of type $TYPE (one of the FT_* constants).
+my $first_user_m4dir = 1;
 sub scan_m4_dirs ($@)
 {
   my ($type, @dirlist) = @_;
@@ -315,7 +328,16 @@ sub scan_m4_dirs ($@)
     {
       if (! opendir (DIR, $m4dir))
        {
-         fatal "couldn't open directory `$m4dir': $!";
+         if ($install && $type == FT_USER && $first_user_m4dir)
+            {
+              # We will try to create this directory later, so don't
+              # complain if it doesn't exist.
+              # TODO: maybe we should avoid complaining only if errno
+              # is ENONENT?
+              $first_user_m4dir = 0;
+              next;
+            }
+         fatal "couldn't open directory '$m4dir': $!";
        }
 
       # We reverse the directory contents so that foo2.m4 gets
@@ -773,9 +795,7 @@ sub write_aclocal ($@)
              my $dest;
              for my $ifile (@{$file_includes{$file}}, $file)
                {
-                 $dest = "$user_includes[0]/" . basename $ifile;
-                 verb "installing $ifile to $dest";
-                 install_file ($ifile, $dest);
+                 install_file ($ifile, $user_includes[0]);
                }
              $installed = 1;
            }
diff --git a/lib/am/data.am b/lib/am/data.am
index 1817447..98a38a8 100644
--- a/lib/am/data.am
+++ b/lib/am/data.am
@@ -1,6 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003, 2004, 2006,
-## 2007, 2008, 2009  Free Software Foundation, Inc.
+## Copyright (C) 1994-2012 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
@@ -28,11 +27,14 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
 .PHONY install-%EXEC?exec:data%-am: install-%DIR%%PRIMARY%
 install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%)
        @$(NORMAL_INSTALL)
-       test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
 if %?BASE%
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+         $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)' || exit 1; \
+       fi; \
        for p in $$list; do \
 ## A file can be in the source directory or the build directory.
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
@@ -47,13 +49,17 @@ if %?BASE%
        done
 else !%?BASE%
        @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
+       fi; \
        $(am__nobase_list) | while read dir files; do \
          xfiles=; for file in $$files; do \
            if test -f "$$file"; then xfiles="$$xfiles $$file"; \
            else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
          test -z "$$xfiles" || { \
            test "x$$dir" = x. || { \
-             echo "$(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
+             echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
              $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
            echo " $(INSTALL_%ONE_PRIMARY%) $$xfiles 
'$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
            $(INSTALL_%ONE_PRIMARY%) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || 
exit $$?; }; \
diff --git a/lib/am/java.am b/lib/am/java.am
index 464b706..6c163b5 100644
--- a/lib/am/java.am
+++ b/lib/am/java.am
@@ -1,6 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1998, 1999, 2001, 2003, 2004, 2006, 2008, 2009 Free Software
-## Foundation, Inc.
+## Copyright (C) 1998-2012 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
@@ -48,11 +47,12 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
 ?!EXEC?.PHONY install-data-am: install-%DIR%JAVA
 install-%DIR%JAVA: class%NDIR%.stamp
        @$(NORMAL_INSTALL)
-       test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
 ## A single .java file can be compiled into multiple .class files.  So
 ## we just install all the .class files that got built into this
 ## directory.  This is not optimal, but will have to do for now.
        @test -n "$(%DIR%_JAVA)" && test -n "$(%NDIR%dir)" || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"; \
        set x *.class; shift; test "$$1" != "*.class" || exit 0; \
        echo " $(INSTALL_DATA)" "$$@" "'$(DESTDIR)$(%NDIR%dir)/$$p'"; \
        $(INSTALL_DATA) "$$@" "$(DESTDIR)$(%NDIR%dir)"
diff --git a/lib/am/libs.am b/lib/am/libs.am
index 29f630b..4006bd0 100644
--- a/lib/am/libs.am
+++ b/lib/am/libs.am
@@ -1,6 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004, 2006,
-## 2007, 2008, 2009  Free Software Foundation, Inc.
+## Copyright (C) 1994-2012 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
@@ -28,7 +27,6 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
 .PHONY install-%EXEC?exec:data%-am: install-%DIR%LIBRARIES
 install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES)
        @$(NORMAL_INSTALL)
-       test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
 if %?BASE%
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
@@ -39,18 +37,24 @@ if %?BASE%
          else :; fi; \
        done; \
        test -z "$$list2" || { \
+         echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
          echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(%NDIR%dir)'"; \
          $(INSTALL_DATA) $$list2 "$(DESTDIR)$(%NDIR%dir)" || exit $$?; }
 else !%?BASE%
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        @list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+         $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)' || exit 1; \
+       fi; \
        $(am__nobase_list) | while read dir files; do \
          xfiles=; for p in $$files; do \
            if test -f "$$p"; then xfiles="$$xfiles $$p"; else :; fi; done; \
          test -z "$$xfiles" || { \
            test "x$$dir" = x. || { \
-             echo "$(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
+             echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
              $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
            echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
            $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit 
$$?; }; \
diff --git a/lib/am/lisp.am b/lib/am/lisp.am
index 0194c1b..968439f 100644
--- a/lib/am/lisp.am
+++ b/lib/am/lisp.am
@@ -1,6 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-## 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+## Copyright (C) 1996-2012 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
@@ -90,11 +89,15 @@ install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES)
        @$(NORMAL_INSTALL)
 ## Do not install anything if EMACS was not found.
        @if test "$(EMACS)" != no && test -n "$(%NDIR%dir)"; then \
-         $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"; \
 ?!BASE?          $(am__vpath_adj_setup) \
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
-         list='$(%DIR%_LISP)'; for p in $$list; do \
+         list='$(%DIR%_LISP)'; \
+         if test -n "$$list"; then \
+           echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+           $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
+         fi; \
+         for p in $$list; do \
 ## A lisp file can be in the source directory or the build directory.
            if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
            %BASE?$(am__strip_dir):$(am__vpath_adj)% \
diff --git a/lib/am/ltlib.am b/lib/am/ltlib.am
index 29aa00c..65210c1 100644
--- a/lib/am/ltlib.am
+++ b/lib/am/ltlib.am
@@ -1,6 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004,
-## 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+## Copyright (C) 1994-2012 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
@@ -28,7 +27,6 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
 .PHONY install-%EXEC?exec:data%-am: install-%DIR%LTLIBRARIES
 install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES)
        @$(NORMAL_INSTALL)
-       test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
 if %?BASE%
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
@@ -39,6 +37,8 @@ if %?BASE%
          else :; fi; \
        done; \
        test -z "$$list2" || { \
+         echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+         $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)' || exit 1; \
 ## Note that we explicitly set the libtool mode.  This avoids any lossage
 ## if the program doesn't have a name that libtool expects.
 ## Use INSTALL and not INSTALL_DATA because libtool knows the right
@@ -50,6 +50,10 @@ if %?BASE%
        }
 else !%?BASE%
        @list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)"  || list=; \
+       if test -n "$$list"; then \
+           echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+           $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
+       fi; \
        for p in $$list; do if test -f "$$p"; then echo "$$p $$p"; else :; fi; 
done | \
        sed '/ .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
        $(AWK) 'BEGIN { cur = "." } \
@@ -59,7 +63,7 @@ else !%?BASE%
        while read dir files; do \
          test -z "$$files" || { \
            test "x$$dir" = x. || { \
-             echo "$(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
+             echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
              $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
 ## Note that we explicitly set the libtool mode.  This avoids any lossage
 ## if the program doesn't have a name that libtool expects.
diff --git a/lib/am/mans.am b/lib/am/mans.am
index b41a94d..b0d5335 100644
--- a/lib/am/mans.am
+++ b/lib/am/mans.am
@@ -1,6 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1998, 2001, 2003, 2004, 2006, 2008, 2009 Free Software
-## Foundation, Inc.
+## Copyright (C) 1998-2012 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
@@ -31,16 +30,24 @@ man%SECTION%dir = $(mandir)/man%SECTION%
 .PHONY install-man: install-man%SECTION%
 install-man%SECTION%: %DEPS%
        @$(NORMAL_INSTALL)
-       test -z "$(man%SECTION%dir)" || $(MKDIR_P) 
"$(DESTDIR)$(man%SECTION%dir)"
 if %?NOTRANS_MANS%
 ## Handle MANS with notrans_ prefix
-       @list='%NOTRANS_SECT_LIST%'; test -n "$(man%SECTION%dir)" || exit 0; \
-       { for i in $$list; do echo "$$i"; done;  \
+       @list1='%NOTRANS_SECT_LIST%'; \
+?!HAVE_NOTRANS?        list2=''; \
+?HAVE_NOTRANS? list2='%NOTRANS_LIST%'; \
+       test -n "$(man%SECTION%dir)" \
+         && case "$$list1$$list2" in *[^\ ]*) :;; *) false;; esac \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man%SECTION%dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
 ## Extract all items from notrans_man_MANS that should go in this section.
 ## This must be done dynamically to support conditionals.
-?HAVE_NOTRANS? l2='%NOTRANS_LIST%'; for i in $$l2; do echo "$$i"; done | \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
 ## Accept for `man1' files like `foo.1c' but not `sub.1/foo.2' or `foo-2.1.4'.
-?HAVE_NOTRANS?   sed -n '/\.%SECTION%[a-z]*$$/p'; \
+           | sed -n '/\.%SECTION%[a-z]*$$/p'; \
+       fi; \
 ## Extract basename of manpage, change the extension if needed.
        } | while read p; do \
 ## Find the file.
@@ -66,13 +73,22 @@ if %?NOTRANS_MANS%
 endif %?NOTRANS_MANS%
 if %?TRANS_MANS%
 ## Handle MANS without notrans_ prefix
-       @list='%TRANS_SECT_LIST%'; test -n "$(man%SECTION%dir)" || exit 0; \
-       { for i in $$list; do echo "$$i"; done; \
+       @list1='%TRANS_SECT_LIST%'; \
+?!HAVE_TRANS?  list2=''; \
+?HAVE_TRANS?   list2='%TRANS_LIST%'; \
+       test -n "$(man%SECTION%dir)" \
+         && case "$$list1$$list2" in *[^\ ]*) :;; *) false;; esac \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man%SECTION%dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
 ## Extract all items from notrans_man_MANS that should go in this section.
 ## This must be done dynamically to support conditionals.
-?HAVE_TRANS?   l2='%TRANS_LIST%'; for i in $$l2; do echo "$$i"; done | \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
 ## Accept for `man1' files like `foo.1c' but not `sub.1/foo.2' or `foo-2.1.4'.
-?HAVE_TRANS?     sed -n '/\.%SECTION%[a-z]*$$/p'; \
+           | sed -n '/\.%SECTION%[a-z]*$$/p'; \
+       fi; \
 ## Extract basename of manpage, change the extension if needed.
        } | while read p; do \
 ## Find the file.
diff --git a/lib/am/progs.am b/lib/am/progs.am
index d39b23d..da26277 100644
--- a/lib/am/progs.am
+++ b/lib/am/progs.am
@@ -1,6 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004,
-## 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+## Copyright (C) 1994-2012 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
@@ -24,10 +23,13 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
 .PHONY install-%EXEC?exec:data%-am: install-%DIR%PROGRAMS
 install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        @list='$(%DIR%_PROGRAMS)'; test -n "$(%NDIR%dir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
+       fi; \
        for p in $$list; do echo "$$p $$p"; done | \
 ## On Cygwin with libtool test won't see `foo.exe' but instead `foo'.
 ## So we check for both.
diff --git a/lib/am/python.am b/lib/am/python.am
index bb2748c..cab6129 100644
--- a/lib/am/python.am
+++ b/lib/am/python.am
@@ -29,9 +29,12 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
 .PHONY install-%EXEC?exec:data%-am: install-%DIR%PYTHON
 install-%DIR%PYTHON: $(%DIR%_PYTHON)
        @$(NORMAL_INSTALL)
-       test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
 if %?BASE%
        @list='$(%DIR%_PYTHON)'; dlist=; list2=; test -n "$(%NDIR%dir)" || 
list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
+       fi; \
        for p in $$list; do \
 ## A file can be in the source directory or the build directory.
          if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
@@ -58,6 +61,10 @@ if %?BASE%
        else :; fi
 else !%?BASE%
        @list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
+       fi; \
        $(am__nobase_list) | while read dir files; do \
          xfiles=; for p in $$files; do \
 ## A file can be in the source directory or the build directory.
diff --git a/lib/am/scripts.am b/lib/am/scripts.am
index 346f0d3..64e093e 100644
--- a/lib/am/scripts.am
+++ b/lib/am/scripts.am
@@ -1,6 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003, 2004, 2006, 2007,
-## 2008, 2009 Free Software Foundation, Inc.
+## Copyright (C) 1994-2012 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
@@ -29,10 +28,13 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
 .PHONY install-%EXEC?exec:data%-am: install-%DIR%SCRIPTS
 install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
        @$(NORMAL_INSTALL)
-       test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        @list='$(%DIR%_SCRIPTS)'; test -n "$(%NDIR%dir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
+       fi; \
 ?!BASE?        $(am__nobase_strip_setup); \
        for p in $$list; do \
 ## A file can be in the source directory or the build directory.
diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am
index 5314dec..9190e8f 100644
--- a/lib/am/texinfos.am
+++ b/lib/am/texinfos.am
@@ -1,7 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
 
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-## 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+## Copyright (C) 1994-2012 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
@@ -143,8 +142,11 @@ include inst-vars.am
 
 install-dvi-am: $(DVIS)
        @$(NORMAL_INSTALL)
-       test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)"
        @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -156,8 +158,11 @@ install-dvi-am: $(DVIS)
 
 install-html-am: $(HTMLS)
        @$(NORMAL_INSTALL)
-       test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
        @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
          $(am__strip_dir) \
@@ -184,9 +189,12 @@ install-html-am: $(HTMLS)
 
 install-info-am: $(INFO_DEPS)
        @$(NORMAL_INSTALL)
-       test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)"
        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
        list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
+       fi; \
        for file in $$list; do \
 ## Strip possible $(srcdir) prefix.
          case $$file in \
@@ -242,8 +250,11 @@ install-info-am: $(INFO_DEPS)
 
 install-pdf-am: $(PDFS)
        @$(NORMAL_INSTALL)
-       test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
        @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -254,8 +265,11 @@ install-pdf-am: $(PDFS)
 
 install-ps-am: $(PSS)
        @$(NORMAL_INSTALL)
-       test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)"
        @list='$(PSS)'; test -n "$(psdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9cac904..b2a8e05 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -25,7 +25,7 @@ dist-auxfile.test \
 dist-auxfile-2.test \
 dist-pr109765.test \
 gcj6.test \
-instdir-cond.test \
+instdir-cond2.test \
 java-nobase.test \
 objext-pr10128.test \
 pr8365-remake-timing.test \
diff --git a/tests/aclocal-install-fail.test b/tests/aclocal-install-fail.test
new file mode 100755
index 0000000..cf493aa
--- /dev/null
+++ b/tests/aclocal-install-fail.test
@@ -0,0 +1,65 @@
+#! /bin/sh
+# Copyright (C) 2012 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 that "aclocal --install" fails when it should.
+# FIXME: this is a good candidate for a conversion to TAP.
+
+am_create_testdir=empty
+required=ro-dir
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+MY_MACRO
+END
+
+mkdir sys-acdir
+cat > sys-acdir/my-defs.m4 <<END
+AC_DEFUN([MY_MACRO], [:])
+END
+
+ACLOCAL="$ACLOCAL -Wnone --system-acdir=sys-acdir"
+
+: > a-regular-file
+mkdir unwritable-dir
+chmod a-w unwritable-dir
+
+$ACLOCAL -I a-regular-file --install 2>stderr \
+  && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$EGREP '(mkdir:|directory ).*a-regular-file' stderr
+test ! -f aclocal.m4
+
+$ACLOCAL --install -I unwritable-dir/sub 2>stderr \
+  && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$EGREP '(mkdir:|directory ).*unwritable-dir/sub' stderr
+test ! -f aclocal.m4
+
+$ACLOCAL -I unwritable-dir --install 2>stderr \
+  && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$EGREP '(cp:|copy ).*unwritable-dir' stderr
+test ! -f aclocal.m4
+
+# Sanity check.
+mkdir m4
+$ACLOCAL -I m4 --install && test -f aclocal.m4 \
+  || fatal_ "aclocal failed also when expected to succeed"
+
+:
diff --git a/tests/aclocal-install-mkdir.test b/tests/aclocal-install-mkdir.test
new file mode 100755
index 0000000..54e97ab
--- /dev/null
+++ b/tests/aclocal-install-mkdir.test
@@ -0,0 +1,72 @@
+#! /bin/sh
+# Copyright (C) 2012 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 that "aclocal --install" creates the local m4 directory if
+# necessary.
+# FIXME: this is a good candidate for a conversion to TAP.
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+MY_MACRO
+END
+
+mkdir sys-acdir
+cat > sys-acdir/my-defs.m4 <<END
+AC_DEFUN([MY_MACRO], [:])
+END
+
+ACLOCAL="$ACLOCAL --system-acdir=sys-acdir"
+
+$ACLOCAL -I foo --install
+test -f foo/my-defs.m4
+
+$ACLOCAL --install -I "`pwd`/bar"
+test -f bar/my-defs.m4
+
+$ACLOCAL --install -I baz/sub/sub2
+test -f baz/sub/sub2/my-defs.m4
+
+# What should happen:
+#  * zardoz1 should be created, and required m4 files copied into there.
+#  * zardoz2 shouldn't be preferred to quux, even if the former exists
+#    while the latter does not.
+mkdir zardoz2
+$ACLOCAL --install -I zardoz1 -I zardoz2
+test -d zardoz1
+grep MY_MACRO zardoz1/my-defs.m4
+ls zardoz2 | grep . && Exit 1
+
+# Directories in ACLOCAL_PATH should never be created if they don't
+# exist.
+ACLOCAL_PATH="`pwd`/none:`pwd`/none2" $ACLOCAL --install && Exit 1
+test ! -d none
+test ! -d none2
+ACLOCAL_PATH="`pwd`/none:`pwd`/none2" $ACLOCAL --install -I x
+test -f x/my-defs.m4
+test ! -d none
+test ! -d none2
+
+# It's better if aclocal doesn't create the first include dir on failure.
+$ACLOCAL --install -I none -I none2 && Exit 1
+test ! -d none
+test ! -d none2
+
+:
diff --git a/tests/help-regex.test b/tests/aclocal-no-install-no-mkdir.test
similarity index 66%
copy from tests/help-regex.test
copy to tests/aclocal-no-install-no-mkdir.test
index 3eff5f9..73a6116 100755
--- a/tests/help-regex.test
+++ b/tests/aclocal-no-install-no-mkdir.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2012 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
@@ -14,25 +14,26 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure that obsolescent macro `AM_WITH_REGEX' adds proper text to
-# the configure help screen.
+# Check that aclocal does not create a non-existent local m4 directory
+# if the '--install' option is not given.
 
+am_create_testdir=empty
 . ./defs || Exit 1
 
 set -e
 
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
-AM_WITH_REGEX
+MY_MACRO
 END
 
-$ACLOCAL
-$AUTOCONF
-
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
+mkdir sys-acdir
+cat > sys-acdir/my-defs.m4 <<END
+AC_DEFUN([MY_MACRO], [:])
+END
 
-$FGREP ' --without-regex ' stdout
-$FGREP ' use GNU rx ' stdout
+$ACLOCAL -I foo --system-acdir=sys-acdir && Exit 1
+test ! -d foo
+test ! -r foo
 
 :
diff --git a/tests/dist-auxfile-2.test b/tests/aclocal-verbose-install.test
similarity index 51%
copy from tests/dist-auxfile-2.test
copy to tests/aclocal-verbose-install.test
index 08daa6c..589d540 100755
--- a/tests/dist-auxfile-2.test
+++ b/tests/aclocal-verbose-install.test
@@ -14,10 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Files specified by AC_REQUIRE_AUX_FILE must exist, and if a Makefile
-# is present in the build-aux directory, they correctly get automatically
-# distributed.
-# Related to automake bug#9651.
+# Check verbose messages by `aclocal --install'.
 
 am_create_testdir=empty
 . ./defs || Exit 1
@@ -26,37 +23,32 @@ set -e
 
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
-AC_CONFIG_AUX_DIR([sub])
-AM_INIT_AUTOMAKE
-AC_REQUIRE_AUX_FILE([zardoz])
-AC_CONFIG_FILES([Makefile sub/Makefile])
-AC_OUTPUT
+MY_MACRO_BAR
+MY_MACRO_QUUX
 END
 
-cat > Makefile.am <<'END'
-SUBDIRS = sub
-test: distdir
-       ls -l $(distdir) $(distdir)/* ;: For debugging.
-       test -f $(distdir)/sub/zardoz
-.PHONY: test
-check-local: test
+mkdir sys-acdir
+cat > sys-acdir/bar.m4 <<END
+AC_DEFUN([MY_MACRO_BAR], [:])
+END
+cat > sys-acdir/quux.m4 <<END
+AC_DEFUN([MY_MACRO_QUUX], [:])
 END
 
-mkdir sub
-: > sub/Makefile.am
-
-echo dummy > sub/zardoz
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-test -f sub/install-sh
-# Should work also without `--add-missing'.
-$AUTOMAKE
-
-./configure
-
-$MAKE test
-$MAKE distcheck
+mkdir foodir
+: > foodir/bar.m4
+
+$ACLOCAL --system-acdir=sys-acdir --install --verbose -I foodir 2>stderr \
+ || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep ' installing .*sys-acdir/bar\.m4.* to .*foodir/bar\.m4' stderr
+grep ' installing .*sys-acdir/quux\.m4.* to .*foodir/quux\.m4' stderr
+grep ' overwriting .*foodir/bar\.m4.* with .*sys-acdir/bar\.m4' stderr
+grep ' installing .*foodir/quux\.m4.* from .*sys-acdir/quux\.m4' stderr
+
+# Sanity checks.
+ls -l foodir
+grep MY_MACRO_BAR foodir/bar.m4
+grep MY_MACRO_QUUX foodir/quux.m4
 
 :
diff --git a/tests/installdir.test b/tests/installdir.test
index b09f495..2fc1285 100755
--- a/tests/installdir.test
+++ b/tests/installdir.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 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
@@ -15,17 +15,47 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test for PR 203.
+# See also automake bug#11030.
 
 . ./defs || Exit 1
 
 set -e
 
+echo AC_OUTPUT >> configure.in
+
 cat > Makefile.am << 'END'
+foodir = $(datadir)/$(distdir)
 installdirs-local:
-       @echo here
+       $(MKDIR_P) $(DESTDIR)$(foodir)
+install-data-hook: installdirs-local
 END
 
 $ACLOCAL
 $AUTOMAKE
 
-test `grep installdirs-local Makefile.in | wc -l` -eq 3
+test `grep installdirs-local Makefile.in | wc -l` -eq 4
+
+cwd=`pwd` || fatal_ "getting current working directory"
+
+$AUTOCONF
+./configure --prefix="$cwd/inst"
+
+$MAKE installdirs
+test -d inst/share/$me-1.0
+rm -rf inst
+
+$MAKE install
+test -d inst/share/$me-1.0
+rm -rf inst
+
+./configure --prefix=/foo
+
+$MAKE installdirs DESTDIR="$cwd/dest"
+test -d dest/foo/share/$me-1.0
+rm -rf dest
+
+$MAKE install DESTDIR="$cwd/dest"
+test -d dest/foo/share/$me-1.0
+rm -rf dest
+
+:
diff --git a/tests/instdir-cond.test b/tests/instdir-cond.test
index 8d83f88..9cdd810 100644
--- a/tests/instdir-cond.test
+++ b/tests/instdir-cond.test
@@ -30,9 +30,10 @@ END
 : > bar
 
 cat > Makefile.am << 'END'
+pkglibexec_SCRIPTS =
 if ENABLE_FOO
 pkgdata_DATA = foo
-pkglibexec_SCRIPTS = bar
+pkglibexec_SCRIPTS += bar
 endif
 END
 
diff --git a/tests/instdir-empty.test b/tests/instdir-cond2.test
similarity index 54%
rename from tests/instdir-empty.test
rename to tests/instdir-cond2.test
index f699583..6cdc26d 100644
--- a/tests/instdir-empty.test
+++ b/tests/instdir-cond2.test
@@ -14,45 +14,40 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# An empty "foo_PRIMARY" declaration should cause "make install" to create
-# directory $(foodir).  Suggested in discussion on automake bug#10997.
+# Check against automake bug#10997: directories holding only
+# conditionally-installed files should not be created unconditionally.
+# FIXME: this test tries to check that the above also hold for the
+# FIXME: "installdirs" target, but that doesn't currently work :-(
+# FIXME: So this test is still xfailing.
+# See sister test 'instdir-cond.test' for the succeeding part.
 
 . ./defs || Exit 1
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AM_CONDITIONAL([ENABLE_FOO], [false])
+AC_OUTPUT
+END
+
+: > foo
+: > bar
 
 cat > Makefile.am << 'END'
-pkgdata_DATA =
-libexec_SCRIPTS =
+pkglibexec_SCRIPTS =
+if ENABLE_FOO
+pkgdata_DATA = foo
+pkglibexec_SCRIPTS += bar
+endif
 END
 
 $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-cwd=`pwd`
-./configure --prefix="$cwd/inst"
-
-$MAKE install
-test -d inst/share/$me
-test -d inst/libexec
-rm -rf inst
-
-$MAKE install-exec
-test ! -d inst/share
-test -d inst/libexec
-rm -rf inst
-
-$MAKE install-data
-test -d inst/share/$me
-test ! -d inst/libexec
-rm -rf inst
+./configure --prefix="`pwd`/inst"
 
-./configure --prefix=/foo
-$MAKE install DESTDIR=$cwd/dest
-test -d dest/foo/share/$me
-test -d dest/foo/libexec
+$MAKE installdirs
+test ! -d inst || { find inst; Exit 1; }
 
 :
diff --git a/tests/instdir-no-empty.test b/tests/instdir-no-empty.test
new file mode 100755
index 0000000..cf57996
--- /dev/null
+++ b/tests/instdir-no-empty.test
@@ -0,0 +1,123 @@
+#! /bin/sh
+# Copyright (C) 2012 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/>.
+
+# An empty "foo_PRIMARY" declaration should *not* cause "make install"
+# to create directory $(foodir).  See automake bug#10997 and bug#11030.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<END
+AC_SUBST([CC], [whatever])
+AC_SUBST([JAVAC], [whatever])
+AM_PATH_PYTHON(,,:)
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+mydir = $(prefix)/my
+myexecdir = $(prefix)/myexec
+javadir = $(prefix)/java
+END
+
+# Write Makefile.am.
+{
+
+  for dir in sbin bin libexec pkglibexec myexec; do
+    for dst in '' dist_ nodist_; do
+      echo "${dst}${dir}_SCRIPTS ="
+    done
+    echo "${dir}_PROGRAMS ="
+  done
+
+  for dir in lib pkglib myexec my; do
+    echo "${dir}_LIBRARIES ="
+    echo "${dir}_LTLIBRARIES ="
+  done
+
+  for p1 in '' notrans_; do
+    for p2 in '' dist_ nodist_; do
+      for s in '' 1 2 3 4 5 6 7 8 9; do
+        echo "${p1}${p2}man${s}_MANS ="
+      done
+    done
+  done
+
+  for dst in '' dist_ nodist_; do
+    for dir in dataroot data pkgdata doc lisp my; do
+      echo "${dst}${dir}_DATA ="
+    done
+    for dir in include pkginclude oldinclude my; do
+      echo "${dst}${dir}_HEADERS ="
+    done
+    for dir in python my; do
+      echo "${dst}${dir}_PYTHON ="
+    done
+    for dir in info my; do
+      echo "${dst}${dir}_TEXINFOS ="
+    done
+    for dir in java my; do
+      echo "${dst}${dir}_JAVA ="
+    done
+    for dir in lisp my; do
+      echo "${dst}${dir}_LISP ="
+    done
+  done
+
+} > t
+
+cat t >> Makefile.am
+sed 's/^/nobase_/' t >> Makefile.am
+rm -f t
+
+cat Makefile.am # For debugging.
+
+# Sanity check.
+grep '^oldinclude_HEADERS =' Makefile.am \
+  && grep '^nodist_my_PYTHON =' Makefile.am \
+  && grep '^notrans_dist_man5_MANS =' Makefile.am \
+  || fatal_ "creating Makefile.am"
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+cwd=`pwd` || fatal_ "getting current working directory"
+
+doinst ()
+{
+  $MAKE install install-pdf install-ps install-dvi ${1+"$@"}
+}
+
+: > foo.sh
+
+./configure --prefix="$cwd/inst"
+doinst
+test ! -d inst || { find inst; Exit 1; }
+$MAKE uninstall
+doinst bin_SCRIPTS=foo.sh
+test -f inst/bin/foo.sh
+
+./configure
+doinst DESTDIR="$cwd/dest"
+test ! -d dest || { find dest; Exit 1; }
+$MAKE uninstall
+doinst DESTDIR="$cwd/dest" bin_SCRIPTS=foo.sh
+test -f dest/usr/local/bin/foo.sh
+
+:
diff --git a/tests/java3.test b/tests/java3.test
index e1850a8..5701d8f 100755
--- a/tests/java3.test
+++ b/tests/java3.test
@@ -48,8 +48,11 @@ cwd=`pwd` || Exit 1
 ./configure --prefix="$cwd/_inst"
 $MAKE
 $MAKE install
-ls -l . _inst/java # For debugging.
+ls -l .
 find . -name '*.class' | grep . && Exit 1
+# If we have nothing to install, we shouldn't create any installation
+# directory.  Related to automake bug#11030.
+test ! -d _inst
 $MAKE uninstall
 $MAKE distcheck
 
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index b5a604c..3280833 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -64,6 +64,10 @@ aclocal-path-install.test \
 aclocal-path-install-serial.test \
 aclocal-path-nonexistent.test \
 aclocal-path-precedence.test \
+aclocal-install-fail.test \
+aclocal-install-mkdir.test \
+aclocal-no-install-no-mkdir.test \
+aclocal-verbose-install.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
@@ -460,7 +464,8 @@ instdat2.test \
 instdir.test \
 instdir2.test \
 instdir-cond.test \
-instdir-empty.test \
+instdir-cond2.test \
+instdir-no-empty.test \
 instdir-java.test \
 instdir-lisp.test \
 instdir-ltlib.test \


hooks/post-receive
-- 
GNU Automake



reply via email to

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