Checkout and Build NSPR

  • Revision slug: Checkout_and_Build_NSPR
  • Revision title: Checkout and Build NSPR
  • Revision id: 128682
  • Created:
  • Creator: Pd
  • Is current revision? No
  • Comment /* Build */

Revision Content

Checkout

To checkout NetScape Portable Runtime (NSPR) you need CVS 1.10 set the CVSROOT enviornment variable to:

:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot

Issue the command:

cvs checkout [-r TAG] mozilla/nsprpub

You now have NSPR checked out into the current working directory.

Build

There are two different build procedures for NSPR, depending on which NSPR release you want to build. NSPR releases 4.1.x and earlier use the classic build method. Beginning with NSPR release 4.2 an autoconf based make system is used.

Building NSPR varies a little depending on platform. Building NSPR builds only NSPR libraries, the test cases must be built separately. Building debug and optimized targets requires options on the <tt>gmake</tt> or <tt>configure</tt> command line. Read on.

Unix

Autoconf

In the directory you have checked NSPR out to, create a directory to contain the build targets; <tt>cd</tt> to that directory; run <tt>configure</tt> and <tt>make</tt>. For example, say:

mkdir target
cd target
../mozilla/nsprpub/configure
gmake
cd pr/tests
gmake

The above commands build the debug targets. To build the optimized targets, the <tt>configure</tt> command should say:

... configure --enable-optimize --disable-debug

For platforms supporting it, to build 64bit targets, add the <tt>--enable-64bit</tt> option to the <tt>configure</tt> command.

Classic

Building debug targets, first NSPR itself, then the test suite:

cd mozilla/nsprpub
gmake
cd pr/tests
gmake

To build the optimized targets, change the gmake commands to:

gmake BUILD_OPT=1

Windows

Autoconf

Using the autoconf build method on Windows requires the Cygwin Toolkit.

Open a Cygwin window. Follow the procedure described for building NSPR on Unix.

Classic

Building Windows targets is similar. There are two builds for Windows: a generic Win32 build and a WinNT build. The difference is that the WinNT build runs only on Windows NT (and Windows 2000); the generic Win32 build runs on any of Win9x, WinME, WinNT, Win2K.

The following assumes MSVC 6.0 with ServicePack 4. The compiler is must be configured to run from the command line.

To build the generic Win32 debug targets:

cd mozilla\nsprpub
gmake OS_TARGET=WIN95
cd pr\tests
gmake OS_TARGET=WIN95

To build the optimized targets, add <tt>BUILD_OPT=1</tt> option to the <tt>gmake</tt> command.

To build the WinNT debug targets:

cd mozilla\nsprpub
gmake
cd pr\tests
gmake

To build the optimized targets, add <tt>BUILD_OPT=1</tt> option to the <tt>gmake</tt> command.

Mac

This topic is left as an exercise for a Mac specialist.

Others

Specialists on mozilla contributed ports are invited to contribute to this section.

Original Document Information

Revision Source

<h2 name="Checkout"> Checkout </h2>
<p>To checkout NetScape Portable Runtime (NSPR) you need CVS 1.10 set the CVSROOT enviornment variable to:
</p>
<pre>:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot</pre>
<p>Issue the command:
</p>
<pre>cvs checkout [-r TAG] mozilla/nsprpub</pre>
<p>You now have NSPR checked out into the current working directory.
</p>
<h2 name="Build"> Build </h2>
<p>There are two different build procedures for NSPR, depending on which NSPR release you want to build. NSPR releases 4.1.x and earlier use the <em>classic</em> build method. Beginning with NSPR release 4.2 an <em>autoconf</em> based make system is used.
</p><p>Building NSPR varies a little depending on platform. Building NSPR builds only NSPR libraries, the test cases must be built separately. Building debug and optimized targets requires options on the <tt>gmake</tt> or <tt>configure</tt> command line. Read on.
</p>
<h3 name="Unix"> Unix </h3>
<h4 name="Autoconf"> Autoconf </h4>
<p>In the directory you have checked NSPR out to, create a directory to contain the build targets; <tt>cd</tt> to that directory; run <tt>configure</tt> and <tt>make</tt>. For example, say:
</p>
<pre>mkdir target
cd target
../mozilla/nsprpub/configure
gmake
cd pr/tests
gmake</pre>
<p>The above commands build the debug targets. To build the optimized targets, the <tt>configure</tt> command should say:
</p>
<pre>... configure --enable-optimize --disable-debug</pre>
<p>For platforms supporting it, to build 64bit targets, add the <tt>--enable-64bit</tt> option to the <tt>configure</tt> command.
</p>
<h4 name="Classic"> Classic </h4>
<p>Building debug targets, first NSPR itself, then the test suite:
</p>
<pre>cd mozilla/nsprpub
gmake
cd pr/tests
gmake
</pre>
<p>To build the optimized targets, change the gmake commands to:
</p>
<pre>gmake BUILD_OPT=1</pre>
<h3 name="Windows"> Windows </h3>
<h4 name="Autoconf_2"> Autoconf </h4>
<p>Using the autoconf build method on Windows requires <a class="external" href="http://sources.redhat.com/cygwin/">the Cygwin Toolkit</a>.
</p><p>Open a Cygwin window. Follow the procedure described for building NSPR on Unix.
</p>
<h4 name="Classic_2"> Classic </h4>
<p>Building Windows targets is similar. There are two builds for Windows: a generic Win32 build and a WinNT build. The difference is that the WinNT build runs only on Windows NT (and Windows 2000); the generic Win32 build runs on any of Win9x, WinME, WinNT, Win2K.
</p><p>The following assumes MSVC 6.0 with ServicePack 4. The compiler is must be configured to run from the command line.
</p><p>To build the generic Win32 debug targets:
</p>
<pre>cd mozilla\nsprpub
gmake OS_TARGET=WIN95
cd pr\tests
gmake OS_TARGET=WIN95</pre>
<p>To build the optimized targets, add <tt>BUILD_OPT=1</tt> option to the <tt>gmake</tt> command.
</p><p>To build the WinNT debug targets:
</p>
<pre>cd mozilla\nsprpub
gmake
cd pr\tests
gmake</pre>
<p>To build the optimized targets, add <tt>BUILD_OPT=1</tt> option to the <tt>gmake</tt> command.
</p>
<h3 name="Mac"> Mac </h3>
<p>This topic is left as an exercise for a Mac specialist.
</p>
<h3 name="Others"> Others </h3>
<p>Specialists on mozilla contributed ports are invited to contribute to this section.
</p>
<h2 name="Original_Document_Information"> Original Document Information </h2>
<div class="originaldocinfo">
<ul><li> Authors: <a class="external" href="mailto:larryh@netscape.com">larryh@netscape.com</a>, Wan Teh Chang
</li><li> Last Updated Date: November 7, 2001
</li></ul>
</div>
Revert to this revision