subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g..@apache.org
Subject svn commit: r1516196 [2/26] - in /subversion/branches/invoke-diff-cmd-feature: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ contrib/client-side/emacs/ contrib/hook-scripts/ doc/programmer/ notes/ notes/ht...
Date Wed, 21 Aug 2013 16:09:52 GMT
Modified: subversion/branches/invoke-diff-cmd-feature/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build.conf?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build.conf (original)
+++ subversion/branches/invoke-diff-cmd-feature/build.conf Wed Aug 21 16:09:43 2013
@@ -40,12 +40,16 @@ private-includes =
         subversion/libsvn_delta/compose_delta.c
         subversion/bindings/cxxhl/include/*.hpp
         subversion/bindings/cxxhl/include/svncxxhl/*.hpp
+        subversion/bindings/cxxhl/src/*.hpp
+        subversion/bindings/cxxhl/src/aprwrap/*.hpp
+        subversion/bindings/cxxhl/src/private/*.hpp
         subversion/libsvn_subr/utf8proc/utf8proc.h
-        subversion/libsvn_subr/utf8proc/utf8proc.c.inline
-        subversion/libsvn_subr/utf8proc/utf8proc_data.c.inline
+        subversion/libsvn_subr/utf8proc/utf8proc.c
+        subversion/libsvn_subr/utf8proc/utf8proc_data.c
 private-built-includes =
         subversion/svn_private_config.h
         subversion/libsvn_fs_fs/rep-cache-db.h
+        subversion/libsvn_fs_x/rep-cache-db.h
         subversion/libsvn_wc/wc-metadata.h
         subversion/libsvn_wc/wc-queries.h
         subversion/libsvn_wc/wc-checks.h
@@ -66,8 +70,14 @@ private-built-includes =
         subversion/bindings/javahl/include/org_apache_subversion_javahl_types_VersionExtended_LoadedLib.h
         subversion/bindings/javahl/include/org_apache_subversion_javahl_types_VersionExtended_LoadedLibIterator.h
         subversion/bindings/javahl/include/org_apache_subversion_javahl_types_Revision.h
+        subversion/bindings/javahl/include/org_apache_subversion_javahl_types_RevisionRangeList.h
         subversion/bindings/javahl/include/org_apache_subversion_javahl_callback_UserPasswordCallback.h
-
+        subversion/bindings/javahl/include/org_apache_subversion_javahl_remote_RemoteSession.h
+        subversion/bindings/javahl/include/org_apache_subversion_javahl_remote_RemoteFactory.h
+        subversion/bindings/javahl/include/org_apache_subversion_javahl_remote_CommitEditor.h
+        subversion/bindings/javahl/include/org_apache_subversion_javahl_remote_StateReporter.h
+        subversion/bindings/javahl/include/org_apache_subversion_javahl_ConfigImpl_Category.h
+        subversion/bindings/javahl/include/org_apache_subversion_javahl_util_DiffLib.h
 
 test-scripts =
         subversion/tests/cmdline/*_tests.py
@@ -194,6 +204,14 @@ libs = libsvn_client libsvn_ra libsvn_su
 install = bin
 manpages = subversion/svnmucc/svnmucc.1
 
+[svnauth]
+description = Subversion Authentication Credentials Management Tool
+type = exe
+path = subversion/svnauth
+libs = libsvn_subr apriconv apr serf
+install = bin
+manpages = subversion/svnauth/svnauth.1
+
 # Support for GNOME Keyring
 [libsvn_auth_gnome_keyring]
 description = Subversion GNOME Keyring Library
@@ -265,6 +283,13 @@ install = fsmod-lib
 libs = libsvn_delta libsvn_subr aprutil apriconv apr libsvn_fs_util
 msvc-static = yes
 
+[libsvn_fs_x]
+type = fs-module
+path = subversion/libsvn_fs_x
+install = fsmod-lib
+libs = libsvn_delta libsvn_subr aprutil apriconv apr libsvn_fs_util
+msvc-static = yes
+
 # Low-level grab bag of utilities
 [libsvn_fs_util]
 type = lib
@@ -291,7 +316,7 @@ msvc-export = svn_ra.h private\svn_ra_pr
 type = ra-module
 path = subversion/libsvn_ra_serf
 install = serf-lib
-libs = libsvn_delta libsvn_subr aprutil apriconv apr serf xml
+libs = libsvn_delta libsvn_subr aprutil apriconv apr serf xml zlib
 msvc-libs = secur32.lib
 msvc-static = yes
 
@@ -326,7 +351,7 @@ description = Subversion General Utility
 type = lib
 install = fsmod-lib
 path = subversion/libsvn_subr
-libs = aprutil apriconv apr xml zlib apr_memcache sqlite magic
+libs = aprutil apriconv apr xml zlib apr_memcache sqlite magic intl
 msvc-libs = kernel32.lib advapi32.lib shfolder.lib ole32.lib
             crypt32.lib version.lib psapi.lib
 msvc-export = 
@@ -345,6 +370,7 @@ msvc-export = 
         private\svn_temp_serializer.h private\svn_io_private.h
         private\svn_string_private.h private\svn_magic.h
         private\svn_subr_private.h private\svn_mutex.h private\svn_named_atomic.h
+        private\svn_packed_data.h
 
 # Working copy management lib
 [libsvn_wc]
@@ -392,12 +418,18 @@ msvc-libs = libhttpd.lib
 # CONSTRUCTED HEADERS
 #
 
-[rep_cache]
-description = Schema for the rep-sharing feature
+[rep_cache_fs_fs]
+description = Schema for the FSFS rep-sharing feature
 type = sql-header
 path = subversion/libsvn_fs_fs
 sources = rep-cache-db.sql
 
+[rep_cache_fs_x]
+description = Schema for the FSX rep-sharing feature
+type = sql-header
+path = subversion/libsvn_fs_x
+sources = rep-cache-db.sql
+
 [wc_queries]
 desription = Queries on the WC database
 type = sql-header
@@ -410,7 +442,6 @@ type = sql-header
 path = subversion/libsvn_subr
 sources = internal_statements.sql
 
-
 # ----------------------------------------------------------------------------
 #
 # TARGETS FOR I18N SUPPORT
@@ -433,7 +464,6 @@ sources = core.i
 libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
        libsvn_diff libsvn_subr apr
 description = Subversion core library bindings
-include-runtime = yes
 
 [swig_client]
 type = swig
@@ -503,35 +533,39 @@ description = Subversion WC library bind
 type = swig_lib
 lang = python
 path = subversion/bindings/swig/python/libsvn_swig_py
-libs = libsvn_client libsvn_wc libsvn_ra libsvn_delta libsvn_subr apriconv apr
+libs = libsvn_client libsvn_wc libsvn_ra libsvn_delta libsvn_subr
+       apriconv apr python swig
 link-cmd = $(LINK)
 install = swig-py-lib
 # need special build rule to include -DSWIGPYTHON
 compile-cmd = $(COMPILE_SWIG_PY)
 msvc-static = no
+msvc-export = ../bindings/swig/python/libsvn_swig_py/swigutil_py.h
 
 # SWIG utility library for Perl modules
 [libsvn_swig_perl]
 type = swig_lib
 lang = perl
 path = subversion/bindings/swig/perl/libsvn_swig_perl
-libs = libsvn_delta libsvn_subr apriconv apr
+libs = libsvn_delta libsvn_subr apriconv apr perl swig
 install = swig-pl-lib
 # need special build rule to include
 compile-cmd = $(COMPILE_SWIG_PL)
-msvc-static = yes
+msvc-static = no
+msvc-export = ../bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h
 
 # SWIG utility library for Ruby modules
 [libsvn_swig_ruby]
 type = swig_lib
 lang = ruby
 path = subversion/bindings/swig/ruby/libsvn_swig_ruby
-libs = libsvn_client libsvn_wc libsvn_delta libsvn_subr apriconv apr
+libs = libsvn_client libsvn_wc libsvn_delta libsvn_subr apriconv apr ruby swig
 link-cmd = $(LINK) $(SWIG_RB_LIBS)
 install = swig-rb-lib
 # need special build rule to include
 compile-cmd = $(COMPILE_SWIG_RB)
 msvc-static = no
+msvc-export = ../bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
 
 # ----------------------------------------------------------------------------
 #
@@ -541,7 +575,9 @@ msvc-static = no
 type = java
 path = subversion/bindings/javahl/src/org/apache/subversion/javahl
   subversion/bindings/javahl/src/org/apache/subversion/javahl/callback
+  subversion/bindings/javahl/src/org/apache/subversion/javahl/remote
   subversion/bindings/javahl/src/org/apache/subversion/javahl/types
+  subversion/bindings/javahl/src/org/apache/subversion/javahl/util
 src-root = subversion/bindings/javahl/src
 sources = *.java
 install = javahl-java
@@ -585,8 +621,30 @@ package-roots = org
 #add-deps = javahl-compat-java
 add-deps = $(javahl_compat_java_DEPS)
 
+[javahl-callback-javah]
+type = javah
+path = subversion/bindings/javahl/src/org/apache/subversion/javahl/callback
+classes = subversion/bindings/javahl/classes
+headers = subversion/bindings/javahl/include
+package = org.apache.subversion.javahl.callback
+sources = *.java
+add-deps = $(javahl_java_DEPS)
+install = javahl-javah
+link-cmd = $(COMPILE_JAVAHL_JAVAH) -force
+
+[javahl-remote-javah]
+type = javah
+path = subversion/bindings/javahl/src/org/apache/subversion/javahl/remote
+classes = subversion/bindings/javahl/classes
+headers = subversion/bindings/javahl/include
+package = org.apache.subversion.javahl.remote
+sources = *.java
+add-deps = $(javahl_java_DEPS)
+install = javahl-javah
+link-cmd = $(COMPILE_JAVAHL_JAVAH) -force
+
 [javahl-types-javah]
-type = javah 
+type = javah
 path = subversion/bindings/javahl/src/org/apache/subversion/javahl/types
 classes = subversion/bindings/javahl/classes
 headers = subversion/bindings/javahl/include
@@ -596,19 +654,19 @@ add-deps = $(javahl_java_DEPS)
 install = javahl-javah
 link-cmd = $(COMPILE_JAVAHL_JAVAH) -force
 
-[javahl-callback-javah]
-type = javah 
-path = subversion/bindings/javahl/src/org/apache/subversion/javahl/callback
+[javahl-util-javah]
+type = javah
+path = subversion/bindings/javahl/src/org/apache/subversion/javahl/util
 classes = subversion/bindings/javahl/classes
 headers = subversion/bindings/javahl/include
-package = org.apache.subversion.javahl.callback
+package = org.apache.subversion.javahl.util
 sources = *.java
 add-deps = $(javahl_java_DEPS)
 install = javahl-javah
 link-cmd = $(COMPILE_JAVAHL_JAVAH) -force
 
 [javahl-javah]
-type = javah 
+type = javah
 path = subversion/bindings/javahl/src/org/apache/subversion/javahl
 classes = subversion/bindings/javahl/classes
 headers = subversion/bindings/javahl/include
@@ -623,9 +681,11 @@ description = Subversion Java HighLevel 
 type = lib
 path = subversion/bindings/javahl/native
 libs = libsvn_repos libsvn_client libsvn_wc libsvn_ra libsvn_delta libsvn_diff 
-       libsvn_subr libsvn_fs aprutil apriconv apr
+       libsvn_subr libsvn_fs aprutil apriconv apr java-sdk
 sources = *.cpp *.c
-add-deps = $(javahl_javah_DEPS) $(javahl_java_DEPS) $(javahl_callback_javah_DEPS) $(javahl_types_javah_DEPS)
+add-deps = $(javahl_java_DEPS) $(javahl_callback_javah_DEPS)
+           $(javahl_remote_javah_DEPS) $(javahl_types_javah_DEPS)
+           $(javahl_util_javah_DEPS) $(javahl_javah_DEPS)
 install = javahl-lib
 # need special build rule to include -I$(JDK)/include/jni.h
 compile-cmd = $(COMPILE_JAVAHL_CXX)
@@ -642,7 +702,7 @@ type = lib
 path = subversion/bindings/cxxhl
 libs = libsvn_repos libsvn_client libsvn_wc libsvn_ra libsvn_delta libsvn_diff
        libsvn_subr libsvn_fs aprutil apriconv apr
-sources = src/*.cpp
+sources = src/*.cpp src/aprwrap/*.cpp
 install = cxxhl-lib
 msvc-static = yes
 compile-cmd = $(COMPILE_CXXHL_CXX)
@@ -650,14 +710,31 @@ link-cmd = $(LINK_CXX_LIB)
 
 [cxxhl-tests]
 description = Unit tests for Subversion C++ HighLevel bindings
+when = SVN_USE_GMOCK
 type = exe
 path = subversion/bindings/cxxhl
-libs = libsvncxxhl libsvn_subr
+libs = libsvncxxhl libgmock libsvn_subr apr
 sources = tests/*.cpp
 install = tests
-compile-cmd = $(COMPILE_CXXHL_CXX)
+compile-cmd = $(COMPILE_CXXHL_GMOCK_CXX)
 link-cmd = $(LINK_CXX)
 
+
+# ----------------------------------------------------------------------------
+#
+# Gmock targets
+#
+
+[libgmock]
+description = Googlemock Library
+when = SVN_USE_GMOCK
+type = lib
+path = gmock-fused
+sources = gmock-gtest-all.cc
+install = tests
+compile-cmd = $(COMPILE_GMOCK_CXX)
+link-cmd = $(LINK_CXX_LIB)
+
 # ----------------------------------------------------------------------------
 #
 # TESTING TARGETS
@@ -704,16 +781,35 @@ libs = libsvn_test libsvn_fs libsvn_fs_b
 
 # ----------------------------------------------------------------------------
 # Tests for libsvn_fs_fs
-[fs-pack-test]
+[fs-fs-pack-test]
 description = Test fsfs packing in libsvn_fs_fs
 type = exe
 path = subversion/tests/libsvn_fs_fs
-sources = fs-pack-test.c
+sources = fs-fs-pack-test.c
 install = test
 libs = libsvn_test libsvn_fs libsvn_fs_fs libsvn_delta
        libsvn_subr apriconv apr
 
 # ----------------------------------------------------------------------------
+# Tests for libsvn_fs_x
+[fs-x-pack-test]
+description = Test fsx packing in libsvn_fs_x
+type = exe
+path = subversion/tests/libsvn_fs_x
+sources = fs-x-pack-test.c
+install = test
+libs = libsvn_test libsvn_fs libsvn_fs_x libsvn_delta
+       libsvn_subr apriconv apr
+
+[string-table-test]
+description = Test fsfs string tables
+type = exe
+path = subversion/tests/libsvn_fs_x
+sources = string-table-test.c
+install = test
+libs = libsvn_test libsvn_fs_x libsvn_subr apr
+
+# ----------------------------------------------------------------------------
 # Tests for libsvn_fs
 
 [locks-test]
@@ -867,6 +963,14 @@ sources = named_atomic-test-proc.c
 install = sub-test
 libs = libsvn_subr apr
 
+[packed-data-test]
+description = Test path library
+type = exe
+path = subversion/tests/libsvn_subr
+sources = packed-data-test.c
+install = test
+libs = libsvn_test libsvn_subr apriconv apr
+
 [path-test]
 description = Test path library
 type = exe
@@ -875,6 +979,22 @@ sources = path-test.c
 install = test
 libs = libsvn_test libsvn_subr apriconv apr
 
+[prefix-string-test]
+description = Test path library
+type = exe
+path = subversion/tests/libsvn_subr
+sources = prefix-string-test.c
+install = test
+libs = libsvn_test libsvn_subr apriconv apr
+
+[priority-queue-test]
+description = Test path library
+type = exe
+path = subversion/tests/libsvn_subr
+sources = priority-queue-test.c
+install = test
+libs = libsvn_test libsvn_subr apriconv apr
+
 [revision-test]
 description = Test revision library
 type = exe
@@ -1173,6 +1293,15 @@ external-lib = $(SVN_MAGIC_LIBS)
 type = lib
 external-lib = $(SVN_SASL_LIBS)
 
+[openssl]
+type = lib
+external-lib = $(SVN_OPENSSL_LIBS)
+msvc-libs = ssleay32.lib libeay32.lib
+
+[intl]
+type = lib
+external-lib = $(SVN_INTL_LIBS)
+
 [zlib]
 type = lib
 external-lib = $(SVN_ZLIB_LIBS)
@@ -1187,7 +1316,7 @@ external-lib = $(SVN_APR_MEMCACHE_LIBS)
 type = lib
 external-lib = $(SVN_SERF_LIBS)
 external-project = serf/serf
-libs = apr aprutil xml
+libs = apr aprutil xml openssl
 msvc-static = yes
 
 [sqlite]
@@ -1198,6 +1327,26 @@ external-lib = $(SVN_SQLITE_LIBS)
 type = lib
 external-lib = $(SVN_XML_LIBS)
 
+[swig]
+type = lib
+external-lib = $(SVN_SWIG_LIBS)
+
+[perl]
+type = lib
+external-lib = $(SVN_PERL_LIBS)
+
+[python]
+type = lib
+external-lib = $(SVN_PYTHON_LIBS)
+
+[ruby]
+type = lib
+external-lib = $(SVN_RUBY_LIBS)
+
+[java-sdk]
+type = lib
+external-lib = $(SVN_JAVA_SDK_LIBS)
+
 [ra-libs]
 type = lib
 external-lib = $(SVN_RA_LIB_LINK)
@@ -1206,7 +1355,7 @@ libs = libsvn_ra_serf libsvn_ra_local li
 [fs-libs]
 type = lib
 external-lib = $(SVN_FS_LIB_LINK)
-libs = libsvn_fs_base libsvn_fs_fs
+libs = libsvn_fs_base libsvn_fs_fs libsvn_fs_x
 
 [__ALL__]
 type = project
@@ -1220,10 +1369,12 @@ libs = svn svnadmin svndumpfilter svnloo
 type = project
 path = build/win32
 libs = __ALL__
-       fs-test fs-base-test fs-fsfs-test fs-pack-test skel-test
-       strings-reps-test changes-test locks-test repos-test
+       fs-test fs-base-test fs-fsfs-test fs-fs-pack-test fs-x-pack-test
+       string-table-test
+       skel-test strings-reps-test changes-test locks-test repos-test
        checksum-test compat-test config-test hashdump-test mergeinfo-test
-       opt-test path-test stream-test string-test time-test utf-test
+       opt-test packed-data-test path-test prefix-string-test
+       priority-queue-test stream-test string-test time-test utf-test
        error-test error-code-test cache-test spillbuf-test crypto-test
        named_atomic-test named_atomic-proc-test revision-test
        subst_translate-test io-test
@@ -1266,13 +1417,13 @@ lang = python
 [__SWIG_PERL__]
 type = swig_project
 path = build/win32
-libs = swig_client swig_delta swig_fs swig_ra swig_repos swig_wc swig_core
+libs = swig_client swig_delta swig_diff swig_fs swig_ra swig_repos swig_wc swig_core
 lang = perl
 
 [__SWIG_RUBY__]
 type = swig_project
 path = build/win32
-libs = swig_client swig_delta swig_fs swig_ra swig_repos swig_wc swig_core
+libs = swig_client swig_delta swig_diff swig_fs swig_ra swig_repos swig_wc swig_core
 lang = ruby
 
 [__JAVAHL__]

Modified: subversion/branches/invoke-diff-cmd-feature/build/ac-macros/berkeley-db.m4
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build/ac-macros/berkeley-db.m4?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build/ac-macros/berkeley-db.m4 (original)
+++ subversion/branches/invoke-diff-cmd-feature/build/ac-macros/berkeley-db.m4 Wed Aug 21 16:09:43 2013
@@ -48,7 +48,7 @@ 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
@@ -126,22 +126,35 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB,
     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 "$bdb_status" = "required"; then
-        AC_MSG_ERROR([Berkeley DB $db_version or newer wasn't found.])
+        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,6 +187,7 @@ 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
 
    if test -z "$SVN_DB_LIBS"; then
       # We pass --dbm-libs here since Debian has modified apu-config not
@@ -215,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
 
@@ -230,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)
@@ -249,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]
     )
 

Modified: subversion/branches/invoke-diff-cmd-feature/build/ac-macros/compiler.m4
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build/ac-macros/compiler.m4?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build/ac-macros/compiler.m4 (original)
+++ subversion/branches/invoke-diff-cmd-feature/build/ac-macros/compiler.m4 Wed Aug 21 16:09:43 2013
@@ -67,8 +67,16 @@ AC_DEFUN([SVN_CC_MODE_SETUP],
   ])
 
   CMODEFLAGS="$CFLAGS"
+  CFLAGS=""
+
+  dnl Find flags to silence all warnings
+  SVN_CFLAGS_ADD_IFELSE([-w])
+
+  CNOWARNFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS_KEEP"
+
   AC_SUBST(CMODEFLAGS)
+  AC_SUBST(CNOWARNFLAGS)
   AC_SUBST(CMAINTAINERFLAGS)
 
   dnl Tell clang to not accept unknown warning flags
@@ -85,9 +93,17 @@ AC_DEFUN([SVN_CXX_MODE_SETUP],
                 dnl g++ and clang++
   SVN_CXXFLAGS_ADD_IFELSE([-std=c++98])
 
-  CXXMODEFLAGS="$CXXFLAGS"
+  CXXMODEFLAGS="$CFLAGS"
+  CXXFLAGS=""
+
+  dnl Find flags to silence all warnings
+  SVN_CXXFLAGS_ADD_IFELSE([-w])
+
+  CXXNOWARNFLAGS="$CXXFLAGS"
   CXXFLAGS="$CXXFLAGS_KEEP"
+
   AC_SUBST(CXXMODEFLAGS)
+  AC_SUBST(CXXNOWARNFLAGS)
   AC_SUBST(CXXMAINTAINERFLAGS)
 
   dnl Tell clang++ to not accept unknown warning flags

Modified: subversion/branches/invoke-diff-cmd-feature/build/ac-macros/sqlite.m4
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build/ac-macros/sqlite.m4?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build/ac-macros/sqlite.m4 (original)
+++ subversion/branches/invoke-diff-cmd-feature/build/ac-macros/sqlite.m4 Wed Aug 21 16:09:43 2013
@@ -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
@@ -246,6 +250,10 @@ AC_DEFUN(SVN_DOWNLOAD_SQLITE,
   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])
 ])

Modified: subversion/branches/invoke-diff-cmd-feature/build/generator/gen_base.py
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build/generator/gen_base.py?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build/generator/gen_base.py (original)
+++ subversion/branches/invoke-diff-cmd-feature/build/generator/gen_base.py Wed Aug 21 16:09:43 2013
@@ -75,7 +75,7 @@ class GeneratorBase:
 
     # Now read and parse build.conf
     parser = configparser.ConfigParser()
-    parser.read(fname)
+    parser.readfp(open(fname))
 
     self.conf = build_path(os.path.abspath(fname))
 
@@ -239,36 +239,61 @@ class GeneratorBase:
         except: pass
         os.rename(new_hdrfile, hdrfile)
 
-  @staticmethod
-  def write_errno_table():
+  def write_file_if_changed(self, fname, new_contents):
+    """Rewrite the file if new_contents are different than its current content.
+
+    If you have your windows projects open and generate the projects
+    it's not a small thing for windows to re-read all projects so
+    only update those that have changed.
+    """
+
+    try:
+      old_contents = open(fname, 'rb').read()
+    except IOError:
+      old_contents = None
+    if old_contents != new_contents:
+      open(fname, 'wb').write(new_contents)
+      print("Wrote: %s" % fname)
+
+
+  def write_errno_table(self):
     # ### We generate errorcode.inc at autogen.sh time (here!).
     # ###
     # ### Currently it's only used by maintainer-mode builds.  If this
     # ### functionality ever moves to release builds, it will have to move
-    # ### to configure-time.  (But then you have to solve two problems:
-    # ### what to do on windows, and what to do on unix when Python is not
-    # ### available at configure-time.)
+    # ### to configure-time (but remember that Python cannot be assumed to
+    # ### be available from 'configure').
     import errno
-    fd = open('subversion/libsvn_subr/errorcode.inc', 'w')
-    fd.write('/* This file was generated by build/generator/gen_base.py */\n\n')
 
-    ## write errno codes.
-    fd.write('static struct {\n'
-             '  int errcode;\n'
-             '  const char *errname;\n'
-             '} svn__errno[] = {\n');
-    for num, val in sorted(errno.errorcode.items()):
-      fd.write('  { %d, "%s" },\n' % (num, val))
-    # fd.seek(-2, os.SEEK_CUR); fd.write('\n');
-    fd.write('};\n')
-
-    fd.write('\n')
-
-    ## write apr error codes.
-    fd.write('static struct {\n'
-             '  int errcode;\n'
-             '  const char *errname;\n'
-             '} svn__apr_errno[] = {\n');
+    lines = [
+        '/* This file was generated by build/generator/gen_base.py */',
+        ''
+    ]
+
+    def write_struct(name, codes):
+      lines.extend([
+          'static struct {',
+          '  int errcode;',
+          '  const char *errname;',
+          '} %s[] = {' % (name,),
+        ])
+
+      for num, val in sorted(codes):
+        lines.extend([
+            '  { %d, "%s" },' % (num, val),
+          ])
+
+       # Remove ',' for c89 compatibility
+      lines[-1] = lines[-1][0:-1]
+
+      lines.extend([
+          '};',
+          '',
+        ])
+
+    write_struct('svn__errno', errno.errorcode.items())
+
+    # Fetch and write apr_errno.h codes.
     aprerr = []
     for line in open(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),
                                   'tools', 'dev', 'aprerr.txt')):
@@ -277,16 +302,19 @@ class GeneratorBase:
          continue
       key, _, val = line.split()
       aprerr += [(int(val), key)]
-    for num, val in sorted(aprerr):
-      fd.write('  { %d, "%s" },\n' % (num, val))
-    # fd.seek(-2, os.SEEK_CUR); fd.write('\n');
-    fd.write('};\n')
+    write_struct('svn__apr_errno', aprerr)
 
     ## sanity check
     intersection = set(errno.errorcode.keys()) & set(dict(aprerr).keys())
-    if intersection:
+    if self.errno_filter(intersection):
         print("WARNING: errno intersects APR error codes: %r" % intersection)
 
+    self.write_file_if_changed('subversion/libsvn_subr/errorcode.inc',
+                               '\n'.join(lines))
+
+  def errno_filter(self, codes):
+    return codes
+
 class DependencyGraph:
   """Record dependencies between build items.
 
@@ -471,13 +499,14 @@ class TargetLinked(Target):
     # the specified install area depends upon this target
     self.gen_obj.graph.add(DT_INSTALL, self.install, self)
 
-    sources = sorted(_collect_paths(self.sources or '*.c' or '*.cpp', self.path))
+    sources = sorted(_collect_paths(self.sources, self.path))
 
-    for srcs, reldir in sources:
-      for src in srcs.split(" "):
+    for src, reldir in sources:
         if glob.glob(src):
           if src[-2:] == '.c':
             objname = src[:-2] + self.objext
+          elif src[-3:] == '.cc':
+            objname = src[:-3] + self.objext
           elif src[-4:] == '.cpp':
             objname = src[:-4] + self.objext
           else:
@@ -561,6 +590,12 @@ class TargetLib(TargetLinked):
     self.msvc_fake = options.get('msvc-fake') == 'yes' # has fake target
     self.msvc_export = options.get('msvc-export', '').split()
 
+  def disable_shared(self):
+    "tries to disable building as a shared library,"
+
+    self.msvc_static = True
+    self.msvc_export = []
+
 class TargetApacheMod(TargetLib):
 
   def __init__(self, name, options, gen_obj):
@@ -622,7 +657,6 @@ class TargetSWIG(TargetLib):
     TargetLib.__init__(self, name, options, gen_obj)
     self.lang = lang
     self.desc = self.desc + ' for ' + lang_full_name[lang]
-    self.include_runtime = options.get('include-runtime') == 'yes'
 
     ### hmm. this is Makefile-specific
     self.link_cmd = '$(LINK_%s_WRAPPER)' % lang_abbrev[lang].upper()
@@ -646,13 +680,16 @@ class TargetSWIG(TargetLib):
     module_name = iname[:4] != 'svn_' and iname[:-2] or iname[4:-2]
 
     lib_extension = self.gen_obj._extension_map['lib', 'target']
-    if self.lang == "ruby":
+    if self.lang == "python":
+      lib_extension = self.gen_obj._extension_map['pyd', 'target']
+      lib_filename = '_' + module_name + lib_extension
+    elif self.lang == "ruby":
+      lib_extension = self.gen_obj._extension_map['so', 'target']
       lib_filename = module_name + lib_extension
     elif self.lang == "perl":
       lib_filename = '_' + module_name.capitalize() + lib_extension
     else:
-      lib_extension = self.gen_obj._extension_map['pyd', 'target']
-      lib_filename = '_' + module_name + lib_extension
+      lib_filename = module_name + lib_extension
 
     self.name = self.lang + '_' + module_name
     self.path = build_path_join(self.path, self.lang)
@@ -702,6 +739,12 @@ class TargetSWIGLib(TargetLib):
         return [ self.target ]
       return [ ]
 
+  def disable_shared(self):
+    "disables building shared libraries"
+
+    return # Explicit NO-OP
+
+
 class TargetProject(Target):
   def __init__(self, name, options, gen_obj):
     Target.__init__(self, name, options, gen_obj)
@@ -954,10 +997,13 @@ def _collect_paths(pats, path=None):
   path (string), if specified, is a path that will be prepended to each
     glob pattern before it is evaluated
 
-  If path is none the return value is a list of filenames, otherwise
+  If path is None the return value is a list of filenames, otherwise
   the return value is a list of 2-tuples. The first element in each tuple
   is a matching filename and the second element is the portion of the
   glob pattern which matched the file before its last forward slash (/)
+
+  If no files are found matching a pattern, then include the pattern itself
+  as a filename in the results.
   """
   result = [ ]
   for base_pat in pats.split():

Modified: subversion/branches/invoke-diff-cmd-feature/build/generator/gen_make.py
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build/generator/gen_make.py?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build/generator/gen_make.py (original)
+++ subversion/branches/invoke-diff-cmd-feature/build/generator/gen_make.py Wed Aug 21 16:09:43 2013
@@ -62,6 +62,8 @@ class Generator(gen_base.GeneratorBase):
     ('lib', 'object'): '.lo',
     ('pyd', 'target'): '.la',
     ('pyd', 'object'): '.lo',
+    ('so', 'target'): '.la',
+    ('so', 'object'): '.lo',
     }
 
   def __init__(self, fname, verfname, options=None):
@@ -236,6 +238,7 @@ class Generator(gen_base.GeneratorBase):
       header_class_filenames = [ ]
       deps = [ ]
       libs = [ ]
+      add_deps = target_ob.add_deps.split()
 
       for link_dep in self.graph.get_sources(gen_base.DT_LINK, target_ob.name):
         if isinstance(link_dep, gen_base.TargetJava):
@@ -286,7 +289,7 @@ class Generator(gen_base.GeneratorBase):
                             varname=targ_varname,
                             path=path,
                             install=None,
-                            add_deps=target_ob.add_deps,
+                            add_deps=add_deps,
                             objects=objects,
                             deps=deps,
                             when=target_ob.when,

Modified: subversion/branches/invoke-diff-cmd-feature/build/generator/gen_msvc_dsp.py
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build/generator/gen_msvc_dsp.py?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build/generator/gen_msvc_dsp.py (original)
+++ subversion/branches/invoke-diff-cmd-feature/build/generator/gen_msvc_dsp.py Wed Aug 21 16:09:43 2013
@@ -82,7 +82,6 @@ class Generator(gen_win.WinGeneratorBase
       'rootpath' : self.rootpath,
       'platforms' : self.platforms,
       'configs' : configs,
-      'includes' : self.get_win_includes(target),
       'sources' : sources,
       'default_platform' : self.platforms[0],
       'default_config' : configs[0].name,

Modified: subversion/branches/invoke-diff-cmd-feature/build/generator/gen_vcnet_vcproj.py
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build/generator/gen_vcnet_vcproj.py?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build/generator/gen_vcnet_vcproj.py (original)
+++ subversion/branches/invoke-diff-cmd-feature/build/generator/gen_vcnet_vcproj.py Wed Aug 21 16:09:43 2013
@@ -38,6 +38,23 @@ class Generator(gen_win.WinGeneratorBase
   def quote(self, str):
     return '"%s"' % str
 
+  def gen_proj_names(self, install_targets):
+    "Generate project file names for the targets"
+
+    if float(self.vcproj_version) < 11.0:
+      gen_win.WinGeneratorBase.gen_proj_names(self, install_targets)
+      return
+
+    # With VS2012 we can assume that even the light versions
+    # support proper project nesting in the UI
+
+    for target in install_targets:
+      if target.msvc_name:
+        target.proj_name = target.msvc_name
+        continue
+
+      target.proj_name = target.name
+
   def get_external_project(self, target, proj_ext):
     "Link project files: prefer vcproj's, but if don't exist, try dsp's."
     vcproj = gen_win.WinGeneratorBase.get_external_project(self, target,
@@ -100,7 +117,6 @@ class Generator(gen_win.WinGeneratorBase
       'platforms' : self.platforms,
       'config_type' : config_type,
       'configs' : configs,
-      'includes' : self.get_win_includes(target),
       'sources' : sources,
       'default_platform' : self.platforms[0],
       'default_config' : configs[0].name,

Modified: subversion/branches/invoke-diff-cmd-feature/build/generator/gen_win.py
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build/generator/gen_win.py?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build/generator/gen_win.py (original)
+++ subversion/branches/invoke-diff-cmd-feature/build/generator/gen_win.py Wed Aug 21 16:09:43 2013
@@ -38,6 +38,7 @@ import string
 import generator.swig.header_wrappers
 import generator.swig.checkout_swig_header
 import generator.swig.external_runtime
+import gen_win_dependencies
 
 if sys.version_info[0] >= 3:
   # Python >=3.0
@@ -52,177 +53,7 @@ else:
 import gen_base
 import ezt
 
-
-class GeneratorBase(gen_base.GeneratorBase):
-  """This intermediate base class exists to be instantiated by win-tests.py,
-  in order to obtain information from build.conf and library paths without
-  actually doing any generation."""
-  _extension_map = {
-    ('exe', 'target'): '.exe',
-    ('exe', 'object'): '.obj',
-    ('lib', 'target'): '.dll',
-    ('lib', 'object'): '.obj',
-    ('pyd', 'target'): '.pyd',
-    ('pyd', 'object'): '.obj',
-    }
-
-  def parse_options(self, options):
-    self.apr_path = 'apr'
-    self.apr_util_path = 'apr-util'
-    self.apr_iconv_path = 'apr-iconv'
-    self.serf_path = None
-    self.serf_lib = None
-    self.bdb_path = 'db4-win32'
-    self.httpd_path = None
-    self.libintl_path = None
-    self.zlib_path = 'zlib'
-    self.openssl_path = None
-    self.jdk_path = None
-    self.junit_path = None
-    self.swig_path = None
-    self.vs_version = '2002'
-    self.sln_version = '7.00'
-    self.vcproj_version = '7.00'
-    self.vcproj_extension = '.vcproj'
-    self.sqlite_path = 'sqlite-amalgamation'
-    self.skip_sections = { 'mod_dav_svn': None,
-                           'mod_authz_svn': None,
-                           'mod_dontdothat' : None,
-                           'libsvn_auth_kwallet': None,
-                           'libsvn_auth_gnome_keyring': None }
-
-    # Instrumentation options
-    self.disable_shared = None
-    self.static_apr = None
-    self.static_openssl = None
-    self.instrument_apr_pools = None
-    self.instrument_purify_quantify = None
-    self.configure_apr_util = None
-    self.sasl_path = None
-
-    # NLS options
-    self.enable_nls = None
-
-    # ML (assembler) is disabled by default; use --enable-ml to detect
-    self.enable_ml = None
-
-    for opt, val in options:
-      if opt == '--with-berkeley-db':
-        self.bdb_path = val
-      elif opt == '--with-apr':
-        self.apr_path = val
-      elif opt == '--with-apr-util':
-        self.apr_util_path = val
-      elif opt == '--with-apr-iconv':
-        self.apr_iconv_path = val
-      elif opt == '--with-serf':
-        self.serf_path = val
-      elif opt == '--with-httpd':
-        self.httpd_path = val
-        del self.skip_sections['mod_dav_svn']
-        del self.skip_sections['mod_authz_svn']
-        del self.skip_sections['mod_dontdothat']
-      elif opt == '--with-libintl':
-        self.libintl_path = val
-        self.enable_nls = 1
-      elif opt == '--with-jdk':
-        self.jdk_path = val
-      elif opt == '--with-junit':
-        self.junit_path = val
-      elif opt == '--with-zlib':
-        self.zlib_path = val
-      elif opt == '--with-swig':
-        self.swig_path = val
-      elif opt == '--with-sqlite':
-        self.sqlite_path = val
-      elif opt == '--with-sasl':
-        self.sasl_path = val
-      elif opt == '--with-openssl':
-        self.openssl_path = val
-      elif opt == '--enable-purify':
-        self.instrument_purify_quantify = 1
-        self.instrument_apr_pools = 1
-      elif opt == '--enable-quantify':
-        self.instrument_purify_quantify = 1
-      elif opt == '--enable-pool-debug':
-        self.instrument_apr_pools = 1
-      elif opt == '--enable-nls':
-        self.enable_nls = 1
-      elif opt == '--enable-bdb-in-apr-util':
-        self.configure_apr_util = 1
-      elif opt == '--enable-ml':
-        self.enable_ml = 1
-      elif opt == '--disable-shared':
-        self.disable_shared = 1
-      elif opt == '--with-static-apr':
-        self.static_apr = 1
-      elif opt == '--with-static-openssl':
-        self.static_openssl = 1
-      elif opt == '--vsnet-version':
-        if val == '2002' or re.match('7(\.\d+)?$', val):
-          self.vs_version = '2002'
-          self.sln_version = '7.00'
-          self.vcproj_version = '7.00'
-          self.vcproj_extension = '.vcproj'
-        elif val == '2003' or re.match('8(\.\d+)?$', val):
-          self.vs_version = '2003'
-          self.sln_version = '8.00'
-          self.vcproj_version = '7.10'
-          self.vcproj_extension = '.vcproj'
-        elif val == '2005' or re.match('9(\.\d+)?$', val):
-          self.vs_version = '2005'
-          self.sln_version = '9.00'
-          self.vcproj_version = '8.00'
-          self.vcproj_extension = '.vcproj'
-        elif val == '2008' or re.match('10(\.\d+)?$', val):
-          self.vs_version = '2008'
-          self.sln_version = '10.00'
-          self.vcproj_version = '9.00'
-          self.vcproj_extension = '.vcproj'
-        elif val == '2010':
-          self.vs_version = '2010'
-          self.sln_version = '11.00'
-          self.vcproj_version = '10.0'
-          self.vcproj_extension = '.vcxproj'
-        elif val == '2012' or val == '11':
-          self.vs_version = '2012'
-          self.sln_version = '12.00'
-          self.vcproj_version = '11.0'
-          self.vcproj_extension = '.vcxproj'
-        elif re.match('^1\d+$', val):
-          self.vsversion = val
-          self.sln_version = '12.00'
-          self.vcproj_version = val + '.0'
-          self.vcproj_extension = '.vcxproj'
-        else:
-          print('WARNING: Unknown VS.NET version "%s",'
-                 ' assuming "%s"\n' % (val, '7.00'))
-
-
-  def __init__(self, fname, verfname, options):
-
-    # parse (and save) the options that were passed to us
-    self.parse_options(options)
-
-    # Initialize parent
-    gen_base.GeneratorBase.__init__(self, fname, verfname, options)
-
-    # Find Berkeley DB
-    self._find_bdb()
-
-  def _find_bdb(self):
-    "Find the Berkeley DB library and version"
-    for ver in ("53", "52", "51", "50", "48", "47", "46",
-                "45", "44", "43", "42", "41", "40"):
-      lib = "libdb" + ver
-      path = os.path.join(self.bdb_path, "lib")
-      if os.path.exists(os.path.join(path, lib + ".lib")):
-        self.bdb_lib = lib
-        break
-    else:
-      self.bdb_lib = None
-
-class WinGeneratorBase(GeneratorBase):
+class WinGeneratorBase(gen_win_dependencies.GenDependenciesBase):
   "Base class for all Windows project files generators"
 
   def __init__(self, fname, verfname, options, subdir):
@@ -234,47 +65,33 @@ class WinGeneratorBase(GeneratorBase):
     """
 
     # Initialize parent
-    GeneratorBase.__init__(self, fname, verfname, options)
+    gen_win_dependencies.GenDependenciesBase.__init__(self, fname, verfname,
+                                                      options, find_libs=False)
 
-    if self.bdb_lib is not None:
-      print("Found %s.lib in %s\n" % (self.bdb_lib, self.bdb_path))
-    else:
-      print("BDB not found, BDB fs will not be built\n")
+    # On Windows we create svn_private_config.h in the output directory since
+    # r1370526.
+    # 
+    # Without this replacement all projects include a not-existing file,
+    # which makes the MSBuild calculation to see whether a project is changed
+    # far more expensive than necessary.
+    self.private_built_includes.append('$(Configuration)/svn_private_config.h')
+    self.private_built_includes.remove('subversion/svn_private_config.h')
 
     if subdir == 'vcnet-vcproj':
       print('Generating for Visual Studio %s\n' % self.vs_version)
 
-    # Find the right Ruby include and libraries dirs and
-    # library name to link SWIG bindings with
-    self._find_ruby()
-
-    # Find the right Perl library name to link SWIG bindings with
-    self._find_perl()
-
-    # Find the right Python include and libraries dirs for SWIG bindings
-    self._find_python()
-
-    # Find the installed SWIG version to adjust swig options
-    self._find_swig()
+    self.find_libraries(True)
 
-    # Find the installed Java Development Kit
-    self._find_jdk()
+    # Print list of identified libraries
+    printed = []
+    for lib in sorted(self._libraries.values(), key = lambda s: s.name):
+      if lib.name in printed:
+        continue 
+      printed.append(lib.name)
+      print('Found %s %s' % (lib.name, lib.version))
 
-    # Find APR and APR-util version
-    self._find_apr()
-    self._find_apr_util()
-
-    # Find Sqlite
-    self._find_sqlite()
-
-    # Look for ZLib and ML
-    if self.zlib_path:
-      self._find_zlib()
-      self._find_ml()
-
-    # Find serf and its dependencies
-    if self.serf_path:
-      self._find_serf()
+    if 'db' not in self._libraries:
+      print('BDB not found, BDB fs will not be built')
 
     #Make some files for the installer so that we don't need to
     #require sed or some other command to do it
@@ -298,7 +115,7 @@ class WinGeneratorBase(GeneratorBase):
       os.makedirs(self.projfilesdir)
 
     # Generate the build_zlib.bat file
-    if self.zlib_path:
+    if self._libraries['zlib'].is_src:
       data = {'zlib_path': os.path.relpath(self.zlib_path, self.projfilesdir),
               'zlib_version': self.zlib_version,
               'use_ml': self.have_ml and 1 or None}
@@ -306,16 +123,16 @@ class WinGeneratorBase(GeneratorBase):
       self.write_with_template(bat, 'templates/build_zlib.ezt', data)
 
     # Generate the build_locale.bat file
-    pofiles = []
     if self.enable_nls:
+      pofiles = []
       for po in os.listdir(os.path.join('subversion', 'po')):
         if fnmatch.fnmatch(po, '*.po'):
           pofiles.append(POFile(po[:-3]))
 
-    data = {'pofiles': pofiles}
-    self.write_with_template(os.path.join(self.projfilesdir,
-                                          'build_locale.bat'),
-                             'templates/build_locale.ezt', data)
+      data = {'pofiles': pofiles}
+      self.write_with_template(os.path.join(self.projfilesdir,
+                                            'build_locale.bat'),
+                               'templates/build_locale.ezt', data)
 
     #Here we can add additional platforms to compile for
     self.platforms = ['Win32']
@@ -328,7 +145,7 @@ class WinGeneratorBase(GeneratorBase):
     #Here we can add additional modes to compile for
     self.configs = ['Debug','Release']
 
-    if self.swig_libdir:
+    if 'swig' in self._libraries:
       # Generate SWIG header wrappers and external runtime
       for swig in (generator.swig.header_wrappers,
                    generator.swig.checkout_swig_header,
@@ -337,6 +154,11 @@ class WinGeneratorBase(GeneratorBase):
     else:
       print("%s not found; skipping SWIG file generation..." % self.swig_exe)
 
+  def errno_filter(self, codes):
+    "Callback for gen_base.write_errno_table()."
+    # Filter out python's SOC* codes, which alias the windows API names.
+    return set(filter(lambda code: not (10000 <= code <= 10100), codes))
+
   def find_rootpath(self):
     "Gets the root path as understand by the project system"
     return os.path.relpath('.', self.projfilesdir) + "\\"
@@ -379,26 +201,32 @@ class WinGeneratorBase(GeneratorBase):
     # Don't create projects for scripts
     install_targets = [x for x in install_targets if not isinstance(x, gen_base.TargetScript)]
 
+    if not self.enable_nls:
+      install_targets = [x for x in install_targets if x.name != 'locale']
+
     # Drop the libsvn_fs_base target and tests if we don't have BDB
-    if not self.bdb_lib:
+    if 'db' not in self._libraries:
       install_targets = [x for x in install_targets if x.name != 'libsvn_fs_base']
       install_targets = [x for x in install_targets if not (isinstance(x, gen_base.TargetExe)
                                                             and x.install == 'bdb-test')]
 
-    # Drop the serf target if we don't have both serf and openssl
-    if not self.serf_lib:
-      install_targets = [x for x in install_targets if x.name != 'serf']
+    # Drop the ra_serf target if we don't have serf
+    if 'serf' not in self._libraries:
       install_targets = [x for x in install_targets if x.name != 'libsvn_ra_serf']
+    # Drop the serf target if we don't build serf ourselves
+    if 'serf' not in self._libraries or not self._libraries['serf'].is_src:
+      install_targets = [x for x in install_targets if x.name != 'serf']
 
-    # Drop the swig targets if we don't have swig
-    if not self.swig_path and not self.swig_libdir:
-      install_targets = [x for x in install_targets
-                                     if not (isinstance(x, gen_base.TargetSWIG)
-                                             or isinstance(x, gen_base.TargetSWIGLib)
-                                             or isinstance(x, gen_base.TargetSWIGProject))]
+    # Drop the swig targets if we don't have swig or language support
+    install_targets = [x for x in install_targets
+                       if (not (isinstance(x, gen_base.TargetSWIG)
+                                or isinstance(x, gen_base.TargetSWIGLib)
+                                or isinstance(x, gen_base.TargetSWIGProject))
+                           or (x.lang in self._libraries
+                               and 'swig' in self._libraries))]
 
     # Drop the Java targets if we don't have a JDK
-    if not self.jdk_path:
+    if 'java_sdk' not in self._libraries:
       install_targets = [x for x in install_targets
                                      if not (isinstance(x, gen_base.TargetJava)
                                              or isinstance(x, gen_base.TargetJavaHeaders)
@@ -406,6 +234,12 @@ class WinGeneratorBase(GeneratorBase):
                                              or x.name == '__JAVAHL_TESTS__'
                                              or x.name == 'libsvnjavahl')]
 
+    # If we don't build 'ZLib' ourself, remove this target and all the dependencies on it
+    if not self._libraries['zlib'].is_src:
+      install_targets = [x for x in install_targets if x.name != 'zlib']
+      # TODO: Fixup dependencies
+
+    # Create DLL targets for libraries
     dll_targets = []
     for target in install_targets:
       if isinstance(target, gen_base.TargetLib):
@@ -413,7 +247,7 @@ class WinGeneratorBase(GeneratorBase):
           install_targets.append(self.create_fake_target(target))
         if target.msvc_export:
           if self.disable_shared:
-            target.msvc_static = True
+            target.disable_shared()
           else:
             dll_targets.append(self.create_dll_target(target))
     install_targets.extend(dll_targets)
@@ -489,6 +323,9 @@ class WinGeneratorBase(GeneratorBase):
                     defines=self.get_win_defines(target, cfg),
                     libdirs=self.get_win_lib_dirs(target, cfg),
                     libs=self.get_win_libs(target, cfg),
+                    includes=self.get_win_includes(target, cfg),
+                    forced_include_files
+                            =self.get_win_forced_includes(target, cfg),
                     ))
     return configs
 
@@ -509,6 +346,7 @@ class WinGeneratorBase(GeneratorBase):
         cbuild = None
         ctarget = None
         cdesc = None
+        cignore = None
         if isinstance(target, gen_base.TargetJavaHeaders):
           classes = self.path(target.classes)
           if self.junit_path is not None:
@@ -543,9 +381,18 @@ class WinGeneratorBase(GeneratorBase):
         if quote_path and '-' in rsrc:
           rsrc = '"%s"' % rsrc
 
+        if (not isinstance(source, gen_base.SourceFile)
+            and cbuild is None and ctarget is None and cdesc is None
+            and source in self._excluded_from_build):
+          # Make sure include dependencies are excluded from the build.
+          # This is an 'orrible 'ack that relies on the source being a
+          # string if it's an include dependency, or a SourceFile object
+          # otherwise.
+          cignore = 'yes'
+
         sources.append(ProjectItem(path=rsrc, reldir=reldir, user_deps=[],
                                    custom_build=cbuild, custom_target=ctarget,
-                                   custom_desc=cdesc,
+                                   custom_desc=cdesc, ignored = cignore,
                                    extension=os.path.splitext(rsrc)[1]))
 
     if isinstance(target, gen_base.TargetJavaClasses) and target.jar:
@@ -666,8 +513,7 @@ class WinGeneratorBase(GeneratorBase):
       return self.get_output_dir(target)
 
   def get_def_file(self, target):
-    if isinstance(target, gen_base.TargetLib) and target.msvc_export \
-       and not self.disable_shared:
+    if isinstance(target, gen_base.TargetLib) and target.msvc_export:
       return target.name + ".def"
     return None
 
@@ -697,7 +543,7 @@ class WinGeneratorBase(GeneratorBase):
             and target.external_project):
       return None
 
-    if target.external_project[:5] == 'serf/' and self.serf_lib:
+    if target.external_project[:5] == 'serf/' and 'serf' in self._libraries:
       path = self.serf_path + target.external_project[4:]
     elif target.external_project.find('/') != -1:
       path = target.external_project
@@ -720,8 +566,8 @@ class WinGeneratorBase(GeneratorBase):
     if self.enable_nls and name == '__ALL__':
       depends.extend(self.sections['locale'].get_targets())
 
-    # Build ZLib as a dependency of Serf if we have it
-    if self.zlib_path and name == 'serf':
+    # Make ZLib a dependency of serf if we build the zlib src
+    if name == 'serf' and self._libraries['zlib'].is_src:
       depends.extend(self.sections['zlib'].get_targets())
 
     # To set the correct build order of the JavaHL targets, the javahl-javah
@@ -743,7 +589,9 @@ class WinGeneratorBase(GeneratorBase):
 
     dep_dict = {}
 
-    if isinstance(target, gen_base.TargetLib) and target.msvc_static:
+    if mode == FILTER_EXTERNALLIBS:
+      self.get_externallib_depends(target, dep_dict)
+    elif isinstance(target, gen_base.TargetLib) and target.msvc_static:
       self.get_static_win_depends(target, dep_dict)
     else:
       self.get_linked_win_depends(target, dep_dict)
@@ -758,6 +606,10 @@ class WinGeneratorBase(GeneratorBase):
       for dep, (is_proj, is_lib, is_static) in dep_dict.items():
         if is_static or (is_lib and not is_proj):
           deps.append(dep)
+    elif mode == FILTER_EXTERNALLIBS:
+      for dep, (is_proj, is_lib, is_static) in dep_dict.items():
+        if is_static or (is_lib and not is_proj):
+          deps.append(dep)
     else:
       raise NotImplementedError
 
@@ -823,7 +675,7 @@ class WinGeneratorBase(GeneratorBase):
         # every dll dependency we first check to see if its corresponding
         # static library is already in the list of dependencies. If it is,
         # we don't add the dll to the list.
-        if is_lib and dep.msvc_export and not self.disable_shared:
+        if is_lib and dep.msvc_export:
           static_dep = self.graph.get_sources(gen_base.DT_LINK, dep.name)[0]
           if static_dep in deps:
             continue
@@ -841,6 +693,21 @@ class WinGeneratorBase(GeneratorBase):
       elif is_static:
         self.get_linked_win_depends(dep, deps, 1)
 
+      # and recurse over the external library dependencies for swig libraries,
+      # to include the language runtime
+      elif isinstance(dep, gen_base.TargetSWIGLib):
+        self.get_externallib_depends(dep, deps)
+
+  def get_externallib_depends(self, target, deps):
+    """Find externallib dependencies for a project"""
+
+    direct_deps = self.get_direct_depends(target)
+    for dep, dep_kind in direct_deps:
+      self.get_externallib_depends(dep, deps)
+
+      if isinstance(target, gen_base.TargetLinked) and dep.external_lib:
+        deps[dep] = dep_kind
+
   def get_win_defines(self, target, cfg):
     "Return the list of defines for target"
 
@@ -849,190 +716,133 @@ class WinGeneratorBase(GeneratorBase):
                    "_CRT_NONSTDC_NO_DEPRECATE=",
                    "_CRT_SECURE_NO_WARNINGS="]
 
-    if self.sqlite_inline:
-      fakedefines.append("SVN_SQLITE_INLINE")
+    if cfg == 'Debug':
+      fakedefines.extend(["_DEBUG","SVN_DEBUG"])
+    elif cfg == 'Release':
+      fakedefines.append("NDEBUG")
 
     if isinstance(target, gen_base.TargetApacheMod):
       if target.name == 'mod_dav_svn':
         fakedefines.extend(["AP_DECLARE_EXPORT"])
 
-    if target.name.find('ruby') == -1:
-      fakedefines.append("snprintf=_snprintf")
-
     if isinstance(target, gen_base.TargetSWIG):
       fakedefines.append("SWIG_GLOBAL")
 
-    # Expect rb_errinfo() to be avilable in Ruby 1.9+,
-    # rather than ruby_errinfo.
-    if (self.ruby_major_version > 1 or self.ruby_minor_version > 8):
-      fakedefines.extend(["HAVE_RB_ERRINFO"])
-
-    if cfg == 'Debug':
-      fakedefines.extend(["_DEBUG","SVN_DEBUG"])
-    elif cfg == 'Release':
-      fakedefines.append("NDEBUG")
+    for dep in self.get_win_depends(target, FILTER_EXTERNALLIBS):
+      if dep.external_lib:
+        for elib in re.findall('\$\(SVN_([^\)]*)_LIBS\)', dep.external_lib):
+          external_lib = elib.lower()
 
-    if self.static_apr:
-      fakedefines.extend(["APR_DECLARE_STATIC", "APU_DECLARE_STATIC"])
+        if external_lib in self._libraries:
+          lib = self._libraries[external_lib]
 
-    # XXX: Check if db is present, and if so, let apr-util know
-    # XXX: This is a hack until the apr build system is improved to
-    # XXX: know these things for itself.
-    if self.bdb_lib:
-      fakedefines.append("APU_HAVE_DB=1")
-      fakedefines.append("SVN_LIBSVN_FS_LINKS_FS_BASE=1")
+          if lib.defines:
+            fakedefines.extend(lib.defines)
 
     # check if they wanted nls
     if self.enable_nls:
       fakedefines.append("ENABLE_NLS")
 
-    if self.serf_lib:
-      fakedefines.append("SVN_HAVE_SERF")
-      fakedefines.append("SVN_LIBSVN_CLIENT_LINKS_RA_SERF")
-
     # check we have sasl
-    if self.sasl_path:
-      fakedefines.append("SVN_HAVE_SASL")
-
     if target.name.endswith('svn_subr'):
       fakedefines.append("SVN_USE_WIN32_CRASHHANDLER")
 
-    # use static linking to Expat
-    fakedefines.append("XML_STATIC")
-
     return fakedefines
 
-  def get_win_includes(self, target):
+  def get_win_includes(self, target, cfg='Release'):
     "Return the list of include directories for target"
 
-    fakeincludes = [ self.path("subversion/include"),
-                     self.path("subversion"),
-                     self.apath(self.apr_path, "include"),
-                     self.apath(self.apr_util_path, "include") ]
+    fakeincludes = [ "subversion/include",
+                     "subversion" ]
+                     
+    for dep in self.get_win_depends(target, FILTER_EXTERNALLIBS):
+      if dep.external_lib:
+        for elib in re.findall('\$\(SVN_([^\)]*)_LIBS\)', dep.external_lib):
+          external_lib = elib.lower()
+
+        if external_lib in self._libraries:
+          lib = self._libraries[external_lib]
+
+          fakeincludes.extend(lib.include_dirs)
 
     if target.name == 'mod_authz_svn':
-      fakeincludes.extend([ self.apath(self.httpd_path, "modules/aaa") ])
+      fakeincludes.extend([ os.path.join(self.httpd_path, "modules/aaa") ])
 
     if isinstance(target, gen_base.TargetApacheMod):
-      fakeincludes.extend([ self.apath(self.apr_util_path, "xml/expat/lib"),
-                            self.apath(self.httpd_path, "include"),
-                            self.apath(self.bdb_path, "include") ])
-    elif isinstance(target, gen_base.TargetSWIG):
+      fakeincludes.extend([ os.path.join(self.httpd_path, "include") ])
+    elif (isinstance(target, gen_base.TargetSWIG)
+          or isinstance(target, gen_base.TargetSWIGLib)):
       util_includes = "subversion/bindings/swig/%s/libsvn_swig_%s" \
                       % (target.lang,
                          gen_base.lang_utillib_suffix[target.lang])
-      fakeincludes.extend([ self.path("subversion/bindings/swig"),
-                            self.path("subversion/bindings/swig/proxy"),
-                            self.path("subversion/bindings/swig/include"),
-                            self.path(util_includes) ])
-    else:
-      fakeincludes.extend([ self.apath(self.apr_util_path, "xml/expat/lib"),
-                            self.path("subversion/bindings/swig/proxy"),
-                            self.apath(self.bdb_path, "include") ])
-
-    if self.libintl_path:
-      fakeincludes.append(self.apath(self.libintl_path, 'inc'))
-
-    if self.serf_lib:
-      fakeincludes.append(self.apath(self.serf_path))
-
-    if self.swig_libdir \
-       and (isinstance(target, gen_base.TargetSWIG)
-            or isinstance(target, gen_base.TargetSWIGLib)):
-      if self.swig_vernum >= 103028:
-        fakeincludes.append(self.apath(self.swig_libdir, target.lang))
-        if target.lang == 'perl':
-          # At least swigwin 1.3.38+ uses perl5 as directory name. Just add it
-          # to the list to make sure we don't break old versions
-          fakeincludes.append(self.apath(self.swig_libdir, 'perl5'))
-      else:
-        fakeincludes.append(self.swig_libdir)
-      if target.lang == "perl":
-        fakeincludes.extend(self.perl_includes)
-      if target.lang == "python":
-        fakeincludes.extend(self.python_includes)
-      if target.lang == "ruby":
-        fakeincludes.extend(self.ruby_includes)
+      fakeincludes.append(util_includes)
 
-    fakeincludes.append(self.apath(self.zlib_path))
+    if (isinstance(target, gen_base.TargetSWIG)
+        or isinstance(target, gen_base.TargetSWIGLib)):
 
-    if self.sqlite_inline:
-      fakeincludes.append(self.apath(self.sqlite_path))
-    else:
-      fakeincludes.append(self.apath(self.sqlite_path, 'inc'))
+      # Projects aren't generated unless we have swig
+      assert self.swig_libdir
 
-    if self.sasl_path:
-      fakeincludes.append(self.apath(self.sasl_path, 'include'))
+      if target.lang == "perl" and self.swig_version >= (1, 3, 28):
+        # At least swigwin 1.3.38+ uses perl5 as directory name.
+        lang_subdir = 'perl5'
+      else:
+        lang_subdir = target.lang
 
-    if target.name == "libsvnjavahl" and self.jdk_path:
-      fakeincludes.append(os.path.join(self.jdk_path, 'include'))
-      fakeincludes.append(os.path.join(self.jdk_path, 'include', 'win32'))
+      # After the language specific includes include the generic libdir,
+      # to allow overriding a generic with a per language include
+      fakeincludes.append(os.path.join(self.swig_libdir, lang_subdir))
+      fakeincludes.append(self.swig_libdir)
 
-    if target.name.find('cxxhl') != -1:
-      fakeincludes.append(self.path("subversion/bindings/cxxhl/include"))
+    if 'cxxhl' in target.name:
+      fakeincludes.append("subversion/bindings/cxxhl/include")
 
-    return fakeincludes
+    return gen_base.unique(map(self.apath, fakeincludes))
 
   def get_win_lib_dirs(self, target, cfg):
     "Return the list of library directories for target"
 
-    expatlibcfg = cfg.replace("Debug", "LibD").replace("Release", "LibR")
-    if self.static_apr:
-      libcfg = expatlibcfg
-    else:
-      libcfg = cfg
+    debug = (cfg == 'Debug')
 
-    fakelibdirs = [ self.apath(self.bdb_path, "lib"),
-                    self.apath(self.zlib_path),
-                    ]
-
-    if not self.sqlite_inline:
-      fakelibdirs.append(self.apath(self.sqlite_path, "lib"))
-
-    if self.sasl_path:
-      fakelibdirs.append(self.apath(self.sasl_path, "lib"))
-    if self.serf_lib:
-      fakelibdirs.append(self.apath(msvc_path_join(self.serf_path, cfg)))
-
-    fakelibdirs.append(self.apath(self.apr_path, libcfg))
-    fakelibdirs.append(self.apath(self.apr_util_path, libcfg))
-    fakelibdirs.append(self.apath(self.apr_util_path, 'xml', 'expat',
-                                  'lib', expatlibcfg))
+    if not isinstance(target, gen_base.TargetLinked):
+      return []
+
+    if isinstance(target, gen_base.TargetLib) and target.msvc_static:
+      return []
+
+    fakelibdirs = []
+
+    for dep in self.get_win_depends(target, FILTER_LIBS):
+      if dep.external_lib:
+        for elib in re.findall('\$\(SVN_([^\)]*)_LIBS\)', dep.external_lib):
+          external_lib = elib.lower()
+
+          if external_lib not in self._libraries:
+            continue
+
+          lib = self._libraries[external_lib]
+
+          if debug and lib.debug_lib_dir:
+            lib_dir = self.apath(lib.debug_lib_dir)
+          elif lib.lib_dir:
+            lib_dir = self.apath(lib.lib_dir)
+          else:
+            continue # Dependency without library (E.g. JDK)
+
+          fakelibdirs.append(lib_dir)
 
     if isinstance(target, gen_base.TargetApacheMod):
       fakelibdirs.append(self.apath(self.httpd_path, cfg))
       if target.name == 'mod_dav_svn':
         fakelibdirs.append(self.apath(self.httpd_path, "modules/dav/main",
                                       cfg))
-    if self.swig_libdir \
-       and (isinstance(target, gen_base.TargetSWIG)
-            or isinstance(target, gen_base.TargetSWIGLib)):
-      if target.lang == "perl" and self.perl_libdir:
-        fakelibdirs.append(self.perl_libdir)
-      if target.lang == "python" and self.python_libdir:
-        fakelibdirs.append(self.python_libdir)
-      if target.lang == "ruby" and self.ruby_libdir:
-        fakelibdirs.append(self.ruby_libdir)
 
-    return fakelibdirs
+    return gen_base.unique(fakelibdirs)
 
   def get_win_libs(self, target, cfg):
     "Return the list of external libraries needed for target"
 
-    dblib = None
-    if self.bdb_lib:
-      dblib = self.bdb_lib+(cfg == 'Debug' and 'd.lib' or '.lib')
-
-    if self.serf_lib:
-      if self.serf_ver_maj != 0:
-        serflib = 'serf-%d.lib' % self.serf_ver_maj
-      else:
-        serflib = 'serf.lib'
-
-    zlib = (cfg == 'Debug' and 'zlibstatD.lib' or 'zlibstat.lib')
-    sasllib = None
-    if self.sasl_path:
-      sasllib = 'libsasl.lib'
+    debug = (cfg == 'Debug')
 
     if not isinstance(target, gen_base.TargetLinked):
       return []
@@ -1041,50 +851,30 @@ class WinGeneratorBase(GeneratorBase):
       return []
 
     nondeplibs = target.msvc_libs[:]
-    nondeplibs.append(zlib)
-    if self.enable_nls:
-      if self.libintl_path:
-        nondeplibs.append(self.apath(self.libintl_path,
-                                     'lib', 'intl3_svn.lib'))
-      else:
-        nondeplibs.append('intl3_svn.lib')
 
     if isinstance(target, gen_base.TargetExe):
       nondeplibs.append('setargv.obj')
 
-    if ((isinstance(target, gen_base.TargetSWIG)
-         or isinstance(target, gen_base.TargetSWIGLib))
-        and target.lang == 'perl'):
-      nondeplibs.append(self.perl_lib)
-
-    if ((isinstance(target, gen_base.TargetSWIG)
-         or isinstance(target, gen_base.TargetSWIGLib))
-        and target.lang == 'ruby'):
-      nondeplibs.append(self.ruby_lib)
-
     for dep in self.get_win_depends(target, FILTER_LIBS):
       nondeplibs.extend(dep.msvc_libs)
 
-      if dep.external_lib == '$(SVN_DB_LIBS)':
-        nondeplibs.append(dblib)
+      if dep.external_lib:
+        for elib in re.findall('\$\(SVN_([^\)]*)_LIBS\)', dep.external_lib):
 
-      if dep.external_lib == '$(SVN_SQLITE_LIBS)' and not self.sqlite_inline:
-        nondeplibs.append('sqlite3.lib')
+          external_lib = elib.lower()
 
-      if self.serf_lib and dep.external_lib == '$(SVN_SERF_LIBS)':
-        nondeplibs.append(serflib)
-
-      if dep.external_lib == '$(SVN_SASL_LIBS)':
-        nondeplibs.append(sasllib)
-
-      if dep.external_lib == '$(SVN_APR_LIBS)':
-        nondeplibs.append(self.apr_lib)
+          if external_lib not in self._libraries:
+            if external_lib not in self._optional_libraries:
+              print('Warning: Using undeclared dependency \'$(SVN_%s_LIBS)\'.'
+                    % (elib,))
+            continue
 
-      if dep.external_lib == '$(SVN_APRUTIL_LIBS)':
-        nondeplibs.append(self.aprutil_lib)
+          lib = self._libraries[external_lib]
 
-      if dep.external_lib == '$(SVN_XML_LIBS)':
-        nondeplibs.append('xml.lib')
+          if debug:
+            nondeplibs.append(lib.debug_lib_name)
+          else:
+            nondeplibs.append(lib.lib_name)
 
     return gen_base.unique(nondeplibs)
 
@@ -1112,21 +902,23 @@ class WinGeneratorBase(GeneratorBase):
 
     return list(sources.values())
 
-  def write_file_if_changed(self, fname, new_contents):
-    """Rewrite the file if new_contents are different than its current content.
+  def get_win_forced_includes(self, target, cfg):
+    """Return a list of include files that need to be included before any
+       other header in every c/c++ file"""
 
-    If you have your windows projects open and generate the projects
-    it's not a small thing for windows to re-read all projects so
-    only update those that have changed.
-    """
+    fakeincludes = []
 
-    try:
-      old_contents = open(fname, 'rb').read()
-    except IOError:
-      old_contents = None
-    if old_contents != new_contents:
-      open(fname, 'wb').write(new_contents)
-      print("Wrote: %s" % fname)
+    for dep in self.get_win_depends(target, FILTER_EXTERNALLIBS):
+      if dep.external_lib:
+        for elib in re.findall('\$\(SVN_([^\)]*)_LIBS\)', dep.external_lib):
+          external_lib = elib.lower()
+
+        if external_lib in self._libraries:
+          lib = self._libraries[external_lib]
+
+          fakeincludes.extend(lib.forced_includes)
+
+    return gen_base.unique(fakeincludes)
 
   def write_with_template(self, fname, tname, data):
     fout = StringIO()
@@ -1137,7 +929,7 @@ class WinGeneratorBase(GeneratorBase):
     self.write_file_if_changed(fname, fout.getvalue())
 
   def write_zlib_project_file(self, name):
-    if not self.zlib_path:
+    if not self._libraries['zlib'].is_src:
       return
     zlib_path = os.path.abspath(self.zlib_path)
     zlib_sources = map(lambda x : os.path.relpath(x, self.projfilesdir),
@@ -1160,8 +952,13 @@ class WinGeneratorBase(GeneratorBase):
                         ))
 
   def write_serf_project_file(self, name):
-    if not self.serf_lib:
+    if 'serf' not in self._libraries:
       return
+      
+    serf = self._libraries['serf']
+    
+    if not serf.is_src:
+      return # Using an installed library
 
     serf_path = os.path.abspath(self.serf_path)
     serf_sources = map(lambda x : os.path.relpath(x, self.serf_path),
@@ -1173,10 +970,6 @@ class WinGeneratorBase(GeneratorBase):
                        glob.glob(os.path.join(serf_path, '*.h'))
                        + glob.glob(os.path.join(serf_path, 'auth', '*.h'))
                        + glob.glob(os.path.join(serf_path, 'buckets', '*.h')))
-    if self.serf_ver_maj != 0:
-      serflib = 'serf-%d.lib' % self.serf_ver_maj
-    else:
-      serflib = 'serf.lib'
 
     apr_static = self.static_apr and 'APR_STATIC=1' or ''
     openssl_static = self.static_openssl and 'OPENSSL_STATIC=1' or ''
@@ -1194,7 +987,7 @@ class WinGeneratorBase(GeneratorBase):
                          ('project_guid', self.makeguid('serf')),
                          ('apr_static', apr_static),
                          ('openssl_static', openssl_static),
-                         ('serf_lib', serflib),
+                         ('serf_lib', serf.lib_name),
                         ))
 
   def move_proj_file(self, path, name, params=()):
@@ -1218,453 +1011,17 @@ class WinGeneratorBase(GeneratorBase):
 
     raise NotImplementedError
 
-  def _find_perl(self):
-    "Find the right perl library name to link swig bindings with"
-    self.perl_includes = []
-    self.perl_libdir = None
-    fp = os.popen('perl -MConfig -e ' + escape_shell_arg(
-                  'print "$Config{PERL_REVISION}$Config{PERL_VERSION}"'), 'r')
-    try:
-      line = fp.readline()
-      if line:
-        msg = 'Found installed perl version number.'
-        self.perl_lib = 'perl' + line.rstrip() + '.lib'
-      else:
-        msg = 'Could not detect perl version.'
-        self.perl_lib = 'perl56.lib'
-      print('%s\n  Perl bindings will be linked with %s\n'
-             % (msg, self.perl_lib))
-    finally:
-      fp.close()
-
-    fp = os.popen('perl -MConfig -e ' + escape_shell_arg(
-                  'print $Config{archlib}'), 'r')
-    try:
-      line = fp.readline()
-      if line:
-        self.perl_libdir = os.path.join(line, 'CORE')
-        self.perl_includes = [os.path.join(line, 'CORE')]
-    finally:
-      fp.close()
-
-  def _find_ruby(self):
-    "Find the right Ruby library name to link swig bindings with"
-    self.ruby_includes = []
-    self.ruby_libdir = None
-    self.ruby_version = None
-    self.ruby_major_version = None
-    self.ruby_minor_version = None
-    # Pass -W0 to stifle the "-e:1: Use RbConfig instead of obsolete
-    # and deprecated Config." warning if we are using Ruby 1.9.
-    proc = os.popen('ruby -rrbconfig -W0 -e ' + escape_shell_arg(
-                    "puts Config::CONFIG['ruby_version'];"
-                    "puts Config::CONFIG['LIBRUBY'];"
-                    "puts Config::CONFIG['archdir'];"
-                    "puts Config::CONFIG['libdir'];"), 'r')
-    try:
-      rubyver = proc.readline()[:-1]
-      if rubyver:
-        self.ruby_version = rubyver
-        self.ruby_major_version = string.atoi(self.ruby_version[0])
-        self.ruby_minor_version = string.atoi(self.ruby_version[2])
-        libruby = proc.readline()[:-1]
-        if libruby:
-          msg = 'Found installed ruby %s' % rubyver
-          self.ruby_lib = libruby
-          self.ruby_includes.append(proc.readline()[:-1])
-          self.ruby_libdir = proc.readline()[:-1]
-      else:
-        msg = 'Could not detect Ruby version, assuming 1.8.'
-        self.ruby_version = "1.8"
-        self.ruby_major_version = 1
-        self.ruby_minor_version = 8
-        self.ruby_lib = 'msvcrt-ruby18.lib'
-      print('%s\n  Ruby bindings will be linked with %s\n'
-             % (msg, self.ruby_lib))
-    finally:
-      proc.close()
-
-  def _find_python(self):
-    "Find the appropriate options for creating SWIG-based Python modules"
-    self.python_includes = []
-    self.python_libdir = ""
-    try:
-      from distutils import sysconfig
-      inc = sysconfig.get_python_inc()
-      plat = sysconfig.get_python_inc(plat_specific=1)
-      self.python_includes.append(inc)
-      if inc != plat:
-        self.python_includes.append(plat)
-      self.python_libdir = self.apath(sysconfig.PREFIX, "libs")
-    except ImportError:
-      pass
-
-  def _find_jdk(self):
-    if not self.jdk_path:
-      jdk_ver = None
-      try:
-        try:
-          # Python >=3.0
-          import winreg
-        except ImportError:
-          # Python <3.0
-          import _winreg as winreg
-        key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,
-                           r"SOFTWARE\JavaSoft\Java Development Kit")
-        # Find the newest JDK version.
-        num_values = winreg.QueryInfoKey(key)[1]
-        for i in range(num_values):
-          (name, value, key_type) = winreg.EnumValue(key, i)
-          if name == "CurrentVersion":
-            jdk_ver = value
-            break
-
-        # Find the JDK path.
-        if jdk_ver is not None:
-          key = winreg.OpenKey(key, jdk_ver)
-          num_values = winreg.QueryInfoKey(key)[1]
-          for i in range(num_values):
-            (name, value, key_type) = winreg.EnumValue(key, i)
-            if name == "JavaHome":
-              self.jdk_path = value
-              break
-        winreg.CloseKey(key)
-      except (ImportError, EnvironmentError):
-        pass
-      if self.jdk_path:
-        print("Found JDK version %s in %s\n" % (jdk_ver, self.jdk_path))
-    else:
-      print("Using JDK in %s\n" % (self.jdk_path))
-
-  def _find_swig(self):
-    # Require 1.3.24. If not found, assume 1.3.25.
-    default_version = '1.3.25'
-    minimum_version = '1.3.24'
-    vernum = 103025
-    minimum_vernum = 103024
-    libdir = ''
-
-    if self.swig_path is not None:
-      self.swig_exe = os.path.abspath(os.path.join(self.swig_path, 'swig'))
-    else:
-      self.swig_exe = 'swig'
-
-    try:
-      outfp = subprocess.Popen([self.swig_exe, '-version'], stdout=subprocess.PIPE, universal_newlines=True).stdout
-      txt = outfp.read()
-      if txt:
-        vermatch = re.compile(r'^SWIG\ Version\ (\d+)\.(\d+)\.(\d+)$', re.M) \
-                   .search(txt)
-      else:
-        vermatch = None
-
-      if vermatch:
-        version = tuple(map(int, vermatch.groups()))
-        # build/ac-macros/swig.m4 explains the next incantation
-        vernum = int('%d%02d%03d' % version)
-        print('Found installed SWIG version %d.%d.%d\n' % version)
-        if vernum < minimum_vernum:
-          print('WARNING: Subversion requires version %s\n'
-                 % minimum_version)
-
-        libdir = self._find_swig_libdir()
-      else:
-        print('Could not find installed SWIG,'
-               ' assuming version %s\n' % default_version)
-        self.swig_libdir = ''
-      outfp.close()
-    except OSError:
-      print('Could not find installed SWIG,'
-             ' assuming version %s\n' % default_version)
-      self.swig_libdir = ''
-
-    self.swig_vernum = vernum
-    self.swig_libdir = libdir
-
-  def _find_swig_libdir(self):
-    fp = os.popen(self.swig_exe + ' -swiglib', 'r')
-    try:
-      libdir = fp.readline().rstrip()
-      if libdir:
-        print('Using SWIG library directory %s\n' % libdir)
-        return libdir
-      else:
-        print('WARNING: could not find SWIG library directory\n')
-    finally:
-      fp.close()
-    return ''
-
-  def _find_ml(self):
-    "Check if the ML assembler is in the path"
-    if not self.enable_ml:
-      self.have_ml = 0
-      return
-    fp = os.popen('ml /help', 'r')
-    try:
-      line = fp.readline()
-      if line:
-        msg = 'Found ML, ZLib build will use ASM sources'
-        self.have_ml = 1
-      else:
-        msg = 'Could not find ML, ZLib build will not use ASM sources'
-        self.have_ml = 0
-      print('%s\n' % (msg,))
-    finally:
-      fp.close()
-
-  def _get_serf_version(self):
-    "Retrieves the serf version from serf.h"
-
-    # shouldn't be called unless serf is there
-    assert self.serf_path and os.path.exists(self.serf_path)
-
-    self.serf_ver_maj = None
-    self.serf_ver_min = None
-    self.serf_ver_patch = None
-
-    # serf.h should be present
-    if not os.path.exists(os.path.join(self.serf_path, 'serf.h')):
-      return None, None, None
-
-    txt = open(os.path.join(self.serf_path, 'serf.h')).read()
-
-    maj_match = re.search(r'SERF_MAJOR_VERSION\s+(\d+)', txt)
-    min_match = re.search(r'SERF_MINOR_VERSION\s+(\d+)', txt)
-    patch_match = re.search(r'SERF_PATCH_VERSION\s+(\d+)', txt)
-    if maj_match:
-      self.serf_ver_maj = int(maj_match.group(1))
-    if min_match:
-      self.serf_ver_min = int(min_match.group(1))
-    if patch_match:
-      self.serf_ver_patch = int(patch_match.group(1))
-
-    return self.serf_ver_maj, self.serf_ver_min, self.serf_ver_patch
-
-  def _find_serf(self):
-    "Check if serf and its dependencies are available"
-
-    minimal_serf_version = (1, 2, 0)
-    self.serf_lib = None
-    if self.serf_path and os.path.exists(self.serf_path):
-      if self.openssl_path and os.path.exists(self.openssl_path):
-        self.serf_lib = 'serf'
-        version = self._get_serf_version()
-        if None in version:
-          msg = 'Unknown serf version found; but, will try to build ' \
-                'ra_serf.'
-        else:
-          self.serf_ver = '.'.join(str(v) for v in version)
-          if version < minimal_serf_version:
-            self.serf_lib = None
-            msg = 'Found serf %s, but >= %s is required. ra_serf will not be built.\n' % \
-                  (self.serf_ver, '.'.join(str(v) for v in minimal_serf_version))
-          else:
-            msg = 'Found serf %s' % self.serf_ver
-        print(msg)
-      else:
-        print('openssl not found, ra_serf will not be built\n')
-    else:
-      print('serf not found, ra_serf will not be built\n')
-
-  def _find_apr(self):
-    "Find the APR library and version"
-
-    minimal_apr_version = (0, 9, 0)
-
-    version_file_path = os.path.join(self.apr_path, 'include',
-                                     'apr_version.h')
-
-    if not os.path.exists(version_file_path):
-      sys.stderr.write("ERROR: '%s' not found.\n" % version_file_path);
-      sys.stderr.write("Use '--with-apr' option to configure APR location.\n");
-      sys.exit(1)
-
-    fp = open(version_file_path)
-    txt = fp.read()
-    fp.close()
-
-    vermatch = re.search(r'^\s*#define\s+APR_MAJOR_VERSION\s+(\d+)', txt, re.M)
-    major = int(vermatch.group(1))
-
-    vermatch = re.search(r'^\s*#define\s+APR_MINOR_VERSION\s+(\d+)', txt, re.M)
-    minor = int(vermatch.group(1))
-
-    vermatch = re.search(r'^\s*#define\s+APR_PATCH_VERSION\s+(\d+)', txt, re.M)
-    patch = int(vermatch.group(1))
-
-    version = (major, minor, patch)
-    self.apr_version = '%d.%d.%d' % version
-
-    suffix = ''
-    if major > 0:
-        suffix = '-%d' % major
-
-    if self.static_apr:
-      self.apr_lib = 'apr%s.lib' % suffix
-    else:
-      self.apr_lib = 'libapr%s.lib' % suffix
-
-    if version < minimal_apr_version:
-      sys.stderr.write("ERROR: apr %s or higher is required "
-                       "(%s found)\n" % (
-                          '.'.join(str(v) for v in minimal_apr_version),
-                          self.apr_version))
-      sys.exit(1)
-    else:
-      print('Found apr %s' % self.apr_version)
-
-  def _find_apr_util(self):
-    "Find the APR-util library and version"
-
-    minimal_aprutil_version = (0, 9, 0)
-    version_file_path = os.path.join(self.apr_util_path, 'include',
-                                     'apu_version.h')
-
-    if not os.path.exists(version_file_path):
-      sys.stderr.write("ERROR: '%s' not found.\n" % version_file_path);
-      sys.stderr.write("Use '--with-apr-util' option to configure APR-Util location.\n");
-      sys.exit(1)
-
-    fp = open(version_file_path)
-    txt = fp.read()
-    fp.close()
-
-    vermatch = re.search(r'^\s*#define\s+APU_MAJOR_VERSION\s+(\d+)', txt, re.M)
-    major = int(vermatch.group(1))
-
-    vermatch = re.search(r'^\s*#define\s+APU_MINOR_VERSION\s+(\d+)', txt, re.M)
-    minor = int(vermatch.group(1))
-
-    vermatch = re.search(r'^\s*#define\s+APU_PATCH_VERSION\s+(\d+)', txt, re.M)
-    patch = int(vermatch.group(1))
-
-    version = (major, minor, patch)
-    self.aprutil_version = '%d.%d.%d' % version
-
-    suffix = ''
-    if major > 0:
-        suffix = '-%d' % major
-
-    if self.static_apr:
-      self.aprutil_lib = 'aprutil%s.lib' % suffix
-    else:
-      self.aprutil_lib = 'libaprutil%s.lib' % suffix
-
-    if version < minimal_aprutil_version:
-      sys.stderr.write("ERROR: aprutil %s or higher is required "
-                       "(%s found)\n" % (
-                          '.'.join(str(v) for v in minimal_aprutil_version),
-                          self.aprutil_version))
-      sys.exit(1)
-    else:
-      print('Found aprutil %s' % self.aprutil_version)
-
-  def _find_sqlite(self):
-    "Find the Sqlite library and version"
-
-    minimal_sqlite_version = (3, 7, 12)
-
-    header_file = os.path.join(self.sqlite_path, 'inc', 'sqlite3.h')
-
-    # First check for compiled version of SQLite.
-    if os.path.exists(header_file):
-      # Compiled SQLite seems found, check for sqlite3.lib file.
-      lib_file = os.path.join(self.sqlite_path, 'lib', 'sqlite3.lib')
-      if not os.path.exists(lib_file):
-        sys.stderr.write("ERROR: '%s' not found.\n" % lib_file)
-        sys.stderr.write("Use '--with-sqlite' option to configure sqlite location.\n");
-        sys.exit(1)
-      self.sqlite_inline = False
-    else:
-      # Compiled SQLite not found. Try amalgamation version.
-      amalg_file = os.path.join(self.sqlite_path, 'sqlite3.c')
-      if not os.path.exists(amalg_file):
-        sys.stderr.write("ERROR: SQLite not found in '%s' directory.\n" % self.sqlite_path)
-        sys.stderr.write("Use '--with-sqlite' option to configure sqlite location.\n");
-        sys.exit(1)
-      header_file = os.path.join(self.sqlite_path, 'sqlite3.h')
-      self.sqlite_inline = True
-
-    fp = open(header_file)
-    txt = fp.read()
-    fp.close()
-    vermatch = re.search(r'^\s*#define\s+SQLITE_VERSION\s+"(\d+)\.(\d+)\.(\d+)(?:\.(\d))?"', txt, re.M)
-
-    version = vermatch.groups()
-
-    # Sqlite doesn't add patch numbers for their ordinary releases
-    if not version[3]:
-      version = version[0:3]
-
-    version = tuple(map(int, version))
-
-    self.sqlite_version = '.'.join(str(v) for v in version)
-
-    if version < minimal_sqlite_version:
-      sys.stderr.write("ERROR: sqlite %s or higher is required "
-                       "(%s found)\n" % (
-                          '.'.join(str(v) for v in minimal_sqlite_version),
-                          self.sqlite_version))
-      sys.exit(1)
-    else:
-      print('Found SQLite %s' % self.sqlite_version)
-
-  def _find_zlib(self):
-    "Find the ZLib library and version"
-
-    if not self.zlib_path:
-      self.zlib_version = '1'
-      return
-
-    header_file = os.path.join(self.zlib_path, 'zlib.h')
-
-    if not os.path.exists(header_file):
-      self.zlib_version = '1'
-      return
-
-    fp = open(header_file)
-    txt = fp.read()
-    fp.close()
-    vermatch = re.search(r'^\s*#define\s+ZLIB_VERSION\s+"(\d+)\.(\d+)\.(\d+)(?:\.\d)?"', txt, re.M)
-
-    version = tuple(map(int, vermatch.groups()))
-
-    self.zlib_version = '%d.%d.%d' % version
-
-    print('Found ZLib %s' % self.zlib_version)
-
 class ProjectItem:
   "A generic item class for holding sources info, config info, etc for a project"
   def __init__(self, **kw):
+    self.ignored = None
     vars(self).update(kw)
 
 # ============================================================================
-# This is a cut-down and modified version of code from:
-#   subversion/subversion/bindings/swig/python/svn/core.py
-#
-if sys.platform == "win32":
-  _escape_shell_arg_re = re.compile(r'(\\+)(\"|$)')
-
-  def escape_shell_arg(arg):
-    # The (very strange) parsing rules used by the C runtime library are
-    # described at:
-    # http://msdn.microsoft.com/library/en-us/vclang/html/_pluslang_Parsing_C.2b2b_.Command.2d.Line_Arguments.asp
-
-    # double up slashes, but only if they are followed by a quote character
-    arg = re.sub(_escape_shell_arg_re, r'\1\1\2', arg)
-
-    # surround by quotes and escape quotes inside
-    arg = '"' + arg.replace('"', '"^""') + '"'
-    return arg
-
-else:
-  def escape_shell_arg(str):
-    return "'" + str.replace("'", "'\\''") + "'"
-
-# ============================================================================
 
 FILTER_LIBS = 1
 FILTER_PROJECTS = 2
+FILTER_EXTERNALLIBS = 3
 
 class POFile:
   "Item class for holding po file info"

Modified: subversion/branches/invoke-diff-cmd-feature/build/generator/swig/__init__.py
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build/generator/swig/__init__.py?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build/generator/swig/__init__.py (original)
+++ subversion/branches/invoke-diff-cmd-feature/build/generator/swig/__init__.py Wed Aug 21 16:09:43 2013
@@ -61,10 +61,17 @@ class Generator:
     self.swig_path = swig_path
     self.swig_libdir = _exec.output([self.swig_path, "-swiglib"], strip=1)
 
+  _swigVersion = None
   def version(self):
     """Get the version number of SWIG"""
-    swig_version = _exec.output([self.swig_path, "-version"])
-    m = re.search("Version (\d+).(\d+).(\d+)", swig_version)
-    if m:
-      return (m.group(1), m.group(2), m.group(3))
-    return (0, 0, 0)
+
+    if not self._swigVersion:
+      swig_version = _exec.output([self.swig_path, "-version"])
+      m = re.search("Version (\d+).(\d+).(\d+)", swig_version)
+      if m:
+        self._swigVersion = tuple(map(int, m.groups()))
+      else:
+        self._swigVersion = (0, 0, 0)
+
+    # Copy value to avoid changes
+    return tuple(list(self._swigVersion))

Modified: subversion/branches/invoke-diff-cmd-feature/build/generator/swig/external_runtime.py
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/build/generator/swig/external_runtime.py?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/build/generator/swig/external_runtime.py (original)
+++ subversion/branches/invoke-diff-cmd-feature/build/generator/swig/external_runtime.py Wed Aug 21 16:09:43 2013
@@ -24,7 +24,12 @@
 # external_runtime.py: Generate external runtime files for SWIG
 #
 
-import sys, os, re, fileinput
+import sys
+import os
+import re
+import fileinput
+import filecmp
+
 if __name__ == "__main__":
   parent_dir = os.path.dirname(os.path.abspath(os.path.dirname(sys.argv[0])))
   sys.path[0:0] = [ parent_dir, os.path.dirname(parent_dir) ]
@@ -63,8 +68,10 @@ class Generator(generator.swig.Generator
       "python": "pyrun.swg", "perl":"perlrun.swg", "ruby":"rubydef.swg"
     }
 
-    # Build runtime files
-    out = self._output_file(lang)
+    # Build runtime files to temporary location
+    dest = self._output_file(lang)
+    out = dest + '.tmp'
+
     if self.version() == (1, 3, 24):
       out_file = open(out, "w")
       out_file.write(open("%s/swigrun.swg" % self.proxy_dir).read())
@@ -99,6 +106,26 @@ class Generator(generator.swig.Generator
         sys.stdout.write(
           re.sub(r"SWIG_GetModule\(\)", "SWIG_GetModule(NULL)", line)
         )
+
+    # Did the output change?
+    try:
+      if filecmp.cmp(dest, out):
+        identical = True
+      else:
+        identical = False
+    except:
+      identical = False
+
+    # Only overwrite file if changed
+    if identical:
+      os.remove(out)
+    else:
+      try:
+        os.remove(dest)
+      except: pass
+      os.rename(out, dest)
+      print('Wrote %s' % (dest,))
+
   def _output_file(self, lang):
     """Return the output filename of the runtime for the given language"""
     return '%s/swig_%s_external_runtime.swg' % (self.proxy_dir, lang)



Mime
View raw message