Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Darwin arm64 #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@ ERL_LDFLAGS ?= -L$(ERL_EI_LIBDIR)
CFLAGS ?= -O2 -Wall -Wextra
LDFLAGS += -fPIC -shared -lsodium -lei

ifeq ($(CROSSCOMPILE),)
CFLAGS += -I/usr/local/include/sodium
LDFLAGS += -L/usr/local/lib
BREW_EXISTS := $(shell command -v brew 2> /dev/null)

ifeq ($(shell uname),Darwin)
LDFLAGS += -Wl,-rpath /usr/local/lib -flat_namespace -undefined suppress
ifdef BREW_EXISTS
LOCAL_PATH = $(shell brew --prefix)
else
LDFLAGS += -Wl,-R/usr/local/lib
LOCAL_PATH = /usr/local
endif

CFLAGS += -I$(LOCAL_PATH)/include -I$(LOCAL_PATH)/include/sodium
LDFLAGS += -L$(LOCAL_PATH)/lib

ifeq ($(shell uname),Darwin)
LDFLAGS += -Wl,-rpath $(LOCAL_PATH)/lib -flat_namespace -undefined suppress
else
LDFLAGS += -Wl,-R$(LOCAL_PATH)/lib
endif

SRC=src/salty_nif.c
Expand Down