Building NSS

This article is in need of a technical review.


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


  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
hg clone

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.

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 a debug (non-optimized) version of NSS. This is the default.
Build an optimized (non-debug) version of NSS.
Note: Building for a 64-bit environment/ABI is only supported on Unix/POSIX platforms.
Build for a 32-bit environment/ABI. This is the default.
Build for a 64-bit environment/ABI.


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

Last updated by:,