From 782f7e8feb4a4a8c024bc1129d118797aa5cb5f2 Mon Sep 17 00:00:00 2001 From: Eric Scharff Date: Thu, 25 Oct 2007 08:55:48 -0600 Subject: [PATCH] Fixes build parameters for Mac --- makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 47219923c6..5ab6d6a3b5 100644 --- a/makefile +++ b/makefile @@ -33,6 +33,9 @@ test = test build-cxx = g++ build-cc = gcc +pthread = -pthread +lpthread = -lpthread + cxx = $(build-cxx) cc = $(build-cc) ar = ar @@ -54,11 +57,6 @@ common-cflags = $(warnings) -fno-rtti -fno-exceptions \ -I$(JAVA_HOME)/include -idirafter $(src) -I$(bld) -D__STDC_LIMIT_MACROS \ -DBUILTIN_LIBRARIES=\"natives,tlscontext,scaler\" -cflags = $(common-cflags) -fPIC -fvisibility=hidden \ - -I$(JAVA_HOME)/include/linux -I$(src) -pthread - -lflags = -lpthread -ldl -lm -lz - system = posix asm = x86 @@ -66,6 +64,8 @@ ifeq ($(platform),darwin) rdynamic = thread-cflags = shared = -dynamiclib + pthread = + lpthread = endif ifeq ($(platform),windows) inc = /usr/local/win32/include @@ -84,6 +84,11 @@ ifeq ($(platform),windows) cflags = $(common-cflags) -I$(inc) endif +cflags = $(common-cflags) -fPIC -fvisibility=hidden \ + -I$(JAVA_HOME)/include/linux -I$(src) $(pthread) + +lflags = $(lpthread) -ldl -lm -lz + ifeq ($(mode),debug) cflags += -O0 -g3 endif @@ -275,7 +280,7 @@ endif $(executable): $(archive) @echo "linking $(@)" - $(cc) -Wl,--whole-archive $(^) -Wl,--no-whole-archive \ + $(cc) -Wl,-all_load $(^) \ $(lflags) $(rdynamic) -o $(@) @$(strip) --strip-all $(@) @$(show-size) $(@)