summaryrefslogtreecommitdiffstats
path: root/QMTest/TestSCons.py
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2014-08-21 01:52:38 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2014-08-21 01:52:38 (GMT)
commit678c769bc6189b5b7c301fbecfb37496725f6aee (patch)
tree0b0b37051a29dd48d2fb9c9c49a11182a276a0d9 /QMTest/TestSCons.py
parenta035c43fb34cc888fca250f26f68fc2b03c018ac (diff)
downloadSCons-678c769bc6189b5b7c301fbecfb37496725f6aee.zip
SCons-678c769bc6189b5b7c301fbecfb37496725f6aee.tar.gz
SCons-678c769bc6189b5b7c301fbecfb37496725f6aee.tar.bz2
SWIG: improve tool detection, and update SWIG tests to run on Windows.
The tool detection is improved by checking for swig in env['SWIG'], where it is commonly set, as well as env['ENV']['PATH']. The tests mostly didn't work on Windows. I updated them all. Mostly to build 32-bit extensions when using 32-bit python on Windows, and use .pyd as the python extension on Windows.
Diffstat (limited to 'QMTest/TestSCons.py')
-rw-r--r--QMTest/TestSCons.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index 4b2b5a4..ae6e9c5 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -1129,14 +1129,25 @@ SConscript( sconscript )
self.run(program = python, stdin = """\
import os, sys
try:
- py_ver = 'python%d.%d' % sys.version_info[:2]
+ if sys.platform == 'win32':
+ py_ver = 'python%d%d' % sys.version_info[:2]
+ else:
+ py_ver = 'python%d.%d' % sys.version_info[:2]
except AttributeError:
py_ver = 'python' + sys.version[:3]
-print os.path.join(sys.prefix, 'include', py_ver)
-print os.path.join(sys.prefix, 'lib', py_ver, 'config')
+# print include and lib path
+try:
+ import distutils.sysconfig
+ exec_prefix = distutils.sysconfig.EXEC_PREFIX
+ print distutils.sysconfig.get_python_inc()
+ print os.path.join(exec_prefix, 'libs')
+except:
+ print os.path.join(sys.prefix, 'include', py_ver)
+ print os.path.join(sys.prefix, 'lib', py_ver, 'config')
print py_ver
""")
+ # print "get_platform_python_info(): "+self.stdout()
return [python] + self.stdout().strip().split('\n')
def start(self, *args, **kw):