summaryrefslogtreecommitdiff
path: root/Mac
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-04-18 15:24:17 +0000
committerRonald Oussoren <ronaldoussoren@mac.com>2010-04-18 15:24:17 +0000
commitc45c3d995053edd6ffc899853815443a4c6f8a13 (patch)
treeeb19b8f7e4dfdf4c34801aeac0edbbbd19f8796b /Mac
parent501aeffba3673fdce742054a5e0014dbe3ab40a7 (diff)
downloadcpython-git-c45c3d995053edd6ffc899853815443a4c6f8a13.tar.gz
Merged revisions 80179 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r80179 | ronald.oussoren | 2010-04-18 16:01:05 +0200 (Sun, 18 Apr 2010) | 5 lines Add check to build-installer.py to ensure that the right version of Tcl/Tk is available (on OSX) Fixes issue #5651 ........
Diffstat (limited to 'Mac')
-rwxr-xr-xMac/BuildScript/build-installer.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index 8f58dbbdac..ec7b8c39e3 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -377,6 +377,23 @@ def captureCommand(commandline):
return data
+def getTclTkVersion(configfile, versionline):
+ """
+ search Tcl or Tk configuration file for version line
+ """
+ try:
+ f = open(configfile, "r")
+ except:
+ fatal("Framework configuration file not found: %s" % configfile)
+
+ for l in f:
+ if l.startswith(versionline):
+ f.close()
+ return l
+
+ fatal("Version variable %s not found in framework configuration file: %s"
+ % (versionline, configfile))
+
def checkEnvironment():
"""
Check that we're running on a supported system.
@@ -392,6 +409,38 @@ def checkEnvironment():
fatal("Please install the latest version of Xcode and the %s SDK"%(
os.path.basename(SDKPATH[:-4])))
+ # Because we only support dynamic load of only one major/minor version of
+ # Tcl/Tk, ensure:
+ # 1. there are no user-installed frameworks of Tcl/Tk with version
+ # higher than the Apple-supplied system version
+ # 2. there is a user-installed framework in /Library/Frameworks with the
+ # same version as the system version. This allows users to choose
+ # to install a newer patch level.
+
+ for framework in ['Tcl', 'Tk']:
+ fw = dict(lower=framework.lower(),
+ upper=framework.upper(),
+ cap=framework.capitalize())
+ fwpth = "Library/Frameworks/%(cap)s.framework/%(lower)sConfig.sh" % fw
+ sysfw = os.path.join('/System', fwpth)
+ libfw = os.path.join('/', fwpth)
+ usrfw = os.path.join(os.getenv('HOME'), fwpth)
+ version = "%(upper)s_VERSION" % fw
+ if getTclTkVersion(libfw, version) != getTclTkVersion(sysfw, version):
+ fatal("Version of %s must match %s" % (libfw, sysfw) )
+ if os.path.exists(usrfw):
+ fatal("Please rename %s to avoid possible dynamic load issues."
+ % usrfw)
+
+ # Remove inherited environment variables which might influence build
+ environ_var_prefixes = ['CPATH', 'C_INCLUDE_', 'DYLD_', 'LANG', 'LC_',
+ 'LD_', 'LIBRARY_', 'PATH', 'PYTHON']
+ for ev in list(os.environ):
+ for prefix in environ_var_prefixes:
+ if ev.startswith(prefix) :
+ print "INFO: deleting environment variable %s=%s" % (
+ ev, os.environ[ev])
+ del os.environ[ev]
def parseOptions(args=None):
@@ -1084,6 +1133,8 @@ def main():
shutil.rmtree(WORKDIR)
os.mkdir(WORKDIR)
+ os.environ['LC_ALL'] = 'C'
+
# Then build third-party libraries such as sleepycat DB4.
buildLibraries()