autoconf
[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: Fri, 26 Sep 2003 04:11:20 -0400

Hello,

I sent this bug report and patch almost a year ago but never received a  
response, nor has the problem been fixed, so I thought I would try again.

The following patch is for release 2.75d 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     Thu Aug 21 11:18:22 2003
+++ m4sh.m4-fixed       Fri Sep 26 03:50:17 2003
@@ -688,10 +688,13 @@
 # -------------------
 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)
@@ -699,8 +702,8 @@
 # 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]