From eebeefbf29447f02ce172c4e4910036c656bac73 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Wed, 28 Feb 2018 13:00:52 -0500 Subject: Update configure variable verification --- browser/base/content/aboutDialog.xul | 8 +++++++- build/directive4.py | 31 +++++++++++-------------------- build/moz.configure/old.configure | 1 + old-configure.in | 25 +++++++++++++++++++++++-- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/browser/base/content/aboutDialog.xul b/browser/base/content/aboutDialog.xul index f64e79681..5780e5ec1 100644 --- a/browser/base/content/aboutDialog.xul +++ b/browser/base/content/aboutDialog.xul @@ -122,12 +122,18 @@ &warningDesc.version; +#ifdef MC_PRIVATE_BUILD + + This is a private build of Basilisk. If you did not manually build this copy from source yourself, then please download an official version from the . + +#else Basilisk is community software released by and Mozilla developers. Learn to this software. - Want to help? Please consider or get involved with our of the Unified XUL Platform. + Want to help? Please consider or get involved with our of the Unified XUL Platform. +#endif diff --git a/build/directive4.py b/build/directive4.py index 2a49f3028..8f05eeed5 100644 --- a/build/directive4.py +++ b/build/directive4.py @@ -4,11 +4,9 @@ # Imports from __future__ import print_function, unicode_literals -from collections import OrderedDict import os import sys -import json # Sanity check if not len(sys.argv) > 1: @@ -19,6 +17,7 @@ if not len(sys.argv) > 1: listConfigure = sys.argv[1:] listConfig = [] strBrandingDirectory = "" +listViolations = [] # Build a list of set configure variables for _value in listConfigure: @@ -33,8 +32,8 @@ for _value in listConfigure: if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("branding/official")) or (strBrandingDirectory.endswith("branding/unstable")): # Applies to Pale Moon and Basilisk if ('MC_BASILISK' in listConfig) or ('MC_PALEMOON' in listConfig): - # Define a list of system libs - listSystemLibs = [ + listViolations += [ + 'MOZ_SANDBOX', 'MOZ_SYSTEM_LIBEVENT', 'MOZ_SYSTEM_NSS', 'MOZ_SYSTEM_NSPR', @@ -47,25 +46,17 @@ if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("br 'MOZ_SYSTEM_JEMALLOC' ] - # Iterate through system libs and output 1 to DIRECTIVE4 if any are found - for _value in listSystemLibs: - if _value in listConfig: - sys.stdout.write("1") - sys.exit(1) - - # Applies only to Pale Moon + # Applies to Pale Moon Only if 'MC_PALEMOON' in listConfig: - # Define a list of configure features that are in violation of Official branding - listFeatureViolations = [ - 'MOZ_SANDBOX', + listViolations += [ 'MOZ_WEBRTC' ] - - # Iterate through features and output 1 to DIRECTIVE4 if any violations are found - for _value in listFeatureViolations: - if _value in listConfig: - sys.stdout.write("1") - sys.exit(1) + + # Iterate through enabled violations and output 1 to DIRECTIVE4 if any are found + for _value in listViolations: + if _value in listConfig: + sys.stdout.write("1") + sys.exit(1) # Exit outputting nothing to DIRECTIVE4 being empty because there are no violations sys.exit(0) diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index c9bdc9682..ffdea81b0 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -214,6 +214,7 @@ def old_configure_options(*options): '--enable-png-arm-neon-support', '--enable-posix-nspr-emulation', '--enable-pref-extensions', + '--enable-private-build', '--enable-pulseaudio', '--enable-raw', '--enable-readline', diff --git a/old-configure.in b/old-configure.in index 3cb499b93..b257a9efd 100644 --- a/old-configure.in +++ b/old-configure.in @@ -2623,6 +2623,22 @@ fi AC_SUBST(MOZ_BRANDING_DIRECTORY) +dnl ======================================================== +dnl = Private Build +dnl ======================================================== +MOZ_ARG_ENABLE_BOOL(private-build, +[ --enable-private-build Enable private builds + This allows you to build with official + branding for personal use only using any + build time configuration.], + MC_PRIVATE_BUILD=1, + MC_PRIVATE_BUILD=) + +AC_SUBST(MC_PRIVATE_BUILD) +if test -n "$MC_PRIVATE_BUILD"; then + AC_DEFINE(MC_PRIVATE_BUILD) +fi + dnl ======================================================== dnl = Distribution ID dnl ======================================================== @@ -5771,7 +5787,8 @@ dnl ======================================================== dnl Directive 4 dnl ======================================================== -DIRECTIVE4_LIST="MOZ_OFFICIAL_BRANDING=$MOZ_OFFICIAL_BRANDING +DIRECTIVE4_LIST=" +MOZ_OFFICIAL_BRANDING=$MOZ_OFFICIAL_BRANDING MOZ_BRANDING_DIRECTORY=$MOZ_BRANDING_DIRECTORY MC_BASILISK=$MC_BASILISK MC_PALEMOON=$MC_PALEMOON @@ -5791,7 +5808,11 @@ MOZ_SYSTEM_JEMALLOC=$MOZ_SYSTEM_JEMALLOC" DIRECTIVE4=`$PYTHON $_topsrcdir/build/directive4.py $DIRECTIVE4_LIST` if test -n "$DIRECTIVE4"; then - AC_ERROR([Branding Violation - Please see: http://www.palemoon.org/redist.shtml]) + if test -n "$MC_PRIVATE_BUILD"; then + AC_MSG_WARN([Private Build - The configuration you have chosen to use with official branding deviates from official build configuration. Your build is thus for personal and private use only and must not be (re)distributed - Please see: http://www.palemoon.org/redist.shtml]) + else + AC_MSG_ERROR([Branding Violation - Please see: http://www.palemoon.org/redist.shtml]) + fi fi AC_SUBST(DIRECTIVE4) -- cgit v1.2.3