mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Add flags for Homebrew into python-config --ldflags
(#2384)
This commit is contained in:
parent
c055ba718b
commit
bc13a87bee
2 changed files with 6 additions and 3 deletions
|
@ -1300,7 +1300,7 @@ require_osx_version() {
|
|||
|
||||
configured_with_package_dir() {
|
||||
local package_var_name="$(capitalize "$1")"
|
||||
shift 1
|
||||
shift 3
|
||||
local PACKAGE_CONFIGURE_OPTS="${package_var_name}_CONFIGURE_OPTS"
|
||||
local PACKAGE_CONFIGURE_OPTS_ARRAY="${package_var_name}_MAKE_OPTS_ARRAY[@]"
|
||||
local arg flag
|
||||
|
@ -1330,7 +1330,10 @@ use_homebrew() {
|
|||
# /usr/local/lib:/usr/lib is the default library search path
|
||||
if [[ -n $brew_prefix && $brew_prefix != "/usr" && $brew_prefix != "/usr/local" ]]; then
|
||||
export CPPFLAGS="${CPPFLAGS:+${CPPFLAGS% } }-I${brew_prefix}/include"
|
||||
export LDFLAGS="${LDFLAGS:+${LDFLAGS% } }-L${brew_prefix}/lib"
|
||||
export LDFLAGS="${LDFLAGS:+${LDFLAGS% } }-L${brew_prefix}/lib -Wl,-rpath,${brew_prefix}/lib"
|
||||
# `python-config` ignores LDFLAGS envvar. Adding to LIBS is the only way to add extra stuff
|
||||
# to `python-config --ldflags` output
|
||||
export LIBS="${LIBS:+${LIBS% } }-L${brew_prefix}/lib -Wl,-rpath,${brew_prefix}/lib"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ DEF
|
|||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -L$BREW_PREFIX/lib"
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib"
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
|
|
Loading…
Reference in a new issue