blob: 7d31878520bc47f4aadb60a1718d53e864c02e42 [file] [log] [blame]
dnl
dnl Process this file with autoconf to produce a configure script
dnl
AC_PREREQ(2.50)
AC_INIT(export_vars.sh.in)
VERSION=2.08
AC_SUBST(VERSION)
AC_CONFIG_HEADER(include/apreq_config.h)
AC_CONFIG_AUX_DIR(build)
sinclude(build/apreq-conf.m4)
sinclude(build/apreq-hints.m4)
sinclude(build/apr_common.m4)
sinclude(build/find_apr.m4)
sinclude(build/find_apu.m4)
dnl Generate ./config.nice for reproducing runs of configure
dnl
APR_CONFIG_NICE(config.nice)
dnl # Some initial steps for configuration. We setup the default directory
dnl # and which files are to be configured.
dnl Absolute source/build directory
abs_srcdir=`(cd $srcdir && pwd)`
abs_builddir=`pwd`
if test "$abs_builddir" != "$abs_srcdir"; then
USE_VPATH=1
APREQ_CONFIG_LOCATION=build
else
APREQ_CONFIG_LOCATION=source
fi
AC_SUBST(APREQ_CONFIG_LOCATION)
AC_CANONICAL_SYSTEM
AC_PROG_INSTALL
dnl
dnl compute the top directory of the build
dnl note: this is needed for LIBTOOL and exporting the bundled Expat
dnl
top_builddir="$abs_builddir"
AC_SUBST(top_builddir)
AC_SUBST(abs_srcdir)
AC_SUBST(abs_builddir)
dnl Initialize mkdir -p functionality.
APR_MKDIR_P_CHECK($abs_srcdir/build/mkdir.sh)
dnl Enable the layout handling code, then reparse the prefix-style
dnl arguments due to autoconf being a PITA.
APR_ENABLE_LAYOUT(apreq)
APR_PARSE_ARGUMENTS
dnl load os-specific hints for apr-util
APREQ_PRELOAD
dnl
dnl set up the compilation flags and stuff
dnl
APREQ_INCLUDES=""
APREQ_PRIV_INCLUDES="-I$top_builddir/include -I$top_builddir/include/private"
if test -n "$USE_VPATH"; then
APREQ_PRIV_INCLUDES="$APRUTIL_PRIV_INCLUDES -I$abs_srcdir/include/private -I$abs_srcdir/include"
fi
dnl
dnl Find the APR includes directory and (possibly) the source (base) dir.
dnl
APREQ_FIND_APR
dnl
dnl even though we use apr_rules.mk for building apr-util, we need
dnl to grab CC and CPP ahead of time so that apr-util config tests
dnl use the same compiler as APR; we need the same compiler options
dnl and feature test macros as well
dnl
APR_SETIFNULL(CC, `$apr_config --cc`)
APR_SETIFNULL(CPP, `$apr_config --cpp`)
APR_ADDTO(CFLAGS, `$apr_config --cflags`)
APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`)
AC_SUBST(CPP)
APREQ_FIND_APU
dnl get our version information
get_version="$abs_srcdir/build/get-version.sh"
version_hdr="$abs_srcdir/include/apreq_version.h"
APREQ_MAJOR_VERSION="`$get_version major $version_hdr APREQ`"
APREQ_MINOR_VERSION="`$get_version minor $version_hdr APREQ`"
APREQ_PATCH_VERSION="`$get_version patch $version_hdr APREQ`"
APREQ_DOTTED_VERSION="`$get_version all $version_hdr APREQ`"
APR_MAJOR_VERSION="`$apr_config --version | cut -f1 -d.`"
APREQ_LIBTOOL_VERSION="`expr $APREQ_MAJOR_VERSION + $APREQ_MINOR_VERSION + $APR_MAJOR_VERSION`:$APREQ_PATCH_VERSION:$APREQ_MINOR_VERSION"
AC_SUBST(APREQ_DOTTED_VERSION)
AC_SUBST(APREQ_LIBTOOL_VERSION)
AC_SUBST(APREQ_MAJOR_VERSION)
AC_SUBST(APREQ_MINOR_VERSION)
AC_SUBST(APREQ_PATCH_VERSION)
echo "APREQ Version: ${APREQ_DOTTED_VERSION}"
so_ext=$APR_SO_EXT
lib_target=$APR_LIB_TARGET
AC_SUBST(so_ext)
AC_SUBST(lib_target)
APREQ_LIBNAME="apreq2"
AC_SUBST(APREQ_LIBNAME)
dnl
dnl Prep all the flags and stuff for compilation and export to other builds
dnl
APR_ADDTO(APREQ_LIBS, [$APR_LIBS])
APR_ADDTO(APREQ_LIBS, [$APU_LIBS])
AC_SUBST(APREQ_EXPORT_LIBS)
AC_SUBST(APREQ_PRIV_INCLUDES)
AC_SUBST(APREQ_INCLUDES)
AC_SUBST(APREQ_LDFLAGS)
AC_SUBST(APREQ_LIBS)
AC_SUBST(LDFLAGS)
dnl copy apr's rules.mk into our build directory.
if test ! -d ./build; then
$mkdir_p build
fi
cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk
dnl
dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
dnl
case "$host_alias" in
*bsdi* | BSD/OS)
# Check whether they've installed GNU make
if make --version > /dev/null 2>&1; then
INCLUDE_RULES="include $abs_builddir/build/rules.mk"
INCLUDE_OUTPUTS="include $abs_srcdir/build-outputs.mk"
else
INCLUDE_RULES=".include \"$abs_builddir/build/rules.mk\""
INCLUDE_OUTPUTS=".include \"$abs_srcdir/build-outputs.mk\""
fi
;;
*)
INCLUDE_RULES="include $abs_builddir/build/rules.mk"
INCLUDE_OUTPUTS="include $abs_srcdir/build-outputs.mk"
;;
esac
AC_SUBST(INCLUDE_RULES)
AC_SUBST(INCLUDE_OUTPUTS)
for d in include include/private; do
test -d $top_builddir/$d || mkdir $top_builddir/$d
done
AC_CONFIG_FILES([Makefile export_vars.sh apreq2-config])
AC_CONFIG_COMMANDS([default], [chmod +x apreq2-config])
AC_OUTPUT