Bug 420373 - "need a way to distinguish GREs based on architecture in nsGREGlue" [p=mozilla@rosenauer.org (Wolfgang Rosenauer) r=bsmedberg a1.9b5=schrep]

This commit is contained in:
reed@reedloden.com 2008-03-21 21:25:34 -07:00
Родитель 9ba71b0afd
Коммит 33e8801ec8
7 изменённых файлов: 59 добавлений и 16 удалений

Просмотреть файл

@ -174,6 +174,10 @@ ifdef GC_LEAK_DETECTOR
DEFINES += -DGC_LEAK_DETECTOR
endif
ifdef TARGET_XPCOM_ABI
DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
CXXFLAGS += $(TK_CFLAGS)
EXTRA_DSO_LDOPTS += \

Просмотреть файл

@ -145,3 +145,7 @@ OS_COMPILE_CXXFLAGS += -Zl
OS_COMPILE_CFLAGS += -Zl
DEFINES += -D_USE_ANSI_CPP
endif
ifdef TARGET_XPCOM_ABI
DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
endif

Просмотреть файл

@ -153,6 +153,28 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
PRUint32 propertiesLength,
char *aBuffer, PRUint32 aBufLen)
{
#ifdef TARGET_XPCOM_ABI
// append the ABI to the properties to match only binary
// compatible GREs
static const GREProperty kExtraProperty =
{ "abi", TARGET_XPCOM_ABI };
GREProperty *allProperties = new GREProperty[propertiesLength + 1];
if (!allProperties)
return NS_ERROR_OUT_OF_MEMORY;
for (PRUint32 i=0; i<propertiesLength; i++) {
allProperties[i].property = properties[i].property;
allProperties[i].value = properties[i].value;
}
allProperties[propertiesLength].property = kExtraProperty.property;
allProperties[propertiesLength].value = kExtraProperty.value;
PRUint32 allPropertiesLength = propertiesLength + 1;
#else
GREProperty *allProperties = properties;
PRUint32 allPropertiesLength = propertiesLength;
#endif
// if GRE_HOME is in the environment, use that GRE
const char* env = getenv("GRE_HOME");
if (env && *env) {
@ -256,7 +278,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
const char *home = getenv("HOME");
if (home && *home && GRE_FindGREFramework(home,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -264,7 +286,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
// Check /Library/Frameworks/XUL.framework/Versions/<version>/libxpcom.dylib
if (GRE_FindGREFramework("",
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -273,7 +295,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
env = getenv("MOZ_GRE_CONF");
if (env && GRE_GetPathFromConfigFile(env,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -289,7 +311,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
if (GRE_GetPathFromConfigFile(buffer,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -301,7 +323,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
if (GRE_GetPathFromConfigDir(buffer,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -310,7 +332,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
// Look for a global /etc/gre.conf file
if (GRE_GetPathFromConfigFile(GRE_CONF_PATH,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -318,7 +340,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
// Look for a group of config files in /etc/gre.d/
if (GRE_GetPathFromConfigDir(GRE_CONF_DIR,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -327,7 +349,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
env = getenv("MOZ_GRE_CONF");
if (env && GRE_GetPathFromConfigFile(env,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -342,7 +364,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
if (GRE_GetPathFromConfigFile(buffer,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -353,7 +375,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
if (GRE_GetPathFromConfigDir(buffer,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -369,7 +391,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
"%s" XPCOM_FILE_PATH_SEPARATOR GRE_CONF_PATH, p);
if (GRE_GetPathFromConfigFile(buffer,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -379,7 +401,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
"%s" XPCOM_FILE_PATH_SEPARATOR GRE_CONF_DIR, p);
if (GRE_GetPathFromConfigDir(buffer,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen)) {
return NS_OK;
}
@ -403,7 +425,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
KEY_READ, &hRegKey) == ERROR_SUCCESS) {
PRBool ok = GRE_GetPathFromRegKey(hRegKey,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen);
::RegCloseKey(hRegKey);
@ -415,7 +437,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
KEY_ENUMERATE_SUB_KEYS, &hRegKey) == ERROR_SUCCESS) {
PRBool ok = GRE_GetPathFromRegKey(hRegKey,
versions, versionsLength,
properties, propertiesLength,
allProperties, allPropertiesLength,
aBuffer, aBufLen);
::RegCloseKey(hRegKey);
@ -659,7 +681,7 @@ GRE_GetPathFromRegKey(HKEY aRegKey,
// <Property>=<value> (REG_SZ)
//
// Additional meta-info may be available in the future, including
// localization info, ABI, and other information which might be pertinent
// localization info and other information which might be pertinent
// to selecting one GRE over another.
//
// When a GRE is being registered, it should try to register itself at

Просмотреть файл

@ -126,3 +126,8 @@ export:: $(XPCOM_GLUE_SRC_CSRCS) $(XPCOM_GLUE_SRC_CPPSRCS) $(topsrcdir)/xpcom/gl
GARBAGE += nsStringAPI.cpp
DEFINES += -DXPCOM_GLUE
ifdef TARGET_XPCOM_ABI
DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
endif

Просмотреть файл

@ -65,6 +65,10 @@ ifdef MOZ_JAVAXPCOM
DEFINES += -DMOZ_JAVAXPCOM
endif
ifdef TARGET_XPCOM_ABI
DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
endif
REQUIRES = \
xpcom \
string \

Просмотреть файл

@ -253,6 +253,9 @@ InstallXULApp(nsIFile* aXULRunnerDir,
static const GREProperty kGREProperties[] = {
{ "xulrunner", "true" }
#ifdef TARGET_XPCOM_ABI
, { "abi", TARGET_XPCOM_ABI }
#endif
#ifdef MOZ_JAVAXPCOM
, { "javaxpcom", "1" }
#endif

Просмотреть файл

@ -68,7 +68,8 @@ INSTALL_SDK = 1
include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
$(MOZILLA_VERSION).system.conf: $(topsrcdir)/config/milestone.txt Makefile
printf "[%s]\nGRE_PATH=%s\nxulrunner=true" $(MOZILLA_VERSION) $(installdir)> $@
printf "[%s]\nGRE_PATH=%s\nxulrunner=true\nabi=%s" \
$(MOZILLA_VERSION) $(installdir) $(TARGET_XPCOM_ABI)> $@
ifndef SKIP_GRE_REGISTRATION
# to register xulrunner per-user, override this with $HOME/.gre.d