allow fluidsynth, avcodec, and slirp if Brew is installed at compile time

This commit is contained in:
Jonathan Campbell
2021-06-22 11:15:57 -06:00
parent fecb68dc87
commit 6122a3216a

View File

@@ -53,9 +53,26 @@ export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
export INTERNAL_FREETYPE=1
opts=
# if Brew has installed packages, try to use those too
brew="/opt/homebrew"
if [[ -d "$brew" && -d "$brew/include" && -d "$brew/lib" ]]; then
echo "Brew is installed, I'm going to use it's libraries too"
new=" -I$brew/include"
nld=" -L$brew/lib"
export CFLAGS="$CFLAGS$new"
export LDFLAGS="$LDFLAGS$nld"
export CPPFLAGS="$CPPFLAGS$new"
export CXXFLAGS="$CXXFLAGS$new"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$brew/lib/pkgconfig"
else
opts+=" --disable-avcodec --disable-libfluidsynth --disable-libslirp"
fi
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
./configure --enable-core-inline --enable-debug=heavy --prefix=/usr --disable-libfluidsynth --disable-libslirp --disable-avcodec "$@" || exit 1
./configure --enable-core-inline --enable-debug=heavy --prefix=/usr $opts "$@" || exit 1
make -j3 || exit 1