diff --git a/start.sh b/start.sh index 8bd6661..c698d81 100755 --- a/start.sh +++ b/start.sh @@ -14,7 +14,6 @@ if [ $? -ne 1 ]; then fi # Setup for Darwin. -HOST_FLAGS="" uname -a | grep Darwin > /dev/null if [ $? -ne 1 ]; then export CC=gcc-11 @@ -25,8 +24,6 @@ if [ $? -ne 1 ]; then alias gcc="gcc-11" alias g++="g++-11" alias sed="gsed" - HOST_FLAGS="-DHOST_DARWIN" - echo Detected host Darwin. fi # Check that the source code is valid. @@ -72,6 +69,6 @@ if [ $? -ne 0 ]; then fi # Compile and run Build. -gcc -o bin/build -g util/build.c -pthread -DPARALLEL_BUILD -D${ES_TARGET-TARGET_X86_64} $HOST_FLAGS \ +gcc -o bin/build -g util/build.c -pthread -DPARALLEL_BUILD -D${ES_TARGET-TARGET_X86_64} \ -Wall -Wextra -Wno-format-security -Wno-format-overflow -Wno-missing-field-initializers -Wno-unused-function -Wno-format-truncation \ && bin/build "$@" diff --git a/util/build.c b/util/build.c index 9a1d110..580e186 100644 --- a/util/build.c +++ b/util/build.c @@ -398,7 +398,7 @@ void Build(int optimise, bool compile) { } #endif -#ifndef HOST_DARWIN +#ifndef __APPLE__ CallSystem("ctags -R " "--exclude=old/* " "--exclude=root/* " @@ -642,7 +642,7 @@ void BuildCrossCompiler() { if (CallSystem("which sed > /dev/null 2>&1")) { printf("Error: Missing sed.\n"); missingPackages = true; } if (CallSystem("which awk > /dev/null 2>&1")) { printf("Error: Missing awk.\n"); missingPackages = true; } -#ifdef HOST_DARWIN +#ifdef __APPLE__ if (CallSystem("gcc -L/opt/homebrew/lib -lmpc 2>&1 | grep -i undefined > /dev/null")) { printf("Error: Missing GNU MPC.\n"); missingLibraries = true; } if (CallSystem("gcc -L/opt/homebrew/lib -lmpfr 2>&1 | grep -i undefined > /dev/null")) { printf("Error: Missing GNU MPFR.\n"); missingLibraries = true; } if (CallSystem("gcc -L/opt/homebrew/lib -lgmp 2>&1 | grep -i undefined > /dev/null")) { printf("Error: Missing GNU GMP.\n"); missingLibraries = true; } @@ -1227,8 +1227,8 @@ void GetSource(const char *parameters, const char *checksum) { free(alternateURL); -#ifdef HOST_DARWIN -#define SHA256SUM "sha256 -a 256" +#ifdef __APPLE__ +#define SHA256SUM "shasum -a 256" #else #define SHA256SUM "sha256sum" #endif