1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

Convert MOZILLA_OFFICIAL conditionals to MC_OFFICIAL where needed.

- `--enable-official-branding` implies `MC_OFFICIAL` (no need to specifically set it)
- `--enable-official-vendor` can be used to set `MC_OFFICIAL` on builds without `--enable-official-branding` that should still be considered official release versions.
- `MC_OFFICIAL` implies `--enable-release`, meaning `DEVELOPER_OPTIONS` isn't set
- `MC_OFFICIAL` makes `nsXULAppInfo.getIsOfficial` return `true`
- `MC_OFFICIAL` makes `AppConstants.MOZILLA_OFFICIAL` (for compatibility in extensions) and `AppConstants.MC_OFFICIAL` return `true`
- Optional, for the time being: `MOZILLA_OFFICIAL` is still present in some places in case someone wants to build a Mozilla-alike official application and has the rights and necessary keys to use Mozilla-official third-party services. This must always be combined with `MC_OFFICIAL` to have a sane combination of defines. This may be removed in the future.
This commit is contained in:
wolfbeast
2018-04-13 22:06:20 +02:00
committed by Roy Tam
parent 81228c3a44
commit d37246737b
12 changed files with 32 additions and 21 deletions
@@ -44,7 +44,7 @@ this.AboutHomeUtils = {
return !Services.prefs.getBoolPref("browser.EULA.override");
} catch (e) { }
#ifndef MOZILLA_OFFICIAL
#ifndef MC_OFFICIAL
// Non-official builds shouldn't show the notification.
return false;
#endif
+4 -1
View File
@@ -37,5 +37,8 @@ EXTRA_PP_JS_MODULES += [
'RecentWindow.jsm',
]
# Pass down 'official build' flags
if CONFIG['MC_OFFICIAL']:
DEFINES['MC_OFFICIAL'] = 1
if CONFIG['MOZILLA_OFFICIAL']:
DEFINES['MOZILLA_OFFICIAL'] = 1
DEFINES['MOZILLA_OFFICIAL'] = 1
+1 -1
View File
@@ -47,7 +47,7 @@ this.AboutHomeUtils = {
return !Services.prefs.getBoolPref("browser.EULA.override");
} catch (e) { }
if (!AppConstants.MOZILLA_OFFICIAL) {
if (!AppConstants.MC_OFFICIAL) {
// Non-official builds shouldn't show the notification.
return false;
}
+1 -1
View File
@@ -7,7 +7,7 @@ dnl Add compiler specific options
AC_DEFUN([MOZ_DEFAULT_COMPILER],
[
dnl set DEVELOPER_OPTIONS early; MOZ_DEFAULT_COMPILER is usually the first non-setup directive
if test -z "$MOZILLA_OFFICIAL"; then
if test -z "$MC_OFFICIAL"; then
DEVELOPER_OPTIONS=1
fi
MOZ_ARG_ENABLE_BOOL(release,
+1 -1
View File
@@ -16,7 +16,7 @@ ifndef RESFILE
RCFILE=./module.rc
RESFILE=./module.res
_RC_STRING = -QUIET 1 -DEPTH $(DEPTH) -TOPSRCDIR $(MOZILLA_DIR) -OBJDIR . -SRCDIR $(srcdir) -DISPNAME $(MOZ_APP_DISPLAYNAME) -APPVERSION $(MOZ_APP_VERSION)
ifdef MOZILLA_OFFICIAL
ifdef MC_OFFICIAL
_RC_STRING += -OFFICIAL 1
endif
ifdef MOZ_DEBUG
+1
View File
@@ -2112,6 +2112,7 @@ AC_SUBST(MOZ_APP_VERSION)
AC_SUBST(MOZ_PKG_SPECIAL)
AC_SUBST(MOZILLA_OFFICIAL)
AC_SUBST(MC_OFFICIAL)
dnl ========================================================
dnl ECMAScript Internationalization API Support (uses ICU)
+9 -9
View File
@@ -2264,7 +2264,7 @@ MOZ_ARG_HEADER(Application)
ENABLE_SYSTEM_EXTENSION_DIRS=1
MOZ_BRANDING_DIRECTORY=
MOZ_OFFICIAL_BRANDING=
MC_OFFICIAL=1
MC_OFFICIAL=
MOZ_FEEDS=1
MOZ_AUTH_EXTENSION=1
if test "$MOZ_IOS"; then
@@ -2357,10 +2357,10 @@ AC_SUBST(MOZ_ANDROID_DISTRIBUTION_DIRECTORY)
dnl ========================================================
dnl = Vendor override
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(official-vendor,
[ --disable-official-vendor Disable the use of official vendor.],
MC_OFFICIAL=,
MC_OFFICIAL=1)
MOZ_ARG_ENABLE_BOOL(official-vendor,
[ --enable-official-vendor This is an official release build.],
MC_OFFICIAL=1,
MC_OFFICIAL=)
dnl ========================================================
@@ -2368,11 +2368,10 @@ dnl = Trademarked Branding
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(official-branding,
[ --enable-official-branding
Enable Official mozilla.org Branding
Enable Official Branding
Do not distribute builds with
--enable-official-branding unless you have
permission to use trademarks per
http://www.mozilla.org/foundation/trademarks/ .],
permission to use our trademarks!],
MOZ_OFFICIAL_BRANDING=1,
MOZ_OFFICIAL_BRANDING=)
@@ -2592,6 +2591,7 @@ if test -n "$MOZ_OFFICIAL_BRANDING"; then
else
MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
AC_DEFINE(MOZ_OFFICIAL_BRANDING)
dnl Using official branding implies an official release build.
MC_OFFICIAL=1
fi
fi
@@ -5567,7 +5567,7 @@ AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
AC_SUBST(MOZILLA_OFFICIAL)
if test "$MOZILLA_OFFICIAL"; then
AC_DEFINE(MOZILLA_OFFICIAL)
# Build revisions should always be present in official builds
# Build revisions should always be present in official Mozilla builds
MOZ_INCLUDE_SOURCE_INFO=1
fi
+1 -1
View File
@@ -90,7 +90,7 @@ def build_dict(config, env=os.environ):
d['bin_suffix'] = substs.get('BIN_SUFFIX', '')
d['addon_signing'] = substs.get('MOZ_ADDON_SIGNING') == '1'
d['require_signing'] = substs.get('MOZ_REQUIRE_SIGNING') == '1'
d['official'] = bool(substs.get('MOZILLA_OFFICIAL'))
d['official'] = bool(substs.get('MC_OFFICIAL'))
d['sm_promise'] = bool(substs.get('SPIDERMONKEY_PROMISE'))
def guess_platform():
+1 -1
View File
@@ -12,7 +12,7 @@ toolkit.jar:
content/global/about.xhtml
content/global/aboutAbout.js
content/global/aboutAbout.xhtml
#ifdef MOZILLA_OFFICIAL
#ifdef MC_OFFICIAL
content/global/aboutRights.xhtml
#else
content/global/aboutRights.xhtml (aboutRights-unbranded.xhtml)
+10 -3
View File
@@ -36,11 +36,18 @@ this.AppConstants = Object.freeze({
false,
#endif
// Official corresponds, roughly, to whether this build is performed
// on Mozilla's continuous integration infrastructure. You should
// Official corresponds to whether this build is considered an
// official, branded release for the public. You should
// disable developer-only functionality when this flag is set.
// MOZILLA_OFFICIAL is deprecated but kept for extension compatibility.
MOZILLA_OFFICIAL:
#ifdef MOZILLA_OFFICIAL
#ifdef MC_OFFICIAL
true,
#else
false,
#endif
MC_OFFICIAL:
#ifdef MC_OFFICIAL
true,
#else
false,
+1 -1
View File
@@ -1024,7 +1024,7 @@ nsXULAppInfo::GetDistributionID(nsACString& aResult)
NS_IMETHODIMP
nsXULAppInfo::GetIsOfficial(bool* aResult)
{
#ifdef MOZILLA_OFFICIAL
#ifdef MC_OFFICIAL
*aResult = true;
#else
*aResult = false;
+1 -1
View File
@@ -164,7 +164,7 @@ interface nsIXULRuntime : nsISupports
readonly attribute AUTF8String distributionID;
/**
* True if this is an official build (MOZILLA_OFFICIAL).
* True if this is an official build (MC_OFFICIAL).
*/
readonly attribute boolean isOfficial;