summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2012-07-21 17:48:09 (GMT)
committerNed Deily <nad@acm.org>2012-07-21 17:48:09 (GMT)
commita606aef743aee23cf313fd57f99cf29dfc164316 (patch)
treeb89bef83039f3cc3b04d2e5a52cbb705cd775cef /Mac
parent7b31b1a2a405ac7273e90a4110c0b7c79acbeb53 (diff)
downloadcpython-a606aef743aee23cf313fd57f99cf29dfc164316.zip
cpython-a606aef743aee23cf313fd57f99cf29dfc164316.tar.gz
cpython-a606aef743aee23cf313fd57f99cf29dfc164316.tar.bz2
Issue #15188: Modify the OS X build_installer script to remove temporary
build paths from configuration variables cached in _sysconfigdata.py, as is already done for the installed Makefile. This avoids a distuils test case failure in test_ldshared_value.
Diffstat (limited to 'Mac')
-rwxr-xr-xMac/BuildScript/build-installer.py31
1 files changed, 19 insertions, 12 deletions
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index 1a16165..7891b6b 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -900,19 +900,26 @@ def buildPython():
# We added some directories to the search path during the configure
# phase. Remove those because those directories won't be there on
- # the end-users system.
- path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework',
- 'Versions', version, 'lib', 'python%s'%(version,),
- 'config' + config_suffix, 'Makefile')
- fp = open(path, 'r')
- data = fp.read()
- fp.close()
+ # the end-users system. Also remove the directories from _sysconfigdata.py
+ # (added in 3.3) if it exists.
+
+ path_to_lib = os.path.join(rootDir, 'Library', 'Frameworks',
+ 'Python.framework', 'Versions',
+ version, 'lib', 'python%s'%(version,))
+ paths = [os.path.join(path_to_lib, 'config' + config_suffix, 'Makefile'),
+ os.path.join(path_to_lib, '_sysconfigdata.py')]
+ for path in paths:
+ if not os.path.exists(path):
+ continue
+ fp = open(path, 'r')
+ data = fp.read()
+ fp.close()
- data = data.replace('-L%s/libraries/usr/local/lib'%(WORKDIR,), '')
- data = data.replace('-I%s/libraries/usr/local/include'%(WORKDIR,), '')
- fp = open(path, 'w')
- fp.write(data)
- fp.close()
+ data = data.replace('-L%s/libraries/usr/local/lib'%(WORKDIR,), '')
+ data = data.replace('-I%s/libraries/usr/local/include'%(WORKDIR,), '')
+ fp = open(path, 'w')
+ fp.write(data)
+ fp.close()
# Add symlinks in /usr/local/bin, using relative links
usr_local_bin = os.path.join(rootDir, 'usr', 'local', 'bin')