autoconf-patches
[Top][All Lists]
Advanced

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

AS_MKDIR_P bug/patch


From: Eric Sunshine
Subject: AS_MKDIR_P bug/patch
Date: Thu, 19 Dec 2002 17:24:58 -0500

Hello,

The following patch is for release 2.75 and the CVS version of autoconf.
The patch addresses two issues in m4sugar/m4sh.m4:

1) _AS_MKDIR_P_PREPARE behaves incorrectly on some platforms (such as
NextStep and OpenStep) for which `mkdir' does not recognize any options.
The
existing implementation leaves a bogus directory named "-p" sitting in the
working directory.  The patch removes this bogus directory if present.

2) _AS_MKDIR_P_PREPARE neglects to take advantage of the older `mkdirs'
command (note the plural) which exists on some platforms (such as NextStep
and OpenStep), and which performs the same functions as `mkdir -p'.  The
patch adds a check for `mkdirs' if `mkdir -p' fails.

-- ES


--- m4sh.m4     Tue Nov  5 02:09:14 2002
+++ fix/m4sh.m4 Tue Dec 17 01:34:51 2002
@@ -686,10 +686,13 @@ $as_ln_s $1 $2
 # -------------------
 m4_defun([_AS_MKDIR_P_PREPARE],
 [if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p'
+elif mkdirs . 2>/dev/null; then
+  as_mkdir_p='mkdirs'
 else
-  as_mkdir_p=false
+  as_mkdir_p=''
 fi
+test -r ./-p && rm -rf ./-p
 ])# _AS_MKDIR_P_PREPARE

 # AS_MKDIR_P(PATH)
@@ -697,8 +700,8 @@ fi
 # Emulate `mkdir -p' with plain `mkdir'.
 m4_define([AS_MKDIR_P],
 [AS_REQUIRE([_$0_PREPARE])dnl
-{ if $as_mkdir_p; then
-    mkdir -p $1
+{ if test -n "$as_mkdir_p"; then
+    $as_mkdir_p $1
   else
     as_dir=$1
     as_dirs=





reply via email to

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