bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr-util / configure.in
1 dnl
2 dnl Process this file with autoconf to produce a configure script
3 dnl
4
5 AC_PREREQ(2.13)
6 AC_INIT(export_vars.sh.in)
7
8 AC_CONFIG_HEADER(include/private/apu_config.h)
9 AC_CONFIG_AUX_DIR(build)
10
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
18 dnl Generate ./config.nice for reproducing runs of configure
19 dnl 
20 APR_CONFIG_NICE(config.nice)
21
22 dnl # Some initial steps for configuration.  We setup the default directory
23 dnl # and which files are to be configured.
24
25 dnl Absolute source/build directory
26 abs_srcdir=`(cd $srcdir && pwd)`
27 abs_builddir=`pwd`
28
29 if test "$abs_builddir" != "$abs_srcdir"; then
30   USE_VPATH=1
31   APU_CONFIG_LOCATION=build
32 else
33   APU_CONFIG_LOCATION=source
34 fi
35
36 AC_SUBST(APU_CONFIG_LOCATION)
37
38 AC_CANONICAL_SYSTEM
39
40 dnl
41 dnl compute the top directory of the build
42 dnl note: this is needed for LIBTOOL and exporting the bundled Expat
43 dnl
44 top_builddir="$abs_builddir"
45 AC_SUBST(top_builddir)
46 AC_SUBST(abs_srcdir)
47 AC_SUBST(abs_builddir)
48
49 dnl Initialize mkdir -p functionality.
50 APR_MKDIR_P_CHECK($abs_srcdir/build/mkdir.sh)
51
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`"
57
58 AC_SUBST(APRUTIL_DOTTED_VERSION)
59 AC_SUBST(APRUTIL_MAJOR_VERSION)
60
61 echo "APR-util Version: ${APRUTIL_DOTTED_VERSION}"
62
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)
66 APR_PARSE_ARGUMENTS
67
68 dnl load os-specific hints for apr-util
69 APU_PRELOAD
70
71 dnl
72 dnl set up the compilation flags and stuff
73 dnl
74
75 APRUTIL_INCLUDES=""
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"
79 fi
80
81 dnl
82 dnl Find the APR includes directory and (possibly) the source (base) dir.
83 dnl
84 APU_FIND_APR
85
86 dnl
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
91 dnl
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`)
96
97 dnl Find LDAP library
98 dnl Determine what DBM backend type to use.
99 dnl Find Expat
100 dnl Find an iconv library
101 APU_FIND_LDAP
102 APU_CHECK_DBM
103 APU_FIND_EXPAT
104 APU_FIND_ICONV
105
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])
110   msg="yes"
111 else
112   msg="no"
113 fi
114 AC_MSG_RESULT([$msg])
115
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
119 fi
120
121 so_ext=$APR_SO_EXT
122 lib_target=$APR_LIB_TARGET
123 AC_SUBST(so_ext)
124 AC_SUBST(lib_target)
125
126 APRUTIL_LIBNAME="aprutil${libsuffix}"
127 AC_SUBST(APRUTIL_LIBNAME)
128
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
132 # built.
133 case $host in
134 *-apple-darwin*) LT_NO_INSTALL="" ;;
135 *) LT_NO_INSTALL="-no-install" ;;
136 esac
137 AC_SUBST(LT_NO_INSTALL)
138
139 EXTRA_OS_LINK=""
140 host_alias=`uname -s`
141 case "$host_alias" in
142     dnl ### BeOS requires that ALL symbols resolve at LINK time!
143     dnl ### 
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)'
151     ;;
152 *)
153     ;;
154 esac
155
156 AC_SUBST(EXTRA_OS_LINK)
157
158 dnl
159 dnl Prep all the flags and stuff for compilation and export to other builds
160 dnl
161 APR_ADDTO(APRUTIL_LIBS, [$APR_LIBS])
162
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)
168 AC_SUBST(LDFLAGS)
169
170 dnl copy apr's rules.mk into our build directory.
171 if test ! -d ./build; then
172    $mkdir_p build
173 fi
174 cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk
175
176 dnl
177 dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
178 dnl
179 case "$host_alias" in
180 *bsdi* | BSD/OS)
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"
184     else
185         INCLUDE_RULES=".include \"$abs_builddir/build/rules.mk\""
186     fi
187     ;;
188 *)
189     INCLUDE_RULES="include $abs_builddir/build/rules.mk"
190     ;;
191 esac
192 AC_SUBST(INCLUDE_RULES)
193
194 if test -f $abs_srcdir/test/Makefile.in; then
195     test_Makefile="test/Makefile"
196 fi
197
198 if test ! -d "$top_builddir/include/private"; then
199     $mkdir_p $top_builddir/include/private
200 fi
201
202 dnl
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"
205 AC_OUTPUT([
206     export_vars.sh
207     apu-config
208     build/pkg/pkginfo
209     include/private/apu_select_dbm.h
210     include/apr_ldap.h
211     include/apu.h
212     include/apu_want.h
213     $MAKEFILES
214         ],[
215 chmod +x apu-config
216 ])