Version 35 (modified by 12 years ago) (diff) | ,
---|
Building NSS on Windows
Preamble
NSS stands for Network Security Services. NSS is required to use SSL in Pidgin. NSS depends on NSPR and a shared database (SQLite since NSS 3.12), but you don't have to worry about these, there's and NSS with NSPR package which is compact thus it contains all sources required to build NSS.
Note: at the moment you can't build NSS completely using GCC. It fails at the final stage when linking additional tools. However, you can build all the important libraries successfully. It will hopefully be improved in the future. You can, however, build NSS completely with the Windows Driver Kit, but you'll need the NSS-WDK patch (binaries here).
Prerequisites
- Get GNU Patch:
Download Patch from the !GnuWin32 project. Note that Windows thinks that "patch.exe" is a patch for a program and will prompt you to UAC elevate it whenever you use it (see this page). - Get the Windows SDK:
Download the Windows SDK for Windows 7 SP1 and install it to the default location. - Get the Windows Driver Kit (WDK):
Download the WDK for Windows 7 SP1 and install it to the default location. - Get the Netscape Portable Runtime (NSPR):
Download the latest version of NSPR (currently 4.8.9) and extract it toc:\devel\pidgin-devel\win32-dev
. - Get Network Security Services (NSS):
Download the latest version of NSS (currently 3.12.11 w/ CKBI 1.87) and extract it to the same location. - Get MozillaBuild:
Download the latest version of MozillaBuild and install it toc:\devel\mozilla-build
.
Apply patches
Download the WDK build patch from the XChat-WDK project. Open a command prompt at your NSS/NSPR directory and run "c:\path\to\patch.exe" -p1 --binary -i nss-wdk.patch
.
Choose build configuration
The two most important options are:
- optimization
- debug RTL
You can toggle them with environmental variables. Here's the matrix:
USE_DEBUG_RTL= | USE_DEBUG_RTL=1 | |
---|---|---|
BUILD_OPT= | WINNT6.1_DBG.OBJ | WINNT6.1_DBG.OBJD |
BUILD_OPT=1 | WINNT6.1_OPT.OBJ | N/A |
The version after WINNT is the version of your current OS (you can check it with the winver
command). WINNT6.1 assumes you're building on Windows 7. The default setting is an unoptimized build with the release RTL (WINNT6.1_DBG.OBJ).
WARNING: it seems the builder considers an option to be enabled if it's set, so if you enter set BUILD_OPT=0
you'll get an optimized build, not a debug one. The answer lies in mozilla\security\coreconf\WIN32.mk
. They check variables with ifdefs, which is just plain wrong (or they should mention it this way in the documentation).
More info about the build variables can be found on the Build instructions page of the Mozilla Developer Central.
Build NSS
To be updated with DDK build instructions
The easiest way to do this with consistent results is to make a build script (the following is what the binary included with Pidgin is built with):
#!/bin/bash #The path that we've extracted the nss source tarball into NSS_SRC_DIR=/c/devel/pidgin-devel/win32-dev #Set our Build Arguments: #Optimized Build export BUILD_OPT=1 #Target Windows NT Family export OS_TARGET=WINNT #Use GCC (as opposed to VC) export NS_USE_GCC=1 #Set up the build path with MinGW and Moztools PATH=/c/devel/pidgin-devel/win32-dev/mingw/bin PATH=/c/devel/mozilla-build/moztools/bin:$PATH PATH=/c/devel/mozilla-build/msys/bin:$PATH export PATH pushd $NSS_SRC_DIR/nss-3.12.8/mozilla/security/nss make nss_build_all popd
Save this script as build.sh
. Launch a command prompt and run:
c:\devel\mozilla-build\msys\bin\sh build.sh
The build will likely not complete successfully due to hardcoded library paths and other problems in the build system (it will bail out building .../cmd/bltest
). If it gets that far, it has already built the various libraries successfully.
The resulting binaries will be placed in c:\devel\pidgin-devel\win32-dev\nss-3.12.8\mozilla\dist
. The contents of private
and public
are the same across all configurations so they can be distributed separately. The following files need to be distributed with Pidgin:
libnspr4.dll
libplds4.dll
libplc4.dll
nssutil3.dll
freebl3.dll
sqlite3.dll
softokn3.dll
nss3.dll
ssl3.dll
nssckbi.dll
softokn3.chk
freebl3.chk
Attachments (7)
-
build-x86.bat (2.1 KB) - added by 11 years ago.
Build Batch file
-
nss-wdk.patch (9.1 KB) - added by 11 years ago.
Local copy of https://github.com/hexchat/hexchat/blob/master/win32/ext/nss-wdk/nss-wdk.patch
-
nss-wdk.2.patch (8.8 KB) - added by 10 years ago.
Patch for NSS 3.15.2
-
nss-wdk-3.16.patch (8.4 KB) - added by 10 years ago.
Patch for NSS 3.16
-
nss-wdk-3.17.1.patch (10.8 KB) - added by 9 years ago.
Patch for 3.17.1
-
nss-wdk-3.20.1.patch (10.4 KB) - added by 8 years ago.
Patch for NSS 3.20.1
- nss-wdk-3.24.patch (11.8 KB) - added by 8 years ago.
Download all attachments as: .zip