Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2006-07-26 16:33:24 +0000
committerGrant Gayed2006-07-26 16:33:24 +0000
commit08a67030eaaa3732e5f3fef624123f931b42ae42 (patch)
tree355315bbd2079c8f275ee0f701221cc763364d75
parent8f47fd64649405aec2e1b6333b6be1e8602cc3ab (diff)
downloadeclipse.platform.swt-08a67030eaaa3732e5f3fef624123f931b42ae42.tar.gz
eclipse.platform.swt-08a67030eaaa3732e5f3fef624123f931b42ae42.tar.xz
eclipse.platform.swt-08a67030eaaa3732e5f3fef624123f931b42ae42.zip
132500
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties31
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java155
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/Browser.java154
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak43
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/build.sh18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak42
11 files changed, 401 insertions, 82 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties
index 4e8c21a0ef..60c6f0570d 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties
@@ -647,6 +647,13 @@ XPCOM_VtblCall__II_3B_3Z_1=
XPCOM_VtblCall__II_3B_3Z_2=
XPCOM_VtblCall__II_3B_3Z_3=
+XPCOM_VtblCall__II_3B_3Z_3I=
+XPCOM_VtblCall__II_3B_3Z_3I_0=
+XPCOM_VtblCall__II_3B_3Z_3I_1=
+XPCOM_VtblCall__II_3B_3Z_3I_2=
+XPCOM_VtblCall__II_3B_3Z_3I_3=
+XPCOM_VtblCall__II_3B_3Z_3I_4=
+
XPCOM_VtblCall__II_3C=
XPCOM_VtblCall__II_3C_0=
XPCOM_VtblCall__II_3C_1=
@@ -859,6 +866,22 @@ XPCOM_strlen_PRUnichar_0=
org_eclipse_swt_internal_mozilla_XPCOMObject=
+org_eclipse_swt_internal_mozilla_XPCOM_1PROFILE=flags=no_gen
+XPCOM_PROFILE_NS_NewProfileDirServiceProvider=
+XPCOM_PROFILE_NS_NewProfileDirServiceProvider_0=
+XPCOM_PROFILE_NS_NewProfileDirServiceProvider_1=
+
+XPCOM_PROFILE_ProfileDirServiceProvider_Register=
+XPCOM_PROFILE_ProfileDirServiceProvider_Register_0=
+
+XPCOM_PROFILE_ProfileDirServiceProvider_SetProfileDir=
+XPCOM_PROFILE_ProfileDirServiceProvider_SetProfileDir_0=
+XPCOM_PROFILE_ProfileDirServiceProvider_SetProfileDir_1=
+
+XPCOM_PROFILE_ProfileDirServiceProvider_Shutdown=
+XPCOM_PROFILE_ProfileDirServiceProvider_Shutdown_0=
+
+
org_eclipse_swt_internal_mozilla_nsEmbedString=
org_eclipse_swt_internal_mozilla_nsIAppShell=
@@ -891,6 +914,12 @@ org_eclipse_swt_internal_mozilla_nsIDOMUIEvent=
org_eclipse_swt_internal_mozilla_nsIDOMWindow=
+org_eclipse_swt_internal_mozilla_nsIDirectoryService=
+
+org_eclipse_swt_internal_mozilla_nsIDirectoryServiceProvider=
+
+org_eclipse_swt_internal_mozilla_nsIDirectoryServiceProvider2=
+
org_eclipse_swt_internal_mozilla_nsIDocShell=
org_eclipse_swt_internal_mozilla_nsIDownload=
@@ -929,6 +958,8 @@ org_eclipse_swt_internal_mozilla_nsIProgressDialog=
org_eclipse_swt_internal_mozilla_nsIPromptService=
+org_eclipse_swt_internal_mozilla_nsIProperties=
+
org_eclipse_swt_internal_mozilla_nsIRequest=
org_eclipse_swt_internal_mozilla_nsIServiceManager=
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java
index 9901978e8c..9a4315da7c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java
@@ -71,7 +71,7 @@ public class Browser extends Composite {
static nsIAppShell AppShell;
static WindowCreator WindowCreator;
static int BrowserCount;
- static boolean mozilla, ignoreDispose;
+ static boolean mozilla, ignoreDispose, usingProfile;
static boolean IsLinux;
/* Package Name */
@@ -82,6 +82,7 @@ public class Browser extends Composite {
static final String PREFERENCE_CHARSET = "intl.charset.default"; //$NON-NLS-1$
static final String SEPARATOR_LOCALE = "-"; //$NON-NLS-1$
static final String TOKENIZER_LOCALE = ","; //$NON-NLS-1$
+ static final String PROFILE_DIR = "/eclipse"; //$NON-NLS-1$
static {
String osName = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
@@ -173,10 +174,51 @@ public Browser(Composite parent, int style) {
}
}
+ /*
+ * Try to load the various profile libraries until one is found that loads successfully:
+ * - mozilla14profile/mozilla14profile-gcc should succeed for mozilla 1.4 - 1.6
+ * - mozilla17profile/mozilla17profile-gcc should succeed for mozilla 1.7.x and firefox
+ * - mozilla18profile/mozilla18profile-gcc should succeed for mozilla 1.8.x (seamonkey)
+ */
+ try {
+ Library.loadLibrary ("swt-mozilla14-profile"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e1) {
+ try {
+ Library.loadLibrary ("swt-mozilla17-profile"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e2) {
+ try {
+ Library.loadLibrary ("swt-mozilla14-profile-gcc3"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e3) {
+ try {
+ Library.loadLibrary ("swt-mozilla17-profile-gcc3"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e4) {
+ try {
+ Library.loadLibrary ("swt-mozilla18-profile"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e5) {
+ try {
+ Library.loadLibrary ("swt-mozilla18-profile-gcc3"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e6) {
+ /*
+ * fail silently, the Browser will still work without profile support
+ * but will abort any attempts to navigate to HTTPS pages
+ */
+ }
+ }
+ }
+ }
+ }
+ }
+
int /*long*/[] retVal = new int /*long*/[1];
- nsEmbedString path = new nsEmbedString(mozillaPath);
- int rc = XPCOM.NS_NewLocalFile(path.getAddress(), true, retVal);
- path.dispose();
+ nsEmbedString pathString = new nsEmbedString(mozillaPath);
+ int rc = XPCOM.NS_NewLocalFile(pathString.getAddress(), true, retVal);
+ pathString.dispose();
if (rc != XPCOM.NS_OK) error(rc);
if (retVal[0] == 0) error(XPCOM.NS_ERROR_NULL_POINTER);
@@ -227,10 +269,71 @@ public Browser(Composite parent, int style) {
if (rc != XPCOM.NS_OK) error(rc);
windowWatcher.Release();
+ /* specify the user profile directory */
+ if (usingProfile) {
+ buffer = Converter.wcsToMbcs(null, XPCOM.NS_DIRECTORYSERVICE_CONTRACTID, true);
+ rc = serviceManager.GetServiceByContractID(buffer, nsIDirectoryService.NS_IDIRECTORYSERVICE_IID, result);
+ if (rc != XPCOM.NS_OK) error(rc);
+ if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);
+
+ nsIDirectoryService directoryService = new nsIDirectoryService(result[0]);
+ result[0] = 0;
+ rc = directoryService.QueryInterface(nsIProperties.NS_IPROPERTIES_IID, result);
+ if (rc != XPCOM.NS_OK) error(rc);
+ if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);
+ directoryService.Release();
+
+ nsIProperties properties = new nsIProperties(result[0]);
+ result[0] = 0;
+ buffer = Converter.wcsToMbcs(null, XPCOM.NS_APP_APPLICATION_REGISTRY_DIR, true);
+ rc = properties.Get(buffer, nsIFile.NS_IFILE_IID, result);
+ if (rc != XPCOM.NS_OK) error(rc);
+ if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);
+ properties.Release();
+
+ nsIFile profileDir = new nsIFile(result[0]);
+ result[0] = 0;
+ int /*long*/ path = XPCOM.nsEmbedCString_new();
+ rc = profileDir.GetNativePath(path);
+ if (rc != XPCOM.NS_OK) error(rc);
+ profileDir.Release(); //
+
+ int length = XPCOM.nsEmbedCString_Length(path);
+ ptr = XPCOM.nsEmbedCString_get(path);
+ buffer = new byte [length];
+ XPCOM.memmove(buffer, ptr, length);
+ XPCOM.nsEmbedCString_delete(path);
+ String string = new String(Converter.mbcsToWcs(null, buffer)) + PROFILE_DIR;
+ pathString = new nsEmbedString(string);
+ rc = XPCOM.NS_NewLocalFile(pathString.getAddress(), true, result);
+ if (rc != XPCOM.NS_OK) error(rc);
+ if (result[0] == 0) error(XPCOM.NS_ERROR_NULL_POINTER);
+ pathString.dispose(); //
+
+ profileDir = new nsIFile(result[0]);
+ result[0] = 0;
+
+ rc = XPCOM_PROFILE.NS_NewProfileDirServiceProvider(true, result);
+ if (rc != XPCOM.NS_OK) error(rc);
+ if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);
+
+ final int /*long*/ dirServiceProvider = result[0];
+ result[0] = 0;
+ rc = XPCOM_PROFILE.ProfileDirServiceProvider_Register(dirServiceProvider);
+ if (rc != XPCOM.NS_OK) error(rc);
+ rc = XPCOM_PROFILE.ProfileDirServiceProvider_SetProfileDir(dirServiceProvider, profileDir.getAddress());
+ if (rc != XPCOM.NS_OK) error(rc);
+
+ getDisplay().addListener(SWT.Dispose, new Listener() {
+ public void handleEvent(Event e) {
+ XPCOM_PROFILE.ProfileDirServiceProvider_Shutdown(dirServiceProvider);
+ }
+ });
+ }
+
/*
- * As a result of not using profiles, the user's locale and charset default
- * to en_us and iso-8859-1, which are not the correct values for users in
- * other locales. The fix for this is to set mozilla's locale and charset
+ * As a result of using a common profile (or none at all), the user cannot specify
+ * their locale and charset. The fix for this is to set mozilla's locale and charset
* preference values according to the user's current locale and charset.
*/
buffer = XPCOM.NS_PREFSERVICE_CONTRACTID.getBytes();
@@ -2035,14 +2138,15 @@ int /*long*/ OnLocationChange(int /*long*/ aWebProgress, int /*long*/ aRequest,
int /*long*/ OnStatusChange(int /*long*/ aWebProgress, int /*long*/ aRequest, int /*long*/ aStatus, int /*long*/ aMessage) {
/*
- * Feature in Mozilla. In Mozilla 1.7.5, navigating to an
- * HTTPS link without a user profile set causes a crash.
- * Most requests for HTTPS pages are aborted in OnStartURIOpen.
- * However, https page requests that do not initially specify
- * https as their protocol will get past this check since they
- * are resolved afterwards. The workaround is to check the url
- * whenever there is a status change, and to abort any https
- * requests that are detected.
+ * Feature in Mozilla. Navigating to an HTTPS link without a user profile
+ * set causes a crash. The workaround is to abort attempts to navigate to
+ * HTTPS pages if a profile is not being used.
+ *
+ * Most navigation requests for HTTPS pages are handled in OnStartURIOpen.
+ * However, https page requests that do not initially specify https as their
+ * protocol will get past this check since they are resolved afterwards.
+ * The workaround is to check the url whenever there is a status change, and
+ * to abort any detected https requests if a profile is not being used.
*/
nsIRequest request = new nsIRequest(aRequest);
int /*long*/ aName = XPCOM.nsEmbedCString_new();
@@ -2053,7 +2157,7 @@ int /*long*/ OnStatusChange(int /*long*/ aWebProgress, int /*long*/ aRequest, in
XPCOM.memmove(bytes, buffer, length);
XPCOM.nsEmbedCString_delete(aName);
String value = new String(bytes);
- if (value.startsWith(XPCOM.HTTPS_PROTOCOL)) {
+ if (!usingProfile && value.startsWith(XPCOM.HTTPS_PROTOCOL)) {
request.Cancel(XPCOM.NS_BINDING_ABORTED);
return XPCOM.NS_OK;
}
@@ -2332,21 +2436,16 @@ int /*long*/ OnStartURIOpen(int /*long*/ aURI, int /*long*/ retval) {
XPCOM.nsEmbedCString_delete(aSpec);
String value = new String(dest);
/*
- * Feature in Mozilla. In Mozilla 1.7.5, navigating to an
- * HTTPS link without a user profile set causes a crash.
- * HTTPS requires a user profile to be set to persist security
- * information. This requires creating a new user profile
- * (i.e. creating a new folder) or locking an existing Mozilla
- * user profile. The Mozilla Profile API is not frozen and it is not
- * currently implemented. The workaround is to not load
- * HTTPS resources to avoid the crash.
- */
+ * Feature in Mozilla. Navigating to an HTTPS link without a user profile
+ * set causes a crash. The workaround is to abort attempts to navigate to
+ * HTTPS pages if a profile is not being used.
+ */
boolean isHttps = value.startsWith(XPCOM.HTTPS_PROTOCOL);
if (locationListeners.length == 0) {
- XPCOM.memmove(retval, new int[] {isHttps ? 1 : 0}, 4);
+ XPCOM.memmove(retval, new int[] {isHttps && !usingProfile ? 1 : 0}, 4);
return XPCOM.NS_OK;
}
- boolean doit = !isHttps;
+ boolean doit = !isHttps || usingProfile;
if (request == 0) {
LocationEvent event = new LocationEvent(this);
event.display = getDisplay();
@@ -2363,7 +2462,7 @@ int /*long*/ OnStartURIOpen(int /*long*/ aURI, int /*long*/ retval) {
event.doit = doit;
for (int i = 0; i < locationListeners.length; i++)
locationListeners[i].changing(event);
- if (!isHttps) doit = event.doit;
+ if (!isHttps || usingProfile) doit = event.doit;
}
/* Note. boolean remains of size 4 on 64 bit machine */
XPCOM.memmove(retval, new int[] {doit ? 0 : 1}, 4);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
index 5a463b08d0..b4e21d445b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
@@ -1570,6 +1570,28 @@ fail:
}
#endif
+#ifndef NO_VtblCall__II_3B_3Z_3I
+JNIEXPORT jint JNICALL XPCOM_NATIVE(VtblCall__II_3B_3Z_3I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jbyteArray arg2, jbooleanArray arg3, jintArray arg4)
+{
+ jbyte *lparg2=NULL;
+ jboolean *lparg3=NULL;
+ jint *lparg4=NULL;
+ jint rc = 0;
+ XPCOM_NATIVE_ENTER(env, that, VtblCall__II_3B_3Z_3I_FUNC);
+ if (arg2) if ((lparg2 = env->GetByteArrayElements(arg2, NULL)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = env->GetBooleanArrayElements(arg3, NULL)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = env->GetIntArrayElements(arg4, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jint, jbyte *, jboolean *, jint *))(*(jint **)arg1)[arg0])(arg1, lparg2, lparg3, lparg4);
+fail:
+ if (arg4 && lparg4) env->ReleaseIntArrayElements(arg4, lparg4, 0);
+ if (arg3 && lparg3) env->ReleaseBooleanArrayElements(arg3, lparg3, 0);
+ if (arg2 && lparg2) env->ReleaseByteArrayElements(arg2, lparg2, 0);
+ XPCOM_NATIVE_EXIT(env, that, VtblCall__II_3B_3Z_3I_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_VtblCall__II_3C
JNIEXPORT jint JNICALL XPCOM_NATIVE(VtblCall__II_3C)
(JNIEnv *env, jclass that, jint arg0, jint arg1, jcharArray arg2)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h
index db36968d2e..697534a026 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h
@@ -26,8 +26,8 @@
*
* ***** END LICENSE BLOCK ***** */
-#ifndef INC_os_H
-#define INC_os_H
+#ifndef INC_xpcom_H
+#define INC_xpcom_H
#define NDEBUG
@@ -45,4 +45,4 @@
#define STDMETHODCALLTYPE
#endif
-#endif /* INC_os_H */
+#endif /* INC_xpcom_H */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
index 6f1b2e4899..1d79c1ec9d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
@@ -31,8 +31,8 @@
#ifdef NATIVE_STATS
-int XPCOM_nativeFunctionCount = 131;
-int XPCOM_nativeFunctionCallCount[131];
+int XPCOM_nativeFunctionCount = 132;
+int XPCOM_nativeFunctionCallCount[132];
char * XPCOM_nativeFunctionNames[] = {
"Call",
"NS_1GetComponentManager",
@@ -121,6 +121,7 @@ char * XPCOM_nativeFunctionNames[] = {
"VtblCall__II_3B_3I_3Z",
"VtblCall__II_3B_3J",
"VtblCall__II_3B_3Z",
+ "VtblCall__II_3B_3Z_3I",
"VtblCall__II_3C",
"VtblCall__II_3CIIII",
"VtblCall__II_3CI_3I",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
index b2d849bab7..3443a510fd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
@@ -125,6 +125,7 @@ typedef enum {
VtblCall__II_3B_3I_3Z_FUNC,
VtblCall__II_3B_3J_FUNC,
VtblCall__II_3B_3Z_FUNC,
+ VtblCall__II_3B_3Z_3I_FUNC,
VtblCall__II_3C_FUNC,
VtblCall__II_3CIIII_FUNC,
VtblCall__II_3CI_3I_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
index bc9ee69963..095f5d98ce 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
@@ -49,10 +49,10 @@ public class XPCOM extends Platform {
public static final nsID NS_LOADGROUP_CID = new nsID("e1c61582-2a84-11d3-8cce-0060b0fc14a3"); //$NON-NLS-1$
public static final nsID NS_PROMPTSERVICE_CID = new nsID("a2112d6a-0e28-421f-b46a-25c0b308cbd0"); //$NON-NLS-1$
public static final nsID NS_CATEGORYMANAGER_CID = new nsID("16d222a6-1dd2-11b2-b693-f38b02c021b2"); //$NON-NLS-1$
-
+
+ public static final String NS_DIRECTORYSERVICE_CONTRACTID = "@mozilla.org/file/directory_service;1"; //$NON-NLS-1$
public static final String NS_DOWNLOAD_CONTRACTID = "@mozilla.org/download;1"; //$NON-NLS-1$
public static final String NS_FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1"; //$NON-NLS-1$
- public static final String NS_PROFILE_CONTRACTID = "@mozilla.org/profile/manager;1"; //$NON-NLS-1$
public static final String NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID = "@mozilla.org/helperapplauncherdialog;1"; //$NON-NLS-1$
public static final String NS_MEMORY_CONTRACTID = "@mozilla.org/xpcom/memory-service;1"; //$NON-NLS-1$
public static final String NS_PREFLOCALIZEDSTRING_CONTRACTID = "@mozilla.org/pref-localizedstring;1"; //$NON-NLS-1$
@@ -88,6 +88,7 @@ public class XPCOM extends Platform {
public static final int NS_ERROR_FACTORY_EXISTS = NS_ERROR_BASE + 0x100;
public static final int NS_ERROR_HTMLPARSER_UNRESOLVEDDTD = 0x804e03f3;
public static final int NS_ERROR_FILE_NOT_FOUND = 0x80520012;
+ public static final String NS_APP_APPLICATION_REGISTRY_DIR = "AppRegD"; //$NON-NLS-1$
public static final native void memmove(nsID dest, int /*long*/ src, int nbytes);
public static final native void memmove(int /*long*/ dest, nsID src, int nbytes);
@@ -222,4 +223,5 @@ static final native int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0,
static final native int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, byte[] arg1);
static final native int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, int[] arg1, int /*long*/[] arg2);
static final native int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, nsID arg1, int /*long*/ arg2);
+static final native int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, boolean[] arg1, int /*long*/[] arg2);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/Browser.java
index 9950d13f87..d0cc650651 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/Browser.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/Browser.java
@@ -71,7 +71,7 @@ public class Browser extends Composite {
static nsIAppShell AppShell;
static WindowCreator WindowCreator;
static int BrowserCount;
- static boolean mozilla, ignoreDispose;
+ static boolean mozilla, ignoreDispose, usingProfile;
static Callback eventCallback;
static int /*long*/ eventProc;
@@ -85,7 +85,9 @@ public class Browser extends Composite {
static final String PREFERENCE_CHARSET = "intl.charset.default"; //$NON-NLS-1$
static final String SEPARATOR_LOCALE = "-"; //$NON-NLS-1$
static final String TOKENIZER_LOCALE = ","; //$NON-NLS-1$
+ static final String PROFILE_DIR = "/eclipse"; //$NON-NLS-1$
static final int STOP_PROPOGATE = 1;
+
/**
* Constructs a new instance of this class given its parent
* and a style value describing its behavior and appearance.
@@ -167,10 +169,51 @@ public Browser(Composite parent, int style) {
}
}
+ /*
+ * Try to load the various profile libraries until one is found that loads successfully:
+ * - mozilla14profile/mozilla14profile-gcc should succeed for mozilla 1.4 - 1.6
+ * - mozilla17profile/mozilla17profile-gcc should succeed for mozilla 1.7.x and firefox
+ * - mozilla18profile/mozilla18profile-gcc should succeed for mozilla 1.8.x (seamonkey)
+ */
+ try {
+ Library.loadLibrary ("swt-mozilla14-profile"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e1) {
+ try {
+ Library.loadLibrary ("swt-mozilla17-profile"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e2) {
+ try {
+ Library.loadLibrary ("swt-mozilla14-profile-gcc3"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e3) {
+ try {
+ Library.loadLibrary ("swt-mozilla17-profile-gcc3"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e4) {
+ try {
+ Library.loadLibrary ("swt-mozilla18-profile"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e5) {
+ try {
+ Library.loadLibrary ("swt-mozilla18-profile-gcc3"); //$NON-NLS-1$
+ usingProfile = true;
+ } catch (UnsatisfiedLinkError e6) {
+ /*
+ * fail silently, the Browser will still work without profile support
+ * but will abort any attempts to navigate to HTTPS pages
+ */
+ }
+ }
+ }
+ }
+ }
+ }
+
int /*long*/[] retVal = new int /*long*/[1];
- nsEmbedString path = new nsEmbedString(mozillaPath);
- int rc = XPCOM.NS_NewLocalFile(path.getAddress(), true, retVal);
- path.dispose();
+ nsEmbedString pathString = new nsEmbedString(mozillaPath);
+ int rc = XPCOM.NS_NewLocalFile(pathString.getAddress(), true, retVal);
+ pathString.dispose();
if (rc != XPCOM.NS_OK) error(rc);
if (retVal[0] == 0) error(XPCOM.NS_ERROR_NULL_POINTER);
@@ -220,10 +263,71 @@ public Browser(Composite parent, int style) {
if (rc != XPCOM.NS_OK) error(rc);
windowWatcher.Release();
+ /* specify the user profile directory */
+ if (usingProfile) {
+ buffer = Converter.wcsToMbcs(null, XPCOM.NS_DIRECTORYSERVICE_CONTRACTID, true);
+ rc = serviceManager.GetServiceByContractID(buffer, nsIDirectoryService.NS_IDIRECTORYSERVICE_IID, result);
+ if (rc != XPCOM.NS_OK) error(rc);
+ if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);
+
+ nsIDirectoryService directoryService = new nsIDirectoryService(result[0]);
+ result[0] = 0;
+ rc = directoryService.QueryInterface(nsIProperties.NS_IPROPERTIES_IID, result);
+ if (rc != XPCOM.NS_OK) error(rc);
+ if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);
+ directoryService.Release();
+
+ nsIProperties properties = new nsIProperties(result[0]);
+ result[0] = 0;
+ buffer = Converter.wcsToMbcs(null, XPCOM.NS_APP_APPLICATION_REGISTRY_DIR, true);
+ rc = properties.Get(buffer, nsIFile.NS_IFILE_IID, result);
+ if (rc != XPCOM.NS_OK) error(rc);
+ if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);
+ properties.Release();
+
+ nsIFile profileDir = new nsIFile(result[0]);
+ result[0] = 0;
+ int /*long*/ path = XPCOM.nsEmbedCString_new();
+ rc = profileDir.GetNativePath(path);
+ if (rc != XPCOM.NS_OK) error(rc);
+ profileDir.Release(); //
+
+ int length = XPCOM.nsEmbedCString_Length(path);
+ ptr = XPCOM.nsEmbedCString_get(path);
+ buffer = new byte [length];
+ XPCOM.memmove(buffer, ptr, length);
+ XPCOM.nsEmbedCString_delete(path);
+ String string = new String(Converter.mbcsToWcs(null, buffer)) + PROFILE_DIR;
+ pathString = new nsEmbedString(string);
+ rc = XPCOM.NS_NewLocalFile(pathString.getAddress(), true, result);
+ if (rc != XPCOM.NS_OK) error(rc);
+ if (result[0] == 0) error(XPCOM.NS_ERROR_NULL_POINTER);
+ pathString.dispose(); //
+
+ profileDir = new nsIFile(result[0]);
+ result[0] = 0;
+
+ rc = XPCOM_PROFILE.NS_NewProfileDirServiceProvider(true, result);
+ if (rc != XPCOM.NS_OK) error(rc);
+ if (result[0] == 0) error(XPCOM.NS_NOINTERFACE);
+
+ final int /*long*/ dirServiceProvider = result[0];
+ result[0] = 0;
+ rc = XPCOM_PROFILE.ProfileDirServiceProvider_Register(dirServiceProvider);
+ if (rc != XPCOM.NS_OK) error(rc);
+ rc = XPCOM_PROFILE.ProfileDirServiceProvider_SetProfileDir(dirServiceProvider, profileDir.getAddress());
+ if (rc != XPCOM.NS_OK) error(rc);
+
+ getDisplay().addListener(SWT.Dispose, new Listener() {
+ public void handleEvent(Event e) {
+ XPCOM_PROFILE.ProfileDirServiceProvider_Shutdown(dirServiceProvider);
+ }
+ });
+ }
+
/*
- * As a result of not using profiles, the user's locale and charset default
- * to en_us and iso-8859-1, which are not the correct values for users in
- * other locales. The fix for this is to set mozilla's locale and charset
+ * As a result of using a common profile (or none at all), the user cannot specify
+ * their locale and charset. The fix for this is to set mozilla's locale and charset
* preference values according to the user's current locale and charset.
*/
buffer = XPCOM.NS_PREFSERVICE_CONTRACTID.getBytes();
@@ -2049,14 +2153,15 @@ int /*long*/ OnLocationChange(int /*long*/ aWebProgress, int /*long*/ aRequest,
int /*long*/ OnStatusChange(int /*long*/ aWebProgress, int /*long*/ aRequest, int /*long*/ aStatus, int /*long*/ aMessage) {
/*
- * Feature in Mozilla. In Mozilla 1.7.5, navigating to an
- * HTTPS link without a user profile set causes a crash.
- * Most requests for HTTPS pages are aborted in OnStartURIOpen.
- * However, https page requests that do not initially specify
- * https as their protocol will get past this check since they
- * are resolved afterwards. The workaround is to check the url
- * whenever there is a status change, and to abort any https
- * requests that are detected.
+ * Feature in Mozilla. Navigating to an HTTPS link without a user profile
+ * set causes a crash. The workaround is to abort attempts to navigate to
+ * HTTPS pages if a profile is not being used.
+ *
+ * Most navigation requests for HTTPS pages are handled in OnStartURIOpen.
+ * However, https page requests that do not initially specify https as their
+ * protocol will get past this check since they are resolved afterwards.
+ * The workaround is to check the url whenever there is a status change, and
+ * to abort any detected https requests if a profile is not being used.
*/
nsIRequest request = new nsIRequest(aRequest);
int /*long*/ aName = XPCOM.nsEmbedCString_new();
@@ -2067,7 +2172,7 @@ int /*long*/ OnStatusChange(int /*long*/ aWebProgress, int /*long*/ aRequest, in
XPCOM.memmove(bytes, buffer, length);
XPCOM.nsEmbedCString_delete(aName);
String value = new String(bytes);
- if (value.startsWith(XPCOM.HTTPS_PROTOCOL)) {
+ if (!usingProfile && value.startsWith(XPCOM.HTTPS_PROTOCOL)) {
request.Cancel(XPCOM.NS_BINDING_ABORTED);
return XPCOM.NS_OK;
}
@@ -2346,21 +2451,16 @@ int /*long*/ OnStartURIOpen(int /*long*/ aURI, int /*long*/ retval) {
XPCOM.nsEmbedCString_delete(aSpec);
String value = new String(dest);
/*
- * Feature in Mozilla. In Mozilla 1.7.5, navigating to an
- * HTTPS link without a user profile set causes a crash.
- * HTTPS requires a user profile to be set to persist security
- * information. This requires creating a new user profile
- * (i.e. creating a new folder) or locking an existing Mozilla
- * user profile. The Mozilla Profile API is not frozen and it is not
- * currently implemented. The workaround is to not load
- * HTTPS resources to avoid the crash.
+ * Feature in Mozilla. Navigating to an HTTPS link without a user profile
+ * set causes a crash. The workaround is to abort attempts to navigate to
+ * HTTPS pages if a profile is not being used.
*/
boolean isHttps = value.startsWith(XPCOM.HTTPS_PROTOCOL);
if (locationListeners.length == 0) {
- XPCOM.memmove(retval, new int[] {isHttps ? 1 : 0}, 4);
+ XPCOM.memmove(retval, new int[] {isHttps && !usingProfile ? 1 : 0}, 4);
return XPCOM.NS_OK;
}
- boolean doit = !isHttps;
+ boolean doit = !isHttps || usingProfile;
if (request == 0) {
LocationEvent event = new LocationEvent(this);
event.display = getDisplay();
@@ -2377,7 +2477,7 @@ int /*long*/ OnStartURIOpen(int /*long*/ aURI, int /*long*/ retval) {
event.doit = doit;
for (int i = 0; i < locationListeners.length; i++)
locationListeners[i].changing(event);
- if (!isHttps) doit = event.doit;
+ if (!isHttps || usingProfile) doit = event.doit;
}
/* Note. boolean remains of size 4 on 64 bit machine */
XPCOM.memmove(retval, new int[] {doit ? 0 : 1}, 4);
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 61680a59e6..82d1dbd097 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
@@ -25,6 +25,9 @@ CAIRO_PREFIX = swt-cairo
ATK_PREFIX = swt-atk
GNOME_PREFIX = swt-gnome
MOZILLA_PREFIX = swt-mozilla$(GCC_VERSION)
+PROFILE14_PREFIX = swt-mozilla14-profile$(GCC_VERSION)
+PROFILE17_PREFIX = swt-mozilla17-profile$(GCC_VERSION)
+PROFILE18_PREFIX = swt-mozilla18-profile$(GCC_VERSION)
GLX_PREFIX = swt-glx
SWT_LIB = lib$(SWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
@@ -35,6 +38,9 @@ CAIRO_LIB = lib$(CAIRO_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
ATK_LIB = lib$(ATK_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
GNOME_LIB = lib$(GNOME_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
MOZILLA_LIB = lib$(MOZILLA_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
+PROFILE14_LIB = lib$(PROFILE14_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
+PROFILE17_LIB = lib$(PROFILE17_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
+PROFILE18_LIB = lib$(PROFILE18_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
GLX_LIB = lib$(GLX_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
CAIROCFLAGS = `pkg-config --cflags cairo`
@@ -73,10 +79,8 @@ MOZILLACFLAGS = -O \
-I. \
-I$(JAVA_HOME)/include \
-I$(JAVA_HOME)/include/linux \
- ${GECKO_INCLUDES} \
${SWT_PTR_CFLAGS}
-MOZILLALIBS = -shared -s -Wl,--version-script=mozilla_exports -Bsymbolic \
- ${GECKO_LIBS}
+MOZILLALIBS = -shared -s -Wl,--version-script=mozilla_exports -Bsymbolic
SWT_OBJECTS = swt.o callback.o
CDE_OBJECTS = swt.o cde.o cde_structs.o cde_stats.o
@@ -86,6 +90,9 @@ CAIRO_OBJECTS = swt.o cairo.o cairo_structs.o cairo_stats.o
ATK_OBJECTS = swt.o atk.o atk_structs.o atk_custom.o atk_stats.o
GNOME_OBJECTS = swt.o gnome.o gnome_structs.o gnome_stats.o
MOZILLA_OBJECTS = swt.o xpcom.o xpcom_custom.o xpcom_structs.o xpcom_stats.o
+PROFILE14_OBJECTS = xpcom14_profile.o
+PROFILE17_OBJECTS = xpcom17_profile.o
+PROFILE18_OBJECTS = xpcom18_profile.o
GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
CFLAGS = -O -Wall \
@@ -195,22 +202,40 @@ gnome_stats.o: gnome_stats.c gnome_stats.h
#
# Mozilla lib
#
-make_mozilla:$(MOZILLA_LIB)
+make_mozilla:$(MOZILLA_LIB) $(PROFILE14_LIB) $(PROFILE17_LIB) $(PROFILE18_LIB)
$(MOZILLA_LIB): $(MOZILLA_OBJECTS)
- $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALIBS)
+ $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALIBS) ${GECKO_LIBS}
xpcom.o: xpcom.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom.cpp
+ $(CXX) $(MOZILLACFLAGS) ${GECKO_INCLUDES} -c xpcom.cpp
xpcom_structs.o: xpcom_structs.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom_structs.cpp
+ $(CXX) $(MOZILLACFLAGS) ${GECKO_INCLUDES} -c xpcom_structs.cpp
xpcom_custom.o: xpcom_custom.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom_custom.cpp
+ $(CXX) $(MOZILLACFLAGS) ${GECKO_INCLUDES} -c xpcom_custom.cpp
xpcom_stats.o: xpcom_stats.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom_stats.cpp
+ $(CXX) $(MOZILLACFLAGS) ${GECKO_INCLUDES} -c xpcom_stats.cpp
+
+$(PROFILE14_OBJECTS): xpcom_profile.cpp
+ $(CXX) -o $(PROFILE14_OBJECTS) $(MOZILLACFLAGS) ${PROFILE14_INCLUDES} -c xpcom_profile.cpp
+
+$(PROFILE17_OBJECTS): xpcom_profile.cpp
+ $(CXX) -o $(PROFILE17_OBJECTS) $(MOZILLACFLAGS) ${PROFILE17_INCLUDES} -c xpcom_profile.cpp
+
+$(PROFILE18_OBJECTS): xpcom_profile.cpp
+ $(CXX) -o $(PROFILE18_OBJECTS) $(MOZILLACFLAGS) ${PROFILE18_INCLUDES} -c xpcom_profile.cpp
+
+$(PROFILE14_LIB): $(PROFILE14_OBJECTS)
+ $(CXX) -o $(PROFILE14_LIB) $(PROFILE14_OBJECTS) $(MOZILLALIBS) ${PROFILE14_LIBS}
+
+$(PROFILE17_LIB): $(PROFILE17_OBJECTS)
+ $(CXX) -o $(PROFILE17_LIB) $(PROFILE17_OBJECTS) $(MOZILLALIBS) ${PROFILE17_LIBS}
+
+$(PROFILE18_LIB): $(PROFILE18_OBJECTS)
+ $(CXX) -o $(PROFILE18_LIB) $(PROFILE18_OBJECTS) $(MOZILLALIBS) ${PROFILE18_LIBS}
#
# GLX lib
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/build.sh b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/build.sh
index 7da54df2a1..a90796ae86 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/build.sh
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/build.sh
@@ -52,8 +52,20 @@ case $OS in
fi
if [ "${GECKO_SDK}" = "" ]; then
GECKO_SDK=/bluebird/teamswt/swt-builddir/mozilla/1.4/linux_gtk2/mozilla/dist/sdk
- GECKO_INCLUDES="-include ${GECKO_SDK}/mozilla-config.h -I${GECKO_SDK}/nspr/include -I${GECKO_SDK}/xpcom/include -I${GECKO_SDK}/string/include -I${GECKO_SDK}/embed_base/include -I${GECKO_SDK}/embedstring/include"
- GECKO_LIBS="-L${GECKO_SDK}/embedstring/bin -lembedstring -L${GECKO_SDK}/embed_base/bin -lembed_base_s -L${GECKO_SDK}/xpcom/bin -lxpcomglue_s -lxpcom -L${GECKO_SDK}/nspr/bin -lnspr4 -lplds4 -lplc4"
+ GECKO_INCLUDES="-include ${GECKO_SDK}/mozilla-config.h -I${GECKO_SDK}/../include/xpcom -I${GECKO_SDK}/../include/nspr -I${GECKO_SDK}/../include/embed_base -I${GECKO_SDK}/../include/embedstring -I${GECKO_SDK}/../include/string -I${GECKO_SDK}/../include/profdirserviceprovider"
+ GECKO_LIBS="${GECKO_SDK}/../lib/libembed_base_s.a ${GECKO_SDK}/../lib/libprofdirserviceprovider_s.a ${GECKO_SDK}/../lib/libembedstring.a ${GECKO_SDK}/../lib/libxpcomglue_s.a -L${GECKO_SDK}/../bin -L${GECKO_SDK}/../lib/ -lxpcom -lnspr4 -lplds4 -lplc4"
+ PROFILE14_INCLUDES="-include ${GECKO_SDK}/mozilla-config.h -I${GECKO_SDK}/../include/xpcom -I${GECKO_SDK}/../include/nspr -I${GECKO_SDK}/../include/string -I${GECKO_SDK}/../include/profdirserviceprovider"
+ PROFILE14_LIBS="${GECKO_SDK}/../lib/libembed_base_s.a ${GECKO_SDK}/../lib/libprofdirserviceprovider_s.a -L${GECKO_SDK}/../lib/ -lxpcom"
+ fi
+ if [ "${GECKO17_SDK}" = "" ]; then
+ GECKO17_SDK=/bluebird/teamswt/swt-builddir/mozilla/1.7/linux_gtk2/mozilla/dist/sdk
+ PROFILE17_INCLUDES="-include ${GECKO17_SDK}/include/mozilla-config.h -I${GECKO17_SDK}/../include/xpcom -I${GECKO17_SDK}/../include/nspr -I${GECKO17_SDK}/../include/string -I${GECKO17_SDK}/../include/profdirserviceprovider"
+ PROFILE17_LIBS="${GECKO17_SDK}/../lib/libembed_base_s.a ${GECKO17_SDK}/../lib/libprofdirserviceprovider_s.a -L${GECKO17_SDK}/../lib/ -lxpcom"
+ fi
+ if [ "${GECKO18_SDK}" = "" ]; then
+ GECKO18_SDK=/bluebird/teamswt/swt-builddir/mozilla/1.8/linux_gtk2/mozilla/dist/sdk
+ PROFILE18_INCLUDES="-include ${GECKO18_SDK}/include/mozilla-config.h -I${GECKO18_SDK}/../include/xpcom -I${GECKO18_SDK}/../include/nspr -I${GECKO18_SDK}/../include/string -I${GECKO18_SDK}/../include/profdirserviceprovider"
+ PROFILE18_LIBS="${GECKO18_SDK}/../lib/libembed_base_s.a ${GECKO18_SDK}/../lib/libprofdirserviceprovider_s.a -L${GECKO18_SDK}/../lib/ -lxpcom"
fi
OUTPUT_DIR=../../../org.eclipse.swt.motif.linux.x86
makefile="make_linux.mak"
@@ -117,6 +129,6 @@ case $OS in
;;
esac
-export JAVA_HOME MOTIF_HOME CDE_HOME GECKO_SDK GECKO_INCLUDES GECKO_LIBS OUTPUT_DIR
+export JAVA_HOME MOTIF_HOME CDE_HOME GECKO_SDK GECKO17_SDK GECKO18_SDK GECKO_INCLUDES GECKO_LIBS OUTPUT_DIR PROFILE14_INCLUDES PROFILE17_INCLUDES PROFILE18_INCLUDES PROFILE14_LIBS PROFILE17_LIBS PROFILE18_LIBS
make -f $makefile $1 $2 $3 $4
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak
index d64ebbae08..8cd204bfd2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak
@@ -59,8 +59,17 @@ CAIROCFLAGS = `pkg-config --cflags cairo`
CAIROLIBS = -shared -fpic -fPIC -s `pkg-config --libs-only-L cairo` -lcairo
MOZILLA_PREFIX = swt-mozilla
+PROFILE14_PREFIX = swt-mozilla14-profile$(GCC_VERSION)
+PROFILE17_PREFIX = swt-mozilla17-profile$(GCC_VERSION)
+PROFILE18_PREFIX = swt-mozilla18-profile$(GCC_VERSION)
MOZILLA_LIB = lib$(MOZILLA_PREFIX)$(GCC_VERSION)-$(WS_PREFIX)-$(SWT_VERSION).so
+PROFILE14_LIB = lib$(PROFILE14_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
+PROFILE17_LIB = lib$(PROFILE17_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
+PROFILE18_LIB = lib$(PROFILE18_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
MOZILLA_OBJECTS = swt.o xpcom.o xpcom_custom.o xpcom_structs.o xpcom_stats.o
+PROFILE14_OBJECTS = xpcom14_profile.o
+PROFILE17_OBJECTS = xpcom17_profile.o
+PROFILE18_OBJECTS = xpcom18_profile.o
MOZILLACFLAGS = -O \
-DXPCOM_GLUE=1 \
-DMOZILLA_STRICT_API=1 \
@@ -73,9 +82,8 @@ MOZILLACFLAGS = -O \
-I./ \
-I$(JAVA_HOME)/include \
-I$(JAVA_HOME)/include/linux \
- ${GECKO_INCLUDES} \
${SWT_PTR_CFLAGS}
-MOZILLALIBS = -shared -s -Wl,--version-script=mozilla_exports -Bsymbolic ${GECKO_LIBS}
+MOZILLALIBS = -shared -s -Wl,--version-script=mozilla_exports -Bsymbolic
GLX_PREFIX = swt-glx
GLX_LIB = lib$(GLX_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
@@ -140,19 +148,37 @@ cairo_structs.o: cairo_structs.c cairo_structs.h cairo.h swt.h
cairo_stats.o: cairo_stats.c cairo_structs.h cairo.h cairo_stats.h swt.h
$(CC) $(CFLAGS) $(CAIROCFLAGS) -c cairo_stats.c
-make_mozilla:$(MOZILLA_LIB)
+make_mozilla:$(MOZILLA_LIB) $(PROFILE14_LIB) $(PROFILE17_LIB) $(PROFILE18_LIB)
$(MOZILLA_LIB): $(MOZILLA_OBJECTS)
- $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALIBS)
+ $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALIBS) ${GECKO_LIBS}
xpcom.o: xpcom.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom.cpp
+ $(CXX) $(MOZILLACFLAGS) ${GECKO_INCLUDES} -c xpcom.cpp
xpcom_structs.o: xpcom_structs.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom_structs.cpp
+ $(CXX) $(MOZILLACFLAGS) ${GECKO_INCLUDES} -c xpcom_structs.cpp
xpcom_custom.o: xpcom_custom.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom_custom.cpp
+ $(CXX) $(MOZILLACFLAGS) ${GECKO_INCLUDES} -c xpcom_custom.cpp
xpcom_stats.o: xpcom_stats.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom_stats.cpp
+ $(CXX) $(MOZILLACFLAGS) ${GECKO_INCLUDES} -c xpcom_stats.cpp
+
+$(PROFILE14_OBJECTS): xpcom_profile.cpp
+ $(CXX) -o $(PROFILE14_OBJECTS) $(MOZILLACFLAGS) ${PROFILE14_INCLUDES} -c xpcom_profile.cpp
+
+$(PROFILE17_OBJECTS): xpcom_profile.cpp
+ $(CXX) -o $(PROFILE17_OBJECTS) $(MOZILLACFLAGS) ${PROFILE17_INCLUDES} -c xpcom_profile.cpp
+
+$(PROFILE18_OBJECTS): xpcom_profile.cpp
+ $(CXX) -o $(PROFILE18_OBJECTS) $(MOZILLACFLAGS) ${PROFILE18_INCLUDES} -c xpcom_profile.cpp
+
+$(PROFILE14_LIB): $(PROFILE14_OBJECTS)
+ $(CXX) -o $(PROFILE14_LIB) $(PROFILE14_OBJECTS) $(MOZILLALIBS) ${PROFILE14_LIBS}
+
+$(PROFILE17_LIB): $(PROFILE17_OBJECTS)
+ $(CXX) -o $(PROFILE17_LIB) $(PROFILE17_OBJECTS) $(MOZILLALIBS) ${PROFILE17_LIBS}
+
+$(PROFILE18_LIB): $(PROFILE18_OBJECTS)
+ $(CXX) -o $(PROFILE18_LIB) $(PROFILE18_OBJECTS) $(MOZILLALIBS) ${PROFILE18_LIBS}
make_glx: $(GLX_LIB)

Back to the top