acinclude.m4 revision 5e02b58f37d5dcea1e75f35ed6b14cbb9af31a9a
f808c858fa61e7769218966759510a8b1190dfcfrafdnl APACHE_MODULE(modname [, shared])
f808c858fa61e7769218966759510a8b1190dfcfrafdnl Includes an extension in the build.
f808c858fa61e7769218966759510a8b1190dfcfrafdnl "modname" is the name of the modules/ subdir where the extension resides
f808c858fa61e7769218966759510a8b1190dfcfrafdnl "shared" can be set to "shared" or "yes" to build the extension as
f808c858fa61e7769218966759510a8b1190dfcfrafdnl a dynamically loadable library.
f808c858fa61e7769218966759510a8b1190dfcfrafdnl XXX - for now, all modules using this function are in modules/standard
f808c858fa61e7769218966759510a8b1190dfcfrafAC_DEFUN(APACHE_MODULE,[
f808c858fa61e7769218966759510a8b1190dfcfraf if test -d "$cwd/$srcdir/modules/standard" ; then
f808c858fa61e7769218966759510a8b1190dfcfrafdnl MOD_SUBDIRS="$MOD_SUBDIRS $1"
f808c858fa61e7769218966759510a8b1190dfcfraf if test "$2" != "shared" -a "$2" != "yes"; then
f808c858fa61e7769218966759510a8b1190dfcfraf libname=$(basename $1)
f808c858fa61e7769218966759510a8b1190dfcfraf _extlib="libapachemod_${libname}.a"
f808c858fa61e7769218966759510a8b1190dfcfraf MOD_LTLIBS="$MOD_LTLIBS modules/standard/libapachemod_${libname}.la"
f808c858fa61e7769218966759510a8b1190dfcfraf MOD_LIBS="$MOD_LIBS standard/$_extlib"
f808c858fa61e7769218966759510a8b1190dfcfraf MOD_STATIC="$MOD_STATIC $1"
f808c858fa61e7769218966759510a8b1190dfcfraf MOD_SHARED="$MOD_SHARED $1"
f808c858fa61e7769218966759510a8b1190dfcfrafdnl APACHE_OUTPUT(modules/$1/Makefile)
f808c858fa61e7769218966759510a8b1190dfcfrafAC_SUBST(MOD_LTLIBS)
f808c858fa61e7769218966759510a8b1190dfcfrafdnl ## APACHE_OUTPUT(file)
f808c858fa61e7769218966759510a8b1190dfcfrafdnl ## adds "file" to the list of files generated by AC_OUTPUT
f808c858fa61e7769218966759510a8b1190dfcfrafdnl ## This macro can be used several times.
25e8c5aa2b496d9026e958ac731a610167574f59vikramAC_DEFUN(APACHE_OUTPUT, [
f808c858fa61e7769218966759510a8b1190dfcfraf APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1"
f808c858fa61e7769218966759510a8b1190dfcfrafdnl AC_ADD_LIBRARY(library)
f808c858fa61e7769218966759510a8b1190dfcfrafdnl add a library to the link line
f808c858fa61e7769218966759510a8b1190dfcfrafAC_DEFUN(AC_ADD_LIBRARY,[
f808c858fa61e7769218966759510a8b1190dfcfraf APACHE_ONCE(LIBRARY, $1, [
f808c858fa61e7769218966759510a8b1190dfcfraf EXTRA_LIBS="$EXTRA_LIBS -l$1"
f808c858fa61e7769218966759510a8b1190dfcfrafdnl AC_CHECK_DEFINE(macro, headerfile)
f808c858fa61e7769218966759510a8b1190dfcfrafdnl checks for the macro in the header file
f808c858fa61e7769218966759510a8b1190dfcfrafAC_DEFUN(AC_CHECK_DEFINE,[
f808c858fa61e7769218966759510a8b1190dfcfraf AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1,
f808c858fa61e7769218966759510a8b1190dfcfraf AC_EGREP_CPP([YES_IS_DEFINED], [
f808c858fa61e7769218966759510a8b1190dfcfraf#include <$2>
f808c858fa61e7769218966759510a8b1190dfcfrafYES_IS_DEFINED
f808c858fa61e7769218966759510a8b1190dfcfraf ], ac_cv_define_$1=yes, ac_cv_define_$1=no))
f808c858fa61e7769218966759510a8b1190dfcfraf if test "$ac_cv_define_$1" = "yes" ; then
f808c858fa61e7769218966759510a8b1190dfcfraf AC_DEFINE(HAVE_$1)
f808c858fa61e7769218966759510a8b1190dfcfrafdnl AC_TYPE_RLIM_T
f808c858fa61e7769218966759510a8b1190dfcfrafdnl If rlim_t is not defined, define it to int
f808c858fa61e7769218966759510a8b1190dfcfrafAC_DEFUN(AC_TYPE_RLIM_T, [
f808c858fa61e7769218966759510a8b1190dfcfraf AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
f808c858fa61e7769218966759510a8b1190dfcfraf AC_TRY_COMPILE([#include <sys/resource.h>], [rlim_t spoon;], [
f808c858fa61e7769218966759510a8b1190dfcfraf ac_cv_type_rlim_t=yes
f808c858fa61e7769218966759510a8b1190dfcfraf ],[ac_cv_type_rlim_t=no
f808c858fa61e7769218966759510a8b1190dfcfraf if test "$ac_ac_type_rlim_t" = "no" ; then
f808c858fa61e7769218966759510a8b1190dfcfraf AC_DEFINE(rlim_t, int)
f808c858fa61e7769218966759510a8b1190dfcfrafdnl APACHE_ONCE(namespace, variable, code)
f808c858fa61e7769218966759510a8b1190dfcfrafdnl execute code, if variable is not set in namespace
f808c858fa61e7769218966759510a8b1190dfcfrafAC_DEFUN(APACHE_ONCE,[
f808c858fa61e7769218966759510a8b1190dfcfraf unique=`echo $ac_n "$2$ac_c" | tr -c -d a-zA-Z0-9`
25e8c5aa2b496d9026e958ac731a610167574f59vikram cmd="echo $ac_n \"\$$1$unique$ac_c\""
25e8c5aa2b496d9026e958ac731a610167574f59vikram if test -n "$unique" && test "`eval $cmd`" = "" ; then
25e8c5aa2b496d9026e958ac731a610167574f59vikram eval "$1$unique=set"