From 430b5d638d9b6e396564b466b84fdc9e9c73dba0 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sun, 17 Jun 2018 16:01:40 -0700 Subject: [PATCH] fix Mac OS 10.13 build issues Compile out the min/max functions in GBALink.cpp when compiling with clang, clang does not like them because of some sort of changes in the preprocessor. Run the mac builder script with homebrew bash, system bash does not work and dash no longer works. TODO: fix dash compat --- src/gba/GBALink.cpp | 8 ++++++++ tools/builder/core.sh | 1 + tools/osx/builder | 22 +++++++++++----------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/gba/GBALink.cpp b/src/gba/GBALink.cpp index 493da448..560e6927 100644 --- a/src/gba/GBALink.cpp +++ b/src/gba/GBALink.cpp @@ -49,6 +49,12 @@ enum siocnt_lo_32bit { SIO_IRQ_ENABLE = 0x4000 }; +#ifdef __clang__ + +// don't define these min/max functions, they don't compile + +#else + // The usual min/max functions for built-in types. // // template T min( T x, T y ) { return x < y ? x : y; } @@ -80,6 +86,8 @@ BLARGG_DEF_MIN_MAX(double) #undef max #define max blargg_max +#endif // not clang + // Joybus bool gba_joybus_enabled = false; bool gba_joybus_active = false; diff --git a/tools/builder/core.sh b/tools/builder/core.sh index c5663809..5eb94a55 100644 --- a/tools/builder/core.sh +++ b/tools/builder/core.sh @@ -20,6 +20,7 @@ export CXX="\${CXX:-g++}" case "\$CC" in ccache*) + : ;; *) if command -v ccache >/dev/null; then diff --git a/tools/osx/builder b/tools/osx/builder index 7c29a2bd..de0b2617 100755 --- a/tools/osx/builder +++ b/tools/osx/builder @@ -1,17 +1,17 @@ -#!/bin/sh +#!/usr/local/bin/bash set -e -# bash 3 does not work for this code -if [ -z "$IN_DASH" ]; then - if command -v dash >/dev/null; then - export IN_DASH=1 - exec dash "$0" "$@" - else - echo >&2 "please install dash from homebrew or macports to run this script" - exit 1 - fi -fi +## bash 3 does not work for this code +#if [ -z "$IN_DASH" ]; then +# if command -v dash >/dev/null; then +# export IN_DASH=1 +# exec dash "$0" "$@" +# else +# echo >&2 "please install dash from homebrew or macports to run this script" +# exit 1 +# fi +#fi BUILD_ROOT=$HOME/vbam-build-mac