Add dbd to the windows project files.
[apr-util.git] / configure.in
blob2534eb14c665816f6b127c06d07988b8f0b93bc5
1 dnl
2 dnl Process this file with autoconf to produce a configure script
3 dnl
5 AC_PREREQ(2.50)
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)
17 sinclude(build/dbd.m4)
19 dnl Generate ./config.nice for reproducing runs of configure
20 dnl 
21 APR_CONFIG_NICE(config.nice)
23 dnl # Some initial steps for configuration.  We setup the default directory
24 dnl # and which files are to be configured.
26 dnl Absolute source/build directory
27 abs_srcdir=`(cd $srcdir && pwd)`
28 abs_builddir=`pwd`
30 if test "$abs_builddir" != "$abs_srcdir"; then
31   USE_VPATH=1
32   APU_CONFIG_LOCATION=build
33 else
34   APU_CONFIG_LOCATION=source
37 AC_SUBST(APU_CONFIG_LOCATION)
39 AC_CANONICAL_SYSTEM
41 AC_PROG_INSTALL
43 dnl
44 dnl compute the top directory of the build
45 dnl note: this is needed for LIBTOOL and exporting the bundled Expat
46 dnl
47 top_builddir="$abs_builddir"
48 AC_SUBST(top_builddir)
49 AC_SUBST(abs_srcdir)
50 AC_SUBST(abs_builddir)
52 dnl Initialize mkdir -p functionality.
53 APR_MKDIR_P_CHECK($abs_srcdir/build/mkdir.sh)
55 dnl get our version information
56 get_version="$abs_srcdir/build/get-version.sh"
57 version_hdr="$abs_srcdir/include/apu_version.h"
58 APRUTIL_MAJOR_VERSION="`$get_version major $version_hdr APU`"
59 APRUTIL_DOTTED_VERSION="`$get_version all $version_hdr APU`"
61 AC_SUBST(APRUTIL_DOTTED_VERSION)
62 AC_SUBST(APRUTIL_MAJOR_VERSION)
64 echo "APR-util Version: ${APRUTIL_DOTTED_VERSION}"
66 dnl Enable the layout handling code, then reparse the prefix-style
67 dnl arguments due to autoconf being a PITA.
68 APR_ENABLE_LAYOUT(apr-util)
69 APR_PARSE_ARGUMENTS
71 dnl load os-specific hints for apr-util
72 APU_PRELOAD
74 dnl
75 dnl set up the compilation flags and stuff
76 dnl
78 APRUTIL_INCLUDES=""
79 APRUTIL_PRIV_INCLUDES="-I$top_builddir/include -I$top_builddir/include/private"
80 if test -n "$USE_VPATH"; then
81     APRUTIL_PRIV_INCLUDES="$APRUTIL_PRIV_INCLUDES -I$abs_srcdir/include/private -I$abs_srcdir/include"
84 dnl
85 dnl Find the APR includes directory and (possibly) the source (base) dir.
86 dnl
87 APU_FIND_APR
89 dnl
90 dnl even though we use apr_rules.mk for building apr-util, we need
91 dnl to grab CC and CPP ahead of time so that apr-util config tests
92 dnl use the same compiler as APR; we need the same compiler options
93 dnl and feature test macros as well
94 dnl
95 APR_SETIFNULL(CC, `$apr_config --cc`)
96 APR_SETIFNULL(CPP, `$apr_config --cpp`)
97 APR_ADDTO(CFLAGS, `$apr_config --cflags`)
98 APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`)
101 dnl  Find the APR-ICONV directory.
103 if test -d ../apr-iconv; then
104   APR_SUBDIR_CONFIG(../apr-iconv,
105                     [$apache_apr_flags --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir --datadir=$datadir --with-installbuilddir=$installbuilddir],
106                     [--enable-layout=*|\'--enable-layout=*])
107   APRUTIL_EXPORT_LIBS="$abs_srcdir/../apr-iconv/lib/libapriconv.la $APRUTIL_EXPORT_LIBS"
108   APRUTIL_INCLUDES="-I$abs_srcdir/../apr-iconv/include $APRUTIL_INCLUDES"
109   APR_ICONV_DIR=../apr-iconv
110 else
111   APR_ICONV_DIR=""
113 AC_SUBST(APR_ICONV_DIR)
115 dnl Find LDAP library
116 dnl Determine what DBM backend type to use.
117 dnl Find Expat
118 dnl Find an iconv library
119 APU_FIND_LDAP
120 APU_CHECK_DBM
121 APU_CHECK_DBD
122 APU_CHECK_DBD_MYSQL
123 APU_CHECK_DBD_SQLITE3
124 APU_CHECK_DBD_SQLITE2
125 APU_FIND_EXPAT
126 APU_FIND_ICONV
128 AC_SEARCH_LIBS(crypt, crypt ufc)
129 AC_MSG_CHECKING(if system crypt() function is threadsafe)
130 if test "x$apu_crypt_threadsafe" = "x1"; then
131   AC_DEFINE(APU_CRYPT_THREADSAFE, 1, [Define if the system crypt() function is threadsafe])
132   msg="yes"
133 else
134   msg="no"
136 AC_MSG_RESULT([$msg])
138 AC_CHECK_FUNCS(crypt_r, [ crypt_r="1" ], [ crypt_r="0" ])
139 if test "$crypt_r" = "1"; then
140   APU_CHECK_CRYPT_R_STYLE
143 so_ext=$APR_SO_EXT
144 lib_target=$APR_LIB_TARGET
145 AC_SUBST(so_ext)
146 AC_SUBST(lib_target)
148 APRUTIL_LIBNAME="aprutil${libsuffix}"
149 AC_SUBST(APRUTIL_LIBNAME)
152 dnl Prep all the flags and stuff for compilation and export to other builds
154 APR_ADDTO(APRUTIL_LIBS, [$APR_LIBS])
156 AC_SUBST(APRUTIL_EXPORT_LIBS)
157 AC_SUBST(APRUTIL_PRIV_INCLUDES)
158 AC_SUBST(APRUTIL_INCLUDES)
159 AC_SUBST(APRUTIL_LDFLAGS)
160 AC_SUBST(APRUTIL_LIBS)
161 AC_SUBST(LDFLAGS)
163 dnl copy apr's rules.mk into our build directory.
164 if test ! -d ./build; then
165    $mkdir_p build
167 cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk
170 dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
172 case "$host_alias" in
173 *bsdi* | BSD/OS)
174     # Check whether they've installed GNU make
175     if make --version > /dev/null 2>&1; then
176         INCLUDE_RULES="include $abs_builddir/build/rules.mk"
177         INCLUDE_OUTPUTS="include $abs_srcdir/build-outputs.mk"
178     else
179         INCLUDE_RULES=".include \"$abs_builddir/build/rules.mk\""
180         INCLUDE_OUTPUTS=".include \"$abs_srcdir/build-outputs.mk\""
181     fi
182     ;;
184     INCLUDE_RULES="include $abs_builddir/build/rules.mk"
185     INCLUDE_OUTPUTS="include $abs_srcdir/build-outputs.mk"
186     ;;
187 esac
188 AC_SUBST(INCLUDE_RULES)
189 AC_SUBST(INCLUDE_OUTPUTS)
191 for d in include include/private; do
192     test -d $top_builddir/$d || mkdir $top_builddir/$d
193 done
195 AC_CONFIG_FILES([Makefile export_vars.sh
196                  build/pkg/pkginfo apr-util.pc
197                  apu-$APRUTIL_MAJOR_VERSION-config:apu-config.in
198                  include/private/apu_select_dbm.h
199                  include/apr_ldap.h
200                  include/apu.h include/apu_want.h])
202 AC_CONFIG_COMMANDS([default], [
203 chmod +x apu-$APRUTIL_MAJOR_VERSION-config
205 APRUTIL_MAJOR_VERSION=$APRUTIL_MAJOR_VERSION
208 if test -d $srcdir/test; then
209     AC_CONFIG_FILES([test/Makefile])
212 AC_OUTPUT