1 dnl ## Process this file with autoconf to produce a configure script
6 AC_CONFIG_HEADER(include/ap_config_auto.h)
9 dnl ## This is the central place where Apache's version should be kept.
10 dnl AM_INIT_AUTOMAKE(apache, 2.0-dev)
12 VERSION="apache-2.0-dev"
14 APACHE_VERSION=$VERSION
15 APACHE_SUBST(APACHE_VERSION)
17 test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
18 test "$prefix" = "NONE" && prefix='/usr/local'
20 dnl Absolute source/build directory
21 abs_srcdir=`(cd $srcdir && pwd)`
24 APACHE_CONFIG_NICE(config.nice)
26 dnl If the source dir is not equal to the build dir,
27 dnl then we are running in VPATH mode.
29 if test "$abs_builddir" != "$abs_srcdir"; then
34 dnl ## Preload our OS configuration
37 dnl ## Check for programs
45 dnl AC_PATH_PROG(PERL_PATH, perl)
49 dnl various OS checks that apparently set required flags
54 dnl ## Check for libraries
56 dnl ## Check for header files
58 dnl I think these are just used all over the place, so just check for
59 dnl them at the base of the tree. If some are specific to a single
60 dnl directory, they should be moved (Comment #Spoon)
62 dnl Regarding standard header files: AC_HEADER_STDC doesn't set symbols
63 dnl HAVE_STRING_H, HAVE_STDLIB_H, etc., so those are checked for
64 dnl explicitly so that the normal HAVE_xxx_H symbol is defined.
86 dnl ## Check for typedefs, structures, and compiler characteristics.
90 dnl ## Check for library functions
92 dnl See Comment #Spoon
98 AC_CHECK_LIB(nsl, gethostbyname)
99 AC_CHECK_LIB(nsl, gethostname)
100 AC_CHECK_LIB(socket, socket)
101 AC_CHECK_LIB(resolv, sethostent)
107 AC_ARG_WITH(optim,[ --with-optim="FLAGS" compiler optimisation flags],
110 AC_ARG_WITH(port,[ --with-port=PORT Port on which to listen (default is 80)],
114 AC_ARG_WITH(debug,[ --with-debug Turn on debugging and compile time warnings],
115 [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi])
117 AC_ARG_WITH(maintainer-mode,[ --with-maintainer-mode Turn on debugging and compile time warnings],
118 [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DAP_DEBUG"; else CFLAGS="$CFLAGS -g"; fi])
121 APACHE_ENABLE_MODULES
124 INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include"
125 if test -n "$USE_VPATH"; then
126 INCLUDES="$INCLUDES -I\$(top_builddir)/include -I\$(top_builddir)/lib/apr/include"
129 dnl reading config stubs
130 esyscmd(./helpers/config-stubs .)
132 INCLUDES="$INCLUDES -I\$(top_srcdir)/os/\$(OS_DIR)"
133 EXTRA_LIBS="$EXTRA_LIBS $LIBS"
134 EXTRA_LDFLAGS="$LDFLAGS"
137 APACHE_SUBST(progname)
138 APACHE_SUBST(EXTRA_CFLAGS)
139 APACHE_SUBST(EXTRA_LDFLAGS)
140 APACHE_SUBST(EXTRA_LIBS)
141 APACHE_SUBST(INCLUDES)
142 APACHE_SUBST(MPM_LIB)
145 APACHE_SUBST(BUILTIN_LIBS)
150 APACHE_LIBTOOL_SILENT
152 if test "$apache_need_shared" = "yes"; then
153 $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
156 AC_ARG_WITH(program-name,
157 [ --with-program-name=alternate executable name],[
158 progname="$withval" ], [
161 dnl ### util_xml is always included, so we always need Expat (for now)
162 apache_need_expat=yes
164 dnl AP_LIB_DIRS specifies the additional libs from src/lib/ that we need
165 dnl AP_LIBS specifies the actual libraries. note we have two required libs.
166 AP_LIBS="lib/apr/\$(LIBPRE)apr.a lib/pcre/libpcre.la"
167 if test "$apache_need_sdbm" = "yes"; then
168 AP_LIB_DIRS="$AP_LIB_DIRS sdbm"
169 AP_LIBS="$AP_LIBS lib/sdbm/libsdbm.la"
170 INCLUDES="$INCLUDES -I\$(top_srcdir)/lib/sdbm"
172 if test "$apache_need_expat" = "yes"; then
173 AP_LIB_DIRS="$AP_LIB_DIRS expat-lite"
174 AP_LIBS="$AP_LIBS lib/expat-lite/libexpat.la"
175 INCLUDES="$INCLUDES -I\$(top_srcdir)/lib/expat-lite"
177 APACHE_SUBST(AP_LIB_DIRS)
178 APACHE_SUBST(AP_LIBS)
180 dnl check for endianness
181 if test "$cross_compiling" = "no"; then
184 AC_DEFINE(AP_UNKNOWN_BYTE_ORDER,1,
185 [byte order is unknown due to cross-compilation])
188 APACHE_FAST_OUTPUT(Makefile ap/Makefile lib/Makefile main/Makefile)
189 APACHE_FAST_OUTPUT(modules/Makefile os/Makefile support/Makefile lib/pcre/Makefile)
190 for i in $AP_LIB_DIRS; do
191 APACHE_FAST_OUTPUT(lib/$i/Makefile)
194 dnl ## Run configure for packages Apache uses
195 dnl ## This has been placed at this location for a reason. This allows
196 dnl ## Apache to set some variable that APR needs (like whether to enable
197 dnl ## or disable threads), while still allowing APR to run and generate
198 dnl ## APRVARS before Apache generates it's Makefiles and the related files.
199 dnl ## This allows APR to detect libraries like dl and tell Apache that it
200 dnl ## needs to include or not include them.
201 RUN_SUBDIR_CONFIG_NOW(lib/apr)
204 APACHE_GEN_CONFIG_VARS
206 dnl There needs to be a .deps file in the top build directory.
207 dnl All others are created dynamically by rules.mk.
211 dnl ## Build modules.c
212 rm -f $srcdir/modules.c
213 echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c
216 echo '/* Generated by configure */' > ${path_h}.new
217 echo "#define HTTPD_ROOT \"$prefix\"" >> ${path_h}.new
218 echo "#define SUEXEC_BIN \"$bindir/suexec\"" >> ${path_h}.new
219 echo "#define SERVER_CONFIG_FILE \"conf/$progname.conf\"" >> ${path_h}.new
220 echo "#define APACHE_MPM_DIR \"$mpmdir\"" >> ${path_h}.new
222 cmp ${path_h}.new ${path_h} >/dev/null 2>&1
223 if test $? -ne 0 ; then
224 rm -f ${path_h} && mv ${path_h}.new ${path_h} && \
225 echo "Updated ${path_h}"
227 rm -f ${path_h}.new && \
228 echo "${path_h} unchanged"
231 path_h=./include/ap_config_path.h
233 exec_prefix=$exec_prefix
241 perlbin=`$srcdir/helpers/PrintPath perl`
244 AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs,,[