From 7612f0391de66b3895edb308f8fe299f107e8f97 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Wed, 21 May 2014 22:48:11 +0900 Subject: [PATCH] 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. --- plugins/python-build/bin/python-build | 12 ++++++++---- plugins/python-build/test/build.bats | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 56834874..99e77429 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -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" diff --git a/plugins/python-build/test/build.bats b/plugins/python-build/test/build.bats index 17e8d539..214b6dfd 100644 --- a/plugins/python-build/test/build.bats +++ b/plugins/python-build/test/build.bats @@ -125,8 +125,8 @@ OUT unstub make assert_build_log <