]> granicus.if.org Git - apache/blob - configure.in
Test for AP_USE_HSREGEX, not USE_HSREGEX, as that's what actually gets
[apache] / configure.in
1 dnl ## Process this file with autoconf to produce a configure script
2
3 AC_PREREQ(2.13)
4 AC_INIT(acinclude.m4)
5
6 dnl ## This is the central place where Apache's version should be kept.
7 dnl AM_INIT_AUTOMAKE(apache, 2.0-dev)
8
9 VERSION="apache-2.0-dev"
10         
11 AC_CONFIG_HEADER(include/ap_config_auto.h)
12
13 APACHE_VERSION=$VERSION
14 APACHE_SUBST(APACHE_VERSION)
15
16 test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
17 test "$prefix" = "NONE" && prefix='/usr/local'
18
19 dnl Needed for APACHE_MODULE() to work
20 cwd=`pwd`
21
22 dnl ## Run configure for packages Apache uses
23 AC_CONFIG_SUBDIRS(lib/apr)
24
25 dnl ## Check for programs
26
27 AC_PROG_AWK
28 AC_PROG_CC
29 AC_PROG_CPP
30 AC_PROG_INSTALL
31 dnl AC_PROG_RANLIB
32 dnl AC_PATH_PROG(PERL_PATH, perl)
33
34 dnl various OS checks that apparently set required flags
35 AC_AIX
36 AC_ISC_POSIX
37 AC_MINIX
38
39 dnl ## Check for libraries
40
41 dnl ## Check for header files
42
43 dnl I think these are just used all over the place, so just check for
44 dnl them at the base of the tree. If some are specific to a single
45 dnl directory, they should be moved (Comment #Spoon)
46
47 AC_HEADER_STDC
48 AC_CHECK_HEADERS( \
49 unistd.h \
50 sys/stat.h \
51 sys/time.h \
52 sys/types.h \
53 sys/socket.h \
54 netinet/in.h \
55 arpa/inet.h \
56 netdb.h \
57 pwd.h \
58 grp.h \
59 )
60 AC_HEADER_SYS_WAIT
61
62 dnl ## Check for C preprocessor symbols
63
64 AC_CHECK_DEFINE(EAGAIN, errno.h)
65
66 dnl ## Check for typedefs, structures, and compiler characteristics.
67
68 AC_C_CONST
69 AC_C_INLINE
70 AC_TYPE_PID_T
71
72 dnl ## Check for library functions
73
74 dnl See Comment #Spoon
75
76 AC_CHECK_FUNCS( \
77 strdup \
78 strcasecmp \
79 strncasecmp \
80 strstr \
81 strerror \
82 initgroups \
83 waitpid \
84 gettimeofday \
85 memmove \
86 bzero \
87 )
88
89 AC_CHECK_LIB(nsl, gethostbyname)
90 AC_CHECK_LIB(socket, socket)
91
92 AC_CHECK_FUNCS(inet_addr inet_network, break, [
93   AC_MSG_ERROR(inet_addr function not found)
94 ])
95
96 APACHE_INADDR_NONE
97
98 REENTRANCY_FLAGS
99
100 AC_FUNC_SELECT_ARGTYPES
101
102 dnl Check if we'll actually need to cast select args all the time
103 if test "$ac_cv_func_select_arg1" != "int" \
104         -o "$ac_cv_func_select_arg234" != "fd_set *" \
105         -o "$ac_cv_func_select_arg5" != "struct timeval *" ; then
106
107     AC_DEFINE(SELECT_NEEDS_CAST,,
108         [Define if arguments to select() aren't what we expect])
109 fi
110
111 dnl ## Checking command-line options
112 test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
113     EXTRA_CFLAGS="$EXTRA_CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
114 test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "y2" && \
115     EXTRA_CFLAGS="$EXTRA_CFLAGS -g -Wall -Werror -Wmissing-declarations"
116
117 APACHE_ENABLE_LAYOUT
118 APACHE_ENABLE_MODULES
119 APACHE_ENABLE_SHARED
120
121 INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include"
122 APACHE_SUBST(INCLUDES)
123
124 dnl reading config stubs
125 esyscmd(./helpers/config-stubs .)
126
127 INCLUDES="$INCLUDES -I\$(top_srcdir)/\$(OS_DIR)"
128 EXTRA_LIBS="$EXTRA_LIBS $LIBS"
129 EXTRA_LDFLAGS="$LDFLAGS"
130 LIBS=""
131 LDFLAGS=""
132 APACHE_SUBST(EXTRA_CFLAGS)
133 APACHE_SUBST(EXTRA_LDFLAGS)
134 APACHE_SUBST(EXTRA_LIBS)
135 APACHE_SUBST(REGEX_DIR)
136 APACHE_SUBST(REGEX_LIB)
137 APACHE_SUBST(MPM_LIB)
138 APACHE_SUBST(OS)
139 APACHE_SUBST(OS_DIR)
140 APACHE_SUBST(BUILTIN_LIBS)
141
142 AM_DISABLE_SHARED
143 AM_PROG_LIBTOOL
144 APACHE_LIBTOOL_SILENT
145
146 if test "$apache_need_shared" = "yes"; then
147   $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
148 fi
149
150 EXTRA_CFLAGS="$EXTRA_CFLAGS \`\$(abs_srcdir)/apaci\`"
151
152 APACHE_FAST_OUTPUT(apaci Makefile ap/Makefile lib/Makefile main/Makefile
153            modules/Makefile os/Makefile)
154 APACHE_FAST_GENERATE
155         
156 dnl ## Build modules.c
157 rm -f $srcdir/modules.c
158 echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c
159
160 AC_SUBST(prefix)
161
162 AC_OUTPUT($APACHE_OUTPUT_FILES apaci)
163 chmod 744 apaci