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
eb5b91aa
Commit
eb5b91aa
authored
Jan 31, 2015
by
Steve Dower
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23199: libpython27.a in amd64 release is 32-bit
parent
063d966b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
19 deletions
+18
-19
Tools/msi/msi.py
Tools/msi/msi.py
+18
-19
No files found.
Tools/msi/msi.py
View file @
eb5b91aa
...
@@ -132,34 +132,32 @@ docfile = 'python%s%s%s.chm' % (major, minor, docfile)
...
@@ -132,34 +132,32 @@ docfile = 'python%s%s%s.chm' % (major, minor, docfile)
# Build the mingw import library, libpythonXY.a
# Build the mingw import library, libpythonXY.a
# This requires 'nm' and 'dlltool' executables on your PATH
# This requires 'nm' and 'dlltool' executables on your PATH
def
build_mingw_lib
(
lib_file
,
def_file
,
dll_file
,
mingw_lib
):
def
build_mingw_lib
(
dll_path
,
def_file
,
dll_file
,
mingw_lib
):
warning
=
"WARNING: %s - libpythonXX.a not built"
warning
=
"WARNING: %s - libpythonXX.a not built"
nm
=
find_executable
(
'nm
'
)
gendef
=
find_executable
(
'gendef
'
)
dlltool
=
find_executable
(
'dlltool'
)
dlltool
=
find_executable
(
'dlltool'
)
if
not
nm
or
not
dlltool
:
if
not
gendef
or
not
dlltool
:
print
warning
%
"
nm
and/or dlltool were not found"
print
warning
%
"
gendef
and/or dlltool were not found"
return
False
return
False
nm_command
=
'%s -Cs %s'
%
(
nm
,
lib_file
)
gendef_command
=
'%s - %s'
%
(
gendef
,
dll_path
)
dlltool_command
=
"%s --dllname %s --def %s --output-lib %s"
%
\
dlltool_command
=
"%s --dllname %s --def %s --output-lib %s"
%
\
(
dlltool
,
dll_file
,
def_file
,
mingw_lib
)
(
dlltool
,
dll_file
,
def_file
,
mingw_lib
)
export_match
=
re
.
compile
(
r"^_imp__(.*) in python\
d+
\.dll"
).
match
if
msilib
.
Win64
:
dlltool_command
+=
" -m i386:x86-64"
else
:
dlltool_command
+=
" -m i386"
f
=
open
(
def_file
,
'w'
)
f
=
open
(
def_file
,
'w'
)
print
>>
f
,
"LIBRARY %s"
%
dll_file
gendef_pipe
=
os
.
popen
(
gendef_command
)
print
>>
f
,
"EXPORTS"
for
line
in
gendef_pipe
.
readlines
():
print
>>
f
,
line
nm_pipe
=
os
.
popen
(
nm_command
)
for
line
in
nm_pipe
.
readlines
():
m
=
export_match
(
line
)
if
m
:
print
>>
f
,
m
.
group
(
1
)
f
.
close
()
f
.
close
()
exit
=
nm
_pipe
.
close
()
exit
=
gendef
_pipe
.
close
()
if
exit
:
if
exit
:
print
warning
%
"
nm
did not run successfully"
print
warning
%
"
gendef
did not run successfully"
return
False
return
False
if
os
.
system
(
dlltool_command
)
!=
0
:
if
os
.
system
(
dlltool_command
)
!=
0
:
...
@@ -169,13 +167,11 @@ def build_mingw_lib(lib_file, def_file, dll_file, mingw_lib):
...
@@ -169,13 +167,11 @@ def build_mingw_lib(lib_file, def_file, dll_file, mingw_lib):
return
True
return
True
# Target files (.def and .a) go in PCBuild directory
# Target files (.def and .a) go in PCBuild directory
lib_file
=
os
.
path
.
join
(
srcdir
,
PCBUILD
,
"python%s%s.lib
"
%
(
major
,
minor
))
dll_path
=
os
.
path
.
join
(
srcdir
,
PCBUILD
,
"python%s%s.dll
"
%
(
major
,
minor
))
def_file
=
os
.
path
.
join
(
srcdir
,
PCBUILD
,
"python%s%s.def"
%
(
major
,
minor
))
def_file
=
os
.
path
.
join
(
srcdir
,
PCBUILD
,
"python%s%s.def"
%
(
major
,
minor
))
dll_file
=
"python%s%s.dll"
%
(
major
,
minor
)
dll_file
=
"python%s%s.dll"
%
(
major
,
minor
)
mingw_lib
=
os
.
path
.
join
(
srcdir
,
PCBUILD
,
"libpython%s%s.a"
%
(
major
,
minor
))
mingw_lib
=
os
.
path
.
join
(
srcdir
,
PCBUILD
,
"libpython%s%s.a"
%
(
major
,
minor
))
have_mingw
=
build_mingw_lib
(
lib_file
,
def_file
,
dll_file
,
mingw_lib
)
# Determine the target architecture
# Determine the target architecture
if
os
.
system
(
"nmake /nologo /c /f msisupport.mak"
)
!=
0
:
if
os
.
system
(
"nmake /nologo /c /f msisupport.mak"
)
!=
0
:
raise
RuntimeError
(
"'nmake /f msisupport.mak' failed"
)
raise
RuntimeError
(
"'nmake /f msisupport.mak' failed"
)
...
@@ -183,6 +179,7 @@ dll_path = os.path.join(srcdir, PCBUILD, dll_file)
...
@@ -183,6 +179,7 @@ dll_path = os.path.join(srcdir, PCBUILD, dll_file)
msilib
.
set_arch_from_file
(
dll_path
)
msilib
.
set_arch_from_file
(
dll_path
)
if
msilib
.
pe_type
(
dll_path
)
!=
msilib
.
pe_type
(
"msisupport.dll"
):
if
msilib
.
pe_type
(
dll_path
)
!=
msilib
.
pe_type
(
"msisupport.dll"
):
raise
SystemError
,
"msisupport.dll for incorrect architecture"
raise
SystemError
,
"msisupport.dll for incorrect architecture"
if
msilib
.
Win64
:
if
msilib
.
Win64
:
upgrade_code
=
upgrade_code_64
upgrade_code
=
upgrade_code_64
# Bump the last digit of the code by one, so that 32-bit and 64-bit
# Bump the last digit of the code by one, so that 32-bit and 64-bit
...
@@ -190,6 +187,8 @@ if msilib.Win64:
...
@@ -190,6 +187,8 @@ if msilib.Win64:
digit
=
hex
((
int
(
product_code
[
-
2
],
16
)
+
1
)
%
16
)[
-
1
]
digit
=
hex
((
int
(
product_code
[
-
2
],
16
)
+
1
)
%
16
)[
-
1
]
product_code
=
product_code
[:
-
2
]
+
digit
+
'}'
product_code
=
product_code
[:
-
2
]
+
digit
+
'}'
have_mingw
=
build_mingw_lib
(
dll_path
,
def_file
,
dll_file
,
mingw_lib
)
if
testpackage
:
if
testpackage
:
ext
=
'px'
ext
=
'px'
testprefix
=
'x'
testprefix
=
'x'
...
...
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