JSS build instructions for OSX 10.6

The following build instructions were provided by PAVRW. The generic instructions didn't work to build on OSX 10.6.7.

HOWTO successfully compile JSS and NSS for 32 and 64 bits on OSX 10.6 (10.6.7)

STEPS:

Export all this:

BUILD_OPT="1"
CVSROOT=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot"
JAVA_HOME=$(/usr/libexec/java_home")
NO_MDUPDATE="1"
NSDISTMODE="copy"
NS_USE_GCC="1"

Create working dir:
mkdir nss-jss
cd nss-jss

Obtain source:
Altought manual said NSPR_4_6_4_RTM, NSS_3_11_4_RTM, JSS_4_2_5_RTM, they didnt work for OSX, giving many compiling errors.
cvs login
cvs co -r NSPR_4_8_7_RTM NSPR
cvs co -r NSS_3_12_9_WITH_CKBI_1_82_RTM NSS
cvs co -r JSS_4_3_2_RTM JSS

Build NSS for 32 and 64:
cd mozilla/security/nss
make nss_build_all CC="gcc -arch i386" CCC="g++ -arch i386"
make nss_build_all USE_64=1

Build JSS for 32 and 64:
cd ../jss
make CC="gcc -arch i386" CCC="g++ -arch i386"
make USE_64=1


on OSX, java.library.path doesnt seem to have /usr/lib or other paths. Temporal solution: copy libs to java dir /usr/lib/java. Setting LD_LIBRARY_PATH didnt work