]> granicus.if.org Git - apache/blob - modules/config5.m4
Upon further review, it seems silly to add z the here when we didn't add
[apache] / modules / config5.m4
1 AC_MSG_CHECKING(for extra modules)
2 AC_ARG_WITH(module,
3   APACHE_HELP_STRING(--with-module=module-type:module-file,
4                      Enable module-file in the modules/<module-type> directory.),
5   [
6     modtype=`echo $withval | sed -e's/\(.*\):.*/\1/'`
7     pkg=`echo $withval | sed -e's/.*:\(.*\)/\1/'`
8     modfilec=`echo $pkg | sed -e 's;^.*/;;'`
9     modfileo=`echo $pkg | sed -e 's;^.*/;;' -e 's;\.c$;.o;'`
10
11     if test "x$withval" != "xmodules/$modtype/$modfilec"; then
12         cp $pkg modules/$modtype/$modfilec
13     fi
14     module=`echo $pkg | sed -e 's;.*/mod_\(.*\).c;\1;'`
15     objects="mod_$module.lo"
16     libname="mod_$module.la"
17     modpath_current="modules/$modtype"
18     BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
19     if test ! -s "$modpath_current/modules.mk"; then
20       cat >>$modpath_current/modules.mk<<EOF
21 $libname: $objects
22         \$(MOD_LINK) $objects
23 DISTCLEAN_TARGETS = modules.mk
24 static = $libname
25 shared =
26 EOF
27     else
28       cat >>$modpath_current/modules.mk.tmp<<EOF
29 $libname: $objects
30         \$(MOD_LINK) $objects
31 EOF
32       cat $modpath_current/modules.mk >> $modpath_current/modules.mk.tmp
33       rm $modpath_current/modules.mk
34       mv $modpath_current/modules.mk.tmp $modpath_current/modules.mk
35       sed -e "s/\(static =.*\)/\1 $libname/" $modpath_current/modules.mk > $modpath_current/modules.mk.tmp
36       rm $modpath_current/modules.mk
37       mv $modpath_current/modules.mk.tmp $modpath_current/modules.mk
38     fi
39     MODLIST="$MODLIST $module"
40   AC_MSG_RESULT(added $withval)
41   ],
42   [ AC_MSG_RESULT(no extra modules) 
43   ])