Skip to content
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
9 changes: 8 additions & 1 deletion c_src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PROJECT := sippet_nif
ERTS_INCLUDE_DIR ?= $(shell erl -noshell -s init stop -eval "io:format(\"~s/erts-~s/include/\", [code:root_dir(), erlang:system_info(version)]).")
ERL_INTERFACE_INCLUDE_DIR ?= $(shell erl -noshell -s init stop -eval "io:format(\"~s\", [code:lib_dir(erl_interface, include)]).")
ERL_INTERFACE_LIB_DIR ?= $(shell erl -noshell -s init stop -eval "io:format(\"~s\", [code:lib_dir(erl_interface, lib)]).")
ERL_ROOT ?= $(shell erl -noshell -s init stop -eval "io:format(\"~s\", [code:root_dir()]).")
ERL_VERSION := $(shell erl -noshell -eval 'io:fwrite("~s\n", [erlang:system_info(otp_release)]).' -s erlang halt)

C_SRC_DIR = $(CURDIR)
Expand Down Expand Up @@ -102,7 +103,13 @@ ifeq ($(shell expr $(ERL_VERSION) \>= 23), 1)
else
LDLIBS += -L $(ERL_INTERFACE_LIB_DIR) -lei -lerl_interface
endif
LDFLAGS += -shared -lstdc++

ifeq ($(PLATFORM),darwin)
LDFLAGS += -bundle -bundle_loader $(ERL_ROOT)/erts-*/bin/beam.smp
else
LDFLAGS += -shared
endif
LDFLAGS += -lstdc++

# Verbosity.

Expand Down