* build/generator/gen_win_dependencies.py (GenDependenciesBase._find_python):
Fix differences of SWIG_PY_OPTS between Unix and Windows.
(Just same logic as function SVN_FIND_SWIG in build/ac-macros/swig.m4)
Patch by: Jun Omae <jun66j5{_AT_}gmail.com>
@@ -1038,10 +1038,22 @@ class GenDependenciesBase(gen_base.GeneratorBase):
return
if sys.version_info[0] >= 3:
- self.user_macros.append(UserMacro("SWIG_PY_OPTS", "-python -py3"))
+ if self.swig_version < (3, 0, 10):
+ if show_warnings:
+ print("WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer")
+ return
+ if self.swig_version < (4, 0, 0):
+ opts = "-python -py3 -nofastunpack -modern"
+ else:
+ opts = "-python -py3 -nofastunpack"
else:
- self.user_macros.append(UserMacro("SWIG_PY_OPTS", "-python -classic"))
+ if not ((1, 3, 24) <= self.swig_version < (4, 0, 0)):
+ if show_warnings:
+ print("WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0")
+ return
+ opts = "-python -classic"
+ self.user_macros.append(UserMacro("SWIG_PY_OPTS", opts))
self._libraries['python'] = SVNCommonLibrary('python', inc_dir, lib_dir, None,
sys.version.split(' ')[0])
