Author: futatuki
Date: Wed Sep 21 17:45:48 2022
New Revision: 1904198

URL: http://svn.apache.org/viewvc?rev=1904198&view=rev
Log:
swig-py: build: Don't pass deperecated options to SWIG >= 4.1.0 release

* build/ac-macros/swig.m4 (SVN_DETERMINE_SWIG_OPTS):
  - Detect SWIG version >= 4.1.0 and set appropriate option to SWIG_PY_OPTS
  - Warn if SWIG version > 4.0.2 which is not checked, but allow to build.
  - Set invalid SWIG_PY_OPTS value if SWIG version is not suitable.

* build/generator/gen_win_dependencies.py (GenDependenciesBase._find_pyton):
  - Detect SWIG version >= 4.1.0 and set appropriate option to SWIG_PY_OPTS
  - Warn if SWIG version > 4.0.2 which is not checked, but allow to build.

Modified:
    subversion/trunk/build/ac-macros/swig.m4
    subversion/trunk/build/generator/gen_win_dependencies.py

Modified: subversion/trunk/build/ac-macros/swig.m4
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/swig.m4?rev=1904198&r1=1904197&r2=1904198&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/swig.m4 (original)
+++ subversion/trunk/build/ac-macros/swig.m4 Wed Sep 21 17:45:48 2022
@@ -182,22 +182,29 @@ suitable Python interpreter is not found
                 if test "$SWIG_VERSION" -ge "300010"; then
                   dnl SWIG Python bindings successfully configured, clear the 
error message dnl
                   SWIG_PY_ERRMSG=""
+                  if test "$SWIG_VERSION" -lt "400000"; then
+                    SWIG_PY_OPTS="-python -py3 -nofastunpack -modern"
+                  elif test "$SWIG_VERSION" -lt "401000"; then 
+                    SWIG_PY_OPTS="-python -py3 -nofastunpack"
+                  else
+                    SWIG_PY_OPTS="-python -nofastunpack"
+                  fi
+                  if test "$SWIG_VERSION" -gt "400002"; then 
+                    AC_MSG_WARN([Subversion Python bindings may work,])
+                    AC_MSG_WARN([but we didn't check with this SWIG version.])
+                  fi
                 else
+                  SWIG_PY_OPTS="-no-such-a-option" # fool proof
                   SWIG_PY_ERRMSG="SWIG version is not suitable"
                   AC_MSG_WARN([Subversion Python bindings for Python 3 require 
SWIG 3.0.10 or newer])
                 fi
-                if test "$SWIG_VERSION" -lt "400000"; then
-                  SWIG_PY_OPTS="-python -py3 -nofastunpack -modern"
-                else
-                  SWIG_PY_OPTS="-python -py3 -nofastunpack"
-                fi
               else
                 if test "$SWIG_VERSION" -lt "400000"; then
                   SWIG_PY_OPTS="-python -classic"
                   dnl SWIG Python bindings successfully configured, clear the 
error message dnl
                   SWIG_PY_ERRMSG=""
                 else
-                  SWIG_PY_OPTS="-python -nofastunpack"
+                  SWIG_PY_OPTS="-no-such-a-option" # fool proof
                   SWIG_PY_ERRMSG="SWIG version is not suitable"
                   AC_MSG_WARN([Subversion Python bindings for Python 2 require 
1.3.24 <= SWIG < 4.0.0])
                 fi

Modified: subversion/trunk/build/generator/gen_win_dependencies.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_win_dependencies.py?rev=1904198&r1=1904197&r2=1904198&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_win_dependencies.py (original)
+++ subversion/trunk/build/generator/gen_win_dependencies.py Wed Sep 21 
17:45:48 2022
@@ -1059,8 +1059,13 @@ class GenDependenciesBase(gen_base.Gener
         return
       if self.swig_version < (4, 0, 0):
         opts = "-python -py3 -nofastunpack -modern"
-      else:
+      elif self.swig_version < (4, 1, 0):
         opts = "-python -py3 -nofastunpack"
+      else:
+        opts = "-python -nofastunpack"
+      if show_warnings and self.swig_version > (4, 0, 2):
+        print("WARNING: Subversion Python bindings may work,\n"
+              "but we didn't check with this SWIG version.")
     else:
       if not ((1, 3, 24) <= self.swig_version < (4, 0, 0)):
         if show_warnings:


Reply via email to