diff options
author | Grant Gayed <ggayed> | 2009-08-20 19:16:37 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2009-08-20 19:16:37 +0000 |
commit | 01b3b749a22532bafaa701afdfbc708890a27ccb (patch) | |
tree | 5ffcab2ed1c78a3386c80731686573f8418841eb | |
parent | f1f13d1b69e6d9ece5cd2ebee890b087dfb2b4d9 (diff) | |
download | eclipse.platform.swt-01b3b749a22532bafaa701afdfbc708890a27ccb.tar.gz eclipse.platform.swt-01b3b749a22532bafaa701afdfbc708890a27ccb.tar.xz eclipse.platform.swt-01b3b749a22532bafaa701afdfbc708890a27ccb.zip |
77217 - Support the Browser widget on Solaris SPARC
3 files changed, 29 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java index 1f9e84512a..89715657ac 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java @@ -33,6 +33,13 @@ class AppFileLocProvider { static final String PLUGINS_DIR = "plugins"; //$NON-NLS-1$ static final String USER_PLUGINS_DIR = ".mozilla" + SEPARATOR_OS + "plugins"; //$NON-NLS-1$ //$NON-NLS-2$ static final String PREFERENCES_FILE = "prefs.js"; //$NON-NLS-1$ + + static boolean IsSparc; + static { + String osName = System.getProperty ("os.name").toLowerCase (); //$NON-NLS-1$ + String osArch = System.getProperty ("os.arch").toLowerCase (); //$NON-NLS-1$ + IsSparc = (osName.startsWith ("sunos") || osName.startsWith ("solaris")) && osArch.startsWith("sparc"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } AppFileLocProvider (String path) { mozillaPath = path + SEPARATOR_OS; @@ -174,18 +181,28 @@ int getFiles (int /*long*/ prop, int /*long*/ _retval) { if (segment.length () > 0) segments.addElement (segment); } while (end != -1); int segmentsSize = segments.size (); - pluginDirs = new String [segmentsSize + 2]; + pluginDirs = new String [segmentsSize + (IsSparc ? 1 : 2)]; for (index = 0; index < segmentsSize; index++) { pluginDirs[index] = (String)segments.elementAt (index); } } } if (pluginDirs == null) { - pluginDirs = new String[2]; + pluginDirs = new String[IsSparc ? 1 : 2]; } /* set the next value to the GRE path + "plugins" */ - pluginDirs[index++] = mozillaPath + PLUGINS_DIR; + + /* + * Bug on Solaris SPARC. Attempting to start the java plug-in fails with an + * error indicating that PR_NewMonitor could not be found. This is a well- + * known problem that many other apps have also encountered, with no + * resolution other than to remove this plug-in. The Browser workaround is + * to not add the directory containing this plug-in to the plug-in search path. + */ + if (!IsSparc) { + pluginDirs[index++] = mozillaPath + PLUGINS_DIR; + } /* set the next value to the home directory + "/.mozilla/plugins" */ pluginDirs[index++] = System.getProperty("user.home") + SEPARATOR_OS + USER_PLUGINS_DIR; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java index 77a16bad0b..76a5d83ad1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java @@ -35,9 +35,14 @@ class MozillaDelegate { MozillaDelegate (Browser browser) { super (); + /* + * The mozilla libraries on SPARC need the C++ runtime library to be loaded, but they do not declare + * this dependency because they usually get it for free as a result of the mozilla executable pulling it + * in. Load this library here and scope it globally so that the mozilla libraries can resolve. + */ if (IsSparc) { - browser.dispose (); - SWT.error (SWT.ERROR_NO_HANDLES, null, " [Unsupported platform]"); //$NON-NLS-1$ + byte[] buffer = Converter.wcsToMbcs (null, "libCrun.so.1", true); //$NON-NLS-1$ + OS.dlopen (buffer, OS.RTLD_NOW | OS.RTLD_GLOBAL); } this.browser = browser; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index 4bb37a50fa..29323e0e4f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -407,7 +407,9 @@ public class OS extends C { public static final int PANGO_WEIGHT_NORMAL = 0x190; public static final int PANGO_WRAP_WORD = 0; public static final int PANGO_WRAP_WORD_CHAR = 2; + public static final int RTLD_GLOBAL = 0x100; public static final int RTLD_LAZY = 1; + public static final int RTLD_NOW = 2; public static final int XA_CARDINAL = 6; public static final int XA_WINDOW = 33; |