You first need to do the patch to fix the broken ../coreconf/location.mk. You must run the patch command from the top level directory. If you checked out the code from CVS like this:
cvs co mozilla/security/coreconf mozilla/security/svrcore
This adds NSS_INCLUDE_DIR and NSS_LIB_DIR - if they are already there (i.e. someone fixed it) then patch will complain, but just ignore it.
Next, if you are not doing an "in-tree" build, you will need to set the environment variables NSPR_INCLUDE_DIR, NSPR_LIB_DIR, NSS_INCLUDE_DIR, and NSS_LIB_DIR to point to the appropriate places. On Windows, if you are using the build method described below (cygwin + MSVC), you should use the "mixed" style path e.g.
The MSVC compiler (cl.exe) will barf on paths like /cygdrive/c/foo/bar.
Unix:
Building on Unix mostly just complies with the usual NSS build requirements.
Windows:
Windows has now (as of 2006/2/1) released free versions of their compiler and platform SDKs - everything you need to build svrcore.
Prerequisites:
First, you must install 3 packages downloaded from Microsoft. If the links don't work, just go to www.microsoft.com and search for their names until you get to the download links for them.
Second, install CygWin - www.cygwin.com
Third, you need nsinstall.exe from the MozTools wintools package (you don't need anything else) - http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip - just unpack the zip file, extract nsinstall.exe, and place in your PATH
* Microsoft Visual C++ Toolkit 2003
** http://msdn.microsoft.com/visualc/vctoolkit2003/ - follow the link to download
export PATH="$HOME/bin:/cygdrive/c/Program Files/Microsoft Visual C++ Toolkit 2003/bin:/cygdrive/c/Program Files/Microsoft Platform SDK/Bin:$PATH"
I've put my nsinstall.exe in my $HOME/bin directory and put that first in my PATH. This assumes you've used the default paths for all of the MS and cygwin installs. If not, change the paths accordingly. In order for the changes to take effect, re-source your file or logout and login again.
And that's it. The svrcore.lib will be found in mozilla/dist/*.OBJ/lib and svrcore.h will be found in mozilla/dist/public/svrcore. When you go to build the mozilla ldap c sdk that you have checked out into the same source tree, it will automatically find the files it needs when you use configure --with-svrcore ...