Bug 1808155 Part 1: Make NativeLayerCA VIDEO_LOG more useful. r=mac-reviewers,mstange
[gecko.git] / docs / nspr / nspr_build_instructions.rst
blobd927a6bd056aef52cd3b79305a4454f6b96069ae
1 NSPR build instructions
2 =======================
4 Prerequisites
5 ~~~~~~~~~~~~~
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.
12 Introduction
13 ~~~~~~~~~~~~
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
26 For example,
30    # check out the source tree from Mercurial
31    hg clone https://hg.mozilla.org/projects/nspr
32    # create a build directory
33    mkdir target.debug
34    cd target.debug
35    # run the configure script
36    ../nspr/configure [optional configure options]
37    # build the libraries
38    gmake
39    # build the test programs
40    cd pr/tests
41    gmake
43 On Mac OS X, use ``make``, which is GNU ``make``.
45 .. _Configure_options:
47 Configure options
48 ~~~~~~~~~~~~~~~~~
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
65 recommended.
67 --enable-64bit
68 ^^^^^^^^^^^^^^
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``
72 configure option.
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:
97 --enable-debug-rtl
98 ^^^^^^^^^^^^^^^^^^
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
103 option.
105 .. _Makefile_targets:
107 Makefile targets
108 ~~~~~~~~~~~~~~~~
110 -  all (default)
111 -  clean
112 -  realclean
113 -  distclean
114 -  install
115 -  release
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:
126 .. code::
128     /bin/sh:
130     $ cd pr/tests
131     $ DYLD_LIBRARY_PATH=../../dist/lib ./accept
132     PASS
133     $
134     $ # to run all the NSPR tests...
135     $
136     $ DYLD_LIBRARY_PATH=../../dist/lib ../../../nspr/pr/tests/runtests.sh ../..