mirror of
https://github.com/pyenv/pyenv-doctor.git
synced 2025-12-08 15:31:27 +09:00
Update paths for Homebrew's lib on Apple Silicon (#6)
This commit is contained in:
parent
56871eba3b
commit
b612411ac7
@ -151,12 +151,20 @@ fi
|
||||
|
||||
case "$(uname -s)" in
|
||||
"Darwin" )
|
||||
## ld(1) on Mac OS X searches /usr/lib first of /usr/local/lib.
|
||||
## to override system libraries installed in /usr/lib,
|
||||
## ld(1) on Mac OS X searches /usr/lib first of Homebrew's lib.
|
||||
## to override system libraries installed by Homebrew,
|
||||
## we must explicitly specify the library path in "-L".
|
||||
if command -v brew 1>/dev/null 2>&1; then # Homebrew
|
||||
[ -d "/usr/local/include" ] && export CPPFLAGS="-I/usr/local/include $CPPFLAGS"
|
||||
[ -d "/usr/local/lib" ] && export LDFLAGS="-L/usr/local/lib $LDFLAGS"
|
||||
# According to https://docs.brew.sh/Installation,
|
||||
# "/usr/local" is for Intel binaries,
|
||||
# "/opt/homebrew" for ARM.
|
||||
if [ "$(uname -m)" = arm64 ]; then
|
||||
[ -d "/opt/homebrew/include" ] && export CPPFLAGS="-I/opt/homebrew/include $CPPFLAGS"
|
||||
[ -d "/opt/homebrew/lib" ] && export LDFLAGS="-L/opt/homebrew/lib $LDFLAGS"
|
||||
else
|
||||
[ -d "/usr/local/include" ] && export CPPFLAGS="-I/usr/local/include $CPPFLAGS"
|
||||
[ -d "/usr/local/lib" ] && export LDFLAGS="-L/usr/local/lib $LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user