autoconf-patches
[Top][All Lists]
Advanced

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

install-sh executability


From: Eric Blake-1
Subject: install-sh executability
Date: Tue, 18 Sep 2007 09:50:24 -0700 (PDT)

Rather than add $(SHELL) to @MKDIR_P@, what if we take the
approach of guaranteeing that install-sh is executable?
Does anyone spot issues with the following patch?

2007-09-18  Eric Blake  <address@hidden>

        Ensure that install-sh is executable.
        * lib/autoconf/general.m4 (AC_CONFIG_AUX_DIRS): Add config.status
        hook for install-sh.
        * tests/tools.at (autoconf: subdirectories): Test for this fix.
        * NEWS: Document it.
        * doc/autoconf.texi (Input): Document that install-sh is now given
        executable permissions.
        * THANKS: Update.
        * configure: Regenerate.
        Reported by Vincent Lefevre, via Karl Berry.

Index: NEWS
===================================================================
RCS file: /sources/autoconf/autoconf/NEWS,v
retrieving revision 1.439
diff -u -p -r1.439 NEWS
--- NEWS        15 Sep 2007 12:41:08 -0000      1.439
+++ NEWS        18 Sep 2007 16:47:06 -0000
@@ -36,6 +36,9 @@ GNU Autoconf NEWS - User visible changes
 
 ** AC_INIT no longer alters $@; regression introduced in 2.60.
 
+** AC_PROG_INSTALL and AC_PROG_MKDIR_P now ensure that the install-sh
+   script is executable.
+
 ** AC_USE_SYSTEM_EXTENSIONS now defines _ALL_SOURCE for Interix platforms.
 
 ** The command 'autoconf -' now correctly processes a file from stdin.
Index: doc/autoconf.texi
===================================================================
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1176
diff -u -p -r1.1176 autoconf.texi
--- doc/autoconf.texi   15 Sep 2007 12:41:08 -0000      1.1176
+++ doc/autoconf.texi   18 Sep 2007 16:47:06 -0000
@@ -1912,6 +1912,12 @@ other auxiliary files.  It checks for @f
 name is obsolete because some @code{make} have a rule that creates
 @file{install} from it if there is no makefile.
 
+As of Autoconf 2.62, a configuration hook is added (via
address@hidden, @pxref{AC_CONFIG_COMMANDS}) to ensure that
+the file @address@hidden/install-sh} has executable permissions.
+However, it is good practice to distribute @file{install-sh} with
+executable permissions already present.
+
 The auxiliary directory is commonly named @file{build-aux}.
 If you need portability to @acronym{DOS} variants, do not name the
 auxiliary directory @file{aux}.  @xref{File System Conventions}.
Index: lib/autoconf/general.m4
===================================================================
RCS file: /sources/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.957
diff -u -p -r1.957 general.m4
--- lib/autoconf/general.m4     15 Sep 2007 12:41:08 -0000      1.957
+++ lib/autoconf/general.m4     18 Sep 2007 16:47:06 -0000
@@ -1628,21 +1628,27 @@ AC_DEFUN([AC_CONFIG_AUX_DIRS],
 for ac_dir in $1; do
   if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
+    ac_prog_install_sh="$ac_aux_dir/install-sh"
+    ac_install_sh="$ac_prog_install_sh -c"
     break
   elif test -f "$ac_dir/install.sh"; then
     ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
+    ac_prog_install_sh="$ac_aux_dir/install.sh"
+    ac_install_sh="$ac_prog_install_sh -c"
     break
   elif test -f "$ac_dir/shtool"; then
     ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
+    ac_prog_install_sh="$ac_aux_dir/shtool"
+    ac_install_sh="$ac_prog_install_sh install -c"
     break
   fi
 done
 if test -z "$ac_aux_dir"; then
   AC_MSG_ERROR([cannot find install-sh or install.sh in $1])
 fi
+# Ensure install-sh is executable.
+AC_CONFIG_COMMANDS([install-sh], [chmod +x "$ac_prog_install_sh"],
+                  [ac_prog_install_sh=$ac_prog_install_sh])dnl
 
 # These three variables are undocumented and unsupported,
 # and are intended to be withdrawn in a future Autoconf release.
Index: tests/tools.at
===================================================================
RCS file: /sources/autoconf/autoconf/tests/tools.at,v
retrieving revision 1.102
diff -u -p -r1.102 tools.at
--- tests/tools.at      15 Sep 2007 12:41:09 -0000      1.102
+++ tests/tools.at      18 Sep 2007 16:47:06 -0000
@@ -378,11 +378,14 @@ AT_DATA([sub/foo.in],
 address@hidden@
 ]])
 
-AT_DATA([install-sh])
+AT_DATA([install-sh], [[#!/bin/sh
+echo "not your normal install-sh"
+]])
 
 AT_CHECK_AUTOCONF
 AT_CHECK_CONFIGURE
 AT_CHECK([[grep '^[^/].*/mkdir -p' sub/foo]], 1)
+AT_CHECK([AS_EXECUTABLE_P([install-sh])])
 
 AT_CLEANUP
 

-- 
View this message in context: 
http://www.nabble.com/install-sh-executability-tf4475481.html#a12760878
Sent from the Gnu - Autoconf - Patches mailing list archive at Nabble.com.





reply via email to

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