install: cope with non-injective $(transform).
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 13 Sep 2008 07:55:23 +0000 (09:55 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 13 Sep 2008 07:55:23 +0000 (09:55 +0200)
* lib/am/progs.am (install-%DIR%PROGRAMS): Rewrite rule to not
try to use the installed name as key in a hash, so destructive
$(transform) scripts still work.
* lib/am/scripts.am (install-%DIR%SCRIPTS): Likewise.
* tests/transform.test: Fix test to look in right place for
installed files.
* tests/transform2.test: New test.
* tests/Makefile.am: Adjust.
Report by Jim Meyering.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Makefile.in
aclocal.m4
configure
lib/am/progs.am
lib/am/scripts.am
tests/Makefile.am
tests/Makefile.in
tests/transform.test
tests/transform2.test [new file with mode: 0755]

index 5ece957f0fb018cbfbd5869022d25e4a11a45c82..1a33103dbc7fde190ab36a9baed7eec5e7a4aaab 100644 (file)
@@ -298,22 +298,20 @@ install-binSCRIPTS: $(bin_SCRIPTS)
        sed -e 'p;s,.*/,,;n' \
            -e 'h;s|.*|.|' \
            -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
-       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = ""; list[""] = "" } { \
-         if ($$2 == $$4) tgt = $$3; else tgt = $$3 "/" $$4; \
-         files[tgt] = files[tgt] " " $$1; dirs[$$3] = 1; \
-         if (++n[tgt] == $(am__install_max)) \
-           { list[++lno] = tgt " " files[tgt]; n[tgt] = 0; files[tgt] = "" } } \
-         END { d = ""; for (dir in dirs) d = d " " dir; print d; \
-               for (l in list) print list[l]; \
-               for (dir in files) print dir, files[dir] }' | { \
-       read dirs; \
-       while read dir files; do \
-         if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-         test -z "$$files" || { \
-           echo " $(binSCRIPT_INSTALL) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-           $(binSCRIPT_INSTALL) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-         }; \
-       done; }
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(binSCRIPT_INSTALL) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+              $(binSCRIPT_INSTALL) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+            } \
+       ; done
 
 uninstall-binSCRIPTS:
        @$(NORMAL_UNINSTALL)
index 16f8a3039e203ca989d8a020fe1f02aaddc1ece0..b275e43d67b0d95996623d327613573f702719eb 100644 (file)
@@ -13,8 +13,8 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.62],,
-[m4_warning([this file was generated for autoconf 2.62.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
index a6ded566a383c7707b2857335b29bd311c30a9ac..d7591c2ad6e722dcadc8789b0a18671a624ca0b1 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for GNU Automake 1.10a.
+# Generated by GNU Autoconf 2.63 for GNU Automake 1.10a.
 #
 # Report bugs to <bug-automake@gnu.org>.
 #
@@ -601,82 +601,82 @@ PACKAGE_STRING='GNU Automake 1.10a'
 PACKAGE_BUGREPORT='bug-automake@gnu.org'
 
 ac_unique_file="automake.in"
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-build
-build_cpu
-build_vendor
-build_os
-am_AUTOCONF
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-am__isrc
-CYGPATH_W
-PACKAGE
-VERSION
-ACLOCAL
-AUTOCONF
-AUTOMAKE
-AUTOHEADER
-MAKEINFO
-install_sh
-STRIP
-INSTALL_STRIP_PROGRAM
-MKDIR_P
-mkdir_p
-AWK
-SET_MAKE
-am__leading_dot
-AMTAR
-am__tar
-am__untar
-APIVERSION
-pkgvdatadir
-PERL
-TEX
-LN
-MODIFICATION_DELAY
-GREP
-EGREP
-FGREP
+ac_subst_vars='LTLIBOBJS
 LIBOBJS
-LTLIBOBJS'
+FGREP
+EGREP
+GREP
+MODIFICATION_DELAY
+LN
+TEX
+PERL
+pkgvdatadir
+APIVERSION
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+am_AUTOCONF
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -1106,9 +1106,9 @@ fi
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) { $as_echo "$as_me: error: Unrecognized options: $ac_unrecognized_opts" >&2
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
    { (exit 1); exit 1; }; } ;;
-    *)     $as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2 ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
 
@@ -1161,7 +1161,7 @@ test "$silent" = yes && exec 6>/dev/null
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { $as_echo "$as_me: error: Working directory cannot be determined" >&2
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
    { (exit 1); exit 1; }; }
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
   { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
@@ -1373,7 +1373,7 @@ test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 GNU Automake configure 1.10a
-generated by GNU Autoconf 2.62
+generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -1387,7 +1387,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by GNU Automake $as_me 1.10a, which was
-generated by GNU Autoconf 2.62.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
 
@@ -1510,8 +1510,8 @@ _ASBOX
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
@@ -1714,6 +1714,8 @@ $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
   fi
 done
 if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
   { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
   { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
@@ -2273,12 +2275,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     STRIP=$ac_ct_STRIP
@@ -2780,8 +2778,8 @@ _ACEOF
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
@@ -3209,7 +3207,7 @@ exec 6>&1
 # values after options handling.
 ac_log="
 This file was extended by GNU Automake $as_me 1.10a, which was
-generated by GNU Autoconf 2.62.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -3222,6 +3220,12 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q`
 
 _ACEOF
 
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
@@ -3233,14 +3237,15 @@ ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
 
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [FILE]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
-  -q, --quiet      do not print progress messages
+  -q, --quiet, --silent
+                   do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
+      --file=FILE[:TEMPLATE]
                    instantiate the configuration file FILE
 
 Configuration files:
@@ -3252,7 +3257,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
 GNU Automake config.status 1.10a
-configured by $0, generated by GNU Autoconf 2.62,
+configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright (C) 2008 Free Software Foundation, Inc.
@@ -3452,7 +3457,8 @@ for ac_last_try in false false false false false :; do
 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
    { (exit 1); exit 1; }; }
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
     { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -3579,8 +3585,8 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-$as_echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
    { (exit 1); exit 1; }; };;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
@@ -3886,7 +3892,7 @@ if test "$no_create" != yes; then
   $ac_cs_success || { (exit 1); exit 1; }
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:$LINENO: WARNING: Unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2;}
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
index 28505cf84573c506e6066f68a5ff7940007517a9..ea14053cef4d2ec905c31b27a8258206c76056ab 100644 (file)
@@ -47,29 +47,31 @@ install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
 ## The following awk script turns that into one line containing directories
-## and then lines of `target_name_or_directory sources...'.
-       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = "" } { \
-         if ($$2 == $$4) tgt = $$3; else tgt = $$3 "/" $$4; \
-         files[tgt] = files[tgt] " " $$1; dirs[$$3] = 1 } \
-         END { d=""; for (dir in dirs) d = d " " dir; print d; \
-               for (dir in files) print dir, files[dir] }' | { \
-       read dirs; \
-?!BASE?        for dir in $$dirs; do test . = $$dir || { \
-?!BASE?          echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
-?!BASE?          $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; \
-?!BASE?        }; done; \
-       while read dir files; do \
-         if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-         test -z "$$files" || { \
-?!LIBTOOL?         echo " $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
-?!LIBTOOL?         $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
+## and then lines of 'type target_name_or_directory sources...', with type
+## 'd' designating directories, and 'f' files.
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+?!BASE?          case $$type in \
+?!BASE?          d) echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
+?!BASE?             $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?;; \
+?!BASE?          f) \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+?!LIBTOOL?           echo " $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
+?!LIBTOOL?           $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
 ## Note that we explicitly set the libtool mode.  This avoids any
 ## lossage if the install program doesn't have a name that libtool
 ## expects.
-?LIBTOOL?        echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(%DIR%PROGRAMS_INSTALL) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
-?LIBTOOL?        $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(%DIR%PROGRAMS_INSTALL) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
-         }; \
-       done; }
+?LIBTOOL?          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(%DIR%PROGRAMS_INSTALL) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
+?LIBTOOL?          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(%DIR%PROGRAMS_INSTALL) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
+           } \
+?!BASE?          ;; esac \
+       ; done
+
 endif %?INSTALL%
 
 
index 6db83daebd466363900e7d6ab87da8af3f4cdf3f..e4b61d1766f586633f8b87e00815f2eb54d68bc5 100644 (file)
@@ -48,26 +48,25 @@ install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
 ?BASE?     -e 'h;s|.*|.|' \
 ?!BASE?            -e "s|$$srcdirstrip/||" -e 'h;s|[^/]*$$||; s|^$$|.|' \
            -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
-       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = ""; list[""] = "" } { \
-         if ($$2 == $$4) tgt = $$3; else tgt = $$3 "/" $$4; \
-         files[tgt] = files[tgt] " " $$1; dirs[$$3] = 1; \
-         if (++n[tgt] == $(am__install_max)) \
-           { list[++lno] = tgt " " files[tgt]; n[tgt] = 0; files[tgt] = "" } } \
-         END { d = ""; for (dir in dirs) d = d " " dir; print d; \
-               for (l in list) print list[l]; \
-               for (dir in files) print dir, files[dir] }' | { \
-       read dirs; \
-?!BASE?        for dir in $$dirs; do test . = $$dir || { \
-?!BASE?          echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
-?!BASE?          $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; \
-?!BASE?        }; done; \
-       while read dir files; do \
-         if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-         test -z "$$files" || { \
-           echo " $(%DIR%SCRIPT_INSTALL) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
-           $(%DIR%SCRIPT_INSTALL) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
-         }; \
-       done; }
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+?!BASE?          case $$type in \
+?!BASE?          d) echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
+?!BASE?             $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?;; \
+?!BASE?          f) \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(%DIR%SCRIPT_INSTALL) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
+              $(%DIR%SCRIPT_INSTALL) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
+            } \
+?!BASE?          ;; esac \
+       ; done
 endif %?INSTALL%
 
 
index a9e995eb8bed8b7d50eb7e80d06ecc2587c9e153..71467700bd147d141955c6f20ccb74f7c1fc8351 100644 (file)
@@ -618,6 +618,7 @@ txinfo29.test \
 txinfo30.test \
 txinfo31.test \
 transform.test \
+transform2.test \
 unused.test \
 upc.test \
 upc2.test \
index d5559b646bbbe3c96a55a5ed1c02667a916da604..bac93825ed16fdef68401de28e000ffaab14bf3b 100644 (file)
@@ -769,6 +769,7 @@ txinfo29.test \
 txinfo30.test \
 txinfo31.test \
 transform.test \
+transform2.test \
 unused.test \
 upc.test \
 upc2.test \
index 7a9e549d66ccae25633c4b86880a9a10d0d77aee..a5f473086b0d9f33c882bb98c93c87a7a7af358f 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003, 2004, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2007, 2008  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
@@ -56,7 +57,7 @@ $AUTOMAKE
 $MAKE
 $MAKE test-install
 $MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test `find inst -type f -print | wc -l` = 0
 
 # Opportunistically test for installdirs.
 rm -rf inst
diff --git a/tests/transform2.test b/tests/transform2.test
new file mode 100755 (executable)
index 0000000..f1faa94
--- /dev/null
@@ -0,0 +1,82 @@
+#! /bin/sh
+# Copyright (C) 2002, 2003, 2004, 2007, 2008  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 3, 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/>.
+
+# Make sure that --program-transform works even when multiple files are
+# collapsed.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'EOF'
+bin_PROGRAMS = p1 p2
+bin_SCRIPTS = s1.sh s2.sh
+man_MANS = m1.1 m2.1
+
+test-install: install
+       test -f inst/bin/p$(EXEEXT)
+       test -f inst/bin/s.sh
+       test -f inst/man/man1/m.1
+
+test-install-foo: install
+       test -f inst/bin/foo$(EXEEXT)
+       test -f inst/bin/foo
+       test -f inst/man/man1/foo.1
+       test ! -f inst/bin/p1$(EXEEXT)
+       test ! -f inst/bin/p2$(EXEEXT)
+       test ! -f inst/bin/s1.sh
+       test ! -f inst/bin/s2.sh
+       test ! -f inst/man/man/m1.1
+       test ! -f inst/man/man/m2.1
+EOF
+
+cat >p1.c <<'EOF'
+int
+main ()
+{
+  return 0;
+}
+EOF
+
+cp p1.c p2.c
+
+: > s1.sh
+: > s2.sh
+: > m1.1
+: > m2.1
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure --program-transform-name='s/[12]//' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+$MAKE
+$MAKE test-install
+$MAKE uninstall
+test `find inst -type f -print | wc -l` = 0
+
+# Also squash all file types in question.
+./configure --program-transform-name='s/.*/foo/' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+$MAKE
+$MAKE test-install-foo
+$MAKE uninstall
+test `find inst -type f -print | wc -l` = 0
+: