From 8c9420c1f745b030ea2933f84fa301754c242652 Mon Sep 17 00:00:00 2001 From: Paul Halpin Date: Tue, 19 Apr 2022 13:36:15 +0100 Subject: [PATCH 1/2] changed flags to work with any homebrew installation --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6ff86b0607..512ab3b284 100644 --- a/Makefile +++ b/Makefile @@ -117,8 +117,8 @@ ifeq ($(HOST_OS),Darwin) CC := gcc-$(OSX_GCC_VER) CXX := g++-$(OSX_GCC_VER) CPP := cpp-$(OSX_GCC_VER) -P - PLATFORM_CFLAGS := -I /usr/local/include - PLATFORM_LDFLAGS := -L /usr/local/lib + PLATFORM_CFLAGS := -I $(shell brew --prefix)/include + PLATFORM_LDFLAGS := -L $(shell brew --prefix)/lib else $(error No suitable macOS toolchain found, have you installed Homebrew?) endif From 5c70e202243cd1d27ad256c7ff596e29ba00e5e1 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sat, 30 Apr 2022 12:14:47 +0100 Subject: [PATCH 2/2] check for homebrew first --- Makefile | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 512ab3b284..122013da6d 100644 --- a/Makefile +++ b/Makefile @@ -102,23 +102,23 @@ endif # macOS overrides ifeq ($(HOST_OS),Darwin) OSX_BUILD := 1 - # Using MacPorts? - ifeq ($(shell test -d /opt/local/lib && echo y),y) - OSX_GCC_VER = $(shell find /opt/local/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1) - CC := gcc-mp-$(OSX_GCC_VER) - CXX := g++-mp-$(OSX_GCC_VER) - CPP := cpp-mp-$(OSX_GCC_VER) -P - PLATFORM_CFLAGS := -I /opt/local/include - PLATFORM_LDFLAGS := -L /opt/local/lib + # Using Homebrew? + ifeq ($(shell which brew >/dev/null 2>&1 && echo y),y) + OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1) + CC := gcc-$(OSX_GCC_VER) + CXX := g++-$(OSX_GCC_VER) + CPP := cpp-$(OSX_GCC_VER) -P + PLATFORM_CFLAGS := -I $(shell brew --prefix)/include + PLATFORM_LDFLAGS := -L $(shell brew --prefix)/lib else - # Using Homebrew? - ifeq ($(shell which brew >/dev/null 2>&1 && echo y),y) - OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1) - CC := gcc-$(OSX_GCC_VER) - CXX := g++-$(OSX_GCC_VER) - CPP := cpp-$(OSX_GCC_VER) -P - PLATFORM_CFLAGS := -I $(shell brew --prefix)/include - PLATFORM_LDFLAGS := -L $(shell brew --prefix)/lib + # Using MacPorts? + ifeq ($(shell test -d /opt/local/lib && echo y),y) + OSX_GCC_VER = $(shell find /opt/local/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1) + CC := gcc-mp-$(OSX_GCC_VER) + CXX := g++-mp-$(OSX_GCC_VER) + CPP := cpp-mp-$(OSX_GCC_VER) -P + PLATFORM_CFLAGS := -I /opt/local/include + PLATFORM_LDFLAGS := -L /opt/local/lib else $(error No suitable macOS toolchain found, have you installed Homebrew?) endif