mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-27 03:33:27 -03:00
build: Fix macOS Apple Silicon build with miniupnpc and libnatpmp
The preferred Homebrew prefix for Apple Silicon is /opt/homebrew. Therefore, if we do not use pkg-config to detect packages, we should set the CPPFLAGS and LDFLAGS variables for them explicitly.
This commit is contained in:
parent
1c046bb7ac
commit
2445df4eb3
1 changed files with 27 additions and 0 deletions
27
configure.ac
27
configure.ac
|
@ -699,6 +699,33 @@ case $host in
|
||||||
if $BREW list --versions qt5 >/dev/null; then
|
if $BREW list --versions qt5 >/dev/null; then
|
||||||
export PKG_CONFIG_PATH="$($BREW --prefix qt5 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH"
|
export PKG_CONFIG_PATH="$($BREW --prefix qt5 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
case $host in
|
||||||
|
*aarch64*)
|
||||||
|
dnl The preferred Homebrew prefix for Apple Silicon is /opt/homebrew.
|
||||||
|
dnl Therefore, as we do not use pkg-config to detect miniupnpc and libnatpmp
|
||||||
|
dnl packages, we should set the CPPFLAGS and LDFLAGS variables for them
|
||||||
|
dnl explicitly.
|
||||||
|
if test "x$use_upnp" != xno && $BREW list --versions miniupnpc >/dev/null; then
|
||||||
|
miniupnpc_prefix=$($BREW --prefix miniupnpc 2>/dev/null)
|
||||||
|
if test "x$suppress_external_warnings" != xno; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -isystem $miniupnpc_prefix/include"
|
||||||
|
else
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$miniupnpc_prefix/include"
|
||||||
|
fi
|
||||||
|
LDFLAGS="$LDFLAGS -L$miniupnpc_prefix/lib"
|
||||||
|
fi
|
||||||
|
if test "x$use_natpmp" != xno && $BREW list --versions libnatpmp >/dev/null; then
|
||||||
|
libnatpmp_prefix=$($BREW --prefix libnatpmp 2>/dev/null)
|
||||||
|
if test "x$suppress_external_warnings" != xno; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -isystem $libnatpmp_prefix/include"
|
||||||
|
else
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$libnatpmp_prefix/include"
|
||||||
|
fi
|
||||||
|
LDFLAGS="$LDFLAGS -L$libnatpmp_prefix/lib"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
case $build_os in
|
case $build_os in
|
||||||
|
|
Loading…
Add table
Reference in a new issue