autoconf-patches
[Top][All Lists]
Advanced

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

AC_PROG_INSTALL: require installation of multiple files.


From: Ralf Wildenhues
Subject: AC_PROG_INSTALL: require installation of multiple files.
Date: Tue, 22 Jan 2008 00:25:51 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello,

the `make install' rules generated by Automake can benefit greatly from
being able to install multiple files at once.  The GNU Coding Standards
have been changed to allow this, but Autoconf's AC_PROG_INSTALL needs to
detect this, too: otherwise, it accepts some rather old ancestors of the
install-sh script (pre-GNU) that came with some imake version and which
only installed one file at a time, and sometimes removed files, too.

OK to apply, so future Automake 1.11 can depend on this being available
in Autoconf 2.62?

Cheers,
Ralf

    * lib/autoconf/programs.m4 (AC_PROG_INSTALL): Require that
    `install -c file1 file2 dir' works.
    * doc/autoconf.texi (Particular Programs): Document this.
    * NEWS: Update.

diff --git a/NEWS b/NEWS
index 854c54a..ba278ad 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,9 @@ GNU Autoconf NEWS - User visible changes.
    indent-column and wrap-column; these should not normally be needed,
    but can be used to fine-tune how the output text is wrapped.
 
+** AC_PROG_INSTALL now requires an install program that can install multiple
+   files into a target directory.
+
 ** The command 'autoconf -' now correctly processes a file from stdin.
 
 ** For all of the directory arguments for 'configure', such as '--prefix'
@@ -1669,7 +1672,7 @@ Various bug fixes.
 -----
 
 Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
-2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+2003, 2004, 2005, 2006, 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
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 3d76b3e..767ccfc 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -183,7 +183,7 @@ a package for creating scripts to configure source code 
packages using
 templates and an M4 macro package.
 
 Copyright @copyright{} 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -3730,7 +3730,9 @@ This macro screens out various instances of 
@command{install} known not to
 work.  It prefers to find a C program rather than a shell script, for
 speed.  Instead of @file{install-sh}, it can also use @file{install.sh},
 but that name is obsolete because some @command{make} programs have a rule
-that creates @file{install} from it if there is no makefile.
+that creates @file{install} from it if there is no makefile.  Starting with
+Autoconf 2.62, this macro requires @command{install} to be able to install
+multiple files into a target directory.
 
 Autoconf comes with a copy of @file{install-sh} that you can use.  If
 you use @code{AC_PROG_INSTALL}, you must include either
diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4
index 9ebdf03..20fb479 100644
--- a/lib/autoconf/programs.m4
+++ b/lib/autoconf/programs.m4
@@ -2,7 +2,7 @@
 # Checking for programs.
 
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 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
@@ -560,6 +560,7 @@ AC_REQUIRE_AUX_FILE([install-sh])dnl
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
 AC_MSG_CHECKING([for a BSD-compatible install])
 if test -z "$INSTALL"; then
 AC_CACHE_VAL(ac_cv_path_install,
@@ -586,14 +587,26 @@ case $as_dir/ in
            # program-specific install script used by HP pwplus--don't use.
            :
          else
-           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-           break 3
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two 
"`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
          fi
        fi
       done
     done
     ;;
-esac])
+esac
+])
+rm -rf conftest.one conftest.two conftest.dir
 ])dnl
   if test "${ac_cv_path_install+set}" = set; then
     INSTALL=$ac_cv_path_install




reply via email to

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