[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Patch for supporting VPATH builds

From: Mo DeJong <mdejong_at_cygnus.com>
Date: 2001-01-26 08:26:01 CET

On Wed, 24 Jan 2001, Kevin Pilch-Bisson wrote:

> On Wed, Jan 24, 2001 at 02:56:38AM +0100, Branko =C8ibej wrote:
> > Kevin Pilch-Bisson wrote:
> >=20
> > > +dnl $MKDIR is required for configuring apr and neon in a vpath build
> > > +MKDIR=3Dmkdir
> > > +
> >=20
> > Are you sure this is right? APR uses mkdir.sh from apr/helpers. I think=
> =20
> > we should do the same.
> We could, I was just looking at the GNU Makefile conventions, and it
> said mkdir was one of the utilities we could expect all platforms to
> have, thus we could use it directly. However, automake generates some
> stuff which relies on $MKDIR, so I just set it to mkdir.

I sent a patch to the apr dev list long ago to fix this problem,
but it seems they never added it to the CVS. The real fix is to
create a MKDIR macro that does the same thing as the mkdir shell
script.

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,[
 

Mo DeJong
Red Hat Inc
Received on Sat Oct 21 14:36:20 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.