diff -r 000000000000 -r ad87c5e85a41 widgetproperty --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetproperty Sat Nov 28 13:56:10 2009 +0100 @@ -0,0 +1,188 @@ +diff --git a/xpcom/build/Makefile.in b/xpcom/build/Makefile.in +--- a/xpcom/build/Makefile.in ++++ b/xpcom/build/Makefile.in +@@ -161,17 +161,18 @@ OS_LIBS += $(LIBICONV) + GARBAGE += $(XPCOM_GLUE_SRC_LCSRCS) $(XPCOM_GLUE_SRC_LCPPSRCS) $(XPCOM_GLUENS_SRC_LCPPSRCS) $(wildcard *.$(OBJ_SUFFIX)) + + include $(topsrcdir)/config/rules.mk + + DEFINES += \ + -D_IMPL_NS_COM \ + -D_IMPL_NS_STRINGAPI \ + -DEXPORT_XPT_API \ +- -DEXPORT_XPTC_API ++ -DEXPORT_XPTC_API \ ++ -DMOZ_WIDGET_TOOLKIT=\"$(MOZ_WIDGET_TOOLKIT)\" + + EXTRA_DSO_LDOPTS += $(NSPR_LIBS) + + ifdef GC_LEAK_DETECTOR + DEFINES += -DGC_LEAK_DETECTOR + endif + + ifdef TARGET_XPCOM_ABI +diff --git a/xpcom/glue/Makefile.in b/xpcom/glue/Makefile.in +--- a/xpcom/glue/Makefile.in ++++ b/xpcom/glue/Makefile.in +@@ -157,11 +157,13 @@ include $(topsrcdir)/config/rules.mk + + ifdef _MSC_VER + # Don't include directives about which CRT to use + OS_COMPILE_CXXFLAGS += -Zl + OS_COMPILE_CFLAGS += -Zl + DEFINES += -D_USE_ANSI_CPP + endif + ++DEFINES += -DMOZ_WIDGET_TOOLKIT=\"$(MOZ_WIDGET_TOOLKIT)\" ++ + ifdef TARGET_XPCOM_ABI + DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\" + endif +diff --git a/xpcom/glue/nsGREGlue.cpp b/xpcom/glue/nsGREGlue.cpp +--- a/xpcom/glue/nsGREGlue.cpp ++++ b/xpcom/glue/nsGREGlue.cpp +@@ -157,36 +157,46 @@ GRE_GetPathFromRegKey(HKEY aRegKey, + + nsresult + GRE_GetGREPathWithProperties(const GREVersionRange *versions, + PRUint32 versionsLength, + const GREProperty *properties, + PRUint32 propertiesLength, + char *aBuffer, PRUint32 aBufLen) + { ++ // append the widget information to be able to have multiple xulrunners ++ // based on different widget toolkits installed ++ static const GREProperty kWidgetProperty = ++ { "widget", MOZ_WIDGET_TOOLKIT }; ++ + #ifdef TARGET_XPCOM_ABI +- // append the ABI to the properties to match only binary ++ // append the ABI to the properties to match only binary + // compatible GREs +- static const GREProperty kExtraProperty = +- { "abi", TARGET_XPCOM_ABI }; ++ static const GREProperty kAbiProperty = ++ { "abi", TARGET_XPCOM_ABI }; + ++ GREProperty *allProperties = new GREProperty[propertiesLength + 2]; ++#else + GREProperty *allProperties = new GREProperty[propertiesLength + 1]; ++#endif + if (!allProperties) + return NS_ERROR_OUT_OF_MEMORY; + + for (PRUint32 i=0; i $@ ++ printf "[%s]\nGRE_PATH=%s\nxulrunner=true\nwidget=%s\nabi=%s" \ ++ $(MOZILLA_VERSION) $(installdir) $(MOZ_WIDGET_TOOLKIT) $(TARGET_XPCOM_ABI)> $@ + + ifndef SKIP_GRE_REGISTRATION + # to register xulrunner per-user, override this with $HOME/.gre.d + regdir = /etc/gre.d + + install:: $(MOZILLA_VERSION).system.conf + $(NSINSTALL) -D $(DESTDIR)$(regdir) + $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(regdir)