From 389043873b19443070ff6beb85733c9f7eb5f18b Mon Sep 17 00:00:00 2001 From: bucanero Date: Wed, 22 Sep 2021 09:40:35 -0300 Subject: [PATCH] Support apple M1 (arm64) Clean up --- tools/geohot/Makefile | 6 ++++++ tools/sprxlinker/Makefile | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/geohot/Makefile b/tools/geohot/Makefile index a6e2823e..1a642627 100644 --- a/tools/geohot/Makefile +++ b/tools/geohot/Makefile @@ -40,6 +40,12 @@ ifneq (,$(findstring Darwin,$(UNAME))) CXXFLAGS += -fvisibility=hidden CFLAGS += -I/usr/local/include -I/usr/local/opt/libelf/include/libelf -I/usr/local/opt/openssl/include LDFLAGS += -mmacosx-version-min=$(OSX_MIN) -Wl,-syslibroot,$(SDK) -L/opt/local/lib -L/usr/local/opt/openssl/lib -lgmp -lcrypto -lz + + ifneq (,$(findstring arm,$(shell uname -p))) + CFLAGS += -I/opt/homebrew/include -I/opt/homebrew/opt/libelf/include/libelf -I/opt/homebrew/opt/openssl/include + LDFLAGS += -L/opt/homebrew/lib -L/opt/homebrew/opt/openssl/lib + endif + endif ifneq (,$(findstring BSD,$(UNAME))) diff --git a/tools/sprxlinker/Makefile b/tools/sprxlinker/Makefile index 350c5867..37c53453 100644 --- a/tools/sprxlinker/Makefile +++ b/tools/sprxlinker/Makefile @@ -31,8 +31,9 @@ ifneq (,$(findstring CYGWIN,$(UNAME))) endif ifneq (,$(findstring Darwin,$(UNAME))) - CFLAGS += -I/opt/local/include -I/usr/local/opt/libelf/include/libelf - LDFLAGS += -L/opt/local/lib -lelf + CFLAGS += -I/opt/local/include -I/usr/local/opt/libelf/include/libelf \ + -I/opt/homebrew/include -I/opt/homebrew/opt/libelf/include/libelf + LDFLAGS += -L/opt/local/lib -L/opt/homebrew/lib -lelf OS := Mac endif