Bug 1320690 - Re-enable bundled NSS on BSDs. r?ted draft
authorJan Beich <jbeich@FreeBSD.org>
Mon, 28 Nov 2016 14:33:36 +0000
changeset 447306 a2023693b8b79dd7ae44d8c1da0570f549344692
parent 447305 f664a80393daca803f15055ade0c85145883f3ff
child 539013 1496293d5f56a2fc86b192763d8b06d896e4c36f
push id38036
push userbmo:jbeich@FreeBSD.org
push dateSat, 03 Dec 2016 20:56:19 +0000
reviewersted
bugs1320690
milestone53.0a1
Bug 1320690 - Re-enable bundled NSS on BSDs. r?ted MozReview-Commit-ID: F9k21fzoZaT
old-configure.in
security/generate_mapfile.py
--- a/old-configure.in
+++ b/old-configure.in
@@ -2081,19 +2081,18 @@ if test -n "$_USE_SYSTEM_NSS"; then
     AM_PATH_NSS(3.28, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
 fi
 
 if test -n "$MOZ_SYSTEM_NSS"; then
    NSS_LIBS="$NSS_LIBS -lcrmf"
 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])
             ;;
    esac
 fi
 
 if test -z "$SKIP_LIBRARY_CHECKS"; then
--- a/security/generate_mapfile.py
+++ b/security/generate_mapfile.py
@@ -12,43 +12,38 @@
 # The NSS build system processes them using a series of sed replacements,
 # but the Mozilla build system is already running a Python script to generate
 # the file so it's simpler to just do the replacement in Python.
 
 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:
             line = line.rstrip()
             # 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 ', '')
             # Remove the string ';+'
             line = line.replace(';+', '')
             # 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]
+                if is_darwin:
+                    line = line[:i]
                 else:
-                    line = line[:i]
-            # On non-Linux, symbols get an underscore in front.
-            if line and not is_linux:
+                    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')