Index: build/generator/gen_win.py
===================================================================
--- build/generator/gen_win.py	(revision 24088)
+++ build/generator/gen_win.py	(working copy)
@@ -23,8 +23,8 @@
 
 class GeneratorBase(gen_base.GeneratorBase):
   """This intermediate base class exists to be instantiated by win-tests.py,
-  in order to obtain information from build.conf without actually doing
-  any generation."""
+  in order to obtain information from build.conf and library paths without
+  actually doing any generation."""
   _extension_map = {
     ('exe', 'target'): '.exe',
     ('exe', 'object'): '.obj',
@@ -32,9 +32,6 @@
     ('lib', 'object'): '.obj',
     }
 
-class WinGeneratorBase(GeneratorBase):
-  "Base class for all Windows project files generators"
-
   def parse_options(self, options):
     self.apr_path = 'apr'
     self.apr_util_path = 'apr-util'
@@ -50,8 +47,6 @@
     self.openssl_path = None
     self.junit_path = None
     self.swig_path = None
-    self.vsnet_version = '7.00'
-    self.vsnet_proj_ver = '7.00'
     self.sqlite_path = None
     self.skip_sections = { 'mod_dav_svn': None,
                            'mod_authz_svn': None }
@@ -121,24 +116,40 @@
         if val == '2002' or re.match('7(\.\d+)?', val):
           self.vsnet_version = '7.00'
           self.vsnet_proj_ver = '7.00'
-          sys.stderr.write('Generating for VS.NET 2002\n')
         elif val == '2003' or re.match('8(\.\d+)?', val):
           self.vsnet_version = '8.00'
           self.vsnet_proj_ver = '7.10'
-          sys.stderr.write('Generating for VS.NET 2003\n')
         elif val == '2005' or re.match('9(\.\d+)?', val):
           self.vsnet_version = '9.00'
           self.vsnet_proj_ver = '8.00'
-          sys.stderr.write('Generating for VS.NET 2005\n')
         else:
-          sys.stderr.write('WARNING: Unknown VS.NET version "%s",'
-                           ' assumimg "%s"\n' % (val, self.vsnet_version))
-    if self.sqlite_path == None:
-      sys.stderr.write('ERROR: Sqlite path not specifed. ' + \
-                       'Use --with-sqlite option.')
-      sys.exit(1)
-	
+          self.vsnet_version = val
 
+  def __init__(self, fname, verfname, options):
+
+    # Initialize parent
+    gen_base.GeneratorBase.__init__(self, fname, verfname, options)
+    
+    # parse (and save) the options that were passed to us
+    self.parse_options(options)
+
+    # Find Berkeley DB
+    self._find_bdb()
+
+  def _find_bdb(self):
+    "Find the Berkley DB library and version"
+    for ver in ("45", "44", "43", "42", "41", "40"):
+      lib = "libdb" + ver
+      path = os.path.join(self.bdb_path, "lib")
+      if os.path.exists(os.path.join(path, lib + ".lib")):
+        self.bdb_lib = lib
+        break
+    else:
+      self.bdb_lib = None
+
+class WinGeneratorBase(GeneratorBase):
+  "Base class for all Windows project files generators"	
+
   def __init__(self, fname, verfname, options, subdir):
     """
     Do some Windows specific setup
@@ -147,12 +158,31 @@
     create the necessary paths
     """
 
-    # parse (and save) the options that were passed to us
-    self.parse_options(options)
+    # Initialize parent
+    GeneratorBase.__init__(self, fname, verfname, options)
+    
+    if self.sqlite_path == None:
+      sys.stderr.write('ERROR: Sqlite path not specifed. ' + \
+                       'Use --with-sqlite option.')
+      sys.exit(1)
 
-    # Find db-4.0.x or db-4.1.x
-    self._find_bdb()
+    if self.bdb_lib is not None:
+      sys.stderr.write("Found %s.lib in %s\n" % (self.bdb_lib, self.bdb_path))
+    else:
+      sys.stderr.write("BDB not found, BDB fs will not be built\n")
 
+    if self.vsnet_version == '7.00':
+      sys.stderr.write('Generating for VS.NET 2002\n')
+    elif self.vsnet_version == '8.00':
+      sys.stderr.write('Generating for VS.NET 2003\n')
+    elif self.vsnet_version == '9.00':
+      sys.stderr.write('Generating for VS.NET 2005\n')
+    else:
+      sys.stderr.write('WARNING: Unknown VS.NET version "%s",'
+                       ' assumimg "%s"\n' % (self.vsnet_version, '7.00'))
+      self.vsnet_version = '7.00'
+      self.vsnet_proj_ver = '7.00'
+    
     # Find the right Ruby include and libraries dirs and
     # library name to link SWIG bindings with
     self._find_ruby()
@@ -219,9 +249,6 @@
     self.write_with_template(os.path.join('build', 'win32', 'build_locale.bat'),
                              'build_locale.ezt', data)
 
-    #Initialize parent
-    GeneratorBase.__init__(self, fname, verfname, options)
-
     #Make the project files directory if it doesn't exist
     #TODO win32 might not be the best path as win64 stuff will go here too
     self.projfilesdir=os.path.join("build","win32",subdir)
@@ -1020,19 +1047,6 @@
 
     raise NotImplementedError
 
-  def _find_bdb(self):
-    "Find the Berkley DB library and version"
-    for ver in ("45", "44", "43", "42", "41", "40"):
-      lib = "libdb" + ver
-      path = os.path.join(self.bdb_path, "lib")
-      if os.path.exists(os.path.join(path, lib + ".lib")):
-        sys.stderr.write("Found %s.lib in %s\n" % (lib, path))
-        self.bdb_lib = lib
-        break
-    else:
-      sys.stderr.write("BDB not found, BDB fs will not be built\n")
-      self.bdb_lib = None
-
   def _find_perl(self):
     "Find the right perl library name to link swig bindings with"
     fp = os.popen('perl -MConfig -e ' + escape_shell_arg(
Index: win-tests.py
===================================================================
--- win-tests.py	(revision 24077)
+++ win-tests.py	(working copy)
@@ -51,7 +51,10 @@
 
 import gen_win
 version_header = os.path.join('subversion', 'include', 'svn_version.h')
-gen_obj = gen_win.GeneratorBase('build.conf', version_header, [])
+cp = ConfigParser.ConfigParser()
+cp.read('gen-make.opts')
+gen_obj = gen_win.GeneratorBase('build.conf', version_header,
+                                cp.items('options'))
 all_tests = gen_obj.test_progs + gen_obj.bdb_test_progs \
           + gen_obj.scripts + gen_obj.bdb_scripts
 client_tests = filter(lambda x: x.startswith(CMDLINE_TEST_SCRIPT_PATH),
@@ -184,38 +187,40 @@
 
 def locate_libs():
   "Move DLLs to a known location and set env vars"
-  def get(cp, section, option, default):
-    if cp.has_option(section, option):
-      return cp.get(section, option)
-    else:
-      return default
 
-  cp = ConfigParser.ConfigParser()
-  cp.read('gen-make.opts')
-  apr_path = get(cp, 'options', '--with-apr', 'apr')
-  aprutil_path = get(cp, 'options', '--with-apr-util', 'apr-util')
-  apriconv_path = get(cp, 'options', '--with-apr-iconv', 'apr-iconv')
-  apriconv_so_path = os.path.join(apriconv_path, objdir, 'iconv')
+  dlls = []
+  
   # look for APR 1.x dll's and use those if found
-  apr_dll_path = os.path.join(apr_path, objdir, 'libapr-1.dll')
-  if os.path.exists(apr_dll_path):
-    aprutil_dll_path = os.path.join(aprutil_path, objdir, 'libaprutil-1.dll')
-    apriconv_dll_path = os.path.join(apriconv_path, objdir, 'libapriconv-1.dll')
+  apr_test_path = os.path.join(gen_obj.apr_path, objdir, 'libapr-1.dll')
+  if os.path.exists(apr_test_path):
+    suffix = "-1"
   else:
-    apr_dll_path = os.path.join(apr_path, objdir, 'libapr.dll')
-    aprutil_dll_path = os.path.join(aprutil_path, objdir, 'libaprutil.dll')
-    apriconv_dll_path = os.path.join(apriconv_path, objdir, 'libapriconv.dll')
-    
+    suffix = ""
+  dlls.append(os.path.join(gen_obj.apr_path, objdir,
+                           'libapr%s.dll' % (suffix)))
+  dlls.append(os.path.join(gen_obj.apr_util_path, objdir,
+                             'libaprutil%s.dll' % (suffix)))
+  dlls.append(os.path.join(gen_obj.apr_iconv_path, objdir,
+                           'libapriconv%s.dll' % (suffix)))
 
-  copy_changed_file(apr_dll_path, abs_objdir)
-  copy_changed_file(aprutil_dll_path, abs_objdir)
-  copy_changed_file(apriconv_dll_path, abs_objdir)
+  if gen_obj.libintl_path is not None:
+    dlls.append(os.path.join(gen_obj.libintl_path, 'bin', 'intl3_svn.dll'))
 
-  libintl_path = get(cp, 'options', '--with-libintl', None)
-  if libintl_path is not None:
-    libintl_dll_path = os.path.join(libintl_path, 'bin', 'intl3_svn.dll')
-    copy_changed_file(libintl_dll_path, abs_objdir)
+  dlls.append(os.path.join(gen_obj.sqlite_path, 'bin', 'sqlite3.dll'))
 
+  if gen_obj.bdb_path is not None:
+    partial_path = os.path.join(gen_obj.bdb_path, 'bin', gen_obj.bdb_lib)
+    if objdir == 'Debug':
+      dlls.append(partial_path + 'd.dll')
+    else:
+      dlls.append(partial_path + '.dll')
+
+  if gen_obj.sasl_path is not None:
+    dlls.append(os.path.join(gen_obj.sasl_path, 'lib', 'libsasl.dll'))
+
+  for dll in dlls:
+    copy_changed_file(dll, abs_objdir)
+
   # Copy the Subversion library DLLs
   if not cp.has_option('options', '--disable-shared'):
     for svn_dll in svn_dlls:
@@ -230,6 +235,7 @@
     copy_changed_file(mod_dav_svn_path, abs_objdir)
     copy_changed_file(mod_authz_svn_path, abs_objdir)
 
+  apriconv_so_path = os.path.join(gen_obj.apr_iconv_path, objdir, 'iconv')
   os.environ['APR_ICONV_PATH'] = os.path.abspath(apriconv_so_path)
   os.environ['PATH'] = abs_objdir + os.pathsep + os.environ['PATH']
   
