summaryrefslogtreecommitdiffstats
path: root/test/SWIG/live.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/SWIG/live.py')
-rw-r--r--test/SWIG/live.py32
1 files changed, 7 insertions, 25 deletions
diff --git a/test/SWIG/live.py b/test/SWIG/live.py
index d319af7..5070d8e 100644
--- a/test/SWIG/live.py
+++ b/test/SWIG/live.py
@@ -34,17 +34,6 @@ import sys
import TestSCons
-if sys.platform =='darwin':
- # change to make it work with stock OS X python framework
- # we can't link to static libpython because there isn't one on OS X
- # so we link to a framework version. However, testing must also
- # use the same version, or else you get interpreter errors.
- python = "/System/Library/Frameworks/Python.framework/Versions/Current/bin/python"
- _python_ = '"' + python + '"'
-else:
- python = TestSCons.python
- _python_ = TestSCons._python_
-
# swig-python expects specific filenames.
# the platform specific suffix won't necessarily work.
if sys.platform == 'win32':
@@ -59,29 +48,22 @@ swig = test.where_is('swig')
if not swig:
test.skip_test('Can not find installed "swig", skipping test.\n')
+python = test.get_platform_python()
+_python_ = test.get_quoted_platform_python()
-version = sys.version[:3] # see also sys.prefix documentation
# handle testing on other platforms:
ldmodule_prefix = '_'
-frameworks = ''
-platform_sys_prefix = sys.prefix
-if sys.platform == 'darwin':
- # OS X has a built-in Python but no static libpython
- # so you should link to it using apple's 'framework' scheme.
- # (see top of file for further explanation)
- frameworks = '-framework Python'
- platform_sys_prefix = '/System/Library/Frameworks/Python.framework/Versions/%s/' % version
-
-python_include_dir = os.path.join(platform_sys_prefix,
- 'include',
- 'python' + version)
+python_include_dir = test.get_python_inc()
+
Python_h = os.path.join(python_include_dir, 'Python.h')
if not os.path.exists(Python_h):
test.skip_test('Can not find %s, skipping test.\n' % Python_h)
+
+python_frameworks_flags = test.get_python_frameworks_flags()
test.write("wrapper.py",
"""import os
@@ -96,7 +78,7 @@ foo = Environment(SWIGFLAGS='-python',
CPPPATH='%(python_include_dir)s/',
LDMODULEPREFIX='%(ldmodule_prefix)s',
LDMODULESUFFIX='%(_dll)s',
- FRAMEWORKSFLAGS='%(frameworks)s',
+ FRAMEWORKSFLAGS='%(python_frameworks_flags)s',
)
import sys