httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <p...@ukweb.com>
Subject New configure
Date Wed, 02 Jul 1997 22:05:02 GMT
Here is a first draft of a new configure script which makes the changes
previous discussed (moving core source files to a subdirectory, moving
modules files, adding os abstraction files, auto-configuring modules).

Apart from the moved source files and less cluttered /src directoory, the
only important user-visible change is a new directive in Configuration.
Lines such as 

  Module    auth_module    mod_auth.o

can be replaced with AddModule directives, like this

  AddModule                modules/standard/mod_auth.o

This removes the need to duplicate the structure name ("auth_module") in
Configuration - the new Configure will try and find this out for itself. 
It can get this from a separate file (mod_auth.module) or by reading the
.c source if available. If all else fails, it converts mod_SOMETHING.o
into SOMETHING_module (this works on all distributed modules). Also
handles modules specified as (say) modules/proxy/libproxy.a. 

The module file (.module) or the .c can include shell script commands
which get executed as part of the configure process. For example, the
following would be added to mod_auth_dbm.c to auto-configure in a DBM
library:

  ConfigStart
    LIBS="$LIBS $DBM_LIB"
  ConfigEnd

Modules specified by AddModule can exist anywhere on the file system, but
if they live in modules/SOMETHING, a suitable makefile will be
auto-generated if Makefile.tmpl exists in that directory.

Ok, here are the instructions for converting a standard Apache src
directory into something that works with this new Configure. The patch
files and new files mentioned are listed after the instructions.
Because of the number of new and moved files and directories I cannot
supply a simple patch.

//pcs

-----------

# update Configure and Configuration.tmpl
cd src
cp Configuration.tmpl Configuration
patch < Configure.patch
patch < Configuration.patch
patch < src.patch

# create os-abstraction files (empty for now) and new Makefile.tmpl
mkdir os
mkdir os/unix
touch os/unix/os.h
touch os/unix/os.c
# add os/unix/Makefile.tmpl

# move /support into /src/support, update the Makefile.tmpl
mkdir support
cp ../support/* support
cd support
patch < support.patch

# move modules into modules/standard, add new Makefile.tmpl
mkdir modules/standard
mv mod_*.[ch] modules/standard
# add modules/standard/Makefile.tmpl

# move all other source files in core, add new Makefile.tmpl
mkdir core
mv *.[ch] core
# add core/Makefile.tmpl

That's it! Now you can run ./Configure, the make as normal (hopefully). 

-----

Configure.patch:

--- old/Configure	Wed Jul  2 21:02:14 1997
+++ Configure	Wed Jul  2 22:37:45 1997
@@ -16,6 +16,8 @@
 
 file=Configuration
 tmpfile=htconf.$$
+tmpfile2=$tmpfile.2
+tmpfile3=$tmpfile.3
 makefile_tmpl=Makefile.tmpl
 
 while [ "x$1" != "x" ]; do
@@ -57,6 +59,7 @@
 # Check for syntax errors...
 
 if egrep -v '^%?Module[ 	]+[A-Za-z0-9_]+[ 	]+[^ 	]+$' $tmpfile \
+   | egrep -v '^%?AddModule[ 	]+[^ 	]+$' \
    | grep -v = > /dev/null
 then
    echo "Syntax error --- The configuration file is used only to"
@@ -72,35 +75,6 @@
 if [ -f Makefile ] ; then mv Makefile Makefile.bak; fi
 if [ -f modules.c ] ; then mv modules.c modules.c.bak; fi
 
-sed -e 's/_module//' $tmpfile | awk >modules.c '\
-   BEGIN { modules[n++] = "core" ; pmodules[pn++] = "core"} \
-   /^Module/ { modules[n++] = $2 ; pmodules[pn++] = $2 } \
-   /^%Module/ { pmodules[pn++] = $2 } \
-   END { print "/* modules.c --- automatically generated by Apache"; \
-	 print " * configuration script.  DO NOT HAND EDIT!!!!!"; \
-	 print " */"; \
-	 print ""; \
-	 print "#include \"httpd.h\""; \
-	 print "#include \"http_config.h\""; \
-	 print ""; \
-	 for (i = 0; i < pn; ++i) { \
-	     printf ("extern module %s_module;\n", pmodules[i]); \
-	 } \
-	 print ""; \
-	 print "module *prelinked_modules[] = {"; \
-	 for (i = 0; i < n; ++i) { \
-	     printf "  &%s_module,\n", modules[i]; \
-	 } \
-	 print "  NULL"; \
-	 print "};"; \
-	 print "module *preloaded_modules[] = {"; \
-	 for (i = 0; i < pn; ++i) { \
-	     printf "  &%s_module,\n", pmodules[i]; \
-	 } \
-	 print "  NULL"; \
-	 print "};"; \
-   }'
-
 #
 # Add module set only
 #
@@ -111,16 +85,6 @@
 echo "# is re-run" >> Makefile
 echo "#" >> Makefile
 
-awk >>Makefile <$tmpfile '\
-   /^Module/ { modules[n++] = $3 } \
-   /^%Module/ { modules[n++] = $3 } \
-   END { print "MODULES=\\"; \
-	 for (i = 0; i < n; ++i) { \
-	     if (i < n-1) printf ("  %s \\\n", modules[i]); \
-	     else printf ("  %s\n", modules[i]); \
-	 } \
-	 print "" \
-       }'
 #
 # Now add Makefile additions and Rules
 #
@@ -158,7 +122,7 @@
 
 # Preset DBM_LIB. Can be overridden on a per-platform basis.
 
-DBM_LIB="-ldbm"
+DBM_LIB="-lgdbm"
 
 #
 # Look for ranlib. Do it early in case we want to override it below
@@ -185,6 +149,7 @@
 
 #
 SHELL="/bin/sh"
+OSDIR="os/unix"
 
 case "$PLAT" in
     *MPE/iX*)
@@ -522,6 +487,7 @@
 # Now that _that's_ done, get on with it
 #
 
+SRCDIR=`pwd`
 echo " + configured for $OS platform"
 
 #
@@ -561,29 +527,173 @@
 fi
 
 #
-# Are they using the status monitor module? If so, check
-# for STATUS rule...
+# Find out what modules we want and try and configure things for them
+# Module lines can look like this:
 #
-STAT_MOD="mod_status"
-if grep "$STAT_MOD" Makefile > /dev/null; then
-    if [ "$RULE_STATUS" = "yes" ]; then
-	CFLAGS="$CFLAGS -DSTATUS"
-    fi
-fi
-
-#
-# Are they using dbm auth? If so, add DBM library.
+#  Module  name_module    some/path/mod_name[.[oa]]
+#  AddModule              some/path/mod_name[.[oa]]
 #
-if grep mod_auth_dbm Makefile > /dev/null; then
-    LIBS="$LIBS $DBM_LIB"
-fi
+# In both cases, the some/path can either be an arbitrary path (including
+# an absolue path), or a path like "modules/DIR", in which case we _might_
+# auto-generate a Makefile in modules/DIR (see later).
+#
+# The first case is the original style, where we give the module's
+# name as well as it's binary file location - either a .o or .a.
+#
+# The second format is new, and means we do not repeat the module
+# name, which is already part of the module source or definition.
+# The way we find the module name (and other optional information about
+# the module) is like this:
+#
+#  1 If extension is not given or is .c, assume .o was given and goto 3
+#  2 If extension if .module, go to D1
+#  3 If extension is .o, look for a corresponding .c file and if
+#      found, go to C1
+#  4 If no .c file was found, look for a .module file (Apache module
+#      definition file). If found, go to D1
+#  5 Assume module name is the "name" part of "mod_name", as in
+#      name_module.
+#
+# If a C file is found:
+#
+# C1 Look for module name given by an MODULE: line (e.g. MODULE: name_module)
+#      If found assume module contains a definition, and go to D1
+# C2 If not found, look for a module name given on the declaration of the
+#      module structure (e.g. module name_module).
+# C3 If neither given, go to 4 above.
+#
+# If a definition file is found, or a .c file includes a module definition:
+#
+# D1 Get the module name from the MODULE: name= line
+# D2 Get other module options (libraries etc). To be done later.
+#
+
+# For now, we will convert the AddModule lines into Module format
+# lines, so the rest of Configure can do its stuff without too much
+# additional hackery. It would be nice to reduce the number of times
+# we have to awk the $tmpfile, though.
+
+# MODFILES contains a list of module filenames (could be .c, .o, .a
+#    or .module files) from AddModule lines only
+# MODDIRS contains a list of subdirectories under 'modules' which
+#    contain modules we want to build from both AddModule and Module
+#    lines
+
+MODFILES=`awk <$tmpfile '$1 == "AddModule" { printf "%s ", $2 }'`
+MODDIRS=`awk < $tmpfile '\
+	($1 == "Module" && $3 ~ /^modules\//) { \
+	    split ($3, pp, "/"); \
+	if (! SEEN[pp[2]]) { printf "%s ", pp[2]; SEEN[pp[2]] = 1; } \
+    	} \
+	($1 == "AddModule" && $2 ~ /^modules\//) { \
+	    split ($2, pp, "/"); \
+	if (! SEEN[pp[2]]) { printf "%s ", pp[2]; SEEN[pp[2]] = 1; } \
+    	} \
+'`
+
+#
+# Now autoconfigure each of the modules specified by AddModule.
+# Use tmpfile2 for the module definition file, and tmpfile3 for the
+# shell commands to be executed for this module.
+#
+
+for modfile in $MODFILES ; do
+#	echo Trying to find $modfile
+	rm -f $tmpfile2 $tmpfile3
+	modname=
+
+	ext=`echo $modfile | sed 's/^.*\.//'`
+	modbase=`echo $modfile | sed 's/\.[^.]*$//'`
+	if [ x$ext = x$modfile ]; then ext=o; modbase=$modfile; modfile=$modbase.o; fi
+	if [ x$ext = x ] ; then ext=o; modbase=$modfile; fi
+
+	# modbase is the path+filename without extension, ext is the
+	# extension given, or if none, o
+#	echo bas=$modbase ext=$ext
+
+	if [ -r $modbase.module ] ; then
+		cat $modbase.module > $tmpfile2
+	elif [ -e $modbase.c ] ; then
+		# Guess module structure name in case there is not
+		# module definition in this file
+		modname=`grep '^module .*;' $modbase.c | head -1 |\
+			sed 's/^module[ 	]*//' | \
+			sed 's/[ 	]*;[ 	]*$//'`
+		# Get any module definition part
+		if fgrep "MODULE-DEFINITION-" $modbase.c > /dev/null; then
+		cat $modbase.c | \
+		sed '1,/MODULE-DEFINITION-START/d;/MODULE-DEFINITION-END/,$d' \
+			> $tmpfile2
+		fi
+	fi		
+	if [ -r $tmpfile2 ] ; then
+		# Read a module definition from .module or .c
+		modname=`fgrep "Name:" $tmpfile2 | sed 's/^.*Name:[ 	]*//'`
+		cat $tmpfile2 | sed '1,/ConfigStart/d;/ConfigEnd/,$d' > \
+			$tmpfile3
+		. $tmpfile3
+		rm -f $tmpfile2 $tmpfile3
+		ext=o
+	fi
+	if [ -z "$modname" ] ; then
+		modname=`echo $modbase | sed 's/^.*\///' | \
+			sed 's/^mod_//' | sed 's/^lib//' | sed 's/$/_module/'`
+	fi
+	echo "Adding Module $modname $modbase.$ext"
+#	echo "Module $modname $modbase.$ext" >>$tmpfile
+done
+
+# $tmpfile now contains Module lines for all the modules we want
+
+# create modules.c
+
+sed -e 's/_module//' $tmpfile | awk >modules.c '\
+   BEGIN { modules[n++] = "core" ; pmodules[pn++] = "core"} \
+   /^Module/ { modules[n++] = $2 ; pmodules[pn++] = $2 } \
+   /^%Module/ { pmodules[pn++] = $2 } \
+   END { print "/* modules.c --- automatically generated by Apache"; \
+	 print " * configuration script.  DO NOT HAND EDIT!!!!!"; \
+	 print " */"; \
+	 print ""; \
+	 print "#include \"httpd.h\""; \
+	 print "#include \"http_config.h\""; \
+	 print ""; \
+	 for (i = 0; i < pn; ++i) { \
+	     printf ("extern module %s_module;\n", pmodules[i]); \
+	 } \
+	 print ""; \
+	 print "module *prelinked_modules[] = {"; \
+	 for (i = 0; i < n; ++i) { \
+	     printf "  &%s_module,\n", modules[i]; \
+	 } \
+	 print "  NULL"; \
+	 print "};"; \
+	 print "module *preloaded_modules[] = {"; \
+	 for (i = 0; i < pn; ++i) { \
+	     printf "  &%s_module,\n", pmodules[i]; \
+	 } \
+	 print "  NULL"; \
+	 print "};"; \
+   }'
 
+# Add the module targets to the Makefile
+
+awk >>Makefile <$tmpfile '\
+   /^Module/ { modules[n++] = $3 } \
+   /^%Module/ { modules[n++] = $3 } \
+   END { print "MODULES=\\"; \
+	 for (i = 0; i < n; ++i) { \
+	     if (i < n-1) printf ("  %s \\\n", modules[i]); \
+	     else printf ("  %s\n", modules[i]); \
+	 } \
+	 print "" \
+       }'
 #
 # Now HS's POSIX regex implementation if needed/wanted
 #
 if [ "$RULE_WANTHSREGEX" = "yes" ]; then
     REGLIB="regex/libregex.a"
-    INCLUDES="$INCLUDES -Iregex"
+    INCLUDES="$INCLUDES -I${SRCDIR}/regex"
 fi
 
 #
@@ -616,23 +726,32 @@
     echo "OPTIM=$OPTIM" >> Makefile.config
 fi
 echo "CFLAGS1=$CFLAGS">> Makefile.config
-echo "INCLUDES1=$INCLUDES">> Makefile.config
+echo "INCLUDES1=$INCLUDES -I${SRCDIR}/core">> Makefile.config
 echo "LIBS1=$LIBS">> Makefile.config
 echo "LDFLAGS1=$LDFLAGS">> Makefile.config
 echo "BROKEN_BPRINTF_FLAGS=$OSBPRINTF">> Makefile.config
 echo "REGLIB=$REGLIB">> Makefile.config
 echo "RANLIB=$RANLIB">> Makefile.config
 echo "SHELL=$SHELL">> Makefile.config
+echo "OSOBJ=${SRCDIR}/$OSDIR/os.o">> Makefile.config
+echo "OSDIR=${SRCDIR}/$OSDIR">> Makefile.config
 echo >> Makefile.config
 echo "#### End of Configure created section ####">> Makefile.config
 
+cp $OSDIR/os.h core/os.h
 
 # Now (finish) creating the makefiles
 cat Makefile.config >> Makefile
 sed -e "s#@@Configuration@@#$file#" "$makefile_tmpl" >>Makefile
 awk >>Makefile <$tmpfile \
    '($1 == "Module" && $3 ~ /modules\//) { printf "%s: modules/last-built ; @cat
/dev/null\n\n", $3, $3}'
-cat Makefile.config ../support/Makefile.tmpl > ../support/Makefile
+
+# directories to create makefiles in
+MAKEDIRS="support core $OSDIR"
+for dir in $MAKEDIRS ; do
+	echo Creating Makefile in $dir
+	cat Makefile.config $dir/Makefile.tmpl > $dir/Makefile
+done
 
 cat << EOF > modules/Makefile
 # 
@@ -651,17 +770,14 @@
 echo "INCLUDES2=$INCLUDES2">> modules/Makefile
 echo "MOD_CFLAGS=\$(INCLUDES2) \$(AUX_CFLAGS)">> modules/Makefile
 
-awk >> modules/Makefile < $tmpfile '\
-   BEGIN {printf "MODULES="} \
-   ($1 == "Module" && $3 ~ /modules\//) {split ($3, pp, "/"); printf "%s ", pp[2]}
\
-   END {printf "\n"}'
-
-awk >> modules/Makefile < $tmpfile '\
-   BEGIN {printf "CLEANERS="} \
-   ($1 == "Module" && $3 ~ /modules\//) {split ($3, pp, "/"); printf "%s_clean ",
pp[2]} \
-   END {printf "\n"}'
+CLEANERS=""
+for i in $MODDIRS ; do
+	CLEANERS="$CLEANERS${i}_clean "
+done
 
 cat << EOF >> modules/Makefile
+MODULES=$MODDIRS
+CLEANERS=$CLEANERS
 
 default: \$(MODULES)
 	@echo "Done building module subdirectories"
@@ -669,14 +785,54 @@
 clean: \$(CLEANERS)
 	@echo "Done cleaning module subdirectories"
 
-placeholder \$(MODULES): ForceMe
+\$(MODULES): ForceMe
 	(cd \$@; \$(MAKE) CC=\$(CC) AUX_CFLAGS='\$(MOD_CFLAGS)' RANLIB='\$(RANLIB)')
 
 ForceMe:
 
 EOF
 
-awk >>modules/Makefile <$tmpfile \
-   '($1 == "Module" && $3 ~ /modules\//) { split ($3, pp, "/"); \
-   printf "%s_clean:\n\t(cd %s; $(MAKE) clean)\n\n", pp[2], pp[2]}'
+(
+for i in $MODDIRS ; do
+	echo "${i}_clean:"
+	echo "	(cd ${i}; \$(MAKE) clean)"
+	echo ""
+done
+) >> modules/Makefile
+
+for moddir in $MODDIRS ; do
+	if [ ! -e modules/$moddir/Makefile.tmpl ] ; then
+		continue
+	fi
+	echo "Creating Makefile in modules/$moddir"
+
+	cat Makefile.config > modules/$moddir/Makefile
+	awk >> modules/$moddir/Makefile < $tmpfile '\
+	    BEGIN { printf "OBJS=" }\
+	    ($1 == "Module" && $3 ~ /^modules\/'$moddir'\//) { \
+		split ($3, pp, "/"); \
+		printf "%s ", pp[3]; \
+	    	} \
+	   END {printf "\n"}'
+
+	cat << 'EOF' >> modules/$moddir/Makefile
+CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
+LIBS=$(EXTRA_LIBS) $(LIBS1)
+INCLUDES=$(INCLUDES1) $(EXTRA_INCLUDES)
+LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)
+INCDIR=../../core
+
+all:	$(OBJS)
+
+.c.o:
+	$(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $<
+
+clean:
+	rm -f $(OBJS)
+
+EOF
+cat >> modules/$moddir/Makefile < modules/$moddir/Makefile.tmpl
+
+done
+
 

------------------------------------------

Configuration.patch:

--- old/Configuration	Wed Jul  2 21:02:08 1997
+++ Configuration	Wed Jul  2 22:36:44 1997
@@ -42,7 +42,7 @@
 # the C compiler, and set OPTIM to '-O2'
 #
 EXTRA_CFLAGS=
-EXTRA_LDFLAGS=
+EXTRA_LFLAGS=
 EXTRA_LIBS=
 EXTRA_INCLUDES=
 
@@ -125,24 +125,24 @@
 ## passed to CGI/SSI scripts.  It is listed first (lowest priority) since
 ## it does not do per-request stuff.
 
-Module env_module          mod_env.o
+AddModule                 modules/standard/mod_env.o
 
 ## mod_dld defines commands that allow other modules to be loaded
 ## dynamically (at runtime).  This module is for experimental use only.
 
-# Module dld_module          mod_dld.o
+# AddModule                 modules/optional/mod_dld.o
 
 ##
 ## Request logging modules
 ##
 
-Module config_log_module   mod_log_config.o
+AddModule                 modules/standard/mod_log_config.o
 
 ## Optional modules for NCSA user-agent/referer logging compatibility
 ## We recommend, however, that you just use the configurable access_log.
 
-# Module agent_log_module    mod_log_agent.o
-# Module referer_log_module  mod_log_referer.o
+# AddModule                 modules/optional/mod_log_agent.o
+# AddModule                 modules/optional/mod_log_referer.o
 
 ##
 ## Type checking modules
@@ -151,8 +151,8 @@
 ## magic type handlers (the latter is obsoleted by mod_actions).
 ## mod_negotiation allows content selection based on the Accept* headers.
 
-Module mime_module         mod_mime.o
-Module negotiation_module  mod_negotiation.o
+AddModule                 modules/standard/mod_mime.o
+AddModule                 modules/standard/mod_negotiation.o
 
 ##
 ## Content delivery modules
@@ -162,20 +162,20 @@
 ## STATUS=yes (see the Rules section near the start of this file) to allow
 ## full status information.  Check conf/access.conf on how to enable this.
 
-# Module status_module       mod_status.o
+# AddModule                 modules/optional/mod_status.o
 
 ## The Info module displays configuration information for the server and 
 ## all included modules. It's very useful for debugging.
 
-# Module info_module         mod_info.o
+# AddModule                 modules/optional/mod_info.o
 
 ## mod_include translates server-side include (SSI) statements in text files.
 ## mod_dir handles requests on directories and directory indexes.
 ## mod_cgi handles CGI scripts.
 
-Module includes_module     mod_include.o
-Module dir_module          mod_dir.o
-Module cgi_module          mod_cgi.o
+AddModule                 modules/standard/mod_include.o
+AddModule                 modules/standard/mod_dir.o
+AddModule                 modules/standard/mod_cgi.o
 
 ## The asis module implemented ".asis" file types, which allow the embedding
 ## of HTTP headers at the beginning of the document.  mod_imap handles internal 
@@ -183,9 +183,9 @@
 ## CGI scripts which act as "handlers" for particular files, for example to
 ## automatically convert every GIF to another file type.
 
-Module asis_module         mod_asis.o
-Module imap_module         mod_imap.o
-Module action_module       mod_actions.o
+AddModule                 modules/standard/mod_asis.o
+AddModule                 modules/standard/mod_imap.o
+AddModule                 modules/standard/mod_actions.o
 
 ##
 ## URL translation modules.
@@ -193,42 +193,42 @@
 ## The UserDir module for selecting resource directories by user name
 ## and a common prefix, e.g., /~<user> , /usr/web/<user> , etc.
 
-Module userdir_module      mod_userdir.o
+AddModule                 modules/standard/mod_userdir.o
 
 ## The proxy module enables the server to act as a proxy for outside
 ## http and ftp services. It's not as complete as it could be yet.
 ## NOTE: You do not want this module UNLESS you are running a proxy;
 ##       it is not needed for normal (origin server) operation.
 
-# Module proxy_module        modules/proxy/libproxy.a
+# AddModule                 modules/proxy/libproxy.a
 
 ## The Alias module provides simple URL translation and redirection.
 
-Module alias_module        mod_alias.o
+AddModule                 modules/standard/mod_alias.o
 
 ## mod_rewrite allows for powerful URI-to-URI and URI-to-filename mapping,
 ## using regular expressions.
 
-# Module rewrite_module      mod_rewrite.o
+# AddModule                 modules/optional/mod_rewrite.o
 
 ##
 ## Access control and authentication modules. 
 ##
-Module access_module       mod_access.o
-Module auth_module         mod_auth.o
+AddModule                 modules/standard/mod_access.o
+AddModule                 modules/standard/mod_auth.o
 
 ## The anon_auth module allows for anonymous-FTP-style username/ 
 ## password authentication.
 
-# Module anon_auth_module    mod_auth_anon.o
+# AddModule                 modules/standard/mod_auth_anon.o
 
 ## db_auth and dbm_auth work with Berkeley DB files - make sure there
 ## is support for DBM files on your system.  You may need to grab the GNU
 ## "gdbm" package if not and possibly adjust EXTRA_LIBS. (This may be
 ## done by Configure at a later date)
 
-# Module db_auth_module      mod_auth_db.o
-# Module dbm_auth_module     mod_auth_dbm.o
+# AddModule                 modules/standard/mod_auth_db.o
+# AddModule                 modules/standard/mod_auth_dbm.o
 
 ## msql_auth checks against an mSQL database.  You must have mSQL installed
 ## and an "msql.h" available for this to even compile.  Additionally,
@@ -239,29 +239,29 @@
 ## This depends on your installation of mSQL. (This may be done by Configure
 ## at a later date)
 
-# Module msql_auth_module    mod_auth_msql.o
+# AddModule                 modules/standard/mod_auth_msql.o
 
 ## "digest" implements HTTP Digest Authentication rather than the less 
 ## secure Basic Auth used by the other modules.
 
-# Module digest_module       mod_digest.o
+# AddModule                 modules/optional/mod_digest.o
 
 ## Optional response header manipulation modules. 
 ##
 ## cern_meta mimics the behavior of the CERN web server with regards to 
 ## metainformation files.  
 
-# Module cern_meta_module    mod_cern_meta.o
+# AddModule                 modules/optional/mod_cern_meta.o
 
 ## The expires module can apply Expires: headers to resources,
 ## as a function of access time or modification time.
 
-# Module expires_module      mod_expires.o
+# Module expires_module      modules/optional/mod_expires.o
 
 ## The headers module can set arbitrary HTTP response headers,
 ## as configured in server, vhost, access.conf or .htaccess configs
 
-# Module headers_module      mod_headers.o
+# AddModule                 modules/optional/mod_headers.o
 
 ## Miscellaneous modules
 ##
@@ -273,17 +273,17 @@
 ## You do not need this, or any other module to allow your site
 ## to use Cookies.  This module is for user tracking only
 
-# Module usertrack_module      mod_usertrack.o
+# AddModule                 modules/optional/mod_usertrack.o
 
 ## The example module, which demonstrates the use of the API.  See
 ## the file modules/example/README for details.  This module should
 ## only be used for testing -- DO NOT ENABLE IT on a production server.
 
-# Module example_module      modules/example/mod_example.o
+# AddModule                 modules/example/mod_example.o
 
 ## mod_browser lets you set environment variables based on the User-Agent
 ## string in the request; this is useful for conditional HTML, for example.
 ## Since it is also used to detect buggy browsers for workarounds, it
 ## should be the last (highest priority) module.
 
-Module browser_module      mod_browser.o
+AddModule                  modules/standard/mod_browser

----------------------------

support.patch:

*** support/Makefile.tmpl	Thu Mar 13 12:14:14 1997
--- Makefile.tmpl	Wed Jul  2 22:14:08 1997
***************
*** 6,12 ****
  CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
  LIBS=$(EXTRA_LIBS) $(LIBS1)
  INCLUDES=-I../src -I../src/regex $(INCLUDES1) $(EXTRA_INCLUDES)
! LFLAGS=$(LFLAGS1) $(EXTRA_LFLAGS)
  
  .c.o: 
  	$(CC) -c $(CFLAGS) $(INCLUDES) $<
--- 6,12 ----
  CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
  LIBS=$(EXTRA_LIBS) $(LIBS1)
  INCLUDES=-I../src -I../src/regex $(INCLUDES1) $(EXTRA_INCLUDES)
! LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)
  
  .c.o: 
  	$(CC) -c $(CFLAGS) $(INCLUDES) $<
***************
*** 16,25 ****
  all: $(TARGETS)
  
  htpasswd: htpasswd.c
! 	$(CC) $(CFLAGS) htpasswd.c -o htpasswd $(LIBS)
  
  htdigest: htdigest.c
! 	$(CC) $(CFLAGS) htdigest.c -o htdigest
  
  httpd_monitor: httpd_monitor.c
  	$(CC) $(INCLUDES) $(CFLAGS) httpd_monitor.c -o httpd_monitor
--- 16,25 ----
  all: $(TARGETS)
  
  htpasswd: htpasswd.c
! 	$(CC) $(INCLUDES) $(CFLAGS) htpasswd.c -o htpasswd $(LIBS)
  
  htdigest: htdigest.c
! 	$(CC) $(INCLUDES) $(CFLAGS) htdigest.c -o htdigest
  
  httpd_monitor: httpd_monitor.c
  	$(CC) $(INCLUDES) $(CFLAGS) httpd_monitor.c -o httpd_monitor

--------------------------------

src.patch:

*** /home/paul/remote-cvs/apache/src/Makefile.tmpl	Wed Jul  2 22:31:38 1997
--- Makefile.tmpl	Wed Jul  2 22:13:47 1997
***************
*** 8,22 ****
  INCLUDES=$(INCLUDES1) $(EXTRA_INCLUDES)
  LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)
  
! OBJS= alloc.o http_main.o http_core.o http_config.o http_request.o \
!   http_log.o http_protocol.o rfc1413.o util.o util_script.o modules.o buff.o\
!   md5c.o util_md5.o explain.o http_bprintf.o util_date.o util_snprintf.o\
    $(MODULES)
  
  .c.o:
  	$(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $<
  
! all: @@Configuration@@ httpd
  
  @@Configuration@@: Configuration.tmpl
  	@echo "@@Configuration@@ older than Configuration.tmpl, or doesn't exist."
--- 8,28 ----
  INCLUDES=$(INCLUDES1) $(EXTRA_INCLUDES)
  LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)
  
! OBJS= \
!   core/alloc.o core/http_main.o core/http_core.o \
!   core/http_config.o core/http_request.o core/http_log.o \
!   core/http_protocol.o core/rfc1413.o core/util.o \
!   core/util_script.o core/buff.o core/md5c.o \
!   core/util_md5.o core/explain.o core/http_bprintf.o \
!   core/util_date.o core/util_snprintf.o \
!   modules.o \
!   $(OSOBJ) \
    $(MODULES)
  
  .c.o:
  	$(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $<
  
! all: @@Configuration@@ os-dir core-dir modules/last-built httpd 
  
  @@Configuration@@: Configuration.tmpl
  	@echo "@@Configuration@@ older than Configuration.tmpl, or doesn't exist."
***************
*** 25,32 ****
  	@echo "If not, you will at least have to touch @@Configuration@@."
  	@false
  
! httpd: $(REGLIB) $(OBJS)
! 	$(CC) $(LDFLAGS)  -o httpd $(OBJS) $(REGLIB) $(LIBS)
  
  regex/libregex.a:
  	(cd regex; $(MAKE) lib CC=$(CC) AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)')
--- 31,38 ----
  	@echo "If not, you will at least have to touch @@Configuration@@."
  	@false
  
! httpd: $(REGLIB) modules.o
! 	$(CC) $(LDFLAGS)  -o httpd $(OBJS) $(LIBS) $(REGLIB)
  
  regex/libregex.a:
  	(cd regex; $(MAKE) lib CC=$(CC) AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)')
***************
*** 35,44 ****
  	(cd modules; \
  	$(MAKE) CC=$(CC) AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)')
  
  clean:
! 	rm -f httpd *.o core
  	cd regex; $(MAKE) clean
  	cd modules; $(MAKE) clean
  
  dist.tar: 
  	# Assure a semi-sensible configuration going out...
--- 41,63 ----
  	(cd modules; \
  	$(MAKE) CC=$(CC) AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)')
  
+ support: support-dir
+ 
+ support-dir:
+ 	cd support; $(MAKE)
+ 
+ core-dir:
+ 	cd core; $(MAKE)
+ 
+ os-dir:	
+ 	cd $(OSDIR); $(MAKE)
+ 
  clean:
! 	rm -f httpd $(OBJS) 
! 	cd core; $(MAKE) clean
  	cd regex; $(MAKE) clean
  	cd modules; $(MAKE) clean
+ 	cd support; $(MAKE) clean
  
  dist.tar: 
  	# Assure a semi-sensible configuration going out...
***************
*** 51,163 ****
  http_bprintf.o: http_bprintf.c
  	$(CC) -c $(INCLUDES) $(CFLAGS) $(BROKEN_BPRINTF_FLAGS) http_bprintf.c
  
- # We really don't expect end users to use this rule.  It works only with
- # gcc, and rebuilds Makefile.tmpl.  You have to re-run Configure after
- # using it.
- depend:
- 	sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \
- 	    && $(CC) -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile..new \
- 	    && mv Makefile.tmpl Makefile.tmpl.bak \
- 	    && mv Makefile.new Makefile.tmpl
- 
  #Dependencies
  
  $(OBJS): Makefile
  
! # DO NOT REMOVE
! alloc.o: alloc.c httpd.h conf.h alloc.h buff.h multithread.h
! buff.o: buff.c httpd.h conf.h alloc.h buff.h http_main.h
! explain.o: explain.c explain.h
! http_bprintf.o: http_bprintf.c httpd.h conf.h alloc.h buff.h
! http_config.o: http_config.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_core.h http_log.h http_request.h \
!  http_conf_globals.h explain.h
! http_core.o: http_core.c httpd.h conf.h alloc.h buff.h http_config.h \
!  http_core.h http_protocol.h http_conf_globals.h http_main.h \
!  http_log.h rfc1413.h util_md5.h md5.h scoreboard.h
! http_log.o: http_log.c httpd.h conf.h alloc.h buff.h http_config.h \
!  http_core.h http_log.h
! http_main.o: http_main.c httpd.h conf.h alloc.h buff.h http_main.h \
!  http_log.h http_config.h http_protocol.h http_request.h \
!  http_conf_globals.h http_core.h scoreboard.h multithread.h explain.h
! http_protocol.o: http_protocol.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_core.h http_protocol.h http_main..h http_log.h \
!  util_date.h
! http_request.o: http_request.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_request.h http_core.h http_protocol.h http_log.h \
!  http_main.h scoreboard.h
! md5c.o: md5c.c md5.h
! mod_access.o: mod_access.c httpd.h conf.h alloc.h buff.h http_core.h \
!  http_config.h http_log.h http_request.h
! mod_actions.o: mod_actions.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_request.h http_core.h http_protocol.h http_main.h \
!  http_log.h util_script.h
! mod_alias.o: mod_alias.c httpd.h conf.h alloc.h buff.h http_config.h
! mod_asis.o: mod_asis.c httpd.h conf.h alloc.h buff.h http_config.h \
!  http_protocol.h http_log.h util_script.h http_main.h http_request.h
! mod_auth.o: mod_auth.c httpd.h conf.h alloc.h buff.h http_config.h \
!  http_core.h http_log.h http_protocol.h
! mod_auth_anon.o: mod_auth_anon.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_core.h http_log.h http_protocol.h
! mod_auth_db.o: mod_auth_db.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_core.h http_log.h http_protocol.h
! mod_auth_dbm.o: mod_auth_dbm.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_core.h http_log.h http_protocol.h
! mod_auth_msql.o: mod_auth_msql.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_core.h http_log.h http_protocol.h
! mod_browser.o: mod_browser.c httpd.h conf.h alloc.h buff.h \
!  http_config.h
! mod_cern_meta.o: mod_cern_meta.c httpd.h conf.h alloc.h buff.h \
!  http_config.h util_script.h http_log.h http_request.h
! mod_cgi.o: mod_cgi.c httpd.h conf.h alloc.h buff.h http_config.h \
!  http_request.h http_core.h http_protocol.h http_main.h http_log.h \
!  util_script.h http_conf_globals.h
! mod_digest.o: mod_digest.c httpd.h conf.h alloc.h buff.h http_config.h \
!  http_core.h http_log.h http_protocol.h util_md5.h md5.h
! mod_dir.o: mod_dir.c httpd.h conf.h alloc..h buff.h http_config.h \
!  http_core.h http_request.h http_protocol.h http_log.h http_main.h \
!  util_script.h
! mod_dld.o: mod_dld.c httpd.h conf.h alloc.h buff.h http_config.h \
!  http_conf_globals.h
! mod_env.o: mod_env.c httpd.h conf.h alloc.h buff.h http_config.h
! mod_expires.o: mod_expires.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_log.h
! mod_headers.o: mod_headers.c httpd.h conf.h alloc.h buff.h \
!  http_config.h
! mod_imap.o: mod_imap.c httpd.h conf.h alloc.h buff.h http_config.h \
!  http_request.h http_core.h http_protocol.h http_main.h http_log.h \
!  util_script.h
! mod_include.o: mod_include.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_request.h http_core.h http_protocol.h http_log.h \
!  http_main.h util_script.h
! mod_info.o: mod_info.c httpd.h conf.h alloc.h buff.h http_config.h \
!  http_core.h http_log.h http_main.h http_protocol.h util_script.h \
!  http_conf_globals.h
! mod_log_agent.o: mod_log_agent.c httpd.h conf.h alloc.h buff.h \
!  http_config.h
! mod_log_config.o: mod_log_config.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_core.h
! mod_log_referer.o: mod_log_referer.c httpd.h conf.h alloc.h buff.h \
!  http_config.h
! mod_mime.o: mod_mime.c httpd.h conf.h alloc.h buff.h http_config.h
! mod_negotiation.o: mod_negotiation.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_request.h http_core.h http_log.h util_script.h
! mod_rewrite.o: mod_rewrite.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_request.h http_core.h http_log.h mod_rewrite.h
! mod_status.o: mod_status.c httpd.h conf.h alloc.h buff.h http_config.h \
!  http_core.h http_protocol.h http_main.h util_script.h scoreboard.h \
!  http_log.h
! mod_userdir.o: mod_userdir.c httpd.h conf.h alloc.h buff.h \
!  http_config.h
! mod_usertrack.o: mod_usertrack.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_core.h
! modules.o: modules.c httpd.h conf.h alloc.h buff.h http_config.h
! rfc1413.o: rfc1413.c httpd.h conf.h alloc.h buff.h http_log.h \
!  rfc1413.h http_main.h
! util.o: util.c httpd.h conf.h alloc.h buff.h http_conf_globals.h
! util_date.o: util_date.c util_date.h
! util_md5.o: util_md5.c httpd.h conf.h alloc.h buff.h util_md5.h md5.h
! util_script.o: util_script.c httpd.h conf.h alloc.h buff.h \
!  http_config.h http_conf_globals.h http_main.h http_log.h \
!  http_protocol.h http_core.h http_request.h util_script.h
! util_snprintf.o: util_snprintf.c conf.h
--- 70,77 ----
  http_bprintf.o: http_bprintf.c
  	$(CC) -c $(INCLUDES) $(CFLAGS) $(BROKEN_BPRINTF_FLAGS) http_bprintf.c
  
  #Dependencies
  
  $(OBJS): Makefile
  
! modules.o: core/httpd.h core/http_config.h


--------------------------------

New os/unix/Makefile.tmpl:

CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
LIBS=$(EXTRA_LIBS) $(LIBS1)
INCLUDES=$(INCLUDES1) $(EXTRA_INCLUDES)
LFLAGS=$(LFLAGS1) $(EXTRA_LFLAGS)
INCDIR=../../core

OBJS=	os.o

all:	$(OBJS)

.c.o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $<

clean:
	rm -f $(OBJS)

os.o:	os.c

--------------------------------

New core/Makefile.tmpl:

# Apache makefile suffix for core files

# This is combined with the information in the "Configuration" file
# by the configure script to make the actual Makefile.

CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
LIBS=$(EXTRA_LIBS) $(LIBS1)
INCLUDES=$(INCLUDES1) $(EXTRA_INCLUDES)
LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)

OBJS= alloc.o http_main.o http_core.o http_config.o http_request.o \
  http_log.o http_protocol.o rfc1413.o util.o util_script.o buff.o\
  md5c.o util_md5.o explain.o http_bprintf.o util_date.o util_snprintf.o

.c.o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $<

all: $(OBJS)

clean:
	rm -f $(OBJS) 

# Work around broken compilers
http_bprintf.o: http_bprintf.c
	$(CC) -c $(INCLUDES) $(CFLAGS) $(BROKEN_BPRINTF_FLAGS) http_bprintf.c

#Dependencies

$(OBJS): 

alloc.o: conf.h alloc.h
buff.o: conf.h alloc.h buff.h
explain.o: explain.h
http_bprintf.o: conf.h alloc.h buff.h
http_config.o: httpd.h http_config.h http_core.h http_log.h http_request.h \
               http_conf_globals.h explain.h
http_core.o: httpd.h http_config.h http_core.h http_protocol.h scoreboard.h \
             http_conf_globals.h http_main.h http_log.h rfc1413.h util_md5.h
http_log.o: httpd.h http_config.h http_core.h http_log.h
http_main.o: httpd.h http_config.h http_core.h http_log.h http_request.h \
             http_conf_globals.h http_protocol.h http_main.h scoreboard.h \
             explain.h
http_protocol.o: httpd.h http_config.h http_core.h http_protocol.h \
                 http_main.h http_log.h util_date.h
http_request.o: httpd.h http_config.h http_request.h http_core.h \
                http_protocol.h http_log.h http_main.h scoreboard.h
md5c.o: md5.h
rfc1413.o: httpd.h http_log.h rfc1413.h
util.o: httpd.h http_conf_globals.h
util_date.o: util_date.h
util_md5.o: httpd.h util_md5.h
util_script.o: httpd.h http_config.h http_conf_globals.h http_main.h \
               http_log.h http_protocol.h http_core.h http_request.h \
               util_script.h
util_snprintf.o: httpd.h

httpd.h: conf.h alloc.h buff.h
util_md5.h: md5.h

---------------------------

New modules/standard/Makefile.tmpl:

mod_access.o: $(INCDIR)/httpd.h $(INCDIR)/http_core.h \
              $(INCDIR)/http_config.h $(INCDIR)/http_log.h

mod_actions.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h \
              $(INCDIR)/http_request.h $(INCDIR)/http_core.h \
              $(INCDIR)/http_protocol.h $(INCDIR)/http_main.h \
              $(INCDIR)/http_log.h $(INCDIR)/util_script.h

mod_alias.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h

mod_asis.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h \
              $(INCDIR)/http_protocol.h $(INCDIR)/http_log.h \
              $(INCDIR)/util_script.h $(INCDIR)/http_main.h \
              $(INCDIR)/http_request.h

mod_auth.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h \
              $(INCDIR)/http_core.h $(INCDIR)/http_log.h \
              $(INCDIR)/http_protocol.h

mod_browser.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h

mod_cgi.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h \
              $(INCDIR)/http_request.h $(INCDIR)/http_core.h \
              $(INCDIR)/http_protocol.h $(INCDIR)/http_main.h \
              $(INCDIR)/http_log.h $(INCDIR)/util_script.h 

mod_dir.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h \
              $(INCDIR)/http_core.h $(INCDIR)/http_request.h \
              $(INCDIR)/http_protocol.h $(INCDIR)/http_log.h \
              $(INCDIR)/http_main.h $(INCDIR)/util_script.h \

mod_env.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h

mod_imap.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h \
              $(INCDIR)/http_request.h $(INCDIR)/http_core.h \
              $(INCDIR)/http_protocol.h $(INCDIR)/http_main.h \
              $(INCDIR)/http_log.h $(INCDIR)/util_script.h

mod_include.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h \
              $(INCDIR)/http_request.h $(INCDIR)/http_core.h \
              $(INCDIR)/http_log.h $(INCDIR)/http_protocol.h \
              $(INCDIR)/http_main.h $(INCDIR)/util_script.h

mod_log_config.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h \
              $(INCDIR)/http_core.h

mod_mime.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h

mod_negotiation.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h \
              $(INCDIR)/http_request.h $(INCDIR)/http_core.h \
              $(INCDIR)/http_log.h

mod_userdir.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h




Mime
View raw message