Skip to content

Commit

Permalink
Fix FreeBSD build
Browse files Browse the repository at this point in the history
  • Loading branch information
saleyn committed Mar 25, 2024
1 parent 77efa0b commit 3fead86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions c_src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ UNAME_SYS := $(shell uname -s | tr 'A-Z' 'a-z')
ifeq ($(CXX),)
CXX := g++
TARGET := $(shell erl -noshell -noinput -eval "io:format("~s\n", [erlang:system_info(system_architecture)]), halt(0).")
SYSROOT := ""
else
TARGET := $(shell $(CXX) -dumpmachine)
SYSROOT := $(shell $(CXX) -print-sysroot)
endif


Expand Down Expand Up @@ -72,6 +70,7 @@ HAVE_FORMAT ?= $(C20_FEATURES)
HAVE_SRCLOC ?= $(C20_FEATURES)

ifeq ($(UNAME_SYS),linux)
SYSROOT := $(shell $(CXX) -print-sysroot)
CXXFLAGS += -mavx2 -DHAVE_SETRESUID -DHAVE_PIPE2 $(X64)
# Check for Linux capability API (Install package: libcap-devel)
ifneq ($(wildcard $(SYSROOT)/usr/include/sys/capability.h),)
Expand Down
8 changes: 4 additions & 4 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
]}.

{pre_hooks, [
{"freebsd", compile, "gmake -C c_src"},
{ compile, "make -C c_src"}
{"(freebsd|netbsd|openbsd)", compile, "gmake -C c_src"},
{"(linux|darwin|solaris)", compile, "make -C c_src"}
]}.
{post_hooks, [
{"freebsd", clean, "gmake -C c_src clean"},
{ clean, "make -C c_src clean"}
{"(freebsd|netbsd|openbsd)", clean, "gmake -C c_src clean"},
{"(linux|darwin|solaris)", clean, "make -C c_src clean"}
]}.

{plugins, [rebar3_hex, rebar3_ex_doc]}.
Expand Down

0 comments on commit 3fead86

Please sign in to comment.