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)
43 dnl compute the top directory of the build
44 dnl note: this is needed for LIBTOOL and exporting the bundled Expat
46 top_builddir="$abs_builddir"
47 AC_SUBST(top_builddir)
49 AC_SUBST(abs_builddir)
51 dnl Initialize mkdir -p functionality.
52 APR_MKDIR_P_CHECK($abs_srcdir/build/mkdir.sh)
54 dnl get our version information
55 get_version="$abs_srcdir/build/get-version.sh"
56 version_hdr="$abs_srcdir/include/apu_version.h"
57 APRUTIL_MAJOR_VERSION="`$get_version major $version_hdr APU`"
58 APRUTIL_DOTTED_VERSION="`$get_version all $version_hdr APU`"
60 AC_SUBST(APRUTIL_DOTTED_VERSION)
61 AC_SUBST(APRUTIL_MAJOR_VERSION)
63 echo "APR-util Version: ${APRUTIL_DOTTED_VERSION}"
65 dnl Enable the layout handling code, then reparse the prefix-style
66 dnl arguments due to autoconf being a PITA.
67 APR_ENABLE_LAYOUT(apr-util)
70 dnl load os-specific hints for apr-util
74 dnl set up the compilation flags and stuff
78 APRUTIL_PRIV_INCLUDES="-I$top_builddir/include -I$top_builddir/include/private"
79 if test -n "$USE_VPATH"; then
80 APRUTIL_PRIV_INCLUDES="$APRUTIL_PRIV_INCLUDES -I$abs_srcdir/include/private -I$abs_srcdir/include"
84 dnl Find the APR includes directory and (possibly) the source (base) dir.
89 dnl even though we use apr_rules.mk for building apr-util, we need
90 dnl to grab CC and CPP ahead of time so that apr-util config tests
91 dnl use the same compiler as APR; we need the same compiler options
92 dnl and feature test macros as well
94 APR_SETIFNULL(CC, `$apr_config --cc`)
95 APR_SETIFNULL(CPP, `$apr_config --cpp`)
96 APR_ADDTO(CFLAGS, `$apr_config --cflags`)
97 APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`)
100 dnl Determine what DBM backend type to use.
102 dnl Find an iconv library
108 AC_SEARCH_LIBS(crypt, crypt ufc)
109 AC_MSG_CHECKING(if system crypt() function is threadsafe)
110 if test "x$apu_crypt_threadsafe" = "x1"; then
111 AC_DEFINE(APU_CRYPT_THREADSAFE, 1, [Define if the system crypt() function is threadsafe])
116 AC_MSG_RESULT([$msg])
118 AC_CHECK_FUNCS(crypt_r, [ crypt_r="1" ], [ crypt_r="0" ])
119 if test "$crypt_r" = "1"; then
120 APU_CHECK_CRYPT_R_STYLE
124 lib_target=$APR_LIB_TARGET
128 APRUTIL_LIBNAME="aprutil${libsuffix}"
129 AC_SUBST(APRUTIL_LIBNAME)
132 host_alias=`uname -s`
133 case "$host_alias" in
134 dnl ### BeOS requires that ALL symbols resolve at LINK time!
136 dnl ### So, if we're building on BeOS then we need to add in the
137 dnl ### apr and expat libraries to the build or it'll die a truly horrible
138 dnl ### death. We now use the apr-config tool to determine the correct
139 dnl ### library to link against :)
140 *AIX*|*Darwin*|*BeOS*)
141 dnl need such stuff as -liconv to be specified when building libaprutil.la
142 EXTRA_OS_LINK='$(APRUTIL_LDFLAGS) $(APRUTIL_LIBS)'
148 AC_SUBST(EXTRA_OS_LINK)
151 dnl Prep all the flags and stuff for compilation and export to other builds
153 APR_ADDTO(APRUTIL_LIBS, [$APR_LIBS])
155 AC_SUBST(APRUTIL_EXPORT_LIBS)
156 AC_SUBST(APRUTIL_PRIV_INCLUDES)
157 AC_SUBST(APRUTIL_INCLUDES)
158 AC_SUBST(APRUTIL_LDFLAGS)
159 AC_SUBST(APRUTIL_LIBS)
162 dnl copy apr's rules.mk into our build directory.
163 if test ! -d ./build; then
166 cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk
169 dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
171 case "$host_alias" in
173 # Check whether they've installed GNU make
174 if make --version > /dev/null 2>&1; then
175 INCLUDE_RULES="include $abs_builddir/build/rules.mk"
176 INCLUDE_OUTPUTS="include $abs_srcdir/build-outputs.mk"
178 INCLUDE_RULES=".include \"$abs_builddir/build/rules.mk\""
179 INCLUDE_OUTPUTS=".include \"$abs_srcdir/build-outputs.mk\""
183 INCLUDE_RULES="include $abs_builddir/build/rules.mk"
184 INCLUDE_OUTPUTS="include $abs_srcdir/build-outputs.mk"
187 AC_SUBST(INCLUDE_RULES)
188 AC_SUBST(INCLUDE_OUTPUTS)
190 if test -d $srcdir/test; then
191 test_Makefile="test/Makefile"
194 if test ! -d "$top_builddir/include/private"; then
195 mkdir $top_builddir/include
196 mkdir $top_builddir/include/private
200 dnl everthing is done.
201 MAKEFILES="Makefile $test_Makefile"
204 apu-$APRUTIL_MAJOR_VERSION-config:apu-config.in
206 include/private/apu_select_dbm.h
212 chmod +x apu-$APRUTIL_MAJOR_VERSION-config
214 APRUTIL_MAJOR_VERSION=$APRUTIL_MAJOR_VERSION