1 dnl SVN_LIB_APRUTIL(wanted_regex, alt_wanted_regex)
3 dnl 'wanted_regex' and 'alt_wanted_regex are regular expressions
4 dnl that the aprutil version string must match.
6 dnl Check configure options and assign variables related to
7 dnl the Apache Portable Runtime Utilities (APRUTIL) library.
9 dnl If there is an apr-util source directory, there *must* be a
10 dnl corresponding apr source directory. APRUTIL's build system
11 dnl is too tied in with apr. (You can't use an installed APR and
12 dnl a source APR-util.)
16 AC_DEFUN(SVN_LIB_APRUTIL,
18 APRUTIL_WANTED_REGEXES="$1"
20 AC_MSG_NOTICE([Apache Portable Runtime Utility (APRUTIL) library configuration])
22 APR_FIND_APU("$abs_srcdir/apr-util", "$abs_builddir/apr-util", 1, [0 1])
24 if test $apu_found = "no"; then
25 AC_MSG_WARN([APRUTIL not found])
29 if test $apu_found = "reconfig"; then
30 SVN_EXTERNAL_PROJECT([apr-util], [--with-apr=../apr])
33 dnl check APRUTIL version number against regex
35 AC_MSG_CHECKING([APR-UTIL version])
36 apu_version="`$apu_config --version`"
37 if test $? -ne 0; then
38 # This is a hack as suggested by Ben Collins-Sussman. It can be
39 # removed after apache 2.0.44 has been released. (The apu-config
40 # shipped in 2.0.43 contains a correct version number, but
41 # stupidly doesn't understand the --version switch.)
42 apu_version=`grep "APRUTIL_DOTTED_VERSION=" $(which $apu_config) | tr -d "APRUTIL_DOTTED_VERSION="| tr -d '"'`
44 # apu-config --version failed.
45 # Your apu-config doesn't support the --version switch, please upgrade
46 # to APR-UTIL more recent than 2002-Nov-05.])
48 AC_MSG_RESULT([$apu_version])
50 APU_WANTED_REGEX_MATCH=0
51 for apu_wanted_regex in $APRUTIL_WANTED_REGEXES; do
52 if test `expr $apu_version : $apu_wanted_regex` -ne 0; then
53 APU_WANTED_REGEX_MATCH=1
58 if test $APU_WANTED_REGEX_MATCH -eq 0; then
59 echo "wanted regexes are $APRUTIL_WANTED_REGEXES"
60 AC_MSG_ERROR([invalid apr-util version found])
63 dnl Get libraries and thread flags from APRUTIL ---------------------
65 LDFLAGS="$LDFLAGS `$apu_config --ldflags`"
66 if test $? -ne 0; then
67 AC_MSG_ERROR([apu-config --ldflags failed])
70 SVN_APRUTIL_INCLUDES="`$apu_config --includes`"
71 if test $? -ne 0; then
72 AC_MSG_ERROR([apu-config --includes failed])
75 dnl When APR stores the dependent libs in the .la file, we don't need
77 SVN_APRUTIL_LIBS="`$apu_config --link-libtool --libs`"
78 if test $? -ne 0; then
79 AC_MSG_ERROR([apu-config --link-libtool --libs failed])
82 SVN_APRUTIL_EXPORT_LIBS="`$apu_config --link-ld --libs`"
83 if test $? -ne 0; then
84 AC_MSG_ERROR([apu-config --link-ld --libs failed])
87 AC_SUBST(SVN_APRUTIL_INCLUDES)
88 AC_SUBST(SVN_APRUTIL_LIBS)
89 AC_SUBST(SVN_APRUTIL_EXPORT_LIBS)
90 AC_SUBST(SVN_APRUTIL_PREFIX)
92 dnl What version of Expat are we using? -----------------
93 SVN_HAVE_OLD_EXPAT="`$apu_config --old-expat`"
94 if test "$SVN_HAVE_OLD_EXPAT" = "yes"; then
95 AC_DEFINE(SVN_HAVE_OLD_EXPAT, 1, [Defined if Expat 1.0 or 1.1 was found])
99 dnl SVN_DOWNLOAD_APRUTIL()
100 dnl no apr-util found, print out a message telling the user what to do
101 AC_DEFUN(SVN_DOWNLOAD_APRUTIL,
103 echo "The Apache Portable Runtime Utility (APRUTIL) library cannot be found."
104 echo "Either install APRUTIL on this system and supply the appropriate"
105 echo "--with-apr-util option"
109 echo "get it with SVN and put it in a subdirectory of this source:"
112 echo " http://svn.apache.org/repos/asf/apr/apr-util/branches/1.2.x \\"
115 echo "Run that right here in the top level of the Subversion tree."
116 echo "Afterwards, run apr-util/buildconf in that subdirectory and"
117 echo "then run configure again here."
119 AC_MSG_ERROR([no suitable APRUTIL found])