httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@devsys.jaguNET.com>
Subject PATCH: Allow for greater depth in modules directory
Date Wed, 23 Jun 1999 22:29:30 GMT
Right now, modules added using AddModule must exist exactly one layer
under ./modules. This restriction results in a jumbled directory.
This patch removes this restriction.

This is for 1.3.7-dev. The patch is being applied to the -2.0
tree already. Note that it is subsequently easy after this to make
the minor changes that modules can be located ANYWHERE, even
outside of the Apache tree. This was recently suggested as
a "desirable" option :)

--- Configure.orig	Wed Jun 23 10:32:39 1999
+++ Configure	Wed Jun 23 17:59:35 1999
@@ -1479,10 +1479,12 @@
 	    }
     	}
 	(($1 == "AddModule" || $1 == "SharedModule") && $2 ~ /^modules\//) { 
-	    split ($2, pp, "/")
-	    if (! SEEN[pp[2]]) {
-		printf "%s ", pp[2]
-		SEEN[pp[2]] = 1
+	    count = split ($2, pp, "/")
+	    dir = pp[2]
+	    for (i = 3; i < count; i++) dir = dir "/" pp[i] 
+	    if (! SEEN[dir]) {
+		printf "%s ", dir
+		SEEN[dir] = 1
 	    } 
     	}'`
 MODDIRS_NO_SO=`awk < $tmpfile '
@@ -1494,10 +1496,12 @@
 	    }
     	}
 	(($1 == "AddModule") && $2 ~ /^modules\//) { 
-	    split ($2, pp, "/")
-	    if (! SEEN[pp[2]]) {
-		printf "%s ", pp[2]
-		SEEN[pp[2]] = 1
+	    count = split ($2, pp, "/")
+	    dir = pp[2]
+	    for (i = 3; i < count; i++) dir = dir "/" pp[i] 
+	    if (! SEEN[dir]) {
+		printf "%s ", dir
+		SEEN[dir] = 1
 	    } 
     	}'`
 
@@ -1753,9 +1757,10 @@
 done
 for moddir in $MODDIRS_NO_SO
 do
-	if [ -f modules/$moddir/Makefile.tmpl ] ; then
-		AUTOLIBS="$AUTOLIBS modules/$moddir/lib$moddir.a"
-	fi
+        if [ -f modules/$moddir/Makefile.tmpl ] ; then
+		autolibn=`echo $moddir | sed 's@.*/@@'`
+		AUTOLIBS="$AUTOLIBS modules/$moddir/lib$autolibn.a"
+        fi
 done
 
 ####################################################################
@@ -1776,8 +1781,9 @@
     END {
 	print "MODULES= \\"
 	for (i = 0; i < n; ++i) {
-	    split (modules[i], pp, "/")
-	    dir = pp[1] "/" pp[2] 
+	    count = split (modules[i], pp, "/")
+	    dir = pp[1]
+	    for (j = 2; j < count; j++) dir = dir "/" pp[j] 
 	    inthere = 0
 	    for ( tdir in autodirs ) {
 		if (tdir == dir) 
@@ -2135,11 +2141,11 @@
 INCDIR=$(SRCDIR)/include
 EOF
 	if [ -f $moddir/Makefile.libdir ]; then
-	    basedir=`echo $moddir | sed 's@^[^/]*/@@g'`
+	    basedir=`echo $moddir | sed 's@^[^/]*/@@g' | sed 's@/@\\\\/@g'`
 	    awk >> $moddir/Makefile < $tmpfile '
 		($2 ~ /^modules\/'$basedir'\//) {
-		    split($2, pp, "/");
-		    split(pp[3], parts, ".");
+		    count = split($2, pp, "/");
+		    split(pp[count], parts, ".");
 		    libext=parts[2];
 		}
 		END { 
@@ -2147,11 +2153,11 @@
 		}'
 	    # it's responsible for the rest of its Makefile...
 	else
-	    basedir=`echo $moddir | sed 's@^[^/]*/@@g'`
+	    basedir=`echo $moddir | sed 's@^[^/]*/@@g' | sed 's@/@\\\\/@g'`
 	    OBJS=`awk < $tmpfile '
 		($1 == "Module" && $3 ~ /^modules\/'$basedir'\//) { 
-		    split ($3, pp, "/")
-		    printf "%s ", pp[3] 
+		    count = split ($3, pp, "/")
+		    printf "%s ", pp[count] 
 		} 
 		'`
 	    echo "OBJS=$OBJS" >> $moddir/Makefile
@@ -2163,10 +2169,10 @@
 	    fi
 	    awk >> $moddir/Makefile < $tmpfile '
 	    ($1 == "SharedModule" && $2 ~ /^modules\/'$basedir'\//) {
-		split($2, pp, "/")
-		shlibs=shlibs " " pp[3]
-		so=pp[3]
-		split(pp[3], parts, ".")
+		count = split($2, pp, "/")
+		shlibs=shlibs " " pp[count]
+		so=pp[count]
+		split(pp[count], parts, ".")
 		base=parts[1]
 		objspic=objspic " " base ".lo"
 	    }
-- 
===========================================================================
   Jim Jagielski   |||   jim@jaguNET.com   |||   http://www.jaguNET.com/
            "That's no ordinary rabbit... that's the most foul,
            cruel and bad-tempered rodent you ever laid eyes on"

Mime
View raw message