Commit 2171d100 authored by Justin Erenkrantz's avatar Justin Erenkrantz
Browse files

First pass at trying to standardize httpd-2.0's usage of APR and APR-util

so that they can be separated - use an installed APR and APR-util with
httpd-2.0.  This is not expected to achieve full separation, but is
merely the first step in the process.  The tree should still be buildable
in the source-only case.

This commit does the following things:
- Use the standard find_apr.m4 and find_apu.m4 m4 macro files that flood and
  Subversion already use for locating APR and APR-util.  This adds the
  --with-apr and --with-apr-util configure options.
- Stop using APRVARS and export_vars.sh.
- Use apr-config and apu-config to determine dependencies.
- Add AP_BUILD_SRCLIB_DIRS and AP_CLEAN_SRCLIB_DIRS values (names stink)
  to dynamically figure out what subdirs in srclib we will build.
  (What we really want to do is set one value - go L->R on build and
   R->L on clean.  I can't think of a way to do this.)
- If we are using APR and APR-util that are already installed, don't
  specify them in srclib.  (This still needs some work I bet.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95061 13f79535-47bb-0310-9956-ffa450edef68
parent 3f11aed0
Loading
Loading
Loading
Loading
+35 −26
Changes for configure.in: 35 added lines, 26 removed lines.
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@ dnl #
sinclude(srclib/apr/build/apr_common.m4)
sinclude(srclib/apr/build/apr_network.m4)
sinclude(srclib/apr/build/apr_threads.m4)
sinclude(srclib/apr/build/find_apr.m4)
sinclude(srclib/apr-util/build/find_apu.m4)
sinclude(acinclude.m4)

dnl XXX we can't just use AC_PREFIX_DEFAULT because that isn't subbed in
@@ -61,11 +63,40 @@ orig_prefix="$prefix"

echo $ac_n "${nl}Configuring Apache Portable Runtime library ...${nl}"

APR_FIND_APR("$srcdir/srclib/apr", "./srclib/apr")

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")
  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_ADDTO(CFLAGS, `$apr_config --cflags`)
APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`)
APR_ADDTO(LDFLAGS, `$apr_config --ldflags`)

echo $ac_n "${nl}Configuring Apache Portable Runtime Utility library...${nl}"

APR_FIND_APU("$srcdir/srclib/apr-util", "./srclib/apr-util")

if test "$apu_found" = "no"; then
  AC_MSG_ERROR([APR-util not found.  Please read the documentation.])
fi

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")
  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

APR_ADDTO(LDFLAGS, `$apu_config --ldflags`)
APR_ADDTO(INCLUDES, `$apu_config --includes`)

echo $ac_n "${nl}Configuring PCRE regular expression library ...${nl}"

@@ -73,23 +104,6 @@ APR_SUBDIR_CONFIG(srclib/pcre, "--prefix=$prefix --exec-prefix=$exec_prefix --li

echo $ac_n "${nl}Configuring Apache httpd ...${nl}"

echo $ac_n "obtaining flag settings from the sub-configures...${nl}"
. ./srclib/apr/APRVARS

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=

dnl Absolute source/build directory
abs_srcdir=`(cd $srcdir && pwd)`
abs_builddir=`pwd`
@@ -389,11 +403,13 @@ APACHE_HELP_STRING(--with-suexec-umask,umask for suexec'd process),[
  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])
@@ -429,13 +445,6 @@ 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}"

+2 −2
Changes for srclib/Makefile.in: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line

SUBDIRS = pcre
BUILD_SUBDIRS = apr apr-util
CLEAN_SUBDIRS = apr-util apr
BUILD_SUBDIRS = $(AP_BUILD_SRCLIB_DIRS)
CLEAN_SUBDIRS = $(AP_CLEAN_SRCLIB_DIRS)

include $(top_builddir)/build/rules.mk