You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/07/22 13:22:20 UTC

svn commit: r1505660 [1/5] - in /subversion/branches/fsfs-improvements: ./ build/generator/ build/generator/swig/ build/generator/templates/ notes/http-and-webdav/ subversion/ subversion/bindings/swig/ subversion/bindings/swig/ruby/libsvn_swig_ruby/ su...

Author: stefan2
Date: Mon Jul 22 11:22:18 2013
New Revision: 1505660

URL: http://svn.apache.org/r1505660
Log:
On the fsfs-improvements branch: sync with trunk up to & including r1505656.
Resolved the usual fs_fs.c conflicts.

Added:
    subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h
      - copied unchanged from r1505656, subversion/trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h
Removed:
    subversion/branches/fsfs-improvements/tools/dist/make-deps-tarball.sh
Modified:
    subversion/branches/fsfs-improvements/   (props changed)
    subversion/branches/fsfs-improvements/CHANGES
    subversion/branches/fsfs-improvements/build.conf
    subversion/branches/fsfs-improvements/build/generator/gen_base.py
    subversion/branches/fsfs-improvements/build/generator/gen_make.py
    subversion/branches/fsfs-improvements/build/generator/gen_msvc_dsp.py
    subversion/branches/fsfs-improvements/build/generator/gen_vcnet_vcproj.py
    subversion/branches/fsfs-improvements/build/generator/gen_win.py
    subversion/branches/fsfs-improvements/build/generator/gen_win_dependencies.py
    subversion/branches/fsfs-improvements/build/generator/swig/__init__.py
    subversion/branches/fsfs-improvements/build/generator/swig/external_runtime.py
    subversion/branches/fsfs-improvements/build/generator/templates/msvc_dsp.ezt
    subversion/branches/fsfs-improvements/build/generator/templates/vcnet_vcproj.ezt
    subversion/branches/fsfs-improvements/build/generator/templates/vcnet_vcxproj.ezt
    subversion/branches/fsfs-improvements/configure.ac
    subversion/branches/fsfs-improvements/gen-make.py
    subversion/branches/fsfs-improvements/get-deps.sh
    subversion/branches/fsfs-improvements/notes/http-and-webdav/webdav-protocol
    subversion/branches/fsfs-improvements/subversion/bindings/swig/INSTALL
    subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
    subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
    subversion/branches/fsfs-improvements/subversion/include/private/svn_cache.h
    subversion/branches/fsfs-improvements/subversion/include/private/svn_client_private.h
    subversion/branches/fsfs-improvements/subversion/include/private/svn_string_private.h
    subversion/branches/fsfs-improvements/subversion/include/private/svn_temp_serializer.h
    subversion/branches/fsfs-improvements/subversion/include/svn_fs.h
    subversion/branches/fsfs-improvements/subversion/include/svn_io.h
    subversion/branches/fsfs-improvements/subversion/include/svn_wc.h
    subversion/branches/fsfs-improvements/subversion/libsvn_client/checkout.c
    subversion/branches/fsfs-improvements/subversion/libsvn_client/commit.c
    subversion/branches/fsfs-improvements/subversion/libsvn_client/merge.c
    subversion/branches/fsfs-improvements/subversion/libsvn_client/mergeinfo.c
    subversion/branches/fsfs-improvements/subversion/libsvn_client/patch.c
    subversion/branches/fsfs-improvements/subversion/libsvn_delta/xdelta.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs/fs-loader.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs/fs-loader.h
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/dag.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/dag.h
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/tree.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/tree.h
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/caching.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/hotcopy.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/temp_serializer.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.h
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.h
    subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/update.c
    subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util.c
    subversion/branches/fsfs-improvements/subversion/libsvn_ra_svn/client.c
    subversion/branches/fsfs-improvements/subversion/libsvn_ra_svn/marshal.c
    subversion/branches/fsfs-improvements/subversion/libsvn_repos/load-fs-vtable.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/cache-inprocess.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/cache-membuffer.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/cache-memcache.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/cache.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/cache.h
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/compress.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/io.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/string.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/subst.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/temp_serializer.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/utf.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/win32_xlate.c
    subversion/branches/fsfs-improvements/subversion/libsvn_wc/diff_editor.c
    subversion/branches/fsfs-improvements/subversion/libsvn_wc/diff_local.c
    subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.h
    subversion/branches/fsfs-improvements/subversion/mod_dav_svn/repos.c
    subversion/branches/fsfs-improvements/subversion/po/sv.po
    subversion/branches/fsfs-improvements/subversion/svn_private_config.hw
    subversion/branches/fsfs-improvements/subversion/tests/cmdline/diff_tests.py
    subversion/branches/fsfs-improvements/subversion/tests/libsvn_subr/cache-test.c
    subversion/branches/fsfs-improvements/subversion/tests/libsvn_subr/string-test.c
    subversion/branches/fsfs-improvements/tools/buildbot/slaves/win32-SharpSvn/svn-config.cmd.template
    subversion/branches/fsfs-improvements/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd
    subversion/branches/fsfs-improvements/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd
    subversion/branches/fsfs-improvements/tools/dev/fsfs-access-map.c
    subversion/branches/fsfs-improvements/tools/dev/unix-build/Makefile.svn
    subversion/branches/fsfs-improvements/tools/dist/backport.pl
    subversion/branches/fsfs-improvements/tools/server-side/fsfs-stats.c
    subversion/branches/fsfs-improvements/win-tests.py

Propchange: subversion/branches/fsfs-improvements/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1502791-1505656
  Merged /subversion/branches/fsfs-format7:r1433848,1438408,1441129,1442051,1442068,1442504,1443803,1444690,1444693,1444695,1445040,1445080,1446103,1451129,1453590,1454307,1477166,1478055,1490673-1490674,1491784,1498103,1498155

Modified: subversion/branches/fsfs-improvements/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/CHANGES?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/CHANGES (original)
+++ subversion/branches/fsfs-improvements/CHANGES Mon Jul 22 11:22:18 2013
@@ -25,7 +25,7 @@ http://svn.apache.org/repos/asf/subversi
 
 
 Version 1.8.1
-(?? July 2013, from /branches/1.8.x)
+(23 July 2013, from /branches/1.8.x)
 http://svn.apache.org/repos/asf/subversion/tags/1.8.1
 
  User-visible changes:
@@ -34,6 +34,8 @@ http://svn.apache.org/repos/asf/subversi
     * improve sqlite error message output (r1497804)
     * support platforms lacking mmap (r1498136)
     * allow configuration files to start with UTF-8 BOM (r1499100 et al)
+    * don't fail on UTF-8 data when encoding conversion not available (r1503009)
+    * improve error messages when encoding conversion fails (r1503010)
 
   - Client-side bugfixes:
     * merge: rename 'automatic merge' to 'complete merge' (r1491432)
@@ -62,6 +64,9 @@ http://svn.apache.org/repos/asf/subversi
     * commit: remove stale entries from wc lock table when deleting (r1491756)
     * merge: fix --record-only erroring out on renamed path (issue #4387)
     * svnmucc: fix 'make install' symlink to work when DESTDIR is set (r1501072)
+    * wc: fix crash when target is symlink to a working copy root (issue #4383)
+    * ra_serf: change "internal malfunction" errors to normal errors (r1502577)
+    * ra_serf: handle proxies not supporting chunked requests (r1502401 et al)
 
   - Server-side bugfixes:
     * fsfs: resolve endless loop problem when repos/db/uuid has \r\n (r1492145)
@@ -74,6 +79,7 @@ http://svn.apache.org/repos/asf/subversi
     * svnadmin upgrade: fix error of non-sharded fsfs repositories (r1494287)
     * svnadmin create: deny '--fs-type=fsfs --compatible-version=1.0' (r1494223)
     * svnadmin upgrade: fix data loss when cancelling in last stage (r1494298)
+    * mod_dav_svn: fix incorrect path canonicalization (r1503528)
 
   - Other tool improvements and bugfixes:
     * fsfs-stats (tool): resolve segfault when passing invalid path (r1492164)
@@ -97,6 +103,7 @@ http://svn.apache.org/repos/asf/subversi
     * fs: improve test against newlines in filenames (r1498483 et al)
     * make building with BDB 6 an opt-in feature (r1499438)
     * sqlite: allow placing amalgamation in build dir (r1499034, r1500175) 
+    * ra_svn: make sessions usable after log callback early out (r1503554)
 
   - Bindings:
     * swig-rb: fix tests with out-of-tree-builds (r1492295)
@@ -446,13 +453,23 @@ http://svn.apache.org/repos/asf/subversi
 
 
 Version 1.7.11
-(?? ??? 2013, from /branches/1.7.x)
+(23 Jul 2013, from /branches/1.7.x)
 http://svn.apache.org/repos/asf/subversion/tags/1.7.11
 
  User-visible changes:
+  - General
+    * translation updates for Simplified Chinese
+
+  - Server-side bugfixes:
+    * mod_dav_svn: fix incorrect path canonicalization (r1503528)
+
   - Other tool improvements and bugfixes:
     * fix argument processing in contrib hook scripts (r1485350)
 
+ Developer-visible changes:
+  - Bindings:
+    * javahl: fix bug in error constructing code (r1405922)
+
 
 Version 1.7.10
 (30 May 2013, from /branches/1.7.x)

Modified: subversion/branches/fsfs-improvements/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build.conf?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build.conf (original)
+++ subversion/branches/fsfs-improvements/build.conf Mon Jul 22 11:22:18 2013
@@ -340,7 +340,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 = 
@@ -516,7 +516,8 @@ 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
@@ -528,7 +529,7 @@ msvc-static = no
 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)
@@ -539,7 +540,7 @@ msvc-static = yes
 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
@@ -648,7 +649,7 @@ 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) $(javahl_remote_javah_DEPS)
 install = javahl-lib
@@ -1215,6 +1216,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)
@@ -1229,7 +1239,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]
@@ -1240,6 +1250,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)

Modified: subversion/branches/fsfs-improvements/build/generator/gen_base.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/gen_base.py?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/gen_base.py (original)
+++ subversion/branches/fsfs-improvements/build/generator/gen_base.py Mon Jul 22 11:22:18 2013
@@ -239,30 +239,58 @@ class GeneratorBase:
         except: pass
         os.rename(new_hdrfile, hdrfile)
 
+  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.
     import errno
-    fd = open('subversion/libsvn_subr/errorcode.inc', 'w')
-    fd.write('/* This file was generated by build/generator/gen_base.py */\n\n')
+
+    lines = [
+        '/* This file was generated by build/generator/gen_base.py */',
+        ''
+    ]
 
     def write_struct(name, codes):
-      fd.write('static struct {\n'
-               '  int errcode;\n'
-               '  const char *errname;\n'
-               '} %s[] = {\n' % name)
+      lines.extend([
+          'static struct {',
+          '  int errcode;',
+          '  const char *errname;',
+          '} %s[] = {' % (name,),
+        ])
+
       for num, val in sorted(codes):
-        fd.write('  { %d, "%s" },\n' % (num, val))
-      # fd.seek(-2, os.SEEK_CUR); fd.write('\n');
-      fd.write('};\n')
+        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())
-    fd.write('\n')
 
     # Fetch and write apr_errno.h codes.
     aprerr = []
@@ -280,6 +308,9 @@ class GeneratorBase:
     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
 
@@ -643,13 +674,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)

Modified: subversion/branches/fsfs-improvements/build/generator/gen_make.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/gen_make.py?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/gen_make.py (original)
+++ subversion/branches/fsfs-improvements/build/generator/gen_make.py Mon Jul 22 11:22:18 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):

Modified: subversion/branches/fsfs-improvements/build/generator/gen_msvc_dsp.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/gen_msvc_dsp.py?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/gen_msvc_dsp.py (original)
+++ subversion/branches/fsfs-improvements/build/generator/gen_msvc_dsp.py Mon Jul 22 11:22:18 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/fsfs-improvements/build/generator/gen_vcnet_vcproj.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/gen_vcnet_vcproj.py?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/gen_vcnet_vcproj.py (original)
+++ subversion/branches/fsfs-improvements/build/generator/gen_vcnet_vcproj.py Mon Jul 22 11:22:18 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/fsfs-improvements/build/generator/gen_win.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/gen_win.py?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/gen_win.py (original)
+++ subversion/branches/fsfs-improvements/build/generator/gen_win.py Mon Jul 22 11:22:18 2013
@@ -68,15 +68,29 @@ class WinGeneratorBase(gen_win_dependenc
     gen_win_dependencies.GenDependenciesBase.__init__(self, fname, verfname,
                                                       options, find_libs=False)
 
+    # 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)
 
     self.find_libraries(True)
 
-    if self._libraries['db']:
-      db = self._libraries['db']
-      print('Found BDB %s in %s' % (db.version, self.bdb_path))
-    else:
+    # 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))
+
+    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
@@ -101,7 +115,7 @@ class WinGeneratorBase(gen_win_dependenc
       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}
@@ -109,16 +123,16 @@ class WinGeneratorBase(gen_win_dependenc
       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']
@@ -131,7 +145,7 @@ class WinGeneratorBase(gen_win_dependenc
     #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,
@@ -187,6 +201,9 @@ class WinGeneratorBase(gen_win_dependenc
     # 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 'db' not in self._libraries:
       install_targets = [x for x in install_targets if x.name != 'libsvn_fs_base']
@@ -200,15 +217,16 @@ class WinGeneratorBase(gen_win_dependenc
     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)
@@ -305,6 +323,9 @@ class WinGeneratorBase(gen_win_dependenc
                     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
 
@@ -673,16 +694,21 @@ class WinGeneratorBase(gen_win_dependenc
       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"
 
@@ -691,196 +717,134 @@ class WinGeneratorBase(gen_win_dependenc
                    "_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 'db' in self._libraries:
-      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 'serf' in self._libraries:
-      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.apath("subversion/include"),
-                     self.apath("subversion") ]
+    fakeincludes = [ "subversion/include",
+                     "subversion" ]
                      
     for dep in self.get_win_depends(target, FILTER_EXTERNALLIBS):
-      if dep.external_lib and \
-         dep.external_lib.startswith('$(SVN_') and \
-         dep.external_lib.endswith('_LIBS)'):
-
-        external_lib = dep.external_lib[6:-6].lower()
+      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]
-          inc_dir = self.apath(lib.include_dir)
-      
-          # Avoid duplicate items
-          if inc_dir and inc_dir not in fakeincludes:
-            fakeincludes.extend([inc_dir])
+
+          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.httpd_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.path("subversion/bindings/swig/proxy") ])
+      fakeincludes.append(util_includes)
 
-    if self.libintl_path:
-      fakeincludes.append(self.apath(self.libintl_path, 'inc'))
+    if (isinstance(target, gen_base.TargetSWIG)
+        or isinstance(target, gen_base.TargetSWIGLib)):
 
-    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)
+      # Projects aren't generated unless we have swig
+      assert self.swig_libdir
 
-    if self.sqlite_inline:
-      fakeincludes.append(self.apath(self.sqlite_path))
-    else:
-      fakeincludes.append(self.apath(self.sqlite_path, 'inc'))
-
-    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"))
 
-    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"
 
     debug = (cfg == 'Debug')
 
+    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 and \
-         dep.external_lib.startswith('$(SVN_') and \
-         dep.external_lib.endswith('_LIBS)'):
+      if dep.external_lib:
+        for elib in re.findall('\$\(SVN_([^\)]*)_LIBS\)', dep.external_lib):
+          external_lib = elib.lower()
 
-        external_lib = dep.external_lib[6:-6].lower()
+          if external_lib not in self._libraries:
+            continue
 
-        if external_lib in self._libraries:
           lib = self._libraries[external_lib]
-          
-          if debug:
+
+          if debug and lib.debug_lib_dir:
             lib_dir = self.apath(lib.debug_lib_dir)
-          else:
+          elif lib.lib_dir:
             lib_dir = self.apath(lib.lib_dir)
-      
-          # Avoid duplicate items
-          if lib_dir and lib_dir not in fakelibdirs:
-            fakelibdirs.extend([lib_dir])
-
-    if not self.sqlite_inline:
-      fakelibdirs.append(self.apath(self.sqlite_path, "lib"))
+          else:
+            continue # Dependency without library (E.g. JDK)
 
-    if self.sasl_path:
-      fakelibdirs.append(self.apath(self.sasl_path, "lib"))
+          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"
 
     debug = (cfg == 'Debug')
 
-    dblib = None
-    if self.bdb_lib:
-      dblib = self.bdb_lib+(debug and 'd.lib' or '.lib')
-
-    sasllib = None
-    if self.sasl_path:
-      sasllib = 'libsasl.lib'
-
     if not isinstance(target, gen_base.TargetLinked):
       return []
 
@@ -888,36 +852,24 @@ class WinGeneratorBase(gen_win_dependenc
       return []
 
     nondeplibs = target.msvc_libs[:]
-    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 and \
-         dep.external_lib.startswith('$(SVN_') and \
-         dep.external_lib.endswith('_LIBS)'):
+      if dep.external_lib:
+        for elib in re.findall('\$\(SVN_([^\)]*)_LIBS\)', dep.external_lib):
 
-        external_lib = dep.external_lib[6:-6].lower()
+          external_lib = elib.lower()
+
+          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 external_lib in self._libraries:
           lib = self._libraries[external_lib]
 
           if debug:
@@ -925,26 +877,6 @@ class WinGeneratorBase(gen_win_dependenc
           else:
             nondeplibs.append(lib.lib_name)
 
-        elif external_lib == 'sqlite':
-
-          if not self.sqlite_inline:
-            nondeplibs.append('sqlite3.lib')
-          # else: # Is not a linkable library
-
-        elif external_lib == 'sasl':
-
-          if sasllib:
-            nondeplibs.append(sasllib)
-
-        elif external_lib == 'apr_memcache' or \
-             external_lib == 'magic':
-          # Currently unhandled
-          lib = None
-
-        else:
-          print('Warning: Using underclared dependency \'%s\'' % \
-                (dep.external_lib,))
-
     return gen_base.unique(nondeplibs)
 
   def get_win_sources(self, target, reldir_prefix=''):
@@ -971,21 +903,23 @@ class WinGeneratorBase(gen_win_dependenc
 
     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()
@@ -996,7 +930,7 @@ class WinGeneratorBase(gen_win_dependenc
     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),

Modified: subversion/branches/fsfs-improvements/build/generator/gen_win_dependencies.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/gen_win_dependencies.py?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/gen_win_dependencies.py (original)
+++ subversion/branches/fsfs-improvements/build/generator/gen_win_dependencies.py Mon Jul 22 11:22:18 2013
@@ -27,21 +27,11 @@
 #
 
 import os
-try:
-  # Python >=2.5
-  from hashlib import md5 as hashlib_md5
-except ImportError:
-  # Python <2.5
-  from md5 import md5 as hashlib_md5
 import sys
 import fnmatch
 import re
 import subprocess
-import glob
 import string
-import generator.swig.header_wrappers
-import generator.swig.checkout_swig_header
-import generator.swig.external_runtime
 
 if sys.version_info[0] >= 3:
   # Python >=3.0
@@ -58,12 +48,17 @@ import ezt
 
 class SVNCommonLibrary:
 
-  def __init__(self, name, include_dir, lib_dir, lib_name, version=None,
+  def __init__(self, name, include_dirs, lib_dir, lib_name, version=None,
                debug_lib_dir=None, debug_lib_name=None, dll_dir=None,
                dll_name=None, debug_dll_dir=None, debug_dll_name=None,
-               is_src=False):
+               is_src=False, defines=[], forced_includes=[]):
     self.name = name
-    self.include_dir = include_dir
+    if include_dirs:
+      self.include_dirs = include_dirs if isinstance(include_dirs, list) \
+                                       else [include_dirs]
+    else:
+      self.include_dirs = []
+    self.defines = defines if not defines or isinstance(defines, list) else [defines]
     self.lib_dir = lib_dir
     self.lib_name = lib_name
     self.version = version
@@ -71,6 +66,10 @@ class SVNCommonLibrary:
     self.dll_name = dll_name
     self.is_src = is_src
 
+    self.forced_includes = forced_includes if not forced_includes \
+                                           or isinstance(forced_includes, list) \
+                                           else [forced_includes]
+
     if debug_lib_dir:
       self.debug_lib_dir = debug_lib_dir
     else:
@@ -102,10 +101,28 @@ class GenDependenciesBase(gen_base.Gener
     ('lib', 'object'): '.obj',
     ('pyd', 'target'): '.pyd',
     ('pyd', 'object'): '.obj',
+    ('so', 'target'): '.so',
+    ('so', 'object'): '.obj',
     }
 
   _libraries = {}     # Dict of SVNCommonLibrary instances of found libraries
 
+  _optional_libraries = [  # List of optional libraries to suppress warnings
+        'db',
+        'intl',
+        'serf',
+        'sasl',
+        'swig',
+        'perl',
+        'python',
+        'ruby',
+        'java_sdk',
+
+        # So optional, we don't even have any code to detect them on Windows
+        'apr_memcache',
+        'magic',
+  ]
+
   def parse_options(self, options):
     self.apr_path = 'apr'
     self.apr_util_path = 'apr-util'
@@ -260,42 +277,23 @@ class GenDependenciesBase(gen_base.Gener
     self._find_apr()
     self._find_apr_util_and_expat()
     self._find_zlib()
+    self._find_sqlite(show_warnings)
 
     # Optional dependencies
     self._find_bdb(show_warnings)
     self._find_openssl(show_warnings)
     self._find_serf(show_warnings)
-    
-    
-    if show_warnings:
-      # 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()
+    self._find_sasl(show_warnings)
+    self._find_libintl(show_warnings)
 
-      # Find the right Python include and libraries dirs for SWIG bindings
-      self._find_python()
+    self._find_jdk(show_warnings)
 
-      # Find the installed SWIG version to adjust swig options
-      self._find_swig()
+    # Swig (optional) dependencies
+    if self._find_swig(show_warnings):
+      self._find_perl(show_warnings)
+      self._find_python(show_warnings)
+      self._find_ruby(show_warnings)
 
-      # Find the installed Java Development Kit
-      self._find_jdk()
-
-      # Find Sqlite
-      self._find_sqlite()
-
-    
-    if show_warnings:
-      printed = []
-      for lib in self._libraries.values():
-        if lib.name in printed:
-          continue 
-        printed.append(lib.name)
-        print('Found %s %s' % (lib.name, lib.version))
-    
   def _find_apr(self):
     "Find the APR library and version"
 
@@ -306,14 +304,18 @@ class GenDependenciesBase(gen_base.Gener
                        "location.\n")
       sys.exit(1)                       
 
-    inc_path = os.path.join(self.apr_path, 'include')
-    version_file_path = os.path.join(inc_path, 'apr_version.h')
+    inc_base = os.path.join(self.apr_path, 'include')
 
-    if not os.path.exists(version_file_path):
+    if os.path.isfile(os.path.join(inc_base, 'apr-1', 'apr_version.h')):
+      inc_path = os.path.join(inc_base, 'apr-1')
+    elif os.path.isfile(os.path.join(inc_base, 'apr_version.h')):
+      inc_path = inc_base
+    else:
       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)
 
+    version_file_path = os.path.join(inc_path, 'apr_version.h')
     txt = open(version_file_path).read()
 
     vermatch = re.search(r'^\s*#define\s+APR_MAJOR_VERSION\s+(\d+)', txt, re.M)
@@ -339,12 +341,14 @@ class GenDependenciesBase(gen_base.Gener
     if major > 0:
         suffix = '-%d' % major
 
+    defines = []
     if self.static_apr:
       lib_name = 'apr%s.lib' % suffix
       lib_dir = os.path.join(self.apr_path, 'LibR')
       dll_dir = None
       debug_dll_dir = None
-      
+      defines.extend(["APR_DECLARE_STATIC"])
+
       if not os.path.isdir(lib_dir) and \
          os.path.isfile(os.path.join(self.apr_path, 'lib', lib_name)):
         # Installed APR instead of APR-Source
@@ -369,22 +373,33 @@ class GenDependenciesBase(gen_base.Gener
         dll_dir = lib_dir
         debug_dll_dir = debug_lib_dir
       else:
-        dll_dir = lib_dir
-        debug_dll_dir = debug_lib_dir
+        dll_dir = os.path.join(self.apr_path, 'bin')
+        debug_dll_dir = None
       
     self._libraries['apr'] = SVNCommonLibrary('apr', inc_path, lib_dir, lib_name,
                                               apr_version,
                                               debug_lib_dir=debug_lib_dir,
                                               dll_dir=dll_dir,
                                               dll_name=dll_name,
-                                              debug_dll_dir=debug_dll_dir)
+                                              debug_dll_dir=debug_dll_dir,
+                                              defines=defines)
 
   def _find_apr_util_and_expat(self):
     "Find the APR-util library and version"
 
     minimal_aprutil_version = (0, 9, 0)
-    
-    inc_path = os.path.join(self.apr_util_path, 'include')
+
+    inc_base = os.path.join(self.apr_util_path, 'include')
+
+    if os.path.isfile(os.path.join(inc_base, 'apr-1', 'apu_version.h')):
+      inc_path = os.path.join(inc_base, 'apr-1')
+    elif os.path.isfile(os.path.join(inc_base, 'apu_version.h')):
+      inc_path = inc_base
+    else:
+      sys.stderr.write("ERROR: 'apu_version' not found.\n")
+      sys.stderr.write("Use '--with-apr-util' option to configure APR-Util location.\n")
+      sys.exit(1)
+
     version_file_path = os.path.join(inc_path, 'apu_version.h')
 
     if not os.path.exists(version_file_path):
@@ -417,11 +432,13 @@ class GenDependenciesBase(gen_base.Gener
     if major > 0:
         suffix = '-%d' % major
 
+    defines = []
     if self.static_apr:
       lib_name = 'aprutil%s.lib' % suffix
-      lib_dir = os.path.join(self.aprutil_path, 'LibR')
+      lib_dir = os.path.join(self.apr_util_path, 'LibR')
       dll_dir = None
       debug_dll_dir = None
+      defines.extend(["APR_DECLARE_STATIC"])
       
       if not os.path.isdir(lib_dir) and \
          os.path.isfile(os.path.join(self.apr_util_path, 'lib', lib_name)):
@@ -437,7 +454,7 @@ class GenDependenciesBase(gen_base.Gener
       if not os.path.isdir(lib_dir) and \
          os.path.isfile(os.path.join(self.apr_util_path, 'lib', lib_name)):
         # Installed APR-Util instead of APR-Util-Source
-        lib_dir = os.path.join(apr_util_path, 'lib')
+        lib_dir = os.path.join(self.apr_util_path, 'lib')
         debug_lib_dir = lib_dir
       else:
         debug_lib_dir = os.path.join(self.apr_util_path, 'Debug')
@@ -447,16 +464,17 @@ class GenDependenciesBase(gen_base.Gener
         dll_dir = lib_dir
         debug_dll_dir = debug_lib_dir
       else:
-        dll_dir = lib_dir
-        debug_dll_dir = debug_lib_dir
-      
+        dll_dir = os.path.join(self.apr_util_path, 'bin')
+        debug_dll_dir = None
+
     self._libraries['aprutil'] = SVNCommonLibrary('apr-util', inc_path, lib_dir,
                                                    lib_name,
                                                    aprutil_version,
                                                    debug_lib_dir=debug_lib_dir,
                                                    dll_dir=dll_dir,
                                                    dll_name=dll_name,
-                                                   debug_dll_dir=debug_dll_dir)
+                                                   debug_dll_dir=debug_dll_dir,
+                                                   defines=defines)
 
     # And now find expat
     # If we have apr-util as a source location, it is in a subdir.
@@ -493,7 +511,8 @@ class GenDependenciesBase(gen_base.Gener
 
     self._libraries['xml'] = SVNCommonLibrary('expat', inc_path, lib_dir,
                                                'xml.lib', xml_version,
-                                               debug_lib_dir = debug_lib_dir)
+                                               debug_lib_dir = debug_lib_dir,
+                                               defines=['XML_STATIC'])
 
   def _find_zlib(self):
     "Find the ZLib library and version"
@@ -619,12 +638,17 @@ class GenDependenciesBase(gen_base.Gener
     else:
       debug_dll_name = None
 
+    # Usually apr-util doesn't find BDB on Windows, so we help apr-util
+    # by defining the value ourselves (Legacy behavior)
+    defines = ['APU_HAVE_DB=1', 'SVN_LIBSVN_FS_LINKS_FS_BASE']
+
     self._libraries['db'] = SVNCommonLibrary('db', inc_path, lib_dir, lib_name,
                                               version,
                                               debug_lib_name=debug_lib_name,
                                               dll_dir=dll_dir,
                                               dll_name=dll_name,
-                                              debug_dll_name=debug_dll_name)
+                                              debug_dll_name=debug_dll_name,
+                                              defines=defines)
 
     # For compatibility with old code
     self.bdb_lib = self._libraries['db'].lib_name
@@ -642,19 +666,20 @@ class GenDependenciesBase(gen_base.Gener
       inc_dir = os.path.join(self.openssl_path, 'inc32')
       if self.static_openssl:
         lib_dir = os.path.join(self.openssl_path, 'out32')
+        bin_dir = None
       else:
         lib_dir = os.path.join(self.openssl_path, 'out32dll')
-        bin_dir = os.path.join(self.openssl_path, 'out32dll')
+        bin_dir = lib_dir
     elif os.path.isfile(os.path.join(self.openssl_path,
                         'include/openssl/opensslv.h')):
       version_path = os.path.join(self.openssl_path,
                                   'include/openssl/opensslv.h')
       inc_dir = os.path.join(self.openssl_path, 'include')
       lib_dir = os.path.join(self.openssl_path, 'lib')
-      if self.static_openss:
-        self.bin_dir = None
+      if self.static_openssl:
+        bin_dir = None
       else:
-        self.bin_dir = os.path.join(self.openssl_path, 'bin')
+        bin_dir = os.path.join(self.openssl_path, 'bin')
     else:
       if show_warning:
         print('WARNING: \'opensslv.h\' not found')
@@ -664,7 +689,7 @@ class GenDependenciesBase(gen_base.Gener
     txt = open(version_path).read()
 
     vermatch = re.search(
-      r'#define OPENSSL_VERSION_TEXT	"OpenSSL\s+((\d+)\.(\d+).(\d+)([^ -]*))',
+      r'#define OPENSSL_VERSION_TEXT\s+"OpenSSL\s+((\d+)\.(\d+).(\d+)([^ -]*))',
       txt)
   
     version = (int(vermatch.group(2)), 
@@ -672,101 +697,128 @@ class GenDependenciesBase(gen_base.Gener
                int(vermatch.group(4)))
     openssl_version = vermatch.group(1)
   
-    self._libraries['ssleay32'] = SVNCommonLibrary('openssl', inc_dir, lib_dir,
-                                                    'ssleay32.lib',
-                                                    openssl_version,
-                                                    dll_name='ssleay32.dll',
-                                                    dll_dir=bin_dir)
+    self._libraries['openssl'] = SVNCommonLibrary('openssl', inc_dir, lib_dir,
+                                                  'ssleay32.lib',
+                                                  openssl_version,
+                                                  dll_name='ssleay32.dll',
+                                                  dll_dir=bin_dir)
 
     self._libraries['libeay32'] = SVNCommonLibrary('openssl', inc_dir, lib_dir,
                                                     'libeay32.lib',
                                                     openssl_version,
                                                     dll_name='libeay32.dll',
-                                                    dll_dir=bin_dir)                                                    
+                                                    dll_dir=bin_dir)
 
-  def _find_perl(self):
+  def _find_perl(self, show_warnings):
     "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')
+                  'print "$Config{PERL_REVISION}.$Config{PERL_VERSION}.'
+                          '$Config{PERL_SUBVERSION}\\n"; '
+                  'print "$Config{archlib}\\n"'), 'r')
     try:
       line = fp.readline()
       if line:
-        msg = 'Found installed perl version number.'
-        self.perl_lib = 'perl' + line.rstrip() + '.lib'
+        perl_version = line.strip()
+        perlv = perl_version.split('.')
+        perl_lib = 'perl%s%s.lib' % (perlv[0], perlv[1])
       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()
+        return
 
-    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')]
+        lib_dir = os.path.join(line.strip(), 'CORE')
+        inc_dir = lib_dir
     finally:
       fp.close()
 
-  def _find_ruby(self):
+    self._libraries['perl'] = SVNCommonLibrary('perl', inc_dir, lib_dir,
+                                               perl_lib, perl_version)
+
+  def _find_ruby(self, show_warnings):
     "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
+
+    lib_dir = None
+    inc_dirs = []
+
     # 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')
+    fp = os.popen('ruby -rrbconfig -W0 -e ' + escape_shell_arg(
+                  "puts Config::CONFIG['ruby_version'];"
+                  "puts Config::CONFIG['LIBRUBY'];"
+                  "puts Config::CONFIG['libdir'];"
+                  "puts Config::CONFIG['rubyhdrdir'];"
+                  "puts Config::CONFIG['arch'];"), '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))
+      line = fp.readline()
+      if line:
+        ruby_version = line.strip()
+
+      line = fp.readline()
+      if line:
+        ruby_lib = line.strip()
+
+      line = fp.readline()
+      if line:
+        lib_dir = line.strip()
+
+      line = fp.readline()
+      if line:
+        inc_base = line.strip()
+        inc_dirs = [inc_base]
+
+      line = fp.readline()
+      if line:
+        inc_dirs.append(os.path.join(inc_base, line.strip()))
+
     finally:
-      proc.close()
+      fp.close()
+
+    if not lib_dir:
+      return
 
-  def _find_python(self):
+    # Visual C++ doesn't have a standard compliant snprintf yet
+    # (Will probably be added in VS2013 + 1)
+    defines = ['snprintf=_snprintf']
+
+    ver = ruby_version.split('.')
+    ver = tuple(map(int, ver))
+    if ver >= (1, 8, 0):
+      defines.extend(["HAVE_RB_ERRINFO"])
+
+    forced_includes = []
+    if ver >= (1, 9, 0):
+      forced_includes.append('swigutil_rb__pre_ruby.h')
+      defines.extend(["SVN_SWIG_RUBY__CUSTOM_RUBY_CONFIG"])
+
+    self._libraries['ruby'] = SVNCommonLibrary('ruby', inc_dirs, lib_dir,
+                                               ruby_lib, ruby_version,
+                                               defines=defines,
+                                               forced_includes=forced_includes)
+
+  def _find_python(self, show_warnings):
     "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")
+
+      inc_dir = sysconfig.get_python_inc()
+      lib_dir = os.path.join(sysconfig.PREFIX, "libs")
     except ImportError:
-      pass
+      return
+
+    self._libraries['python'] = SVNCommonLibrary('python', inc_dir, lib_dir, None,
+                                                 sys.version.split(' ')[0])
 
-  def _find_jdk(self):
-    if not self.jdk_path:
+  def _find_jdk(self, show_warnings):
+    "Find details about an installed jdk"
+
+    jdk_path = self.jdk_path
+    self.jdk_path = None # No jdk on errors
+
+    minimal_jdk_version = (1, 0, 0) # ### Provide sane default
+
+    if not jdk_path:
       jdk_ver = None
       try:
         try:
@@ -792,73 +844,131 @@ class GenDependenciesBase(gen_base.Gener
           for i in range(num_values):
             (name, value, key_type) = winreg.EnumValue(key, i)
             if name == "JavaHome":
-              self.jdk_path = value
+              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 not jdk_path or not os.path.isdir(jdk_path):
+      return
+
+    try:
+      outfp = subprocess.Popen([os.path.join(jdk_path, 'bin', 'javah.exe'),
+                               '-version'], stdout=subprocess.PIPE).stdout
+      line = outfp.read()
+      if line:
+        vermatch = re.search(r'"(([0-9]+(\.[0-9]+)+)(_[._0-9]+)?)"', line, re.M)
+      else:
+        vermatch = None
+
+      if vermatch:
+        version = tuple(map(int, vermatch.groups()[1].split('.')))
+        versionstr = vermatch.groups()[0]
+      else:
+        if show_warnings:
+          print('Could not find installed JDK,')
+        return
+      outfp.close()
+    except OSError:
+      if show_warnings:
+        print('Could not find installed JDK,')
+      return
+
+    if version < minimal_jdk_version:
+      if show_warning:
+        print('Found java jdk %s, but >= %s is required. '
+              'javahl will not be built.\n' % \
+              (versionstr, '.'.join(str(v) for v in minimal_jdk_version)))
+      return
+
+    self.jdk_path = jdk_path
+    inc_dirs = [
+        os.path.join(jdk_path, 'include'),
+        os.path.join(jdk_path, 'include', 'win32'),
+      ]
+
+    lib_dir = os.path.join(jdk_path, 'lib')
+
+    # The JDK provides .lib files, but we currently don't use these.
+    self._libraries['java_sdk'] = SVNCommonLibrary('java-sdk', inc_dirs,
+                                                   lib_dir, None,
+                                                   versionstr)
+
+  def _find_swig(self, show_warnings):
+    "Find details about an installed swig"
+
+    minimal_swig_version = (1, 3, 25)
+
+    if not self.swig_path:
+      swig_exe = 'swig.exe'
+    else:
+      swig_exe = os.path.abspath(os.path.join(self.swig_path, 'swig.exe'))
 
     if self.swig_path is not None:
-      self.swig_exe = os.path.abspath(os.path.join(self.swig_path, 'swig'))
+      self.swig_exe = os.path.abspath(os.path.join(self.swig_path, 'swig.exe'))
     else:
       self.swig_exe = 'swig'
 
+    swig_version = None
     try:
-      outfp = subprocess.Popen([self.swig_exe, '-version'], stdout=subprocess.PIPE, universal_newlines=True).stdout
-      txt = outfp.read()
+      fp = subprocess.Popen([self.swig_exe, '-version'],
+                            stdout=subprocess.PIPE).stdout
+      txt = fp.read()
       if txt:
-        vermatch = re.compile(r'^SWIG\ Version\ (\d+)\.(\d+)\.(\d+)$', re.M) \
-                   .search(txt)
+        vermatch = re.search(r'^SWIG\ Version\ (\d+)\.(\d+)\.(\d+)', txt, re.M)
       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()
+        swig_version = tuple(map(int, vermatch.groups()))
+      fp.close()
     except OSError:
-      print('Could not find installed SWIG,'
-             ' assuming version %s\n' % default_version)
-      self.swig_libdir = ''
+      swig_version = None
 
-    self.swig_vernum = vernum
-    self.swig_libdir = libdir
+    if not swig_version:
+      if show_warnings:
+        print('Could not find installed SWIG')
+      return False
+
+    swig_ver = '%d.%d.%d' % (swig_version)
+    if swig_version < minimal_swig_version:
+      if show_warning:
+        print('Found swig %s, but >= %s is required. '
+              'the swig bindings will not be built.\n' %
+              (swig_version, '.'.join(str(v) for v in minimal_swig_version)))
+      return
 
-  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 = subprocess.Popen([self.swig_exe, '-swiglib'],
+                            stdout=subprocess.PIPE).stdout
+      lib_dir = fp.readline().strip()
+      fp.close()
+    except OSError:
+      lib_dir = None
       fp.close()
-    return ''
+
+    if not lib_dir:
+      if show_warnings:
+        print('Could not find libdir of installed SWIG')
+      return False
+
+    if (not self.swig_path and
+        os.path.isfile(os.path.join(lib_dir, '../swig.exe'))):
+      self.swig_path = os.path.dirname(lib_dir)
+
+    inc_dirs = [
+        'subversion/bindings/swig',
+        'subversion/bindings/swig/proxy',
+        'subversion/bindings/swig/include',
+      ]
+
+    self.swig_libdir = lib_dir
+    self.swig_version = swig_version
+
+    self._libraries['swig'] = SVNCommonLibrary('swig', inc_dirs, lib_dir, None,
+                                               swig_ver)
+    return True
 
   def _find_ml(self):
     "Check if the ML assembler is in the path"
@@ -884,9 +994,9 @@ class GenDependenciesBase(gen_base.Gener
     # shouldn't be called unless serf is there
     assert inc_dir and os.path.exists(inc_dir)
 
-    self.serf_ver_maj = None
-    self.serf_ver_min = None
-    self.serf_ver_patch = None
+    serf_ver_maj = None
+    serf_ver_min = None
+    serf_ver_patch = None
 
     # serf.h should be present
     if not os.path.exists(os.path.join(inc_dir, 'serf.h')):
@@ -898,28 +1008,28 @@ class GenDependenciesBase(gen_base.Gener
     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))
+      serf_ver_maj = int(maj_match.group(1))
     if min_match:
-      self.serf_ver_min = int(min_match.group(1))
+      serf_ver_min = int(min_match.group(1))
     if patch_match:
-      self.serf_ver_patch = int(patch_match.group(1))
+      serf_ver_patch = int(patch_match.group(1))
 
-    return self.serf_ver_maj, self.serf_ver_min, self.serf_ver_patch
+    return serf_ver_maj, serf_ver_min, serf_ver_patch
 
   def _find_serf(self, show_warning):
     "Check if serf and its dependencies are available"
 
     minimal_serf_version = (1, 2, 1)
-    
+
     if not self.serf_path:
       return
-    
+
     inc_dir = self.serf_path
-    
+
     if os.path.isfile(os.path.join(inc_dir, 'serf.h')):
       # Source layout
       version = self._get_serf_version(inc_dir)
-      
+
       if version < (1, 3, 0):
         lib_dir = os.path.join(self.serf_path, 'Release')
         debug_lib_dir = os.path.join(self.serf_path, 'Debug')
@@ -931,7 +1041,14 @@ class GenDependenciesBase(gen_base.Gener
       # Install layout
       inc_dir = os.path.join(self.serf_path, 'include/serf-1')
       version = self._get_serf_version(inc_dir)
-      lib_dir = os.path.join(inc_dir, 'lib')
+      lib_dir = os.path.join(self.serf_path, 'lib')
+      debug_lib_dir = None
+      is_src = False
+    elif os.path.isfile(os.path.join(self.serf_path, 'include/serf-2/serf.h')):
+      # Install layout
+      inc_dir = os.path.join(self.serf_path, 'include/serf-2')
+      version = self._get_serf_version(inc_dir)
+      lib_dir = os.path.join(self.serf_path, 'lib')
       debug_lib_dir = None
       is_src = False
     else:
@@ -939,60 +1056,206 @@ class GenDependenciesBase(gen_base.Gener
         print('WARNING: \'serf.h\' not found')
         print("Use '--with-serf' to configure serf location.");
       return
-    
-    if is_src and 'ssleay32' not in self._libraries:
+
+    if is_src and 'openssl' not in self._libraries:
       if show_warning:
         print('openssl not found, serf and ra_serf will not be built')
       return
-    
+    serf_version = '.'.join(str(v) for v in version)
+
     if version < minimal_serf_version:
-      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))
+      if show_warning:
+        print('Found serf %s, but >= %s is required. '
+              'ra_serf will not be built.\n' %
+              (serf_version, '.'.join(str(v) for v in minimal_serf_version)))
       return
-      
-    if self.serf_ver_maj > 0:
-      lib_name = 'serf-%d.lib' % (self.serf_ver_maj,)
+
+    serf_ver_maj = version[0]
+
+    if serf_ver_maj > 0:
+      lib_name = 'serf-%d.lib' % (serf_ver_maj,)
     else:
       lib_name = 'serf.lib'
-      
-    serf_version = '.'.join(str(v) for v in version)
+
+    defines = ['SVN_HAVE_SERF', 'SVN_LIBSVN_CLIENT_LINKS_RA_SERF']
+
     self._libraries['serf'] = SVNCommonLibrary('serf', inc_dir, lib_dir,
                                                 lib_name, serf_version,
                                                 debug_lib_dir=debug_lib_dir,
-                                                is_src=is_src)
+                                                is_src=is_src,
+                                                defines=defines)
+
+  def _find_sasl(self, show_warning):
+    "Check if sals is available"
+
+    minimal_sasl_version = (2, 0, 0)
+
+    if not self.sasl_path:
+      return
 
-  def _find_sqlite(self):
+    inc_dir = os.path.join(self.sasl_path, 'include')
+
+    version_file_path = os.path.join(inc_dir, 'sasl.h')
+
+    if not os.path.isfile(version_file_path):
+      if show_warning:
+        print('WARNING: \'%s\' not found' % (version_file_path,))
+        print("Use '--with-sasl' to configure sasl location.");
+      return
+
+    txt = open(version_file_path).read()
+
+    vermatch = re.search(r'^\s*#define\s+SASL_VERSION_MAJOR\s+(\d+)', txt, re.M)
+    major = int(vermatch.group(1))
+
+    vermatch = re.search(r'^\s*#define\s+SASL_VERSION_MINOR\s+(\d+)', txt, re.M)
+    minor = int(vermatch.group(1))
+
+    vermatch = re.search(r'^\s*#define\s+SASL_VERSION_STEP\s+(\d+)', txt, re.M)
+    patch = int(vermatch.group(1))
+
+    version = (major, minor, patch)
+    sasl_version = '.'.join(str(v) for v in version)
+
+    if version < minimal_sasl_version:
+      if show_warning:
+        print('Found sasl %s, but >= %s is required. '
+              'sals support will not be built.\n' %
+              (sasl_version, '.'.join(str(v) for v in minimal_serf_version)))
+      return
+
+    lib_dir = os.path.join(self.sasl_path, 'lib')
+
+    if os.path.isfile(os.path.join(lib_dir, 'libsasl.dll')):
+      dll_dir = lib_dir
+      dll_name = 'libsasl.dll'
+    elif os.path.isfile(os.path.join(self.sasl_path, 'bin', 'libsasl.dll')):
+      dll_dir = os.path.join(self.sasl_path, 'bin')
+      dll_name = 'libsasl.dll'
+    else:
+      # Probably a static compilation
+      dll_dir = None
+      dll_name = None
+
+    self._libraries['sasl'] = SVNCommonLibrary('sasl', inc_dir, lib_dir,
+                                               'libsasl.lib', sasl_version,
+                                               dll_dir=dll_dir,
+                                               dll_name=dll_name,
+                                               defines=['SVN_HAVE_SASL'])
+
+  def _find_libintl(self, show_warning):
+    "Find gettext support"
+    minimal_libintl_version = (0, 14, 1)
+
+    if not self.enable_nls or not self.libintl_path:
+      return;
+
+    # We support 2 scenarios.
+    if os.path.isfile(os.path.join(self.libintl_path, 'inc', 'libintl.h')) and\
+       os.path.isfile(os.path.join(self.libintl_path, 'lib', 'intl3_svn.lib')):
+
+      # 1. Subversion's custom libintl based on gettext 0.14.1
+      inc_dir = os.path.join(self.libintl_path, 'inc')
+      lib_dir = os.path.join(self.libintl_path, 'lib')
+      dll_dir = os.path.join(self.libintl_path, 'bin')
+
+      lib_name = 'intl3_svn.lib'
+      dll_name = 'intl3_svn.dll'
+    elif os.path.isfile(os.path.join(self.libintl_path, \
+                                     'include', 'libintl.h')):
+      # 2. A gettext install
+      inc_dir = os.path.join(self.libintl_path, 'include')
+      lib_dir = os.path.join(self.libintl_path, 'lib')
+      dll_dir = os.path.join(self.libintl_path, 'bin')
+
+      lib_name = 'intl.lib'
+      dll_name = 'intl.dll'
+    else:
+      if (show_warning):
+        print('WARNING: \'libintl.h\' not found')
+        print("Use '--with-libintl' to configure libintl location.")
+      return
+
+    version_file_path = os.path.join(inc_dir, 'libintl.h')
+    txt = open(version_file_path).read()
+
+    match = re.search(r'^\s*#define\s+LIBINTL_VERSION\s+((0x)?[0-9A-Fa-f]+)',
+                      txt, re.M)
+
+    ver = int(match.group(1), 0)
+    version = (ver >> 16, (ver >> 8) & 0xFF, ver & 0xFF)
+
+    libintl_version = '.'.join(str(v) for v in version)
+
+    if version < minimal_libintl_version:
+      if show_warning:
+        print('Found libintl %s, but >= %s is required.\n' % \
+              (libintl_version,
+               '.'.join(str(v) for v in minimal_libintl_version)))
+      return
+
+    self._libraries['intl'] = SVNCommonLibrary('libintl', inc_dir, lib_dir,
+                                               lib_name, libintl_version,
+                                               dll_dir=dll_dir,
+                                               dll_name=dll_name)
+
+  def _find_sqlite(self, show_warnings):
     "Find the Sqlite library and version"
 
     minimal_sqlite_version = (3, 7, 12)
 
-    header_file = os.path.join(self.sqlite_path, 'inc', 'sqlite3.h')
+    # For SQLite we support 3 scenarios:
+    # - Installed in standard directory layout
+    # - Installed in legacy directory layout
+    # - Amalgamation compiled directly into our libraries
+
+    sqlite_base = self.sqlite_path
+
+    lib_dir = None
+    dll_dir = None
+    dll_name = None
+    defines = []
+
+    lib_name = 'sqlite3.lib'
+
+    if os.path.isfile(os.path.join(sqlite_base, 'include/sqlite3.h')):
+      # Standard layout
+      inc_dir = os.path.join(sqlite_base, 'include')
+      lib_dir = os.path.join(sqlite_base, 'lib')
+
+      # We assume a static library, but let's support shared in this case
+      if os.path.isfile(os.path.join(sqlite_base, 'bin/sqlite3.dll')):
+        dll_dir = os.path.join(sqlite_base, 'bin')
+        dll_name = 'sqlite3.dll'
+    elif os.path.isfile(os.path.join(sqlite_base, 'inc/sqlite3.h')):
+      # Standard layout
+      inc_dir = os.path.join(sqlite_base, 'inc')
+      lib_dir = os.path.join(sqlite_base, 'lib')
+
+      # We assume a static library, but let's support shared in this case
+      if os.path.isfile(os.path.join(sqlite_base, 'bin/sqlite3.dll')):
+        dll_dir = os.path.join(sqlite_base, 'bin')
+        dll_name = 'sqlite3.dll'
+    elif (os.path.isfile(os.path.join(sqlite_base, 'sqlite3.h'))
+          and os.path.isfile(os.path.join(sqlite_base, 'sqlite3.c'))):
+      # Amalgamation
+      inc_dir = sqlite_base
+      lib_dir = None
+      lib_name = None 
+      defines.append('SVN_SQLITE_INLINE')
+    else:
+      sys.stderr.write("ERROR: SQLite not found\n" % self.sqlite_path)
+      sys.stderr.write("Use '--with-sqlite' option to configure sqlite location.\n");
+      sys.exit(1)
+
+    version_file_path = os.path.join(inc_dir, 'sqlite3.h')
+
+    txt = open(version_file_path).read()
 
-    # 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)
+    match = re.search(r'^\s*#define\s+SQLITE_VERSION\s+'
+                      r'"(\d+)\.(\d+)\.(\d+)(?:\.(\d))?"', txt, re.M)
 
-    version = vermatch.groups()
+    version = match.groups()
 
     # Sqlite doesn't add patch numbers for their ordinary releases
     if not version[3]:
@@ -1000,16 +1263,20 @@ class GenDependenciesBase(gen_base.Gener
 
     version = tuple(map(int, version))
 
-    self.sqlite_version = '.'.join(str(v) for v in version)
+    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))
+                          sqlite_version))
       sys.exit(1)
-    else:
-      print('Found SQLite %s' % self.sqlite_version)
+
+    self._libraries['sqlite'] = SVNCommonLibrary('sqlite', inc_dir, lib_dir,
+                                                 lib_name, sqlite_version,
+                                                 dll_dir=dll_dir,
+                                                 dll_name=dll_name,
+                                                 defines=defines)
 
 # ============================================================================
 # This is a cut-down and modified version of code from:

Modified: subversion/branches/fsfs-improvements/build/generator/swig/__init__.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/swig/__init__.py?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/swig/__init__.py (original)
+++ subversion/branches/fsfs-improvements/build/generator/swig/__init__.py Mon Jul 22 11:22:18 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/fsfs-improvements/build/generator/swig/external_runtime.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/swig/external_runtime.py?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/swig/external_runtime.py (original)
+++ subversion/branches/fsfs-improvements/build/generator/swig/external_runtime.py Mon Jul 22 11:22:18 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)

Modified: subversion/branches/fsfs-improvements/build/generator/templates/msvc_dsp.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/templates/msvc_dsp.ezt?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/templates/msvc_dsp.ezt (original)
+++ subversion/branches/fsfs-improvements/build/generator/templates/msvc_dsp.ezt Mon Jul 22 11:22:18 2013
@@ -42,8 +42,8 @@ RSC=rc.exe
 # PROP Target_Dir ""
 [if-any is_utility][else]LIB32=link.exe -lib
 # ADD LIB32 /out:"[rootpath]\[configs.name]\[target.output_dir]\[target.output_name]"
-# ADD CPP /nologo /W3 /FD /Fd"[rootpath]\[configs.name]\[target.output_dir]\[target.output_pdb]" /c [is configs.name "Debug"]/MDd /Gm /Gi /GX /ZI /Od /GZ[else]/MD /GX /O2 /Zi[end][for configs.defines] /D "[configs.defines]"[end][if-any instrument_apr_pools] /D "APR_POOL_DEBUG=[instrument_apr_pools]"[end][for includes] /I "[includes]"[end]
-# ADD RSC /l [if-any is_exe]0x409[else]0x424[end][is configs.name "Debug"] /d "_DEBUG"[end][for includes] /I "[includes]"[end]
+# ADD CPP /nologo /W3 /FD /Fd"[rootpath]\[configs.name]\[target.output_dir]\[target.output_pdb]" /c [is configs.name "Debug"]/MDd /Gm /Gi /GX /ZI /Od /GZ[else]/MD /GX /O2 /Zi[end][for configs.defines] /D "[configs.defines]"[end][if-any instrument_apr_pools] /D "APR_POOL_DEBUG=[instrument_apr_pools]"[end][for configs.includes] /I "[configs.includes]"[end]
+# ADD RSC /l [if-any is_exe]0x409[else]0x424[end][is configs.name "Debug"] /d "_DEBUG"[end][for configs.includes] /I "[configs.includes]"[end]
 BSC32=bscmake.exe
 LINK32=link.exe
 [if-any is_exe is_dll]# ADD LINK32 /nologo[if-any is_exe] /subsystem:console[end][if-any is_dll] /dll[end] /debug /machine:IX86[for configs.libs] [configs.libs][end][for configs.libdirs] /libpath:"[configs.libdirs]"[end] /out:"[rootpath]\[configs.name]\[target.output_dir]\[target.output_name]"[if-any instrument_purify_quantify] /fixed:no[end]

Modified: subversion/branches/fsfs-improvements/build/generator/templates/vcnet_vcproj.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/templates/vcnet_vcproj.ezt?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/templates/vcnet_vcproj.ezt (original)
+++ subversion/branches/fsfs-improvements/build/generator/templates/vcnet_vcproj.ezt Mon Jul 22 11:22:18 2013
@@ -45,7 +45,7 @@
 				EnableIntrinsicFunctions="TRUE"
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
-[end]				AdditionalIncludeDirectories="..\..\..\[configs.name];[for includes][includes][if-index includes last][else];[end][end]"
+[end]				AdditionalIncludeDirectories="..\..\..\[configs.name];[for configs.includes][configs.includes][if-index configs.includes last][else];[end][end]"
 				PreprocessorDefinitions="[if-any instrument_apr_pools]APR_POOL_DEBUG=[instrument_apr_pools];[end][is platforms "x64"]WIN64;[end][for configs.defines][configs.defines][if-index configs.defines last][else];[end][end];_CRT_SECURE_NO_WARNINGS"
 [is configs.name "Debug"]				MinimalRebuild="TRUE"
 				RuntimeLibrary="3"
@@ -62,7 +62,8 @@
 				/we4002 /we4003 /we4013 /we4020 /we4022 /we4024 /we4028 /we4029 /we4030 /we4031 /we4033 /we4047 /we4089 /we4113 /we4115 /we4204 /we4715"
 				DebugInformationFormat="3"
 				ProgramDataBaseFileName="$(IntDir)\[target.output_pdb]"
-				CompileAsManaged="0"
+				[if-any configs.forced_include_files]ForcedIncludeFiles="[for configs.forced_include_files][configs.forced_include_files][if-index configs.forced_include_files last][else];[end][end]"
+				[end]CompileAsManaged="0"
 				CompileAs="0"[if-any is_exe][is configs.name "Release"]
 				OptimizeForWindowsApplication="TRUE"[end][end]/>
 			<Tool
@@ -114,7 +115,7 @@
 				Name="[configs.name]|[platforms]">
 				<Tool
 					Name="VCResourceCompilerTool"
-					AdditionalIncludeDirectories="[for includes][includes][if-index includes last][else];[end][end]"
+					AdditionalIncludeDirectories="[for configs.includes][configs.includes][if-index configs.includes last][else];[end][end]"
 					PreprocessorDefinitions="SVN_FILE_NAME=[target.output_name];SVN_FILE_DESCRIPTION=[target.desc];[is configs.name "Debug"]_DEBUG[else]NDEBUG[end]"/>
 			</FileConfiguration>[end][end]
 		</File>[end]