<DEBUG-PREFIX> and <RELEASE-PREFIX> are directories you specify where the NSPR output will go. You must keep them consistent between NSPR and SpiderMonkey.
Download the source code from here (we use v4.8) and follow the standard build instructions (ignore the cvs checkout instructions) using these options:
./configure --with-dist-prefix="<DEBUG-PREFIX>" --enable-debug-rtl --enable-cplus
./configure --with-dist-prefix="<RELEASE-PREFIX>" --disable-debug --enable-optimize --enable-cplus
First, compile NSPR appropriately, then apply file:fix-makefile.diff patch to the source code you download from here, then follow the standard build instructions, using these options:
make JS_DIST="<DEBUG-PREFIX>" JS_THREADSAFE=1 -f Makefile.ref js32.dll
make JS_DIST="<RELEASE-PREFIX>" JS_THREADSAFE=1 BUILD_OPT=1 -f Makefile.ref js32.dll