]> granicus.if.org Git - apache/blob - acinclude.m4
Disable the DYLD_CANT_UNLOAD workaround for Mac OS X Server, since the
[apache] / acinclude.m4
1 dnl
2 dnl APACHE_MODULE(modname [, shared])
3 dnl
4 dnl Includes an extension in the build.
5 dnl
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.
9 dnl
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"
19     else
20       MOD_SHARED="$MOD_SHARED $1"
21     fi
22     APACHE_OUTPUT(modules/$1/Makefile)
23   fi
24 ])
25
26 AC_SUBST(MOD_LTLIBS)
27
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"
33 ])
34
35 dnl
36 dnl AC_ADD_LIBRARY(library)
37 dnl
38 dnl add a library to the link line
39 dnl
40 AC_DEFUN(AC_ADD_LIBRARY,[
41   APACHE_ONCE(LIBRARY, $1, [
42     EXTRA_LIBS="$EXTRA_LIBS -l$1"
43   ])
44 ])
45
46 dnl
47 dnl AC_CHECK_DEFINE(macro, headerfile)
48 dnl
49 dnl checks for the macro in the header file
50 dnl
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], [
54     #include <$2>
55     #ifdef $1
56     YES_IS_DEFINED
57     #endif
58   ], ac_cv_define_$1=yes, ac_cv_define_$1=no))
59   if test "$ac_cv_define_$1" = "yes" ; then
60       AC_DEFINE(HAVE_$1)
61   fi
62 ])
63
64 dnl
65 dnl AC_TYPE_RLIM_T
66 dnl
67 dnl If rlim_t is not defined, define it to int
68 dnl
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;], [
72       ac_cv_type_rlim_t=yes
73     ],[ac_cv_type_rlim_t=no
74     ])
75   ])
76   if test "$ac_ac_type_rlim_t" = "no" ; then
77       AC_DEFINE(rlim_t, int)
78   fi
79 ])
80
81 dnl
82 dnl APACHE_ONCE(namespace, variable, code)
83 dnl
84 dnl execute code, if variable is not set in namespace
85 dnl
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
90     eval "$1$unique=set"
91     $3
92   fi
93 ])
94