Hi, I made a patch to separate build SWIG bindings for Python 2 and
Python 3 on Unix/Linux.
With this patch:
* configure (and make) variable PYTHON in Makefile is used only for
preparation of build system and running testsuite.
* New configure VARIABLE PYTHON2, PYTHON3 are added for building
py2 and py3 bindings respectively.
* Targets 'swig-py' and '*-swig-py' are used only for Python 3.
* New targets 'swig-py2' and '*-swig-py2' for Python 2 are added.
* Source codes generated by SWIG for Python 2 bindings are
placed under 'subversion/bindings/swig/python2' in source tree.
* SWIG python bindings for py2 are built under
'subversion/bindings/swig/python2' in build tree.
* External support library for SWIG Python 2 bindings libsvn_swig_py is
renamed to libsvn_swig_py2
* Fix 'autogen.sh --release' by passing SWIG_PY_OPTS value for SWIG 3.x
when it executes'make autogen-swig'.
* The 'autogen-swig' target also genarates source code for Python 2
bindings.
Known issues:
* autogen-swig-py, autogen-swig-py2, install-swig-py, install-swig-py2
targets fails when they executed in build tree out of source tree.
(existing, not resolved)
* Two extra symbolic links is required to share source files between
py2 and py3
* 3.0.10 <= SWIG < 4.0.0 is needed to run 'autogen.sh --release' but
not checked the version of 'swig' in command search path.
There is other choice that assign swig-py to py2 and swig-py3 to py3,
but I have no idea which is better. If this one is better, I'll make
a patch for it.
I tested 'make check-swig-py2' and make 'check-swig-py3' on FreeBSD
with PYTHON=python2.7 and PYTHON=python3.7m, and they were passd.
I hope this will help to continue non-positive support for Python 2.
Thanks,
--
Yasuhito FUTATSUKI <futatuki_at_yf.bsdclub.org>/<futatuki_at_poem.co.jp>
Received on 2019-12-10 07:10:52 CET