* m4/mkdirp.m4 (AM_PROG_MKDIR_P): Rewrite using AC_PROG_MKDIR_P.
authorAlexandre Duret-Lutz <adl@gnu.org>
Wed, 7 Jun 2006 05:38:29 +0000 (05:38 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Wed, 7 Jun 2006 05:38:29 +0000 (05:38 +0000)
13 files changed:
ChangeLog
Makefile.in
configure
doc/Makefile.in
doc/stamp-vti
doc/version.texi
lib/Automake/Makefile.in
lib/Automake/tests/Makefile.in
lib/Makefile.in
lib/am/Makefile.in
m4/Makefile.in
m4/mkdirp.m4
tests/Makefile.in

index 4d000b8..9dc41c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-07  Stepan Kasal  <kasal@ucw.cz>
+
+       * m4/mkdirp.m4 (AM_PROG_MKDIR_P): Rewrite using AC_PROG_MKDIR_P.
+
 2006-06-06  Stepan Kasal  <kasal@ucw.cz>
            Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
 
index 10daac2..26c11f6 100644 (file)
@@ -102,6 +102,7 @@ LIBS = @LIBS@
 LN = @LN@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 MODIFICATION_DELAY = @MODIFICATION_DELAY@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
index f20cdec..ad15c9a 100755 (executable)
--- a/configure
+++ b/configure
@@ -1885,42 +1885,49 @@ else
 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 fi
 
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to define $(mkdir_p) as `mkdir -p .', in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However we don't do
-  # that anymore.
-  #  1. before we restricted the check to GNU mkdir, `mkdir -p .' was
-  #     reported to fail in read-only directories.  The system where this
-  #     happened has been forgotten.
-  #  2. in practice we call $(mkdir_p) on directories such as
-  #       $(mkdir_p) "$(DESTDIR)$(somedir)"
-  #     and we don't want to create $(DESTDIR) if $(somedir) is empty.
-  #     To support the latter case, we have to write
-  #       test -z "$(somedir)" || $(mkdir_p) "$(DESTDIR)$(somedir)"
-  #     so $(mkdir_p) always has an argument.
-  #     We will have better chances of detecting a missing test if
-  #     $(mkdir_p) complains about missing arguments.
-  #  3. $(mkdir_p) is named after `mkdir -p' and we don't expect this
-  #     to accept no argument.
-  #  4. having something like `mkdir .' in the output is unsightly.
-  mkdir_p='mkdir -p'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
+{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
   else
-    mkdir_p='$(install_sh) -d'
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
   fi
 fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
+
+mkdir_p=$MKDIR_P
 
 for ac_prog in gawk mawk nawk awk
 do
@@ -3129,6 +3136,7 @@ gives unlimited permission to copy, distribute and modify it."
 ac_pwd='$ac_pwd'
 srcdir='$srcdir'
 INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -3596,6 +3604,11 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
   *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
   esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -3649,6 +3662,7 @@ s&@builddir@&$ac_builddir&;t t
 s&@abs_builddir@&$ac_abs_builddir&;t t
 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
 
index 710162d..06a04e2 100644 (file)
@@ -96,6 +96,7 @@ LIBS = @LIBS@
 LN = @LN@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 MODIFICATION_DELAY = @MODIFICATION_DELAY@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
index 636745f..fbc1f74 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 26 May 2006
-@set UPDATED-MONTH May 2006
+@set UPDATED 6 June 2006
+@set UPDATED-MONTH June 2006
 @set EDITION 1.9a
 @set VERSION 1.9a
index 636745f..fbc1f74 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 26 May 2006
-@set UPDATED-MONTH May 2006
+@set UPDATED 6 June 2006
+@set UPDATED-MONTH June 2006
 @set EDITION 1.9a
 @set VERSION 1.9a
index 987e9d0..c5c587f 100644 (file)
@@ -96,6 +96,7 @@ LIBS = @LIBS@
 LN = @LN@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 MODIFICATION_DELAY = @MODIFICATION_DELAY@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
index c205568..516571e 100644 (file)
@@ -72,6 +72,7 @@ LIBS = @LIBS@
 LN = @LN@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 MODIFICATION_DELAY = @MODIFICATION_DELAY@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
index 7aac954..80b178e 100644 (file)
@@ -99,6 +99,7 @@ LIBS = @LIBS@
 LN = @LN@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 MODIFICATION_DELAY = @MODIFICATION_DELAY@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
index 50f43b0..ff69585 100644 (file)
@@ -83,6 +83,7 @@ LIBS = @LIBS@
 LN = @LN@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 MODIFICATION_DELAY = @MODIFICATION_DELAY@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
index 78d9f1c..ba1b463 100644 (file)
@@ -83,6 +83,7 @@ LIBS = @LIBS@
 LN = @LN@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 MODIFICATION_DELAY = @MODIFICATION_DELAY@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
index 02d7e5f..4f1c96a 100644 (file)
@@ -7,61 +7,9 @@
 
 # AM_PROG_MKDIR_P
 # ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake.  There are at least two reasons why we must not
-# use `-m 0755':
-#   - it causes special bits like SGID to be ignored,
-#   - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out.  Consequently we
-# restrict ourselves to GNU mkdir (using the --version option ensures
-# this.)
+# Check for `mkdir -p'.
 AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to define $(mkdir_p) as `mkdir -p .', in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However we don't do
-  # that anymore.
-  #  1. before we restricted the check to GNU mkdir, `mkdir -p .' was
-  #     reported to fail in read-only directories.  The system where this
-  #     happened has been forgotten.
-  #  2. in practice we call $(mkdir_p) on directories such as
-  #       $(mkdir_p) "$(DESTDIR)$(somedir)"
-  #     and we don't want to create $(DESTDIR) if $(somedir) is empty.
-  #     To support the latter case, we have to write
-  #       test -z "$(somedir)" || $(mkdir_p) "$(DESTDIR)$(somedir)"
-  #     so $(mkdir_p) always has an argument.
-  #     We will have better chances of detecting a missing test if
-  #     $(mkdir_p) complains about missing arguments.
-  #  3. $(mkdir_p) is named after `mkdir -p' and we don't expect this
-  #     to accept no argument.
-  #  4. having something like `mkdir .' in the output is unsightly.
-  mkdir_p='mkdir -p'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
-  else
-    mkdir_p='$(install_sh) -d'
-  fi
-fi
-AC_SUBST([mkdir_p])])
+[AC_PREREQ([2.59c])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+AC_SUBST([mkdir_p], [$MKDIR_P])dnl
+])
index cbdce5c..751e6d1 100644 (file)
@@ -73,6 +73,7 @@ LIBS = @LIBS@
 LN = @LN@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 MODIFICATION_DELAY = @MODIFICATION_DELAY@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@