1 dnl ## Process this file with autoconf to produce a configure script
6 dnl ## This is the central place where Apache's version should be kept.
7 dnl AM_INIT_AUTOMAKE(apache, 2.0-dev)
9 VERSION="apache-2.0-dev"
11 AC_CONFIG_HEADER(include/ap_config_auto.h)
13 APACHE_VERSION=$VERSION
14 APACHE_SUBST(APACHE_VERSION)
16 test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
17 test "$prefix" = "NONE" && prefix='/usr/local'
19 dnl Absolute source/build directory
20 abs_srcdir=`(cd $srcdir && pwd)`
23 APACHE_CONFIG_NICE(config.nice)
25 dnl If the source dir is not equal to the build dir,
26 dnl then we are running in VPATH mode.
28 if test "$abs_builddir" != "$abs_srcdir"; then
32 dnl ## Run configure for packages Apache uses
33 AC_CONFIG_SUBDIRS(lib/pcre lib/apr)
36 dnl ## Preload our OS configuration
39 dnl ## Check for programs
46 dnl AC_PATH_PROG(PERL_PATH, perl)
50 dnl various OS checks that apparently set required flags
55 dnl ## Check for libraries
57 dnl ## Check for header files
59 dnl I think these are just used all over the place, so just check for
60 dnl them at the base of the tree. If some are specific to a single
61 dnl directory, they should be moved (Comment #Spoon)
63 dnl Regarding standard header files: AC_HEADER_STDC doesn't set symbols
64 dnl HAVE_STRING_H, HAVE_STDLIB_H, etc., so those are checked for
65 dnl explicitly so that the normal HAVE_xxx_H symbol is defined.
88 dnl ## Check for C preprocessor symbols
90 AC_CHECK_DEFINE(EAGAIN, errno.h)
92 dnl ## Check for typedefs, structures, and compiler characteristics.
98 dnl ## Check for library functions
100 dnl See Comment #Spoon
115 AC_CHECK_LIB(nsl, gethostbyname)
116 AC_CHECK_LIB(nsl, gethostname)
117 AC_CHECK_LIB(socket, socket)
118 AC_CHECK_LIB(resolv, sethostent)
120 AC_CHECK_FUNCS(inet_addr inet_network, break, [
121 AC_MSG_ERROR(inet_addr function not found)
128 AC_FUNC_SELECT_ARGTYPES
130 dnl Check if we'll actually need to cast select args all the time
131 if test "$ac_cv_func_select_arg1" != "int" \
132 -o "$ac_cv_func_select_arg234" != "fd_set *" \
133 -o "$ac_cv_func_select_arg5" != "struct timeval *" ; then
135 AC_DEFINE(SELECT_NEEDS_CAST,,
136 [Define if arguments to select() aren't what we expect])
139 dnl ## Checking command-line options
140 test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
141 EXTRA_CFLAGS="$EXTRA_CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
142 test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "y2" && \
143 EXTRA_CFLAGS="$EXTRA_CFLAGS -g -Wall -Werror -Wmissing-declarations"
146 APACHE_ENABLE_MODULES
149 INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include"
150 if test -n "$USE_VPATH"; then
151 INCLUDES="$INCLUDES -I\$(top_builddir)/include -I\$(top_builddir)/lib/apr/include"
154 dnl reading config stubs
155 esyscmd(./helpers/config-stubs .)
157 INCLUDES="$INCLUDES -I\$(top_srcdir)/os/\$(OS_DIR)"
158 EXTRA_LIBS="$EXTRA_LIBS $LIBS"
159 EXTRA_LDFLAGS="$LDFLAGS"
162 APACHE_SUBST(progname)
163 APACHE_SUBST(EXTRA_CFLAGS)
164 APACHE_SUBST(EXTRA_LDFLAGS)
165 APACHE_SUBST(EXTRA_LIBS)
166 APACHE_SUBST(INCLUDES)
167 APACHE_SUBST(MPM_LIB)
170 APACHE_SUBST(BUILTIN_LIBS)
175 APACHE_LIBTOOL_SILENT
177 if test "$apache_need_shared" = "yes"; then
178 $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
181 AC_ARG_WITH(program-name,
182 [ --with-program-name=alternate executable name],[
183 progname="$withval" ], [
186 APACHE_FAST_OUTPUT(Makefile ap/Makefile lib/Makefile main/Makefile
187 modules/Makefile os/Makefile support/Makefile)
191 dnl There needs to be a .deps file in the top build directory.
192 dnl All others are created dynamically by rules.mk.
196 dnl ## Build modules.c
197 rm -f $srcdir/modules.c
198 echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c
201 echo '/* Generated by configure */' > ${path_h}.new
202 echo "#define HTTPD_ROOT \"$prefix\"" >> ${path_h}.new
203 echo "#define SUEXEC_BIN \"$bindir/suexec\"" >> ${path_h}.new
204 echo "#define SERVER_CONFIG_FILE \"conf/$progname.conf\"" >> ${path_h}.new
206 cmp ${path_h}.new ${path_h} >/dev/null 2>&1
207 if test $? -ne 0 ; then
208 rm -f ${path_h} && mv ${path_h}.new ${path_h} && \
209 echo "Updated ${path_h}"
211 rm -f ${path_h}.new && \
212 echo "${path_h} unchanged"
215 path_h=./include/ap_config_path.h
217 exec_prefix=$exec_prefix
222 perlbin=`./helpers/PrintPath perl`
225 AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs)