These instructions are outdated. Use the Building NSS page for more recent information.
Numerous optional features of NSS builds are controlled through make variables.
gmake is GNU make, usually your Linux-distro-regular "make" binary file, unless maybe it is a BSD make. Make variables may be set on the gmake command line, e.g.,
gmake variable=value variable=value target1 target2
or defined in the environment, e.g. (for POSIX shells),
variable=value; export variable gmake target1 target2
Here are some (not all) of the make variables that affect NSS builds:
These variables should be either undefined, or set to "1". Results are undefined for variables set to "0".
For Windows, install the MozillaBuild environment and Microsoft Visual Studio 2010. (The free edition works, and other versions like Visual Studio 2008 and Visual Studio 2012 may also work.) Use start-shell-msvc2010.bat from MozillaBuild to get a bash shell with the PATH already configured, and execute these instructions from within that bash shell.
For RHEL-5, you need to use the new assembler. You can install the new assembler as root as follows:
yum install binutils220
You can then use the new assembler by adding /usr/libexec/binutils220 to the beginning of your build path. This can be done in sh or bash as follows:
export PATH=/usr/libexec/binutils220:$PATH
The following build instructions should work for all platforms (with some platform-specific changes as noted).
hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss
cd nspr hg update NSPR_4_9_5_RTM cd ../nss hg update NSS_3_14_2_RTM cd ..
BUILD_OPT=1
in your environment. Otherwise, you get a debug build. On Windows, if you want a debug build with the system's debug RTL libraries, set USE_DEBUG_RTL=1
in your environment.USE_64=1
in your environment. By default, NSS builds for the 32-bit environment on all platforms except Alpha/OSF1.gcc
on platforms other than Linux and Windows, you need to set two more environment variables:
NS_USE_GCC=1
NO_MDUPDATE=1
USE_PTHREADS
to 1.cd nss
gmake nss_build_all
The output of the build will be in the dist
directory alongside the nspr
and nss
directories.
For information on troubleshooting the build system, see Troubleshooting NSS and JSS Build Systems.
CVSROOT
to :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
cvs login
(if you haven't before).cvs co -r NSPR_4_9_5_RTM NSPR cvs co -r NSS_3_14_2_RTM NSS
cd mozilla/security/nss
gmake nss_build_all
The output of the build will be in mozilla/dist
subdirectory.
For information on troubleshooting the build system, see Troubleshooting NSS and JSS Build Systems.