Skip to content

Commit

Permalink
de-duplicate openssl build flags (#284)
Browse files Browse the repository at this point in the history
* de-duplicate openssl build flags

* msvc has no 128-bit type

* export the flag we need

* finish that...
  • Loading branch information
reaperhulk authored May 1, 2020
1 parent 43912af commit 4ed91c8
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-macos-openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ jobs:
- name: Build OpenSSL
run: |
set -x
source ./cryptography-manylinux/openssl-version.sh
mkdir artifact
BASEDIR=$(pwd)
cd openssl*
# Use the brew openssldir so pyopenssl users with homebrew installed will have roots for TLS
# This is obviously not great but we live in an imperfect world.
export CFLAGS="-mmacosx-version-min=10.9 -march=core2"
perl ./Configure --prefix="${BASEDIR}/artifact" --openssldir=/usr/local/etc/[email protected] no-ssl3 no-ssl3-method no-zlib darwin64-x86_64-cc enable-ec_nistp_64_gcc_128 no-shared no-comp no-dynamic-engine
perl ./Configure --prefix="${BASEDIR}/artifact" --openssldir=/usr/local/etc/[email protected] darwin64-x86_64-cc $OPENSSL_BUILD_FLAGS
make -j$(sysctl -n hw.logicalcpu)
make install_sw
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-windows-openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
source ./cryptography-manylinux/openssl-version.sh
echo "::set-env name=OPENSSL_VERSION::$OPENSSL_VERSION"
echo "::set-env name=OPENSSL_SHA256::$OPENSSL_SHA256"
echo "::set-env name=OPENSSL_BUILD_FLAGS_WINDOWS::$OPENSSL_BUILD_FLAGS_WINDOWS"
shell: bash
- name: Download OpenSSL source
run: |
Expand Down
2 changes: 1 addition & 1 deletion cryptography-manylinux/install_openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ check_sha256sum ${OPENSSL_VERSION}.tar.gz ${OPENSSL_SHA256}
tar zxf ${OPENSSL_VERSION}.tar.gz
PATH=/opt/perl/bin:$PATH
pushd ${OPENSSL_VERSION}
./config no-comp enable-ec_nistp_64_gcc_128 no-shared no-dynamic-engine --prefix=/opt/pyca/cryptography/openssl --openssldir=/opt/pyca/cryptography/openssl
./config $OPENSSL_BUILD_FLAGS --prefix=/opt/pyca/cryptography/openssl --openssldir=/opt/pyca/cryptography/openssl
make depend
make -j4
# avoid installing the docs
Expand Down
4 changes: 4 additions & 0 deletions cryptography-manylinux/openssl-version.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
export OPENSSL_VERSION="openssl-1.1.1g"
export OPENSSL_SHA256="ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46"
# We need a base set of flags because on Windows using MSVC
# enable-ec_nistp_64_gcc_128 doesn't work since there's no 128-bit type
export OPENSSL_BUILD_FLAGS_WINDOWS="no-ssl3 no-ssl3-method no-zlib no-shared no-comp no-dynamic-engine"
export OPENSSL_BUILD_FLAGS="${OPENSSL_BUILD_FLAGS_WINDOWS} enable-ec_nistp_64_gcc_128"
2 changes: 1 addition & 1 deletion windows/openssl/build_openssl_win32_2010.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SET PATH=%PATH%;C:\Program Files\NASM;C:\Program Files (x86)\Microsoft SDKs\Wind
SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.1\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.1\INCLUDE\gl;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1\Include
SET LIB=%LIB%;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1\Lib\

perl Configure no-comp no-shared VC-WIN32
perl Configure %OPENSSL_BUILD_FLAGS_WINDOWS% VC-WIN32
nmake
if %errorlevel% neq 0 exit /b %errorlevel%

Expand Down
2 changes: 1 addition & 1 deletion windows/openssl/build_openssl_win32_2019.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\BuildTools\
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86
SET PATH=%PATH%;C:\Program Files\NASM

perl Configure no-comp no-shared VC-WIN32
perl Configure %OPENSSL_BUILD_FLAGS_WINDOWS% VC-WIN32
nmake
if %errorlevel% neq 0 exit /b %errorlevel%

Expand Down
2 changes: 1 addition & 1 deletion windows/openssl/build_openssl_win64_2010.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SET PATH=%PATH%;C:\Program Files\NASM;C:\Program Files (x86)\Microsoft SDKs\Wind
SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.1\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.1\INCLUDE\gl;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1\Include
SET LIB=%LIB%;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1\Lib\x64

perl Configure no-comp no-shared VC-WIN64A
perl Configure %OPENSSL_BUILD_FLAGS_WINDOWS% VC-WIN64A
nmake
if %errorlevel% neq 0 exit /b %errorlevel%

Expand Down
2 changes: 1 addition & 1 deletion windows/openssl/build_openssl_win64_2019.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\BuildTools\
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
SET PATH=%PATH%;C:\Program Files\NASM

perl Configure no-comp no-shared VC-WIN64A
perl Configure %OPENSSL_BUILD_FLAGS_WINDOWS% VC-WIN64A
nmake
if %errorlevel% neq 0 exit /b %errorlevel%

Expand Down

0 comments on commit 4ed91c8

Please sign in to comment.