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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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