changeset 1775:e8bba2ae9acc

. Merge in changes from BSD repository.
author glewis@misty.eyesbeyond.com
date Sun, 18 Oct 2009 09:49:44 -0700
parents 466b3f1889b0 938129c1ba84
children f9fc2a322300
files
diffstat 5 files changed, 50 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/shared/Platform.gmk	Sun Oct 18 09:46:32 2009 -0700
+++ b/make/common/shared/Platform.gmk	Sun Oct 18 09:49:44 2009 -0700
@@ -472,13 +472,6 @@
 #    system swapping during the build.
 #    If we don't know, assume 512. Subtract 128 from MB for VM MAX.
 #    Don't set VM max over 1024-128=896.
-#    736 is the max.
-ifeq ($(OS_VENDOR), OpenBSD)
-  ABS_MAX_MEMORY := "736"
-else
-  ABS_MAX_MEMORY := "896"
-endif
-
 ifeq ($(JDK_HAS_MEM_INFO),)
   JDK_HAS_MEM_INFO=true
   export JDK_HAS_MEM_INFO
@@ -493,7 +486,7 @@
       if [ $(MB_OF_MEMORY) -le 1024 ] ; then \
         expr $(MB_OF_MEMORY) '-' 128 2> $(DEV_NULL) ; \
       else \
-        echo $(ABS_MAX_MEMORY); \
+        echo "896"; \
       fi)
     MIN_VM_MEMORY := $(shell \
       if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
@@ -513,6 +506,18 @@
   export MIN_VM_MEMORY
 endif
 
+# for OpenBSD/i386 limit to 736 max
+ifeq ($(OS_VENDOR), OpenBSD)
+  ifeq ($(ARCH_DATA_MODEL), 32)
+    MAX_VM_MEMORY := $(shell \
+      if [ $(MAX_VM_MEMORY) -gt 736 ] ; then \
+        echo "736"; \
+      else \
+        echo "$(MAX_VM_MEMORY)" ; \
+      fi)
+  endif
+endif
+
 # If blanks in the username, use the first 4 words and pack them together
 _USER1:=$(subst ', ,$(_USER))
 _USER2:=$(subst ", ,$(_USER1))
--- a/src/share/classes/sun/awt/OSInfo.java	Sun Oct 18 09:46:32 2009 -0700
+++ b/src/share/classes/sun/awt/OSInfo.java	Sun Oct 18 09:49:44 2009 -0700
@@ -39,6 +39,7 @@
         WINDOWS,
         LINUX,
         SOLARIS,
+        BSD,
         UNKNOWN
     }
 
@@ -100,6 +101,14 @@
                 return SOLARIS;
             }
 
+            if (osName.contains("BSD")) {
+                return BSD;
+            }
+
+            if (osName.contains("Darwin")) {
+                return BSD;
+            }
+
             // determine another OS here
         }
 
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Sun Oct 18 09:46:32 2009 -0700
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Sun Oct 18 09:49:44 2009 -0700
@@ -428,6 +428,11 @@
     {
         xrenderLibHandle = dlopen("libXrender.so.1", RTLD_LAZY | RTLD_GLOBAL);
 
+        if (xrenderLibHandle == NULL) {
+            xrenderLibHandle = dlopen("libXrender.so",
+                                      RTLD_LAZY | RTLD_GLOBAL);
+        }
+
 #ifndef __linux__ /* SOLARIS */
         if (xrenderLibHandle == NULL) {
             xrenderLibHandle = dlopen("/usr/sfw/lib/libXrender.so.1",
--- a/src/solaris/native/sun/awt/gtk2_interface.c	Sun Oct 18 09:46:32 2009 -0700
+++ b/src/solaris/native/sun/awt/gtk2_interface.c	Sun Oct 18 09:49:44 2009 -0700
@@ -32,7 +32,8 @@
 #include "java_awt_Transparency.h"
 #include "jvm_md.h"
 
-#define GTK2_LIB VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0")
+#define GTK2_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0")
+#define GTK2_LIB JNI_LIB_NAME("gtk-x11-2.0")
 
 #define G_TYPE_INVALID                  G_TYPE_MAKE_FUNDAMENTAL (0)
 #define G_TYPE_NONE                     G_TYPE_MAKE_FUNDAMENTAL (1)
@@ -398,9 +399,12 @@
         void *lib = NULL;
         gboolean result = FALSE;
 
-        lib = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL);
+        lib = dlopen(GTK2_LIB_VERSIONED, RTLD_LAZY | RTLD_LOCAL);
         if (lib == NULL) {
-            return FALSE;
+            lib = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL);
+            if (lib == NULL) {
+                return FALSE;
+            }
         }
 
         fp_gtk_check_version = dlsym(lib, "gtk_check_version");
@@ -423,9 +427,12 @@
     int (*io_handler)();
     char *gtk_modules_env;
 
-    gtk2_libhandle = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL);
-    if (gtk2_libhandle == NULL)
-        return FALSE;
+    gtk2_libhandle = dlopen(GTK2_LIB_VERSIONED, RTLD_LAZY | RTLD_LOCAL);
+    if (gtk2_libhandle == NULL) {
+        gtk2_libhandle = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL);
+        if (gtk2_libhandle == NULL)
+            return FALSE;
+    }
 
     if (setjmp(j) == 0)
     {
--- a/src/solaris/native/sun/xawt/awt_Desktop.c	Sun Oct 18 09:46:32 2009 -0700
+++ b/src/solaris/native/sun/xawt/awt_Desktop.c	Sun Oct 18 09:49:44 2009 -0700
@@ -39,10 +39,13 @@
 
     vfs_handle = dlopen(VERSIONED_JNI_LIB_NAME("gnomevfs-2", "0"), RTLD_LAZY);
     if (vfs_handle == NULL) {
+        vfs_handle = dlopen(JNI_LIB_NAME("gnomevfs-2"), RTLD_LAZY);
+        if (vfs_handle == NULL) {
 #ifdef INTERNAL_BUILD
-        fprintf(stderr, "can not load libgnomevfs-2.so\n");
+            fprintf(stderr, "can not load libgnomevfs-2.so\n");
 #endif
-        return 0;
+            return 0;
+        }
     }
     dlerror(); /* Clear errors */
     gnome_vfs_init = dlsym(vfs_handle, "gnome_vfs_init");
@@ -57,10 +60,13 @@
 
     gnome_handle = dlopen(VERSIONED_JNI_LIB_NAME("gnome-2", "0"), RTLD_LAZY);
     if (gnome_handle == NULL) {
+        gnome_handle = dlopen(JNI_LIB_NAME("gnome-2"), RTLD_LAZY);
+        if (gnome_handle == NULL) {
 #ifdef INTERNAL_BUILD
-        fprintf(stderr, "can not load libgnome-2.so\n");
+            fprintf(stderr, "can not load libgnome-2.so\n");
 #endif
-        return 0;
+            return 0;
+        }
     }
     dlerror(); /* Clear errors */
     gnome_url_show = dlsym(gnome_handle, "gnome_url_show");