Bug 1320690 - Re-enable bundled NSS on BSDs. r=ted

MozReview-Commit-ID: F9k21fzoZaT

--HG--
extra : rebase_source : d0f4ddf93ec82e6a4ec9406a9e0af85862d1dc36
This commit is contained in:
Jan Beich 2016-11-28 14:33:36 +00:00
parent 434009fae3
commit 225a0afb78
2 changed files with 11 additions and 17 deletions

View File

@ -2081,9 +2081,8 @@ if test -n "$MOZ_SYSTEM_NSS"; then
else
NSS_CFLAGS="-I${DIST}/include/nss"
case "${OS_ARCH}" in
# This is to match the conditions in security/generate_mapfile.py,
# plus Windows which doesn't run that script.
WINNT|Darwin|Linux)
# Only few platforms have been tested with GYP
WINNT|Darwin|Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
;;
*)
AC_MSG_ERROR([building in-tree NSS is not supported on this platform. Use --with-system-nss])

View File

@ -17,12 +17,7 @@ import buildconfig
def main(output, input):
# There's a check in old-configure.in under the system-nss handling
# that should match this.
if buildconfig.substs['OS_ARCH'] not in ('Linux', 'Darwin'):
print "Error: unhandled OS_ARCH %s" % buildconfig.substs['OS_ARCH']
return 1
is_linux = buildconfig.substs['OS_ARCH'] == 'Linux'
is_darwin = buildconfig.substs['OS_ARCH'] == 'Darwin'
with open(input, 'rb') as f:
for line in f:
@ -30,8 +25,8 @@ def main(output, input):
# Remove all lines containing ';-'
if ';-' in line:
continue
# On non-Linux, remove all lines containing ';+'
if not is_linux and ';+' in line:
# On OS X, remove all lines containing ';+'
if is_darwin and ';+' in line:
continue
# Remove the string ' DATA '.
line = line.replace(' DATA ', '')
@ -40,15 +35,15 @@ def main(output, input):
# Remove the string ';;'
line = line.replace(';;', '')
# If a ';' is present, remove everything after it,
# and on non-Linux, remove it as well.
# and on OS X, remove it as well.
i = line.find(';')
if i != -1:
if is_linux:
line = line[:i+1]
else:
if is_darwin:
line = line[:i]
# On non-Linux, symbols get an underscore in front.
if line and not is_linux:
else:
line = line[:i+1]
# On OS X, symbols get an underscore in front.
if line and is_darwin:
output.write('_')
output.write(line)
output.write('\n')