summaryrefslogtreecommitdiff
path: root/build/ac-macros
diff options
context:
space:
mode:
authorLorry <lorry@roadtrain.codethink.co.uk>2012-08-22 14:29:52 +0100
committerLorry <lorry@roadtrain.codethink.co.uk>2012-08-22 14:29:52 +0100
commitf1bdf13786f0752c0846cf36f0d91e4fc6747929 (patch)
tree4223b2035bf2240d681a53822808b3c7f687b905 /build/ac-macros
downloadsubversion-tarball-f1bdf13786f0752c0846cf36f0d91e4fc6747929.tar.gz
Tarball conversion
Diffstat (limited to 'build/ac-macros')
-rw-r--r--build/ac-macros/apache.m4178
-rw-r--r--build/ac-macros/apr.m4151
-rw-r--r--build/ac-macros/apr_memcache.m498
-rw-r--r--build/ac-macros/aprutil.m4146
-rw-r--r--build/ac-macros/berkeley-db.m4246
-rw-r--r--build/ac-macros/ctypesgen.m478
-rw-r--r--build/ac-macros/find_apr.m4168
-rw-r--r--build/ac-macros/find_apu.m4178
-rw-r--r--build/ac-macros/gssapi.m482
-rw-r--r--build/ac-macros/java.m4215
-rw-r--r--build/ac-macros/kwallet.m4117
-rw-r--r--build/ac-macros/neon.m4168
-rw-r--r--build/ac-macros/sasl.m4102
-rw-r--r--build/ac-macros/serf.m499
-rw-r--r--build/ac-macros/sqlite.m4249
-rw-r--r--build/ac-macros/svn-macros.m4204
-rw-r--r--build/ac-macros/swig.m4297
-rw-r--r--build/ac-macros/zlib.m474
18 files changed, 2850 insertions, 0 deletions
diff --git a/build/ac-macros/apache.m4 b/build/ac-macros/apache.m4
new file mode 100644
index 0000000..196ad79
--- /dev/null
+++ b/build/ac-macros/apache.m4
@@ -0,0 +1,178 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl Macros to find an Apache installation
+dnl
+dnl This will find an installed Apache.
+dnl
+dnl Note: If we don't have an installed Apache, then we can't install the
+dnl (dynamic) mod_dav_svn.so module.
+dnl
+
+AC_DEFUN(SVN_FIND_APACHE,[
+AC_REQUIRE([AC_CANONICAL_HOST])
+
+HTTPD_WANTED_MMN="$1"
+
+AC_MSG_CHECKING(for Apache module support via DSO through APXS)
+AC_ARG_WITH(apxs,
+ [AS_HELP_STRING([[--with-apxs[=FILE]]],
+ [Build shared Apache modules. FILE is the optional
+ pathname to the Apache apxs tool; defaults to
+ "apxs".])],
+[
+ if test "$withval" = "yes"; then
+ APXS=apxs
+ else
+ APXS="$withval"
+ fi
+ APXS_EXPLICIT=1
+])
+
+if test -z "$APXS"; then
+ for i in /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin /usr/bin ; do
+ if test -f "$i/apxs2"; then
+ APXS="$i/apxs2"
+ break
+ fi
+ if test -f "$i/apxs"; then
+ APXS="$i/apxs"
+ break
+ fi
+ done
+fi
+
+if test -n "$APXS" && test "$APXS" != "no"; then
+ APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
+ if test -r $APXS_INCLUDE/mod_dav.h; then
+ AC_MSG_RESULT(found at $APXS)
+
+ AC_MSG_CHECKING([httpd version])
+ AC_EGREP_CPP(VERSION_OKAY,
+ [
+#include "$APXS_INCLUDE/ap_mmn.h"
+#if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0)
+VERSION_OKAY
+#endif],
+ [AC_MSG_RESULT([recent enough])],
+ [AC_MSG_RESULT([apache too old: mmn must be at least $HTTPD_WANTED_MMN])
+ if test "$APXS_EXPLICIT" != ""; then
+ AC_MSG_ERROR([Apache APXS build explicitly requested, but apache version is too old])
+ fi
+ APXS=""
+ ])
+
+ elif test "$APXS_EXPLICIT" != ""; then
+ AC_MSG_ERROR([no - APXS refers to an old version of Apache
+ Unable to locate $APXS_INCLUDE/mod_dav.h])
+ else
+ AC_MSG_RESULT(no - Unable to locate $APXS_INCLUDE/mod_dav.h)
+ APXS=""
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
+
+if test -n "$APXS" && test "$APXS" != "no"; then
+ AC_MSG_CHECKING([whether Apache version is compatible with APR version])
+ apr_major_version="${apr_version%%.*}"
+ case "$apr_major_version" in
+ 0)
+ apache_minor_version_wanted_regex="0"
+ ;;
+ 1)
+ apache_minor_version_wanted_regex=["[1-4]"]
+ ;;
+ 2)
+ apache_minor_version_wanted_regex=["[3-4]"]
+ ;;
+ *)
+ AC_MSG_ERROR([unknown APR version])
+ ;;
+ esac
+ old_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
+ AC_EGREP_CPP([apache_minor_version= *\"$apache_minor_version_wanted_regex\"],
+ [
+#include "$APXS_INCLUDE/ap_release.h"
+apache_minor_version=AP_SERVER_MINORVERSION],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Apache version incompatible with APR version])])
+ CPPFLAGS="$old_CPPFLAGS"
+fi
+
+AC_ARG_WITH(apache-libexecdir,
+ [AS_HELP_STRING([[--with-apache-libexecdir[=PATH]]],
+ [Install Apache modules to PATH instead of Apache's
+ configured modules directory; PATH "no"
+ or --without-apache-libexecdir means install
+ to LIBEXECDIR.])],
+[
+ APACHE_LIBEXECDIR="$withval"
+])
+
+if test -n "$APXS" && test "$APXS" != "no"; then
+ APXS_CC="`$APXS -q CC`"
+ APACHE_INCLUDES="$APACHE_INCLUDES -I$APXS_INCLUDE"
+
+ if test -z "$APACHE_LIBEXECDIR"; then
+ APACHE_LIBEXECDIR="`$APXS -q libexecdir`"
+ elif test "$APACHE_LIBEXECDIR" = 'no'; then
+ APACHE_LIBEXECDIR="$libexecdir"
+ fi
+
+ BUILD_APACHE_RULE=apache-mod
+ INSTALL_APACHE_RULE=install-mods-shared
+
+ case $host in
+ *-*-cygwin*)
+ APACHE_LDFLAGS="-shrext .so"
+ ;;
+ esac
+else
+ echo "=================================================================="
+ echo "WARNING: skipping the build of mod_dav_svn"
+ echo " try using --with-apxs"
+ echo "=================================================================="
+fi
+
+AC_SUBST(APXS)
+AC_SUBST(APACHE_LDFLAGS)
+AC_SUBST(APACHE_INCLUDES)
+AC_SUBST(APACHE_LIBEXECDIR)
+
+# there aren't any flags that interest us ...
+#if test -n "$APXS" && test "$APXS" != "no"; then
+# CFLAGS="$CFLAGS `$APXS -q CFLAGS CFLAGS_SHLIB`"
+#fi
+
+if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
+ echo "=================================================================="
+ echo "WARNING: You have chosen to compile Subversion with a different"
+ echo " compiler than the one used to compile Apache."
+ echo ""
+ echo " Current compiler: $CC"
+ echo " Apache's compiler: $APXS_CC"
+ echo ""
+ echo "This could cause some problems."
+ echo "=================================================================="
+fi
+
+])
diff --git a/build/ac-macros/apr.m4 b/build/ac-macros/apr.m4
new file mode 100644
index 0000000..6085717
--- /dev/null
+++ b/build/ac-macros/apr.m4
@@ -0,0 +1,151 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_APR(wanted_regex, alt_wanted_regex)
+dnl
+dnl 'wanted_regex' and 'alt_wanted_regex are regular expressions
+dnl that the apr version string must match.
+dnl
+dnl Check configure options and assign variables related to
+dnl the Apache Portable Runtime (APR) library.
+dnl
+
+AC_DEFUN(SVN_LIB_APR,
+[
+ APR_WANTED_REGEXES="$1"
+
+ AC_MSG_NOTICE([Apache Portable Runtime (APR) library configuration])
+
+ APR_FIND_APR("$abs_srcdir/apr", "$abs_builddir/apr", 1, [1 0])
+
+ if test $apr_found = "no"; then
+ AC_MSG_WARN([APR not found])
+ SVN_DOWNLOAD_APR
+ fi
+
+ if test $apr_found = "reconfig"; then
+ SVN_EXTERNAL_PROJECT([apr])
+ fi
+
+ dnl check APR version number against regex
+
+ AC_MSG_CHECKING([APR version])
+ apr_version="`$apr_config --version`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apr-config --version failed])
+ fi
+ AC_MSG_RESULT([$apr_version])
+
+ APR_WANTED_REGEX_MATCH=0
+ for apr_wanted_regex in $APR_WANTED_REGEXES; do
+ if test `expr $apr_version : $apr_wanted_regex` -ne 0; then
+ APR_WANTED_REGEX_MATCH=1
+ break
+ fi
+ done
+
+ if test $APR_WANTED_REGEX_MATCH -eq 0; then
+ echo "wanted regexes are $APR_WANTED_REGEXES"
+ AC_MSG_ERROR([invalid apr version found])
+ fi
+
+ dnl Get build information from APR
+
+ CPPFLAGS="$CPPFLAGS `$apr_config --cppflags`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apr-config --cppflags failed])
+ fi
+
+ CFLAGS="$CFLAGS `$apr_config --cflags`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apr-config --cflags failed])
+ fi
+
+ apr_ldflags="`$apr_config --ldflags`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apr-config --ldflags failed])
+ fi
+ LDFLAGS="$LDFLAGS `SVN_REMOVE_STANDARD_LIB_DIRS($apr_ldflags)`"
+
+ SVN_APR_INCLUDES="`$apr_config --includes`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apr-config --includes failed])
+ fi
+
+ SVN_APR_PREFIX="`$apr_config --prefix`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apr-config --prefix failed])
+ fi
+
+ if test "$enable_all_static" = "yes"; then
+ SVN_APR_LIBS="`$apr_config --link-ld --libs`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apr-config --link-ld --libs failed])
+ fi
+ else
+ SVN_APR_LIBS="`$apr_config --link-ld`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apr-config --link-ld failed])
+ fi
+ fi
+ SVN_APR_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS($SVN_APR_LIBS)`"
+
+ SVN_APR_SHLIB_PATH_VAR="`$apr_config --shlib-path-var`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apr-config --shlib-path-var failed])
+ fi
+
+ AC_SUBST(SVN_APR_PREFIX)
+ AC_SUBST(SVN_APR_CONFIG, ["$apr_config"])
+ AC_SUBST(SVN_APR_INCLUDES)
+ AC_SUBST(SVN_APR_LIBS)
+ AC_SUBST(SVN_APR_SHLIB_PATH_VAR)
+])
+
+dnl SVN_DOWNLOAD_APR()
+dnl no apr found, print out a message telling the user what to do
+AC_DEFUN(SVN_DOWNLOAD_APR,
+[
+ echo "The Apache Portable Runtime (APR) library cannot be found."
+ echo "Please install APR on this system and supply the appropriate"
+ echo "--with-apr option to 'configure'"
+ 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/branches/1.3.x \\"
+ echo " apr"
+ echo ""
+ echo "Run that right here in the top level of the Subversion tree."
+ echo "Afterwards, run apr/buildconf in that subdirectory and"
+ echo "then run configure again here."
+ echo ""
+ echo "Whichever of the above you do, you probably need to do"
+ echo "something similar for apr-util, either providing both"
+ echo "--with-apr and --with-apr-util to 'configure', or"
+ echo "getting both from SVN with:"
+ echo ""
+ echo " svn co \\"
+ echo " http://svn.apache.org/repos/asf/apr/apr-util/branches/1.3.x \\"
+ echo " apr-util"
+ echo ""
+ AC_MSG_ERROR([no suitable apr found])
+])
diff --git a/build/ac-macros/apr_memcache.m4 b/build/ac-macros/apr_memcache.m4
new file mode 100644
index 0000000..384a0e0
--- /dev/null
+++ b/build/ac-macros/apr_memcache.m4
@@ -0,0 +1,98 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_APR_MEMCACHE
+dnl
+dnl Check configure options and assign variables related to
+dnl the apr_memcache client library.
+dnl Sets svn_lib_apr_memcache to "yes" if memcache code is accessible
+dnl either from the standalone apr_memcache library or from apr-util.
+dnl
+
+AC_DEFUN(SVN_LIB_APR_MEMCACHE,
+[
+ apr_memcache_found=no
+
+ AC_ARG_WITH(apr_memcache,AC_HELP_STRING([--with-apr_memcache=PREFIX],
+ [Standalone apr_memcache client library]),
+ [
+ if test "$withval" = "yes" ; then
+ AC_MSG_ERROR([--with-apr_memcache requires an argument.])
+ else
+ AC_MSG_NOTICE([looking for separate apr_memcache package])
+ apr_memcache_prefix=$withval
+ save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES $SVN_APRUTIL_INCLUDES -I$apr_memcache_prefix/include/apr_memcache-0"
+ AC_CHECK_HEADER(apr_memcache.h,[
+ save_ldflags="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$apr_memcache_prefix/lib"
+ AC_CHECK_LIB(apr_memcache, apr_memcache_create,
+ [apr_memcache_found="standalone"])
+ LDFLAGS="$save_ldflags"])
+ CPPFLAGS="$save_cppflags"
+ fi
+ ], [
+ if test -d "$srcdir/apr_memcache"; then
+ apr_memcache_found=reconfig
+ else
+dnl Try just looking in apr-util (>= 1.3 has it already).
+ AC_MSG_NOTICE([looking for apr_memcache as part of apr-util])
+ save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES $SVN_APRUTIL_INCLUDES"
+ AC_CHECK_HEADER(apr_memcache.h,[
+ save_ldflags="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $SVN_APRUTIL_LIBS"
+ AC_CHECK_LIB(aprutil-1, apr_memcache_create,
+ [apr_memcache_found="aprutil"])
+ LDFLAGS="$save_ldflags"])
+ CPPFLAGS="$save_cppflags"
+
+ fi
+ ])
+
+
+ if test $apr_memcache_found = "reconfig"; then
+ SVN_EXTERNAL_PROJECT([apr_memcache], [--with-apr=$apr_config --with-apr-util=$apu_config])
+ apr_memcache_prefix=$prefix
+ SVN_APR_MEMCACHE_PREFIX="$apr_memcache_prefix"
+ SVN_APR_MEMCACHE_INCLUDES="-I$srcdir/memcache"
+ SVN_APR_MEMCACHE_LIBS="$abs_builddir/memcache/libapr_memcache.la"
+ fi
+
+ if test $apr_memcache_found = "standalone"; then
+ SVN_APR_MEMCACHE_PREFIX="$apr_memcache_prefix"
+ SVN_APR_MEMCACHE_INCLUDES="-I$apr_memcache_prefix/include/apr_memcache-0"
+ SVN_APR_MEMCACHE_LIBS="$apr_memcache_prefix/lib/libapr_memcache.la"
+ svn_lib_apr_memcache=yes
+ elif test $apr_memcache_found = "aprutil"; then
+dnl We are already linking apr-util everywhere, so no special treatement needed.
+ SVN_APR_MEMCACHE_PREFIX=""
+ SVN_APR_MEMCACHE_INCLUDES=""
+ SVN_APR_MEMCACHE_LIBS=""
+ svn_lib_apr_memcache=yes
+ elif test $apr_memcache_found = "reconfig"; then
+ svn_lib_apr_memcache=yes
+ else
+ svn_lib_apr_memcache=no
+ fi
+
+ AC_SUBST(SVN_APR_MEMCACHE_PREFIX)
+ AC_SUBST(SVN_APR_MEMCACHE_INCLUDES)
+ AC_SUBST(SVN_APR_MEMCACHE_LIBS)
+])
diff --git a/build/ac-macros/aprutil.m4 b/build/ac-macros/aprutil.m4
new file mode 100644
index 0000000..54f5e32
--- /dev/null
+++ b/build/ac-macros/aprutil.m4
@@ -0,0 +1,146 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_APRUTIL(wanted_regex, alt_wanted_regex)
+dnl
+dnl 'wanted_regex' and 'alt_wanted_regex are regular expressions
+dnl that the aprutil version string must match.
+dnl
+dnl Check configure options and assign variables related to
+dnl the Apache Portable Runtime Utilities (APRUTIL) library.
+dnl
+dnl If there is an apr-util source directory, there *must* be a
+dnl corresponding apr source directory. APRUTIL's build system
+dnl is too tied in with apr. (You can't use an installed APR and
+dnl a source APR-util.)
+dnl
+
+
+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
+
+ dnl check APRUTIL version number against regex
+
+ AC_MSG_CHECKING([APR-UTIL version])
+ apu_version="`$apu_config --version`"
+ if test $? -ne 0; then
+ # This is a hack as suggested by Ben Collins-Sussman. It can be
+ # removed after apache 2.0.44 has been released. (The apu-config
+ # shipped in 2.0.43 contains a correct version number, but
+ # stupidly doesn't understand the --version switch.)
+ apu_version=`grep "APRUTIL_DOTTED_VERSION=" $(which $apu_config) | tr -d "APRUTIL_DOTTED_VERSION="| tr -d '"'`
+ #AC_MSG_ERROR([
+ # apu-config --version failed.
+ # Your apu-config doesn't support the --version switch, please upgrade
+ # to APR-UTIL more recent than 2002-Nov-05.])
+ 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
+
+ dnl Get libraries and thread flags from APRUTIL ---------------------
+
+ apu_ldflags="`$apu_config --ldflags`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apu-config --ldflags failed])
+ fi
+ LDFLAGS="$LDFLAGS `SVN_REMOVE_STANDARD_LIB_DIRS($apu_ldflags)`"
+
+ 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
+
+ if test "$enable_all_static" = "yes"; then
+ SVN_APRUTIL_LIBS="`$apu_config --link-ld --libs`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apu-config --link-ld --libs failed])
+ fi
+ else
+ SVN_APRUTIL_LIBS="`$apu_config --link-ld`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([apu-config --link-ld failed])
+ fi
+ fi
+ SVN_APRUTIL_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS($SVN_APRUTIL_LIBS)`"
+
+ AC_SUBST(SVN_APRUTIL_INCLUDES)
+ AC_SUBST(SVN_APRUTIL_CONFIG, ["$apu_config"])
+ AC_SUBST(SVN_APRUTIL_LIBS)
+ AC_SUBST(SVN_APRUTIL_PREFIX)
+
+ dnl What version of Expat are we using? -----------------
+ 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
+])
+
+dnl SVN_DOWNLOAD_APRUTIL()
+dnl no apr-util found, print out a message telling the user what to do
+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.3.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])
+])
diff --git a/build/ac-macros/berkeley-db.m4 b/build/ac-macros/berkeley-db.m4
new file mode 100644
index 0000000..b507d51
--- /dev/null
+++ b/build/ac-macros/berkeley-db.m4
@@ -0,0 +1,246 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_BERKELEY_DB(major, minor, patch)
+dnl
+dnl Compare if the Berkeley DB specified by user or provided by APR-UTIL
+dnl is no older than the version given by MAJOR, MINOR, and PATCH.
+dnl
+dnl If we find a useable version, set the shell variable
+dnl `svn_lib_berkeley_db' to `yes'. Otherwise, set `svn_lib_berkeley_db'
+dnl to `no'.
+dnl
+dnl This macro also checks for the `--with-berkeley-db=ARG' flag;
+dnl if given, the macro will use the ARG specified, and the
+dnl configuration script will die if it can't find the library. If
+dnl the user gives the `--without-berkeley-db' flag, the entire
+dnl search is skipped.
+
+
+AC_DEFUN(SVN_LIB_BERKELEY_DB,
+[
+ db_version=$1.$2.$3
+ dnl Process the `with-berkeley-db' switch. We set `status' to one
+ dnl of the following values:
+ dnl `required' --- the user specified that they did want to use
+ dnl Berkeley DB, so abort the configuration if we cannot find it.
+ dnl `try-link' --- See if APR-UTIL supplies the correct DB version;
+ dnl if it doesn't, just do not build the bdb based filesystem.
+ dnl `skip' --- Do not look for Berkeley DB, and do not build the
+ dnl bdb based filesystem.
+
+ AC_ARG_WITH(berkeley-db, [AS_HELP_STRING(
+ [[--with-berkeley-db[=HEADER:INCLUDES:LIB_SEARCH_DIRS:LIBS]]], [
+ The Subversion Berkeley DB based filesystem library
+ requires Berkeley DB $db_version or newer. If you
+ specify `--without-berkeley-db', that library will
+ not be built. If you omit the argument of this option
+ completely, the configure script will use Berkeley DB
+ used by APR-UTIL.])],
+ [
+ if test "$withval" = "no"; then
+ status=skip
+ elif test "$withval" = "yes"; then
+ apu_db_version="`$apu_config --db-version`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([Can't determine whether apr-util is linked against a
+ proper version of Berkeley DB.])
+ fi
+
+ if test "$withval" = "yes"; then
+ if test "$apu_db_version" -lt "4"; then
+ AC_MSG_ERROR([APR-UTIL was linked against Berkeley DB version $apu_db_version,
+ while version 4 or higher is required. Reinstall
+ APR-UTIL with the appropriate options.])
+ fi
+
+ status=required
+
+ elif test "$apu_found" != "reconfig"; then
+ if test "$apu_db_version" -lt 4; then
+ AC_MSG_ERROR([APR-UTIL was installed independently, it won't be
+ possible to use the specified Berkeley DB: $withval])
+ fi
+
+ status=required
+ fi
+ else
+ if echo "$withval" | $EGREP ":.*:.*:" > /dev/null; then
+ svn_berkeley_db_header=["`echo "$withval" | $SED -e "s/\([^:]*\):.*/\1/"`"]
+ SVN_DB_INCLUDES=""
+ for i in [`echo "$withval" | $SED -e "s/.*:\([^:]*\):[^:]*:.*/\1/"`]; do
+ SVN_DB_INCLUDES="$SVN_DB_INCLUDES -I$i"
+ done
+ SVN_DB_INCLUDES="${SVN_DB_INCLUDES## }"
+ for l in [`echo "$withval" | $SED -e "s/.*:[^:]*:\([^:]*\):.*/\1/"`]; do
+ LDFLAGS="$LDFLAGS -L$l"
+ done
+ SVN_DB_LIBS=""
+ for l in [`echo "$withval" | $SED -e "s/.*:\([^:]*\)/\1/"`]; do
+ SVN_DB_LIBS="$SVN_DB_LIBS -l$l"
+ done
+ SVN_DB_LIBS="${SVN_DB_LIBS## }"
+
+ status=required
+ else
+ AC_MSG_ERROR([Invalid syntax of argument of --with-berkeley-db option])
+ fi
+ fi
+ ],
+ [
+ # No --with-berkeley-db option:
+ #
+ # Check if APR-UTIL is providing the correct Berkeley DB version
+ # for us.
+ #
+ apu_db_version="`$apu_config --db-version`"
+ if test $? -ne 0; then
+ AC_MSG_WARN([Detected older version of APR-UTIL, trying to determine
+ whether apr-util is linked against Berkeley DB
+ $db_version])
+ status=try-link
+ elif test "$apu_db_version" -lt "4"; then
+ status=skip
+ else
+ status=try-link
+ fi
+ ])
+
+ if test "$status" = "skip"; then
+ svn_lib_berkeley_db=no
+ else
+ AC_MSG_CHECKING([for availability of Berkeley DB])
+ SVN_LIB_BERKELEY_DB_TRY($1, $2, $3)
+ if test "$svn_have_berkeley_db" = "yes"; then
+ AC_MSG_RESULT([yes])
+ svn_lib_berkeley_db=yes
+ else
+ AC_MSG_RESULT([no])
+ svn_lib_berkeley_db=no
+ if test "$status" = "required"; then
+ AC_MSG_ERROR([Berkeley DB $db_version or newer wasn't found.])
+ fi
+ fi
+ fi
+])
+
+
+dnl SVN_LIB_BERKELEY_DB_TRY(major, minor, patch)
+dnl
+dnl A subroutine of SVN_LIB_BERKELEY_DB.
+dnl
+dnl Check that a new-enough version of Berkeley DB is installed.
+dnl "New enough" means no older than the version given by MAJOR,
+dnl MINOR, and PATCH. The result of the test is not cached; no
+dnl messages are printed.
+dnl
+dnl Set the shell variable `svn_have_berkeley_db' to `yes' if we found
+dnl an appropriate version, or `no' otherwise.
+dnl
+dnl This macro uses the Berkeley DB library function `db_version' to
+dnl find the version. If the Berkeley DB library doesn't have this
+dnl function, then this macro assumes it is too old.
+
+dnl NOTE: This is pretty messed up. It seems that the FreeBSD port of
+dnl Berkeley DB 4 puts the header file in /usr/local/include/db4, but the
+dnl database library in /usr/local/lib, as libdb4.[a|so]. There is no
+dnl /usr/local/include/db.h. So if you check for /usr/local first, you'll
+dnl get the old header file from /usr/include, and the new library from
+dnl /usr/local/lib. Disaster. Thus this test compares the version constants
+dnl in the db.h header with the ones returned by db_version().
+
+
+AC_DEFUN(SVN_LIB_BERKELEY_DB_TRY,
+ [
+ svn_lib_berkeley_db_try_save_cppflags="$CPPFLAGS"
+ svn_lib_berkeley_db_try_save_libs="$LIBS"
+
+ svn_check_berkeley_db_major=$1
+ svn_check_berkeley_db_minor=$2
+ svn_check_berkeley_db_patch=$3
+
+ # Extract only the -ldb.* flag from the libs supplied by apu-config
+ # Otherwise we get bit by the fact that expat might not be built yet
+ # Or that it resides in a non-standard location which we would have
+ # to compensate with using something like -R`$apu_config --prefix`/lib.
+ #
+ SVN_DB_LIBS=["${SVN_DB_LIBS-`$apu_config --libs | $SED -e 's/.*\(-ldb[^[:space:]]*\).*/\1/' | $EGREP -- '-ldb[^[:space:]]*'`}"]
+
+ CPPFLAGS="$SVN_DB_INCLUDES $SVN_APRUTIL_INCLUDES $CPPFLAGS"
+ LIBS="`$apu_config --ldflags` $SVN_DB_LIBS $LIBS"
+
+ if test -n "$svn_berkeley_db_header"; then
+ SVN_DB_HEADER="#include <$svn_berkeley_db_header>"
+ svn_db_header="#include <$svn_berkeley_db_header>"
+ else
+ SVN_DB_HEADER="#include <apu_want.h>"
+ svn_db_header="#define APU_WANT_DB
+#include <apu_want.h>"
+ fi
+
+ AH_BOTTOM(
+#ifdef SVN_WANT_BDB
+#define APU_WANT_DB
+@SVN_DB_HEADER@
+#endif
+)
+
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdlib.h>
+$svn_db_header
+
+int main ()
+{
+ int major, minor, patch;
+
+ db_version (&major, &minor, &patch);
+
+ /* Sanity check: ensure that db.h constants actually match the db library */
+ if (major != DB_VERSION_MAJOR
+ || minor != DB_VERSION_MINOR
+ || patch != DB_VERSION_PATCH)
+ exit (1);
+
+ /* Run-time check: ensure the library claims to be the correct version. */
+
+ if (major < $svn_check_berkeley_db_major)
+ exit (1);
+ if (major > $svn_check_berkeley_db_major)
+ exit (0);
+
+ if (minor < $svn_check_berkeley_db_minor)
+ exit (1);
+ if (minor > $svn_check_berkeley_db_minor)
+ exit (0);
+
+ if (patch >= $svn_check_berkeley_db_patch)
+ exit (0);
+ else
+ exit (1);
+}
+ ]])],
+ [svn_have_berkeley_db=yes],
+ [svn_have_berkeley_db=no],
+ [svn_have_berkeley_db=yes]
+ )
+
+ CPPFLAGS="$svn_lib_berkeley_db_try_save_cppflags"
+ LIBS="$svn_lib_berkeley_db_try_save_libs"
+ ]
+)
diff --git a/build/ac-macros/ctypesgen.m4 b/build/ac-macros/ctypesgen.m4
new file mode 100644
index 0000000..e78db7e
--- /dev/null
+++ b/build/ac-macros/ctypesgen.m4
@@ -0,0 +1,78 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl ctypesgen.m4: Locates ctypesgen for building/installing ctypes-python.
+dnl
+
+AC_DEFUN(SVN_CHECK_CTYPESGEN,
+[
+ AC_ARG_WITH(ctypesgen,
+ AS_HELP_STRING([--with-ctypesgen=PATH],
+ [Specify the path to ctypesgen. This can either
+ be the full path to a ctypesgen installation,
+ the full path to a ctypesgen source tree or the
+ full path to ctypesgen.py.]),
+ [
+ case "$withval" in
+ "no")
+ SVN_FIND_CTYPESGEN(no)
+ ;;
+ "yes")
+ SVN_FIND_CTYPESGEN(check)
+ ;;
+ *)
+ SVN_FIND_CTYPESGEN($withval)
+ ;;
+ esac
+ ],
+ [
+ SVN_FIND_CTYPESGEN(check)
+ ])
+])
+
+AC_DEFUN(SVN_FIND_CTYPESGEN,
+[
+ where=$1
+
+ CTYPESGEN=none
+
+ if test $where = check; then
+ AC_PATH_PROG(CTYPESGEN, "ctypesgen.py", none)
+ elif test $where != no; then
+ AC_MSG_CHECKING([for ctypesgen.py])
+
+ if test -f "$where"; then
+ CTYPESGEN="$where"
+ elif test -f "$where/bin/ctypesgen.py"; then
+ CTYPESGEN="$where/bin/ctypesgen.py"
+ else
+ CTYPESGEN="$where/ctypesgen.py"
+ fi
+
+ if test ! -f "$CTYPESGEN" || test ! -x "$CTYPESGEN"; then
+ AC_MSG_ERROR([Could not find ctypesgen at $where/ctypesgen.py or at
+ $where/bin/ctypesgen.py])
+ else
+ AC_MSG_RESULT([$CTYPESGEN])
+ fi
+ fi
+
+ dnl We use CTYPESGEN in the Makefile
+ AC_SUBST(CTYPESGEN)
+])
diff --git a/build/ac-macros/find_apr.m4 b/build/ac-macros/find_apr.m4
new file mode 100644
index 0000000..f5b4e06
--- /dev/null
+++ b/build/ac-macros/find_apr.m4
@@ -0,0 +1,168 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl find_apr.m4 : locate the APR include files and libraries
+dnl
+dnl This macro file can be used by applications to find and use the APR
+dnl library. It provides a standardized mechanism for using APR. It supports
+dnl embedding APR into the application source, or locating an installed
+dnl copy of APR.
+dnl
+dnl APR_FIND_APR(srcdir, builddir, implicit-install-check, acceptable-majors)
+dnl
+dnl where srcdir is the location of the bundled APR source directory, or
+dnl empty if source is not bundled.
+dnl
+dnl where builddir is the location where the bundled APR will will be built,
+dnl or empty if the build will occur in the srcdir.
+dnl
+dnl where implicit-install-check set to 1 indicates if there is no
+dnl --with-apr option specified, we will look for installed copies.
+dnl
+dnl where acceptable-majors is a space separated list of acceptable major
+dnl version numbers. Often only a single major version will be acceptable.
+dnl If multiple versions are specified, and --with-apr=PREFIX or the
+dnl implicit installed search are used, then the first (leftmost) version
+dnl in the list that is found will be used. Currently defaults to [0 1].
+dnl
+dnl Sets the following variables on exit:
+dnl
+dnl apr_found : "yes", "no", "reconfig"
+dnl
+dnl apr_config : If the apr-config tool exists, this refers to it. If
+dnl apr_found is "reconfig", then the bundled directory
+dnl should be reconfigured *before* using apr_config.
+dnl
+dnl Note: this macro file assumes that apr-config has been installed; it
+dnl is normally considered a required part of an APR installation.
+dnl
+dnl If a bundled source directory is available and needs to be (re)configured,
+dnl then apr_found is set to "reconfig". The caller should reconfigure the
+dnl (passed-in) source directory, placing the result in the build directory,
+dnl as appropriate.
+dnl
+dnl If apr_found is "yes" or "reconfig", then the caller should use the
+dnl value of apr_config to fetch any necessary build/link information.
+dnl
+
+AC_DEFUN([APR_FIND_APR], [
+ apr_found="no"
+
+ if test "$ac_cv_emxos2" = "yes"; then
+ # Scripts don't pass test -x on OS/2
+ TEST_X="test -f"
+ else
+ TEST_X="test -x"
+ fi
+
+ ifelse([$4], [], [
+ ifdef(AC_WARNING,AC_WARNING([$0: missing argument 4 (acceptable-majors): Defaulting to APR 0.x then APR 1.x]))
+ acceptable_majors="0 1"],
+ [acceptable_majors="$4"])
+
+ apr_temp_acceptable_apr_config=""
+ for apr_temp_major in $acceptable_majors
+ do
+ case $apr_temp_major in
+ 0)
+ apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-config"
+ ;;
+ *)
+ apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-$apr_temp_major-config"
+ ;;
+ esac
+ done
+
+ AC_MSG_CHECKING(for APR)
+ AC_ARG_WITH(apr,
+ [ --with-apr=PATH prefix for installed APR, path to APR build tree,
+ or the full path to apr-config],
+ [
+ if test "$withval" = "no" || test "$withval" = "yes"; then
+ AC_MSG_ERROR([--with-apr requires a directory or file to be provided])
+ fi
+
+ for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
+ do
+ for lookdir in "$withval/bin" "$withval"
+ do
+ if $TEST_X "$lookdir/$apr_temp_apr_config_file"; then
+ apr_found="yes"
+ apr_config="$lookdir/$apr_temp_apr_config_file"
+ break 2
+ fi
+ done
+ done
+
+ if test "$apr_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
+ apr_found="yes"
+ apr_config="$withval"
+ fi
+
+ dnl if --with-apr is used, it is a fatal error for its argument
+ dnl to be invalid
+ if test "$apr_found" != "yes"; then
+ AC_MSG_ERROR([the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.])
+ fi
+ ],[
+ dnl if we have a bundled source directory, use it
+ if test -d "$1"; then
+ apr_temp_abs_srcdir="`cd $1 && pwd`"
+ apr_found="reconfig"
+ apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apr_version.h\"`"
+ case $apr_bundled_major in
+ "")
+ AC_MSG_ERROR([failed to find major version of bundled APR])
+ ;;
+ 0)
+ apr_temp_apr_config_file="apr-config"
+ ;;
+ *)
+ apr_temp_apr_config_file="apr-$apr_bundled_major-config"
+ ;;
+ esac
+ if test -n "$2"; then
+ apr_config="$2/$apr_temp_apr_config_file"
+ else
+ apr_config="$1/$apr_temp_apr_config_file"
+ fi
+ fi
+ if test "$apr_found" = "no" && test -n "$3" && test "$3" = "1"; then
+ for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
+ do
+ if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then
+ apr_found="yes"
+ apr_config="$apr_temp_apr_config_file"
+ break
+ else
+ dnl look in some standard places (apparently not in builtin/default)
+ for lookdir in /usr /usr/local /opt/apr /usr/local/apache2 ; do
+ if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then
+ apr_found="yes"
+ apr_config="$lookdir/bin/$apr_temp_apr_config_file"
+ break 2
+ fi
+ done
+ fi
+ done
+ fi
+ ])
+
+ AC_MSG_RESULT($apr_found)
+])
diff --git a/build/ac-macros/find_apu.m4 b/build/ac-macros/find_apu.m4
new file mode 100644
index 0000000..84286db
--- /dev/null
+++ b/build/ac-macros/find_apu.m4
@@ -0,0 +1,178 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl find_apu.m4 : locate the APR-util (APU) include files and libraries
+dnl
+dnl This macro file can be used by applications to find and use the APU
+dnl library. It provides a standardized mechanism for using APU. It supports
+dnl embedding APU into the application source, or locating an installed
+dnl copy of APU.
+dnl
+dnl APR_FIND_APU(srcdir, builddir, implicit-install-check, acceptable-majors)
+dnl
+dnl where srcdir is the location of the bundled APU source directory, or
+dnl empty if source is not bundled.
+dnl
+dnl where builddir is the location where the bundled APU will be built,
+dnl or empty if the build will occur in the srcdir.
+dnl
+dnl where implicit-install-check set to 1 indicates if there is no
+dnl --with-apr-util option specified, we will look for installed copies.
+dnl
+dnl where acceptable-majors is a space separated list of acceptable major
+dnl version numbers. Often only a single major version will be acceptable.
+dnl If multiple versions are specified, and --with-apr-util=PREFIX or the
+dnl implicit installed search are used, then the first (leftmost) version
+dnl in the list that is found will be used. Currently defaults to [0 1].
+dnl
+dnl Sets the following variables on exit:
+dnl
+dnl apu_found : "yes", "no", "reconfig"
+dnl
+dnl apu_config : If the apu-config tool exists, this refers to it. If
+dnl apu_found is "reconfig", then the bundled directory
+dnl should be reconfigured *before* using apu_config.
+dnl
+dnl Note: this macro file assumes that apr-config has been installed; it
+dnl is normally considered a required part of an APR installation.
+dnl
+dnl Note: At this time, we cannot find *both* a source dir and a build dir.
+dnl If both are available, the build directory should be passed to
+dnl the --with-apr-util switch.
+dnl
+dnl Note: the installation layout is presumed to follow the standard
+dnl PREFIX/lib and PREFIX/include pattern. If the APU config file
+dnl is available (and can be found), then non-standard layouts are
+dnl possible, since it will be described in the config file.
+dnl
+dnl If a bundled source directory is available and needs to be (re)configured,
+dnl then apu_found is set to "reconfig". The caller should reconfigure the
+dnl (passed-in) source directory, placing the result in the build directory,
+dnl as appropriate.
+dnl
+dnl If apu_found is "yes" or "reconfig", then the caller should use the
+dnl value of apu_config to fetch any necessary build/link information.
+dnl
+
+AC_DEFUN([APR_FIND_APU], [
+ apu_found="no"
+
+ if test "$ac_cv_emxos2" = "yes"; then
+ # Scripts don't pass test -x on OS/2
+ TEST_X="test -f"
+ else
+ TEST_X="test -x"
+ fi
+
+ ifelse([$4], [],
+ [
+ ifdef(AC_WARNING,([$0: missing argument 4 (acceptable-majors): Defaulting to APU 0.x then APU 1.x]))
+ acceptable_majors="0 1"
+ ], [acceptable_majors="$4"])
+
+ apu_temp_acceptable_apu_config=""
+ for apu_temp_major in $acceptable_majors
+ do
+ case $apu_temp_major in
+ 0)
+ apu_temp_acceptable_apu_config="$apu_temp_acceptable_apu_config apu-config"
+ ;;
+ *)
+ apu_temp_acceptable_apu_config="$apu_temp_acceptable_apu_config apu-$apu_temp_major-config"
+ ;;
+ esac
+ done
+
+ AC_MSG_CHECKING(for APR-util)
+ AC_ARG_WITH(apr-util,
+ [ --with-apr-util=PATH prefix for installed APU, path to APU build tree,
+ or the full path to apu-config],
+ [
+ if test "$withval" = "no" || test "$withval" = "yes"; then
+ AC_MSG_ERROR([--with-apr-util requires a directory or file to be provided])
+ fi
+
+ for apu_temp_apu_config_file in $apu_temp_acceptable_apu_config
+ do
+ for lookdir in "$withval/bin" "$withval"
+ do
+ if $TEST_X "$lookdir/$apu_temp_apu_config_file"; then
+ apu_found="yes"
+ apu_config="$lookdir/$apu_temp_apu_config_file"
+ break 2
+ fi
+ done
+ done
+
+ if test "$apu_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
+ apu_found="yes"
+ apu_config="$withval"
+ fi
+
+ dnl if --with-apr-util is used, it is a fatal error for its argument
+ dnl to be invalid
+ if test "$apu_found" != "yes"; then
+ AC_MSG_ERROR([the --with-apr-util parameter is incorrect. It must specify an install prefix, a build directory, or an apu-config file.])
+ fi
+ ],[
+ dnl if we have a bundled source directory, use it
+ if test -d "$1"; then
+ apu_temp_abs_srcdir="`cd $1 && pwd`"
+ apu_found="reconfig"
+ apu_bundled_major="`sed -n '/#define.*APU_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apu_version.h\"`"
+ case $apu_bundled_major in
+ "")
+ AC_MSG_ERROR([failed to find major version of bundled APU])
+ ;;
+ 0)
+ apu_temp_apu_config_file="apu-config"
+ ;;
+ *)
+ apu_temp_apu_config_file="apu-$apu_bundled_major-config"
+ ;;
+ esac
+ if test -n "$2"; then
+ apu_config="$2/$apu_temp_apu_config_file"
+ else
+ apu_config="$1/$apu_temp_apu_config_file"
+ fi
+ fi
+ if test "$apu_found" = "no" && test -n "$3" && test "$3" = "1"; then
+ for apu_temp_apu_config_file in $apu_temp_acceptable_apu_config
+ do
+ if $apu_temp_apu_config_file --help > /dev/null 2>&1 ; then
+ apu_found="yes"
+ apu_config="$apu_temp_apu_config_file"
+ break
+ else
+ dnl look in some standard places (apparently not in builtin/default)
+ for lookdir in /usr /usr/local /opt/apr /usr/local/apache2 ; do
+ if $TEST_X "$lookdir/bin/$apu_temp_apu_config_file"; then
+ apu_found="yes"
+ apu_config="$lookdir/bin/$apu_temp_apu_config_file"
+ break 2
+ fi
+ done
+ fi
+ done
+ fi
+ ])
+
+ AC_MSG_RESULT($apu_found)
+])
diff --git a/build/ac-macros/gssapi.m4 b/build/ac-macros/gssapi.m4
new file mode 100644
index 0000000..8a8dc31
--- /dev/null
+++ b/build/ac-macros/gssapi.m4
@@ -0,0 +1,82 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_GSSAPI
+dnl
+dnl Check configure options and assign variables related to
+dnl the gssapi library.
+dnl
+
+AC_DEFUN(SVN_LIB_RA_SERF_GSSAPI,
+[
+ AC_ARG_WITH(gssapi,
+ [AS_HELP_STRING([[--with-gssapi[=PREFIX]]],
+ [GSSAPI (Kerberos) support])],
+ [svn_lib_gssapi="$withval"],
+ [svn_lib_gssapi="no"])
+
+ AC_MSG_CHECKING([whether to look for GSSAPI (Kerberos)])
+ if test "$svn_lib_gssapi" != "no"; then
+ AC_MSG_RESULT([yes])
+ if test "$svn_lib_gssapi" != "yes"; then
+ AC_MSG_CHECKING([for krb5-config])
+ KRB5_CONFIG="$svn_lib_gssapi/bin/krb5-config"
+ if test -f "$KRB5_CONFIG" && test -x "$KRB5_CONFIG"; then
+ AC_MSG_RESULT([yes])
+ else
+ KRB5_CONFIG=""
+ AC_MSG_RESULT([no])
+ fi
+ else
+ AC_PATH_PROG(KRB5_CONFIG, krb5-config)
+ fi
+ if test -n "$KRB5_CONFIG"; then
+ AC_MSG_CHECKING([for GSSAPI (Kerberos)])
+ old_CPPFLAGS="$CPPFLAGS"
+ old_CFLAGS="$CFLAGS"
+ old_LIBS="$LIBS"
+ CFLAGS=""
+ SVN_GSSAPI_INCLUDES="`$KRB5_CONFIG --cflags`"
+ SVN_GSSAPI_LIBS="`$KRB5_CONFIG --libs gssapi`"
+ SVN_GSSAPI_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS($SVN_GSSAPI_LIBS)`"
+ CPPFLAGS="$CPPFLAGS $SVN_GSSAPI_INCLUDES"
+ CFLAGS="$old_CFLAGS"
+ LIBS="$LIBS $SVN_GSSAPI_LIBS"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[
+#include <gssapi.h>
+int main()
+{gss_init_sec_context(NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL);}]])],
+ svn_lib_gssapi="yes", svn_lib_gssapi="no")
+ if test "$svn_lib_gssapi" = "yes"; then
+ AC_MSG_RESULT([yes])
+ CPPFLAGS="$old_CPPFLAGS"
+ LIBS="$old_LIBS"
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([cannot find GSSAPI (Kerberos)])
+ fi
+ else
+ AC_MSG_ERROR([cannot find krb5-config])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ fi
+ AC_SUBST(SVN_GSSAPI_INCLUDES)
+ AC_SUBST(SVN_GSSAPI_LIBS)
+])
diff --git a/build/ac-macros/java.m4 b/build/ac-macros/java.m4
new file mode 100644
index 0000000..9ef4015
--- /dev/null
+++ b/build/ac-macros/java.m4
@@ -0,0 +1,215 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl java.m4: Locates the JDK and its include files and libraries.
+dnl
+
+AC_DEFUN(SVN_CHECK_JDK,
+[
+ JAVA_OLDEST_WORKING_VER="$1"
+ AC_ARG_WITH(jdk,
+ AS_HELP_STRING([--with-jdk=PATH],
+ [Try to use 'PATH/include' to find the JNI
+ headers. If PATH is not specified, look
+ for a Java Development Kit at JAVA_HOME.]),
+ [
+ case "$withval" in
+ "no")
+ JDK_SUITABLE=no
+ ;;
+ "yes")
+ SVN_FIND_JDK(check, $JAVA_OLDEST_WORKING_VER)
+ ;;
+ *)
+ SVN_FIND_JDK($withval, $JAVA_OLDEST_WORKING_VER)
+ ;;
+ esac
+ ],
+ [
+ SVN_FIND_JDK(check, $JAVA_OLDEST_WORKING_VER)
+ ])
+])
+
+AC_DEFUN(SVN_FIND_JDK,
+[
+ where=$1
+ JAVA_OLDEST_WORKING_VER="$2"
+
+ JDK=none
+ JAVA_BIN=none
+ JAVADOC=none
+ JAVAC=none
+ JAVAH=none
+ JAR=none
+ JNI_INCLUDES=none
+
+ JDK_SUITABLE=no
+ AC_MSG_CHECKING([for JDK])
+ if test $where = check; then
+ dnl Prefer /Library/Java/Home first to try to be nice on Darwin.
+ dnl We'll correct later if we get caught in the tangled web of JAVA_HOME.
+ if test -x "$JAVA_HOME/bin/java"; then
+ JDK="$JAVA_HOME"
+ elif test -x "/Library/Java/Home/bin/java"; then
+ JDK="/Library/Java/Home"
+ elif test -x "/usr/bin/java"; then
+ JDK="/usr"
+ elif test -x "/usr/local/bin/java"; then
+ JDK="/usr/local"
+ fi
+ else
+ JDK=$where
+ fi
+
+ dnl Correct for Darwin's odd JVM layout. Ideally, we should use realpath,
+ dnl but Darwin doesn't have that utility. /usr/bin/java is a symlink into
+ dnl /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Commands
+ dnl See http://developer.apple.com/qa/qa2001/qa1170.html
+ os_arch="`uname`"
+ if test "$os_arch" = "Darwin"; then
+ OSX_VER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`
+
+ if test "$OSX_VER" = "10.4"; then
+ dnl For OS X 10.4, the SDK version is 10.4u instead of 10.4.
+ OSX_VER="10.4u"
+ fi
+
+ OSX_SYS_JAVA_FRAMEWORK="/System/Library/Frameworks/JavaVM.framework"
+ OSX_SDK_JAVA_FRAMEWORK="/Developer/SDKs/MacOSX$OSX_VER.sdk/System/Library"
+ OSX_SDK_JAVA_FRAMEWORK="$OSX_SDK_JAVA_FRAMEWORK/Frameworks/JavaVM.framework"
+ fi
+
+ if test "$os_arch" = "Darwin" && test "$JDK" = "/usr" &&
+ test -d "/Library/Java/Home"; then
+ JDK="/Library/Java/Home"
+ fi
+
+ if test "$os_arch" = "Darwin" && test "$JDK" = "/Library/Java/Home"; then
+ JRE_LIB_DIR="$OSX_SYS_JAVA_FRAMEWORK/Classes"
+ else
+ JRE_LIB_DIR="$JDK/jre/lib"
+ fi
+
+ if test -f "$JDK/include/jni.h"; then
+ dnl This *must* be fully expanded, or we'll have problems later in find.
+ JNI_INCLUDEDIR="$JDK/include"
+ JDK_SUITABLE=yes
+ elif test "$os_arch" = "Darwin" && test -e "$JDK/Headers/jni.h"; then
+ dnl Search the Headers directory in the JDK
+ JNI_INCLUDEDIR="$JDK/Headers"
+ JDK_SUITABLE=yes
+ elif test "$os_arch" = "Darwin" &&
+ test -e "$OSX_SYS_JAVA_FRAMEWORK/Headers/jni.h"; then
+ dnl Search the System framework's Headers directory
+ JNI_INCLUDEDIR="$OSX_SYS_JAVA_FRAMEWORK/Headers"
+ JDK_SUITABLE=yes
+ elif test "$os_arch" = "Darwin" &&
+ test -e "$OSX_SDK_JAVA_FRAMEWORK/Headers/jni.h"; then
+ dnl Search the SDK's System framework's Headers directory
+ JNI_INCLUDEDIR="$OSX_SDK_JAVA_FRAMEWORK/Headers"
+ JDK_SUITABLE=yes
+ else
+ JDK_SUITABLE=no
+ fi
+ if test "$JDK_SUITABLE" = "yes"; then
+ AC_MSG_RESULT([$JNI_INCLUDEDIR/jni.h])
+ else
+ AC_MSG_RESULT([no])
+ if test "$where" != "check"; then
+ AC_MSG_WARN([no JNI header files found.])
+ if test "$os_arch" = "Darwin"; then
+ AC_MSG_WARN([You may need to install the latest Java Development package from http://connect.apple.com/. Apple no longer includes the JNI header files by default on Java updates.])
+ fi
+ fi
+ fi
+
+ if test "$JDK_SUITABLE" = "yes"; then
+ JAVA_BIN='$(JDK)/bin'
+
+ JAVA="$JAVA_BIN/java"
+ JAVAC="$JAVA_BIN/javac"
+ JAVAH="$JAVA_BIN/javah"
+ JAVADOC="$JAVA_BIN/javadoc"
+ JAR="$JAVA_BIN/jar"
+
+ dnl Prefer Jikes (for speed) if available.
+ jikes_options="/usr/local/bin/jikes /usr/bin/jikes"
+ AC_ARG_WITH(jikes,
+ AS_HELP_STRING([--with-jikes=PATH],
+ [Specify the path to a jikes binary to use
+ it as your Java compiler. The default is to
+ look for jikes (PATH optional). This behavior
+ can be switched off by supplying 'no'.]),
+ [
+ if test "$withval" != "no" && test "$withval" != "yes"; then
+ dnl Assume a path was provided.
+ jikes_options="$withval $jikes_options"
+ fi
+ requested_jikes="$withval" # will be 'yes' if path unspecified
+ ])
+ if test "$requested_jikes" != "no"; then
+ dnl Look for a usable jikes binary.
+ for jikes in $jikes_options; do
+ if test -z "$jikes_found" && test -x "$jikes"; then
+ jikes_found="yes"
+ JAVAC="$jikes"
+ JAVA_CLASSPATH="$JRE_LIB_DIR"
+ for jar in $JRE_LIB_DIR/*.jar; do
+ JAVA_CLASSPATH="$JAVA_CLASSPATH:$jar"
+ done
+ fi
+ done
+ fi
+ if test -n "$requested_jikes" && test "$requested_jikes" != "no"; then
+ dnl Jikes was explicitly requested. Verify that it was provided.
+ if test -z "$jikes_found"; then
+ AC_MSG_ERROR([Could not find a usable version of Jikes])
+ elif test -n "$jikes_found" && test "$requested_jikes" != "yes" &&
+ test "$JAVAC" != "$requested_jikes"; then
+ AC_MSG_WARN([--with-jikes PATH was invalid, substitute found])
+ fi
+ fi
+
+ dnl Add javac flags.
+ # The release for "-source" could actually be greater than that
+ # of "-target", if we want to cross-compile for lesser JVMs.
+ if test -z "$JAVAC_FLAGS"; then
+ JAVAC_FLAGS="-target $JAVA_OLDEST_WORKING_VER -source 1.5"
+ if test "$enable_debugging" = "yes"; then
+ JAVAC_FLAGS="-g -Xlint:unchecked $JAVAC_FLAGS"
+ fi
+ fi
+
+ JNI_INCLUDES="-I$JNI_INCLUDEDIR"
+ list="`find "$JNI_INCLUDEDIR" -type d -print`"
+ for dir in $list; do
+ JNI_INCLUDES="$JNI_INCLUDES -I$dir"
+ done
+ fi
+
+ dnl We use JDK in the Makefile
+ AC_SUBST(JDK)
+ AC_SUBST(JAVA)
+ AC_SUBST(JAVAC)
+ AC_SUBST(JAVAC_FLAGS)
+ AC_SUBST(JAVADOC)
+ AC_SUBST(JAVAH)
+ AC_SUBST(JAR)
+ AC_SUBST(JNI_INCLUDES)
+])
diff --git a/build/ac-macros/kwallet.m4 b/build/ac-macros/kwallet.m4
new file mode 100644
index 0000000..61a2d10
--- /dev/null
+++ b/build/ac-macros/kwallet.m4
@@ -0,0 +1,117 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_KWALLET
+dnl
+dnl Check configure options and assign variables related to KWallet support
+dnl
+
+AC_DEFUN(SVN_LIB_KWALLET,
+[
+ AC_ARG_WITH(kwallet,
+ [AS_HELP_STRING([[--with-kwallet[=PATH]]],
+ [Enable use of KWallet (KDE 4) for auth credentials])],
+ [svn_lib_kwallet="$withval"],
+ [svn_lib_kwallet=no])
+
+ AC_MSG_CHECKING([whether to look for KWallet])
+ if test "$svn_lib_kwallet" != "no"; then
+ AC_MSG_RESULT([yes])
+ if test "$svn_enable_shared" = "yes"; then
+ if test "$APR_HAS_DSO" = "yes"; then
+ if test "$USE_NLS" = "yes"; then
+ if test -n "$PKG_CONFIG"; then
+ if test "$HAVE_DBUS" = "yes"; then
+ AC_MSG_CHECKING([for QtCore, QtDBus, QtGui])
+ if $PKG_CONFIG --exists QtCore QtDBus QtGui; then
+ AC_MSG_RESULT([yes])
+ if test "$svn_lib_kwallet" != "yes"; then
+ AC_MSG_CHECKING([for kde4-config])
+ KDE4_CONFIG="$svn_lib_kwallet/bin/kde4-config"
+ if test -f "$KDE4_CONFIG" && test -x "$KDE4_CONFIG"; then
+ AC_MSG_RESULT([yes])
+ else
+ KDE4_CONFIG=""
+ AC_MSG_RESULT([no])
+ fi
+ else
+ AC_PATH_PROG(KDE4_CONFIG, kde4-config)
+ fi
+ if test -n "$KDE4_CONFIG"; then
+ AC_MSG_CHECKING([for KWallet])
+ old_CXXFLAGS="$CXXFLAGS"
+ old_LDFLAGS="$LDFLAGS"
+ old_LIBS="$LIBS"
+ for d in [`$PKG_CONFIG --cflags QtCore QtDBus QtGui`]; do
+ if test -n ["`echo "$d" | $EGREP -- '^-D[^[:space:]]*'`"]; then
+ CPPFLAGS="$CPPFLAGS $d"
+ fi
+ done
+ qt_include_dirs="`$PKG_CONFIG --cflags-only-I QtCore QtDBus QtGui`"
+ kde_dir="`$KDE4_CONFIG --prefix`"
+ SVN_KWALLET_INCLUDES="$DBUS_CPPFLAGS $qt_include_dirs -I$kde_dir/include"
+ qt_libs_other_options="`$PKG_CONFIG --libs-only-other QtCore QtDBus QtGui`"
+ SVN_KWALLET_LIBS="$DBUS_LIBS -lQtCore -lQtDBus -lQtGui -lkdecore -lkdeui $qt_libs_other_options"
+ CXXFLAGS="$CXXFLAGS $SVN_KWALLET_INCLUDES"
+ LIBS="$LIBS $SVN_KWALLET_LIBS"
+ qt_lib_dirs="`$PKG_CONFIG --libs-only-L QtCore QtDBus QtGui`"
+ kde_lib_suffix="`$KDE4_CONFIG --libsuffix`"
+ LDFLAGS="$old_LDFLAGS `SVN_REMOVE_STANDARD_LIB_DIRS($qt_lib_dirs -L$kde_dir/lib$kde_lib_suffix)`"
+ AC_LANG(C++)
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[
+#include <kwallet.h>
+int main()
+{KWallet::Wallet::walletList();}]])], svn_lib_kwallet="yes", svn_lib_kwallet="no")
+ AC_LANG(C)
+ if test "$svn_lib_kwallet" = "yes"; then
+ AC_MSG_RESULT([yes])
+ CXXFLAGS="$old_CXXFLAGS"
+ LIBS="$old_LIBS"
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([cannot find KWallet])
+ fi
+ else
+ AC_MSG_ERROR([cannot find kde4-config])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([cannot find QtCore, QtDBus, QtGui])
+ fi
+ else
+ AC_MSG_ERROR([cannot find D-Bus])
+ fi
+ else
+ AC_MSG_ERROR([cannot find pkg-config])
+ fi
+ else
+ AC_MSG_ERROR([missing support for internationalization])
+ fi
+ else
+ AC_MSG_ERROR([APR does not have support for DSOs])
+ fi
+ else
+ AC_MSG_ERROR([--with-kwallet conflicts with --disable-shared])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ fi
+ AC_SUBST(SVN_KWALLET_INCLUDES)
+ AC_SUBST(SVN_KWALLET_LIBS)
+])
diff --git a/build/ac-macros/neon.m4 b/build/ac-macros/neon.m4
new file mode 100644
index 0000000..f951039
--- /dev/null
+++ b/build/ac-macros/neon.m4
@@ -0,0 +1,168 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_NEON(allowed_list_of_regex, recommended_ver, url)
+dnl
+dnl Search for a suitable version of neon. allowed_list_of_regex is a
+dnl list of regular expressions used in a grep invocation
+dnl to match versions of Neon that can be used. recommended_ver is the
+dnl recommended version of Neon, which is not necessarily the latest
+dnl released version of neon that exists. url is the URL of the
+dnl recommended version of Neon.
+dnl
+dnl If a --with-neon option is passed (no argument), then a search for
+dnl neon on the system is performed.
+dnl
+dnl If a --with-neon=PREFIX option is passed search for a suitable
+dnl neon installed on the system whose configuration can be found in
+dnl PREFIX/bin/neon-config.
+dnl
+dnl If the search for neon fails, set svn_lib_neon to no, otherwise set
+dnl it to yes.
+
+AC_DEFUN(SVN_LIB_NEON,
+[
+ NEON_ALLOWED_LIST="$1"
+ NEON_RECOMMENDED_VER="$2"
+ NEON_URL="$3"
+
+ AC_MSG_NOTICE([checking neon library])
+
+ AC_ARG_WITH(neon,
+ AS_HELP_STRING([--with-neon=PREFIX],
+ [Determine neon library configuration based on
+ 'PREFIX/bin/neon-config'. Default is to search for
+ neon-config in $PATH.]),
+ [
+ if test "$withval" = "yes" ; then
+ if test -n "$PKG_CONFIG" && $PKG_CONFIG neon --exists ; then
+ NEON_PKG_CONFIG="yes"
+ else
+ AC_PATH_PROG(neon_config, neon-config)
+ fi
+ else
+ neon_config="$withval/bin/neon-config"
+ fi
+
+ SVN_NEON_CONFIG()
+ ],
+ [
+ AC_PATH_PROG(neon_config, neon-config)
+ SVN_NEON_CONFIG()
+ ])
+
+ AC_SUBST(SVN_NEON_INCLUDES)
+ AC_SUBST(NEON_LIBS)
+])
+
+dnl SVN_NEON_CONFIG()
+dnl neon-config found, gather relevant information from it
+AC_DEFUN(SVN_NEON_CONFIG,
+[
+ if test "$NEON_PKG_CONFIG" = "yes" || test -f "$neon_config"; then
+ if test "$NEON_PKG_CONFIG" = "yes" || test "$neon_config" != ""; then
+ AC_MSG_CHECKING([neon library version])
+ if test "$NEON_PKG_CONFIG" = "yes" ; then
+ NEON_VERSION=`$PKG_CONFIG neon --modversion`
+ else
+ NEON_VERSION=`$neon_config --version | $SED -e 's/^neon //'`
+ fi
+ AC_MSG_RESULT([$NEON_VERSION])
+
+ if test -n ["`echo "$NEON_VERSION" | $EGREP '^0\.(2[6-9]|3[0-9])\.'`"] ; then
+ AC_DEFINE_UNQUOTED([SVN_NEON_0_26], [1],
+ [Define to 1 if you have Neon 0.26 or later.])
+ fi
+
+ if test -n ["`echo "$NEON_VERSION" | $EGREP '^0\.(2[7-9]|3[0-9])\.'`"] ; then
+ AC_DEFINE_UNQUOTED([SVN_NEON_0_27], [1],
+ [Define to 1 if you have Neon 0.27 or later.])
+ fi
+
+ if test -n ["`echo "$NEON_VERSION" | $EGREP '^0\.(2[8-9]|3[0-9])\.'`"] ; then
+ AC_DEFINE_UNQUOTED([SVN_NEON_0_28], [1],
+ [Define to 1 if you have Neon 0.28 or later.])
+ fi
+
+ for svn_allowed_neon in $NEON_ALLOWED_LIST; do
+ if test -n "`echo "$NEON_VERSION" | grep "^$svn_allowed_neon"`" ||
+ test "$svn_allowed_neon" = "any"; then
+ svn_allowed_neon_on_system="yes"
+ if test "$NEON_PKG_CONFIG" = "yes"; then
+ SVN_NEON_INCLUDES=[`$PKG_CONFIG neon --cflags | $SED -e 's/-D[^ ]*//g'`]
+ CFLAGS=["$CFLAGS `$PKG_CONFIG neon --cflags | $SED -e 's/-I[^ ]*//g'`"]
+ old_CFLAGS="$CFLAGS"
+ old_LIBS="$LIBS"
+ NEON_LIBS=`$PKG_CONFIG neon --libs`
+ CFLAGS="$CFLAGS $SVN_NEON_INCLUDES"
+ LIBS="$LIBS $NEON_LIBS"
+ neon_test_code="
+#include <ne_compress.h>
+#include <ne_xml.h>
+int main()
+{ne_xml_create(); ne_decompress_destroy(NULL);}"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[$neon_test_code]])], shared_linking="yes", shared_linking="no")
+ if test "$shared_linking" = "no"; then
+ NEON_LIBS=`$PKG_CONFIG neon --libs --static`
+ LIBS="$LIBS $NEON_LIBS"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[$neon_test_code]])], , AC_MSG_ERROR([cannot find Neon]))
+ fi
+ CFLAGS="$old_CFLAGS"
+ LIBS="$old_LIBS"
+ else
+ SVN_NEON_INCLUDES=[`$neon_config --cflags | $SED -e 's/-D[^ ]*//g'`]
+ CFLAGS=["$CFLAGS `$neon_config --cflags | $SED -e 's/-I[^ ]*//g'`"]
+ NEON_LIBS=`$neon_config --libs`
+ fi
+ svn_lib_neon="yes"
+ break
+ fi
+ done
+
+ if test -z $svn_allowed_neon_on_system; then
+ echo "You have neon version $NEON_VERSION,"
+ echo "but Subversion needs neon $NEON_RECOMMENDED_VER."
+ SVN_DOWNLOAD_NEON()
+ fi
+
+ else
+ # no neon subdir, no neon-config in PATH
+ AC_MSG_RESULT([nothing])
+ echo "No suitable neon can be found."
+ SVN_DOWNLOAD_NEON()
+ fi
+
+ elif test "$with_neon" != "no"; then
+ # user passed --with-neon=/incorrect/path
+ SVN_DOWNLOAD_NEON()
+ fi
+])
+
+dnl SVN_DOWNLOAD_NEON()
+dnl no neon found, print out a message telling the user what to do
+AC_DEFUN(SVN_DOWNLOAD_NEON,
+[
+ echo ""
+ echo "An appropriate version of neon could not be found, so libsvn_ra_neon"
+ echo "will not be built. If you want to build libsvn_ra_neon, please"
+ echo "install neon ${NEON_RECOMMENDED_VER} on this system."
+ echo ""
+ AC_MSG_RESULT([no suitable neon found])
+ svn_lib_neon="no"
+])
diff --git a/build/ac-macros/sasl.m4 b/build/ac-macros/sasl.m4
new file mode 100644
index 0000000..563f9cb
--- /dev/null
+++ b/build/ac-macros/sasl.m4
@@ -0,0 +1,102 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_SASL
+dnl
+dnl Check configure options and assign variables related to
+dnl the sasl library.
+dnl
+dnl If we find the library, set the shell variable
+dnl `svn_lib_sasl' to `yes'. Otherwise, set `svn_lib_sasl'
+dnl to `no'.
+
+AC_DEFUN(SVN_LIB_SASL,
+[
+ AC_ARG_WITH(sasl, [AS_HELP_STRING([--with-sasl=PATH],
+ [Compile with libsasl2 in PATH])],
+ [
+ with_sasl="$withval"
+ required="yes"
+ ],
+ [
+ with_sasl="yes"
+ required="no"
+ ])
+
+ AC_MSG_CHECKING([whether to look for SASL])
+
+ if test "${with_sasl}" = "no"; then
+ AC_MSG_RESULT([no])
+ svn_lib_sasl=no
+ else
+ AC_MSG_RESULT([yes])
+ saved_LDFLAGS="$LDFLAGS"
+ saved_CPPFLAGS="$CPPFLAGS"
+
+ if test "$with_sasl" = "yes"; then
+ AC_MSG_NOTICE([Looking in default locations])
+ AC_CHECK_HEADER(sasl/sasl.h,
+ [AC_CHECK_HEADER(sasl/saslutil.h,
+ [AC_CHECK_LIB(sasl2, prop_get,
+ svn_lib_sasl=yes,
+ svn_lib_sasl=no)],
+ svn_lib_sasl=no)], svn_lib_sasl=no)
+ if test "$svn_lib_sasl" = "no"; then
+ with_sasl="/usr/local"
+ fi
+ else
+ svn_lib_sasl=no
+ fi
+
+ if test "$svn_lib_sasl" = "no"; then
+ SVN_SASL_INCLUDES="-I${with_sasl}/include"
+ CPPFLAGS="$CPPFLAGS $SVN_SASL_INCLUDES"
+ LDFLAGS="$LDFLAGS `SVN_REMOVE_STANDARD_LIB_DIRS(-L${with_sasl}/lib)`"
+
+ AC_CHECK_HEADER(sasl/sasl.h,
+ [AC_CHECK_HEADER(sasl/saslutil.h,
+ [AC_CHECK_LIB(sasl2, prop_get,
+ svn_lib_sasl=yes,
+ svn_lib_sasl=no)],
+ svn_lib_sasl=no)], svn_lib_sasl=no)
+ fi
+
+ AC_MSG_CHECKING([for availability of Cyrus SASL v2])
+ if test "$svn_lib_sasl" = "yes"; then
+ SVN_SASL_LIBS="-lsasl2"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+
+ if test "$required" = "yes"; then
+ dnl The user explicitly requested SASL, but we couldn't find it.
+ dnl Exit with an error message.
+ AC_MSG_ERROR([Could not find Cyrus SASL v2])
+ fi
+
+ SVN_SASL_INCLUDES=""
+ LDFLAGS="$saved_LDFLAGS"
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ fi
+
+ AC_SUBST(SVN_SASL_INCLUDES)
+ AC_SUBST(SVN_SASL_LIBS)
+])
diff --git a/build/ac-macros/serf.m4 b/build/ac-macros/serf.m4
new file mode 100644
index 0000000..a6f7cf1
--- /dev/null
+++ b/build/ac-macros/serf.m4
@@ -0,0 +1,99 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_SERF(min_major_num, min_minor_num, min_micro_num)
+dnl
+dnl Check configure options and assign variables related to
+dnl the serf library.
+dnl
+
+AC_DEFUN(SVN_LIB_SERF,
+[
+ serf_found=no
+
+ serf_check_major="$1"
+ serf_check_minor="$2"
+ serf_check_patch="$3"
+
+ AC_ARG_WITH(serf,AS_HELP_STRING([--with-serf=PREFIX],
+ [Serf WebDAV client library]),
+ [
+ if test "$withval" = "yes" ; then
+ AC_MSG_ERROR([--with-serf requires an argument.])
+ elif test "$withval" != "no" ; then
+ AC_MSG_NOTICE([serf library configuration])
+ serf_prefix=$withval
+ for serf_major in serf-1 serf-0; do
+ if ! test -d $serf_prefix/include/$serf_major; then continue; fi
+ save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES $SVN_APRUTIL_INCLUDES -I$serf_prefix/include/$serf_major"
+ AC_CHECK_HEADERS(serf.h,[
+ save_ldflags="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$serf_prefix/lib"
+ AC_CHECK_LIB($serf_major, serf_context_create,[
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include "serf.h"
+],[
+#if ! SERF_VERSION_AT_LEAST($serf_check_major, $serf_check_minor, $serf_check_patch)
+#error Serf version too old: need $serf_check_major.$serf_check_minor.$serf_check_patch
+#endif
+], [serf_found=yes], [AC_MSG_WARN([Serf version too old: need $serf_check_major.$serf_check_minor.$serf_check_patch])
+ serf_found=no])], ,
+ $SVN_APRUTIL_LIBS $SVN_APR_LIBS -lz)
+ LDFLAGS="$save_ldflags"])
+ CPPFLAGS="$save_cppflags"
+ test $serf_found = yes && break
+ done
+ fi
+ ], [
+ if test -d "$srcdir/serf"; then
+ serf_found=reconfig
+ fi
+ ])
+
+
+ if test $serf_found = "reconfig"; then
+ SVN_EXTERNAL_PROJECT([serf], [--with-apr=$apr_config --with-apr-util=$apu_config])
+ serf_major=serf-`$srcdir/serf/build/get-version.sh major $srcdir/serf/serf.h SERF`
+ serf_prefix=$prefix
+ SVN_SERF_PREFIX="$serf_prefix"
+ SVN_SERF_INCLUDES="-I$srcdir/serf"
+ SVN_SERF_LIBS="$abs_builddir/serf/lib$serf_major.la"
+ fi
+
+ if test $serf_found = "yes"; then
+ SVN_SERF_PREFIX="$serf_prefix"
+ SVN_SERF_INCLUDES="-I$serf_prefix/include/$serf_major"
+ if test -e "$serf_prefix/lib/lib$serf_major.la"; then
+ SVN_SERF_LIBS="$serf_prefix/lib/lib$serf_major.la"
+ else
+ SVN_SERF_LIBS="-l$serf_major"
+ LDFLAGS="$LDFLAGS -L$serf_prefix/lib"
+ fi
+ elif test $serf_found = "reconfig"; then
+ serf_found=yes
+ fi
+
+ svn_lib_serf=$serf_found
+
+ AC_SUBST(SVN_SERF_PREFIX)
+ AC_SUBST(SVN_SERF_INCLUDES)
+ AC_SUBST(SVN_SERF_LIBS)
+])
diff --git a/build/ac-macros/sqlite.m4 b/build/ac-macros/sqlite.m4
new file mode 100644
index 0000000..85a48da
--- /dev/null
+++ b/build/ac-macros/sqlite.m4
@@ -0,0 +1,249 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_SQLITE(minimum_ver, recommended_ver, url)
+dnl
+dnl Search for a suitable version of sqlite. minimum_ver is a
+dnl version string which is the lowest suitable version we can use.
+dnl recommended_ver is the recommended version of sqlite, which is
+dnl not necessarily the latest version released. url is the URL of
+dnl the recommended version of sqlite.
+dnl
+dnl If a --with-sqlite=PREFIX option is passed, look for a suitable sqlite
+dnl either installed under the directory PREFIX or as an amalgamation file
+dnl at the path PREFIX. In this case ignore any sqlite-amalgamation/ subdir
+dnl within the source tree.
+dnl
+dnl If no --with-sqlite option is passed, look first for
+dnl sqlite-amalgamation/sqlite3.c which should be the amalgamated version of
+dnl the source distribution. If the amalgamation exists and is the wrong
+dnl version, exit with a failure. If no sqlite-amalgamation/ subdir is
+dnl present, search for a sqlite installed on the system.
+dnl
+dnl If the search for sqlite fails, set svn_lib_sqlite to no, otherwise set
+dnl it to yes.
+
+AC_DEFUN(SVN_LIB_SQLITE,
+[
+ SQLITE_MINIMUM_VER="$1"
+ SQLITE_RECOMMENDED_VER="$2"
+ SQLITE_URL="$3"
+ SQLITE_PKGNAME="sqlite3"
+
+ SVN_SQLITE_MIN_VERNUM_PARSE
+
+ AC_MSG_NOTICE([checking sqlite library])
+
+ AC_ARG_WITH(sqlite,
+ AS_HELP_STRING([--with-sqlite=PREFIX],
+ [Use installed SQLite library or amalgamation file.]),
+ [
+ if test "$withval" = "yes" ; then
+ AC_MSG_ERROR([--with-sqlite requires an argument.])
+ else
+ sqlite_dir="$withval"
+ fi
+
+ if test -d $sqlite_dir; then
+ dnl pointed at an sqlite installation
+ SVN_SQLITE_DIR_CONFIG($sqlite_dir)
+ else
+ dnl pointed at the amalgamation file
+ SVN_SQLITE_FILE_CONFIG($sqlite_dir)
+ fi
+
+ if test -z "$svn_lib_sqlite"; then
+ AC_MSG_WARN([no suitable sqlite found in $sqlite_dir])
+ SVN_DOWNLOAD_SQLITE
+ fi
+ ],
+ [
+ dnl see if the sqlite amalgamation exists in the source tree
+ SVN_SQLITE_FILE_CONFIG($abs_srcdir/sqlite-amalgamation/sqlite3.c)
+
+ if test -z "$svn_lib_sqlite"; then
+ dnl check the "standard" location of /usr
+ SVN_SQLITE_DIR_CONFIG()
+ fi
+
+ if test -z "$svn_lib_sqlite"; then
+ dnl no --with-sqlite switch, and no sqlite subdir, look in PATH
+ SVN_SQLITE_PKG_CONFIG
+ fi
+
+ if test -z "$svn_lib_sqlite"; then
+ SVN_DOWNLOAD_SQLITE
+ fi
+ ])
+
+ AC_SUBST(SVN_SQLITE_INCLUDES)
+ AC_SUBST(SVN_SQLITE_LIBS)
+])
+
+dnl SVN_SQLITE_PKG_CONFIG
+dnl
+dnl Look for sqlite in PATH using pkg-config.
+AC_DEFUN(SVN_SQLITE_PKG_CONFIG,
+[
+ if test -n "$PKG_CONFIG"; then
+ AC_MSG_CHECKING([sqlite library version (via pkg-config)])
+ sqlite_version=`$PKG_CONFIG $SQLITE_PKGNAME --modversion --silence-errors`
+
+ if test -n "$sqlite_version"; then
+ SVN_SQLITE_VERNUM_PARSE
+
+ if test "$sqlite_ver_num" -ge "$sqlite_min_ver_num"; then
+ AC_MSG_RESULT([$sqlite_version])
+ svn_lib_sqlite="yes"
+ SVN_SQLITE_INCLUDES="`$PKG_CONFIG $SQLITE_PKGNAME --cflags`"
+ SVN_SQLITE_LIBS="`$PKG_CONFIG $SQLITE_PKGNAME --libs`"
+ else
+ AC_MSG_RESULT([none or unsupported $sqlite_version])
+ fi
+ fi
+ fi
+
+ if test -z "$svn_lib_sqlite"; then
+ AC_MSG_RESULT(no)
+ fi
+])
+
+dnl SVN_SQLITE_DIR_CONFIG(sqlite_dir)
+dnl
+dnl Check to see if we've got an appropriate sqlite library at sqlite_dir.
+dnl If we don't, fail.
+AC_DEFUN(SVN_SQLITE_DIR_CONFIG,
+[
+ if test -z "$1"; then
+ sqlite_dir=""
+ sqlite_include="sqlite3.h"
+ else
+ sqlite_dir="$1"
+ sqlite_include="$1/include/sqlite3.h"
+ fi
+
+ save_CPPFLAGS="$CPPFLAGS"
+ save_LDFLAGS="$LDFLAGS"
+
+ if test ! -z "$1"; then
+ CPPFLAGS="$CPPFLAGS -I$sqlite_dir/include"
+ LDFLAGS="$LDFLAGS -L$sqlite_dir/lib"
+ fi
+
+ AC_CHECK_HEADER(sqlite3.h,
+ [
+ AC_MSG_CHECKING([sqlite library version (via header)])
+ AC_EGREP_CPP(SQLITE_VERSION_OKAY,[
+#include "$sqlite_include"
+#if SQLITE_VERSION_NUMBER >= $sqlite_min_ver_num
+SQLITE_VERSION_OKAY
+#endif],
+ [AC_MSG_RESULT([okay])
+ AC_CHECK_LIB(sqlite3, sqlite3_close, [
+ svn_lib_sqlite="yes"
+ if test -z "$sqlite_dir" -o ! -d "$sqlite_dir"; then
+ SVN_SQLITE_LIBS="-lsqlite3"
+ else
+ SVN_SQLITE_INCLUDES="-I$sqlite_dir/include"
+ SVN_SQLITE_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS(-L$sqlite_dir/lib -lsqlite3)`"
+ fi
+ ])], [AC_MSG_RESULT([unsupported SQLite version])])
+ ])
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+])
+
+dnl SVN_SQLITE_FILE_CONFIG(sqlite_file)
+dnl
+dnl Check to see if we've got an appropriate sqlite amalgamation file
+dnl at sqlite_file. If not, fail.
+AC_DEFUN(SVN_SQLITE_FILE_CONFIG,
+[
+ sqlite_amalg="$1"
+ AC_MSG_CHECKING([sqlite amalgamation])
+ if test ! -e $sqlite_amalg; then
+ AC_MSG_RESULT([no])
+ else
+ AC_MSG_RESULT([yes])
+ AC_MSG_CHECKING([sqlite amalgamation file version])
+ AC_EGREP_CPP(SQLITE_VERSION_OKAY,[
+#include "$sqlite_amalg"
+#if SQLITE_VERSION_NUMBER >= $sqlite_min_ver_num
+SQLITE_VERSION_OKAY
+#endif],
+ [AC_MSG_RESULT([amalgamation found and is okay])
+ AC_DEFINE(SVN_SQLITE_INLINE, 1,
+ [Defined if svn should use the amalgamated version of sqlite])
+ SVN_SQLITE_INCLUDES="-I`dirname $sqlite_amalg`"
+ SVN_SQLITE_LIBS="-ldl -lpthread"
+ svn_lib_sqlite="yes"],
+ [AC_MSG_RESULT([unsupported amalgamation SQLite version])])
+ fi
+])
+
+dnl SVN_SQLITE_VERNUM_PARSE()
+dnl
+dnl Parse a x.y[.z] version string sqlite_version into a number sqlite_ver_num.
+AC_DEFUN(SVN_SQLITE_VERNUM_PARSE,
+[
+ sqlite_major=`expr $sqlite_version : '\([[0-9]]*\)'`
+ sqlite_minor=`expr $sqlite_version : '[[0-9]]*\.\([[0-9]]*\)'`
+ sqlite_micro=`expr $sqlite_version : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test -z "$sqlite_micro"; then
+ sqlite_micro=0
+ fi
+ sqlite_ver_num=`expr $sqlite_major \* 1000000 \
+ \+ $sqlite_minor \* 1000 \
+ \+ $sqlite_micro`
+])
+
+dnl SVN_SQLITE_MIN_VERNUM_PARSE()
+dnl
+dnl Parse a x.y.z version string SQLITE_MINIMUM_VER into a number
+dnl sqlite_min_ver_num.
+AC_DEFUN(SVN_SQLITE_MIN_VERNUM_PARSE,
+[
+ sqlite_min_major=`expr $SQLITE_MINIMUM_VER : '\([[0-9]]*\)'`
+ sqlite_min_minor=`expr $SQLITE_MINIMUM_VER : '[[0-9]]*\.\([[0-9]]*\)'`
+ sqlite_min_micro=`expr $SQLITE_MINIMUM_VER : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ sqlite_min_ver_num=`expr $sqlite_min_major \* 1000000 \
+ \+ $sqlite_min_minor \* 1000 \
+ \+ $sqlite_min_micro`
+])
+
+dnl SVN_DOWNLOAD_SQLITE()
+dnl no sqlite found, print out a message telling the user what to do
+AC_DEFUN(SVN_DOWNLOAD_SQLITE,
+[
+ echo ""
+ echo "An appropriate version of sqlite could not be found. We recommmend"
+ echo "${SQLITE_RECOMMENDED_VER}, but require at least ${SQLITE_MINIMUM_VER}."
+ echo "Please either install a newer sqlite on this system"
+ echo ""
+ echo "or"
+ echo ""
+ echo "get the sqlite ${SQLITE_RECOMMENDED_VER} amalgamation from:"
+ echo " ${SQLITE_URL}"
+ echo "unpack the archive using tar/gunzip and copy sqlite3.c from the"
+ echo "resulting directory to:"
+ echo "$abs_srcdir/sqlite-amalgamation/sqlite3.c"
+ echo ""
+ AC_MSG_ERROR([Subversion requires SQLite])
+])
diff --git a/build/ac-macros/svn-macros.m4 b/build/ac-macros/svn-macros.m4
new file mode 100644
index 0000000..29e9624
--- /dev/null
+++ b/build/ac-macros/svn-macros.m4
@@ -0,0 +1,204 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+# Miscellaneous additional macros for Subversion's own use.
+
+# SVN_CONFIG_NICE(FILENAME)
+# Write a shell script to FILENAME (typically 'config.nice') which reinvokes
+# configure with all of the arguments. Reserves use of the filename
+# FILENAME.old for its own use.
+# This is different from 'config.status --recheck' in that it does add implicit
+# --no-create --no-recursion options, and stores _just_ the configure
+# invocation, instead of the entire configured state.
+AC_DEFUN([SVN_CONFIG_NICE], [
+ AC_MSG_NOTICE([creating $1])
+ # This little dance satisfies Cygwin, which cannot overwrite in-use files.
+ if test -f "$1"; then
+ mv "$1" "$1.old"
+ fi
+
+ cat >"$1" <<EOF
+#! /bin/sh
+#
+# Created by configure
+
+'[$]0' $ac_configure_args "\[$]@"
+EOF
+
+ chmod +x "$1"
+ rm -f "$1.old"
+])
+
+
+# SVN_EXTERNAL_PROJECT_SETUP()
+# Internal helper for SVN_EXTERNAL_PROJECT.
+AC_DEFUN([SVN_EXTERNAL_PROJECT_SETUP], [
+ do_subdir_config="yes"
+ AC_ARG_ENABLE([subdir-config],
+ AS_HELP_STRING([--disable-subdir-config],
+ [do not reconfigure packages in subdirectories]),
+ [if test "$enableval" = "no"; then do_subdir_config="no"; fi])
+ AC_SUBST([SVN_EXTERNAL_PROJECT_SUBDIRS], [""])
+])
+
+# SVN_EXTERNAL_PROJECT(SUBDIR [, ADDITIONAL-CONFIGURE-ARGS])
+# Setup SUBDIR as an external project. This means:
+# - Execute the configure script immediately at the point of macro invocation.
+# - Add SUBDIR to the substitution variable SVN_EXTERNAL_PROJECT_SUBDIRS,
+# for the Makefile.in to arrange to execute make in the subdir.
+#
+# Derived from APR_SUBDIR_CONFIG
+AC_DEFUN([SVN_EXTERNAL_PROJECT], [
+ AC_REQUIRE([SVN_EXTERNAL_PROJECT_SETUP])
+ SVN_EXTERNAL_PROJECT_SUBDIRS="$SVN_EXTERNAL_PROJECT_SUBDIRS $1"
+ if test "$do_subdir_config" = "yes" ; then
+ # save our work to this point; this allows the sub-package to use it
+ AC_CACHE_SAVE
+
+ AC_MSG_NOTICE([configuring package in $1 now])
+ ac_popdir=`pwd`
+ ac_abs_srcdir=`(cd $srcdir/$1 && pwd)`
+ apr_config_subdirs="$1"
+ test -d $1 || $MKDIR $1
+ cd $1
+
+ # A "../" for each directory in /$config_subdirs.
+ ac_dots=[`echo $apr_config_subdirs| $SED -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`]
+
+ # Make the cache file name correct relative to the subdirectory.
+ case "$cache_file" in
+ /*) ac_sub_cache_file=$cache_file ;;
+ *) # Relative path.
+ ac_sub_cache_file="$ac_dots$cache_file" ;;
+ esac
+
+ # The eval makes quoting arguments work.
+ if eval $SHELL $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2
+ then :
+ echo "$1 configured properly"
+ else
+ echo "configure failed for $1"
+ exit 1
+ fi
+ cd $ac_popdir
+
+ # grab any updates from the sub-package
+ AC_CACHE_LOAD
+ else
+ AC_MSG_WARN([not running configure in $1])
+ fi
+])
+
+dnl
+dnl SVN_CONFIG_SCRIPT(path)
+dnl
+dnl Make AC_OUTPUT create an executable file.
+dnl Accumulate filenames in $SVN_CONFIG_SCRIPT_FILES for AC_SUBSTing to
+dnl use in, for example, Makefile distclean rules.
+dnl
+AC_DEFUN(SVN_CONFIG_SCRIPT, [
+ SVN_CONFIG_SCRIPT_FILES="$SVN_CONFIG_SCRIPT_FILES $1"
+ AC_CONFIG_FILES([$1], [chmod +x $1])])
+
+dnl Iteratively interpolate the contents of the second argument
+dnl until interpolation offers no new result. Then assign the
+dnl final result to $1.
+dnl
+dnl Based on APR_EXPAND_VAR macro
+dnl
+dnl Example:
+dnl
+dnl foo=1
+dnl bar='${foo}/2'
+dnl baz='${bar}/3'
+dnl SVN_EXPAND_VAR(fraz, $baz)
+dnl $fraz is now "1/2/3"
+dnl
+AC_DEFUN(SVN_EXPAND_VAR,[
+svn_last=
+svn_cur="$2"
+while test "x${svn_cur}" != "x${svn_last}";
+do
+ svn_last="${svn_cur}"
+ svn_cur=`eval "echo ${svn_cur}"`
+done
+$1="${svn_cur}"
+])
+
+dnl SVN_MAYBE_ADD_TO_CFLAGS(option)
+dnl
+dnl Attempt to compile a trivial C program to test if the option passed
+dnl is valid. If it is, then add it to CFLAGS. with the passed in option
+dnl and see if it was successfully compiled.
+dnl
+dnl This macro is usually used for stricter syntax checking flags.
+dnl Therefore we include certain headers which may in turn include system
+dnl headers, as system headers on some platforms may fail strictness checks
+dnl we wish to use on other platforms.
+
+AC_DEFUN(SVN_MAYBE_ADD_TO_CFLAGS,
+[
+ option="$1"
+ svn_maybe_add_to_cflags_saved_flags="$CFLAGS"
+ CFLAGS="$CFLAGS $option"
+ AC_MSG_CHECKING([if $CC accepts $option])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#include <apr_portable.h>]],
+ [[]])],
+ [svn_maybe_add_to_cflags_ok="yes"],
+ [svn_maybe_add_to_cflags_ok="no"]
+ )
+ if test "$svn_maybe_add_to_cflags_ok" = "yes"; then
+ AC_MSG_RESULT([yes, will use it])
+ else
+ AC_MSG_RESULT([no])
+ CFLAGS="$svn_maybe_add_to_cflags_saved_flags"
+ fi
+])
+
+dnl SVN_REMOVE_STANDARD_LIB_DIRS(OPTIONS)
+dnl
+dnl Remove standard library search directories.
+dnl OPTIONS is a list of compiler/linker options.
+dnl This macro prints input options except -L options whose arguments are
+dnl standard library search directories (e.g. /usr/lib).
+dnl
+dnl This macro is used to avoid linking against Subversion libraries
+dnl potentially placed in standard library search directories.
+AC_DEFUN([SVN_REMOVE_STANDARD_LIB_DIRS],
+[
+ input_flags="$1"
+ output_flags=""
+ filtered_dirs="/lib /lib64 /usr/lib /usr/lib64"
+ for flag in $input_flags; do
+ filter="no"
+ for dir in $filtered_dirs; do
+ if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then
+ filter="yes"
+ break
+ fi
+ done
+ if test "$filter" = "no"; then
+ output_flags="$output_flags $flag"
+ fi
+ done
+ if test -n "$output_flags"; then
+ printf "%s" "${output_flags# }"
+ fi
+])
diff --git a/build/ac-macros/swig.m4 b/build/ac-macros/swig.m4
new file mode 100644
index 0000000..a0e91ee
--- /dev/null
+++ b/build/ac-macros/swig.m4
@@ -0,0 +1,297 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl check to see if SWIG is current enough.
+dnl
+dnl if it is, then check to see if we have the correct version of python.
+dnl
+dnl if we do, then set up the appropriate SWIG_ variables to build the
+dnl python bindings.
+
+AC_DEFUN(SVN_CHECK_SWIG,
+[
+ AC_ARG_WITH(swig,
+ AS_HELP_STRING([--with-swig=PATH],
+ [Try to use 'PATH/bin/swig' to build the
+ swig bindings. If PATH is not specified,
+ look for a 'swig' binary in your PATH.]),
+ [
+ case "$withval" in
+ "no")
+ SWIG_SUITABLE=no
+ SVN_FIND_SWIG(no)
+ ;;
+ "yes")
+ SVN_FIND_SWIG(check)
+ ;;
+ *)
+ SVN_FIND_SWIG($withval)
+ ;;
+ esac
+ ],
+ [
+ SVN_FIND_SWIG(check)
+ ])
+])
+
+AC_DEFUN(SVN_FIND_SWIG,
+[
+ where=$1
+
+ if test $where = no; then
+ SWIG=none
+ elif test $where = check; then
+ AC_PATH_PROG(SWIG, swig, none)
+ else
+ if test -f "$where"; then
+ SWIG="$where"
+ else
+ SWIG="$where/bin/swig"
+ fi
+ if test ! -f "$SWIG" || test ! -x "$SWIG"; then
+ AC_MSG_ERROR([Could not find swig binary at $SWIG])
+ fi
+ fi
+
+ if test "$SWIG" != "none"; then
+ AC_MSG_CHECKING([swig version])
+ SWIG_VERSION_RAW="`$SWIG -version 2>&1 | \
+ $SED -ne 's/^.*Version \(.*\)$/\1/p'`"
+ # We want the version as an integer so we can test against
+ # which version we're using. SWIG doesn't provide this
+ # to us so we have to come up with it on our own.
+ # The major is passed straight through,
+ # the minor is zero padded to two places,
+ # and the patch level is zero padded to three places.
+ # e.g. 1.3.24 becomes 103024
+ SWIG_VERSION="`echo \"$SWIG_VERSION_RAW\" | \
+ $SED -e 's/[[^0-9\.]].*$//' \
+ -e 's/\.\([[0-9]]\)$/.0\1/' \
+ -e 's/\.\([[0-9]][[0-9]]\)$/.0\1/' \
+ -e 's/\.\([[0-9]]\)\./0\1/; s/\.//g;'`"
+ AC_MSG_RESULT([$SWIG_VERSION_RAW])
+ # If you change the required swig version number, don't forget to update:
+ # subversion/bindings/swig/INSTALL
+ # packages/rpm/redhat-8+/subversion.spec
+ # packages/rpm/redhat-7.x/subversion.spec
+ # packages/rpm/rhel-3/subversion.spec
+ # packages/rpm/rhel-4/subversion.spec
+ if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then
+ SWIG_SUITABLE=yes
+ else
+ SWIG_SUITABLE=no
+ AC_MSG_WARN([Detected SWIG version $SWIG_VERSION_RAW])
+ AC_MSG_WARN([Subversion requires SWIG 1.3.24 or later])
+ fi
+ fi
+
+ SWIG_PY_COMPILE="none"
+ SWIG_PY_LINK="none"
+ if test "$PYTHON" != "none"; then
+ AC_MSG_NOTICE([Configuring python swig binding])
+
+ AC_CACHE_CHECK([for Python includes], [ac_cv_python_includes],[
+ ac_cv_python_includes="`$PYTHON ${abs_srcdir}/build/get-py-info.py --includes`"
+ ])
+ SWIG_PY_INCLUDES="\$(SWIG_INCLUDES) $ac_cv_python_includes"
+
+ if test "$ac_cv_python_includes" = "none"; then
+ AC_MSG_WARN([python bindings cannot be built without distutils module])
+ fi
+
+ AC_CACHE_CHECK([for compiling Python extensions], [ac_cv_python_compile],[
+ ac_cv_python_compile="`$PYTHON ${abs_srcdir}/build/get-py-info.py --compile`"
+ ])
+ SWIG_PY_COMPILE="$ac_cv_python_compile $CFLAGS"
+
+ AC_CACHE_CHECK([for linking Python extensions], [ac_cv_python_link],[
+ ac_cv_python_link="`$PYTHON ${abs_srcdir}/build/get-py-info.py --link`"
+ ])
+ SWIG_PY_LINK="$ac_cv_python_link"
+
+ AC_CACHE_CHECK([for linking Python libraries], [ac_cv_python_libs],[
+ ac_cv_python_libs="`$PYTHON ${abs_srcdir}/build/get-py-info.py --libs`"
+ ])
+ SWIG_PY_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS($ac_cv_python_libs)`"
+
+ dnl Sun Forte adds an extra space before substituting APR_INT64_T_FMT
+ dnl gcc-2.95 adds an extra space after substituting APR_INT64_T_FMT
+ dnl thus the egrep patterns have a + in them.
+ SVN_PYCFMT_SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
+ AC_CACHE_CHECK([for apr_int64_t Python/C API format string],
+ [svn_cv_pycfmt_apr_int64_t], [
+ if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+ AC_EGREP_CPP([MaTcHtHiS +\"lld\" +EnDeNd],
+ [#include <apr.h>
+ MaTcHtHiS APR_INT64_T_FMT EnDeNd],
+ [svn_cv_pycfmt_apr_int64_t="L"])
+ fi
+ if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+ AC_EGREP_CPP([MaTcHtHiS +\"ld\" +EnDeNd],r
+ [#include <apr.h>
+ MaTcHtHiS APR_INT64_T_FMT EnDeNd],
+ [svn_cv_pycfmt_apr_int64_t="l"])
+ fi
+ if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+ AC_EGREP_CPP([MaTcHtHiS +\"d\" +EnDeNd],
+ [#include <apr.h>
+ MaTcHtHiS APR_INT64_T_FMT EnDeNd],
+ [svn_cv_pycfmt_apr_int64_t="i"])
+ fi
+ ])
+ CPPFLAGS="$SVN_PYCFMT_SAVE_CPPFLAGS"
+ if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+ AC_MSG_ERROR([failed to recognize APR_INT64_T_FMT on this platform])
+ fi
+ AC_DEFINE_UNQUOTED([SVN_APR_INT64_T_PYCFMT],
+ ["$svn_cv_pycfmt_apr_int64_t"],
+ [Define to the Python/C API format character suitable]
+ [ for apr_int64_t])
+ fi
+
+ if test "$PERL" != "none"; then
+ AC_MSG_CHECKING([perl version])
+ dnl Note that the q() bit is there to avoid unbalanced brackets
+ dnl which m4 really doesn't like.
+ PERL_VERSION="`$PERL -e 'q([[); print $]] * 1000000,$/;'`"
+ AC_MSG_RESULT([$PERL_VERSION])
+ if test "$PERL_VERSION" -ge "5008000"; then
+ SWIG_PL_INCLUDES="\$(SWIG_INCLUDES) `$PERL -MExtUtils::Embed -e ccopts`"
+ else
+ AC_MSG_WARN([perl bindings require perl 5.8.0 or newer.])
+ fi
+ fi
+
+ SWIG_RB_COMPILE="none"
+ SWIG_RB_LINK="none"
+ if test "$RUBY" != "none"; then
+ rbconfig="$RUBY -rrbconfig -e "
+
+ for var_name in arch archdir CC LDSHARED DLEXT LIBS LIBRUBYARG \
+ rubyhdrdir sitedir sitelibdir sitearchdir libdir
+ do
+ rbconfig_tmp=`$rbconfig "print Config::CONFIG@<:@'$var_name'@:>@"`
+ eval "rbconfig_$var_name=\"$rbconfig_tmp\""
+ done
+
+ AC_MSG_NOTICE([Configuring Ruby SWIG binding])
+
+ AC_CACHE_CHECK([for Ruby include path], [svn_cv_ruby_includes],[
+ if test -d "$rbconfig_rubyhdrdir"; then
+ dnl Ruby >=1.9
+ svn_cv_ruby_includes="-I. -I$rbconfig_rubyhdrdir -I$rbconfig_rubyhdrdir/ruby -I$rbconfig_rubyhdrdir/ruby/backward -I$rbconfig_rubyhdrdir/$rbconfig_arch"
+ else
+ dnl Ruby 1.8
+ svn_cv_ruby_includes="-I. -I$rbconfig_archdir"
+ fi
+ ])
+ SWIG_RB_INCLUDES="\$(SWIG_INCLUDES) $svn_cv_ruby_includes"
+
+ AC_CACHE_CHECK([how to compile Ruby extensions], [svn_cv_ruby_compile],[
+ # Ruby doesn't like '-ansi', so strip that out of CFLAGS
+ svn_cv_ruby_compile="$rbconfig_CC `echo $CFLAGS | $SED -e "s/ -ansi//g;s/ -std=c89//g"`"
+ ])
+ SWIG_RB_COMPILE="$svn_cv_ruby_compile"
+
+ AC_CACHE_CHECK([how to link Ruby extensions], [svn_cv_ruby_link],[
+ svn_cv_ruby_link="`$RUBY -e 'ARGV.shift; print ARGV.join(%q( ))' \
+ $rbconfig_LDSHARED`"
+ svn_cv_ruby_link="$rbconfig_CC $svn_cv_ruby_link"
+ svn_cv_ruby_link="$svn_cv_ruby_link -shrext .$rbconfig_DLEXT"
+ ])
+ SWIG_RB_LINK="$svn_cv_ruby_link"
+
+ AC_CACHE_CHECK([how to link Ruby libraries], [ac_cv_ruby_libs], [
+ ac_cv_ruby_libs="$rbconfig_LIBRUBYARG $rbconfig_LIBS"
+ ])
+ SWIG_RB_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS($ac_cv_ruby_libs)`"
+
+ AC_MSG_CHECKING([for rb_errinfo])
+ old_CFLAGS="$CFLAGS"
+ old_LIBS="$LIBS"
+ CFLAGS="`echo $CFLAGS | $SED -e "s/ -ansi//g;s/ -std=c89//g"` $svn_cv_ruby_includes"
+ LIBS="$SWIG_RB_LIBS"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[
+#include <ruby.h>
+int main()
+{rb_errinfo();}]])], have_rb_errinfo="yes", have_rb_errinfo="no")
+ if test "$have_rb_errinfo" = "yes"; then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_RB_ERRINFO], [1],
+ [Define to 1 if you have the `rb_errinfo' function.])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ CFLAGS="$old_CFLAGS"
+ LIBS="$old_LIBS"
+
+ AC_CACHE_VAL([svn_cv_ruby_sitedir],[
+ svn_cv_ruby_sitedir="$rbconfig_sitedir"
+ ])
+ AC_ARG_WITH([ruby-sitedir],
+ AS_HELP_STRING([--with-ruby-sitedir=SITEDIR],
+ [install Ruby bindings in SITEDIR
+ (default is same as ruby's one)]),
+ [svn_ruby_installdir="$withval"],
+ [svn_ruby_installdir="$svn_cv_ruby_sitedir"])
+
+ AC_MSG_CHECKING([where to install Ruby scripts])
+ AC_CACHE_VAL([svn_cv_ruby_sitedir_libsuffix],[
+ svn_cv_ruby_sitedir_libsuffix="`echo "$rbconfig_sitelibdir" | \
+ $SED -e "s,^$rbconfig_sitedir,,"`"
+ ])
+ SWIG_RB_SITE_LIB_DIR="${svn_ruby_installdir}${svn_cv_ruby_sitedir_libsuffix}"
+ AC_MSG_RESULT([$SWIG_RB_SITE_LIB_DIR])
+
+ AC_MSG_CHECKING([where to install Ruby extensions])
+ AC_CACHE_VAL([svn_cv_ruby_sitedir_archsuffix],[
+ svn_cv_ruby_sitedir_archsuffix="`echo "$rbconfig_sitearchdir" | \
+ $SED -e "s,^$rbconfig_sitedir,,"`"
+ ])
+ SWIG_RB_SITE_ARCH_DIR="${svn_ruby_installdir}${svn_cv_ruby_sitedir_archsuffix}"
+ AC_MSG_RESULT([$SWIG_RB_SITE_ARCH_DIR])
+
+ AC_MSG_CHECKING([how to use output level for Ruby bindings tests])
+ AC_CACHE_VAL([svn_cv_ruby_test_verbose],[
+ svn_cv_ruby_test_verbose="normal"
+ ])
+ AC_ARG_WITH([ruby-test-verbose],
+ AS_HELP_STRING([--with-ruby-test-verbose=LEVEL],
+ [how to use output level for Ruby bindings tests
+ (default is normal)]),
+ [svn_ruby_test_verbose="$withval"],
+ [svn_ruby_test_verbose="$svn_cv_ruby_test_verbose"])
+ SWIG_RB_TEST_VERBOSE="$svn_ruby_test_verbose"
+ AC_MSG_RESULT([$SWIG_RB_TEST_VERBOSE])
+ fi
+ AC_SUBST(SWIG)
+ AC_SUBST(SWIG_PY_INCLUDES)
+ AC_SUBST(SWIG_PY_COMPILE)
+ AC_SUBST(SWIG_PY_LINK)
+ AC_SUBST(SWIG_PY_LIBS)
+ AC_SUBST(SWIG_PL_INCLUDES)
+ AC_SUBST(SWIG_RB_LINK)
+ AC_SUBST(SWIG_RB_LIBS)
+ AC_SUBST(SWIG_RB_INCLUDES)
+ AC_SUBST(SWIG_RB_COMPILE)
+ AC_SUBST(SWIG_RB_SITE_LIB_DIR)
+ AC_SUBST(SWIG_RB_SITE_ARCH_DIR)
+ AC_SUBST(SWIG_RB_TEST_VERBOSE)
+])
diff --git a/build/ac-macros/zlib.m4 b/build/ac-macros/zlib.m4
new file mode 100644
index 0000000..298dfee
--- /dev/null
+++ b/build/ac-macros/zlib.m4
@@ -0,0 +1,74 @@
+dnl ===================================================================
+dnl Licensed to the Apache Software Foundation (ASF) under one
+dnl or more contributor license agreements. See the NOTICE file
+dnl distributed with this work for additional information
+dnl regarding copyright ownership. The ASF licenses this file
+dnl to you under the Apache License, Version 2.0 (the
+dnl "License"); you may not use this file except in compliance
+dnl with the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing,
+dnl software distributed under the License is distributed on an
+dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+dnl KIND, either express or implied. See the License for the
+dnl specific language governing permissions and limitations
+dnl under the License.
+dnl ===================================================================
+dnl
+dnl SVN_LIB_Z
+dnl
+dnl Check configure options and assign variables related to
+dnl the zlib library.
+dnl
+
+AC_DEFUN(SVN_LIB_Z,
+[
+ zlib_found=no
+
+ AC_ARG_WITH(zlib,AS_HELP_STRING([--with-zlib=PREFIX],
+ [zlib compression library]),
+ [
+ if test "$withval" = "yes" ; then
+ AC_CHECK_HEADER(zlib.h, [
+ AC_CHECK_LIB(z, inflate, [zlib_found="builtin"])
+ ])
+ elif test "$withval" = "no" ; then
+ AC_MSG_ERROR([cannot compile without zlib.])
+ else
+ AC_MSG_NOTICE([zlib library configuration])
+ zlib_prefix=$withval
+ save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include"
+ AC_CHECK_HEADERS(zlib.h,[
+ save_ldflags="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$zlib_prefix/lib"
+ AC_CHECK_LIB(z, inflate, [zlib_found="yes"])
+ LDFLAGS="$save_ldflags"
+ ])
+ CPPFLAGS="$save_cppflags"
+ fi
+ ],
+ [
+ AC_CHECK_HEADER(zlib.h, [
+ AC_CHECK_LIB(z, inflate, [zlib_found="builtin"])
+ ])
+ ])
+
+ if test "$zlib_found" = "no"; then
+ AC_MSG_ERROR([subversion requires zlib])
+ fi
+
+ if test "$zlib_found" = "yes"; then
+ SVN_ZLIB_PREFIX="$zlib_prefix"
+ SVN_ZLIB_INCLUDES="-I$zlib_prefix/include"
+ LDFLAGS="$LDFLAGS `SVN_REMOVE_STANDARD_LIB_DIRS(-L$zlib_prefix/lib)`"
+ fi
+
+ SVN_ZLIB_LIBS="-lz"
+
+ AC_SUBST(SVN_ZLIB_PREFIX)
+ AC_SUBST(SVN_ZLIB_INCLUDES)
+ AC_SUBST(SVN_ZLIB_LIBS)
+])