diff --git a/c_src/Makefile b/c_src/Makefile index 71d017f3..e444b00c 100644 --- a/c_src/Makefile +++ b/c_src/Makefile @@ -1,11 +1,11 @@ -LEVELDB_VSN ?= "nhse-develop-3.0" +export LEVELDB_VSN ?= "nhse-develop-3.0" SNAPPY_VSN ?= "1.1.9" BASEDIR = $(shell pwd) -LDFLAGS := $(LDFLAGS) -L$(BASEDIR)/system/lib -LD_LIBRARY_PATH := $(BASEDIR)/system/lib:$(LD_LIBRARY_PATH) -CFLAGS := $(CFLAGS) -I $(BASEDIR)/system/include -I. -I $(BASEDIR)/leveldb/include -fPIC -CXXFLAGS := $(CXXFLAGS) -I $(BASEDIR)/system/include -I. -I $(BASEDIR)/leveldb/include -fPIC +export LDFLAGS := $(LDFLAGS) -L$(BASEDIR)/system/lib +export LD_LIBRARY_PATH := $(BASEDIR)/system/lib:$(LD_LIBRARY_PATH) +export CFLAGS := $(CFLAGS) -I $(BASEDIR)/system/include -I. -I $(BASEDIR)/leveldb/include -fPIC +export CXXFLAGS := $(CXXFLAGS) -I $(BASEDIR)/system/include -I. -I $(BASEDIR)/leveldb/include -fPIC get-deps: if [ ! -r snappy-$(SNAPPY_VSN).tar.gz ]; then \ diff --git a/rebar.config.script b/rebar.config.script index 9e75fbd2..ea286e9b 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -6,7 +6,8 @@ %% actually running. case os:type() of {unix,darwin} -> - Opt = " -mmacosx-version-min=10.8 -stdlib=libc++", + OSXVersion = re:replace(os:cmd("sw_vers -productVersion"), "[\n]", "", [global, {return, list}]), + Opt = " -mmacosx-version-min=" ++ OSXVersion ++ " -stdlib=libc++ -std=c++11", [Mjr|_] = string:tokens(os:cmd("/usr/bin/uname -r"), "."), Major = list_to_integer(Mjr), if