1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-09 20:13:47 -05:00

Don't clober the environment CPPFLAGS and LDFLAGS (refs #168)

Because the variables specified via command-line arguments for the
`./configure` will be favored than one in environment variables,
setting those variables in `PACKAGE_CONFIGURE_OPTS_ARRAY` will hide
existing environment variables.

To avoid the problem, stop using `package_option()` to setup those
variables.
This commit is contained in:
Yamashita Yuu
2014-05-21 22:48:11 +09:00
parent 21f44a130a
commit 7612f0391d
2 changed files with 12 additions and 8 deletions

View File

@@ -1047,7 +1047,8 @@ needs_yaml() {
use_homebrew_yaml() {
local libdir="$(brew --prefix libyaml 2>/dev/null || true)"
if [ -d "$libdir" ]; then
package_option python configure CPPFLAGS="-I$libdir/include" LDFLAGS="-L$libdir/lib"
export CPPFLAGS="-I$libdir/include ${CPPFLAGS}"
export LDFLAGS="-L$libdir/lib ${LDFLAGS}"
else
return 1
fi
@@ -1079,7 +1080,8 @@ use_homebrew_readline() {
if ! configured_with_readline_dir; then
local libdir="$(brew --prefix readline 2>/dev/null || true)"
if [ -d "$libdir" ]; then
package_option python configure CPPFLAGS="-I$libdir/include" LDFLAGS="-L$libdir/lib"
export CPPFLAGS="-I$libdir/include ${CPPFLAGS}"
export LDFLAGS="-L$libdir/lib ${LDFLAGS}"
else
return 1
fi
@@ -1095,7 +1097,8 @@ has_broken_mac_openssl() {
use_homebrew_openssl() {
local ssldir="$(brew --prefix openssl 2>/dev/null || true)"
if [ -d "$ssldir" ]; then
package_option python configure CPPFLAGS="-I$ssldir/include" LDFLAGS="-L$ssldir/lib"
export CPPFLAGS="-I$ssldir/include ${CPPFLAGS}"
export LDFLAGS="-L$ssldir/lib ${LDFLAGS}"
else
return 1
fi
@@ -1109,7 +1112,8 @@ build_package_mac_openssl() {
OPENSSLDIR="${OPENSSLDIR:-$OPENSSL_PREFIX_PATH/ssl}"
# Tell Python to use this openssl for its extension.
package_option python configure CPPFLAGS="-I${OPENSSL_PREFIX_PATH}/include" LDFLAGS="-L${OPENSSL_PREFIX_PATH}/lib"
export CPPFLAGS="-I${OPENSSL_PREFIX_PATH}/include ${CPPFLAGS}"
export LDFLAGS="-L${OPENSSL_PREFIX_PATH}/lib ${LDFLAGS}"
# Hint OpenSSL that we prefer a 64-bit build.
export KERNEL_BITS="64"