temp/widgetproperty
changeset 6 19a215169796
parent 0 ad87c5e85a41
equal deleted inserted replaced
5:17b1dd932700 6:19a215169796
       
     1 diff --git a/xpcom/build/Makefile.in b/xpcom/build/Makefile.in
       
     2 --- a/xpcom/build/Makefile.in
       
     3 +++ b/xpcom/build/Makefile.in
       
     4 @@ -161,17 +161,18 @@ OS_LIBS += $(LIBICONV)
       
     5  GARBAGE         += $(XPCOM_GLUE_SRC_LCSRCS) $(XPCOM_GLUE_SRC_LCPPSRCS) $(XPCOM_GLUENS_SRC_LCPPSRCS) $(wildcard *.$(OBJ_SUFFIX))
       
     6  
       
     7  include $(topsrcdir)/config/rules.mk
       
     8  
       
     9  DEFINES		+= \
       
    10  		-D_IMPL_NS_COM \
       
    11  		-D_IMPL_NS_STRINGAPI \
       
    12  		-DEXPORT_XPT_API \
       
    13 -		-DEXPORT_XPTC_API
       
    14 +		-DEXPORT_XPTC_API \
       
    15 +		-DMOZ_WIDGET_TOOLKIT=\"$(MOZ_WIDGET_TOOLKIT)\"
       
    16  
       
    17  EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
       
    18  
       
    19  ifdef GC_LEAK_DETECTOR
       
    20  DEFINES += -DGC_LEAK_DETECTOR
       
    21  endif
       
    22  
       
    23  ifdef TARGET_XPCOM_ABI
       
    24 diff --git a/xpcom/glue/Makefile.in b/xpcom/glue/Makefile.in
       
    25 --- a/xpcom/glue/Makefile.in
       
    26 +++ b/xpcom/glue/Makefile.in
       
    27 @@ -157,11 +157,13 @@ include $(topsrcdir)/config/rules.mk
       
    28  
       
    29  ifdef _MSC_VER
       
    30  # Don't include directives about which CRT to use
       
    31  OS_COMPILE_CXXFLAGS += -Zl
       
    32  OS_COMPILE_CFLAGS += -Zl
       
    33  DEFINES += -D_USE_ANSI_CPP
       
    34  endif
       
    35  
       
    36 +DEFINES += -DMOZ_WIDGET_TOOLKIT=\"$(MOZ_WIDGET_TOOLKIT)\"
       
    37 +
       
    38  ifdef TARGET_XPCOM_ABI
       
    39  DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
       
    40  endif
       
    41 diff --git a/xpcom/glue/nsGREGlue.cpp b/xpcom/glue/nsGREGlue.cpp
       
    42 --- a/xpcom/glue/nsGREGlue.cpp
       
    43 +++ b/xpcom/glue/nsGREGlue.cpp
       
    44 @@ -157,36 +157,46 @@ GRE_GetPathFromRegKey(HKEY aRegKey,
       
    45  
       
    46  nsresult
       
    47  GRE_GetGREPathWithProperties(const GREVersionRange *versions,
       
    48                               PRUint32 versionsLength,
       
    49                               const GREProperty *properties,
       
    50                               PRUint32 propertiesLength,
       
    51                               char *aBuffer, PRUint32 aBufLen)
       
    52  {
       
    53 +  // append the widget information to be able to have multiple xulrunners
       
    54 +  // based on different widget toolkits installed
       
    55 +  static const GREProperty kWidgetProperty =
       
    56 +    { "widget", MOZ_WIDGET_TOOLKIT };
       
    57 +
       
    58  #ifdef TARGET_XPCOM_ABI
       
    59 -  // append the ABI to the properties to match only binary 
       
    60 +  // append the ABI to the properties to match only binary
       
    61    // compatible GREs
       
    62 -  static const GREProperty kExtraProperty =
       
    63 -    { "abi", TARGET_XPCOM_ABI };
       
    64 +  static const GREProperty kAbiProperty =
       
    65 +  { "abi", TARGET_XPCOM_ABI };
       
    66  
       
    67 +  GREProperty *allProperties = new GREProperty[propertiesLength + 2];
       
    68 +#else
       
    69    GREProperty *allProperties = new GREProperty[propertiesLength + 1];
       
    70 +#endif
       
    71    if (!allProperties)
       
    72      return NS_ERROR_OUT_OF_MEMORY;
       
    73  
       
    74    for (PRUint32 i=0; i<propertiesLength; i++) {
       
    75      allProperties[i].property = properties[i].property;
       
    76      allProperties[i].value    = properties[i].value;
       
    77    }
       
    78 -  allProperties[propertiesLength].property = kExtraProperty.property;
       
    79 -  allProperties[propertiesLength].value    = kExtraProperty.value;
       
    80 +  allProperties[propertiesLength].property = kWidgetProperty.property;
       
    81 +  allProperties[propertiesLength].value    = kWidgetProperty.value;
       
    82 +#ifdef TARGET_XPCOM_ABI
       
    83 +  allProperties[propertiesLength+1].property = kAbiProperty.property;
       
    84 +  allProperties[propertiesLength+1].value    = kAbiProperty.value;
       
    85 +  PRUint32 allPropertiesLength = propertiesLength + 2;
       
    86 +#else
       
    87    PRUint32 allPropertiesLength = propertiesLength + 1;
       
    88 -#else
       
    89 -  const GREProperty *allProperties = properties;
       
    90 -  PRUint32 allPropertiesLength = propertiesLength;
       
    91  #endif
       
    92  
       
    93    // if GRE_HOME is in the environment, use that GRE
       
    94    const char* env = getenv("GRE_HOME");
       
    95    if (env && *env) {
       
    96      char p[MAXPATHLEN];
       
    97      snprintf(p, sizeof(p), "%s" XPCOM_FILE_PATH_SEPARATOR XPCOM_DLL, env);
       
    98      p[sizeof(p) - 1] = '\0';
       
    99 diff --git a/xpcom/glue/standalone/Makefile.in b/xpcom/glue/standalone/Makefile.in
       
   100 --- a/xpcom/glue/standalone/Makefile.in
       
   101 +++ b/xpcom/glue/standalone/Makefile.in
       
   102 @@ -120,14 +120,15 @@ OS_COMPILE_CFLAGS += -Zl
       
   103  DEFINES += -D_USE_ANSI_CPP
       
   104  endif
       
   105  
       
   106  export:: $(XPCOM_GLUE_SRC_CSRCS) $(XPCOM_GLUE_SRC_CPPSRCS) $(topsrcdir)/xpcom/glue/nsStringAPI.cpp
       
   107  	$(INSTALL) $^ .
       
   108  
       
   109  GARBAGE += nsStringAPI.cpp
       
   110  
       
   111 -DEFINES		+= -DXPCOM_GLUE
       
   112 +DEFINES		+= -DXPCOM_GLUE \
       
   113 +                   -DMOZ_WIDGET_TOOLKIT=\"$(MOZ_WIDGET_TOOLKIT)\"
       
   114  
       
   115  ifdef TARGET_XPCOM_ABI
       
   116  DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
       
   117  endif
       
   118  
       
   119 diff --git a/xulrunner/app/Makefile.in b/xulrunner/app/Makefile.in
       
   120 --- a/xulrunner/app/Makefile.in
       
   121 +++ b/xulrunner/app/Makefile.in
       
   122 @@ -59,17 +59,18 @@ PROGRAM = xulrunner$(BIN_SUFFIX)
       
   123  else
       
   124  ifeq ($(OS_ARCH), BeOS)
       
   125  PROGRAM = xulrunner$(BIN_SUFFIX)
       
   126  else
       
   127  PROGRAM = xulrunner-bin$(BIN_SUFFIX)
       
   128  endif
       
   129  endif
       
   130  
       
   131 -DEFINES += -DXULRUNNER_PROGNAME=\"xulrunner\"
       
   132 +DEFINES += -DXULRUNNER_PROGNAME=\"xulrunner\" \
       
   133 +           -DMOZ_WIDGET_TOOLKIT=\"$(MOZ_WIDGET_TOOLKIT)\"
       
   134  
       
   135  ifdef MOZ_JAVAXPCOM
       
   136  DEFINES += -DMOZ_JAVAXPCOM
       
   137  endif
       
   138  
       
   139  ifdef TARGET_XPCOM_ABI
       
   140  DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
       
   141  endif
       
   142 diff --git a/xulrunner/app/nsXULRunnerApp.cpp b/xulrunner/app/nsXULRunnerApp.cpp
       
   143 --- a/xulrunner/app/nsXULRunnerApp.cpp
       
   144 +++ b/xulrunner/app/nsXULRunnerApp.cpp
       
   145 @@ -257,17 +257,18 @@ InstallXULApp(nsIFile* aXULRunnerDir,
       
   146  
       
   147    if (NS_FAILED(rv))
       
   148      return 3;
       
   149  
       
   150    return 0;
       
   151  }
       
   152  
       
   153  static const GREProperty kGREProperties[] = {
       
   154 -  { "xulrunner", "true" }
       
   155 +  { "xulrunner", "true" },
       
   156 +  { "widget", MOZ_WIDGET_TOOLKIT }
       
   157  #ifdef TARGET_XPCOM_ABI
       
   158    , { "abi", TARGET_XPCOM_ABI }
       
   159  #endif
       
   160  #ifdef MOZ_JAVAXPCOM
       
   161    , { "javaxpcom", "1" }
       
   162  #endif
       
   163  };
       
   164  
       
   165 diff --git a/xulrunner/installer/Makefile.in b/xulrunner/installer/Makefile.in
       
   166 --- a/xulrunner/installer/Makefile.in
       
   167 +++ b/xulrunner/installer/Makefile.in
       
   168 @@ -63,18 +63,18 @@ endif
       
   169  
       
   170  include $(topsrcdir)/config/rules.mk
       
   171  
       
   172  INSTALL_SDK = 1
       
   173  
       
   174  include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
       
   175  
       
   176  $(MOZILLA_VERSION).system.conf: $(topsrcdir)/config/milestone.txt Makefile
       
   177 -	printf "[%s]\nGRE_PATH=%s\nxulrunner=true\nabi=%s" \
       
   178 -	  $(MOZILLA_VERSION) $(installdir) $(TARGET_XPCOM_ABI)> $@
       
   179 +	printf "[%s]\nGRE_PATH=%s\nxulrunner=true\nwidget=%s\nabi=%s" \
       
   180 +	  $(MOZILLA_VERSION) $(installdir) $(MOZ_WIDGET_TOOLKIT) $(TARGET_XPCOM_ABI)> $@
       
   181  
       
   182  ifndef SKIP_GRE_REGISTRATION
       
   183  # to register xulrunner per-user, override this with $HOME/.gre.d
       
   184  regdir = /etc/gre.d
       
   185  
       
   186  install:: $(MOZILLA_VERSION).system.conf
       
   187  	$(NSINSTALL) -D $(DESTDIR)$(regdir)
       
   188  	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(regdir)