Hello,

When I submitted the patch to revive the NeXT ports of Ruby a couple 
months ago, one of the problems which the patch corrected was a bug in 
Autoconf where the configure script leaves a bogus directory named '-p' 
sitting at the top of the project tree on platforms for which 'mkdir' 
does not recognize the '-p' option.  Unfortunately, this fix was never 
committed. I was wondering if there was a reason for the omission or if 
was merely an accidental oversight.

The following m4 code, which corrects the problem, can be handled in one 
of two ways.  The code can either be placed in a new aclocal.m4 file in 
the project, or it can be inserted at the very top of configure.in 
_before_ the call to AC_INIT().

Eric

#---------------------------------------------------------------------
# Replacement for AS_MKDIR_P() from m4sugar/m4sh.m4 which fixes two
# issues which are present in Autoconf 2.57 and probably all earlier
# 2.5x versions.  This bug, along with a patch, was submitted to the
# Autoconf GNATS database by Eric Sunshine <sunshine / sunshineco.com>
# as #227 on 17-Dec-2002.  The bogus "-p" directory bug was fixed for
# Autoconf 2.58 on 26-Sep-2003.  The "mkdirs" optimization was deemed
# an unnecessary optimization.
#
# 1) Removes bogus "-p" directory which the stock AS_MKDIR_P() leaves
#    laying around in the working directory if the mkdir command does
#    not recognize the -p option.
# 2) Takes advantage of the older "mkdirs" program if it exists and if
#    "mkdir -p" does not work.
#---------------------------------------------------------------------
m4_defun([_AS_MKDIR_P_PREPARE],
[if mkdir -p . 2>/dev/null; then
   as_mkdir_p='mkdir -p'
elif mkdirs . 2>/dev/null; then
   as_mkdir_p='mkdirs'
else
   as_mkdir_p=''
fi
test -d ./-p && rmdir ./-p
])# _AS_MKDIR_P_PREPARE

m4_define([AS_MKDIR_P],
[AS_REQUIRE([_$0_PREPARE])dnl
{ if test -n "$as_mkdir_p"; then
     $as_mkdir_p $1
   else
     as_dir=$1
     as_dirs=
     while test ! -d "$as_dir"; do
       as_dirs="$as_dir $as_dirs"
       as_dir=`AS_DIRNAME("$as_dir")`
     done
     test ! -n "$as_dirs" || mkdir $as_dirs
   fi || AS_ERROR([cannot create directory $1]); }
])# AS_MKDIR_P