diff --git a/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in b/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in index ef7bbe53b8d..58d317e5645 100644 --- a/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in +++ b/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in @@ -1022,18 +1022,26 @@ function UpdateService() { LOG("UpdateService", "XPCOM ABI unknown: updates are not possible."); } + var osVersion; + var sysInfo = Components.classes["@mozilla.org/system-info;1"] + .getService(Components.interfaces.nsIPropertyBag2); try { - var sysInfo = - Components.classes["@mozilla.org/system-info;1"] - .getService(Components.interfaces.nsIPropertyBag2); - - gOSVersion = encodeURIComponent(sysInfo.getProperty("name") + " " + - sysInfo.getProperty("version")); + osVersion = sysInfo.getProperty("name") + " " + sysInfo.getProperty("version"); } catch (e) { LOG("UpdateService", "OS Version unknown: updates are not possible."); } + if (osVersion) { + try { + osVersion += " (" + sysInfo.getProperty("secondaryLibrary") + ")"; + } + catch (e) { + // Not all platforms have a secondary widget library, so an error is nothing to worry about. + } + gOSVersion = encodeURIComponent(osVersion); + } + #ifdef XP_MACOSX // Mac universal build should report a different ABI than either macppc // or mactel. diff --git a/mozilla/xpcom/base/Makefile.in b/mozilla/xpcom/base/Makefile.in index 4b95919ae92..4213020a66a 100644 --- a/mozilla/xpcom/base/Makefile.in +++ b/mozilla/xpcom/base/Makefile.in @@ -148,3 +148,7 @@ include $(topsrcdir)/config/rules.mk DEFINES += -D_IMPL_NS_COM +ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT))) +CXXFLAGS += $(MOZ_GTK2_CFLAGS) +endif + diff --git a/mozilla/xpcom/base/nsSystemInfo.cpp b/mozilla/xpcom/base/nsSystemInfo.cpp index c93a9310a66..821370457e7 100644 --- a/mozilla/xpcom/base/nsSystemInfo.cpp +++ b/mozilla/xpcom/base/nsSystemInfo.cpp @@ -39,6 +39,11 @@ #include "nsSystemInfo.h" #include "prsystem.h" #include "nsString.h" +#include "prprf.h" + +#ifdef MOZ_WIDGET_GTK2 +#include +#endif nsSystemInfo::nsSystemInfo() { @@ -74,6 +79,17 @@ nsSystemInfo::Init() else NS_WARNING("PR_GetSystemInfo failed"); } + +#ifdef MOZ_WIDGET_GTK2 + // This must be done here because NSPR can only separate OS's when compiled, not libraries. + char* gtkver = PR_smprintf("GTK %u.%u.%u", gtk_major_version, gtk_minor_version, gtk_micro_version); + if (gtkver) { + rv = SetPropertyAsACString(NS_ConvertASCIItoUTF16("secondaryLibrary"), + nsDependentCString(gtkver)); + PR_smprintf_free(gtkver); + NS_ENSURE_SUCCESS(rv, rv); + } +#endif return NS_OK; } diff --git a/mozilla/xpcom/build/Makefile.in b/mozilla/xpcom/build/Makefile.in index 791bc6a137c..4532896a0b9 100644 --- a/mozilla/xpcom/build/Makefile.in +++ b/mozilla/xpcom/build/Makefile.in @@ -186,6 +186,10 @@ ifeq ($(OS_ARCH),BeOS) EXTRA_DSO_LDOPTS += -lbe endif +ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT))) +EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) +endif + ifeq ($(OS_ARCH),WINNT) EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME,shell32 ole32 uuid version) ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))