configure.in revision adc9a96eb3f2ee826dea80b7bc61273221c70139
842ae4bd224140319ae7feec1872b93dfd491143fieldingdnl ## Process this file with autoconf to produce a configure script
842ae4bd224140319ae7feec1872b93dfd491143fielding
842ae4bd224140319ae7feec1872b93dfd491143fieldingAC_PREREQ(2.13)
842ae4bd224140319ae7feec1872b93dfd491143fieldingAC_INIT(acinclude.m4)
842ae4bd224140319ae7feec1872b93dfd491143fielding
842ae4bd224140319ae7feec1872b93dfd491143fieldingAC_CONFIG_HEADER(include/ap_config_auto.h)
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcndAC_CONFIG_AUX_DIR(.)
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnddnl ## This is the central place where Apache's version should be kept.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnddnl AM_INIT_AUTOMAKE(apache, 2.0-dev)
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcndVERSION="apache-2.0-dev"
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcndAPACHE_VERSION=$VERSION
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcndAPACHE_SUBST(APACHE_VERSION)
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtest "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtest "$prefix" = "NONE" && prefix='/usr/local'
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingdnl Absolute source/build directory
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingabs_srcdir=`(cd $srcdir && pwd)`
7c1827557873d94e3a0323172837fca1c3b27f6cwroweabs_builddir=`pwd`
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingAPACHE_CONFIG_NICE(config.nice)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingdnl If the source dir is not equal to the build dir,
95db5a4aa11a83bd25a6e11b53dd62c0af243e92wrowednl then we are running in VPATH mode.
83bee7f569bee7534741915e173e6a7de9ddae81stoddard
7c1827557873d94e3a0323172837fca1c3b27f6cwroweif test "$abs_builddir" != "$abs_srcdir"; then
f6bd1c0924641e60dcc56cbaba27d3cb3ce4917erbb USE_VPATH=1
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingfi
c032b37ad682c1da5382258811e8e35a8ec0d78dwrowe
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingAC_CANONICAL_SYSTEM
95db5a4aa11a83bd25a6e11b53dd62c0af243e92wrowe
7b3590ada24130fe5d52ce7fbf98177e3d121a4cstoddarddnl
7c1827557873d94e3a0323172837fca1c3b27f6cwrowednl ## Preload our OS configuration
f6bd1c0924641e60dcc56cbaba27d3cb3ce4917erbbAPR_PRELOAD
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingAPACHE_PRELOAD
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
9c27402f770d7b03b1d145214507cd05bce287c4wrowednl
c2549f0b237ac86f3623a601a766969d805dbc2anddnl Process command line arguments. This is done early in the process so the
c2549f0b237ac86f3623a601a766969d805dbc2anddnl user can get feedback quickly in case of an error.
c2549f0b237ac86f3623a601a766969d805dbc2anddnl
c2549f0b237ac86f3623a601a766969d805dbc2andAPACHE_CHECK_DBM
c2549f0b237ac86f3623a601a766969d805dbc2and
c2549f0b237ac86f3623a601a766969d805dbc2anddnl ## Check for programs
c2549f0b237ac86f3623a601a766969d805dbc2and
c2549f0b237ac86f3623a601a766969d805dbc2andAC_PROG_AWK
c2549f0b237ac86f3623a601a766969d805dbc2andAC_PROG_CC
c032b37ad682c1da5382258811e8e35a8ec0d78dwroweAC_PROG_CPP
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingAC_PROG_INSTALL
95db5a4aa11a83bd25a6e11b53dd62c0af243e92wroweAC_PROG_LN_S
7b3590ada24130fe5d52ce7fbf98177e3d121a4cstoddardAC_CHECK_TOOL(RANLIB, ranlib, true)
7c1827557873d94e3a0323172837fca1c3b27f6cwrowednl AC_PATH_PROG(PERL_PATH, perl)
f6bd1c0924641e60dcc56cbaba27d3cb3ce4917erbb
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingREENTRANCY_FLAGS
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
dnl various OS checks that apparently set required flags
AC_AIX
AC_ISC_POSIX
AC_MINIX
dnl ## Check for libraries
dnl ## Check for header files
dnl I think these are just used all over the place, so just check for
dnl them at the base of the tree. If some are specific to a single
dnl directory, they should be moved (Comment #Spoon)
dnl Regarding standard header files: AC_HEADER_STDC doesn't set symbols
dnl HAVE_STRING_H, HAVE_STDLIB_H, etc., so those are checked for
dnl explicitly so that the normal HAVE_xxx_H symbol is defined.
AC_HEADER_STDC
AC_CHECK_HEADERS( \
string.h \
stdlib.h \
ctype.h \
limits.h \
unistd.h \
sys/time.h \
sys/types.h \
sys/socket.h \
netinet/in.h \
netinet/tcp.h \
arpa/inet.h \
netdb.h \
pwd.h \
grp.h \
strings.h
)
AC_HEADER_SYS_WAIT
dnl ## Check for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl ## Check for library functions
dnl See Comment #Spoon
AC_CHECK_FUNCS( \
initgroups \
)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(nsl, gethostname)
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(resolv, sethostent)
APACHE_EBCDIC
AC_ARG_WITH(optim,[ --with-optim="FLAGS" compiler optimisation flags],
[OPTIM="$withval"])
AC_ARG_WITH(port,[ --with-port=PORT Port on which to listen (default is 80)],
[PORT="$withval"],
[PORT=80])
AC_ARG_WITH(debug,[ --with-debug Turn on debugging and compile time warnings],
[if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi])
AC_ARG_WITH(maintainer-mode,[ --with-maintainer-mode Turn on debugging and compile time warnings],
[if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DAP_DEBUG"; else CFLAGS="$CFLAGS -g"; fi])
APACHE_ENABLE_LAYOUT
APACHE_ENABLE_MODULES
APACHE_ENABLE_SHARED
INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/srclib/apr/include"
if test -n "$USE_VPATH"; then
INCLUDES="$INCLUDES -I\$(top_builddir)/include -I\$(top_builddir)/srclib/apr/include"
fi
dnl reading config stubs
esyscmd(./build/config-stubs .)
INCLUDES="$INCLUDES -I\$(top_srcdir)/os/\$(OS_DIR)"
EXTRA_LIBS="$EXTRA_LIBS $LIBS"
EXTRA_LDFLAGS="$LDFLAGS"
LIBS=""
LDFLAGS=""
APACHE_SUBST(progname)
APACHE_SUBST(EXTRA_CFLAGS)
APACHE_SUBST(EXTRA_LDFLAGS)
APACHE_SUBST(EXTRA_LIBS)
APACHE_SUBST(INCLUDES)
APACHE_SUBST(MPM_LIB)
APACHE_SUBST(OS)
APACHE_SUBST(OS_DIR)
APACHE_SUBST(BUILTIN_LIBS)
APACHE_SUBST(LIBPRE)
AM_DISABLE_SHARED
AM_PROG_LIBTOOL
APACHE_LIBTOOL_SILENT
if test "$apache_need_shared" = "yes"; then
$SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
case $PLATFORM in
*os390)
CFLAGS="$CFLAGS -Wc,DLL,EXPORTALL"
;;
esac
fi
AC_ARG_WITH(program-name,
[ --with-program-name=alternate executable name],[
progname="$withval" ], [
progname="httpd"] )
dnl ### util_xml is always included, so we always need Expat (for now)
apache_need_expat=yes
dnl AP_LIB_DIRS specifies the additional libs from srclib/ that we need
dnl AP_LIBS specifies the actual libraries. note we have some required libs.
AP_LIBS="srclib/pcre/libpcre.la srclib/apr-util/libaprutil.la"
if test "$apache_need_sdbm" = "yes"; then
AP_LIB_DIRS="$AP_LIB_DIRS sdbm"
AP_LIBS="$AP_LIBS srclib/sdbm/libsdbm.la"
INCLUDES="$INCLUDES -I\$(top_srcdir)/srclib/sdbm"
fi
if test "$apache_need_expat" = "yes"; then
AP_LIB_DIRS="$AP_LIB_DIRS expat-lite"
AP_LIBS="$AP_LIBS srclib/expat-lite/libexpat.la"
INCLUDES="$INCLUDES -I\$(top_srcdir)/srclib/expat-lite"
fi
dnl APR should go after the other libs, so the right symbols can be picked up
AP_LIBS="$AP_LIBS srclib/apr/\$(LIBPRE)apr.a"
APACHE_SUBST(AP_LIB_DIRS)
APACHE_SUBST(AP_LIBS)
AC_DEFINE(AP_USING_AUTOCONF, 1,
[Using autoconf to configure Apache])
if test "$SINGLE_LISTEN_UNSERIALIZED_ACCEPT" = "1"; then
AC_DEFINE(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, 1,
[This platform doesn't suffer from the thundering herd problem])
fi
dnl check for endianness
if test "$cross_compiling" = "no"; then
AC_C_BIGENDIAN
else
AC_DEFINE(AP_UNKNOWN_BYTE_ORDER,1,
[byte order is unknown due to cross-compilation])
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(support/Makefile test/Makefile srclib/pcre/Makefile)
for i in $AP_LIB_DIRS; do
APACHE_FAST_OUTPUT(srclib/$i/Makefile)
done
dnl ## Run configure for packages Apache uses
dnl ## This has been placed at this location for a reason. This allows
dnl ## Apache to set some variable that APR needs (like whether to enable
dnl ## or disable threads), while still allowing APR to run and generate
dnl ## APRVARS before Apache generates it's Makefiles and the related files.
dnl ## This allows APR to detect libraries like dl and tell Apache that it
dnl ## needs to include or not include them.
RUN_SUBDIR_CONFIG_NOW(srclib/apr, $apache_apr_flags)
RUN_SUBDIR_CONFIG_NOW(srclib/apr-util, "--with-apr=../apr")
RUN_SUBDIR_CONFIG_NOW(srclib/pcre)
. ./srclib/apr/APRVARS
APACHE_GEN_CONFIG_VARS
dnl ## Build modules.c
rm -f modules.c
echo $MODLIST | $AWK -f $srcdir/build/build-modules-c.awk > modules.c
AC_OUTPUT_COMMANDS([
echo '/* Generated by configure */' > ${path_h}.new
echo "#define HTTPD_ROOT \"$prefix\"" >> ${path_h}.new
echo "#define SUEXEC_BIN \"$bindir/suexec\"" >> ${path_h}.new
echo "#define SERVER_CONFIG_FILE \"conf/$progname.conf\"" >> ${path_h}.new
echo "#define APACHE_MPM_DIR \"$mpmdir\"" >> ${path_h}.new
cmp ${path_h}.new ${path_h} >/dev/null 2>&1
if test $? -ne 0 ; then
rm -f ${path_h} && mv ${path_h}.new ${path_h} && \
echo "Updated ${path_h}"
else
rm -f ${path_h}.new && \
echo "${path_h} unchanged"
fi
],[
path_h=./include/ap_config_path.h
prefix=$prefix
exec_prefix=$exec_prefix
bindir=$bindir
progname=$progname
mpmdir=$MPM_DIR
])
AC_TYPE_RLIM_T
perlbin=`$srcdir/build/PrintPath perl`
AC_SUBST(perlbin)
dnl If we are running on BSD/OS, we need to use the BSD .include syntax.
BSD_MAKEFILE=no
case "$host_alias" in
*bsdi*)
BSD_MAKEFILE=yes;;
esac
AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs support/apachectl,,[
APACHE_GEN_MAKEFILES
])