Hi, I updated the patch to restrict supported SWIG version
posted before, <4ea8a16b-f04b-ab8c-8794-60a244294...@poem.co.jp>.

In build system:
* Make symbolic link for *.so files in build tree on the copy-swig-py
 target, for the check-swig-py target (for SWIG >= 4.0.0). this symbolic
 links are cleared on the clean-swig-py target
* Stop build with Python 3 + SWIG < 3.0.10 (or SWIG >= 4.0.0, yet)
* Stop build with Python 2 + SWIG >= 4.0.0

In subversion/bindings/swig/INSTALL:
* Add description that SWIG is optional for using distribution tarball.
* Update description of supported SWIG version.

Please review, especially I don't have any confidence in description
in INSTALL file.

Thanks,
--
Yasuhito FUTATSUKI <futat...@poem.co.jp>
Restrict SWIG version for Python bindings

* Makefile.in (copy-swig-py:):
  Make symbolic links to C extension modules in build/test directory
  (for check-swig-py with SWIG 3.0.9 and SWIG 4.0 or later)

* build/ac-macros/swig.m4:
  Add SWIG version check for Python 2 and Python 3 to check its version
  is suitable for Python bindings, and to set up appropriate SWIG option. 

* subversion/bindings/swig/INSTALL
 (BUILDING SWIG BINDINGS FOR SVN ON UNIX, Step1):
 - Add description that SWIG installation is optional.
 - Update suitable SWIG version information per language bindings.
 (BUILDING SWIG BINDINGS FOR SVN ON UNIX, Step1a): Fold long line.

Index: Makefile.in
===================================================================
--- Makefile.in (revision 1869469)
+++ Makefile.in (working copy)
@@ -935,6 +935,7 @@
        @for f in $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/*.py; do \
          ! [ -f "$$f" ] || cp -pf $$f $(SWIG_PY_DIR)/libsvn; \
        done
+       @cd $(SWIG_PY_DIR)/libsvn;ln -sf ../.libs/*.so .
        @touch $(SWIG_PY_DIR)/libsvn/__init__.py
 
 swig-py: autogen-swig-py copy-swig-py
Index: build/ac-macros/swig.m4
===================================================================
--- build/ac-macros/swig.m4     (revision 1869469)
+++ build/ac-macros/swig.m4     (working copy)
@@ -158,13 +158,26 @@
           ])
 
           if test "$ac_cv_python_is_py3" = "yes"; then
-             SWIG_PY_OPTS="-python -py3"
+            if test "$SWIG_VERSION" -ge "300010" -a "$SWIG_VERSION" -lt 
"400000"; then
+              SWIG_PY_OPTS="-python -py3"
+              dnl SWIG Python bindings successfully configured, clear the 
error message dnl
+              SWIG_PY_ERRMSG=""
+            else
+              SWIG_PY_OPTS="-python -py3 -nofastunpack"
+              SWIG_PY_ERRMSG="SWIG version is not suitable"
+              AC_MSG_WARN([Subversion Python bindings for Python 3 requires 
3.0.10 <= SWIG < 4.0.0])
+            fi
           else
-             SWIG_PY_OPTS="-python -classic"
+            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_ERRMSG="SWIG version is not suitable"
+              AC_MSG_WARN([Subversion Python bindings for Python 2 requires 
1.3.24 <= SWIG < 4.0.0])
+            fi
           fi
-
-          dnl SWIG Python bindings successfully configured, clear the error 
message
-          SWIG_PY_ERRMSG=""
         fi
             
       fi
Index: subversion/bindings/swig/INSTALL
===================================================================
--- subversion/bindings/swig/INSTALL    (revision 1869469)
+++ subversion/bindings/swig/INSTALL    (working copy)
@@ -64,15 +64,34 @@
 BUILDING SWIG BINDINGS FOR SVN ON UNIX
 
 
-Step 1:  Install a suitable version of SWIG (which is
-         currently SWIG version 1.3.24 or later).
+Step 1: [Optional] Install a suitable version of SWIG
 
+    * SWIG installation is optional if you are using distribution tarball,
+      because it contains source fils generated by SWIG. If you are using
+      a source working copy checked out from Subversion source repository,
+      or you want to regenerate SWIG language bindings source files from 
+      SWIG source files for some reason, you need suitable version of 
+      SWIG installation.
+
+    * Currently supported SWIG version is 2.0.0 and later, however,
+      - SWIG 1.3.24 and later in 1.3.x may work, but we didn't test on
+        latest our source code.
+      - Python bindings for Python 2 doesn't supported SWIG 4.0.0 and later.
+      - Python 3 support for Python bindings requires SWIG 3.0.10 and later,
+        but SWIG 4.0.0 and later is not supported (yet). 
+      - Ruby bindings doesn't support SWIG 3.0.8.
+      - Make sure language specific supported version of SWIG itself, e.g.
+        - Perl 5.16 and later requires SWIG 2.0.8 and later.
+        - SWIG 3.0.9 has some trouble with Python support.
+         (see https://sourceforge.net/p/swig/news/2016/06/swig-3010-released/)
+
     * Perhaps your distribution packages a suitable version - if it does
       install it, and skip to the last bullet point in this section.
 
     * Go to http://www.swig.org/, download the source tarball, and unpack.
 
-    * In the SWIG-1.3.xx directory, run ./configure.
+    * In the swig-x.y.z, directory, run ./configure (where x.y.z is
+      SWIG version, e.g. 3.0.12).
 
         If you plan to build the Python bindings, and have a system
         with more than one version of Python installed, you may need
@@ -95,13 +114,13 @@
         Run 'make && make install'
 
     * To verify you have SWIG installed correctly, run "swig -version"
-      from the command line. SWIG should report that it is version 1.3.24
-      or newer.
+      from the command line. SWIG should report that it is suitable version
+      mentioned above.
 
 Step 1a: Install py3c library if building Python SWIG bindings.
 
-    * Check your distribution packages first for a suitable version, and if 
found
-      install from there.
+    * Check your distribution packages first for a suitable version, and
+      if found install from there.
 
     * To install from source, download the latest release from
       https://github.com/encukou/py3c.

Reply via email to