1 NSPR build instructions
2 =======================
7 On Windows, the NSPR build system needs GNU make and a Unix command-line
8 utility suite such as MKS Toolkit, Cygwin, and MSYS. The easiest way to
9 get these tools is to install the
10 :ref:`MozillaBuild` package.
15 The top level of the NSPR source tree is the ``mozilla/nsprpub``
16 directory. Although ``nsprpub`` is a subdirectory under ``mozilla``,
17 NSPR is independent of the Mozilla client source tree.
19 Building NSPR consists of three steps:
21 #. run the configure script. You may override the compilers (the CC
22 environment variable) or specify options.
23 #. build the libraries
24 #. build the test programs
30 # check out the source tree from Mercurial
31 hg clone https://hg.mozilla.org/projects/nspr
32 # create a build directory
35 # run the configure script
36 ../nspr/configure [optional configure options]
39 # build the test programs
43 On Mac OS X, use ``make``, which is GNU ``make``.
45 .. _Configure_options:
50 Although NSPR uses autoconf, its configure script has two default values
51 that are different from most open source projects.
53 #. If the OS vendor provides a compiler (for example, Sun and HP), NSPR
54 uses that compiler instead of GCC by default.
55 #. NSPR build generates a debug build by default.
57 .. _--disable-debug_--enable-optimize:
59 --disable-debug --enable-optimize
60 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62 Specify these two options to generate an optimized (release) build.
64 These two options can actually be used independently, but it's not
70 On a dual 32-bit/64-bit platform, NSPR build generates a 32-bit build by
71 default. To generate a 64-bit build, specify the ``--enable-64bit``
74 .. _--targetx86_64-pc-mingw32:
76 --target=x86_64-pc-mingw32
77 ^^^^^^^^^^^^^^^^^^^^^^^^^^
79 For 64-bit builds on Windows, when using the mozbuild environment.
81 .. _--enable-win32-target.3DWIN95:
83 --enable-win32-target=WIN95
84 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
86 This option is only used on Windows. NSPR build generates a "WINNT"
87 configuration by default on Windows for historical reasons. We recommend
88 most applications use the "WIN95" configuration. The "WIN95"
89 configuration supports all versions of Windows. The "WIN95" name is
90 historical; it should have been named "WIN32".
92 To generate a "WIN95" configuration, specify the
93 ``--enable-win32-target=WIN95`` configure option.
95 .. _--enable-debug-rtl:
100 This option is only used on Windows. NSPR debug build uses the release C
101 run-time library by default. To generate a debug build that uses the
102 debug C run-time library, specify the ``--enable-debug-rtl`` configure
105 .. _Makefile_targets:
117 .. _Running_the_test_programs:
119 Running the test programs
120 ~~~~~~~~~~~~~~~~~~~~~~~~~
122 The tests were built above, in the ``pr/tests`` directory.
124 On Mac OS X, they can be executed with the following:
131 $ DYLD_LIBRARY_PATH=../../dist/lib ./accept
134 $ # to run all the NSPR tests...
136 $ DYLD_LIBRARY_PATH=../../dist/lib ../../../nspr/pr/tests/runtests.sh ../..