AC_INIT(ABOUT_APACHE)
AC_CONFIG_HEADER(include/ap_config_auto.h)
-AC_CONFIG_AUX_DIR(srclib/apr/build)
+AC_CONFIG_AUX_DIR(build)
dnl #
dnl # Include our own M4 macros along with those for APR and libtool
dnl #
-sinclude(srclib/apr/build/apr_common.m4)
-sinclude(srclib/apr/build/apr_network.m4)
-sinclude(srclib/apr/build/apr_threads.m4)
+sinclude(build/apr_common.m4)
+sinclude(build/find_apr.m4)
+sinclude(build/find_apu.m4)
sinclude(acinclude.m4)
+dnl XXX we can't just use AC_PREFIX_DEFAULT because that isn't subbed in
+dnl by configure until it is too late. Is that how it should be or not?
+dnl Something seems broken here.
+AC_PREFIX_DEFAULT(/usr/local/apache2)
+
+dnl Get the layout here, so we can pass the required variables to apr
+APR_ENABLE_LAYOUT(Apache, [errordir iconsdir htdocsdir cgidir])
+
+dnl reparse the configure arguments.
+APR_PARSE_ARGUMENTS
+
+dnl export expanded and relative configure argument variables
+APACHE_EXPORT_ARGUMENTS
+
dnl Save user-defined environment settings for later restoration
dnl
APR_SAVE_THE_ENVIRONMENT(CPPFLAGS)
nl='
'
-
-dnl XXX we can't just use AC_PREFIX_DEFAULT because that isn't subbed in
-dnl by configure until it is too late. Is that how it should be or not?
-dnl Something seems broken here.
-AC_PREFIX_DEFAULT(/usr/local/apache2)
-test "$prefix" = "NONE" && prefix='/usr/local/apache2'
-test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
+dnl Check that mkdir -p works
+APR_MKDIR_P_CHECK($top_srcdir/build/mkdir.sh)
dnl ## Run configure for packages Apache uses
echo $ac_n "${nl}Configuring Apache Portable Runtime library ...${nl}"
-APR_SUBDIR_CONFIG(srclib/apr, "$apache_apr_flags --prefix=$prefix")
+APR_FIND_APR("$srcdir/srclib/apr", "./srclib/apr", 1)
+
+if test "$apr_found" = "no"; then
+ AC_MSG_ERROR([APR not found. Please read the documentation.])
+fi
+
+if test "$apr_found" = "reconfig"; then
+ APR_SUBDIR_CONFIG(srclib/apr,
+ [$apache_apr_flags --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir --datadir=$datadir --with-installbuilddir=$installbuilddir],
+ [--enable-layout=*|\'--enable-layout=*])
+ dnl We must be the first to build and the last to be cleaned
+ AP_BUILD_SRCLIB_DIRS="apr $AP_BUILD_SRCLIB_DIRS"
+ AP_CLEAN_SRCLIB_DIRS="$AP_CLEAN_SRCLIB_DIRS apr"
+fi
+
+APR_SETIFNULL(CC, `$apr_config --cc`)
+APR_SETIFNULL(CPP, `$apr_config --cpp`)
+APR_ADDTO(CFLAGS, `$apr_config --cflags`)
+APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`)
+APR_ADDTO(LDFLAGS, `$apr_config --ldflags`)
+APR_ADDTO(INCLUDES, `$apr_config --includes`)
+SHLIBPATH_VAR=`$apr_config --shlib-path-var`
+APR_BINDIR=`$apr_config --bindir`
+APR_INCLUDEDIR=`$apr_config --includedir`
echo $ac_n "${nl}Configuring Apache Portable Runtime Utility library...${nl}"
-APR_SUBDIR_CONFIG(srclib/apr-util, "--with-apr=../apr --prefix=$prefix")
+APR_FIND_APU("$srcdir/srclib/apr-util", "./srclib/apr-util", 1)
-echo $ac_n "${nl}Configuring PCRE regular expression library ...${nl}"
+if test "$apu_found" = "no"; then
+ AC_MSG_ERROR([APR-util not found. Please read the documentation.])
+fi
-APR_SUBDIR_CONFIG(srclib/pcre, "--prefix=$prefix")
+if test "$apu_found" = "reconfig"; then
+ APR_SUBDIR_CONFIG(srclib/apr-util,
+ [--with-apr=../apr --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir],
+ [--enable-layout=*|\'--enable-layout=*])
+ dnl We must be the last to build and the first to be cleaned
+ AP_BUILD_SRCLIB_DIRS="$AP_BUILD_SRCLIB_DIRS apr-util"
+ AP_CLEAN_SRCLIB_DIRS="apr-util $AP_CLEAN_SRCLIB_DIRS"
+fi
-echo $ac_n "${nl}Configuring Apache httpd ...${nl}"
+APR_ADDTO(LDFLAGS, `$apu_config --ldflags`)
+APR_ADDTO(INCLUDES, `$apu_config --includes`)
+APU_BINDIR=`$apu_config --bindir`
+APU_INCLUDEDIR=`$apu_config --includedir`
+
+dnl In case we picked up CC and CPP from APR, get that info into the
+dnl config cache so that PCRE uses it. Otherwise, CC and CPP used for
+dnl PCRE and for our config tests will be whatever PCRE determines.
+AC_PROG_CC
+AC_PROG_CPP
-echo $ac_n "obtaining flag settings from the sub-configures...${nl}"
-. ./srclib/apr/APRVARS
+echo $ac_n "${nl}Configuring PCRE regular expression library ...${nl}"
-dnl Now that we have APR's EXTRA_flags in our environment, move them over
-dnl to the normal variables to avoid duplications and use them for testing.
-dnl We ignore EXTRA_INCLUDES because our own includes will encompass them.
-dnl
-APR_ADDTO(CFLAGS, $EXTRA_CFLAGS)
-APR_ADDTO(CPPFLAGS, $EXTRA_CPPFLAGS)
-APR_ADDTO(LDFLAGS, $EXTRA_LDFLAGS)
-APR_ADDTO(LIBS, $EXTRA_LIBS)
-EXTRA_CFLAGS=
-EXTRA_CPPFLAGS=
-EXTRA_LDFLAGS=
-EXTRA_LIBS=
-EXTRA_INCLUDES=
+APR_SUBDIR_CONFIG(srclib/pcre,
+ [--prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir])
+
+echo $ac_n "${nl}Configuring Apache httpd ...${nl}"
dnl Absolute source/build directory
abs_srcdir=`(cd $srcdir && pwd)`
dnl If the source dir is not equal to the build dir,
dnl then we are running in VPATH mode.
+APR_ADDTO(INCLUDES, [-I.])
+
if test "$abs_builddir" != "$abs_srcdir"; then
USE_VPATH=1
- APR_ADDTO(INCLUDES, [-I. -I\$(srcdir) -I\$(top_builddir)/os/\$(OS_DIR) -I\$(top_srcdir)/os/\$(OS_DIR) -I\$(top_builddir)/server/mpm/\$(MPM_NAME) -I\$(top_srcdir)/server/mpm/\$(MPM_NAME) -I\$(top_builddir)/modules/http -I\$(top_srcdir)/modules/http -I\$(top_srcdir)/modules/proxy -I\$(top_builddir)/include -I\$(top_srcdir)/include -I\$(top_builddir)/srclib/apr/include -I\$(top_srcdir)/srclib/apr/include -I\$(top_builddir)/srclib/apr-util/include -I\$(top_srcdir)/srclib/apr-util/include])
-else
- APR_ADDTO(INCLUDES, [-I. -I\$(top_srcdir)/os/\$(OS_DIR) -I\$(top_srcdir)/server/mpm/\$(MPM_NAME) -I\$(top_srcdir)/modules/http -I\$(top_srcdir)/modules/proxy -I\$(top_srcdir)/include -I\$(top_srcdir)/srclib/apr/include -I\$(top_srcdir)/srclib/apr-util/include])
+ APR_ADDTO(INCLUDES, [-I\$(srcdir) -I\$(top_builddir)/server/mpm/\$(MPM_SUBDIR_NAME) -I\$(top_builddir)/include])
fi
+APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/os/\$(OS_DIR) -I\$(top_srcdir)/server/mpm/\$(MPM_SUBDIR_NAME) -I\$(top_srcdir)/modules/http -I\$(top_srcdir)/modules/filters -I\$(top_srcdir)/modules/proxy -I\$(top_srcdir)/include])
+
echo $ac_n "${nl}Applying OS-specific hints for httpd ...${nl}"
case $host in
if test "x$LTFLAGS" = "x"; then
LTFLAGS='--silent'
fi
- LIBTOOL='$(SHELL) $(top_builddir)/srclib/apr/libtool $(LTFLAGS)'
- libtoolversion=`$abs_builddir/srclib/apr/libtool --version`
+ my_libtool=`$apr_config --apr-libtool`
+ LIBTOOL="$my_libtool \$(LTFLAGS)"
+ libtoolversion=`$my_libtool --version`
case $libtoolversion in
- *1.4*)
+ *1.[[45]]*)
SH_LIBTOOL='$(LIBTOOL)'
SHLTCFLAGS="-prefer-pic"
LTCFLAGS="-prefer-non-pic -static"
APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
;;
*-solaris2*)
- dnl This is a hack -- we should be using AC_TRY_RUN instead
+ dnl This is a hack -- we should be using AC_TRY_RUN instead
ap_platform_runtime_link_flag="-R"
+ dnl solaris 8 and above don't have a thundering herd
+ dnl not sure about rev's before this one.
+ case `uname -r` in
+ 5.[567]*)
+ ;;
+ * )
+ APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
+ ;;
+ esac
;;
*cygwin*)
APR_SETVAR(APACHE_MPM, [prefork])
APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
;;
+ *aix*)
+ aixver=`echo $host | sed 's/^[[^0-9]]*//' | sed 's/\.//g'`
+ if test $aixver -ge 4320; then
+ APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
+ fi
+ ;;
+ *os390*)
+ APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
+ ;;
esac
dnl
AC_PATH_PROG(RM, rm)
AC_PROG_AWK
-AC_PROG_CC
-AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_CHECK_TOOL(RANLIB, ranlib, true)
dnl AC_PATH_PROG(PERL_PATH, perl)
+AC_CHECK_PROGS(LYNX_PATH,[lynx links elinks], [lynx])
dnl various OS checks that apparently set required flags
AC_AIX
AC_ISC_POSIX
AC_MINIX
+dnl Check for what we can generate dependency files with
+APR_CHECK_DEPEND
+
dnl ## Check for libraries
dnl ## Check for header files
pwd.h \
grp.h \
strings.h \
+sys/prctl.h \
sys/processor.h \
sys/sem.h
)
getgrnam \
initgroups \
bindprocessor \
+prctl \
timegm \
)
case $host in
*aix*)
# for 32-bit builds, increase MAXDATA to allow lots of threads
- if test x$COMPILE_MODE != 64; then
- OS_SPECIFIC_VARS="set LDR_CNTRL=\"MAXDATA=0x80000000\" ; export LDR_CNTRL ;"
+ if test x$OBJECT_MODE != x64; then
+ OS_SPECIFIC_VARS="LDR_CNTRL=\"MAXDATA=0x80000000\" ; export LDR_CNTRL ;"
fi
- OS_SPECIFIC_VARS="$OS_SPECIFIC_VARS set AIXTHREAD_SCOPE=S ; export AIXTHREAD_SCOPE"
+ OS_SPECIFIC_VARS="$OS_SPECIFIC_VARS AIXTHREAD_SCOPE=S ; export AIXTHREAD_SCOPE"
+ OS_SPECIFIC_VARS="$OS_SPECIFIC_VARS ; AIXTHREAD_MUTEX_DEBUG=OFF ; export AIXTHREAD_MUTEX_DEBUG"
+ OS_SPECIFIC_VARS="$OS_SPECIFIC_VARS ; AIXTHREAD_RWLOCK_DEBUG=OFF ; export AIXTHREAD_RWLOCK_DEBUG"
+ OS_SPECIFIC_VARS="$OS_SPECIFIC_VARS ; AIXTHREAD_COND_DEBUG=OFF ; export AIXTHREAD_COND_DEBUG"
+ OS_SPECIFIC_VARS="$OS_SPECIFIC_VARS ; SPINLOOPTIME=1000 ; export SPINLOOPTIME"
+ OS_SPECIFIC_VARS="$OS_SPECIFIC_VARS ; YIELDLOOPTIME=8 ; export YIELDLOOPTIME"
+ OS_SPECIFIC_VARS="$OS_SPECIFIC_VARS ; MALLOCMULTIHEAP=considersize,heaps:8 ; export MALLOCMULTIHEAP"
;;
*os390*)
OS_SPECIFIC_VARS="export _CEE_RUNOPTS=\"STACK(,,ANY)\" ; export _EDC_ADD_ERRNO2=1"
[if test "$withval" = "yes"; then AC_MSG_ERROR('option --with-port requires a value (the TCP port number)'); else PORT="$withval"; fi],
[PORT=80])
+APR_CHECK_APR_DEFINE(APR_HAVE_IPV6)
+
+AC_ARG_ENABLE(v4-mapped,APACHE_HELP_STRING(--enable-v4-mapped,Allow IPv6 sockets to handle IPv4 connections),
+[
+ v4mapped=$enableval
+],
+[
+ case $host in
+ *freebsd5*|*netbsd*|*openbsd*)
+ v4mapped=no
+ ;;
+ *)
+ v4mapped=yes
+ ;;
+esac
+])
+
+if test $v4mapped = "yes" -o $ac_cv_define_APR_HAVE_IPV6 = "no"; then
+ nonssl_listen_stmt_1=""
+ nonssl_listen_stmt_2="Listen @@Port@@"
+ if test $ac_cv_define_APR_HAVE_IPV6 = "yes"; then
+ AC_DEFINE(AP_ENABLE_V4_MAPPED, 1,
+ [Allow IPv4 connections on IPv6 listening sockets])
+ fi
+else
+ nonssl_listen_stmt_1="Listen 0.0.0.0:@@Port@@"
+ nonssl_listen_stmt_2="Listen [[::]]:@@Port@@"
+fi
+
AC_ARG_ENABLE(maintainer-mode,APACHE_HELP_STRING(--enable-maintainer-mode,Turn on debugging and compile time warnings),
[
APR_ADDTO(CPPFLAGS, -DAP_DEBUG)
])dnl
-APACHE_ENABLE_LAYOUT
prefix="$orig_prefix"
APACHE_ENABLE_MODULES
AC_DEFINE_UNQUOTED(AP_SUEXEC_UMASK, 0$withval, [umask for suexec'd process] ) ] )
dnl AP_LIBS specifies the actual libraries. note we have some required libs.
-AP_LIBS="$abs_builddir/srclib/pcre/libpcre.la $abs_builddir/srclib/apr-util/libaprutil.la $AP_LIBS"
+AP_LIBS="$abs_builddir/srclib/pcre/libpcre.la $AP_LIBS"
dnl APR should go after the other libs, so the right symbols can be picked up
-AP_LIBS="$AP_LIBS $abs_builddir/srclib/apr/libapr.la"
+AP_LIBS="$AP_LIBS `$apu_config --link-libtool --libs` `$apr_config --link-libtool --libs`"
APACHE_SUBST(AP_LIBS)
+APACHE_SUBST(AP_BUILD_SRCLIB_DIRS)
+APACHE_SUBST(AP_CLEAN_SRCLIB_DIRS)
AC_DEFINE(AP_USING_AUTOCONF, 1,
[Using autoconf to configure Apache])
fi
APACHE_FAST_OUTPUT(Makefile modules/Makefile srclib/Makefile)
-APACHE_FAST_OUTPUT(os/beos/Makefile os/os2/Makefile os/Makefile)
-APACHE_FAST_OUTPUT(os/unix/Makefile server/Makefile)
+APACHE_FAST_OUTPUT(os/Makefile server/Makefile)
APACHE_FAST_OUTPUT(support/Makefile srclib/pcre/Makefile)
if test -d ./test; then
APACHE_FAST_OUTPUT(test/Makefile)
fi
-dnl get the exported vars from APRUTIL
-. ./srclib/apr-util/export_vars.sh
-APR_ADDTO(LIBS, $APRUTIL_EXPORT_LIBS)
-APR_ADDTO(INCLUDES, $APRUTIL_EXPORT_INCLUDES)
-APR_ADDTO(LDFLAGS, $APRUTIL_LDFLAGS)
-AP_LIBS="$AP_LIBS $LIBTOOL_LIBS"
-
dnl ## Finalize the variables
echo $ac_n "${nl}Restore user-defined environment settings...${nl}"
rm -f modules.c
echo $MODLIST | $AWK -f $srcdir/build/build-modules-c.awk > modules.c
-AC_DEFINE_UNQUOTED(HTTPD_ROOT, "$prefix",
+APR_EXPAND_VAR(ap_prefix, $prefix)
+AC_DEFINE_UNQUOTED(HTTPD_ROOT, "${ap_prefix}",
[Root directory of the Apache install area])
-AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "conf/$progname.conf",
+AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${rel_sysconfdir}/${progname}.conf",
[Location of the config file, relative to the Apache root directory])
+AC_DEFINE_UNQUOTED(AP_TYPES_CONFIG_FILE, "${rel_sysconfdir}/mime.types",
+ [Location of the MIME types config file, relative to the Apache root directory])
AC_DEFINE_UNQUOTED(APACHE_MPM_DIR, "$MPM_DIR",
[Location of the source for the current MPM])
dnl If we are running on BSD/OS, we need to use the BSD .include syntax.
BSD_MAKEFILE=no
+ap_make_include=include
+ap_make_delimiter=' '
case $host in
*bsdi*)
# Check whether they've installed GNU make
true
else
BSD_MAKEFILE=yes
+ ap_make_include=.include
+ ap_make_delimiter='"'
fi
;;
esac
+AC_SUBST(ap_make_include)
+AC_SUBST(ap_make_delimiter)
+
+dnl Ensure that docs/conf is created.
+test -d docs/conf||$mkdir_p docs/conf
-AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs support/apachectl support/dbmmanage support/envvars-std support/log_server_status support/logresolve.pl support/phf_abuse_log.cgi support/split-logfile build/rules.mk,[true],[
+AC_OUTPUT($APACHE_OUTPUT_FILES docs/conf/httpd-std.conf docs/conf/ssl-std.conf include/ap_config_layout.h support/apxs support/apachectl support/dbmmanage support/envvars-std support/log_server_status support/logresolve.pl support/phf_abuse_log.cgi support/split-logfile build/rules.mk,[true],[
APACHE_GEN_MAKEFILES
])