diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-03-18 13:33:26 +0000 |
---|---|---|
committer | <> | 2015-07-08 14:41:01 +0000 |
commit | bb0ef45f7c46b0ae221b26265ef98a768c33f820 (patch) | |
tree | 98bae10dde41c746c51ae97ec4f879e330415aa7 /build/ac-macros | |
parent | 239dfafe71711b2f4c43d7b90a1228d7bdc5195e (diff) | |
download | subversion-tarball-bb0ef45f7c46b0ae221b26265ef98a768c33f820.tar.gz |
Imported from /home/lorry/working-area/delta_subversion-tarball/subversion-1.8.13.tar.gz.subversion-1.8.13
Diffstat (limited to 'build/ac-macros')
-rw-r--r-- | build/ac-macros/apache.m4 | 47 | ||||
-rw-r--r-- | build/ac-macros/apr.m4 | 39 | ||||
-rw-r--r-- | build/ac-macros/apr_memcache.m4 | 36 | ||||
-rw-r--r-- | build/ac-macros/aprutil.m4 | 30 | ||||
-rw-r--r-- | build/ac-macros/berkeley-db.m4 | 84 | ||||
-rw-r--r-- | build/ac-macros/compiler.m4 | 98 | ||||
-rw-r--r-- | build/ac-macros/gssapi.m4 | 82 | ||||
-rw-r--r-- | build/ac-macros/kwallet.m4 | 102 | ||||
-rw-r--r-- | build/ac-macros/macosx.m4 | 110 | ||||
-rw-r--r-- | build/ac-macros/neon.m4 | 168 | ||||
-rw-r--r-- | build/ac-macros/serf.m4 | 166 | ||||
-rw-r--r-- | build/ac-macros/sqlite.m4 | 99 | ||||
-rw-r--r-- | build/ac-macros/svn-macros.m4 | 133 | ||||
-rw-r--r-- | build/ac-macros/swig.m4 | 25 | ||||
-rw-r--r-- | build/ac-macros/zlib.m4 | 2 |
15 files changed, 638 insertions, 583 deletions
diff --git a/build/ac-macros/apache.m4 b/build/ac-macros/apache.m4 index 196ad79..610d956 100644 --- a/build/ac-macros/apache.m4 +++ b/build/ac-macros/apache.m4 @@ -97,10 +97,10 @@ if test -n "$APXS" && test "$APXS" != "no"; then apache_minor_version_wanted_regex="0" ;; 1) - apache_minor_version_wanted_regex=["[1-4]"] + apache_minor_version_wanted_regex=["[1-5]"] ;; 2) - apache_minor_version_wanted_regex=["[3-4]"] + apache_minor_version_wanted_regex=["[3-5]"] ;; *) AC_MSG_ERROR([unknown APR version]) @@ -118,35 +118,55 @@ apache_minor_version=AP_SERVER_MINORVERSION], CPPFLAGS="$old_CPPFLAGS" fi +# check for some busted versions of mod_dav +# in particular 2.2.25, 2.4.5, and 2.4.6 had the following bugs which are +# troublesome for Subversion: +# PR 55304: https://issues.apache.org/bugzilla/show_bug.cgi?id=55304 +# PR 55306: https://issues.apache.org/bugzilla/show_bug.cgi?id=55306 +# PR 55397: https://issues.apache.org/bugzilla/show_bug.cgi?id=55397 +if test -n "$APXS" && test "$APXS" != "no"; then + AC_MSG_CHECKING([mod_dav version]) + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES" + blacklisted_versions_regex=["\"2\" \"\.\" (\"2\" \"\.\" \"25\"|\"4\" \"\.\" \"[56]\")"] + AC_EGREP_CPP([apache_version= *$blacklisted_versions_regex], + [ +#include "$APXS_INCLUDE/ap_release.h" +apache_version=AP_SERVER_BASEREVISION], + [AC_MSG_RESULT([broken]) + AC_MSG_ERROR([Apache httpd version includes a broken mod_dav; use a newer version of httpd])], + [AC_MSG_RESULT([acceptable])]) + 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" -]) + [Install Apache modules to Apache's configured + modules directory instead of LIBEXECDIR; + if PATH is given, install to PATH.])], +[APACHE_LIBEXECDIR="$withval"],[APACHE_LIBEXECDIR='no']) +INSTALL_APACHE_MODS=false 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 + if test "$APACHE_LIBEXECDIR" = 'no'; then APACHE_LIBEXECDIR="$libexecdir" + elif test "$APACHE_LIBEXECDIR" = 'yes'; then + APACHE_LIBEXECDIR="`$APXS -q libexecdir`" fi BUILD_APACHE_RULE=apache-mod INSTALL_APACHE_RULE=install-mods-shared + INSTALL_APACHE_MODS=true case $host in *-*-cygwin*) APACHE_LDFLAGS="-shrext .so" ;; esac -else +elif test x"$APXS" != x"no"; then echo "==================================================================" echo "WARNING: skipping the build of mod_dav_svn" echo " try using --with-apxs" @@ -157,6 +177,7 @@ AC_SUBST(APXS) AC_SUBST(APACHE_LDFLAGS) AC_SUBST(APACHE_INCLUDES) AC_SUBST(APACHE_LIBEXECDIR) +AC_SUBST(INSTALL_APACHE_MODS) # there aren't any flags that interest us ... #if test -n "$APXS" && test "$APXS" != "no"; then diff --git a/build/ac-macros/apr.m4 b/build/ac-macros/apr.m4 index 6085717..49774ba 100644 --- a/build/ac-macros/apr.m4 +++ b/build/ac-macros/apr.m4 @@ -32,7 +32,7 @@ AC_DEFUN(SVN_LIB_APR, AC_MSG_NOTICE([Apache Portable Runtime (APR) library configuration]) - APR_FIND_APR("$abs_srcdir/apr", "$abs_builddir/apr", 1, [1 0]) + APR_FIND_APR("", "", 1, [1 0]) if test $apr_found = "no"; then AC_MSG_WARN([APR not found]) @@ -40,7 +40,7 @@ AC_DEFUN(SVN_LIB_APR, fi if test $apr_found = "reconfig"; then - SVN_EXTERNAL_PROJECT([apr]) + AC_MSG_ERROR([Unexpected APR reconfig]) fi dnl check APR version number against regex @@ -88,11 +88,6 @@ AC_DEFUN(SVN_LIB_APR, 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 @@ -111,7 +106,6 @@ AC_DEFUN(SVN_LIB_APR, 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) @@ -123,29 +117,12 @@ 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 "Please install APR on this system and configure Subversion" + echo "with the appropriate --with-apr option." echo "" - echo " svn co \\" - echo " http://svn.apache.org/repos/asf/apr/apr-util/branches/1.3.x \\" - echo " apr-util" + echo "You probably need to do something similar with the Apache" + echo "Portable Runtime Utility (APRUTIL) library and then configure" + echo "Subversion with both the --with-apr and --with-apr-util options." echo "" - AC_MSG_ERROR([no suitable apr found]) + AC_MSG_ERROR([no suitable APR found]) ]) diff --git a/build/ac-macros/apr_memcache.m4 b/build/ac-macros/apr_memcache.m4 index 384a0e0..3473864 100644 --- a/build/ac-macros/apr_memcache.m4 +++ b/build/ac-macros/apr_memcache.m4 @@ -48,41 +48,26 @@ AC_DEFUN(SVN_LIB_APR_MEMCACHE, 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 + 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" ]) - 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 @@ -92,7 +77,6 @@ dnl We are already linking apr-util everywhere, so no special treatement needed. 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 index 54f5e32..7aace61 100644 --- a/build/ac-macros/aprutil.m4 +++ b/build/ac-macros/aprutil.m4 @@ -38,7 +38,7 @@ AC_DEFUN(SVN_LIB_APRUTIL, AC_MSG_NOTICE([Apache Portable Runtime Utility (APRUTIL) library configuration]) - APR_FIND_APU("$abs_srcdir/apr-util", "$abs_builddir/apr-util", 1, [1 0]) + APR_FIND_APU("", "", 1, [1 0]) if test $apu_found = "no"; then AC_MSG_WARN([APRUTIL not found]) @@ -46,12 +46,12 @@ AC_DEFUN(SVN_LIB_APRUTIL, fi if test $apu_found = "reconfig"; then - SVN_EXTERNAL_PROJECT([apr-util], [--with-apr=../apr]) + AC_MSG_ERROR([Unexpected APRUTIL reconfig]) fi dnl check APRUTIL version number against regex - AC_MSG_CHECKING([APR-UTIL version]) + AC_MSG_CHECKING([APRUTIL version]) apu_version="`$apu_config --version`" if test $? -ne 0; then # This is a hack as suggested by Ben Collins-Sussman. It can be @@ -76,7 +76,7 @@ AC_DEFUN(SVN_LIB_APRUTIL, if test $APU_WANTED_REGEX_MATCH -eq 0; then echo "wanted regexes are $APRUTIL_WANTED_REGEXES" - AC_MSG_ERROR([invalid apr-util version found]) + AC_MSG_ERROR([invalid APRUTIL version found]) fi dnl Get libraries and thread flags from APRUTIL --------------------- @@ -92,11 +92,6 @@ AC_DEFUN(SVN_LIB_APRUTIL, 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 @@ -113,7 +108,6 @@ AC_DEFUN(SVN_LIB_APRUTIL, 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`" @@ -127,20 +121,8 @@ 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 "Install APRUTIL on this system and configure Subversion with the" + echo " appropriate --with-apr-util option." echo "" AC_MSG_ERROR([no suitable APRUTIL found]) ]) diff --git a/build/ac-macros/berkeley-db.m4 b/build/ac-macros/berkeley-db.m4 index b507d51..e424fc8 100644 --- a/build/ac-macros/berkeley-db.m4 +++ b/build/ac-macros/berkeley-db.m4 @@ -36,7 +36,7 @@ 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 Process the `with-berkeley-db' switch. We set `bdb_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. @@ -48,14 +48,14 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB, 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 + requires Berkeley DB $db_version or $db_alt_version. 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 + bdb_status=skip elif test "$withval" = "yes"; then apu_db_version="`$apu_config --db-version`" if test $? -ne 0; then @@ -70,7 +70,7 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB, APR-UTIL with the appropriate options.]) fi - status=required + bdb_status=required elif test "$apu_found" != "reconfig"; then if test "$apu_db_version" -lt 4; then @@ -78,7 +78,7 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB, possible to use the specified Berkeley DB: $withval]) fi - status=required + bdb_status=required fi else if echo "$withval" | $EGREP ":.*:.*:" > /dev/null; then @@ -89,7 +89,7 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB, done SVN_DB_INCLUDES="${SVN_DB_INCLUDES## }" for l in [`echo "$withval" | $SED -e "s/.*:[^:]*:\([^:]*\):.*/\1/"`]; do - LDFLAGS="$LDFLAGS -L$l" + LDFLAGS="$LDFLAGS `SVN_REMOVE_STANDARD_LIB_DIRS(-L$l)`" done SVN_DB_LIBS="" for l in [`echo "$withval" | $SED -e "s/.*:\([^:]*\)/\1/"`]; do @@ -97,7 +97,7 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB, done SVN_DB_LIBS="${SVN_DB_LIBS## }" - status=required + bdb_status=required else AC_MSG_ERROR([Invalid syntax of argument of --with-berkeley-db option]) fi @@ -114,34 +114,47 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB, 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 + bdb_status=try-link elif test "$apu_db_version" -lt "4"; then - status=skip + bdb_status=skip else - status=try-link + bdb_status=try-link fi ]) - if test "$status" = "skip"; then + if test "$bdb_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) + AC_ARG_ENABLE(bdb6, + AS_HELP_STRING([--enable-bdb6], + [Allow building against BDB 6+. + See --with-berkeley-db for specifying the location of + the Berkeley DB installation. Using BDB 6 will fail if + this option is not used.]), + [enable_bdb6=$enableval],[enable_bdb6=unspecified]) + + SVN_LIB_BERKELEY_DB_TRY($1, $2, $3, $enable_bdb6) if test "$svn_have_berkeley_db" = "yes"; then AC_MSG_RESULT([yes]) svn_lib_berkeley_db=yes else - AC_MSG_RESULT([no]) + if test "$svn_have_berkeley_db" = "no6"; then + AC_MSG_RESULT([no (found version 6, but --enable-bdb6 not specified)]) + # A warning will be printed at the end of configure.ac. + else + AC_MSG_RESULT([no]) + fi svn_lib_berkeley_db=no - if test "$status" = "required"; then - AC_MSG_ERROR([Berkeley DB $db_version or newer wasn't found.]) + if test "$bdb_status" = "required"; then + AC_MSG_ERROR([Berkeley DB $db_version or $db_alt_version wasn't found.]) fi fi fi ]) -dnl SVN_LIB_BERKELEY_DB_TRY(major, minor, patch) +dnl SVN_LIB_BERKELEY_DB_TRY(major, minor, patch, enable_bdb6) dnl dnl A subroutine of SVN_LIB_BERKELEY_DB. dnl @@ -174,13 +187,27 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB_TRY, svn_check_berkeley_db_major=$1 svn_check_berkeley_db_minor=$2 svn_check_berkeley_db_patch=$3 + enable_bdb6=$4 - # 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:]]*'`}"] + if test -z "$SVN_DB_LIBS"; then + # We pass --dbm-libs here since Debian has modified apu-config not + # to return -ldb unless --dbm-libs is passed. This may also produce + # extra output beyond -ldb but since we're only filtering for -ldb + # it won't matter to us. However, --dbm-libs was added to apu-config + # in 1.3.8 so it's possible the version we have doesn't support it + # so fallback without it if we get an error. + svn_db_libs_prefiltered=["`$apu_config --libs --dbm-libs`"] + if test $? -ne 0; then + svn_db_libs_prefiltered=["`$apu_config --libs`"] + fi + + # 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=["`echo \"$svn_db_libs_prefiltered\" | $SED -e 's/.*\(-ldb[^[:space:]]*\).*/\1/' | $EGREP -- '-ldb[^[:space:]]*'`"] + fi CPPFLAGS="$SVN_DB_INCLUDES $SVN_APRUTIL_INCLUDES $CPPFLAGS" LIBS="`$apu_config --ldflags` $SVN_DB_LIBS $LIBS" @@ -202,6 +229,7 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB_TRY, ) AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include <string.h> #include <stdlib.h> $svn_db_header @@ -217,6 +245,12 @@ int main () || patch != DB_VERSION_PATCH) exit (1); + /* Block Berkeley DB 6, because (a) we haven't tested with it, (b) 6.0.20 + and newer are under the AGPL, and we want use of AGPL dependencies to be + opt-in. */ + if (major >= 6 && strcmp("$enable_bdb6", "yes")) + exit(2); + /* Run-time check: ensure the library claims to be the correct version. */ if (major < $svn_check_berkeley_db_major) @@ -236,7 +270,11 @@ int main () } ]])], [svn_have_berkeley_db=yes], - [svn_have_berkeley_db=no], + [rc=$? + svn_have_berkeley_db=no + if test $rc = 2; then + svn_have_berkeley_db=no6 + fi], [svn_have_berkeley_db=yes] ) diff --git a/build/ac-macros/compiler.m4 b/build/ac-macros/compiler.m4 new file mode 100644 index 0000000..117bc18 --- /dev/null +++ b/build/ac-macros/compiler.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_CFLAGS_ADD_IFELSE(option, success, failure) +dnl +dnl Check if the C compiler accepts $option. If it does, prepend it +dnl to CFLAGS and execute $success; otherwise execute $failure. +dnl +dnl SVN_CXXFLAGS_ADD_IFELSE(option, success, failure) +dnl +dnl Like SVN_CFLAGS_ADD_IFELSE, but for C++ and CXXFLAGS. +dnl +dnl SVN_PROG_CC: Customized replacement for AC_PROG_CC +dnl SVN_PROG_CXX: Customized replacement for AC_PROG_CXX + +AC_DEFUN([_SVN_XXFLAGS_ADD_IFELSE], +[ + _svn_xxflags__save="[$][$3]" + AC_LANG_PUSH([$1]) + AC_MSG_CHECKING([if [$][$2] accepts $5]) + [$3]="$5 [$][$3]" + dnl Compiling is not enough: Solaris cc accepts invalid options at + dnl compile-time and just warns, assuming they are for the linker, + dnl but they cause errors at link-time. + AC_LINK_IFELSE([AC_LANG_SOURCE([$4])],[ + AC_MSG_RESULT([yes]) + $6 + ],[ + AC_MSG_RESULT([no]) + [$3]="$_svn_xxflags__save" + $7 + ]) + AC_LANG_POP([$1]) +]) + +AC_DEFUN([SVN_CFLAGS_ADD_IFELSE], + [_SVN_XXFLAGS_ADD_IFELSE([C],[CC],[CFLAGS],[[int main(void){return 0;}]],[$1],[$2],[$3])]) + +AC_DEFUN([SVN_CXXFLAGS_ADD_IFELSE], + [_SVN_XXFLAGS_ADD_IFELSE([C++],[CXX],[CXXFLAGS],[[int main(){}]],[$1],[$2],[$3])]) + + +AC_DEFUN([SVN_CC_MODE_SETUP], +[ + CFLAGS_KEEP="$CFLAGS" + CFLAGS="" + + dnl Find flags to force C90 mode + dnl gcc and clang + SVN_CFLAGS_ADD_IFELSE([-std=c90],[],[ + SVN_CFLAGS_ADD_IFELSE([-std=c89],[],[ + SVN_CFLAGS_ADD_IFELSE([-ansi]) + ]) + ]) + + CMODEFLAGS="$CFLAGS" + CFLAGS="$CFLAGS_KEEP" + AC_SUBST(CMODEFLAGS) + AC_SUBST(CMAINTAINERFLAGS) + + dnl Tell clang to not accept unknown warning flags + SVN_CFLAGS_ADD_IFELSE([-Werror=unknown-warning-option]) +]) + + +AC_DEFUN([SVN_CXX_MODE_SETUP], +[ + CXXFLAGS_KEEP="$CXXFLAGS" + CXXFLAGS="" + + dnl Find flags to force C++98 mode + dnl g++ and clang++ + SVN_CXXFLAGS_ADD_IFELSE([-std=c++98]) + + CXXMODEFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS_KEEP" + AC_SUBST(CXXMODEFLAGS) + AC_SUBST(CXXMAINTAINERFLAGS) + + dnl Tell clang++ to not accept unknown warning flags + SVN_CXXFLAGS_ADD_IFELSE([-Werror=unknown-warning-option]) +]) diff --git a/build/ac-macros/gssapi.m4 b/build/ac-macros/gssapi.m4 deleted file mode 100644 index 8a8dc31..0000000 --- a/build/ac-macros/gssapi.m4 +++ /dev/null @@ -1,82 +0,0 @@ -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/kwallet.m4 b/build/ac-macros/kwallet.m4 index 61a2d10..0f0f6ac 100644 --- a/build/ac-macros/kwallet.m4 +++ b/build/ac-macros/kwallet.m4 @@ -35,73 +35,69 @@ AC_DEFUN(SVN_LIB_KWALLET, 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 + 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 - AC_PATH_PROG(KDE4_CONFIG, kde4-config) + KDE4_CONFIG="" + AC_MSG_RESULT([no]) 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([[ + 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 + AC_LANG(C) + if test "$svn_lib_kwallet" = "yes"; then + AC_MSG_RESULT([yes]) + CXXFLAGS="$old_CXXFLAGS" + LIBS="$old_LIBS" else - AC_MSG_ERROR([cannot find kde4-config]) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot find KWallet]) fi else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([cannot find QtCore, QtDBus, QtGui]) + AC_MSG_ERROR([cannot find kde4-config]) fi else - AC_MSG_ERROR([cannot find D-Bus]) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot find QtCore, QtDBus, QtGui]) fi else - AC_MSG_ERROR([cannot find pkg-config]) + AC_MSG_ERROR([cannot find D-Bus]) fi else - AC_MSG_ERROR([missing support for internationalization]) + AC_MSG_ERROR([cannot find pkg-config]) fi else AC_MSG_ERROR([APR does not have support for DSOs]) diff --git a/build/ac-macros/macosx.m4 b/build/ac-macros/macosx.m4 new file mode 100644 index 0000000..43e3eb2 --- /dev/null +++ b/build/ac-macros/macosx.m4 @@ -0,0 +1,110 @@ +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 Mac OS X specific checks + +dnl SVN_LIB_MACHO_ITERATE +dnl Check for _dyld_image_name and _dyld_image_header availability +AC_DEFUN(SVN_LIB_MACHO_ITERATE, +[ + AC_MSG_CHECKING([for Mach-O dynamic module iteration functions]) + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + #include <mach-o/dyld.h> + #include <mach-o/loader.h> + ]],[[ + const struct mach_header *header = _dyld_get_image_header(0); + const char *name = _dyld_get_image_name(0); + if (name && header) return 0; + return 1; + ]])],[ + AC_DEFINE([SVN_HAVE_MACHO_ITERATE], [1], + [Is Mach-O low-level _dyld API available?]) + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + ]) +]) + +dnl SVN_LIB_MACOS_PLIST +dnl Assign variables for Mac OS property list support +AC_DEFUN(SVN_LIB_MACOS_PLIST, +[ + AC_MSG_CHECKING([for Mac OS property list utilities]) + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <AvailabilityMacros.h> + #if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) \ + || !defined(MAC_OS_X_VERSION_10_0) \ + || (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_0) + #error ProperyList API unavailable. + #endif + ]],[[]])],[ + dnl ### Hack. We should only need to pass the -framework options when + dnl linking libsvn_subr, since it is the only library that uses Keychain. + dnl + dnl Unfortunately, libtool 1.5.x doesn't track transitive dependencies for + dnl OS X frameworks like it does for normal libraries, so we need to + dnl explicitly pass the option to all the users of libsvn_subr to allow + dnl static builds to link successfully. + dnl + dnl This does mean that all executables we link will be linked directly + dnl to these frameworks - even when building shared libraries - but that + dnl shouldn't cause any problems. + + LIBS="$LIBS -framework CoreFoundation" + AC_DEFINE([SVN_HAVE_MACOS_PLIST], [1], + [Is Mac OS property list API available?]) + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + ]) +]) + +dnl SVN_LIB_MACOS_KEYCHAIN +dnl Check configure options and assign variables related to Keychain support + +AC_DEFUN(SVN_LIB_MACOS_KEYCHAIN, +[ + AC_ARG_ENABLE(keychain, + AS_HELP_STRING([--disable-keychain], + [Disable use of Mac OS KeyChain for auth credentials]), + [enable_keychain=$enableval],[enable_keychain=yes]) + + AC_MSG_CHECKING([for Mac OS KeyChain Services]) + + if test "$enable_keychain" = "yes"; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <AvailabilityMacros.h> + #if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) \ + || !defined(MAC_OS_X_VERSION_10_2) \ + || (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2) + #error KeyChain API unavailable. + #endif + ]],[[]])],[ + dnl ### Hack, see SVN_LIB_MACOS_PLIST + LIBS="$LIBS -framework Security" + LIBS="$LIBS -framework CoreServices" + AC_DEFINE([SVN_HAVE_KEYCHAIN_SERVICES], [1], [Is Mac OS KeyChain support enabled?]) + AC_MSG_RESULT([yes]) + ],[ + enable_keychain=no + AC_MSG_RESULT([no]) + ]) + fi +]) diff --git a/build/ac-macros/neon.m4 b/build/ac-macros/neon.m4 deleted file mode 100644 index f951039..0000000 --- a/build/ac-macros/neon.m4 +++ /dev/null @@ -1,168 +0,0 @@ -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/serf.m4 b/build/ac-macros/serf.m4 index a6f7cf1..ae11e75 100644 --- a/build/ac-macros/serf.m4 +++ b/build/ac-macros/serf.m4 @@ -19,81 +19,151 @@ 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 Search for a suitable version of serf. min_major_num, +dnl min_minor_num, and min_micro_num are used to determine +dnl if the serf library is at least that version. +dnl +dnl If a --with-serf option (no argument) or --with-serf=yes +dnl option is passed, then a search for serf on the system will be +dnl performed with pkg-config. If --with-serf=yes was actually passed +dnl then we error if we can't actually find serf. +dnl +dnl If a --with-serf=PREFIX option is passed search for a suitable +dnl serf installed on the system under that PREFIX. We will +dnl error if we can't find serf. +dnl +dnl If a --with-serf=no option is passed then no search will be +dnl conducted. +dnl +dnl If the search for serf fails, set svn_lib_serf to no, otherwise set +dnl it to yes. dnl AC_DEFUN(SVN_LIB_SERF, [ serf_found=no + serf_required=no + serf_skip=no serf_check_major="$1" serf_check_minor="$2" serf_check_patch="$3" + serf_check_version="$1.$2.$3" AC_ARG_WITH(serf,AS_HELP_STRING([--with-serf=PREFIX], - [Serf WebDAV client library]), + [Serf HTTP client library (enabled by default if found)]), [ 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([ + serf_required=yes + elif test "$withval" = "no" ; then + serf_skip=yes + else + SVN_SERF_PREFIX_CONFIG() + fi + ]) + + if test "$serf_skip" = "no" ; then + if test "$serf_found" = "no" ; then + SVN_SERF_PKG_CONFIG() + fi + + AC_MSG_CHECKING([was serf enabled]) + if test "$serf_found" = "yes"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + SVN_DOWNLOAD_SERF() + if test "$serf_required" = "yes"; then + AC_MSG_ERROR([Serf was explicitly enabled but an appropriate version was not found.]) + fi + fi + fi + + svn_lib_serf=$serf_found + + AC_SUBST(SVN_SERF_INCLUDES) + AC_SUBST(SVN_SERF_LIBS) +]) + +dnl SVN_SERF_PREFIX_CONFIG() +dnl Use user provided prefix to try and detect and configure serf +AC_DEFUN(SVN_SERF_PREFIX_CONFIG, +[ + AC_MSG_NOTICE([serf library configuration via prefix]) + serf_required=yes + serf_prefix=$withval + for serf_major in serf-2 serf-1; 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 `SVN_REMOVE_STANDARD_LIB_DIRS(-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 +#error Serf version too old: need $serf_check_version #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 +], [serf_found=yes], [AC_MSG_WARN([Serf version too old: need $serf_check_version]) + serf_found=no])], , + $SVN_APRUTIL_LIBS $SVN_APR_LIBS -lz) + LDFLAGS="$save_ldflags"]) + CPPFLAGS="$save_cppflags" + test $serf_found = yes && break + done 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" + LDFLAGS="$LDFLAGS `SVN_REMOVE_STANDARD_LIB_DIRS(-L$serf_prefix/lib)`" fi - elif test $serf_found = "reconfig"; then - serf_found=yes fi +]) - svn_lib_serf=$serf_found +dnl SVN_SERF_PKG_CONFIG() +dnl Use pkg-config to try and detect and configure serf +AC_DEFUN(SVN_SERF_PKG_CONFIG, +[ + AC_MSG_NOTICE([serf library configuration via pkg-config]) + if test -n "$PKG_CONFIG"; then + for serf_major in serf-2 serf-1; do + AC_MSG_CHECKING([for $serf_major library]) + if $PKG_CONFIG $serf_major --exists; then + AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([serf library version]) + SERF_VERSION=`$PKG_CONFIG $serf_major --modversion` + AC_MSG_RESULT([$SERF_VERSION]) + AC_MSG_CHECKING([serf version is suitable]) + if $PKG_CONFIG $serf_major --atleast-version=$serf_check_version; then + AC_MSG_RESULT([yes]) + serf_found=yes + SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_major --cflags | $SED -e 's/-D[^ ]*//g'`] + SVN_SERF_LIBS=`$PKG_CONFIG $serf_major --libs` + break + else + AC_MSG_RESULT([no]) + AC_MSG_WARN([Serf version too old: need $serf_check_version]) + fi + else + AC_MSG_RESULT([no]) + fi + done + fi +]) - AC_SUBST(SVN_SERF_PREFIX) - AC_SUBST(SVN_SERF_INCLUDES) - AC_SUBST(SVN_SERF_LIBS) +dnl SVN_DOWNLOAD_SERF() +dnl no serf found, print out a message telling the user what to do +AC_DEFUN(SVN_DOWNLOAD_SERF, +[ + echo "" + echo "An appropriate version of serf could not be found, so libsvn_ra_serf" + echo "will not be built. If you want to build libsvn_ra_serf, please" + echo "install serf $serf_check_version or newer." + echo "" ]) diff --git a/build/ac-macros/sqlite.m4 b/build/ac-macros/sqlite.m4 index 85a48da..c15d15d 100644 --- a/build/ac-macros/sqlite.m4 +++ b/build/ac-macros/sqlite.m4 @@ -78,6 +78,10 @@ AC_DEFUN(SVN_LIB_SQLITE, SVN_SQLITE_FILE_CONFIG($abs_srcdir/sqlite-amalgamation/sqlite3.c) if test -z "$svn_lib_sqlite"; then + SVN_SQLITE_FILE_CONFIG($abs_builddir/sqlite-amalgamation/sqlite3.c) + fi + + if test -z "$svn_lib_sqlite"; then dnl check the "standard" location of /usr SVN_SQLITE_DIR_CONFIG() fi @@ -106,7 +110,7 @@ AC_DEFUN(SVN_SQLITE_PKG_CONFIG, sqlite_version=`$PKG_CONFIG $SQLITE_PKGNAME --modversion --silence-errors` if test -n "$sqlite_version"; then - SVN_SQLITE_VERNUM_PARSE + SVN_SQLITE_VERNUM_PARSE([$sqlite_version], [sqlite_ver_num]) if test "$sqlite_ver_num" -ge "$sqlite_min_ver_num"; then AC_MSG_RESULT([$sqlite_version]) @@ -189,29 +193,36 @@ AC_DEFUN(SVN_SQLITE_FILE_CONFIG, SQLITE_VERSION_OKAY #endif], [AC_MSG_RESULT([amalgamation found and is okay]) + _SVN_SQLITE_DSO_LIBS 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" + if test -n "$svn_sqlite_dso_ldflags"; then + SVN_SQLITE_LIBS="$svn_sqlite_dso_ldflags -lpthread" + else + SVN_SQLITE_LIBS="-lpthread" + fi svn_lib_sqlite="yes"], [AC_MSG_RESULT([unsupported amalgamation SQLite version])]) fi ]) -dnl SVN_SQLITE_VERNUM_PARSE() +dnl SVN_SQLITE_VERNUM_PARSE(version_string, result_var) dnl -dnl Parse a x.y[.z] version string sqlite_version into a number sqlite_ver_num. +dnl Parse a x.y[.z] version string version_string into a number result_var. 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 + version_string="$1" + + major=`expr $version_string : '\([[0-9]]*\)'` + minor=`expr $version_string : '[[0-9]]*\.\([[0-9]]*\)'` + micro=`expr $version_string : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` + if test -z "$micro"; then + micro=0 fi - sqlite_ver_num=`expr $sqlite_major \* 1000000 \ - \+ $sqlite_minor \* 1000 \ - \+ $sqlite_micro` + $2=`expr $major \* 1000000 \ + \+ $minor \* 1000 \ + \+ $micro` ]) dnl SVN_SQLITE_MIN_VERNUM_PARSE() @@ -220,12 +231,7 @@ 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` + SVN_SQLITE_VERNUM_PARSE([$SQLITE_MINIMUM_VER], [sqlite_min_ver_num]) ]) dnl SVN_DOWNLOAD_SQLITE() @@ -241,9 +247,60 @@ AC_DEFUN(SVN_DOWNLOAD_SQLITE, 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 "unpack the archive using unzip and rename the resulting" + echo "directory to:" + echo "$abs_srcdir/sqlite-amalgamation" + if test x"$abs_srcdir" != x"$abs_builddir"; then + echo "or to:" + echo "$abs_builddir/sqlite-amalgamation" + fi echo "" AC_MSG_ERROR([Subversion requires SQLite]) ]) + +dnl _SVN_SQLITE_DSO_LIBS() dnl Find additional libraries that the +dnl sqlite amalgamation code should link in order to load +dnl shared libraries. Copied from build/libtool.m4 +AC_DEFUN(_SVN_SQLITE_DSO_LIBS, +[ + case $host_os in + beos* | mingw* | pw32* | cegcc* | cygwin*) + svn_sqlite_dso_ldflags= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" svn_sqlite_dso_ldflags="-ldl"],[ + svn_sqlite_dso_ldflags= + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [svn_sqlite_dso_ldflags=], + [AC_CHECK_LIB([dld], [shl_load], + [svn_sqlite_dso_ldflags="-ldld"], + [AC_CHECK_FUNC([dlopen], + [svn_sqlite_dso_ldflags=], + [AC_CHECK_LIB([dl], [dlopen], + [svn_sqlite_dso_ldflags="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [svn_sqlite_dso_ldflags="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [svn_sqlite_dso_ldflags="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + AC_MSG_CHECKING([additional libraries for sqlite]) + if test -n "$svn_sqlite_dso_ldflags"; then + AC_MSG_RESULT(${svn_sqlite_dso_ldflags}) + else + AC_MSG_RESULT(none) + fi +]) diff --git a/build/ac-macros/svn-macros.m4 b/build/ac-macros/svn-macros.m4 index 29e9624..39e53e0 100644 --- a/build/ac-macros/svn-macros.m4 +++ b/build/ac-macros/svn-macros.m4 @@ -46,65 +46,6 @@ EOF ]) -# 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 @@ -141,35 +82,14 @@ 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 SVN_STRIP_FLAG(FLAG_VAR_NAME, FLAG) 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, +dnl Remove FLAG from the variable FLAG_VAR_NAME, if it exists. This macro +dnl is primarily used for removing unwanted compiler flags, but is really +dnl just a general wrapper around `sed'. +AC_DEFUN(SVN_STRIP_FLAG, [ - 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 + $1=`echo "$$1" | $SED -e 's/$2//'` ]) dnl SVN_REMOVE_STANDARD_LIB_DIRS(OPTIONS) @@ -202,3 +122,44 @@ AC_DEFUN([SVN_REMOVE_STANDARD_LIB_DIRS], printf "%s" "${output_flags# }" fi ]) + +AC_DEFUN([SVN_CHECK_FOR_ATOMIC_BUILTINS], +[ + AC_CACHE_CHECK([whether the compiler provides atomic builtins], [svn_cv_atomic_builtins], + [AC_TRY_RUN([ + int main() + { + unsigned long long val = 1010, tmp, *mem = &val; + + if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) + return 1; + + tmp = val; + + if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) + return 1; + + if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) + return 1; + + tmp = 3030; + + if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) + return 1; + + if (__sync_lock_test_and_set(&val, 4040) != 3030) + return 1; + + mem = &tmp; + + if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp) + return 1; + + __sync_synchronize(); + + if (mem != &val) + return 1; + + return 0; + }], [svn_cv_atomic_builtins=yes], [svn_cv_atomic_builtins=no], [svn_cv_atomic_builtins=no])]) +]) diff --git a/build/ac-macros/swig.m4 b/build/ac-macros/swig.m4 index a0e91ee..b7fec72 100644 --- a/build/ac-macros/swig.m4 +++ b/build/ac-macros/swig.m4 @@ -185,9 +185,9 @@ AC_DEFUN(SVN_FIND_SWIG, rbconfig="$RUBY -rrbconfig -e " for var_name in arch archdir CC LDSHARED DLEXT LIBS LIBRUBYARG \ - rubyhdrdir sitedir sitelibdir sitearchdir libdir + rubyhdrdir rubyarchhdrdir sitedir sitelibdir sitearchdir libdir do - rbconfig_tmp=`$rbconfig "print Config::CONFIG@<:@'$var_name'@:>@"` + rbconfig_tmp=`$rbconfig "print RbConfig::CONFIG@<:@'$var_name'@:>@"` eval "rbconfig_$var_name=\"$rbconfig_tmp\"" done @@ -196,7 +196,13 @@ AC_DEFUN(SVN_FIND_SWIG, 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" + svn_cv_ruby_includes="-I. -I$rbconfig_rubyhdrdir -I$rbconfig_rubyhdrdir/ruby -I$rbconfig_rubyhdrdir/ruby/backward" + if test -d "$rbconfig_rubyarchhdrdir"; then + dnl Ruby >=2.0 + svn_cv_ruby_includes="$svn_cv_ruby_includes -I$rbconfig_rubyarchhdrdir" + else + svn_cv_ruby_includes="$svn_cv_ruby_includes -I$rbconfig_rubyhdrdir/$rbconfig_arch" + fi else dnl Ruby 1.8 svn_cv_ruby_includes="-I. -I$rbconfig_archdir" @@ -205,10 +211,14 @@ AC_DEFUN(SVN_FIND_SWIG, 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"`" + svn_cv_ruby_compile="$rbconfig_CC $CFLAGS" ]) SWIG_RB_COMPILE="$svn_cv_ruby_compile" + SVN_STRIP_FLAG([SWIG_RB_COMPILE], [-ansi]) + SVN_STRIP_FLAG([SWIG_RB_COMPILE], [-std=c89]) + SVN_STRIP_FLAG([SWIG_RB_COMPILE], [-std=c90]) + dnl FIXME: Check that the compiler for Ruby actually supports this flag + SWIG_RB_COMPILE="$SWIG_RB_COMPILE -Wno-int-to-pointer-cast" AC_CACHE_CHECK([how to link Ruby extensions], [svn_cv_ruby_link],[ svn_cv_ruby_link="`$RUBY -e 'ARGV.shift; print ARGV.join(%q( ))' \ @@ -226,7 +236,10 @@ AC_DEFUN(SVN_FIND_SWIG, 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" + CFLAGS="$CFLAGS $svn_cv_ruby_includes" + SVN_STRIP_FLAG([CFLAGS], [-ansi]) + SVN_STRIP_FLAG([CFLAGS], [-std=c89]) + SVN_STRIP_FLAG([CFLAGS], [-std=c90]) LIBS="$SWIG_RB_LIBS" AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include <ruby.h> diff --git a/build/ac-macros/zlib.m4 b/build/ac-macros/zlib.m4 index 298dfee..e6ad31c 100644 --- a/build/ac-macros/zlib.m4 +++ b/build/ac-macros/zlib.m4 @@ -61,14 +61,12 @@ AC_DEFUN(SVN_LIB_Z, 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) ]) |