Merge branch 'master' of https://github.com/swig/swig
Conflicts: CHANGES.current
This commit is contained in:
commit
0a110e5138
28 changed files with 228 additions and 19 deletions
|
|
@ -11,6 +11,13 @@ Version 3.0.3 (in progress)
|
||||||
2014-09-30: oliverb
|
2014-09-30: oliverb
|
||||||
[Javascript] Merge patch #195 by zittix - Fixed JSClassRef declaration not using the static one.
|
[Javascript] Merge patch #195 by zittix - Fixed JSClassRef declaration not using the static one.
|
||||||
|
|
||||||
|
2014-09-30: ianlancetaylor
|
||||||
|
[Go] In configure script, require Go 1.1 or later.
|
||||||
|
|
||||||
|
2014-09-30: wsfulton
|
||||||
|
[Python] Patch #207 - Fix No module error with -relativeimport when using single
|
||||||
|
header file import.
|
||||||
|
|
||||||
2014-09-27: wsfulton
|
2014-09-27: wsfulton
|
||||||
Patch #208 - Initialise newly created array when using array_functions in the
|
Patch #208 - Initialise newly created array when using array_functions in the
|
||||||
carrays.i library (C++ usage).
|
carrays.i library (C++ usage).
|
||||||
|
|
@ -74,7 +81,7 @@ Version 3.0.3 (in progress)
|
||||||
tag so that StyleCop ignores the files.
|
tag so that StyleCop ignores the files.
|
||||||
|
|
||||||
2014-08-04: wsfulton
|
2014-08-04: wsfulton
|
||||||
[Java] Merge patch #198 from Yuval Kashtan - Support for java.nio.ByteBuffer mapping to
|
[Java] Merge patch #198 from Yuval Kashtan - Support for java.nio.ByteBuffer mapping to
|
||||||
unsigned char * in various.i in NIOBUFFER typemaps.
|
unsigned char * in various.i in NIOBUFFER typemaps.
|
||||||
|
|
||||||
2014-07-14: ianlancetaylor
|
2014-07-14: ianlancetaylor
|
||||||
|
|
@ -84,5 +91,5 @@ Version 3.0.3 (in progress)
|
||||||
does not collect pointers passed to C++ code.
|
does not collect pointers passed to C++ code.
|
||||||
|
|
||||||
2014-07-01: wsfulton
|
2014-07-01: wsfulton
|
||||||
Fix SF Bug #1375 - Expansion of the $parentclassname special variable incorrectly contains
|
Fix SF Bug #1375 - Expansion of the $parentclassname special variable incorrectly contains
|
||||||
brackets in the expanded name.
|
brackets in the expanded name.
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ Add the SDK tools and NDK tools to your path and create a directory somewhere fo
|
||||||
<pre>
|
<pre>
|
||||||
$ export PATH=$HOME/android/android-sdk-linux_x86/tools:$HOME/android/android-sdk-linux_x86/platform-tools:$HOME/android/android-ndk-r6b:$PATH
|
$ export PATH=$HOME/android/android-sdk-linux_x86/tools:$HOME/android/android-sdk-linux_x86/platform-tools:$HOME/android/android-ndk-r6b:$PATH
|
||||||
$ mkdir AndroidApps
|
$ mkdir AndroidApps
|
||||||
$ cd AnrdoidApps
|
$ cd AndroidApps
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@ import_packages_subdirs = \
|
||||||
from_init2 \
|
from_init2 \
|
||||||
from_init3 \
|
from_init3 \
|
||||||
relativeimport1 \
|
relativeimport1 \
|
||||||
relativeimport1
|
relativeimport2 \
|
||||||
|
relativeimport3
|
||||||
|
|
||||||
check: build
|
check: build
|
||||||
if test "x$(SRCDIR)" != x; then \
|
if test "x$(SRCDIR)" != x; then \
|
||||||
|
|
|
||||||
25
Examples/python/import_packages/relativeimport3/Makefile
Normal file
25
Examples/python/import_packages/relativeimport3/Makefile
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
TOP = ../../..
|
||||||
|
SWIG = $(realpath $(TOP)/../preinst-swig)
|
||||||
|
SWIGOPT =
|
||||||
|
LIBS =
|
||||||
|
PY3 =
|
||||||
|
|
||||||
|
ifeq (,$(PY3))
|
||||||
|
PKG1DIR = "py2"
|
||||||
|
else
|
||||||
|
PKG1DIR = "py3"
|
||||||
|
endif
|
||||||
|
|
||||||
|
check: build
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run
|
||||||
|
|
||||||
|
build:
|
||||||
|
cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' build
|
||||||
|
|
||||||
|
static:
|
||||||
|
cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' static
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean
|
||||||
|
cd py2 && $(MAKE) clean
|
||||||
|
cd py3 && $(MAKE) clean
|
||||||
22
Examples/python/import_packages/relativeimport3/README
Normal file
22
Examples/python/import_packages/relativeimport3/README
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
This example tests the %import directive and -relativeimport swig option.
|
||||||
|
|
||||||
|
Use 'python runme.py' to run a test.
|
||||||
|
|
||||||
|
Overview:
|
||||||
|
---------
|
||||||
|
|
||||||
|
The example defines 2 different extension modules--each wrapping a separate C++
|
||||||
|
class.
|
||||||
|
|
||||||
|
pyX/pkg2/pkg3/foo.i - Pkg3_Foo class
|
||||||
|
pyX/pkg2/bar.i - Pkg2_Bar class derived from Pkg3_Foo
|
||||||
|
|
||||||
|
The code is processed by swig with -relativeimport flag. The runtime test
|
||||||
|
imports pyX.pkg2.bar module.
|
||||||
|
|
||||||
|
If everything works well, the module pyX.pkg2.bar shall load properly.
|
||||||
|
|
||||||
|
Unix:
|
||||||
|
-----
|
||||||
|
- Run make
|
||||||
|
- Run the test as described above
|
||||||
14
Examples/python/import_packages/relativeimport3/py2/Makefile
Normal file
14
Examples/python/import_packages/relativeimport3/py2/Makefile
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
TOP = ../../../..
|
||||||
|
SWIG = $(realpath $(TOP)/../preinst-swig)
|
||||||
|
SWIGOPT =
|
||||||
|
LIBS =
|
||||||
|
|
||||||
|
build:
|
||||||
|
cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build
|
||||||
|
|
||||||
|
static:
|
||||||
|
cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean
|
||||||
|
cd pkg2 && $(MAKE) clean
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
TOP = ../../../../..
|
||||||
|
SWIG = $(realpath $(TOP)/../preinst-swig)
|
||||||
|
SWIGOPT =
|
||||||
|
LIBS =
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
|
||||||
|
LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp
|
||||||
|
cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build
|
||||||
|
|
||||||
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
|
||||||
|
LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp
|
||||||
|
cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean
|
||||||
|
cd pkg3 && $(MAKE) clean
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
#ifndef PY2_PKG2_BAR_HPP
|
||||||
|
#define PY2_PKG2_BAR_HPP
|
||||||
|
#include "../../py2/pkg2/pkg3/foo.hpp"
|
||||||
|
struct Pkg2_Bar : Pkg3_Foo {};
|
||||||
|
#endif /* PY2_PKG2_BAR_HPP */
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
%module(package="py2.pkg2") bar
|
||||||
|
%{
|
||||||
|
#include "../../py2/pkg2/bar.hpp"
|
||||||
|
%}
|
||||||
|
%import (module="foo", package="py2.pkg2.pkg3") "../../py2/pkg2/pkg3/foo.hpp"
|
||||||
|
%include "../../py2/pkg2/bar.hpp"
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
TOP = ../../../../../..
|
||||||
|
SWIG = $(realpath $(TOP)/../preinst-swig)
|
||||||
|
SWIGOPT =
|
||||||
|
LIBS =
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
|
||||||
|
LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp
|
||||||
|
|
||||||
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
|
||||||
|
LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
#ifndef PY2_PKG2_PKG3_FOO_HPP
|
||||||
|
#define PY2_PKG2_PKG3_FOO_HPP
|
||||||
|
struct Pkg3_Foo {};
|
||||||
|
#endif /* PY2_PKG2_PKG3_FOO_HPP */
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
%module(package="py2.pkg2.pkg3") foo
|
||||||
|
%{
|
||||||
|
#include "../../../py2/pkg2/pkg3/foo.hpp"
|
||||||
|
%}
|
||||||
|
%include "../../../py2/pkg2/pkg3/foo.hpp"
|
||||||
14
Examples/python/import_packages/relativeimport3/py3/Makefile
Normal file
14
Examples/python/import_packages/relativeimport3/py3/Makefile
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
TOP = ../../../..
|
||||||
|
SWIG = $(realpath $(TOP)/../preinst-swig)
|
||||||
|
SWIGOPT =
|
||||||
|
LIBS =
|
||||||
|
|
||||||
|
build:
|
||||||
|
cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build
|
||||||
|
|
||||||
|
static:
|
||||||
|
cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean
|
||||||
|
cd pkg2 && $(MAKE) clean
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
TOP = ../../../../..
|
||||||
|
SWIG = $(realpath $(TOP)/../preinst-swig)
|
||||||
|
SWIGOPT =
|
||||||
|
LIBS =
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
|
||||||
|
LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp
|
||||||
|
cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build
|
||||||
|
|
||||||
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
|
||||||
|
LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp
|
||||||
|
cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean
|
||||||
|
cd pkg3 && $(MAKE) clean
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
#ifndef PY3_PKG2_BAR_HPP
|
||||||
|
#define PY3_PKG2_BAR_HPP
|
||||||
|
#include "../../py3/pkg2/pkg3/foo.hpp"
|
||||||
|
struct Pkg2_Bar : Pkg3_Foo {};
|
||||||
|
#endif /* PY3_PKG2_BAR_HPP */
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
%module(package="py3.pkg2") bar
|
||||||
|
%{
|
||||||
|
#include "../../py3/pkg2/bar.hpp"
|
||||||
|
%}
|
||||||
|
%import (module="foo", package="py3.pkg2.pkg3") "../../py3/pkg2/pkg3/foo.hpp"
|
||||||
|
%include "../../py3/pkg2/bar.hpp"
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
TOP = ../../../../../..
|
||||||
|
SWIG = $(realpath $(TOP)/../preinst-swig)
|
||||||
|
SWIGOPT =
|
||||||
|
LIBS =
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
|
||||||
|
LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp
|
||||||
|
|
||||||
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
|
||||||
|
LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
#ifndef PY3_PKG2_PKG3_FOO_HPP
|
||||||
|
#define PY3_PKG2_PKG3_FOO_HPP
|
||||||
|
struct Pkg3_Foo {};
|
||||||
|
#endif /* PY3_PKG2_PKG3_FOO_HPP */
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
%module(package="py3.pkg2.pkg3") foo
|
||||||
|
%{
|
||||||
|
#include "../../../py3/pkg2/pkg3/foo.hpp"
|
||||||
|
%}
|
||||||
|
%include "../../../py3/pkg2/pkg3/foo.hpp"
|
||||||
9
Examples/python/import_packages/relativeimport3/runme.py
Normal file
9
Examples/python/import_packages/relativeimport3/runme.py
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Test import of modules content from within __init__.py
|
||||||
|
print "Testing %module(package=...) with -relativeimport"
|
||||||
|
import sys
|
||||||
|
if sys.version_info < (3,0):
|
||||||
|
import py2.pkg2.bar
|
||||||
|
print " Finished importing py2.pkg2.bar"
|
||||||
|
else:
|
||||||
|
import py3.pkg2.bar
|
||||||
|
print " Finished importing py3.pkg2.bar"
|
||||||
|
|
@ -1880,6 +1880,7 @@ include_directive: includetype options string BEGINFILE {
|
||||||
Node *nint = new_node("import");
|
Node *nint = new_node("import");
|
||||||
Node *mnode = new_node("module");
|
Node *mnode = new_node("module");
|
||||||
Setattr(mnode,"name", mname);
|
Setattr(mnode,"name", mname);
|
||||||
|
Setattr(mnode,"options",$2);
|
||||||
appendChild(nint,mnode);
|
appendChild(nint,mnode);
|
||||||
Delete(mnode);
|
Delete(mnode);
|
||||||
appendChild(nint,firstChild($$));
|
appendChild(nint,firstChild($$));
|
||||||
|
|
|
||||||
40
configure.ac
40
configure.ac
|
|
@ -2291,14 +2291,21 @@ else
|
||||||
GOVERSIONOPTION=version
|
GOVERSIONOPTION=version
|
||||||
GOC=$(sh -c "$(go env) && echo \$GOCHAR")c
|
GOC=$(sh -c "$(go env) && echo \$GOCHAR")c
|
||||||
go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version //')
|
go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version //')
|
||||||
|
AC_MSG_CHECKING([whether go version is too old])
|
||||||
case $go_version in
|
case $go_version in
|
||||||
go1.0*) GOOPT="-intgosize 32" ;;
|
go1.0*)
|
||||||
*) if test "$GOC" = "6c"; then
|
AC_MSG_RESULT([yes - minimum version is 1.1])
|
||||||
GOOPT="-intgosize 64"
|
GO=
|
||||||
else
|
GOOPT="-intgosize 32"
|
||||||
GOOPT="-intgosize 32"
|
;;
|
||||||
fi
|
*)
|
||||||
;;
|
AC_MSG_RESULT([no])
|
||||||
|
if test "$GOC" = "6c"; then
|
||||||
|
GOOPT="-intgosize 64"
|
||||||
|
else
|
||||||
|
GOOPT="-intgosize 32"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
case $go_version in
|
case $go_version in
|
||||||
go1.0* | go1.1*)
|
go1.0* | go1.1*)
|
||||||
|
|
@ -2315,14 +2322,17 @@ else
|
||||||
GOC=`echo $GO | sed -e 's/g/c/'`
|
GOC=`echo $GO | sed -e 's/g/c/'`
|
||||||
GOVERSIONOPTION=-V
|
GOVERSIONOPTION=-V
|
||||||
AC_MSG_CHECKING([whether Go ($GO) version is too old])
|
AC_MSG_CHECKING([whether Go ($GO) version is too old])
|
||||||
go_version=`$GO $GOVERSIONOPTION 2>/dev/null | sed -e 's/.*version.* \([[0-9]]*\).*/\1/'`
|
AC_MSG_RESULT([yes - minimum version is 1.1])
|
||||||
go_min_version=7077
|
GO=
|
||||||
if test "$go_version" != "" -a "$go_version" -lt $go_min_version; then
|
dnl Old code retained for now in case we implement an option for it.
|
||||||
AC_MSG_RESULT([yes - minimum version is $go_min_version])
|
dnl go_version=`$GO $GOVERSIONOPTION 2>/dev/null | sed -e 's/.*version.* \([[0-9]]*\).*/\1/'`
|
||||||
GO=
|
dnl go_min_version=7077
|
||||||
else
|
dnl if test "$go_version" != "" -a "$go_version" -lt $go_min_version; then
|
||||||
AC_MSG_RESULT([no])
|
dnl AC_MSG_RESULT([yes - minimum version is $go_min_version])
|
||||||
fi
|
dnl GO=
|
||||||
|
dnl else
|
||||||
|
dnl AC_MSG_RESULT([no])
|
||||||
|
dnl fi
|
||||||
GOOPT="-intgosize 32"
|
GOOPT="-intgosize 32"
|
||||||
GO12=false
|
GO12=false
|
||||||
GO13=false
|
GO13=false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue