| dnl |
| dnl Process this file with autoconf to produce a configure script |
| dnl |
| |
| AC_PREREQ(2.13) |
| AC_INIT(export_vars.sh.in) |
| |
| AC_CONFIG_HEADER(include/private/apu_config.h) |
| AC_CONFIG_AUX_DIR(../apr/build) |
| |
| sinclude(build/apu-conf.m4) |
| sinclude(../apr/build/apr_common.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 |
| fi |
| |
| 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) |
| |
| dnl |
| dnl set up the compilation flags and stuff |
| dnl |
| APR_ADDTO(INCLUDES, [-I\$(top_builddir)/include/private -I\$(top_builddir)/include]) |
| |
| if test -n "$USE_VPATH"; then |
| APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/include]) |
| fi |
| |
| dnl |
| dnl 1. Find the APR includes directory and (possibly) the source (base) dir. |
| dnl 2. Determine what DBM backend type to use. |
| dnl 3. Find Expat |
| dnl |
| APU_FIND_APR |
| APU_FIND_LDAP |
| APU_CHECK_DBM |
| APU_FIND_EXPAT |
| |
| dnl Add in the INCLUDES from APR |
| APR_ADDTO(INCLUDES, [$APR_INCLUDES]) |
| dnl Add in the Includes from APR-UTIL |
| APR_ADDTO(INCLUDES, [$APRUTIL_INCLUDES]) |
| so_ext=$APR_SO_EXT |
| lib_target=$APR_LIB_TARGET |
| AC_SUBST(so_ext) |
| AC_SUBST(lib_target) |
| |
| EXTRA_OS_LINK="" |
| host_alias=`uname -s` |
| case "$host_alias" in |
| *BeOS*) |
| # Horrible Hack !!! |
| # if we're building on BeOS then we need to add in the |
| # apr and expat libraries to the build... Grrrr... |
| EXTRA_OS_LINK="$APR_BUILD_DIR/libapr.la $top_builddir/xml/expat/lib/libexpat.la" |
| ;; |
| *) |
| ;; |
| esac |
| |
| AC_SUBST(EXTRA_OS_LINK) |
| |
| dnl |
| dnl Prep all the flags and stuff for compilation and export to other builds |
| dnl |
| APR_ADDTO(CFLAGS, [$CFLAGS $INCLUDES $APR_EXPORT_CFLAGS $APR_EXPORT_CPPFLAGS]) |
| APR_ADDTO(LIBS, [$APR_EXPORT_LIBS]) |
| APR_ADDTO(INCLUDES, [$APRUTIL_INCLUDES]) |
| |
| AC_SUBST(APRUTIL_EXPORT_LIBS) |
| AC_SUBST(APRUTIL_INCLUDES) |
| AC_SUBST(APRUTIL_LDFLAGS) |
| AC_SUBST(LDFLAGS) |
| APR_ADDTO(LIBS,[$APRUTIL_EXPORT_LIBS]) |
| |
| 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 $APR_BUILD_DIR/build/rules.mk" |
| else |
| INCLUDE_RULES=".include \"$APR_BUILD_DIR/build/rules.mk\"" |
| fi |
| ;; |
| *) |
| INCLUDE_RULES="include $APR_BUILD_DIR/build/rules.mk" |
| ;; |
| esac |
| AC_SUBST(INCLUDE_RULES) |
| |
| if test -d ./test; then |
| test_Makefile="test/Makefile" |
| fi |
| |
| if test ! -d "$top_builddir/include/private"; then |
| mkdir $top_builddir/include |
| mkdir $top_builddir/include/private |
| fi |
| |
| dnl |
| dnl everthing is done. |
| MAKEFILES="Makefile buckets/Makefile crypto/Makefile dbm/Makefile dbm/sdbm/Makefile encoding/Makefile hooks/Makefile ldap/Makefile uri/Makefile xml/Makefile misc/Makefile $test_Makefile" |
| AC_OUTPUT([ |
| export_vars.sh |
| apu-config |
| include/private/apu_select_dbm.h |
| include/apr_ldap.h |
| include/apu.h |
| $MAKEFILES |
| ]) |
| |
| chmod +x apu-config |