This commit is contained in:
Wengier
2021-06-22 14:52:54 -04:00
3 changed files with 43 additions and 7 deletions

View File

@@ -17,20 +17,18 @@ dosbox-x.app: src/dosbox-x contrib/macos/dosbox.icns
cp -v contrib/fonts/FREECG98.BMP dosbox-x.app/Contents/Resources/freecg98.bmp
cp -v src/dosbox-x dosbox-x.app/Contents/MacOS/DosBox
# this is where it gets ugly
otool -L dosbox-x.app/Contents/MacOS/DosBox | grep -E '/usr/local/lib|/usr/local/opt/ffmpeg/lib' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
otool -L dosbox-x.app/Contents/MacOS/DosBox | grep -E '/usr/local/lib|/usr/local/opt/ffmpeg/lib|/opt/homebrew/' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
dylib=`basename $$Y`; \
cp -v $$Y dosbox-x.app/Contents/MacOS/; \
install_name_tool -change $$Y @executable_path/$$dylib dosbox-x.app/Contents/MacOS/DosBox; \
done
# and the libs too
# and the libs too. NTS: Cannot use install_name_tool anymore to change anything about dylib files because that invalidates code signing of those files
for pass in 1 2 3 4 5; do \
for dolib in dosbox-x.app/Contents/MacOS/*.dylib; do \
otool -L "$$dolib" | grep '/usr/local/lib' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
otool -L "$$dolib" | grep -E '/usr/local/lib|/usr/local/opt/ffmpeg/lib|/opt/homebrew/' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
dylib=`basename $$Y`; \
cp -vn $$Y dosbox-x.app/Contents/MacOS/; \
echo "$$Y"; \
install_name_tool -change $$Y @executable_path/$$dylib "$$dolib"; \
install_name_tool -id @executable_path/$$dylib "$$dolib"; \
done; \
done; \
done

View File

@@ -53,9 +53,30 @@ export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
export INTERNAL_FREETYPE=1
brew list fluid-synth &>/dev/null || brew install fluid-synth
brew list libslirp &>/dev/null || brew install libslirp
brew list pkg-config &>/dev/null || brew install pkg-config
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"
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

View File

@@ -54,9 +54,26 @@ brew list fluid-synth &>/dev/null || brew install fluid-synth
brew list libslirp &>/dev/null || brew install libslirp
brew list pkg-config &>/dev/null || brew install pkg-config
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"
fi
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
./configure --enable-core-inline --enable-debug=heavy --prefix=/usr --enable-sdl2 --disable-avcodec "$@" || exit 1
./configure --enable-core-inline --enable-debug=heavy --prefix=/usr --enable-sdl2 $opts "$@" || exit 1
make -j3 || exit 1