Building NSS

This article is in need of a technical review.

Introduction

This page has detailed information on how to build NSS. Because NSS is a cross-platform library that builds on many different platforms and has many options, it may be complex to build. Please read these instructions carefully before attempting to build.

Build Environment

Windows

  1. Get the Prerequisites
    • NSS compilation on Windows uses the same shared build system as Mozilla Firefox. You must first install the Windows Prerequisites, including MozillaBuild.

Get the source

NSS and NSPR use Mercurial for source control like other Mozilla projects. To check out the latest sources for NSS and NSPR--which may not be part of a stable release--use the following commands:

hg clone https://hg.mozilla.org/projects/nspr
hg clone https://hg.mozilla.org/projects/nss

Configure the Environment

The build system for NSS uses a variety of environment variables to control the build. Below is a list of the variables, along with possible values they may be set to. For example, on Windows, you may wish to set OS_TARGET=WIN95.

OS_TARGET
WIN95
Build for all supported versions of Windows. This is the default (as of NSS 3.15.4) and the recommend configuration.
WINNT (obsolete)
An alternative configuration, which is no longer supported. (It uses special features like the Windows fibers API.)
BUILD_OPT
0
Build a debug (non-optimized) version of NSS. This is the default.
1
Build an optimized (non-debug) version of NSS.
 
USE_64
Note: Building for a 64-bit environment/ABI is only supported on Unix/POSIX platforms.
0
Build for a 32-bit environment/ABI. This is the default.
1
Build for a 64-bit environment/ABI.

Build

To build NSS, it's as simple as navigating to the NSS checkout and making the "nss_build_all" target.

cd nss
make nss_build_all

Document Tags and Contributors

Tags: 
Last updated by: emaldona@redhat.com,