Skip to content

Commit cf5efa3

Browse files
author
Reinier Torenbeek
committed
Initial try to build with OpenSSL 1.1.1d
1 parent c2f86d8 commit cf5efa3

File tree

9 files changed

+71
-1059
lines changed

9 files changed

+71
-1059
lines changed

Modules/posixmodule.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,13 @@ extern __declspec(dllimport) char * __pioinfo[];
575575
int
576576
_PyVerify_fd(int fd)
577577
{
578+
#ifdef _MSC_VER
579+
//a call to _get_osfhandle with invalid fd sets errno to EBADF
580+
if (_get_osfhandle(fd) == INVALID_HANDLE_VALUE)
581+
return 0;
582+
else
583+
return 1;
584+
#else
578585
const int i1 = fd >> IOINFO_L2E;
579586
const int i2 = fd & ((1 << IOINFO_L2E) - 1);
580587

@@ -607,6 +614,7 @@ _PyVerify_fd(int fd)
607614
fail:
608615
errno = EBADF;
609616
return 0;
617+
#endif
610618
}
611619

612620
/* the special case of checking dup2. The target fd must be in a sensible range */

Modules/timemodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static BOOL WINAPI PyCtrlHandler(DWORD dwCtrlType)
5656
static long main_thread;
5757

5858

59-
#if defined(__BORLANDC__)
59+
#if defined(__BORLANDC__) || defined(_MSC_VER)
6060
/* These overrides not needed for Win32 */
6161
#define timezone _timezone
6262
#define tzname _tzname
@@ -805,15 +805,15 @@ inittimezone(PyObject *m) {
805805
*/
806806
#if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__)
807807
tzset();
808-
#ifdef PYOS_OS2
808+
#if defined (PYOS_OS2)
809809
PyModule_AddIntConstant(m, "timezone", _timezone);
810810
#else /* !PYOS_OS2 */
811811
PyModule_AddIntConstant(m, "timezone", timezone);
812812
#endif /* PYOS_OS2 */
813813
#ifdef HAVE_ALTZONE
814814
PyModule_AddIntConstant(m, "altzone", altzone);
815815
#else
816-
#ifdef PYOS_OS2
816+
#if defined (PYOS_OS2)
817817
PyModule_AddIntConstant(m, "altzone", _timezone-3600);
818818
#else /* !PYOS_OS2 */
819819
PyModule_AddIntConstant(m, "altzone", timezone-3600);

PCbuild/_hashlib.vcxproj

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,25 @@
5555
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
5656
<Import Project="pyproject.props" />
5757
</ImportGroup>
58+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
59+
<Import Project="openssl.props" />
60+
</ImportGroup>
61+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
62+
<Import Project="openssl.props" />
63+
</ImportGroup>
64+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
65+
<Import Project="openssl.props" />
66+
</ImportGroup>
67+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
68+
<Import Project="openssl.props" />
69+
</ImportGroup>
5870
<PropertyGroup Label="UserMacros" />
5971
<PropertyGroup>
6072
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
6173
</PropertyGroup>
6274
<ItemDefinitionGroup>
63-
<ClCompile>
64-
<AdditionalIncludeDirectories>$(opensslIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
65-
</ClCompile>
6675
<Link>
67-
<AdditionalDependencies>ws2_32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies)</AdditionalDependencies>
76+
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
6877
</Link>
6978
</ItemDefinitionGroup>
7079
<ItemGroup>
@@ -75,14 +84,6 @@
7584
<Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
7685
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
7786
</ProjectReference>
78-
<ProjectReference Include="ssleay.vcxproj">
79-
<Project>{10615b24-73bf-4efa-93aa-236916321317}</Project>
80-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
81-
</ProjectReference>
82-
<ProjectReference Include="libeay.vcxproj">
83-
<Project>{e5b04cc0-eb4c-42ab-b4dc-18ef95f864b0}</Project>
84-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
85-
</ProjectReference>
8687
</ItemGroup>
8788
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
8889
<ImportGroup Label="ExtensionTargets">

PCbuild/_ssl.vcxproj

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,25 @@
5555
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
5656
<Import Project="pyproject.props" />
5757
</ImportGroup>
58+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
59+
<Import Project="openssl.props" />
60+
</ImportGroup>
61+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
62+
<Import Project="openssl.props" />
63+
</ImportGroup>
64+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
65+
<Import Project="openssl.props" />
66+
</ImportGroup>
67+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
68+
<Import Project="openssl.props" />
69+
</ImportGroup>
5870
<PropertyGroup Label="UserMacros" />
5971
<PropertyGroup>
6072
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
6173
</PropertyGroup>
6274
<ItemDefinitionGroup>
63-
<ClCompile>
64-
<AdditionalIncludeDirectories>$(opensslIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
65-
</ClCompile>
6675
<Link>
67-
<AdditionalDependencies>ws2_32.lib;crypt32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies)</AdditionalDependencies>
76+
<AdditionalDependencies>ws2_32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
6877
</Link>
6978
</ItemDefinitionGroup>
7079
<ItemGroup>
@@ -75,14 +84,6 @@
7584
<Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
7685
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
7786
</ProjectReference>
78-
<ProjectReference Include="libeay.vcxproj">
79-
<Project>{e5b04cc0-eb4c-42ab-b4dc-18ef95f864b0}</Project>
80-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
81-
</ProjectReference>
82-
<ProjectReference Include="ssleay.vcxproj">
83-
<Project>{10615b24-73bf-4efa-93aa-236916321317}</Project>
84-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
85-
</ProjectReference>
8687
<ProjectReference Include="_socket.vcxproj">
8788
<Project>{86937f53-c189-40ef-8ce8-8759d8e7d480}</Project>
8889
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

PCbuild/get_externals.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ rem files in both this dir and PC\VS9.0
4747
set libraries=
4848
set libraries=%libraries% bzip2-1.0.6
4949
if NOT "%IncludeBsddb%"=="false" set libraries=%libraries% bsddb-4.7.25.0
50-
if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-1.0.2t
50+
if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-1.1.1d
5151
set libraries=%libraries% sqlite-3.28.0.0
5252
if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tcl-8.5.19.0
5353
if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tk-8.5.19.0
@@ -61,7 +61,7 @@ for %%e in (%libraries%) do (
6161
git clone --depth 1 https://github.com/%ORG%/cpython-source-deps --branch %%e "%EXTERNALS_DIR%\%%e"
6262
) else (
6363
echo.Fetching %%e...
64-
%PYTHON% "%PCBUILD%\get_external.py" -O %ORG% %%e
64+
%PYTHON% "%PCBUILD%\get_external.py" -O %ORG% -e "%EXTERNALS_DIR%" %%e
6565
)
6666
)
6767

@@ -70,6 +70,7 @@ echo.Fetching external binaries...
7070
set binaries=
7171
set binaries=%binaries%
7272
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% nasm-2.11.06
73+
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1d
7374

7475
for %%b in (%binaries%) do (
7576
if exist "%EXTERNALS_DIR%\%%b" (

0 commit comments

Comments
 (0)