[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Compiling Subversion Libraries as DLLs on Windows

From: Brandon Ehle <azverkan_at_yahoo.com>
Date: 2003-10-16 04:18:19 CEST

Russell Yanofsky wrote:

>I'd like to get some feedback on a patch that builds subversion libraries as
>dlls instead of libs on windows. It uses the
>automatically-generated-DEF-file approach discussed back in March in this
>thread:
>
>http://www.contactor.se/~dast/svn/archive-2003-03/1457.shtml
>
>The patch is actually three separate patches, which are attached to this
>message and are meant to be applied successively. The first patch causes
>subversion libraries to be linked with the dynamic apr library instead of
>the static one. The second patch eliminates some special case code from
>gen_win.py for compiling mod_dav_svn and mod_authz_svn which the first patch
>obsoletes. And the third patch contains the changes needed to generate DEF
>files and compile the libraries as DLLs.
>
>These patches aren't ready to be applied. They cause at least a few
>problems:
>
>1) They break compilation of test programs which call non-exported library
>functions. (See test-errors.txt for the resulting link errors.)
>
>2) They break the windows testing script because subversion exes won't run
>without being in the same directory as the dll's they depend on.
>
Not to mention the debugger. We could probably just compile all the
dlls and exes to the same directory.

>3) They probably break the windows installer. It would need to be updated to
>install the new dlls.
>
>Anyone have ideas on how to move forward, or feedback on what's been done so
>far?
>
I'm running with your applied patches + a couple of fixes to get the
VC.NET projects working. I'll let you know if I run into any issues,
but so far so good.

1) I had to comment out the move_proj_file stuff for the project file
overrides because those are static project files and need to be updated
and I'm just running with the auto-converted projects just fine.

2) I had to specify the .def file in the project link tab.

--- generator/gen_vcnet_vcproj.py (revision 7428)
+++ generator/gen_vcnet_vcproj.py (working copy)
@@ -48,6 +48,8 @@

     sources = self.get_proj_sources(False, target, rootpath)

+ linkdef = self.get_proj_linkdef(target, rootpath)
+
     data = {
       'target' : target,
       'target_type' : config_type,
@@ -59,6 +61,7 @@
       'sources' : sources,
       'default_platform' : self.platforms[0],
       'default_config' : configs[0].name,
+ 'linker_definition' : linkdef,
       'is_exe' : ezt.boolean(isinstance(target, gen_base.TargetExe)),
       'is_external' : ezt.boolean(isinstance(target,
gen_base.TargetProject)
                                   and target.cmd),
@@ -99,17 +102,17 @@

     # apr doesn't supply vcproj files, so move our pre-defined ones
     # over if they don't match
- self.move_proj_file('apr', 'apr.vcproj')
- self.move_proj_file('apr-iconv', 'apriconv.vcproj')
- self.move_proj_file(os.path.join('apr-iconv','ccs'),
- 'apriconv_ccs_modules.vcproj')
- self.move_proj_file(os.path.join('apr-iconv','ces'),
- 'apriconv_ces_modules.vcproj')
- self.move_proj_file('apr-util', 'aprutil.vcproj')
- self.move_proj_file(os.path.join('apr-util','uri'),
- 'gen_uri_delims.vcproj')
- self.move_proj_file(os.path.join('apr-util','xml', 'expat', 'lib'),
- 'xml.vcproj')
+## self.move_proj_file('apr', 'apr.vcproj')
+## self.move_proj_file('apr-iconv', 'apriconv.vcproj')
+## self.move_proj_file(os.path.join('apr-iconv','ccs'),
+## 'apriconv_ccs_modules.vcproj')
+## self.move_proj_file(os.path.join('apr-iconv','ces'),
+## 'apriconv_ces_modules.vcproj')
+## self.move_proj_file('apr-util', 'aprutil.vcproj')
+## self.move_proj_file(os.path.join('apr-util','uri'),
+## 'gen_uri_delims.vcproj')
+## self.move_proj_file(os.path.join('apr-util','xml', 'expat', 'lib'),
+## 'xml.vcproj')

     install_targets = self.get_install_targets()

--- generator/vcnet_vcproj.ezt (revision 7428)
+++ generator/vcnet_vcproj.ezt (working copy)
@@ -51,7 +51,8 @@
 [end]
AdditionalLibraryDirectories="..\..\..\db4-win32\lib;[for
configs.libdirs][configs.libdirs];[end]"
                                TargetMachine="1"
                                IgnoreDefaultLibraryNames="libc.lib"
- GenerateDebugInformation="TRUE"
+[if-any linker_definition]
ModuleDefinitionFile="[linker_definition]"
+[end] GenerateDebugInformation="TRUE"
                                
ProgramDatabaseFile="$(OutDir)\$(TargetName).pdb"[is configs.name "Debug"]
                                OptimizeReferences="0"[else]
                                OptimizeReferences="2"

--- generator/gen_win.py (revision 7428)
+++ generator/gen_win.py (working copy)
@@ -256,6 +257,11 @@
                     ))
     return configs

+ def get_proj_linkdef(self, target, rootpath):
+ if isinstance(target, gen_base.TargetLib) and target.msvc_export:
+ return rootpath + "\\" + target.path + "\\" + target.name + ".def"
+ return None
+
   def get_proj_sources(self, quote_path, target, rootpath):
     "Get the list of source files for each project"
     sources = [ ]
@@ -265,8 +271,21 @@
         if quote_path and '-' in rsrc:
           rsrc = '"%s"' % rsrc
         sources.append(ProjectItem(path=rsrc, reldir=reldir, user_deps=[],
- swig_language=None))
+ custom_build=None))
+
+ dsrc = self.get_proj_linkdef(target, rootpath)
+ if dsrc:
+ gsrc = rootpath + "\\build\\generator\\extractor.py"
+ deps = []
+ for header in target.msvc_export:
+ deps.append(rootpath + "\\subversion\\include\\" + header)
+
+ sources.append(ProjectItem(path=dsrc, reldir=None, custom_build=None,
+ user_deps=[]))

+ sources.append(ProjectItem(path=gsrc, reldir=None,
custom_build="defgen",
+ user_deps=deps, custom_target=dsrc))
+
     if isinstance(target, gen_base.TargetSWIG):
       for obj in self.graph.get_sources(gen_base.DT_LINK, target.name):
         if isinstance(obj, gen_base.SWIGObject):

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 16 04:19:09 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.