acinclude.m4 revision aa811cad2eb3fc01d17a5c8eba274b915ab8cd20
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 AC_CHECK_DEFINE(macro, headerfile)
dnl
dnl checks for the macro in the header file
dnl
AC_DEFUN(AC_CHECK_DEFINE,[
AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1,
AC_EGREP_CPP([YES_IS_DEFINED], [
#include <$2>
#ifdef $1
YES_IS_DEFINED
#endif
], ac_cv_define_$1=yes, ac_cv_define_$1=no))
if test "$ac_cv_define_$1" = "yes" ; then
AC_DEFINE(HAVE_$1)
fi
])
dnl
dnl AC_TYPE_RLIM_T
dnl
dnl If rlim_t is not defined, define it to int
dnl
AC_DEFUN(AC_TYPE_RLIM_T, [
AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
AC_TRY_COMPILE([#include <sys/resource.h>], [rlim_t spoon;], [
ac_cv_type_rlim_t=yes
],[ac_cv_type_rlim_t=no
AC_DEFINE(rlim_t, int)
])
])
])
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
])