bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / 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     as_save_IFS="$IFS"; IFS=","
7     for mod in $withval
8     do
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
18       fi
19       cp $pkg $modpath_current/$modfilec
20     fi
21     module=`echo $pkg | sed -e 's;\(.*/\)*mod_\(.*\).c;\2;'`
22     objects="mod_$module.lo"
23     libname="mod_$module.la"
24     BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
25     if test ! -s "$modpath_current/modules.mk"; then
26       cat >>$modpath_current/modules.mk<<EOF
27 $libname: $objects
28         \$(MOD_LINK) $objects
29 DISTCLEAN_TARGETS = modules.mk
30 static = $libname
31 shared =
32 EOF
33     else
34       cat >>$modpath_current/modules.mk.tmp<<EOF
35 $libname: $objects
36         \$(MOD_LINK) $objects
37 EOF
38       cat $modpath_current/modules.mk >> $modpath_current/modules.mk.tmp
39       rm $modpath_current/modules.mk
40       mv $modpath_current/modules.mk.tmp $modpath_current/modules.mk
41       sed -e "s/\(static =.*\)/\1 $libname/" $modpath_current/modules.mk > $modpath_current/modules.mk.tmp
42       rm $modpath_current/modules.mk
43       mv $modpath_current/modules.mk.tmp $modpath_current/modules.mk
44     fi
45     MODLIST="$MODLIST $module"
46     EXTRA_MODLIST="$EXTRA_MODLIST $modtype:$modfilec"
47     MODULE_DIRS="$MODULE_DIRS $modtype"
48     APACHE_FAST_OUTPUT($modpath_current/Makefile)
49     done
50     if test ! -z "$EXTRA_MODLIST"; then
51       AC_MSG_RESULT(added:$EXTRA_MODLIST)
52     fi
53     IFS="$as_save_IFS"
54   ],
55   [ AC_MSG_RESULT(none) 
56   ])