]> granicus.if.org Git - apache/commitdiff
Allow modules to be added to the server at configure time. The syntax
authorRyan Bloom <rbb@apache.org>
Mon, 9 Apr 2001 05:18:40 +0000 (05:18 +0000)
committerRyan Bloom <rbb@apache.org>
Mon, 9 Apr 2001 05:18:40 +0000 (05:18 +0000)
is:

--with-module=module_type:/path/to/module

module_type is the directory under modules/ that the module should be
copied to.  Currently, this only adds static modules

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88772 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/config5.m4 [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index 6af32a2fd638b0273bdd6da787e44d2f9dce4e72..ff4b47598700aaea794d68745099aa8fe9215c6a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,12 @@
 Changes with Apache 2.0.17-dev
 
+  *) Allow module authors to add a module to their Apache build using
+     --with-module, without re-running buildconf.  The syntax is:
+       --with-module=module_type:/path/to/module.c
+     The configure script will copy the module.c file to 
+     modules/module_type, and it will be added to the relevant Makefiles.
+     currently, this only works for static modules.  [Ryan Bloom]
+
   *) Changes required to make prefork clean up idle children properly.
      There was a window during which a starting worker deadlocks when
      an idle cleanup arrives before it completes init. Apache then keeps
diff --git a/modules/config5.m4 b/modules/config5.m4
new file mode 100644 (file)
index 0000000..caa40ea
--- /dev/null
@@ -0,0 +1,43 @@
+AC_MSG_CHECKING(for extra modules)
+AC_ARG_WITH(module,
+  [  --with-module=location  Include the specified module.  location is the
+                          path to the new module.],
+  [
+    modtype=`echo $withval | sed -e's/\(.*\):.*/\1/'`
+    pkg=`echo $withval | sed -e's/.*:\(.*\)/\1/'`
+    modfilec=`echo $pkg | sed -e 's;^.*/;;'`
+    modfileo=`echo $pkg | sed -e 's;^.*/;;' -e 's;\.c$;.o;'`
+
+    if test "x$withval" != "xmodules/$modtype/$modfilec"; then
+        cp $pkg modules/$modtype/$modfilec
+    fi
+    module=`echo $pkg | sed -e 's;.*/mod_\(.*\).c;\1;'`
+    objects="mod_$module.lo"
+    libname="mod_$module.la"
+    modpath_current="modules/$modtype"
+    BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
+    if test ! -s "$modpath_current/modules.mk"; then
+      cat >>$modpath_current/modules.mk<<EOF
+$libname: $objects
+       \$(MOD_LINK) $objects
+DISTCLEAN_TARGETS = modules.mk
+static = $libname
+shared =
+EOF
+    else
+      cat >>$modpath_current/modules.mk.tmp<<EOF
+$libname: $objects
+       \$(MOD_LINK) $objects
+EOF
+      cat $modpath_current/modules.mk >> $modpath_current/modules.mk.tmp
+      rm $modpath_current/modules.mk
+      mv $modpath_current/modules.mk.tmp $modpath_current/modules.mk
+      sed -e "s/\(static =.*\)/\1 $libname/" $modpath_current/modules.mk > $modpath_current/modules.mk.tmp
+      rm $modpath_current/modules.mk
+      mv $modpath_current/modules.mk.tmp $modpath_current/modules.mk
+    fi
+    MODLIST="$MODLIST $module"
+  AC_MSG_RESULT(added $withval)
+  ],
+  [ AC_MSG_RESULT(no extra modules) 
+  ])