Add configure variable verification

This commit is contained in:
NTD
2018-02-08 05:59:22 -05:00
committed by Roy Tam
parent 11cf1c3ad2
commit a12d7d51bb
3 changed files with 110 additions and 0 deletions
+4
View File
@@ -88,6 +88,9 @@
</vbox>
<description class="text-pmcreds">
#ifdef MC_PRIVATE_BUILD
This is a private build of Pale Moon. If you did not manually build this copy from source yourself, then please download an official version from the <label class="text-link" href="http://www.palemoon.org/">Pale Moon website</label>.
#else
Pale Moon is released by <label class="text-link" href="http://www.moonchildproductions.info">Moonchild Productions</label>.
</description>
<description class="text-pmcreds">
@@ -96,6 +99,7 @@
<description class="text-blurb">
If you wish to contribute, please consider helping out by providing support to other users on the <label class="text-link" href="https://forum.palemoon.org/">Pale Moon forum</label>
or getting involved in our development by tackling some of the issues found in our GitHub issue tracker.
#endif
</description>
</vbox>
</vbox>
+59
View File
@@ -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)
+47
View File
@@ -4689,6 +4689,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 ========================================================
@@ -8584,6 +8600,37 @@ AC_SUBST(MOZILLA_VERSION)
AC_SUBST(ac_configure_args)
dnl ========================================================
dnl Directive 4
dnl ========================================================
DIRECTIVE4_LIST="MOZ_OFFICIAL_BRANDING=$MOZ_OFFICIAL_BRANDING
MOZ_BRANDING_DIRECTORY=$MOZ_BRANDING_DIRECTORY
MOZ_PHOENIX=$MOZ_PHOENIX
MOZ_SANDBOX=$MOZ_SANDBOX
MOZ_NATIVE_LIBEVENT=$MOZ_NATIVE_LIBEVENT
MOZ_NATIVE_NSS=$MOZ_NATIVE_NSS
MOZ_NATIVE_NSPR=$MOZ_NATIVE_NSPR
MOZ_NATIVE_JPEG=$MOZ_NATIVE_JPEG
MOZ_NATIVE_ZLIB=$MOZ_NATIVE_ZLIB
MOZ_NATIVE_BZ2=$MOZ_NATIVE_BZ2
MOZ_NATIVE_PNG=$MOZ_NATIVE_PNG
MOZ_NATIVE_LIBVPX=$MOZ_NATIVE_LIBVPX
MOZ_NATIVE_SQLITE=$MOZ_NATIVE_SQLITE
MOZ_NATIVE_JEMALLOC=$MOZ_NATIVE_JEMALLOC"
DIRECTIVE4=`$PYTHON $_topsrcdir/build/directive4.py $DIRECTIVE4_LIST`
if test -n "$DIRECTIVE4"; then
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)
dnl Spit out some output
dnl ========================================================