blob: aa97f724ae445a87e9dda545f295a305a3eee660 [file] [log] [blame]
dnl
dnl APACHE_MODULE(modname [, shared])
dnl
dnl Includes an extension in the build.
dnl
dnl "modname" is the name of the modules/ subdir where the extension resides
dnl "shared" can be set to "shared" or "yes" to build the extension as
dnl a dynamically loadable library.
dnl
AC_DEFUN(APACHE_MODULE,[
if test -d "$cwd/$srcdir/modules/$1" ; then
MOD_SUBDIRS="$MOD_SUBDIRS $1"
if test "$2" != "shared" -a "$2" != "yes"; then
libname=$(basename $1)
_extlib="lib${libname}.a"
MOD_LTLIBS="$MOD_LTLIBS modules/$1/lib${libname}.la"
MOD_LIBS="$MOD_LIBS $1/$_extlib"
MOD_STATIC="$MOD_STATIC $1"
else
MOD_SHARED="$MOD_SHARED $1"
fi
APACHE_OUTPUT(modules/$1/Makefile)
fi
])
AC_SUBST(MOD_LTLIBS)
dnl ## APACHE_OUTPUT(file)
dnl ## adds "file" to the list of files generated by AC_OUTPUT
dnl ## This macro can be used several times.
AC_DEFUN(APACHE_OUTPUT, [
APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1"
])
dnl
dnl AC_ADD_LIBRARY(library)
dnl
dnl add a library to the link line
dnl
AC_DEFUN(AC_ADD_LIBRARY,[
APACHE_ONCE(LIBRARY, $1, [
EXTRA_LIBS="$EXTRA_LIBS -l$1"
])
])
dnl
dnl APACHE_ONCE(namespace, variable, code)
dnl
dnl execute code, if variable is not set in namespace
dnl
AC_DEFUN(APACHE_ONCE,[
unique=`echo $ac_n "$2$ac_c" | tr -c -d a-zA-Z0-9`
cmd="echo $ac_n \"\$$1$unique$ac_c\""
if test -n "$unique" && test "`eval $cmd`" = "" ; then
eval "$1$unique=set"
$3
fi
])