Skip to content

Commit

Permalink
Initial try to build with OpenSSL 1.1.1d
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinier Torenbeek committed Feb 20, 2020
1 parent c2f86d8 commit cf5efa3
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 1,059 deletions.
8 changes: 8 additions & 0 deletions Modules/posixmodule.c
Expand Up @@ -575,6 +575,13 @@ extern __declspec(dllimport) char * __pioinfo[];
int
_PyVerify_fd(int fd)
{
#ifdef _MSC_VER
//a call to _get_osfhandle with invalid fd sets errno to EBADF
if (_get_osfhandle(fd) == INVALID_HANDLE_VALUE)
return 0;
else
return 1;
#else
const int i1 = fd >> IOINFO_L2E;
const int i2 = fd & ((1 << IOINFO_L2E) - 1);

Expand Down Expand Up @@ -607,6 +614,7 @@ _PyVerify_fd(int fd)
fail:
errno = EBADF;
return 0;
#endif
}

/* the special case of checking dup2. The target fd must be in a sensible range */
Expand Down
6 changes: 3 additions & 3 deletions Modules/timemodule.c
Expand Up @@ -56,7 +56,7 @@ static BOOL WINAPI PyCtrlHandler(DWORD dwCtrlType)
static long main_thread;


#if defined(__BORLANDC__)
#if defined(__BORLANDC__) || defined(_MSC_VER)
/* These overrides not needed for Win32 */
#define timezone _timezone
#define tzname _tzname
Expand Down Expand Up @@ -805,15 +805,15 @@ inittimezone(PyObject *m) {
*/
#if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__)
tzset();
#ifdef PYOS_OS2
#if defined (PYOS_OS2)
PyModule_AddIntConstant(m, "timezone", _timezone);
#else /* !PYOS_OS2 */
PyModule_AddIntConstant(m, "timezone", timezone);
#endif /* PYOS_OS2 */
#ifdef HAVE_ALTZONE
PyModule_AddIntConstant(m, "altzone", altzone);
#else
#ifdef PYOS_OS2
#if defined (PYOS_OS2)
PyModule_AddIntConstant(m, "altzone", _timezone-3600);
#else /* !PYOS_OS2 */
PyModule_AddIntConstant(m, "altzone", timezone-3600);
Expand Down
25 changes: 13 additions & 12 deletions PCbuild/_hashlib.vcxproj
Expand Up @@ -55,16 +55,25 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="pyproject.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="openssl.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(opensslIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -75,14 +84,6 @@
<Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="ssleay.vcxproj">
<Project>{10615b24-73bf-4efa-93aa-236916321317}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="libeay.vcxproj">
<Project>{e5b04cc0-eb4c-42ab-b4dc-18ef95f864b0}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
25 changes: 13 additions & 12 deletions PCbuild/_ssl.vcxproj
Expand Up @@ -55,16 +55,25 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="pyproject.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="openssl.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(opensslIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;crypt32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -75,14 +84,6 @@
<Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="libeay.vcxproj">
<Project>{e5b04cc0-eb4c-42ab-b4dc-18ef95f864b0}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="ssleay.vcxproj">
<Project>{10615b24-73bf-4efa-93aa-236916321317}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="_socket.vcxproj">
<Project>{86937f53-c189-40ef-8ce8-8759d8e7d480}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
Expand Down
5 changes: 3 additions & 2 deletions PCbuild/get_externals.bat
Expand Up @@ -47,7 +47,7 @@ rem files in both this dir and PC\VS9.0
set libraries=
set libraries=%libraries% bzip2-1.0.6
if NOT "%IncludeBsddb%"=="false" set libraries=%libraries% bsddb-4.7.25.0
if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-1.0.2t
if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-1.1.1d
set libraries=%libraries% sqlite-3.28.0.0
if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tcl-8.5.19.0
if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tk-8.5.19.0
Expand All @@ -61,7 +61,7 @@ for %%e in (%libraries%) do (
git clone --depth 1 https://github.com/%ORG%/cpython-source-deps --branch %%e "%EXTERNALS_DIR%\%%e"
) else (
echo.Fetching %%e...
%PYTHON% "%PCBUILD%\get_external.py" -O %ORG% %%e
%PYTHON% "%PCBUILD%\get_external.py" -O %ORG% -e "%EXTERNALS_DIR%" %%e
)
)

Expand All @@ -70,6 +70,7 @@ echo.Fetching external binaries...
set binaries=
set binaries=%binaries%
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% nasm-2.11.06
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1d

for %%b in (%binaries%) do (
if exist "%EXTERNALS_DIR%\%%b" (
Expand Down

0 comments on commit cf5efa3

Please sign in to comment.