Skip to content

Commit 4756c91

Browse files
authored
Add support to arm64 arch (#27)
1 parent 78b935d commit 4756c91

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

c_src/Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ ERL_INTERFACE_LIB_DIR ?= $(shell erl -noshell -eval "io:format(\"~ts\", [code:li
1111

1212
C_SRC_DIR = $(CURDIR)
1313
C_SRC_OUTPUT ?= $(CURDIR)/../priv/$(PROJECT).so
14+
UNAME_ARCH := $(shell uname -m)
1415

1516
# System type and C compiler/flags.
1617

1718
UNAME_SYS := $(shell uname -s)
1819
ifeq ($(UNAME_SYS), Darwin)
20+
ifeq ($(UNAME_ARCH), arm64)
21+
ARCH := arm64
22+
else
23+
ARCH := x86_64
24+
endif
1925
CC ?= cc
20-
CFLAGS ?= -O3 -std=c99 -arch x86_64 -Wall -Wmissing-prototypes
21-
CXXFLAGS ?= -O3 -arch x86_64 -finline-functions -Wall
22-
LDFLAGS ?= -arch x86_64 -flat_namespace -undefined suppress
26+
CFLAGS ?= -O3 -std=c99 -arch $(ARCH) -Wall -Wmissing-prototypes
27+
CXXFLAGS ?= -O3 -arch $(ARCH) -finline-functions -Wall
28+
LDFLAGS ?= -arch $(ARCH) -flat_namespace -undefined suppress
2329
else ifeq ($(UNAME_SYS), FreeBSD)
2430
CC ?= cc
2531
CFLAGS ?= -O3 -std=c99 -Wall -Wmissing-prototypes

0 commit comments

Comments
 (0)