diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-08 05:59:22 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-08 07:09:11 -0500 |
commit | f26f28a54c3ee47ea1ebe446f679432f935a8c8e (patch) | |
tree | 4ccaa267d164be0a486968dc1a3db27d24643516 /build | |
parent | d3e1e49a9c82a07f25ca990f349f5595f6848b35 (diff) | |
download | palemoon-gre-f26f28a54c3ee47ea1ebe446f679432f935a8c8e.tar.gz |
Add configure variable verification
Diffstat (limited to 'build')
-rw-r--r-- | build/directive4.py | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/build/directive4.py b/build/directive4.py new file mode 100644 index 000000000..e77ef4675 --- /dev/null +++ b/build/directive4.py @@ -0,0 +1,59 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# Imports +from __future__ import print_function, unicode_literals +from collections import OrderedDict + +import os +import sys + +# Sanity check +if not len(sys.argv) > 1: + print("Incorrect number of arguments") + sys.exit(1) + +# Vars +listConfigure = sys.argv[1:] +listConfig = [] +strBrandingDirectory = "" + +# Build a list of set configure variables +for _value in listConfigure: + _splitString = _value.split("=") + + if _splitString[1] == "1": + listConfig += [ _splitString[0] ] + elif _splitString[0] == "MOZ_BRANDING_DIRECTORY": + strBrandingDirectory = _splitString[1] + +# Only applies if using Official Branding or specific branding directories +if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("branding/official")) or (strBrandingDirectory.endswith("branding/unstable")): + # Applies to Pale Moon + if ('MOZ_PHOENIX' in listConfig): + # Define a list of system libs and features that are in violation of Official branding + listViolations = [ + 'MOZ_NATIVE_LIBEVENT', + 'MOZ_NATIVE_NSS', + 'MOZ_NATIVE_NSPR', + 'MOZ_NATIVE_JPEG', + 'MOZ_NATIVE_ZLIB', + 'MOZ_NATIVE_BZ2', + 'MOZ_NATIVE_PNG', + 'MOZ_NATIVE_LIBVPX', + 'MOZ_NATIVE_SQLITE', + 'MOZ_NATIVE_JEMALLOC', + 'MOZ_SANDBOX' + ] + + # Iterate items 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) + + |