Author: rhuijben
Date: Thu Jul 18 09:45:56 2013
New Revision: 1504405
URL: http://svn.apache.org/r1504405
Log:
In the windows project generator: Handle Cyrus sasl as a proper dependency
instead of local patches to the generator.
* win-tests.py
Handle sasl as a standard dependency, instead of by using sasl knowledge.
* build/generator/gen_win.py
(get_win_defines): Detect sasl by checking libraries collection.
(get_win_includes,
get_win_lib_dirs): Don't add sasl include dir to all projects, but handle
via dependencies.
(get_win_libs): Remove specialized handling.
* build/generator/gen_win_dependencies.py
(imports): Remove unused ugly import.
(find_libraries): Find sasl.
(_find_sasl): New function.
Modified:
subversion/trunk/build/generator/gen_win.py
subversion/trunk/build/generator/gen_win_dependencies.py
subversion/trunk/win-tests.py
Modified: subversion/trunk/build/generator/gen_win.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_win.py?rev=1504405&r1=1504404&r2=1504405&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_win.py (original)
+++ subversion/trunk/build/generator/gen_win.py Thu Jul 18 09:45:56 2013
@@ -730,7 +730,7 @@ class WinGeneratorBase(gen_win_dependenc
fakedefines.append("SVN_LIBSVN_CLIENT_LINKS_RA_SERF")
# check we have sasl
- if self.sasl_path:
+ if 'sasl' in self._libraries:
fakedefines.append("SVN_HAVE_SASL")
if target.name.endswith('svn_subr'):
@@ -804,9 +804,6 @@ class WinGeneratorBase(gen_win_dependenc
else:
fakeincludes.append(self.apath(self.sqlite_path, 'inc'))
- if self.sasl_path:
- fakeincludes.append(self.apath(self.sasl_path, 'include'))
-
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'))
@@ -845,9 +842,6 @@ class WinGeneratorBase(gen_win_dependenc
if not self.sqlite_inline:
fakelibdirs.append(self.apath(self.sqlite_path, "lib"))
- if self.sasl_path:
- fakelibdirs.append(self.apath(self.sasl_path, "lib"))
-
if isinstance(target, gen_base.TargetApacheMod):
fakelibdirs.append(self.apath(self.httpd_path, cfg))
if target.name == 'mod_dav_svn':
@@ -874,10 +868,6 @@ class WinGeneratorBase(gen_win_dependenc
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 []
@@ -928,22 +918,18 @@ class WinGeneratorBase(gen_win_dependenc
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
elif external_lib in ['db',
- 'serf']:
- lib = None
+ 'serf',
+ 'sasl']:
+ lib = None # Suppress warnings for optional library
else:
- print('Warning: Using underclared dependency \'%s\'' % \
+ print('Warning: Using undeclared dependency \'%s\'' % \
(dep.external_lib,))
return gen_base.unique(nondeplibs)
Modified: subversion/trunk/build/generator/gen_win_dependencies.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_win_dependencies.py?rev=1504405&r1=1504404&r2=1504405&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_win_dependencies.py (original)
+++ subversion/trunk/build/generator/gen_win_dependencies.py Thu Jul 18
09:45:56 2013
@@ -27,12 +27,6 @@
#
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
@@ -265,8 +259,8 @@ class GenDependenciesBase(gen_base.Gener
self._find_bdb(show_warnings)
self._find_openssl(show_warnings)
self._find_serf(show_warnings)
-
-
+ self._find_sasl(show_warnings)
+
if show_warnings:
# Find the right Ruby include and libraries dirs and
# library name to link SWIG bindings with
@@ -968,6 +962,61 @@ class GenDependenciesBase(gen_base.Gener
debug_lib_dir=debug_lib_dir,
is_src=is_src)
+ def _find_sasl(self, show_warning):
+ "Check if sals is available"
+
+ minimal_sasl_version = (2, 0, 0)
+
+ if not self.sasl_path:
+ return
+
+ 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:
+ msg = '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)
+
def _find_sqlite(self):
"Find the Sqlite library and version"
Modified: subversion/trunk/win-tests.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/win-tests.py?rev=1504405&r1=1504404&r2=1504405&view=diff
==============================================================================
--- subversion/trunk/win-tests.py (original)
+++ subversion/trunk/win-tests.py Thu Jul 18 09:45:56 2013
@@ -339,9 +339,6 @@ def locate_libs():
if gen_obj.libintl_path:
dlls.append(os.path.join(gen_obj.libintl_path, 'bin', 'intl3_svn.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)