apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mo DeJong <mdej...@cygnus.com>
Subject APR_MKDIR() attempt #2
Date Sat, 06 Jan 2001 20:14:28 GMT
I sent this patch in some time ago, but
I did not hear anything back so I though
I would post it again. This patch fixes
the build in the case where apr is
compiled in a build dir that is not
the src dir. This only matters when
another module uses the RUN_SUBDIR_CONFIG_NOW()
macro.

Mo DeJong
Red Hat Inc


Index: aclocal.m4
===================================================================
RCS file: /home/cvspublic/apr/aclocal.m4,v
retrieving revision 1.38
diff -u -r1.38 aclocal.m4
--- aclocal.m4	2000/12/20 16:20:05	1.38
+++ aclocal.m4	2001/01/06 20:10:01
@@ -331,7 +331,7 @@
 AC_DEFUN(APR_PREPARE_MM_DIR,[
 dnl #----------------------------- Prepare mm directory for VPATH support
 if test -n "$USE_MM" && test -n "$USE_VPATH"; then
-  test -d $mm_dir || $MKDIR $mm_dir
+  test -d $mm_dir || APR_MKDIR($mm_dir)
 
   for i in shtool config.guess config.sub fbtool ltconfig \
            ltmain.sh mm_vers.c; do
Index: apr_common.m4
===================================================================
RCS file: /home/cvspublic/apr/apr_common.m4,v
retrieving revision 1.9
diff -u -r1.9 apr_common.m4
--- apr_common.m4	2000/11/29 23:11:21	1.9
+++ apr_common.m4	2001/01/06 20:10:01
@@ -1,4 +1,39 @@
 dnl
+dnl APR_MKDIR(dir)
+dnl
+dnl This macro works like `mkdir -p $dir' on systems that do not
+dnl support the -p flag to mkdir
+dnl
+dnl Based on `mkinstalldirs' from Noah Friedman <friedman@prep.ai.mit.edu>
+dnl as of 1994-03-25, which was placed in the Public Domain.
+dnl Cleaned up for Apache's Autoconf-style Interface (APACI)
+dnl by Ralf S. Engelschall <rse@apache.org>
+
+AC_DEFUN(APR_MKDIR, [
+  umask_saved=`umask`
+  umask 022
+
+  dir=$1
+  dirlist=`echo ":$dir" |\
+               sed -e 's/^:\//%/' -e 's/^://' -e 's/\// /g' -e 's/^%/\//'`
+
+  pathcomp=
+  for d in $dirlist; do
+    pathcomp="$pathcomp$d"
+    case "$pathcomp" in
+      -* ) pathcomp=./$pathcomp ;;
+    esac
+    if test ! -d "$pathcomp"; then
+      #echo "mkdir $pathcomp" 1>&2
+      mkdir "$pathcomp"
+    fi
+    pathcomp="$pathcomp/"
+  done
+  echo "mkdir -p $1"
+  umask $umask_saved > /dev/null
+])
+
+dnl
 dnl RUN_SUBDIR_CONFIG_NOW(dir [, sub-package-cmdline-args])
 dnl
 AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [
@@ -9,7 +44,7 @@
   ac_popdir=`pwd`
   ac_abs_srcdir=`(cd $srcdir/$1 && pwd)`
   apr_config_subdirs="$1"
-  test -d $1 || $srcdir/helpers/mkdir.sh $1
+  test -d $1 || APR_MKDIR($1)
   cd $1
 
 changequote(, )dnl
Index: configure.in
===================================================================
RCS file: /home/cvspublic/apr/configure.in,v
retrieving revision 1.205
diff -u -r1.205 configure.in
--- configure.in	2001/01/05 22:33:08	1.205
+++ configure.in	2001/01/06 20:10:02
@@ -26,7 +26,6 @@
 dnl XXX This assumes that APR "lives" under Apache.
 dnl XXX We'll need to fix this when we pull it out.
 abs_helpersdir=$abs_srcdir/helpers
-MKDIR=$abs_helpersdir/mkdir.sh
 
 if test "$abs_builddir" != "$abs_srcdir"; then
   USE_VPATH=1
@@ -866,7 +865,7 @@
 SUBDIRS="lib strings passwd tables "
 for dir in $MODULES
 do
-    test -d $dir || $MKDIR $dir
+    test -d $dir || APR_MKDIR($dir)
     if test -f $srcdir/$dir/$OSDIR/Makefile.in; then
         MAKEFILE2="$MAKEFILE2 $dir/$OSDIR/Makefile "
         SUBDIRS="$SUBDIRS $dir/$OSDIR "
@@ -891,7 +890,7 @@
 done
 
 dir=include/arch/unix
-test -d $dir || $MKDIR $dir
+test -d $dir || APR_MKDIR($dir)
 
 AC_OUTPUT($MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h APRVARS,[
 


Mime
View raw message