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_REGEX="$1"
19
APRUTIL_WANTED_REGEX_TOO="$2"
21
AC_MSG_NOTICE([Apache Portable Runtime Utility (APRUTIL) library configuration])
23
APR_FIND_APU("$srcdir/apr-util", "./apr-util", 1, [0 1])
25
if test $apu_found = "no"; then
26
AC_MSG_WARN([APRUTIL not found])
30
if test $apu_found = "reconfig"; then
31
SVN_SUBDIR_CONFIG(apr-util, --with-apr=../apr)
32
SVN_SUBDIRS="$SVN_SUBDIRS apr-util"
35
dnl check APRUTIL version number against regex
37
AC_MSG_CHECKING([APR-UTIL version])
38
apu_version="`$apu_config --version`"
39
if test $? -ne 0; then
40
# This is a hack as suggested by Ben Collins-Sussman. It can be
41
# removed after apache 2.0.44 has been released. (The apu-config
42
# shipped in 2.0.43 contains a correct version number, but
43
# stupidly doesn't understand the --version switch.)
44
apu_version=`grep "APRUTIL_DOTTED_VERSION=" $(which $apu_config) | tr -d "APRUTIL_DOTTED_VERSION="| tr -d '"'`
46
# apu-config --version failed.
47
# Your apu-config doesn't support the --version switch, please upgrade
48
# to APR-UTIL more recent than 2002-Nov-05.])
50
AC_MSG_RESULT([$apu_version])
52
if test `expr $apu_version : $APRUTIL_WANTED_REGEX` -eq 0 \
53
-a `expr $apu_version : $APRUTIL_WANTED_REGEX_TOO` -eq 0; then
54
echo "wanted regex is $APRUTIL_WANTED_REGEX or $APRUTIL_WANTED_REGEX_TOO"
55
AC_MSG_ERROR([invalid apr-util version found])
58
dnl Get libraries and thread flags from APRUTIL ---------------------
60
LDFLAGS="$LDFLAGS `$apu_config --ldflags`"
61
if test $? -ne 0; then
62
AC_MSG_ERROR([apu-config --ldflags failed])
65
SVN_APRUTIL_INCLUDES="`$apu_config --includes`"
66
if test $? -ne 0; then
67
AC_MSG_ERROR([apu-config --includes failed])
70
dnl When APR stores the dependent libs in the .la file, we don't need
72
SVN_APRUTIL_LIBS="`$apu_config --link-libtool --libs`"
73
if test $? -ne 0; then
74
AC_MSG_ERROR([apu-config --link-libtool --libs failed])
77
SVN_APRUTIL_EXPORT_LIBS="`$apu_config --link-ld --libs`"
78
if test $? -ne 0; then
79
AC_MSG_ERROR([apu-config --link-ld --libs failed])
82
AC_SUBST(SVN_APRUTIL_INCLUDES)
83
AC_SUBST(SVN_APRUTIL_LIBS)
84
AC_SUBST(SVN_APRUTIL_EXPORT_LIBS)
85
AC_SUBST(SVN_APRUTIL_PREFIX)
88
dnl SVN_DOWNLOAD_APRUTIL()
89
dnl no apr-util found, print out a message telling the user what to do
90
AC_DEFUN(SVN_DOWNLOAD_APRUTIL,
92
echo "The Apache Portable Runtime Utility (APRUTIL) library cannot be found."
93
echo "Either install APRUTIL on this system and supply the appropriate"
94
echo "--with-apr-util option"
98
echo "get it with SVN and put it in a subdirectory of this source:"
101
echo " http://svn.apache.org/repos/asf/apr/apr-util/branches/APU_0_9_BRANCH \\"
104
echo "Run that right here in the top level of the Subversion tree,"
105
echo "then run autogen.sh again."
107
AC_MSG_ERROR([no suitable APRUTIL found])