2 dnl APACHE_MODULE(modname [, shared])
4 dnl Includes an extension in the build.
6 dnl "modname" is the name of the modules/ subdir where the extension resides
7 dnl "shared" can be set to "shared" or "yes" to build the extension as
8 dnl a dynamically loadable library.
10 AC_DEFUN(APACHE_MODULE,[
11 if test -d "$cwd/$srcdir/modules/$1" ; then
12 MOD_SUBDIRS="$MOD_SUBDIRS $1"
13 if test "$2" != "shared" -a "$2" != "yes"; then
14 libname=$(basename $1)
15 _extlib="lib${libname}.a"
16 MOD_LTLIBS="$MOD_LTLIBS modules/$1/lib${libname}.la"
17 MOD_LIBS="$MOD_LIBS $1/$_extlib"
18 MOD_STATIC="$MOD_STATIC $1"
20 MOD_SHARED="$MOD_SHARED $1"
22 APACHE_OUTPUT(modules/$1/Makefile)
28 dnl ## APACHE_OUTPUT(file)
29 dnl ## adds "file" to the list of files generated by AC_OUTPUT
30 dnl ## This macro can be used several times.
31 AC_DEFUN(APACHE_OUTPUT, [
32 APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1"
36 dnl AC_ADD_LIBRARY(library)
38 dnl add a library to the link line
40 AC_DEFUN(AC_ADD_LIBRARY,[
41 APACHE_ONCE(LIBRARY, $1, [
42 EXTRA_LIBS="$EXTRA_LIBS -l$1"
47 dnl AC_CHECK_DEFINE(macro, headerfile)
49 dnl checks for the macro in the header file
51 AC_DEFUN(AC_CHECK_DEFINE,[
52 AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1,
53 AC_EGREP_CPP([YES_IS_DEFINED], [
58 ], ac_cv_define_$1=yes, ac_cv_define_$1=no))
59 if test "$ac_cv_define_$1" = "yes" ; then
67 dnl If rlim_t is not defined, define it to int
69 AC_DEFUN(AC_TYPE_RLIM_T, [
70 AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
71 AC_TRY_COMPILE([#include <sys/resource.h>], [rlim_t spoon;], [
73 ],[ac_cv_type_rlim_t=no
76 if test "$ac_ac_type_rlim_t" = "no" ; then
77 AC_DEFINE(rlim_t, int)
82 dnl APACHE_ONCE(namespace, variable, code)
84 dnl execute code, if variable is not set in namespace
86 AC_DEFUN(APACHE_ONCE,[
87 unique=`echo $ac_n "$2$ac_c" | tr -c -d a-zA-Z0-9`
88 cmd="echo $ac_n \"\$$1$unique$ac_c\""
89 if test -n "$unique" && test "`eval $cmd`" = "" ; then