Blame modules/config7.m4

Packit 90a5c9
AC_MSG_CHECKING(for extra modules)
Packit 90a5c9
AC_ARG_WITH(module,
Packit 90a5c9
  APACHE_HELP_STRING(--with-module=module-type:module-file,
Packit 90a5c9
                     Enable module-file in the modules/<module-type> directory.),
Packit 90a5c9
  [
Packit 90a5c9
    withval=`echo $withval | sed -e 's/,/ /g'`
Packit 90a5c9
    for mod in $withval
Packit 90a5c9
    do
Packit 90a5c9
      modtype=`echo $mod | sed -e's/\(.*\):.*/\1/'`
Packit 90a5c9
      pkg=`echo $mod | sed -e's/.*:\(.*\)/\1/'`
Packit 90a5c9
      modfilec=`echo $pkg | sed -e 's;^.*/;;'`
Packit 90a5c9
      modfileo=`echo $pkg | sed -e 's;^.*/;;' -e 's;\.c$;.o;'`
Packit 90a5c9
      modpath_current="modules/$modtype"
Packit 90a5c9
      if test "x$mod" != "x$modpath_current/$modfilec"; then
Packit 90a5c9
        if test ! -d "$modpath_current"; then
Packit 90a5c9
          mkdir $modpath_current
Packit 90a5c9
          echo 'include $(top_srcdir)/build/special.mk' > $modpath_current/Makefile.in
Packit 90a5c9
        fi
Packit 90a5c9
        cp $pkg $modpath_current/$modfilec
Packit 90a5c9
      fi
Packit 90a5c9
      module=`echo $pkg | sed -e 's;\(.*/\).*mod_\(.*\).c;\2;'`
Packit 90a5c9
      objects="mod_$module.lo"
Packit 90a5c9
      # The filename of a convenience library must have a "lib" prefix:
Packit 90a5c9
      libname="libmod_$module.la"
Packit 90a5c9
      BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
Packit 90a5c9
      if test ! -s "$modpath_current/modules.mk"; then
Packit 90a5c9
        cat >>$modpath_current/modules.mk<
Packit 90a5c9
$libname: $objects
Packit 90a5c9
	\$(MOD_LINK) $objects
Packit 90a5c9
DISTCLEAN_TARGETS = modules.mk
Packit 90a5c9
static = $libname
Packit 90a5c9
shared =
Packit 90a5c9
EOF
Packit 90a5c9
      else
Packit 90a5c9
        cat >>$modpath_current/modules.mk.tmp<
Packit 90a5c9
$libname: $objects
Packit 90a5c9
	\$(MOD_LINK) $objects
Packit 90a5c9
EOF
Packit 90a5c9
        cat $modpath_current/modules.mk >> $modpath_current/modules.mk.tmp
Packit 90a5c9
        rm $modpath_current/modules.mk
Packit 90a5c9
        mv $modpath_current/modules.mk.tmp $modpath_current/modules.mk
Packit 90a5c9
        sed -e "s/\(static =.*\)/\1 $libname/" $modpath_current/modules.mk > $modpath_current/modules.mk.tmp
Packit 90a5c9
        rm $modpath_current/modules.mk
Packit 90a5c9
        mv $modpath_current/modules.mk.tmp $modpath_current/modules.mk
Packit 90a5c9
      fi
Packit 90a5c9
      MODLIST="$MODLIST $module"
Packit 90a5c9
      EXTRA_MODLIST="$EXTRA_MODLIST $modtype:$modfilec"
Packit 90a5c9
      MODULE_DIRS="$MODULE_DIRS $modtype"
Packit 90a5c9
      APACHE_FAST_OUTPUT($modpath_current/Makefile)
Packit 90a5c9
    done
Packit 90a5c9
    if test ! -z "$EXTRA_MODLIST"; then
Packit 90a5c9
      AC_MSG_RESULT(added:$EXTRA_MODLIST)
Packit 90a5c9
    fi
Packit 90a5c9
  ],
Packit 90a5c9
  [ AC_MSG_RESULT(none) 
Packit 90a5c9
  ])