jdk/make/common/Program.gmk
changeset 13542 93873f8b6528
parent 13411 224a28370893
child 13599 8c59681645f0
--- a/jdk/make/common/Program.gmk	Mon Aug 13 19:49:04 2012 +0400
+++ b/jdk/make/common/Program.gmk	Tue Aug 14 17:11:11 2012 -0400
@@ -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)