50552d8
Index: mozilla/configure.in
50552d8
===================================================================
50552d8
RCS file: /cvsroot/mozilla/configure.in,v
50552d8
retrieving revision 1.1503.2.15
50552d8
diff -u -r1.1503.2.15 configure.in
50552d8
--- mozilla/configure.in	4 Oct 2005 05:53:49 -0000	1.1503.2.15
50552d8
+++ mozilla/configure.in	15 Dec 2005 05:40:40 -0000
50552d8
@@ -86,6 +86,7 @@
50552d8
 MOZPNG=10207
50552d8
 MOZZLIB=1.2.3
50552d8
 NSPR_VERSION=4
50552d8
+NSS_VERSION=3
50552d8
 
50552d8
 dnl Set the minimum version of toolkit libs used by mozilla
50552d8
 dnl ========================================================
50552d8
@@ -3472,6 +3473,19 @@
50552d8
     fi
50552d8
 fi
50552d8
 
50552d8
+dnl ========================================================
50552d8
+dnl = If NSS was not detected in the system, 
50552d8
+dnl = use the one in the source tree (mozilla/security/nss)
50552d8
+dnl ========================================================
50552d8
+
50552d8
+MOZ_ARG_WITH_BOOL(system-nss,
50552d8
+[  --with-system-nss      Use system installed NSS],
50552d8
+    _USE_SYSTEM_NSS=1 )
50552d8
+
50552d8
+if test -n "$_USE_SYSTEM_NSS"; then
50552d8
+    AM_PATH_NSS(3.0.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
50552d8
+fi
50552d8
+
50552d8
 if test -z "$SKIP_LIBRARY_CHECKS"; then
50552d8
 dnl system JPEG support
50552d8
 dnl ========================================================
50552d8
@@ -6698,6 +6712,10 @@
50552d8
 AC_SUBST(NSPR_LIBS)
50552d8
 AC_SUBST(MOZ_NATIVE_NSPR)
50552d8
 
50552d8
+AC_SUBST(NSS_CFLAGS)
50552d8
+AC_SUBST(NSS_LIBS)
50552d8
+AC_SUBST(MOZ_NATIVE_NSS)
50552d8
+
50552d8
 AC_SUBST(CFLAGS)
50552d8
 AC_SUBST(CXXFLAGS)
50552d8
 AC_SUBST(CPPFLAGS)
50552d8
Index: mozilla/configure
50552d8
===================================================================
50552d8
RCS file: /cvsroot/mozilla/configure,v
50552d8
retrieving revision 1.1492.2.17
50552d8
diff -u -r1.1492.2.17 configure
50552d8
--- mozilla/configure	4 Oct 2005 06:01:48 -0000	1.1492.2.17
50552d8
+++ mozilla/configure	15 Dec 2005 05:40:53 -0000
50552d8
@@ -44,6 +44,13 @@
50552d8
   --with-nspr-exec-prefix=PFX
50552d8
                           Exec prefix where NSPR is installed"
50552d8
 ac_help="$ac_help
50552d8
+  --with-system-nss      Use system installed NSS"
50552d8
+ac_help="$ac_help
50552d8
+  --with-nss-prefix=PFX  Prefix where NSS is installed"
50552d8
+ac_help="$ac_help
50552d8
+  --with-nss-exec-prefix=PFX
50552d8
+                          Exec prefix where NSS is installed"
50552d8
+ac_help="$ac_help
50552d8
   --with-system-jpeg[=PFX]
50552d8
                           Use system libjpeg [installed at prefix PFX]"
50552d8
 ac_help="$ac_help
50552d8
@@ -1020,6 +1027,7 @@
50552d8
 MOZPNG=10207
50552d8
 MOZZLIB=1.2.3
50552d8
 NSPR_VERSION=4
50552d8
+NSS_VERSION=3
50552d8
 
50552d8
 GLIB_VERSION=1.2.0
50552d8
 GTK_VERSION=1.2.0
50552d8
@@ -11300,6 +11308,123 @@
50552d8
     fi
50552d8
 fi
50552d8
 
50552d8
+
50552d8
+# Check whether --with-system-nss or --without-system-nss was given.
50552d8
+if test "${with_system_nss+set}" = set; then
50552d8
+  withval="$with_system_nss"
50552d8
+  if test "$withval" = "yes"; then
50552d8
+    _USE_SYSTEM_NSS=1 
50552d8
+  elif test "$withval" = "no"; then
50552d8
+    :
50552d8
+  else
50552d8
+    { echo "configure: error: Option, system-nss, does not take an argument ($withval)." 1>&2; exit 1; }
50552d8
+  fi
50552d8
+fi
50552d8
+
50552d8
+
50552d8
+if test -n "$_USE_SYSTEM_NSS"; then
50552d8
+    
50552d8
+# Check whether --with-nss-prefix or --without-nss-prefix was given.
50552d8
+if test "${with_nss_prefix+set}" = set; then
50552d8
+  withval="$with_nss_prefix"
50552d8
+  nss_config_prefix="$withval"
50552d8
+else
50552d8
+  nss_config_prefix=""
50552d8
+fi
50552d8
+
50552d8
+
50552d8
+# Check whether --with-nss-exec-prefix or --without-nss-exec-prefix was given.
50552d8
+if test "${with_nss_exec_prefix+set}" = set; then
50552d8
+  withval="$with_nss_exec_prefix"
50552d8
+  nss_config_exec_prefix="$withval"
50552d8
+else
50552d8
+  nss_config_exec_prefix=""
50552d8
+fi
50552d8
+
50552d8
+
50552d8
+	if test -n "$nss_config_exec_prefix"; then
50552d8
+		nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix"
50552d8
+		if test -z "$NSS_CONFIG"; then
50552d8
+			NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config
50552d8
+		fi
50552d8
+	fi
50552d8
+	if test -n "$nss_config_prefix"; then
50552d8
+		nss_config_args="$nss_config_args --prefix=$nss_config_prefix"
50552d8
+		if test -z "$NSS_CONFIG"; then
50552d8
+			NSS_CONFIG=$nss_config_prefix/bin/nss-config
50552d8
+		fi
50552d8
+	fi
50552d8
+
50552d8
+	unset ac_cv_path_NSS_CONFIG
50552d8
+	# Extract the first word of "nss-config", so it can be a program name with args.
50552d8
+set dummy nss-config; ac_word=$2
50552d8
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
50552d8
+echo "configure:11363: checking for $ac_word" >&5
50552d8
+if eval "test \"`echo '$''{'ac_cv_path_NSS_CONFIG'+set}'`\" = set"; then
50552d8
+  echo $ac_n "(cached) $ac_c" 1>&6
50552d8
+else
50552d8
+  case "$NSS_CONFIG" in
50552d8
+  /*)
50552d8
+  ac_cv_path_NSS_CONFIG="$NSS_CONFIG" # Let the user override the test with a path.
50552d8
+  ;;
50552d8
+  ?:/*)			 
50552d8
+  ac_cv_path_NSS_CONFIG="$NSS_CONFIG" # Let the user override the test with a dos path.
50552d8
+  ;;
50552d8
+  *)
50552d8
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
50552d8
+  ac_dummy="$PATH"
50552d8
+  for ac_dir in $ac_dummy; do 
50552d8
+    test -z "$ac_dir" && ac_dir=.
50552d8
+    if test -f $ac_dir/$ac_word; then
50552d8
+      ac_cv_path_NSS_CONFIG="$ac_dir/$ac_word"
50552d8
+      break
50552d8
+    fi
50552d8
+  done
50552d8
+  IFS="$ac_save_ifs"
50552d8
+  test -z "$ac_cv_path_NSS_CONFIG" && ac_cv_path_NSS_CONFIG="no"
50552d8
+  ;;
50552d8
+esac
50552d8
+fi
50552d8
+NSS_CONFIG="$ac_cv_path_NSS_CONFIG"
50552d8
+if test -n "$NSS_CONFIG"; then
50552d8
+  echo "$ac_t""$NSS_CONFIG" 1>&6
50552d8
+else
50552d8
+  echo "$ac_t""no" 1>&6
50552d8
+fi
50552d8
+
50552d8
+	min_nss_version=3.0.0
50552d8
+	echo $ac_n "checking for NSS - version >= $min_nss_version (skipping)""... $ac_c" 1>&6
50552d8
+echo "configure:11398: checking for NSS - version >= $min_nss_version (skipping)" >&5
50552d8
+
50552d8
+	no_nss=""
50552d8
+	if test "$NSS_CONFIG" = "no"; then
50552d8
+		no_nss="yes"
50552d8
+	else
50552d8
+		NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
50552d8
+		NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`
50552d8
+
50552d8
+				nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
50552d8
+			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
50552d8
+		nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
50552d8
+			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
50552d8
+		nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
50552d8
+			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
50552d8
+	fi
50552d8
+
50552d8
+	if test -z "$no_nss"; then
50552d8
+		echo "$ac_t""yes" 1>&6
50552d8
+		MOZ_NATIVE_NSS=1     
50552d8
+	else
50552d8
+		echo "$ac_t""no" 1>&6
50552d8
+	fi
50552d8
+
50552d8
+
50552d8
+	
50552d8
+	
50552d8
+
50552d8
+
50552d8
+fi
50552d8
+
50552d8
 if test -z "$SKIP_LIBRARY_CHECKS"; then
50552d8
 # Check whether --with-system-jpeg or --without-system-jpeg was given.
50552d8
 if test "${with_system_jpeg+set}" = set; then
50552d8
@@ -19473,6 +19602,9 @@
50552d8
 s%@NSPR_CONFIG@%$NSPR_CONFIG%g
50552d8
 s%@NSPR_CFLAGS@%$NSPR_CFLAGS%g
50552d8
 s%@NSPR_LIBS@%$NSPR_LIBS%g
50552d8
+s%@NSS_CONFIG@%$NSS_CONFIG%g
50552d8
+s%@NSS_CFLAGS@%$NSS_CFLAGS%g
50552d8
+s%@NSS_LIBS@%$NSS_LIBS%g
50552d8
 s%@GTK_CONFIG@%$GTK_CONFIG%g
50552d8
 s%@GTK_CFLAGS@%$GTK_CFLAGS%g
50552d8
 s%@GTK_LIBS@%$GTK_LIBS%g
50552d8
@@ -19753,6 +19885,7 @@
50552d8
 s%@MOZ_PNG_CFLAGS@%$MOZ_PNG_CFLAGS%g
50552d8
 s%@MOZ_PNG_LIBS@%$MOZ_PNG_LIBS%g
50552d8
 s%@MOZ_NATIVE_NSPR@%$MOZ_NATIVE_NSPR%g
50552d8
+s%@MOZ_NATIVE_NSS@%$MOZ_NATIVE_NSS%g
50552d8
 s%@COMPILE_CFLAGS@%$COMPILE_CFLAGS%g
50552d8
 s%@COMPILE_CXXFLAGS@%$COMPILE_CXXFLAGS%g
50552d8
 s%@CROSS_COMPILE@%$CROSS_COMPILE%g
50552d8
Index: mozilla/aclocal.m4
50552d8
===================================================================
50552d8
RCS file: /cvsroot/mozilla/aclocal.m4,v
50552d8
retrieving revision 1.14
50552d8
diff -u -r1.14 aclocal.m4
50552d8
--- mozilla/aclocal.m4	13 May 2004 03:12:47 -0000	1.14
50552d8
+++ mozilla/aclocal.m4	15 Dec 2005 05:40:53 -0000
50552d8
@@ -8,6 +8,7 @@
50552d8
 builtin(include, build/autoconf/libIDL.m4)dnl
50552d8
 builtin(include, build/autoconf/libIDL-2.m4)dnl
50552d8
 builtin(include, build/autoconf/nspr.m4)dnl
50552d8
+builtin(include, build/autoconf/nss.m4)dnl
50552d8
 builtin(include, build/autoconf/libart.m4)dnl
50552d8
 builtin(include, build/autoconf/pkg.m4)dnl
50552d8
 builtin(include, build/autoconf/freetype2.m4)dnl
50552d8
Index: mozilla/config/autoconf.mk.in
50552d8
===================================================================
50552d8
RCS file: /cvsroot/mozilla/config/autoconf.mk.in,v
50552d8
retrieving revision 3.363.2.1
50552d8
diff -u -r3.363.2.1 autoconf.mk.in
50552d8
--- mozilla/config/autoconf.mk.in	17 Aug 2005 17:17:17 -0000	3.363.2.1
50552d8
+++ mozilla/config/autoconf.mk.in	15 Dec 2005 05:40:53 -0000
50552d8
@@ -229,6 +229,7 @@
50552d8
 MOZ_INSURE_EXCLUDE_DIRS = @MOZ_INSURE_EXCLUDE_DIRS@
50552d8
 
50552d8
 MOZ_NATIVE_NSPR = @MOZ_NATIVE_NSPR@
50552d8
+MOZ_NATIVE_NSS = @MOZ_NATIVE_NSS@
50552d8
 
50552d8
 CROSS_COMPILE   = @CROSS_COMPILE@
50552d8
 
50552d8
@@ -384,6 +385,48 @@
50552d8
 NSPR_CFLAGS	= @NSPR_CFLAGS@
50552d8
 NSPR_LIBS	= @NSPR_LIBS@
50552d8
 
50552d8
+NSS_CONFIG	= @NSS_CONFIG@
50552d8
+NSS_CFLAGS	= @NSS_CFLAGS@
50552d8
+NSS_LIBS	= @NSS_LIBS@
50552d8
+
50552d8
+ifdef MOZ_NATIVE_NSS
50552d8
+NSS_DEP_LIBS	= \
50552d8
+	$(NULL)
50552d8
+NSS_LIBS += \
50552d8
+	-lcrmf \
50552d8
+	$(NULL)
50552d8
+else
50552d8
+NSS_DEP_LIBS	= \
50552d8
+	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
50552d8
+	$(DIST)/lib/$(DLL_PREFIX)smime3$(DLL_SUFFIX) \
50552d8
+	$(DIST)/lib/$(DLL_PREFIX)ssl3$(DLL_SUFFIX) \
50552d8
+	$(DIST)/lib/$(DLL_PREFIX)nss3$(DLL_SUFFIX) \
50552d8
+	$(DIST)/lib/$(DLL_PREFIX)softokn3$(DLL_SUFFIX) \
50552d8
+	$(NULL)
50552d8
+NSS_LIBS = \
50552d8
+	$(LIBS_DIR) \
50552d8
+	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
50552d8
+	-lsmime3 \
50552d8
+	-lssl3 \
50552d8
+	-lnss3 \
50552d8
+	-lsoftokn3 \
50552d8
+	$(NULL)
50552d8
+endif
50552d8
+
50552d8
+ifneq (,$(filter OS2 WINNT WINCE, $(OS_ARCH)))
50552d8
+ifndef GNU_CC
50552d8
+ifndef MOZ_NATIVE_NSS
50552d8
+NSS_LIBS	= \
50552d8
+	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
50552d8
+	$(DIST)/lib/$(LIB_PREFIX)smime3.$(IMPORT_LIB_SUFFIX) \
50552d8
+	$(DIST)/lib/$(LIB_PREFIX)ssl3.$(IMPORT_LIB_SUFFIX) \
50552d8
+	$(DIST)/lib/$(LIB_PREFIX)nss3.$(IMPORT_LIB_SUFFIX) \
50552d8
+	$(DIST)/lib/$(LIB_PREFIX)softokn3.$(IMPORT_LIB_SUFFIX) \
50552d8
+	$(NULL)
50552d8
+endif
50552d8
+endif
50552d8
+endif
50552d8
+
50552d8
 LDAP_CFLAGS	= @LDAP_CFLAGS@
50552d8
 LDAP_LIBS	= @LDAP_LIBS@
50552d8
 XPCOM_GLUE_LDOPTS = @XPCOM_GLUE_LDOPTS@
50552d8
Index: mozilla/config/config.mk
50552d8
===================================================================
50552d8
RCS file: /cvsroot/mozilla/config/config.mk,v
50552d8
retrieving revision 3.337
50552d8
diff -u -r3.337 config.mk
50552d8
--- mozilla/config/config.mk	28 Jul 2005 19:48:11 -0000	3.337
50552d8
+++ mozilla/config/config.mk	15 Dec 2005 05:40:54 -0000
50552d8
@@ -138,39 +138,6 @@
50552d8
 FINAL_LINK_COMPS = $(DEPTH)/config/final-link-comps
50552d8
 FINAL_LINK_COMP_NAMES = $(DEPTH)/config/final-link-comp-names
50552d8
 
50552d8
-# 
50552d8
-# NSS libs needed for final link in static build
50552d8
-# 
50552d8
-
50552d8
-NSS_LIBS	= \
50552d8
-	$(LIBS_DIR) \
50552d8
-	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
50552d8
-	-lsmime3 \
50552d8
-	-lssl3 \
50552d8
-	-lnss3 \
50552d8
-	-lsoftokn3 \
50552d8
-	$(NULL)
50552d8
-
50552d8
-ifneq (,$(filter OS2 WINNT WINCE, $(OS_ARCH)))
50552d8
-ifndef GNU_CC
50552d8
-NSS_LIBS	= \
50552d8
-	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
50552d8
-	$(DIST)/lib/$(LIB_PREFIX)smime3.$(IMPORT_LIB_SUFFIX) \
50552d8
-	$(DIST)/lib/$(LIB_PREFIX)ssl3.$(IMPORT_LIB_SUFFIX) \
50552d8
-	$(DIST)/lib/$(LIB_PREFIX)nss3.$(IMPORT_LIB_SUFFIX) \
50552d8
-	$(DIST)/lib/$(LIB_PREFIX)softokn3.$(IMPORT_LIB_SUFFIX) \
50552d8
-	$(NULL)
50552d8
-endif
50552d8
-endif
50552d8
-
50552d8
-NSS_DEP_LIBS	= \
50552d8
-	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
50552d8
-	$(DIST)/lib/$(DLL_PREFIX)smime3$(DLL_SUFFIX) \
50552d8
-	$(DIST)/lib/$(DLL_PREFIX)ssl3$(DLL_SUFFIX) \
50552d8
-	$(DIST)/lib/$(DLL_PREFIX)nss3$(DLL_SUFFIX) \
50552d8
-	$(DIST)/lib/$(DLL_PREFIX)softokn3$(DLL_SUFFIX) \
50552d8
-	$(NULL)
50552d8
-
50552d8
 MOZ_UNICHARUTIL_LIBS = $(DIST)/lib/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX)
50552d8
 MOZ_REGISTRY_LIBS          = $(DIST)/lib/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX)
50552d8
 MOZ_WIDGET_SUPPORT_LIBS    = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX)
50552d8
Index: mozilla/build/autoconf/nss.m4
50552d8
===================================================================
50552d8
RCS file: mozilla/build/autoconf/nss.m4
50552d8
diff -N mozilla/build/autoconf/nss.m4
50552d8
--- /dev/null	1 Jan 1970 00:00:00 -0000
50552d8
+++ mozilla/build/autoconf/nss.m4	15 Dec 2005 05:40:54 -0000
50552d8
@@ -0,0 +1,67 @@
50552d8
+# -*- tab-width: 4; -*-
50552d8
+# Configure paths for NSS
50552d8
+# Public domain - Chris Seawood <cls@seawood.org> 2001-04-05
50552d8
+# Based upon gtk.m4 (also PD) by Owen Taylor
50552d8
+
50552d8
+dnl AM_PATH_NSS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
50552d8
+dnl Test for NSS, and define NSS_CFLAGS and NSS_LIBS
50552d8
+AC_DEFUN(AM_PATH_NSS,
50552d8
+[dnl
50552d8
+
50552d8
+AC_ARG_WITH(nss-prefix,
50552d8
+	[  --with-nss-prefix=PFX  Prefix where NSS is installed],
50552d8
+	nss_config_prefix="$withval",
50552d8
+	nss_config_prefix="")
50552d8
+
50552d8
+AC_ARG_WITH(nss-exec-prefix,
50552d8
+	[  --with-nss-exec-prefix=PFX
50552d8
+                          Exec prefix where NSS is installed],
50552d8
+	nss_config_exec_prefix="$withval",
50552d8
+	nss_config_exec_prefix="")
50552d8
+
50552d8
+	if test -n "$nss_config_exec_prefix"; then
50552d8
+		nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix"
50552d8
+		if test -z "$NSS_CONFIG"; then
50552d8
+			NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config
50552d8
+		fi
50552d8
+	fi
50552d8
+	if test -n "$nss_config_prefix"; then
50552d8
+		nss_config_args="$nss_config_args --prefix=$nss_config_prefix"
50552d8
+		if test -z "$NSS_CONFIG"; then
50552d8
+			NSS_CONFIG=$nss_config_prefix/bin/nss-config
50552d8
+		fi
50552d8
+	fi
50552d8
+
50552d8
+	unset ac_cv_path_NSS_CONFIG
50552d8
+	AC_PATH_PROG(NSS_CONFIG, nss-config, no)
50552d8
+	min_nss_version=ifelse([$1], ,3.0.0,$1)
50552d8
+	AC_MSG_CHECKING(for NSS - version >= $min_nss_version (skipping))
50552d8
+
50552d8
+	no_nss=""
50552d8
+	if test "$NSS_CONFIG" = "no"; then
50552d8
+		no_nss="yes"
50552d8
+	else
50552d8
+		NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
50552d8
+		NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`
50552d8
+
50552d8
+		dnl Skip version check for now
50552d8
+		nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
50552d8
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
50552d8
+		nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
50552d8
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
50552d8
+		nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
50552d8
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
50552d8
+	fi
50552d8
+
50552d8
+	if test -z "$no_nss"; then
50552d8
+		AC_MSG_RESULT(yes)
50552d8
+		ifelse([$2], , :, [$2])     
50552d8
+	else
50552d8
+		AC_MSG_RESULT(no)
50552d8
+	fi
50552d8
+
50552d8
+
50552d8
+	AC_SUBST(NSS_CFLAGS)
50552d8
+	AC_SUBST(NSS_LIBS)
50552d8
+
50552d8
+])
50552d8
Index: mozilla/security/manager/Makefile.in
50552d8
===================================================================
50552d8
RCS file: /cvsroot/mozilla/security/manager/Makefile.in,v
50552d8
retrieving revision 1.57
50552d8
diff -u -r1.57 Makefile.in
50552d8
--- mozilla/security/manager/Makefile.in	2 Jun 2005 02:03:05 -0000	1.57
50552d8
+++ mozilla/security/manager/Makefile.in	15 Dec 2005 05:40:54 -0000
50552d8
@@ -46,6 +46,8 @@
50552d8
 MODULE = psm
50552d8
 
50552d8
 PACKAGE_FILE = psm.pkg
50552d8
+
50552d8
+ifndef MOZ_NATIVE_NSS
50552d8
 PACKAGE_VARS += \
50552d8
 	NSS3_LIB \
50552d8
 	SMIME3_LIB \
50552d8
@@ -57,6 +59,7 @@
50552d8
 	$(NULL)
50552d8
 
50552d8
 LOADABLE_ROOT_MODULE = $(DLL_PREFIX)nssckbi$(DLL_SUFFIX)
50552d8
+endif
50552d8
 
50552d8
 NSS3_LIB = $(DLL_PREFIX)nss3$(DLL_SUFFIX)
50552d8
 SMIME3_LIB = $(DLL_PREFIX)smime3$(DLL_SUFFIX)
50552d8
@@ -147,6 +150,7 @@
50552d8
 export:: .nss.cleaned
50552d8
 
50552d8
 .nss.cleaned: .nss.checkout
50552d8
+ifndef MOZ_NATIVE_NSS
50552d8
 	$(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
50552d8
 	$(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
50552d8
 ifndef SKIP_CHK
50552d8
@@ -154,9 +158,12 @@
50552d8
 	$(MAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
50552d8
 endif
50552d8
 	touch $@
50552d8
+endif
50552d8
 
50552d8
 .nss.checkout:
50552d8
+ifndef MOZ_NATIVE_NSS
50552d8
 	touch $(srcdir)/$@
50552d8
+endif
50552d8
 
50552d8
 dependclean export packages chrome::
50552d8
 	$(MAKE) -C boot $@
50552d8
@@ -167,12 +174,15 @@
50552d8
 endif
50552d8
 
50552d8
 libs::
50552d8
+ifndef MOZ_NATIVE_NSS
50552d8
 	$(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS)
50552d8
+endif
50552d8
 ifeq ($(OS_ARCH),WINNT)
50552d8
 	cd $(DIST)/lib; cp -f $(LIB_PREFIX)dbm$(MOZ_BITS).$(LIB_SUFFIX) $(LIB_PREFIX)dbm.$(LIB_SUFFIX)
50552d8
 else
50552d8
 	cd $(DIST)/lib; cp -f $(LIB_PREFIX)mozdbm_s.$(LIB_SUFFIX) $(LIB_PREFIX)dbm.$(LIB_SUFFIX); $(RANLIB) $(LIB_PREFIX)dbm.$(LIB_SUFFIX)
50552d8
 endif
50552d8
+ifndef MOZ_NATIVE_NSS
50552d8
 	$(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
50552d8
 ifndef SKIP_CHK
50552d8
 	$(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
50552d8
@@ -210,6 +220,7 @@
50552d8
 	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_HYBRID_MODULE) $(DIST)/bin
50552d8
 endif
50552d8
 endif
50552d8
+endif
50552d8
 	$(MAKE) -C boot $@
50552d8
 	$(MAKE) -C ssl $@
50552d8
 	$(MAKE) -C locales $@
50552d8
@@ -218,6 +229,7 @@
50552d8
 endif
50552d8
 
50552d8
 install::
50552d8
+ifndef MOZ_NATIVE_NSS
50552d8
 	$(SYSINSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DESTDIR)$(mozappdir)
50552d8
 ifndef SKIP_CHK
50552d8
 	$(SYSINSTALL) -m 644 $(DIST)/lib/$(SOFTOKEN3_CHK) $(DESTDIR)$(mozappdir)
50552d8
@@ -232,6 +244,7 @@
50552d8
 	$(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_HYBRID_CHK) $(DESTDIR)$(mozappdir)
50552d8
 	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_HYBRID_MODULE) $(DESTDIR)$(mozappdir)
50552d8
 endif
50552d8
+endif
50552d8
 	$(MAKE) -C boot $@
50552d8
 	$(MAKE) -C ssl $@
50552d8
 	$(MAKE) -C locales $@
50552d8
@@ -246,15 +259,18 @@
50552d8
 ifdef MOZ_XUL
50552d8
 	$(MAKE) -C pki $@
50552d8
 endif
50552d8
+ifndef MOZ_NATIVE_NSS
50552d8
 	$(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
50552d8
 	$(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
50552d8
 ifndef SKIP_CHK
50552d8
 	$(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean
50552d8
 	$(MAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
50552d8
 endif
50552d8
+endif
50552d8
 
50552d8
 echo-requires-recursive::
50552d8
 	$(MAKE) -C boot $@
50552d8
 	$(MAKE) -C ssl $@
50552d8
 	$(MAKE) -C pki $@
50552d8
 	$(MAKE) -C locales $@
50552d8
+
50552d8
Index: mozilla/security/manager/ssl/src/Makefile.in
50552d8
===================================================================
50552d8
RCS file: /cvsroot/mozilla/security/manager/ssl/src/Makefile.in,v
50552d8
retrieving revision 1.67
50552d8
diff -u -r1.67 Makefile.in
50552d8
--- mozilla/security/manager/ssl/src/Makefile.in	3 Aug 2005 05:24:18 -0000	1.67
50552d8
+++ mozilla/security/manager/ssl/src/Makefile.in	15 Dec 2005 05:40:56 -0000
50552d8
@@ -123,8 +123,13 @@
50552d8
 
50552d8
 # Use local includes because they are inserted before INCLUDES
50552d8
 # so that Mozilla's nss.h is used, not glibc's
50552d8
+ifdef MOZ_NATIVE_NSS
50552d8
+LOCAL_INCLUDES += $(NSS_CFLAGS) \
50552d8
+                  $(NULL)
50552d8
+else
50552d8
 LOCAL_INCLUDES += -I$(DIST)/public/nss \
50552d8
                   $(NULL)
50552d8
+endif
50552d8
 
50552d8
 EXTRA_DSO_LDOPTS += \
50552d8
 		$(MOZ_UNICHARUTIL_LIBS) \
50552d8
Index: mozilla/security/manager/ssl/src/nsNSSComponent.cpp
50552d8
===================================================================
50552d8
RCS file: /cvsroot/mozilla/security/manager/ssl/src/nsNSSComponent.cpp,v
50552d8
retrieving revision 1.126.2.1
50552d8
diff -u -r1.126.2.1 nsNSSComponent.cpp
50552d8
--- mozilla/security/manager/ssl/src/nsNSSComponent.cpp	26 Aug 2005 06:41:50 -0000	1.126.2.1
50552d8
+++ mozilla/security/manager/ssl/src/nsNSSComponent.cpp	15 Dec 2005 05:41:00 -0000
50552d8
@@ -488,14 +488,6 @@
50552d8
 }
50552d8
 
50552d8
 
50552d8
-#ifdef XP_MAC
50552d8
-#ifdef DEBUG
50552d8
-#define LOADABLE_CERTS_MODULE NS_LITERAL_CSTRING("NSSckbiDebug.shlb")
50552d8
-#else
50552d8
-#define LOADABLE_CERTS_MODULE NS_LITERAL_CSTRING("NSSckbi.shlb")
50552d8
-#endif /*DEBUG*/ 
50552d8
-#endif /*XP_MAC*/
50552d8
-
50552d8
 static void setOCSPOptions(nsIPrefBranch * pref);
50552d8
 
50552d8
 NS_IMETHODIMP
50552d8
@@ -689,40 +681,40 @@
50552d8
 
50552d8
     const char *possible_ckbi_locations[] = {
50552d8
       NS_GRE_DIR,
50552d8
-      NS_XPCOM_CURRENT_PROCESS_DIR
50552d8
+      NS_XPCOM_CURRENT_PROCESS_DIR,
50552d8
+      0
50552d8
     };
50552d8
-    
50552d8
+
50552d8
     for (size_t il = 0; il < sizeof(possible_ckbi_locations)/sizeof(const char*); ++il) {
50552d8
       nsCOMPtr<nsILocalFile> mozFile;
50552d8
-      directoryService->Get( possible_ckbi_locations[il],
50552d8
-                             NS_GET_IID(nsILocalFile), 
50552d8
-                             getter_AddRefs(mozFile));
50552d8
+      char *fullModuleName = nsnull;
50552d8
+
50552d8
+      if (!possible_ckbi_locations[il])
50552d8
+      {
50552d8
+        fullModuleName = PR_GetLibraryName(nsnull, "nssckbi");
50552d8
+      }
50552d8
+      else
50552d8
+      {
50552d8
+        directoryService->Get( possible_ckbi_locations[il],
50552d8
+                               NS_GET_IID(nsILocalFile), 
50552d8
+                               getter_AddRefs(mozFile));
50552d8
     
50552d8
-      if (!mozFile) {
50552d8
-        continue;
50552d8
+        if (!mozFile) {
50552d8
+          continue;
50552d8
+        }
50552d8
+
50552d8
+        nsCAutoString processDir;
50552d8
+        mozFile->GetNativePath(processDir);
50552d8
+        fullModuleName = PR_GetLibraryName(processDir.get(), "nssckbi");
50552d8
       }
50552d8
 
50552d8
-      char *fullModuleName = nsnull;
50552d8
-#ifdef XP_MAC
50552d8
-      nsCAutoString nativePath;
50552d8
-      mozFile->AppendNative(NS_LITERAL_CSTRING("Essential Files"));
50552d8
-      mozFile->AppendNative(LOADABLE_CERTS_MODULE);
50552d8
-      mozFile->GetNativePath(nativePath);    
50552d8
-      fullModuleName = (char *) nativePath.get();
50552d8
-#else
50552d8
-      nsCAutoString processDir;
50552d8
-      mozFile->GetNativePath(processDir);
50552d8
-      fullModuleName = PR_GetLibraryName(processDir.get(), "nssckbi");
50552d8
-#endif
50552d8
       /* If a module exists with the same name, delete it. */
50552d8
       NS_ConvertUCS2toUTF8 modNameUTF8(modName);
50552d8
       int modType;
50552d8
       SECMOD_DeleteModule(NS_CONST_CAST(char*, modNameUTF8.get()), &modType);
50552d8
       SECStatus rv_add = 
50552d8
         SECMOD_AddNewModule(NS_CONST_CAST(char*, modNameUTF8.get()), fullModuleName, 0, 0);
50552d8
-#ifndef XP_MAC
50552d8
-      PR_Free(fullModuleName); // allocated by NSPR
50552d8
-#endif
50552d8
+      PR_FreeLibraryName(fullModuleName); // allocated by NSPR
50552d8
       if (SECSuccess == rv_add) {
50552d8
         // found a module, no need to try other directories
50552d8
         break;