2 dnl Process this file with autoconf to produce a configure script
6 AC_INIT(export_vars.sh.in)
8 AC_CONFIG_HEADER(include/private/apu_config.h)
9 AC_CONFIG_AUX_DIR(build)
11 sinclude(build/apu-conf.m4)
12 sinclude(build/apu-iconv.m4)
13 sinclude(build/apu-hints.m4)
14 sinclude(build/apr_common.m4)
15 sinclude(build/find_apr.m4)
16 sinclude(build/dbm.m4)
18 dnl Generate ./config.nice for reproducing runs of configure
20 APR_CONFIG_NICE(config.nice)
22 dnl # Some initial steps for configuration. We setup the default directory
23 dnl # and which files are to be configured.
25 dnl Absolute source/build directory
26 abs_srcdir=`(cd $srcdir && pwd)`
29 if test "$abs_builddir" != "$abs_srcdir"; then
31 APU_CONFIG_LOCATION=build
33 APU_CONFIG_LOCATION=source
36 AC_SUBST(APU_CONFIG_LOCATION)
41 dnl compute the top directory of the build
42 dnl note: this is needed for LIBTOOL and exporting the bundled Expat
44 top_builddir="$abs_builddir"
45 AC_SUBST(top_builddir)
47 AC_SUBST(abs_builddir)
49 dnl Initialize mkdir -p functionality.
50 APR_MKDIR_P_CHECK($abs_srcdir/build/mkdir.sh)
52 dnl get our version information
53 get_version="$abs_srcdir/build/get-version.sh"
54 version_hdr="$abs_srcdir/include/apu_version.h"
55 APRUTIL_MAJOR_VERSION="`$get_version major $version_hdr APU`"
56 APRUTIL_DOTTED_VERSION="`$get_version all $version_hdr APU`"
58 AC_SUBST(APRUTIL_DOTTED_VERSION)
59 AC_SUBST(APRUTIL_MAJOR_VERSION)
61 echo "APR-util Version: ${APRUTIL_DOTTED_VERSION}"
63 dnl Enable the layout handling code, then reparse the prefix-style
64 dnl arguments due to autoconf being a PITA.
65 APR_ENABLE_LAYOUT(apr-util)
68 dnl load os-specific hints for apr-util
72 dnl set up the compilation flags and stuff
76 APRUTIL_PRIV_INCLUDES="-I$top_builddir/include -I$top_builddir/include/private"
77 if test -n "$USE_VPATH"; then
78 APRUTIL_PRIV_INCLUDES="$APRUTIL_PRIV_INCLUDES -I$abs_srcdir/include/private -I$abs_srcdir/include"
82 dnl Find the APR includes directory and (possibly) the source (base) dir.
87 dnl even though we use apr_rules.mk for building apr-util, we need
88 dnl to grab CC and CPP ahead of time so that apr-util config tests
89 dnl use the same compiler as APR; we need the same compiler options
90 dnl and feature test macros as well
92 APR_SETIFNULL(CC, `$apr_config --cc`)
93 APR_SETIFNULL(CPP, `$apr_config --cpp`)
94 APR_ADDTO(CFLAGS, `$apr_config --cflags`)
95 APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`)
98 dnl Determine what DBM backend type to use.
100 dnl Find an iconv library
106 AC_SEARCH_LIBS(crypt, crypt ufc)
107 AC_MSG_CHECKING(if system crypt() function is threadsafe)
108 if test "x$apu_crypt_threadsafe" = "x1"; then
109 AC_DEFINE(APU_CRYPT_THREADSAFE, 1, [Define if the system crypt() function is threadsafe])
114 AC_MSG_RESULT([$msg])
116 AC_CHECK_FUNCS(crypt_r, [ crypt_r="1" ], [ crypt_r="0" ])
117 if test "$crypt_r" = "1"; then
118 APR_CHECK_CRYPT_R_STYLE
122 lib_target=$APR_LIB_TARGET
126 APRUTIL_LIBNAME="aprutil${libsuffix}"
127 AC_SUBST(APRUTIL_LIBNAME)
129 # Use -no-install to link the test programs on all platforms
130 # but Darwin, where it would cause the programs to be linked
131 # against installed versions of libapr instead of those just
134 *-apple-darwin*) LT_NO_INSTALL="" ;;
135 *) LT_NO_INSTALL="-no-install" ;;
137 AC_SUBST(LT_NO_INSTALL)
140 host_alias=`uname -s`
141 case "$host_alias" in
142 dnl ### BeOS requires that ALL symbols resolve at LINK time!
144 dnl ### So, if we're building on BeOS then we need to add in the
145 dnl ### apr and expat libraries to the build or it'll die a truly horrible
146 dnl ### death. We now use the apr-config tool to determine the correct
147 dnl ### library to link against :)
148 *AIX*|*Darwin*|*BeOS*|CYGWIN*)
149 dnl need such stuff as -liconv to be specified when building libaprutil.la
150 EXTRA_OS_LINK='$(APRUTIL_LDFLAGS) $(APRUTIL_LIBS)'
156 AC_SUBST(EXTRA_OS_LINK)
159 dnl Prep all the flags and stuff for compilation and export to other builds
161 APR_ADDTO(APRUTIL_LIBS, [$APR_LIBS])
163 AC_SUBST(APRUTIL_EXPORT_LIBS)
164 AC_SUBST(APRUTIL_PRIV_INCLUDES)
165 AC_SUBST(APRUTIL_INCLUDES)
166 AC_SUBST(APRUTIL_LDFLAGS)
167 AC_SUBST(APRUTIL_LIBS)
170 dnl copy apr's rules.mk into our build directory.
171 if test ! -d ./build; then
174 cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk
177 dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
179 case "$host_alias" in
181 # Check whether they've installed GNU make
182 if make --version > /dev/null 2>&1; then
183 INCLUDE_RULES="include $abs_builddir/build/rules.mk"
185 INCLUDE_RULES=".include \"$abs_builddir/build/rules.mk\""
189 INCLUDE_RULES="include $abs_builddir/build/rules.mk"
192 AC_SUBST(INCLUDE_RULES)
194 if test -f $abs_srcdir/test/Makefile.in; then
195 test_Makefile="test/Makefile"
198 if test ! -d "$top_builddir/include/private"; then
199 $mkdir_p $top_builddir/include/private
203 dnl everthing is done.
204 MAKEFILES="Makefile buckets/Makefile crypto/Makefile dbm/Makefile dbm/sdbm/Makefile encoding/Makefile hooks/Makefile ldap/Makefile uri/Makefile xml/Makefile misc/Makefile strmatch/Makefile xlate/Makefile $test_Makefile"
209 include/private/apu_select_dbm.h