Mercurial > cpython-lru_cache-weakref
diff Mac/BuildScript/build-installer.py @ 78222:cd883160ad97
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.
| author | Ned Deily <nad@acm.org> |
|---|---|
| date | Sat, 21 Jul 2012 10:48:09 -0700 |
| parents | d1c93a2ee324 |
| children | f4470babf79b |
line wrap: on
line diff
--- a/Mac/BuildScript/build-installer.py Sat Jul 21 20:32:39 2012 +0300 +++ b/Mac/BuildScript/build-installer.py Sat Jul 21 10:48:09 2012 -0700 @@ -900,19 +900,26 @@ # 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. - 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() + 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() # Add symlinks in /usr/local/bin, using relative links usr_local_bin = os.path.join(rootDir, 'usr', 'local', 'bin')
