From c5176898b5186e1eddae93aad2b15d401b4a9777 Mon Sep 17 00:00:00 2001 From: Yurii Rashkovskii Date: Sun, 31 Jul 2011 19:58:35 -0700 Subject: [PATCH] Build Erlang driver as a 64 bit or 32 bit binary basing on installed Erlang's word size --- lib/erl/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/erl/Makefile b/lib/erl/Makefile index f507bbe..8f08e50 100644 --- a/lib/erl/Makefile +++ b/lib/erl/Makefile @@ -3,7 +3,14 @@ OS := $(shell uname) CFLAGS := -O3 -Wall -fPIC ifeq ($(OS), Darwin) - LD_FLAGS := -shared -undefined suppress -flat_namespace -m32 + LD_FLAGS := -shared -undefined suppress -flat_namespace + ERLWS:=$(shell erl -noshell -eval "io:format(\"~p\",[erlang:system_info(wordsize)])" -s erlang halt) + + ifeq ($(ERLWS), 4) + LD_FLAGS := $(LD_FLAGS) -m32 + else + LD_FLAGS := $(LD_FLAGS) -m64 + endif else LD_FLAGS := -shared -fPIC endif