From 5ece5a795d2821c2ba3c30a96a7d0626b4b16772 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Tue, 16 Sep 2008 16:29:29 +0000 Subject: [PATCH] Make the framework library path we return on Mac OS X match the framework paths for executables and headers, so tests like test/SWIG/live.py work even if there are multiple Python versions installed with frameworks in different locations. git-svn-id: http://scons.tigris.org/svn/scons/trunk@3432 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- QMTest/TestSCons.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index d3a57d0b..c7332fac 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -958,7 +958,7 @@ print "self._msvs_versions =", str(env['MSVS']['VERSIONS']) framework we link against, or else we get interpreter errors. """ if sys.platform[:6] == 'darwin': - return '/System/Library/Frameworks/Python.framework/Versions/Current/bin/python' + return sys.prefix + '/bin/python' else: global python return python @@ -1012,7 +1012,7 @@ print "self._msvs_versions =", str(env['MSVS']['VERSIONS']) so we must link to it using Apple's 'framework' scheme. """ if sys.platform[:6] == 'darwin': - return '/System/Library/Frameworks/Python.framework/Headers' + return sys.prefix + '/Headers' try: import distutils.sysconfig except ImportError: @@ -1025,15 +1025,16 @@ print "self._msvs_versions =", str(env['MSVS']['VERSIONS']) """ Returns the full path of the Python static library (libpython*.a) """ + if sys.platform[:6] == 'darwin': + # Use the framework version (or try to) since that matches + # the executable and headers we return elsewhere. + python_lib = os.path.join(sys.prefix, 'Python') + if os.path.exists(python_lib): + return python_lib python_version = self.get_python_version() python_lib = os.path.join(sys.prefix, 'lib', 'python%s' % python_version, 'config', 'libpython%s.a' % python_version) - if os.path.exists(python_lib): - return python_lib - # The library usually exists on OS X as above, - # but fall back to the framework layout just in case - python_lib = os.path.join(sys.prefix, 'Python') if os.path.exists(python_lib): return python_lib # We can't find it, so maybe it's in the standard path -- 2.26.2