AC_DEFUN(SVN_LIB_APRUTIL,
[
APRUTIL_WANTED_REGEXES="$1"
AC_MSG_NOTICE([Apache Portable Runtime Utility (APRUTIL) library configuration])
APR_FIND_APU("$abs_srcdir/apr-util", "$abs_builddir/apr-util", 1, [1 0])
if test $apu_found = "no"; then
AC_MSG_WARN([APRUTIL not found])
SVN_DOWNLOAD_APRUTIL
fi
if test $apu_found = "reconfig"; then
SVN_EXTERNAL_PROJECT([apr-util], [--with-apr=../apr])
fi
AC_MSG_CHECKING([APR-UTIL version])
apu_version="`$apu_config --version`"
if test $? -ne 0; then
apu_version=`grep "APRUTIL_DOTTED_VERSION=" $(which $apu_config) | tr -d "APRUTIL_DOTTED_VERSION="| tr -d '"'`
fi
AC_MSG_RESULT([$apu_version])
APU_WANTED_REGEX_MATCH=0
for apu_wanted_regex in $APRUTIL_WANTED_REGEXES; do
if test `expr $apu_version : $apu_wanted_regex` -ne 0; then
APU_WANTED_REGEX_MATCH=1
break
fi
done
if test $APU_WANTED_REGEX_MATCH -eq 0; then
echo "wanted regexes are $APRUTIL_WANTED_REGEXES"
AC_MSG_ERROR([invalid apr-util version found])
fi
LDFLAGS="$LDFLAGS `$apu_config --ldflags`"
if test $? -ne 0; then
AC_MSG_ERROR([apu-config --ldflags failed])
fi
SVN_APRUTIL_INCLUDES="`$apu_config --includes`"
if test $? -ne 0; then
AC_MSG_ERROR([apu-config --includes failed])
fi
SVN_APRUTIL_PREFIX="`$apu_config --prefix`"
if test $? -ne 0; then
AC_MSG_ERROR([apu-config --prefix failed])
fi
SVN_APRUTIL_LIBS="`$apu_config --link-libtool --libs`"
if test $? -ne 0; then
AC_MSG_ERROR([apu-config --link-libtool --libs failed])
fi
SVN_APRUTIL_EXPORT_LIBS="`$apu_config --link-ld --libs`"
if test $? -ne 0; then
AC_MSG_ERROR([apu-config --link-ld --libs failed])
fi
AC_SUBST(SVN_APRUTIL_INCLUDES)
AC_SUBST(SVN_APRUTIL_LIBS)
AC_SUBST(SVN_APRUTIL_EXPORT_LIBS)
AC_SUBST(SVN_APRUTIL_PREFIX)
SVN_HAVE_OLD_EXPAT="`$apu_config --old-expat`"
if test "$SVN_HAVE_OLD_EXPAT" = "yes"; then
AC_DEFINE(SVN_HAVE_OLD_EXPAT, 1, [Defined if Expat 1.0 or 1.1 was found])
fi
])
AC_DEFUN(SVN_DOWNLOAD_APRUTIL,
[
echo "The Apache Portable Runtime Utility (APRUTIL) library cannot be found."
echo "Either install APRUTIL on this system and supply the appropriate"
echo "--with-apr-util option"
echo ""
echo "or"
echo ""
echo "get it with SVN and put it in a subdirectory of this source:"
echo ""
echo " svn co \\"
echo " http://svn.apache.org/repos/asf/apr/apr-util/branches/1.2.x \\"
echo " apr-util"
echo ""
echo "Run that right here in the top level of the Subversion tree."
echo "Afterwards, run apr-util/buildconf in that subdirectory and"
echo "then run configure again here."
echo ""
AC_MSG_ERROR([no suitable APRUTIL found])
])