Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
a09fd6ef
Kaydet (Commit)
a09fd6ef
authored
Agu 16, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Build _hashlib on Windows. Build OpenSSL with masm assembler code.
Fixes #1535502.
üst
604c864f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
50 deletions
+61
-50
NEWS
Misc/NEWS
+3
-0
_ssl.mak
PCbuild/_ssl.mak
+25
-9
_ssl.vcproj
PCbuild/_ssl.vcproj
+3
-0
build_ssl.py
PCbuild/build_ssl.py
+28
-40
msi.py
Tools/msi/msi.py
+2
-1
No files found.
Misc/NEWS
Dosyayı görüntüle @
a09fd6ef
...
...
@@ -127,6 +127,9 @@ Documentation
Build
-----
-
Bug
#
1535502
,
build
_hashlib
on
Windows
,
and
use
masm
assembler
code
in
OpenSSL
.
-
Bug
#
1534738
,
win32
debug
version
of
_msi
should
be
_msi_d
.
pyd
.
-
Bug
#
1530448
,
ctypes
buld
failure
on
Solaris
10
was
fixed
.
...
...
PCbuild/_ssl.mak
Dosyayı görüntüle @
a09fd6ef
!IFDEF DEBUG
MODULE=_ssl
_d.pyd
TEMP
_DIR=x86-temp-debug/_ssl
SUFFIX=
_d.pyd
TEMP
=x86-temp-debug/
CFLAGS=/Od /Zi /MDd /LDd /DDEBUG /D_DEBUG /DWIN32
SSL_LIB_DIR=$(SSL_DIR)/out32.dbg
!ELSE
MODULE=_ssl
.pyd
TEMP
_DIR=x86-temp-release/_ssl
SUFFIX=
.pyd
TEMP
=x86-temp-release/
CFLAGS=/Ox /MD /LD /DWIN32
SSL_LIB_DIR=$(SSL_DIR)/out32
!ENDIF
INCLUDES=-I ../Include -I ../PC -I $(SSL_DIR)/inc32
LIBS=gdi32.lib wsock32.lib user32.lib advapi32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib
SOURCE=../Modules/_ssl.c $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib
SSL_LIBS=gdi32.lib wsock32.lib user32.lib advapi32.lib /LIBPATH:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib
SSL_SOURCE=../Modules/_ssl.c $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib
$(MODULE): $(SOURCE) ../PC/*.h ../Include/*.h
@if not exist "$(TEMP_DIR)/." mkdir "$(TEMP_DIR)"
cl /nologo $(SOURCE) $(CFLAGS) /Fo$(TEMP_DIR)\$*.obj $(INCLUDES) /link /out:$(MODULE) $(LIBS)
HASH_LIBS=gdi32.lib user32.lib advapi32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib
HASH_SOURCE=../Modules/_hashopenssl.c $(SSL_LIB_DIR)/libeay32.lib
all: _ssl$(SUFFIX) _hashlib$(SUFFIX)
# Split compile/link into two steps to better support VSExtComp
_ssl$(SUFFIX): $(SSL_SOURCE) ../PC/*.h ../Include/*.h
@if not exist "$(TEMP)/_ssl/." mkdir "$(TEMP)/_ssl"
cl /nologo $(SSL_SOURCE) $(CFLAGS) /Fo$(TEMP)\_ssl\$*.obj $(INCLUDES)
link /nologo @<<
/dll /out:_ssl$(SUFFIX) $(TEMP)\_ssl\$*.obj $(SSL_LIBS)
<<
_hashlib$(SUFFIX): $(HASH_SOURCE) ../PC/*.h ../Include/*.h
@if not exist "$(TEMP)/_hashlib/." mkdir "$(TEMP)/_hashlib"
cl /nologo /c $(HASH_SOURCE) $(CFLAGS) /Fo$(TEMP)\_hashlib\$*.obj $(INCLUDES)
link /nologo @<<
/dll /out:_hashlib$(SUFFIX) $(HASH_LIBS) $(TEMP)\_hashlib\$*.obj
<<
PCbuild/_ssl.vcproj
Dosyayı görüntüle @
a09fd6ef
...
...
@@ -75,6 +75,9 @@
<File
RelativePath=
"..\Modules\_ssl.c"
>
</File>
<File
RelativePath=
"..\Modules\_hashopenssl.c"
>
</File>
</Files>
<Globals>
</Globals>
...
...
PCbuild/build_ssl.py
Dosyayı görüntüle @
a09fd6ef
# Script for building the _ssl
module
for Windows.
# Script for building the _ssl
and _hashlib modules
for Windows.
# Uses Perl to setup the OpenSSL environment correctly
# and build OpenSSL, then invokes a simple nmake session
# for
_ssl.pyd itself
.
# for
the actual _ssl.pyd and _hashlib.pyd DLLs
.
# THEORETICALLY, you can:
# * Unpack the latest SSL release one level above your main Python source
...
...
@@ -10,8 +10,8 @@
# * Install ActivePerl and ensure it is somewhere on your path.
# * Run this script from the PCBuild directory.
#
# it should configure and build SSL, then build the
ssl Python extension
# without intervention.
# it should configure and build SSL, then build the
_ssl and _hashlib
#
Python extensions
without intervention.
import
os
,
sys
,
re
...
...
@@ -59,7 +59,8 @@ def find_best_ssl_dir(sources):
candidates
=
[]
for
s
in
sources
:
try
:
s
=
os
.
path
.
abspath
(
s
)
# note: do not abspath s; the build will fail if any
# higher up directory name has spaces in it.
fnames
=
os
.
listdir
(
s
)
except
os
.
error
:
fnames
=
[]
...
...
@@ -82,31 +83,9 @@ def find_best_ssl_dir(sources):
print
"Found an SSL directory at '
%
s'"
%
(
best_name
,)
else
:
print
"Could not find an SSL directory in '
%
s'"
%
(
sources
,)
sys
.
stdout
.
flush
()
return
best_name
def
run_32all_py
():
# ms\32all.bat will reconfigure OpenSSL and then try to build
# all outputs (debug/nondebug/dll/lib). So we filter the file
# to exclude any "nmake" commands and then execute.
tempname
=
"ms
\\
32all_py.bat"
in_bat
=
open
(
"ms
\\
32all.bat"
)
temp_bat
=
open
(
tempname
,
"w"
)
while
1
:
cmd
=
in_bat
.
readline
()
print
'cmd'
,
repr
(
cmd
)
if
not
cmd
:
break
if
cmd
.
strip
()[:
5
]
.
lower
()
==
"nmake"
:
continue
temp_bat
.
write
(
cmd
)
in_bat
.
close
()
temp_bat
.
close
()
os
.
system
(
tempname
)
try
:
os
.
remove
(
tempname
)
except
:
pass
def
run_configure
(
configure
,
do_script
):
os
.
system
(
"perl Configure "
+
configure
)
os
.
system
(
do_script
)
...
...
@@ -117,12 +96,14 @@ def main():
arch
=
"x86"
debug
=
False
configure
=
"VC-WIN32"
makefile
=
"32.mak"
do_script
=
"ms
\\
do_masm"
makefile
=
"ms
\\
nt.mak"
elif
sys
.
argv
[
1
]
==
"Debug"
:
arch
=
"x86"
debug
=
True
configure
=
"VC-WIN32"
makefile
=
"d32.mak"
do_script
=
"ms
\\
do_masm"
makefile
=
"ms
\\
d32.mak"
elif
sys
.
argv
[
1
]
==
"ReleaseItanium"
:
arch
=
"ia64"
debug
=
False
...
...
@@ -148,8 +129,9 @@ def main():
sys
.
exit
(
1
)
print
"Found a working perl at '
%
s'"
%
(
perl
,)
sys
.
stdout
.
flush
()
# Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live.
ssl_dir
=
find_best_ssl_dir
((
"..
/
.."
,))
ssl_dir
=
find_best_ssl_dir
((
"..
\\
.."
,))
if
ssl_dir
is
None
:
sys
.
exit
(
1
)
...
...
@@ -159,29 +141,35 @@ def main():
# If the ssl makefiles do not exist, we invoke Perl to generate them.
if
not
os
.
path
.
isfile
(
makefile
):
print
"Creating the makefiles..."
sys
.
stdout
.
flush
()
# Put our working Perl at the front of our path
os
.
environ
[
"PATH"
]
=
os
.
path
.
split
(
perl
)[
0
]
+
\
os
.
environ
[
"PATH"
]
=
os
.
path
.
dirname
(
perl
)
+
\
os
.
pathsep
+
\
os
.
environ
[
"PATH"
]
if
arch
==
"x86"
:
run_32all_py
()
else
:
run_configure
(
configure
,
do_script
)
if
arch
==
"x86"
and
debug
:
# the do_masm script in openssl doesn't generate a debug
# build makefile so we generate it here:
os
.
system
(
"perl util
\
mk1mf.pl debug "
+
configure
+
" >"
+
makefile
)
run_configure
(
configure
,
do_script
)
# Now run make.
print
"Executing nmake over the ssl makefiles..."
rc
=
os
.
system
(
"nmake /nologo -f "
+
makefile
)
sys
.
stdout
.
flush
()
rc
=
os
.
system
(
"nmake /nologo PERL=
\"
%
s
\"
-f
\"
%
s
\"
"
%
(
perl
,
makefile
))
if
rc
:
print
"Executing
d32.mak
failed"
print
"Executing
"
+
makefile
+
"
failed"
print
rc
sys
.
exit
(
rc
)
finally
:
os
.
chdir
(
old_cd
)
# And finally, we can build the _ssl module itself for Python.
defs
=
"SSL_DIR=
%
s
"
%
(
ssl_dir
,)
defs
=
"SSL_DIR=
\"
%
s
\"
"
%
(
ssl_dir
,)
if
debug
:
defs
=
defs
+
" "
+
"DEBUG=1"
rc
=
os
.
system
(
'nmake /nologo -f _ssl.mak '
+
defs
+
" "
+
make_flags
)
makeCommand
=
'nmake /nologo -f _ssl.mak '
+
defs
+
" "
+
make_flags
print
"Executing:"
,
makeCommand
sys
.
stdout
.
flush
()
rc
=
os
.
system
(
makeCommand
)
sys
.
exit
(
rc
)
if
__name__
==
'__main__'
:
...
...
Tools/msi/msi.py
Dosyayı görüntüle @
a09fd6ef
...
...
@@ -89,7 +89,8 @@ extensions = [
'_msi.pyd'
,
'_ctypes.pyd'
,
'_ctypes_test.pyd'
,
'_sqlite3.pyd'
'_sqlite3.pyd'
,
'_hashlib.pyd'
]
# Well-known component UUIDs
...
...
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