Merge pull request #1302 from ThomasWaldmann/prefer-openssl-1.1

macOS: prefer homebrew openssl 1.1.x over 1.0.x, see #839
This commit is contained in:
Yamashita, Yuu 2019-04-01 10:53:26 +09:00 committed by GitHub
commit b610909314
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1492,15 +1492,20 @@ has_broken_mac_openssl() {
}
use_homebrew_openssl() {
local ssldir="$(brew --prefix openssl 2>/dev/null || true)"
if [ -d "$ssldir" ]; then
echo "python-build: use openssl from homebrew"
export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}"
export CPPFLAGS="-I$ssldir/include ${CPPFLAGS}"
export LDFLAGS="-L$ssldir/lib ${LDFLAGS}"
local ssl11dir="$(brew --prefix openssl@1.1 2>/dev/null || true)"
local ssl10dir="$(brew --prefix openssl 2>/dev/null || true)"
if [ -d "$ssl11dir" ]; then
echo "python-build: use openssl 1.1 from homebrew"
local ssldir=$ssl11dir
elif [ -d "$ssl10dir" ]; then
echo "python-build: use openssl 1.0 from homebrew"
local ssldir=$ssl10dir
else
return 1
fi
export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}"
export CPPFLAGS="-I$ssldir/include ${CPPFLAGS}"
export LDFLAGS="-L$ssldir/lib ${LDFLAGS}"
}
build_package_mac_openssl() {