Index: build.conf
===================================================================
--- build.conf (revision 22814)
+++ build.conf (working copy)
@@ -200,7 +200,7 @@
path = subversion/libsvn_client
libs = libsvn_wc libsvn_ra libsvn_delta libsvn_diff libsvn_subr apriconv apr
install = lib
-msvc-static = yes
+msvc-export = svn_client.h
# Routines for binary diffing and tree-deltas
[libsvn_delta]
@@ -208,7 +208,7 @@
install = fsmod-lib
path = subversion/libsvn_delta
libs = libsvn_subr aprutil apriconv apr zlib
-msvc-static = yes
+msvc-export = svn_delta.h
# Routines for diffing
[libsvn_diff]
@@ -216,7 +216,7 @@
path = subversion/libsvn_diff
libs = libsvn_subr apriconv apr
install = lib
-msvc-static = yes
+msvc-export = svn_diff.h
# The repository filesystem library
[libsvn_fs]
@@ -227,7 +227,7 @@
# conditionally add more dependencies
add-deps = $(SVN_FS_LIB_DEPS)
add-install-deps = $(SVN_FS_LIB_INSTALL_DEPS)
-msvc-static = yes
+msvc-export = svn_fs.h
[libsvn_fs_base]
type = fs-module
@@ -253,7 +253,7 @@
add-deps = $(SVN_RA_LIB_DEPS)
add-install-deps = $(SVN_RA_LIB_INSTALL_DEPS)
install = lib
-msvc-static = yes
+msvc-export = svn_ra.h
# Accessing repositories via DAV through neon
[libsvn_ra_dav]
@@ -293,7 +293,7 @@
path = subversion/libsvn_repos
install = ramod-lib
libs = libsvn_fs libsvn_delta libsvn_subr apriconv apr
-msvc-static = yes
+msvc-export = svn_repos.h
# Low-level grab bag of utilities
[libsvn_subr]
@@ -302,7 +302,7 @@
path = subversion/libsvn_subr
libs = aprutil apriconv apr xml zlib
msvc-libs = advapi32.lib shfolder.lib
-msvc-static = yes
+msvc-export = svn_auth.h svn_base64.h svn_cmdline.h svn_config.h svn_ctype.h svn_dso.h svn_error.h svn_hash.h svn_io.h svn_md5.h svn_nls.h svn_opt.h svn_path.h svn_pools.h svn_props.h svn_quoprint.h svn_sorts.h svn_string.h svn_subst.h svn_time.h svn_types.h svn_user.h svn_utf.h svn_version.h svn_xml.h private\svn_atomic.h
# Working copy management lib
[libsvn_wc]
@@ -310,7 +310,7 @@
path = subversion/libsvn_wc
libs = libsvn_delta libsvn_diff libsvn_subr aprutil apriconv apr
install = lib
-msvc-static = yes
+msvc-export = svn_wc.h
# Subversion plugin for Apache's mod_dav
[mod_dav_svn]
@@ -362,7 +362,7 @@
path = subversion/bindings/swig
sources = svn_client.i
libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
- libsvn_client libsvn_subr
+ libsvn_client libsvn_subr apr
nonlibs = swig_core
description = Subversion client library bindings
@@ -371,7 +371,7 @@
path = subversion/bindings/swig
sources = svn_delta.i
libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
- libsvn_delta libsvn_subr
+ libsvn_delta libsvn_subr apr
nonlibs = swig_core
description = Subversion delta library bindings
@@ -380,7 +380,7 @@
path = subversion/bindings/swig
sources = svn_fs.i
libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
- libsvn_fs libsvn_subr
+ libsvn_fs libsvn_subr apr
nonlibs = swig_core
description = Subversion FS library bindings
@@ -389,7 +389,7 @@
path = subversion/bindings/swig
sources = svn_ra.i
libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
- libsvn_ra libsvn_subr
+ libsvn_ra libsvn_subr apr
nonlibs = swig_core
description = Subversion RA library bindings
@@ -398,7 +398,7 @@
path = subversion/bindings/swig
sources = svn_repos.i
libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
- libsvn_repos libsvn_subr
+ libsvn_repos libsvn_subr apr
nonlibs = swig_core
description = Subversion repository library bindings
Index: build/generator/extractor.py
===================================================================
--- build/generator/extractor.py (revision 22814)
+++ build/generator/extractor.py (working copy)
@@ -3,7 +3,7 @@
# extractor.py: extract function names from declarations in header files
#
# ====================================================================
-# Copyright (c) 2000-2004 CollabNet. All rights reserved.
+# Copyright (c) 2000-2006 CollabNet. All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -21,7 +21,6 @@
import re
import string
-
#
# This parses the following two types of declarations:
#
@@ -42,6 +41,7 @@
_filter_names = [
'svn_boolean_t', # svn_config_enumerator_t looks like (to our regex) a
# function declaration for svn_boolean_t
+ 'svn_auth_get_keychain_simple_provider', # Not available on Windows
]
if __name__ == '__main__':
@@ -51,3 +51,5 @@
for fname in sys.argv[1:]:
for func in extract_funcs(fname):
print func
+ if os.path.basename(fname) == 'svn_ctype.h':
+ print 'svn_ctype_table = svn_ctype_table_internal CONSTANT'
Index: build/generator/gen_win.py
===================================================================
--- build/generator/gen_win.py (revision 22814)
+++ build/generator/gen_win.py (working copy)
@@ -56,6 +56,7 @@
'mod_authz_svn': None }
# Instrumentation options
+ self.disable_shared = None
self.instrument_apr_pools = None
self.instrument_purify_quantify = None
self.configure_apr_util = None
@@ -111,6 +112,8 @@
self.configure_apr_util = 1
elif opt == '--enable-ml':
self.enable_ml = 1
+ elif opt == '--disable-shared':
+ self.disable_shared = 1
elif opt == '--vsnet-version':
if val == '2002' or re.match('7(\.\d+)?', val):
self.vsnet_version = '7.00'
@@ -277,10 +280,15 @@
install_targets = filter(lambda x: x.name != 'libsvn_ra_dav',
install_targets)
+ dll_targets = []
for target in install_targets:
- if isinstance(target, gen_base.TargetLib) and target.msvc_fake:
- install_targets.append(self.create_fake_target(target))
-
+ if isinstance(target, gen_base.TargetLib):
+ if target.msvc_fake:
+ install_targets.append(self.create_fake_target(target))
+ if target.msvc_export and not self.disable_shared:
+ dll_targets.append(self.create_dll_target(target))
+ install_targets.extend(dll_targets)
+
# sort these for output stability, to watch out for regressions.
install_targets.sort(lambda t1, t2: cmp(t1.name, t2.name))
return install_targets
@@ -295,7 +303,43 @@
self.graph.add(gen_base.DT_LINK, section.target.name, dep)
dep.msvc_fake = section.target
return section.target
+
+ def create_dll_target(self, dep):
+ "Return a dynamic library that depends on a static library"
+ target = gen_base.TargetLib(dep.name,
+ { 'path' : dep.path,
+ 'msvc-name' : dep.name + "_dll" },
+ self)
+ target.msvc_export = dep.msvc_export
+ # The dependency should now be static.
+ dep.msvc_export = None
+ dep.msvc_static = True
+
+ # Remove the 'lib' prefix, so that the static library will be called
+ # svn_foo.lib
+ dep.name = dep.name[3:]
+ # However, its name should still be 'libsvn_foo' in Visual Studio
+ dep.msvc_name = target.name
+
+ # We renamed dep, so right now it has no dependencies. Because target has
+ # dep's old dependencies, transfer them over to dep.
+ deps = self.graph.deps[gen_base.DT_LINK]
+ deps[dep.name] = deps[target.name]
+
+ for key in deps.iterkeys():
+ # Link everything except tests against the dll. Tests need to be linked
+ # against the static libraries because they sometimes access internal
+ # library functions.
+ if dep in deps[key] and key.find("test") == -1:
+ deps[key].remove(dep)
+ deps[key].append(target)
+
+ # The dll has exactly one dependency, the static library.
+ deps[target.name] = [ dep ]
+
+ return target
+
def get_configs(self, target):
"Get the list of configurations for the project"
configs = [ ]
@@ -398,7 +442,7 @@
deps = []
for header in target.msvc_export:
- deps.append(self.path(target.path, header))
+ deps.append(self.path('subversion/include', header))
cbuild = "python $(InputPath) %s > %s" \
% (string.join(deps), def_file)
@@ -605,9 +649,27 @@
def get_linked_win_depends(self, target, deps, static_recurse=0):
"""Find project dependencies for a DLL or EXE project"""
- for dep, dep_kind in self.get_direct_depends(target):
+ direct_deps = self.get_direct_depends(target)
+ for dep, dep_kind in direct_deps:
is_proj, is_lib, is_static = dep_kind
+ # add all top level dependencies
+ if not static_recurse or is_lib:
+ # We need to guard against linking both a static and a dynamic library
+ # into a project (this is mainly a concern for tests). To do this, for
+ # 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:
+ static_dep = self.graph.get_sources(gen_base.DT_LINK, dep.name)[0]
+ if deps.has_key(static_dep):
+ continue
+ deps[dep] = dep_kind
+
+ # add any libraries that static library dependencies depend on
+ for dep, dep_kind in direct_deps:
+ is_proj, is_lib, is_static = dep_kind
+
# recurse for projectless dependencies
if not is_proj:
self.get_linked_win_depends(dep, deps, 0)
@@ -616,11 +678,6 @@
elif is_static:
self.get_linked_win_depends(dep, deps, 1)
- # add all top level dependencies and any libraries that
- # static library dependencies depend on.
- if not static_recurse or is_lib:
- deps[dep] = dep_kind
-
def get_win_defines(self, target, cfg):
"Return the list of defines for target"
Index: build/generator/vcnet_vcproj.ezt
===================================================================
--- build/generator/vcnet_vcproj.ezt (revision 22814)
+++ build/generator/vcnet_vcproj.ezt (working copy)
@@ -114,6 +114,8 @@
[end][end]
[end]
+[is target_type "2"] [end]
+
Index: build/win32/empty.c
===================================================================
--- build/win32/empty.c (revision 0)
+++ build/win32/empty.c (revision 0)
@@ -0,0 +1,2 @@
+/* This file is added to every libsvn_foo_dll project because Visual Studio
+ won't build the project's libraries if it has no source files. */
Index: gen-make.py
===================================================================
--- gen-make.py (revision 22814)
+++ gen-make.py (working copy)
@@ -162,6 +162,9 @@
print " --enable-ml"
print " enable use of ML assembler with zlib"
print
+ print " --disable-shared"
+ print " only build static libraries"
+ print
print " --vsnet-version=VER"
print " generate for VS.NET version VER (2002, 2003, or 2005)"
print " [only valid in combination with '-t vcproj']"
@@ -206,6 +209,7 @@
'enable-nls',
'enable-bdb-in-apr-util',
'enable-ml',
+ 'disable-shared',
'vsnet-version=',
])
if len(args) > 1:
Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c (revision 22814)
+++ subversion/libsvn_ra/ra_loader.c (working copy)
@@ -793,3 +793,46 @@
_("Unrecognized URL scheme '%s'"), url);
}
+/* For each libsvn_ra_foo library that is not linked in, provide a default
+ implementation for svn_ra_foo_init which returns a "not implemented"
+ error. */
+
+#ifndef SVN_LIBSVN_CLIENT_LINKS_RA_DAV
+svn_error_t *
+svn_ra_dav_init(int abi_version,
+ apr_pool_t *pool,
+ apr_hash_t *hash)
+{
+ return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, NULL, NULL);
+}
+#endif /* ! SVN_LIBSVN_CLIENT_LINKS_RA_DAV */
+
+#ifndef SVN_LIBSVN_CLIENT_LINKS_RA_SVN
+svn_error_t *
+svn_ra_svn_init(int abi_version,
+ apr_pool_t *pool,
+ apr_hash_t *hash)
+{
+ return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, NULL, NULL);
+}
+#endif /* ! SVN_LIBSVN_CLIENT_LINKS_RA_SVN */
+
+#ifndef SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL
+svn_error_t *
+svn_ra_local_init(int abi_version,
+ apr_pool_t *pool,
+ apr_hash_t *hash)
+{
+ return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, NULL, NULL);
+}
+#endif /* ! SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL */
+
+#ifndef SVN_LIBSVN_CLIENT_LINKS_RA_SERF
+svn_error_t *
+svn_ra_serf_init(int abi_version,
+ apr_pool_t *pool,
+ apr_hash_t *hash)
+{
+ return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, NULL, NULL);
+}
+#endif /* ! SVN_LIBSVN_CLIENT_LINKS_RA_SERF */
Index: subversion/libsvn_subr/ctype.c
===================================================================
--- subversion/libsvn_subr/ctype.c (revision 22814)
+++ subversion/libsvn_subr/ctype.c (working copy)
@@ -20,7 +20,7 @@
#include "svn_ctype.h"
-static const apr_uint32_t ctype_table[256] =
+const apr_uint32_t svn_ctype_table_internal[256] =
{
/* **** DO NOT EDIT! ****
This table was generated by genctype.py, make changes there. */
@@ -282,4 +282,4 @@
/* xff */ 0
};
-const apr_uint32_t *const svn_ctype_table = ctype_table;
+const apr_uint32_t *const svn_ctype_table = svn_ctype_table_internal;
Index: win-tests.py
===================================================================
--- win-tests.py (revision 22814)
+++ win-tests.py (working copy)
@@ -57,6 +57,11 @@
client_tests = filter(lambda x: x.startswith(CMDLINE_TEST_SCRIPT_PATH),
all_tests)
+dll_paths = []
+for section in gen_obj.sections.values():
+ if section.options.get("msvc-export"):
+ dll_paths.append(os.path.join("subversion", section.name))
+
opts, args = my_getopt(sys.argv[1:], 'hrdvcu:f:',
['release', 'debug', 'verbose', 'cleanup', 'url=',
'svnserve-args=', 'fs-type=', 'asp.net-hack',
@@ -210,8 +215,10 @@
libintl_dll_path = os.path.join(libintl_path, 'bin', 'intl3_svn.dll')
copy_changed_file(libintl_dll_path, abs_objdir)
+ dll_path = reduce(lambda x, y: x + os.path.join(abs_objdir, y) + os.pathsep,
+ dll_paths, "")
os.environ['APR_ICONV_PATH'] = os.path.abspath(apriconv_so_path)
- os.environ['PATH'] = abs_objdir + os.pathsep + os.environ['PATH']
+ os.environ['PATH'] = abs_objdir + os.pathsep + dll_path + os.environ['PATH']
def fix_case(path):
path = os.path.normpath(path)