Browse Source

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.
pull/1/head
wolfbeast 4 years ago committed by Roy Tam
parent
commit
d37246737b
  1. 2
      application/palemoon/modules/AboutHomeUtils.jsm
  2. 5
      application/palemoon/modules/moz.build
  3. 2
      browser/modules/AboutHome.jsm
  4. 2
      build/autoconf/compiler-opts.m4
  5. 2
      config/version.mk
  6. 1
      js/src/old-configure.in
  7. 18
      old-configure.in
  8. 2
      python/mozbuild/mozbuild/mozinfo.py
  9. 2
      toolkit/content/jar.mn
  10. 13
      toolkit/modules/AppConstants.jsm
  11. 2
      toolkit/xre/nsAppRunner.cpp
  12. 2
      xpcom/system/nsIXULRuntime.idl

2
application/palemoon/modules/AboutHomeUtils.jsm

@ -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

5
application/palemoon/modules/moz.build

@ -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

2
browser/modules/AboutHome.jsm

@ -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;
}

2
build/autoconf/compiler-opts.m4

@ -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,

2
config/version.mk

@ -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
js/src/old-configure.in

@ -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)

18
old-configure.in

@ -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

2
python/mozbuild/mozbuild/mozinfo.py

@ -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():

2
toolkit/content/jar.mn

@ -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)

13
toolkit/modules/AppConstants.jsm

@ -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,

2
toolkit/xre/nsAppRunner.cpp

@ -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;

2
xpcom/system/nsIXULRuntime.idl

@ -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;

Loading…
Cancel
Save