Build Instructions for PSM 2

Newsgroup: mozilla.dev.tech.crypto
Main technical contact: Kai Engert
Manager: Stephane Saux

Following these instructions will cause mozilla to build PSM 2 along with all of the other components one usually gets with the build.

Unix Build Instructions

  1. Add the following line to your .mozconfig file:
    ac_add_options --enable-crypto
  2. Pull and build Mozilla as described at Mozilla Unix Build Instructions

  3. The PSM files will be found here:

         /dist/bin/libnssckbi.so
                  /components/libpipnss.so
                  /components/libpippki.so
                  /chrome/pippki.jar
                  /chrome/pipnss.jar
         
            
    After a successful Solaris 32 bit Sparc build, the following files are also a part of PSM 2.
         /dist/bin/libfreebl_hybrid_3.so
                  /libfreebl_pure32_3.so
            
    After a successful HP-UX 32 bit build, the following files are also a part of PSM 2.
         /dist/bin/libfreebl_hybrid_3.sl
                  /libfreebl_pure32_3.sl
            

Windows Build Instructions

Pull and build Mozilla as described at Mozilla Win32 Build Instructions

Make sure you have read the general Win32 build instructions. The general win32 Mozilla build instructions say you CAN optionally use a MOZCONFIG file. Well, for building PSM / the crypto modules, you MUST use one.

Use the UNIX build configurator to create a configuration that suits your needs, and make sure you have the --enable-crypto option checked. Create a file that contains your build options created by the configurator. Or, in the most simple scenario, where everything else should use default settings, the contents of your file (name it something like my-mozconfig) can look like this:

# sh
# Build configuration script
#
# See http://www.mozilla.org/build/unix.html for build instructions.
#

# Options for 'configure' (same as command-line options).
ac_add_options --enable-crypto

In your environment, make the MOZCONFIG environment variable point to your file. Use something like

set MOZCONFIG=c:\mozilla-build\my-mozconfig

Windows Trouble Shooting

  1. When compiling, my build breaks with the following output:
    cp mpi/mpi_x86.asm .
    ml.exe -FoWIN32_D.OBJ/mpi_x86.obj -Cp -Sn -Zi -coff -IC:/mozilla/dist/include/ns
    pr  -I../../../../dist/public/security -I../../../../dist/private/security -I../
    ../../../dist/include -c mpi_x86.asm
    process_begin: CreateProcess((null), ml.exe -FoWIN32_D.OBJ/mpi_x86.obj -Cp -Sn -
    Zi -coff -IC:/mozilla/dist/include/nspr -I../../../../dist/public/security -I../
    ../../../dist/private/security -I../../../../dist/include -c mpi_x86.asm, ...) f
    ailed.
    make (e=2): The system cannot find the file specified.
    gmake.exe[1]: *** [WIN32_D.OBJ/mpi_x86.obj] Error 2
    gmake.exe[1]: Leaving directory `C:/mozilla/security/nss/lib/freebl'
    gmake.exe: *** [install] Error 2
    gmake.exe: Leaving directory `C:/mozilla/security/nss/lib'
    NMAKE : fatal error U1077: 'gmake.exe' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~1\VC98\BIN\NMAKE.EXE' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~1\VC98\BIN\NMAKE.EXE' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~1\VC98\BIN\NMAKE.EXE' : return code '0x2'
    Stop.
    
    The problem here is that MASM (ml.exe) is either not installed on your system or is not in your path. If ml.exe is installed on your system, then make sure it is in your path. If it is not, then see the NSS Build Instructions on where to get MASM.

Macintosh Build Instructions

See Building Mac Mozilla for instructions on setting up your Macintosh development environment.
  1. In your build preferences, add the following line:

    options psm 1

  2. Run the perl script at mozilla:build:mac:build_scripts:BuildMozilla[Debug].pl

  3. The PSM files will be found here:

            mozilla:dist:viewer[_debug]:Components:PIPNSS[Debug].shlb
                                       :Components:PIPPKI[Debug].shlb
                                       :Chrome:pipnss.jar
                                       :Chrome:pippki.jar
                                       :Essential Files:NSSckbi[Debug].shlb