1 AC_MSG_CHECKING(for extra modules)
3 APACHE_HELP_STRING(--with-module=module-type:module-file,
4 Enable module-file in the modules/<module-type> directory.),
6 as_save_IFS="$IFS"; IFS=","
9 modtype=`echo $mod | sed -e's/\(.*\):.*/\1/'`
10 pkg=`echo $mod | sed -e's/.*:\(.*\)/\1/'`
11 modfilec=`echo $pkg | sed -e 's;^.*/;;'`
12 modfileo=`echo $pkg | sed -e 's;^.*/;;' -e 's;\.c$;.o;'`
13 modpath_current="modules/$modtype"
14 if test "x$mod" != "x$modpath_current/$modfilec"; then
15 if test ! -d "$modpath_current"; then
16 mkdir $modpath_current
17 echo 'include $(top_srcdir)/build/special.mk' > $modpath_current/Makefile.in
19 cp $pkg $modpath_current/$modfilec
21 module=`echo $pkg | sed -e 's;\(.*/\).*mod_\(.*\).c;\2;'`
22 objects="mod_$module.lo"
23 # The filename of a convenience library must have a "lib" prefix:
24 libname="libmod_$module.la"
25 BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
26 if test ! -s "$modpath_current/modules.mk"; then
27 cat >>$modpath_current/modules.mk<<EOF
30 DISTCLEAN_TARGETS = modules.mk
35 cat >>$modpath_current/modules.mk.tmp<<EOF
39 cat $modpath_current/modules.mk >> $modpath_current/modules.mk.tmp
40 rm $modpath_current/modules.mk
41 mv $modpath_current/modules.mk.tmp $modpath_current/modules.mk
42 sed -e "s/\(static =.*\)/\1 $libname/" $modpath_current/modules.mk > $modpath_current/modules.mk.tmp
43 rm $modpath_current/modules.mk
44 mv $modpath_current/modules.mk.tmp $modpath_current/modules.mk
46 MODLIST="$MODLIST $module"
47 EXTRA_MODLIST="$EXTRA_MODLIST $modtype:$modfilec"
48 MODULE_DIRS="$MODULE_DIRS $modtype"
49 APACHE_FAST_OUTPUT($modpath_current/Makefile)
51 if test ! -z "$EXTRA_MODLIST"; then
52 AC_MSG_RESULT(added:$EXTRA_MODLIST)