fix OS X openjdk and openjdk-src builds

This commit is contained in:
Joel Dice 2010-11-15 20:28:53 -07:00
parent 02bdec6f8c
commit 86188cfc04
7 changed files with 33 additions and 22 deletions

View File

@ -66,7 +66,18 @@ ifneq (,$(filter mingw32 cygwin,$(build-platform)))
path-separator = ; path-separator = ;
endif endif
library-path-variable = LD_LIBRARY_PATH
ifeq ($(build-platform),darwin)
library-path-variable = DYLD_LIBRARY_PATH
endif
ifdef openjdk ifdef openjdk
openjdk-arch = $(arch)
ifeq ($(arch),x86_64)
openjdk-arch = amd64
endif
ifdef openjdk-src ifdef openjdk-src
include openjdk-src.mk include openjdk-src.mk
options := $(options)-openjdk-src options := $(options)-openjdk-src
@ -83,7 +94,8 @@ ifdef openjdk
else else
options := $(options)-openjdk options := $(options)-openjdk
test-executable = $(executable-dynamic) test-executable = $(executable-dynamic)
library-path = LD_LIBRARY_PATH=$(build) library-path = \
$(library-path-variable)=$(build):$(openjdk)/jre/lib/$(openjdk-arch)
javahome = "$$($(native-path) "$(openjdk)/jre")" javahome = "$$($(native-path) "$(openjdk)/jre")"
endif endif
@ -155,8 +167,6 @@ lflags = $(common-lflags) -lpthread -ldl
version-script-flag = -Wl,--version-script=openjdk.ld version-script-flag = -Wl,--version-script=openjdk.ld
jvm-flags = -L$(build) -ljvm
build-system = posix build-system = posix
system = posix system = posix
@ -185,7 +195,6 @@ endif
ifeq ($(platform),darwin) ifeq ($(platform),darwin)
version-script-flag = version-script-flag =
jvm-flags = $(build)/libjvm.jnilib
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src) build-cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src)
build-lflags += -framework CoreFoundation build-lflags += -framework CoreFoundation
lflags = $(common-lflags) -ldl -framework CoreFoundation -framework CoreServices lflags = $(common-lflags) -ldl -framework CoreFoundation -framework CoreServices
@ -194,22 +203,25 @@ ifeq ($(platform),darwin)
endif endif
rdynamic = rdynamic =
strip-all = -S -x strip-all = -S -x
so-suffix = .jnilib so-suffix = .dylib
shared = -dynamiclib shared = -dynamiclib
ifeq ($(arch),powerpc) ifeq ($(arch),powerpc)
openjdk-extra-cflags += -arch ppc
cflags += -arch ppc cflags += -arch ppc
asmflags += -arch ppc asmflags += -arch ppc
lflags += -arch ppc lflags += -arch ppc
endif endif
ifeq ($(arch),i386) ifeq ($(arch),i386)
openjdk-extra-cflags += -arch i386
cflags += -arch i386 cflags += -arch i386
asmflags += -arch i386 asmflags += -arch i386
lflags += -arch i386 lflags += -arch i386
endif endif
ifeq ($(arch),x86_64) ifeq ($(arch),x86_64)
openjdk-extra-cflags += -arch x86_64
cflags += -arch x86_64 cflags += -arch x86_64
asmflags += -arch x86_64 asmflags += -arch x86_64
lflags += -arch x86_64 lflags += -arch x86_64
@ -532,8 +544,8 @@ vg: build
.PHONY: test .PHONY: test
test: build test: build
/bin/sh $(test)/test.sh 2>/dev/null \ $(library-path) /bin/sh $(test)/test.sh 2>/dev/null \
$(build) $(test-executable) $(mode) "$(test-flags)" \ $(test-executable) $(mode) "$(test-flags)" \
$(call class-names,$(test-build),$(test-classes)) $(call class-names,$(test-build),$(test-classes))
.PHONY: tarball .PHONY: tarball
@ -770,7 +782,7 @@ ifdef msvc
-PDB:$(@).pdb -IMPLIB:$(@).lib $(<) -out:$(@) -MANIFESTFILE:$(@).manifest -PDB:$(@).pdb -IMPLIB:$(@).lib $(<) -out:$(@) -MANIFESTFILE:$(@).manifest
$(mt) -manifest $(@).manifest -outputresource:"$(@);1" $(mt) -manifest $(@).manifest -outputresource:"$(@);1"
else else
$(ld) $(<) $(jvm-flags) $(lflags) -o $(@) $(ld) $(<) -L$(build) -ljvm $(lflags) -o $(@)
endif endif
$(strip) $(strip-all) $(@) $(strip) $(strip-all) $(@)

View File

@ -127,6 +127,12 @@ openjdk-cflags = \
-DJDK_BUILD_NUMBER=\"0\" \ -DJDK_BUILD_NUMBER=\"0\" \
-D_GNU_SOURCE -D_GNU_SOURCE
ifeq ($(platform),darwin)
openjdk-cflags += \
-D_LFS_LARGEFILE=1 \
-D_ALLBSD_SOURCE
endif
ifeq ($(platform),windows) ifeq ($(platform),windows)
openjdk-sources += \ openjdk-sources += \
$(openjdk-src)/windows/native/java/io/canonicalize_md.c \ $(openjdk-src)/windows/native/java/io/canonicalize_md.c \

View File

@ -52,9 +52,6 @@
# define EXPORT(x) _##x # define EXPORT(x) _##x
# endif # endif
# define LIBRARY_PREFIX ""
# define LIBRARY_SUFFIX ".dll"
typedef int socklen_t; typedef int socklen_t;
#else // not PLATFORM_WINDOWS #else // not PLATFORM_WINDOWS
@ -78,9 +75,6 @@ typedef int socklen_t;
# define EXPORT(x) x # define EXPORT(x) x
# define LIBRARY_PREFIX "lib"
# define LIBRARY_SUFFIX ".so"
#endif // not PLATFORM_WINDOWS #endif // not PLATFORM_WINDOWS
using namespace vm; using namespace vm;
@ -245,9 +239,9 @@ class MyClasspath : public Classpath {
this->zipLibrary = sb.pointer; this->zipLibrary = sb.pointer;
sb.append(this->libraryPath); sb.append(this->libraryPath);
sb.append("/"); sb.append("/");
sb.append(LIBRARY_PREFIX); sb.append(SO_PREFIX);
sb.append("zip"); sb.append("zip");
sb.append(LIBRARY_SUFFIX); sb.append(SO_SUFFIX);
sb.append('\0'); sb.append('\0');
this->tzMappings = sb.pointer; this->tzMappings = sb.pointer;

View File

@ -132,7 +132,7 @@ typedef uint64_t uintptr_t;
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
# define SO_SUFFIX ".jnilib" # define SO_SUFFIX ".dylib"
#elif defined PLATFORM_WINDOWS #elif defined PLATFORM_WINDOWS
# define SO_SUFFIX ".dll" # define SO_SUFFIX ".dll"
#else #else

View File

@ -719,7 +719,7 @@ class MySystem: public System {
} }
virtual const char* libraryPrefix() { virtual const char* libraryPrefix() {
return "lib"; return SO_PREFIX;
} }
virtual const char* librarySuffix() { virtual const char* librarySuffix() {

View File

@ -716,7 +716,7 @@ class MySystem: public System {
} }
virtual const char* libraryPrefix() { virtual const char* libraryPrefix() {
return ""; return SO_PREFIX;
} }
virtual const char* librarySuffix() { virtual const char* librarySuffix() {

View File

@ -4,7 +4,6 @@ log=build/log.txt
vg="nice valgrind --leak-check=full --num-callers=32 \ vg="nice valgrind --leak-check=full --num-callers=32 \
--freelist-vol=100000000 --error-exitcode=1" --freelist-vol=100000000 --error-exitcode=1"
library_path=${1}; shift
vm=${1}; shift vm=${1}; shift
mode=${1}; shift mode=${1}; shift
flags=${1}; shift flags=${1}; shift
@ -19,10 +18,10 @@ for test in ${tests}; do
case ${mode} in case ${mode} in
debug|debug-fast|fast|small ) debug|debug-fast|fast|small )
LD_LIBRARY_PATH=${library_path} ${vm} ${flags} ${test} >>${log} 2>&1;; ${vm} ${flags} ${test} >>${log} 2>&1;;
stress* ) stress* )
LD_LIBRARY_PATH=${library_path} ${vg} ${vm} ${flags} ${test} \ ${vg} ${vm} ${flags} ${test} \
>>${log} 2>&1;; >>${log} 2>&1;;
* ) * )