diff --git a/CHANGELOG.md b/CHANGELOG.md index f0f86d3..1040bb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ### Changelog: +#### v2.0.8 + +- Improve build scripts + #### v2.0.7 - Fix compilation error under elixir 1.13 diff --git a/README.MD b/README.MD index 408ee3e..cdf3650 100644 --- a/README.MD +++ b/README.MD @@ -1,6 +1,6 @@ # erlkaf [![Build Status](https://travis-ci.com/silviucpp/erlkaf.svg?branch=master)](https://travis-ci.com/github/silviucpp/erlkaf) -![GitHub](https://img.shields.io/github/license/silviucpp/erlkaf) +[![GitHub](https://img.shields.io/github/license/silviucpp/erlkaf)](https://github.com/silviucpp/erlkaf/blob/master/LICENSE) [![Hex.pm](https://img.shields.io/hexpm/v/erlkaf)](https://hex.pm/packages/erlkaf) *Erlang kafka driver based on [librdkafka][1]* diff --git a/build_deps.sh b/build_deps.sh index d479141..3a691ef 100755 --- a/build_deps.sh +++ b/build_deps.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash ROOT=$(pwd) -DEPS_LOCATION=deps +DEPS_LOCATION=_build/deps OS=$(uname -s) KERNEL=$(echo $(lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | head -n1 | awk '{print $1;}') | awk '{print $1;}') CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu` @@ -73,7 +73,7 @@ BuildLibrary() esac fail_check ./configure - fail_check make -j $(CPUS) + fail_check make -j $CPUS rm src/*.dylib rm src/*.so diff --git a/c_src/Makefile b/c_src/Makefile index 805c7f2..dd2d838 100644 --- a/c_src/Makefile +++ b/c_src/Makefile @@ -4,8 +4,14 @@ PROJECT_NIF_NAME=erlkaf_nif include nif.mk ifeq ($(UNAME_SYS), darwin) - CXXFLAGS += -I/usr/local/opt/openssl/include - LDFLAGS += -L/usr/local/opt/openssl/lib \ + OPENSSL_ROOT := $(shell brew --prefix openssl@1.1) + LZ4_ROOT := $(shell brew --prefix lz4) + ZSTD_ROOT := $(shell brew --prefix zstd) + + CXXFLAGS += -I$(OPENSSL_ROOT)/include + LDFLAGS += -L$(OPENSSL_ROOT)/lib \ + -L$(LZ4_ROOT)/lib \ + -L$(ZSTD_ROOT)/lib \ -L/usr/local/lib LDFLAGS += -Wl,-U,_enif_alloc \ @@ -64,11 +70,11 @@ ifeq ($(UNAME_SYS), darwin) endif CXXFLAGS += -DNDEBUG \ - -I ../deps/librdkafka/src \ - -I ../deps \ + -I ../_build/deps/librdkafka/src \ + -I ../_build/deps \ -g -Wextra -Werror -Wno-missing-field-initializers -fno-exceptions -fno-rtti -std=c++11 -LDFLAGS += -L ../deps/librdkafka/src \ +LDFLAGS += -L ../_build/deps/librdkafka/src \ -lrdkafka \ -lsasl2 \ -lz \ diff --git a/c_src/nif.mk b/c_src/nif.mk index adfd3fb..d19cf65 100644 --- a/c_src/nif.mk +++ b/c_src/nif.mk @@ -37,9 +37,9 @@ UNAME_SYS = $(shell echo $(UNAME_SYS_ORG) | tr A-Z a-z) ifeq ($(UNAME_SYS), darwin) CC ?= cc - CFLAGS ?= -O3 -std=c99 -arch x86_64 -finline-functions -Wall - CXXFLAGS ?= -O3 -arch x86_64 -Wall - LDFLAGS ?= -arch x86_64 + CFLAGS ?= -O3 -std=c99 -finline-functions -Wall + CXXFLAGS ?= -O3 -Wall + LDFLAGS ?= else ifeq ($(UNAME_SYS), freebsd) CC ?= cc CFLAGS ?= -O3 -std=c99 -finline-functions -Wall diff --git a/src/erlkaf.app.src b/src/erlkaf.app.src index aea24e1..df3cf76 100644 --- a/src/erlkaf.app.src +++ b/src/erlkaf.app.src @@ -2,7 +2,7 @@ {description, "erlkaf - Erlang Kafka library based on librdkafka"}, {licenses, ["MIT"]}, {links,[{"Github","https://github.com/silviucpp/erlkaf"}]}, - {vsn, "2.0.7"}, + {vsn, "2.0.8"}, {registered, []}, {applications, [ kernel,