Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
287128aa
Commit
287128aa
authored
Apr 18, 2010
by
Ronald Oussoren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add check to build-installer.py to ensure that
the right version of Tcl/Tk is available (on OSX) Fixes issue #5651
parent
37805e5c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
Mac/BuildScript/build-installer.py
Mac/BuildScript/build-installer.py
+51
-0
No files found.
Mac/BuildScript/build-installer.py
View file @
287128aa
...
...
@@ -371,6 +371,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.
...
...
@@ -386,6 +403,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
):
...
...
@@ -1072,6 +1121,8 @@ def main():
shutil
.
rmtree
(
WORKDIR
)
os
.
mkdir
(
WORKDIR
)
os
.
environ
[
'LC_ALL'
]
=
'C'
# Then build third-party libraries such as sleepycat DB4.
buildLibraries
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment