From f2c5029218f97390017eaa9761c3e2e47f3d081c Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Sun, 8 Oct 2017 10:40:47 +0200 Subject: [PATCH] On Tiger, automatically apply the -fno-PIE workaround/hack (see previous commit); also, check that --host-c*-compiler options have been specified --- README.md | 5 ++--- build-toolchain.bash | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fdbd21ed8e..ad14019d15 100644 --- a/README.md +++ b/README.md @@ -82,10 +82,9 @@ the build directory. All the commands are in `toolchain/bin`, so you might want to add that to your `PATH`. If you're building this on a PowerMac running Mac OS X 10.4, tell the build script -to use the gcc you've installed via tigerbrew, and set an environment variable to work around -a problem caused by GCC's build system: +to use the gcc you've installed via tigerbrew: - gcc_cv_c_no_fpie=no ../Retro68/build-toolchain.bash --host-cxx-compiler=g++-5 --host-c-compiler=gcc-5 + ../Retro68/build-toolchain.bash --host-cxx-compiler=g++-5 --host-c-compiler=gcc-5 ### Build options and recompiling diff --git a/build-toolchain.bash b/build-toolchain.bash index 85a862a96f..cbbbe6d876 100755 --- a/build-toolchain.bash +++ b/build-toolchain.bash @@ -93,6 +93,7 @@ if [ $BUILD_PPC != false ]; then ARCHS="$ARCHS powerpc" fi + ##################### Sanity checks if [ `pwd -P` == "$SRC" ]; then @@ -124,6 +125,26 @@ if [ $SKIP_THIRDPARTY != false ]; then fi fi +### Running on a Power Mac (tested with 10.4 Tiger) + +if [ "`uname -m`" = "Power Macintosh" ]; then + # The default compiler won't work, + # check whether the compiler has been explictly specified + # on the command line + if [ $SKIP_THIRDPARTY = false ]; then + if [ -z "$HOST_CXX_COMPILER" -o -z "$HOST_C_COMPILER" ]; then + echo "**** Apple's version of GCC on Power Macs is too old." + echo "**** Please explicitly specify the C and C++ compilers" + echo "**** using the --host-c-compiler and --host-cxx-compiler options." + echo "**** You can install a usable compiler using tigerbrew." + exit 1 + fi + fi + + # work around a problem with building gcc-7 with homebrew's gcc-5 + export gcc_cv_c_no_fpie=no +fi + ##################### Locate and check Interfaces & Libraries if [ -d "$SRC/CIncludes" -o -d "$SRC/RIncludes" ]; then