diff -r 5c8001201f98 -r 966380e1094f jdk/make/common/Program.gmk --- a/jdk/make/common/Program.gmk Tue Sep 11 13:40:59 2012 -0700 +++ b/jdk/make/common/Program.gmk Tue Sep 11 14:18:54 2012 -0700 @@ -91,7 +91,7 @@ LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a ifeq ($(SYSTEM_ZLIB),true) - OTHER_LDLIBS += -lz + OTHER_LDLIBS += $(ZLIB_LIBS) endif endif @@ -126,6 +126,26 @@ endif # +# Applications expect to be able to link against libjawt without invoking +# System.loadLibrary("jawt") first. This was the behaviour described in the +# devloper documentation of JAWT and what worked with OpenJDK6. +# +ifeq ($(PLATFORM), solaris) + ifeq ($(ARCH_DATA_MODEL), 32) + LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH) + LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH) + else # ! ARCH_DATA_MODEL 64-bit + LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH) + LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH) + endif # ARCH_DATA_MODEL +endif # PLATFORM SOLARIS +ifeq ($(PLATFORM), linux) + LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH) + LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH) +endif # PLATFORM LINUX + + +# # Launcher specific files. # FILES_o = $(OBJDIR)/main.$(OBJECT_SUFFIX)