]> granicus.if.org Git - apache/blob - configure.in
remove APACHE_CHECK_DBM and the usage of srclib/sdbm/. this stuff is part of
[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 AC_CONFIG_HEADER(include/ap_config_auto.h)
7 AC_CONFIG_AUX_DIR(.)
8  
9 dnl ## This is the central place where Apache's version should be kept.
10 dnl AM_INIT_AUTOMAKE(apache, 2.0-dev)
11
12 VERSION="apache-2.0-dev"
13         
14 APACHE_VERSION=$VERSION
15 APACHE_SUBST(APACHE_VERSION)
16
17 test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
18 test "$prefix" = "NONE" && prefix='/usr/local'
19
20 dnl Absolute source/build directory
21 abs_srcdir=`(cd $srcdir && pwd)`
22 abs_builddir=`pwd`
23
24 APACHE_CONFIG_NICE(config.nice)
25
26 dnl If the source dir is not equal to the build dir, 
27 dnl then we are running in VPATH mode.
28
29 if test "$abs_builddir" != "$abs_srcdir"; then
30   USE_VPATH=1
31 fi
32
33 AC_CANONICAL_SYSTEM
34
35 dnl
36 dnl ## Preload our OS configuration
37 APR_PRELOAD
38 APACHE_PRELOAD
39
40 dnl
41 dnl Process command line arguments. This is done early in the process so the
42 dnl user can get feedback quickly in case of an error.
43 dnl
44 dnl ### need to move some of the arguments "up here"
45
46 dnl ## Check for programs
47
48 AC_PROG_AWK
49 AC_PROG_CC
50 AC_PROG_CPP
51 AC_PROG_INSTALL
52 AC_PROG_LN_S
53 AC_CHECK_TOOL(RANLIB, ranlib, true)
54 dnl AC_PATH_PROG(PERL_PATH, perl)
55
56 REENTRANCY_FLAGS
57
58 dnl various OS checks that apparently set required flags
59 AC_AIX
60 AC_ISC_POSIX
61 AC_MINIX
62
63 dnl ## Check for libraries
64
65 dnl ## Check for header files
66
67 dnl I think these are just used all over the place, so just check for
68 dnl them at the base of the tree. If some are specific to a single
69 dnl directory, they should be moved (Comment #Spoon)
70
71 dnl Regarding standard header files: AC_HEADER_STDC doesn't set symbols
72 dnl HAVE_STRING_H, HAVE_STDLIB_H, etc., so those are checked for
73 dnl explicitly so that the normal HAVE_xxx_H symbol is defined.
74
75 AC_HEADER_STDC
76 AC_CHECK_HEADERS( \
77 string.h \
78 stdlib.h \
79 ctype.h \
80 limits.h \
81 unistd.h \
82 sys/time.h \
83 sys/types.h \
84 sys/socket.h \
85 netinet/in.h \
86 netinet/tcp.h \
87 arpa/inet.h \
88 netdb.h \
89 pwd.h \
90 grp.h \
91 strings.h
92 )
93 AC_HEADER_SYS_WAIT
94
95 dnl ## Check for typedefs, structures, and compiler characteristics.
96
97 AC_C_CONST
98
99 dnl ## Check for library functions
100
101 dnl See Comment #Spoon
102
103 AC_CHECK_FUNCS( \
104 initgroups \
105 )
106
107 AC_CHECK_LIB(nsl, gethostbyname)
108 AC_CHECK_LIB(nsl, gethostname)
109 AC_CHECK_LIB(socket, socket)
110 AC_CHECK_LIB(resolv, sethostent)
111
112 APACHE_EBCDIC
113
114 AC_ARG_WITH(optim,[  --with-optim="FLAGS"      compiler optimisation flags],
115         [OPTIM="$withval"])
116
117 AC_ARG_WITH(port,[  --with-port=PORT        Port on which to listen (default is 80)],
118         [PORT="$withval"],
119         [PORT=80])
120
121 AC_ARG_WITH(debug,[  --with-debug            Turn on debugging and compile time warnings],
122         [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi])
123
124 AC_ARG_WITH(maintainer-mode,[  --with-maintainer-mode   Turn on debugging and compile time warnings],
125         [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DAP_DEBUG"; else CFLAGS="$CFLAGS -g"; fi])
126
127 APACHE_ENABLE_LAYOUT
128 APACHE_ENABLE_MODULES
129 APACHE_ENABLE_SHARED
130
131 INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/srclib/apr/include -I\$(top_srcdir)/srclib/apr-util/include"
132 if test -n "$USE_VPATH"; then
133   INCLUDES="$INCLUDES -I\$(top_builddir)/include -I\$(top_builddir)/srclib/apr/include"
134 fi
135
136 dnl reading config stubs
137 esyscmd(./build/config-stubs .)
138
139 INCLUDES="$INCLUDES -I\$(top_srcdir)/os/\$(OS_DIR)"
140 EXTRA_LIBS="$EXTRA_LIBS $LIBS"
141 EXTRA_LDFLAGS="$LDFLAGS"
142 LIBS=""
143 LDFLAGS=""
144 APACHE_SUBST(progname)
145 APACHE_SUBST(EXTRA_CFLAGS)
146 APACHE_SUBST(EXTRA_LDFLAGS)
147 APACHE_SUBST(EXTRA_LIBS)
148 APACHE_SUBST(INCLUDES)
149 APACHE_SUBST(MPM_LIB)
150 APACHE_SUBST(OS)
151 APACHE_SUBST(OS_DIR)
152 APACHE_SUBST(BUILTIN_LIBS)
153 APACHE_SUBST(LIBPRE)
154
155 AM_DISABLE_SHARED
156 AM_PROG_LIBTOOL
157 APACHE_LIBTOOL_SILENT
158
159 if test "$apache_need_shared" = "yes"; then
160   $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
161   case $PLATFORM in
162     *os390)
163       CFLAGS="$CFLAGS -Wc,DLL,EXPORTALL"
164       ;;
165   esac
166 fi
167
168 AC_ARG_WITH(program-name,
169 [  --with-program-name=alternate executable name],[
170   progname="$withval" ], [
171   progname="httpd"] )
172
173 dnl ### util_xml is always included, so we always need Expat (for now)
174 apache_need_expat=yes
175
176 dnl AP_LIB_DIRS specifies the additional libs from srclib/ that we need
177 dnl AP_LIBS specifies the actual libraries. note we have some required libs.
178 AP_LIBS="srclib/pcre/libpcre.la srclib/apr-util/libaprutil.la"
179
180 if test "$apache_need_expat" = "yes"; then
181   AP_LIB_DIRS="$AP_LIB_DIRS expat-lite"
182   AP_LIBS="$AP_LIBS srclib/expat-lite/libexpat.la"
183   INCLUDES="$INCLUDES -I\$(top_srcdir)/srclib/expat-lite"
184 fi
185
186 dnl APR should go after the other libs, so the right symbols can be picked up
187 AP_LIBS="$AP_LIBS srclib/apr/\$(LIBPRE)apr.a"
188 APACHE_SUBST(AP_LIB_DIRS)
189 APACHE_SUBST(AP_LIBS)
190
191 AC_DEFINE(AP_USING_AUTOCONF, 1,
192                 [Using autoconf to configure Apache])
193
194 if test "$SINGLE_LISTEN_UNSERIALIZED_ACCEPT" = "1"; then
195     AC_DEFINE(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, 1, 
196               [This platform doesn't suffer from the thundering herd problem])
197 fi
198
199 dnl check for endianness
200 if test "$cross_compiling" = "no"; then
201   AC_C_BIGENDIAN
202 else
203   AC_DEFINE(AP_UNKNOWN_BYTE_ORDER,1,
204                 [byte order is unknown due to cross-compilation])
205 fi
206
207 APACHE_FAST_OUTPUT(Makefile modules/Makefile srclib/Makefile) 
208 APACHE_FAST_OUTPUT(os/beos/Makefile os/os2/Makefile os/Makefile)
209 APACHE_FAST_OUTPUT(os/unix/Makefile server/Makefile)
210 APACHE_FAST_OUTPUT(support/Makefile test/Makefile srclib/pcre/Makefile)
211 for i in $AP_LIB_DIRS; do
212   APACHE_FAST_OUTPUT(srclib/$i/Makefile)
213 done
214
215 dnl ## Run configure for packages Apache uses
216 dnl ## This has been placed at this location for a reason.  This allows
217 dnl ## Apache to set some variable that APR needs (like whether to enable
218 dnl ## or disable threads), while still allowing APR to run and generate
219 dnl ## APRVARS before Apache generates it's Makefiles and the related files.
220 dnl ## This allows APR to detect libraries like dl and tell Apache that it
221 dnl ## needs to include or not include them.
222 RUN_SUBDIR_CONFIG_NOW(srclib/apr, $apache_apr_flags)
223 RUN_SUBDIR_CONFIG_NOW(srclib/apr-util, "--with-apr=../apr")
224 RUN_SUBDIR_CONFIG_NOW(srclib/pcre)
225 . ./srclib/apr/APRVARS
226
227 APACHE_GEN_CONFIG_VARS
228
229 dnl ## Build modules.c
230 rm -f modules.c
231 echo $MODLIST | $AWK -f $srcdir/build/build-modules-c.awk > modules.c
232
233 AC_OUTPUT_COMMANDS([
234 echo '/* Generated by configure */' > ${path_h}.new
235 echo "#define HTTPD_ROOT \"$prefix\"" >> ${path_h}.new
236 echo "#define SUEXEC_BIN \"$bindir/suexec\"" >> ${path_h}.new
237 echo "#define SERVER_CONFIG_FILE \"conf/$progname.conf\"" >> ${path_h}.new
238 echo "#define APACHE_MPM_DIR \"$mpmdir\"" >> ${path_h}.new
239
240 cmp ${path_h}.new ${path_h} >/dev/null 2>&1
241 if test $? -ne 0 ; then
242     rm -f ${path_h} && mv ${path_h}.new ${path_h} && \
243     echo "Updated ${path_h}"
244 else
245     rm -f ${path_h}.new && \
246     echo "${path_h} unchanged"
247 fi
248 ],[
249 path_h=./include/ap_config_path.h
250 prefix=$prefix
251 exec_prefix=$exec_prefix
252 bindir=$bindir
253 progname=$progname
254 mpmdir=$MPM_DIR
255 ])
256
257 AC_TYPE_RLIM_T
258
259 perlbin=`$srcdir/build/PrintPath perl`
260 AC_SUBST(perlbin)
261
262 dnl If we are running on BSD/OS, we need to use the BSD .include syntax.
263
264 BSD_MAKEFILE=no
265 case "$host_alias" in
266 *bsdi*)
267     BSD_MAKEFILE=yes;;
268 esac
269
270 AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs support/apachectl,,[
271   APACHE_GEN_MAKEFILES
272 ])
273