Add extra code to configure with --with-openssl which is supported by CPython 3.7+

This commit is contained in:
Yamashita, Yuu 2019-04-08 08:21:36 +00:00
parent 0708c6c968
commit 6d279501b5

View file

@ -1502,9 +1502,15 @@ use_homebrew_openssl() {
local ssldir="$(brew --prefix "${openssl}" || true)" local ssldir="$(brew --prefix "${openssl}" || true)"
if [ -d "$ssldir" ]; then if [ -d "$ssldir" ]; then
echo "python-build: use ${openssl} from homebrew" echo "python-build: use ${openssl} from homebrew"
export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}" if [[ -n "${PYTHON_BUILD_CONFIGURE_WITH_OPENSSL:-}" ]]; then
# configure scriopt of newer CPython versions support `--with-openssl`
# https://bugs.python.org/issue21541
package_option python configure --with-openssl="${ssldir}"
else
export CPPFLAGS="-I$ssldir/include ${CPPFLAGS}" export CPPFLAGS="-I$ssldir/include ${CPPFLAGS}"
export LDFLAGS="-L$ssldir/lib ${LDFLAGS}" export LDFLAGS="-L$ssldir/lib ${LDFLAGS}"
fi
export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}"
return return
fi fi
done done
@ -1519,8 +1525,14 @@ build_package_mac_openssl() {
OPENSSLDIR="${OPENSSLDIR:-$OPENSSL_PREFIX_PATH/ssl}" OPENSSLDIR="${OPENSSLDIR:-$OPENSSL_PREFIX_PATH/ssl}"
# Tell Python to use this openssl for its extension. # Tell Python to use this openssl for its extension.
if [[ -n "${PYTHON_BUILD_CONFIGURE_WITH_OPENSSL:-}" ]]; then
# configure scriopt of newer CPython versions support `--with-openssl`
# https://bugs.python.org/issue21541
package_option python configure --with-openssl="${OPENSSL_PREFIX_PATH}"
else
export CPPFLAGS="-I${OPENSSL_PREFIX_PATH}/include ${CPPFLAGS}" export CPPFLAGS="-I${OPENSSL_PREFIX_PATH}/include ${CPPFLAGS}"
export LDFLAGS="-L${OPENSSL_PREFIX_PATH}/lib ${LDFLAGS}" export LDFLAGS="-L${OPENSSL_PREFIX_PATH}/lib ${LDFLAGS}"
fi
# Make sure pkg-config finds our build first. # Make sure pkg-config finds our build first.
export PKG_CONFIG_PATH="${OPENSSL_PREFIX_PATH}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" export PKG_CONFIG_PATH="${OPENSSL_PREFIX_PATH}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"