From 8ca5e9780e577e66dc50976c186c95d18146c23c Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 7 Nov 2010 21:23:25 -0700 Subject: [PATCH] fix OS X build --- makefile | 13 ++++++++++--- src/posix.cpp | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/makefile b/makefile index 1715391afd..fc3d9939c6 100644 --- a/makefile +++ b/makefile @@ -141,6 +141,10 @@ build-lflags = -lz -lpthread -ldl lflags = $(common-lflags) -lpthread -ldl +version-script-flag = -Wl,--version-script=openjdk.ld + +jvm-flags = -L$(build) -ljvm + build-system = posix system = posix @@ -168,7 +172,10 @@ ifeq ($(arch),arm) endif ifeq ($(platform),darwin) + version-script-flag = + jvm-flags = $(build)/libjvm.jnilib build-cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src) + build-lflags += -framework CoreFoundation lflags = $(common-lflags) -ldl -framework CoreFoundation -framework CoreServices ifeq ($(bootimage),true) bootimage-lflags = -Wl,-segprot,__RWX,rwx,rwx @@ -736,8 +743,8 @@ ifdef msvc -IMPLIB:$(build)/$(name).lib -MANIFESTFILE:$(@).manifest $(mt) -manifest $(@).manifest -outputresource:"$(@);2" else - $(ld) $(^) -Wl,--version-script=openjdk.ld \ - $(shared) $(lflags) $(bootimage-lflags) -o $(@) + $(ld) $(^) $(version-script-flag) $(shared) $(lflags) $(bootimage-lflags) \ + -o $(@) endif $(strip) $(strip-all) $(@) @@ -748,7 +755,7 @@ ifdef msvc -PDB:$(@).pdb -IMPLIB:$(@).lib $(<) -out:$(@) -MANIFESTFILE:$(@).manifest $(mt) -manifest $(@).manifest -outputresource:"$(@);1" else - $(ld) $(<) -L$(build) -ljvm $(lflags) -o $(@) + $(ld) $(<) $(jvm-flags) $(lflags) -o $(@) endif $(strip) $(strip-all) $(@) diff --git a/src/posix.cpp b/src/posix.cpp index 1c3e0c6d09..cf7d600bb5 100644 --- a/src/posix.cpp +++ b/src/posix.cpp @@ -8,14 +8,14 @@ There is NO WARRANTY for this software. See license.txt for details. */ +#define __STDC_CONSTANT_MACROS + #ifdef __APPLE__ # include "CoreFoundation/CoreFoundation.h" # undef assert # define _XOPEN_SOURCE #endif -#define __STDC_CONSTANT_MACROS - #include "sys/mman.h" #include "sys/types.h" #include "sys/stat.h"