linux build changes for xulrunner 31


Change-Id: Id87654ae3fec6b88a9c5fa20eaa2c714d393c8db
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 02bb415..0cf2c91 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
@@ -12,9 +12,8 @@
 
 import java.io.*;
 
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
 import org.eclipse.swt.internal.*;
 import org.eclipse.swt.internal.gtk.*;
 import org.eclipse.swt.internal.mozilla.*;
@@ -31,7 +30,6 @@
 	static Boolean IsXULRunner24;
 	static final int STOP_PROPOGATE = 1;
 	static final String LIB_FIX_XULRUNNER10 = "libswt-xulrunner-fix10.so"; //$NON-NLS-1$
-	static final String LIB_FIX_XULRUNNER24 = "libswt-xulrunner-fix24.so"; //$NON-NLS-1$
 	static final String LIB_FIX_XULRUNNER31 = "libswt-xulrunner-fix31.so"; //$NON-NLS-1$
 
 	static final String LIB_XPCOM = "libxpcom.so"; //$NON-NLS-1$
@@ -140,7 +138,7 @@
 static void loadAdditionalLibraries (String mozillaPath, boolean isGlued) {
 	/*
 	 * This function is invoked twice, once before gluing (the fix library for
-	 * XULRunner 24, if appropriate, must be loaded before attempting to glue),
+	 * XULRunner 24/XULRunner 31, if appropriate, must be loaded before attempting to glue),
 	 * and once after gluing (to load the XULRunner 10 fix library, if appropriate).
 	 */
 	String libName = null;
@@ -153,6 +151,10 @@
 			* Works around https://bugzilla.mozilla.org/show_bug.cgi?id=720682
 			* and https://bugzilla.mozilla.org/show_bug.cgi?id=763327.
 			*/
+			/*
+			 * LIB_FIX_XULRUNNER31 is built against XULRunner 31 SDK and it is used as the fix library
+			 * for both XULRunner 24 and XULRunner 31.
+			 */
 			libName = LIB_FIX_XULRUNNER31;
 		}
 	} else {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
index 75b381d..9e9364c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
@@ -136,8 +136,8 @@
 		if [ "${XULRUNNER_LIBS}" = "" ]; then
 			export XULRUNNER_LIBS="-L${XULRUNNER_SDK}/lib -lxpcomglue"
 		fi
-		if [ "${XULRUNNER24_SDK}" = "" ]; then
-			export XULRUNNER24_SDK="/bluebird/teamswt/swt-builddir/geckoSDK/24/x86"
+		if [ "${XULRUNNER31_SDK}" = "" ]; then
+			export XULRUNNER31_SDK="/bluebird/teamswt/swt-builddir/geckoSDK/24/x86"
 		fi
 		if [ "${XULRUNNER31_SDK}" = "" ]; then
 			export XULRUNNER31_SDK="/bluebird/teamswt/swt-builddir/geckoSDK/24/x86"
@@ -171,8 +171,8 @@
 		if [ "${XULRUNNER_LIBS}" = "" ]; then
 			export XULRUNNER_LIBS="-L${XULRUNNER_SDK}/lib -lxpcomglue"
 		fi
-		if [ "${XULRUNNER24_SDK}" = "" ]; then
-			export XULRUNNER24_SDK="/bluebird/teamswt/swt-builddir/geckoSDK/24/x86_64"
+		if [ "${XULRUNNER31_SDK}" = "" ]; then
+			export XULRUNNER31_SDK="/bluebird/teamswt/swt-builddir/geckoSDK/24/x86_64"
 		fi
 		if [ "${XULRUNNER31_SDK}" = "" ]; then
 			export XULRUNNER31_SDK="/media/SSD/Xulrunner/xulrunner-sdk"
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
index f061f10..360b8ed 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
@@ -132,7 +132,7 @@
 	LFLAGS := $(LFLAGS) -s
 endif
 
-all:
+all: make_swt make_atk make_glx make_webkit
 
 #
 # SWT libs
@@ -266,11 +266,7 @@
 xpcomxul_stats.o: xpcom_stats.cpp
 	$(CXX) -o xpcomxul_stats.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_stats.cpp
 
-
-make_xulrunner24:
-	echo -e "#include<stdlib.h>\nsize_t je_malloc_usable_size_in_advance(size_t n) {\nreturn n;\n}" | $(CXX) $(LFLAGS) $(CFLAGS) -L${XULRUNNER24_SDK}/lib -Wl,--whole-archive -lmozglue -Wl,--no-whole-archive -xc - -o libswt-xulrunner-fix24.so
-
-make_xulrunner31: 
+make_xulrunner_fix31: 
 	echo -e "#include<stdlib.h>\nsize_t je_malloc_usable_size_in_advance(size_t n) {\nreturn n;\n}" | $(CXX) $(LFLAGS) $(CFLAGS) -L${XULRUNNER31_SDK}/lib -Wl,--whole-archive -lmozglue -Wl,--no-whole-archive -xc - -o libswt-xulrunner-fix31.so
 
 #
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.java
index 348cb9e..7760596 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.java
@@ -25,7 +25,6 @@
 
 public class Snippet128 {
 	public static void main(String [] args) {
-		Display.DEBUG = true;
 		Display display = new Display();
 		final Shell shell = new Shell(display);
 		GridLayout gridLayout = new GridLayout();
@@ -59,8 +58,7 @@
 
 		final Browser browser;
 		try {
-			System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "/Library/Frameworks/XUL/31/XUL.framework/Versions/Current");
-			browser = new Browser(shell, SWT.MOZILLA);
+			browser = new Browser(shell, SWT.NONE);
 		} catch (SWTError e) {
 			System.out.println("Could not instantiate Browser: " + e.getMessage());
 			display.dispose();
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet148.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet148.java
index 39356a2..896a1e4 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet148.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet148.java
@@ -26,14 +26,12 @@
 public class Snippet148 {
 
 	public static void main(String[] args) {
-		Display.DEBUG = true;
 		final Display display = new Display();
 		Shell shell = new Shell(display);
 		shell.setLayout(new FillLayout());
 		Browser browser = null;
 		try {
-			System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "/Library/Frameworks/XUL/31/XUL.framework/Versions/Current");
-			browser = new Browser(shell, SWT.MOZILLA);
+			browser = new Browser(shell, SWT.NONE);
 		} catch (SWTError e) {
 			/* The Browser widget throws an SWTError if it fails to
 			 * instantiate properly. Application code should catch
@@ -42,11 +40,10 @@
 			 * Platform requirements for the SWT Browser widget are available
 			 * from the SWT FAQ website. 
 			 */
-			e.printStackTrace();
 		}
 		if (browser != null) {
 			/* The Browser widget can be used */
-			browser.setUrl("http://localhost");
+			browser.setUrl("http://www.eclipse.org");
 		}
 		shell.open();
 		while (!shell.isDisposed()) {