Since I don't actually use CVS autoconf anywhere (because of it's
incompatibilities with automake) and don't have it installed, please
test this patch before applying it.

  Lars J


2000-06-28  Lars J. Aas  <[EMAIL PROTECTED]>

        * acgeneral.m4 (AC_SHELL_MKDIR_P): New macro.
        (_AC_OUTPUT_FILES, _AC_OUTPUT_HEADERS, _AC_OUTPUT_LINKS,
        AC_PROG_INSTALL): use AC_SHELL_MKDIR_P


Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.497
diff -u -r1.497 acgeneral.m4
--- acgeneral.m4        2000/06/26 10:57:46     1.497
+++ acgeneral.m4        2000/06/28 12:08:52
@@ -755,6 +755,21 @@
 define([AC_SHELL_UNSET],
 [$ac_unset $1 || test "${$1+set}" != set || $1=$2 && export $1])
 
+# AC_SHELL_MKDIR_P( PATH )
+# ------------------------
+# Emulate "mkdir -p" with plain "mkdir".
+define([AC_SHELL_MKDIR_P],
+[_ac_save_ifs=$IFS
+IFS=/
+set $1
+IFS=${_ac_save_ifs}
+_ac_incr_dir="$[1]"
+while test $[#] -gt 0; do
+  test -d ${_ac_incr_dir} || mkdir ${_ac_incr_dir}
+  shift
+  _ac_incr_dir="${_ac_incr_dir}/$[1]"
+done
+])
 
 ## --------------------------------------------------- ##
 ## Common m4/sh handling of variables (indirections).  ##
@@ -4488,10 +4503,7 @@
   # Remove last slash and all that follows it.  Not all systems have dirname.
   ac_dir=`echo "$ac_file" | sed 's%/[[^/][^/]]*$%%'`
   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-    # The file is in a subdirectory.
-dnl FIXME: should actually be mkinstalldirs (parents may have
-dnl to be created too).
-    test -d "$ac_dir" || mkdir "$ac_dir"
+    AC_SHELL_MKDIR_P("$ac_dir")
     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
     # A "../" for each directory in $ac_dir_suffix.
     ac_dots=`echo "$ac_dir_suffix" | sed 's%/[[^/]]*%../%g'`
@@ -4758,10 +4770,7 @@
     # Remove last slash and all that follows it.  Not all systems have dirname.
     ac_dir=`echo "$ac_file" | sed 's%/[[^/][^/]]*$%%'`
     if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-      # The file is in a subdirectory.
-dnl FIXME: should actually be mkinstalldirs (parents may have
-dnl to be created too).
-      test -d "$ac_dir" || mkdir "$ac_dir"
+      AC_SHELL_MKDIR_P("$ac_dir")
     fi
     rm -f $ac_file
     mv $tmp/config.h $ac_file
@@ -4809,10 +4818,7 @@
   # Remove last slash and all that follows it.  Not all systems have dirname.
   ac_dest_dir=`echo $ac_dest | sed 's%/[[^/][^/]]*$%%'`
   if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
-    # The dest file is in a subdirectory.
-dnl FIXME: should actually be mkinstalldirs (parents may have
-dnl to be created too).
-    test -d "$ac_dest_dir" || mkdir "$ac_dest_dir"
+    AC_SHELL_MKDIR_P("$ac_dest_dir")
     ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
     # A "../" for each directory in $ac_dest_dir_suffix.
     ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[[^/]]*%../%g'`
@@ -4921,14 +4927,12 @@
     echo configuring in $ac_subdir
     case $srcdir in
     .) ;;
-    *)
-dnl FIXME: should actually be mkinstalldirs (parents may have
-dnl to be created too).
-      if test -d ./$ac_subdir || mkdir ./$ac_subdir; then :;
-      else
-        AC_MSG_ERROR(cannot create `pwd`/$ac_subdir)
-      fi
-      ;;
+    *) AC_SHELL_MKDIR_P(./$ac_subdir)
+       if test -d ./$ac_subdir; then :;
+       else
+         AC_MSG_ERROR(cannot create `pwd`/$ac_subdir)
+       fi
+       ;;
     esac
 
     ac_popdir=`pwd`

Reply via email to