diff options
author | Jeff Trawick <trawick@apache.org> | 2012-10-01 00:46:15 +0000 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2012-10-01 00:46:15 +0000 |
commit | 82af8fdc8d0d3e3c45578c43568891dfd7145207 (patch) | |
tree | 5257159f91032c6c12900cb504823b413743c776 /modules/config7.m4 | |
parent | cfb26e446e795258005b6f88196c4201d9979f81 (diff) | |
download | httpd-82af8fdc8d0d3e3c45578c43568891dfd7145207.tar.gz |
--with-module: Fix failure to integrate them into some existing
module directories.
modules/config?.m4 needs to run after the modules/*/config?.m4.
Otherwise, modules.mk as created for --with-module gets wiped
out first.
PR: 40097
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1392150 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/config7.m4')
-rw-r--r-- | modules/config7.m4 | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/config7.m4 b/modules/config7.m4 new file mode 100644 index 0000000000..16f2ff3630 --- /dev/null +++ b/modules/config7.m4 @@ -0,0 +1,56 @@ +AC_MSG_CHECKING(for extra modules) +AC_ARG_WITH(module, + APACHE_HELP_STRING(--with-module=module-type:module-file, + Enable module-file in the modules/<module-type> directory.), + [ + withval=`echo $withval | sed -e 's/,/ /g'` + for mod in $withval + do + modtype=`echo $mod | sed -e's/\(.*\):.*/\1/'` + pkg=`echo $mod | sed -e's/.*:\(.*\)/\1/'` + modfilec=`echo $pkg | sed -e 's;^.*/;;'` + modfileo=`echo $pkg | sed -e 's;^.*/;;' -e 's;\.c$;.o;'` + modpath_current="modules/$modtype" + if test "x$mod" != "x$modpath_current/$modfilec"; then + if test ! -d "$modpath_current"; then + mkdir $modpath_current + echo 'include $(top_srcdir)/build/special.mk' > $modpath_current/Makefile.in + fi + cp $pkg $modpath_current/$modfilec + fi + module=`echo $pkg | sed -e 's;\(.*/\).*mod_\(.*\).c;\2;'` + objects="mod_$module.lo" + # The filename of a convenience library must have a "lib" prefix: + libname="libmod_$module.la" + 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" + EXTRA_MODLIST="$EXTRA_MODLIST $modtype:$modfilec" + MODULE_DIRS="$MODULE_DIRS $modtype" + APACHE_FAST_OUTPUT($modpath_current/Makefile) + done + if test ! -z "$EXTRA_MODLIST"; then + AC_MSG_RESULT(added:$EXTRA_MODLIST) + fi + ], + [ AC_MSG_RESULT(none) + ]) |