add default search paths for dependencies installed via homebrew on ARM macs

This commit is contained in:
Wolfgang Thaller 2021-02-06 15:30:43 +01:00
parent 3236f3cfbf
commit f428918183
2 changed files with 18 additions and 26 deletions

View File

@ -21,7 +21,7 @@ find_package(Boost COMPONENTS wave filesystem system thread regex program_option
# We need Version 3, and Mac OS X still comes with an outdated version (2.3). # We need Version 3, and Mac OS X still comes with an outdated version (2.3).
# So we just add the path where the homebrew package manager installs its # So we just add the path where the homebrew package manager installs its
# "keg-only" version. Shouldn't hurt on Linux. # "keg-only" version. Shouldn't hurt on Linux.
set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} "/usr/local/opt/bison/bin") set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} "/opt/homebrew/opt/bison/bin" "/usr/local/opt/bison/bin")
find_package(BISON 3.0.2) find_package(BISON 3.0.2)
if(NOT Boost_FOUND) if(NOT Boost_FOUND)

View File

@ -209,21 +209,26 @@ if [ $SKIP_THIRDPARTY != true ]; then
fi fi
mkdir -p $PREFIX mkdir -p $PREFIX
# Components needed for targeting 68K: binutils, gcc if [ `uname` = Darwin ]; then
if [ $BUILD_68K != false ]; then
# present-day Mac users are likely to install dependencies # present-day Mac users are likely to install dependencies
# in /usr/local via the homebrew package manager # via the homebrew package manager
export CPPFLAGS="-I/usr/local/include" if [ `uname -m` = arm64 ]; then
export LDFLAGS="-L/usr/local/lib" export CPPFLAGS="-I/opt/homebrew/include"
export LDFLAGS="-L/opt/homebrew/lib"
else
export CPPFLAGS="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"
fi
# or they could be using MacPorts. Default install # or they could be using MacPorts. Default install
# location is /opt/local # location is /opt/local
if [ -d "/opt/local/include" ]; then if [ -d "/opt/local/include" ]; then
export CPPFLAGS="$CPPFLAGS -I/opt/local/include" export CPPFLAGS="$CPPFLAGS -I/opt/local/include"
export LDFLAGS="$LDFLAGS -L/opt/local/lib" export LDFLAGS="$LDFLAGS -L/opt/local/lib"
fi fi
fi
# Components needed for targeting 68K: binutils, gcc
if [ $BUILD_68K != false ]; then
export CC=$HOST_C_COMPILER export CC=$HOST_C_COMPILER
export CXX=$HOST_CXX_COMPILER export CXX=$HOST_CXX_COMPILER
@ -248,8 +253,6 @@ if [ $SKIP_THIRDPARTY != true ]; then
unset target_configargs unset target_configargs
cd .. cd ..
unset CPPFLAGS
unset LDFLAGS
unset CC unset CC
unset CXX unset CXX
@ -269,19 +272,6 @@ if [ $SKIP_THIRDPARTY != true ]; then
# Components needed for targeting PPC (including Carbon): binutils, gcc # Components needed for targeting PPC (including Carbon): binutils, gcc
if [ $BUILD_PPC != false ]; then if [ $BUILD_PPC != false ]; then
# present-day Mac users are likely to install dependencies
# in /usr/local via the homebrew package manager
export CPPFLAGS="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"
# or they could be using MacPorts. Default install
# location is /opt/local
if [ -d "/opt/local/include" ]; then
export CPPFLAGS="$CPPFLAGS -I/opt/local/include"
export LDFLAGS="$LDFLAGS -L/opt/local/lib"
fi
export CC=$HOST_C_COMPILER export CC=$HOST_C_COMPILER
export CXX=$HOST_CXX_COMPILER export CXX=$HOST_CXX_COMPILER
@ -304,8 +294,6 @@ if [ $SKIP_THIRDPARTY != true ]; then
unset target_configargs unset target_configargs
cd .. cd ..
unset CPPFLAGS
unset LDFLAGS
unset CC unset CC
unset CXX unset CXX
@ -315,6 +303,10 @@ if [ $SKIP_THIRDPARTY != true ]; then
fi fi
fi fi
unset CPPFLAGS
unset LDFLAGS
# Build hfsutil # Build hfsutil
mkdir -p $PREFIX/lib mkdir -p $PREFIX/lib
mkdir -p $PREFIX/share/man/man1 mkdir -p $PREFIX/share/man/man1