From bbfa0e7c34ee6c9b3b9cf0e2f724e8509509c361 Mon Sep 17 00:00:00 2001 From: Robert de Rooy <17701098+rderooy@users.noreply.github.com> Date: Mon, 17 Apr 2023 19:36:40 +0200 Subject: [PATCH] Fix macos build script --- build | 13 ++++++------- build-debug-g3 | 6 +++--- build-debug-g3-sdl2 | 8 +++++--- build-debug-sdl2 | 8 ++++---- build-macos | 26 +++++++++++++------------- build-macos-sdl2 | 18 +++++++++--------- build-mingw | 1 - build-mingw-lowend | 2 +- build-mingw-lowend-sdl2 | 9 ++++----- build-sdl2 | 11 +++++------ 10 files changed, 50 insertions(+), 52 deletions(-) diff --git a/build b/build index 1b76841ed..defdc787f 100755 --- a/build +++ b/build @@ -4,15 +4,14 @@ if [ "$1" == "32" ]; then CC="$(which gcc) -m32" CXX="$(which g++) -m32" - export CC - export CXX + export CC CXX shift opt="--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu" fi # Jonathan C dev hack: refer to LNKDOS16 in /usr/src/doslib -doslib= -if [ -d "/usr/src/doslib" ]; then doslib="/usr/src/doslib"; fi +doslib="" +if [ -d /usr/src/doslib ]; then doslib="/usr/src/doslib"; fi if [ -n "${doslib}" ]; then if [ -x "${doslib}/tool/linker/linux-host/lnkdos16" ]; then @@ -29,15 +28,15 @@ fi chmod +x vs/sdl/build-scripts/strip_fPIC.sh # prefer to compile against our own copy of SDL 1.x -echo Compiling our internal SDL 1.x +echo "Compiling our internal SDL 1.x" (cd vs/sdl && ./build-dosbox.sh) || exit 1 # prefer to compile against our own copy of SDLnet 1.x -echo Compiling our internal SDLnet 1.x +echo "Compiling our internal SDLnet 1.x" (cd vs/sdlnet && ./build-dosbox.sh) || exit 1 # now compile ourself -echo Compiling DOSBox-X +echo "Compiling DOSBox-X" chmod +x configure ./configure --enable-debug --prefix=/usr "${@}" "${opt}" || exit 1 make -j3 || exit 1 diff --git a/build-debug-g3 b/build-debug-g3 index 01a7a47eb..c0ff1b7f3 100755 --- a/build-debug-g3 +++ b/build-debug-g3 @@ -23,15 +23,15 @@ CXXFLAGS="${CXXFLAGS} -g3 -O0 -fno-inline -fno-omit-frame-pointer" export CFLAGS CXXFLAGS # prefer to compile against our own copy of SDL 1.x -echo Compiling our internal SDL 1.x +echo "Compiling our internal SDL 1.x" (cd vs/sdl && ./build-dosbox.sh) || exit 1 # prefer to compile against our own copy of SDLnet 1.x -echo Compiling our internal SDLnet 1.x +echo "Compiling our internal SDLnet 1.x" (cd vs/sdlnet && ./build-dosbox.sh) || exit 1 # now compile ourself -echo Compiling DOSBox-X +echo "Compiling DOSBox-X" # NTS: --disable-dynamic-core is needed. the dynamic core doesn't work properly with the CFLAGS given above ./configure --enable-debug=heavy --prefix=/usr --disable-dynamic-core "${@}" || exit 1 make -j3 || exit 1 diff --git a/build-debug-g3-sdl2 b/build-debug-g3-sdl2 index 2c8cf65bd..8f4458d59 100755 --- a/build-debug-g3-sdl2 +++ b/build-debug-g3-sdl2 @@ -24,19 +24,21 @@ export CFLAGS CXXFLAGS # prefer to compile against our own copy of SDL 2.x IF the system does not provide one if [[ "${no_host_sdl2}" ]]; then - x= # doesn't work well cross-compiling + x="" # doesn't work well cross-compiling else x=$(which sdl2-config) fi if test -z "${x}" ; then - echo Compiling our internal SDL 2.x + echo "Compiling our internal SDL 2.x" (cd vs/sdl2 && ./build-dosbox.sh) || exit 1 fi # prefer to compile against our own copy of SDLnet 1.x -echo Compiling our internal SDLnet 1.x +echo "Compiling our internal SDLnet 1.x" (cd vs/sdlnet && ./build-dosbox.sh) || exit 1 +# now compile ourself +echo "Compiling DOSBox-X" # NTS: --disable-dynamic-core is needed. the dynamic core doesn't work properly with the CFLAGS given above ./configure --enable-debug=heavy --prefix=/usr --disable-dynamic-core --enable-sdl2 "${@}" || exit 1 make -j3 || exit 1 diff --git a/build-debug-sdl2 b/build-debug-sdl2 index f0bae7ab1..803ee99a9 100755 --- a/build-debug-sdl2 +++ b/build-debug-sdl2 @@ -30,9 +30,9 @@ chmod +x vs/sdl/build-scripts/strip_fPIC.sh # prefer to compile against our own copy of SDL 2.x IF the system does not provide one if [[ "$no_host_sdl2" ]]; then - x= # doesn't work well cross-compiling + x="" # doesn't work well cross-compiling else - x=$(which sdl2-config) + x="$(which sdl2-config)" fi if test -z "${x}" ; then echo "Compiling our internal SDL 2.x" @@ -40,8 +40,8 @@ if test -z "${x}" ; then fi # prefer to compile against our own copy of SDLnet 1.x -echo "Compiling our internal SDLnet 1.x" -(cd vs/sdlnet && ./build-dosbox.sh) || exit 1 +#echo "Compiling our internal SDLnet 1.x" +#(cd vs/sdlnet && ./build-dosbox.sh) || exit 1 # now compile ourself echo "Compiling DOSBox-X" diff --git a/build-macos b/build-macos index 0d87c5070..01c25aa2b 100755 --- a/build-macos +++ b/build-macos @@ -86,8 +86,8 @@ for arch in ${architectures}; do # prefer to compile against our own copy of SDL 1.x echo "Compiling our internal SDL 1.x" (cd vs/sdl && ./build-dosbox.sh) || exit 1 - new=" -I$top/vs/sdl/linux-host/include" - nld=" -L$top/vs/sdl/linux-host/lib" + new="-I${top}/vs/sdl/linux-host/include " + nld="-L${top}/vs/sdl/linux-host/lib " CFLAGS="${CFLAGS}${new}" LDFLAGS="${LDFLAGS}${nld}" CPPFLAGS="${CPPFLAGS}${new}" @@ -101,8 +101,8 @@ for arch in ${architectures}; do # prefer to compile against our own zlib echo "Compiling our internal zlib" (cd vs/zlib && ./build-dosbox.sh) || exit 1 - new=" -I$top/vs/zlib/linux-host/include" - nld=" -L$top/vs/zlib/linux-host/lib" + new="-I${top}/vs/zlib/linux-host/include " + nld="-L${top}/vs/zlib/linux-host/lib " CFLAGS="${CFLAGS}${new}" LDFLAGS="${LDFLAGS}${nld}" CPPFLAGS="${CPPFLAGS}${new}" @@ -112,8 +112,8 @@ for arch in ${architectures}; do # prefer to compile against our own libpng (comment this out to disable) echo "Compiling our internal libpng" (cd vs/libpng && ./build-dosbox.sh) || exit 1 - new=" -I$top/vs/libpng/linux-host/include" - nld=" -L$top/vs/libpng/linux-host/lib" + new="-I${top}/vs/libpng/linux-host/include " + nld="-L${top}/vs/libpng/linux-host/lib " CFLAGS="${CFLAGS}${new}" LDFLAGS="${LDFLAGS}${nld}" CPPFLAGS="${CPPFLAGS}${new}" @@ -121,10 +121,10 @@ for arch in ${architectures}; do export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS # prefer to compile against our own freetype - echo Compiling our internal freetype + echo "Compiling our internal freetype" (cd vs/freetype && ./build-dosbox.sh) || exit 1 - new=" -I$top/vs/freetype/linux-host/include/freetype2" - nld=" -L$top/vs/freetype/linux-host/lib -lfreetype" + new="-I${top}/vs/freetype/linux-host/include/freetype2 " + nld="-L${top}/vs/freetype/linux-host/lib -lfreetype " CFLAGS="${CFLAGS}${new}" LDFLAGS="${LDFLAGS}${nld}" CPPFLAGS="${CPPFLAGS}${new}" @@ -137,13 +137,13 @@ for arch in ${architectures}; do # if Brew has installed packages, try to use those too if [ -n "${!brew_cmd}" ]; then echo "Brew is installed, I'm going to use it's libraries too" - new=" -I$(${!brew_cmd} --prefix)/include" - nld=" -L$(${!brew_cmd} --prefix)/lib" + new="-I$(${!brew_cmd} --prefix)/include " + nld="-L$(${!brew_cmd} --prefix)/lib " CFLAGS="${CFLAGS}${new}" LDFLAGS="${LDFLAGS}${nld}" CPPFLAGS="${CPPFLAGS}${new}" CXXFLAGS="${CXXFLAGS}${new}" - PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(${!brew_cmd} --prefix)/lib/pkgconfig" + PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(${!brew_cmd} --prefix)/lib/pkgconfig" export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS PKG_CONFIG_PATH fi @@ -158,4 +158,4 @@ for arch in ${architectures}; do make -j3 || exit 1 cp src/dosbox-x "src/dosbox-x-${arch}" -done \ No newline at end of file +done diff --git a/build-macos-sdl2 b/build-macos-sdl2 index b237934f4..1492c0d10 100755 --- a/build-macos-sdl2 +++ b/build-macos-sdl2 @@ -87,7 +87,7 @@ for arch in ${architectures}; do LDFLAGS="${LDFLAGS}${nld}" CPPFLAGS="${CPPFLAGS}${new}" CXXFLAGS="${CXXFLAGS}${new}" - export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS + export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS # prefer to compile against our own zlib echo "Compiling our internal zlib" @@ -98,7 +98,7 @@ for arch in ${architectures}; do LDFLAGS="${LDFLAGS}${nld}" CPPFLAGS="${CPPFLAGS}${new}" CXXFLAGS="${CXXFLAGS}${new}" - export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS + export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS # prefer to compile against our own libpng (comment this out to disable) echo "Compiling our internal libpng" @@ -109,7 +109,7 @@ for arch in ${architectures}; do LDFLAGS="${LDFLAGS}${nld}" CPPFLAGS="${CPPFLAGS}${new}" CXXFLAGS="${CXXFLAGS}${new}" - export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS + export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS # prefer to compile against our own freetype echo "Compiling our internal freetype" @@ -121,21 +121,21 @@ for arch in ${architectures}; do CPPFLAGS="${CPPFLAGS}${new}" CXXFLAGS="${CXXFLAGS}${new}" INTERNAL_FREETYPE=1 - export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS INTERNAL_FREETYPE + export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS INTERNAL_FREETYPE opts= # if Brew has installed packages, try to use those too if [ -n "${!brew_cmd}" ]; then echo "Brew is installed, I'm going to use it's libraries too" - new=" -I$(${!brew_cmd} --prefix)/include" - nld=" -L$(${!brew_cmd} --prefix)/lib" + new="-I$(${!brew_cmd} --prefix)/include " + nld="-L$(${!brew_cmd} --prefix)/lib " CFLAGS="${CFLAGS}${new}" LDFLAGS="${LDFLAGS}${nld}" CPPFLAGS="${CPPFLAGS}${new}" CXXFLAGS="${CXXFLAGS}${new}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(${!brew_cmd} --prefix)/lib/pkgconfig" - export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS PKG_CONFIG_PATH + export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS PKG_CONFIG_PATH fi if [ "${universal}" = 1 ]; then @@ -148,5 +148,5 @@ for arch in ${architectures}; do ./configure --enable-debug=heavy --prefix=/usr --enable-sdl2 "${opts}" "${@}" || exit 1 make -j3 || exit 1 - cp src/dosbox-x "src/dosbox-x-{$arch}" -done \ No newline at end of file + cp src/dosbox-x "src/dosbox-x-${arch}" +done diff --git a/build-mingw b/build-mingw index 9ef9470ca..2d02e1c34 100755 --- a/build-mingw +++ b/build-mingw @@ -70,4 +70,3 @@ chmod +x configure # FIXME: I would like MinGW builds to enable the debugger, eventually ./configure --enable-d3d9 --enable-d3d-shaders --disable-libfluidsynth --prefix=/usr "${@}" || exit 1 make -j3 || exit 1 - diff --git a/build-mingw-lowend b/build-mingw-lowend index d851f9e83..efac889cf 100755 --- a/build-mingw-lowend +++ b/build-mingw-lowend @@ -49,7 +49,7 @@ export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS echo "Compiling our internal freetype" (cd vs/freetype && ./build-dosbox.sh) || exit 1 new="-I${top}/vs/freetype/linux-host/include/freetype2 " -nld="-L${top}/vs/freetype/linux-host/lib -lfreetype " +nld="-L${top}/vs/freetype/linux-host/lib -lfreetype" CFLAGS="${new}${CFLAGS}" LDFLAGS="${nld}${LDFLAGS}" CPPFLAGS="${new}${CPPFLAGS}" diff --git a/build-mingw-lowend-sdl2 b/build-mingw-lowend-sdl2 index 972b39f69..f7c92b3ca 100755 --- a/build-mingw-lowend-sdl2 +++ b/build-mingw-lowend-sdl2 @@ -40,8 +40,8 @@ fi # prefer to compile against our own libpng (comment this out to disable) echo "Compiling our internal libpng" (cd vs/libpng && ./build-dosbox.sh) || exit 1 -new="-I$top/vs/libpng/linux-host/include " -nld="-L$top/vs/libpng/linux-host/lib " +new="-I${top}/vs/libpng/linux-host/include " +nld="-L${top}/vs/libpng/linux-host/lib " CFLAGS="${new}${CFLAGS}" LDFLAGS="${nld}${LDFLAGS}" CPPFLAGS="${new}${CPPFLAGS}" @@ -51,8 +51,8 @@ export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS # prefer to compile against our own freetype echo "Compiling our internal freetype" (cd vs/freetype && ./build-dosbox.sh) || exit 1 -new="-I$top/vs/freetype/linux-host/include/freetype2 " -nld="-L$top/vs/freetype/linux-host/lib -lfreetype " +new="-I${top}/vs/freetype/linux-host/include/freetype2 " +nld="-L${top}/vs/freetype/linux-host/lib -lfreetype" CFLAGS="${new}${CFLAGS}" LDFLAGS="${nld}${LDFLAGS}" CPPFLAGS="${new}${CPPFLAGS}" @@ -66,4 +66,3 @@ chmod +x configure # FIXME: I would like MinGW builds to enable the debugger, eventually ./configure --disable-libfluidsynth --disable-libslirp --enable-d3d9 --enable-d3d-shaders --prefix=/usr --enable-sdl2 "${@}" || exit 1 make -j3 || exit 1 - diff --git a/build-sdl2 b/build-sdl2 index d84172bf1..397f98cb4 100755 --- a/build-sdl2 +++ b/build-sdl2 @@ -4,16 +4,15 @@ if [ "$1" == "32" ]; then CC="$(which gcc) -m32" CXX="$(which g++) -m32" - export CC - export CXX + export CC CXX no_host_sdl2=1 shift opt="--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu" fi # Jonathan C dev hack: refer to LNKDOS16 in /usr/src/doslib -doslib= -if [ -d "/usr/src/doslib" ]; then doslib="/usr/src/doslib"; fi +doslib="" +if [ -d /usr/src/doslib ]; then doslib="/usr/src/doslib"; fi if [ -n "${doslib}" ]; then if [ -x "${doslib}/tool/linker/linux-host/lnkdos16" ]; then @@ -31,9 +30,9 @@ chmod +x vs/sdl/build-scripts/strip_fPIC.sh # prefer to compile against our own copy of SDL 2.x IF the system does not provide one if [[ "$no_host_sdl2" ]]; then - x= # doesn't work well cross-compiling + x="" # doesn't work well cross-compiling else - x=$(which sdl2-config) + x="$(which sdl2-config)" fi if test -z "${x}" ; then echo "Compiling our internal SDL 2.x"