From 333b6c59d46e79d6083ff65af0ec5ae5770cfe5d Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 16 Mar 2012 11:01:20 -0600 Subject: [PATCH] fix non-embedded openjdk build on OS X The JRE lib dir for OpenJDK 7 on OS X seems to be just "lib", not e.g. "lib/amd64" by default, so we use that now. Also, the default library compatibility version for libjvm.dylib is 0.0.0, but OpenJDK wants 1.0.0, so we set it explicitly. --- makefile | 12 +++++++++--- src/classpath-openjdk.cpp | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 64429c1725..c0b0d320dc 100755 --- a/makefile +++ b/makefile @@ -113,8 +113,13 @@ ifneq ($(openjdk),) else options := $(options)-openjdk test-executable = $(shell pwd)/$(executable-dynamic) - library-path = \ - $(library-path-variable)=$(build):$(openjdk)/jre/lib/$(openjdk-arch) + ifeq ($(build-platform),darwin) + library-path = \ + $(library-path-variable)=$(build):$(openjdk)/jre/lib + else + library-path = \ + $(library-path-variable)=$(build):$(openjdk)/jre/lib/$(openjdk-arch) + endif javahome = "$$($(native-path) "$(openjdk)/jre")" endif @@ -308,7 +313,8 @@ ifeq ($(platform),darwin) endif version-script-flag = - lflags = $(common-lflags) -ldl -framework CoreFoundation + lflags = $(common-lflags) -ldl -framework CoreFoundation \ + -Wl,-compatibility_version,1.0.0 ifneq ($(arch),arm) lflags += -framework CoreServices -framework SystemConfiguration \ -framework Security diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index 9c6b2e191d..6959abafec 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -410,6 +410,8 @@ class MyClasspath : public Classpath { sb.append(javaHome); #ifdef PLATFORM_WINDOWS sb.append("/bin"); +#elif defined __APPLE__ + sb.append("/lib"); #elif defined ARCH_x86_64 sb.append("/lib/amd64"); #else