Sync from Automake.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 14 Oct 2006 23:40:42 +0000 (23:40 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 14 Oct 2006 23:40:42 +0000 (23:40 +0000)
* build-aux/install-sh (posix_mkdir): Reject FreeBSD 6.1 mkdir -p -m,
which incorrectly sets the mode of an existing destination
directory.  In some cases the unpatched install-sh could do the
equivalent of "chmod 777 /" or "chmod 0 /" on a buggy FreeBSD
system.  We hope this is rare in practice, but it's clearly worth
fixing.  Problem reported by Alex Unleashed in
<http://lists.gnu.org/archive/html/bug-autoconf/2006-10/msg00012.html>.
Also, don't bother to check for -m bugs unless we're using -m;
suggested by Stepan Kasal.

2006-10-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

Sync from Automake.
* build-aux/depcomp (gcc3): Put dependency extraction flags before the
`-c' flag, so they appear at the same position as in %FASTDEP%
mode in depend2.am.  Fixes build failure for FreeBSD's c89,
which ignores unknown options only after the first non-option.
Bug report against M4 by Nelson H. F. Beebe.

ChangeLog
build-aux/depcomp
build-aux/install-sh

index 561bfdb8b21332a32a13f6cfb742f0c2efc377e6..5d46d8843810407bebc08d0c948c601afcd92961 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2006-10-14  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Sync from Automake.
+       * build-aux/install-sh (posix_mkdir): Reject FreeBSD 6.1 mkdir -p -m,
+       which incorrectly sets the mode of an existing destination
+       directory.  In some cases the unpatched install-sh could do the
+       equivalent of "chmod 777 /" or "chmod 0 /" on a buggy FreeBSD
+       system.  We hope this is rare in practice, but it's clearly worth
+       fixing.  Problem reported by Alex Unleashed in
+       <http://lists.gnu.org/archive/html/bug-autoconf/2006-10/msg00012.html>.
+       Also, don't bother to check for -m bugs unless we're using -m;
+       suggested by Stepan Kasal.
+
+2006-10-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Sync from Automake.
+       * build-aux/depcomp (gcc3): Put dependency extraction flags before the
+       `-c' flag, so they appear at the same position as in %FASTDEP%
+       mode in depend2.am.  Fixes build failure for FreeBSD's c89,
+       which ignores unknown options only after the first non-option.
+       Bug report against M4 by Nelson H. F. Beebe.
+
 2006-10-13  Jim Meyering  <jim@meyering.net>
 
        Fix a bug in yesterday's change.
index ffe5461bdead5741ab8de333fb015a950d090a0d..7d409372d7d37c9fd35052f1b11623517e15c1be 100755 (executable)
@@ -92,7 +92,20 @@ gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
 ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
 ## it if -MD -MP comes after the -MF stuff.  Hmm.
-  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
   stat=$?
   if test $stat -eq 0; then :
   else
index 9d6a5eb7cd1e31899a10d3e780bef9f4ba8e27bc..4fbbae7b7ff932e5af542dbe9612f193a68ed4d1 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2006-05-11.20
+scriptversion=2006-10-14.15
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -336,12 +336,26 @@ do
            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
 
            if (umask $mkdir_umask &&
-               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
            then
-             # Check for bugs in HP-UX 11.23 and IRIX 6.5 mkdir.
-             case `ls -ld "$tmpdir"` in
-               d????-??-* ) posix_mkdir=:;;
-             esac
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
              rmdir "$tmpdir/d" "$tmpdir"
            else
              # Remove any dirs left behind by ancient mkdir implementations.