summaryrefslogtreecommitdiff
path: root/firefox-1.5-with-system-nss.patch
blob: 1e9c701f2c4374e96b873886d98cc69300cef2e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
Index: mozilla/configure.in
===================================================================
RCS file: /cvsroot/mozilla/configure.in,v
retrieving revision 1.1503.2.15
diff -u -r1.1503.2.15 configure.in
--- mozilla/configure.in	4 Oct 2005 05:53:49 -0000	1.1503.2.15
+++ mozilla/configure.in	15 Dec 2005 05:40:40 -0000
@@ -86,6 +86,7 @@
 MOZPNG=10207
 MOZZLIB=1.2.3
 NSPR_VERSION=4
+NSS_VERSION=3
 
 dnl Set the minimum version of toolkit libs used by mozilla
 dnl ========================================================
@@ -3472,6 +3473,19 @@
     fi
 fi
 
+dnl ========================================================
+dnl = If NSS was not detected in the system, 
+dnl = use the one in the source tree (mozilla/security/nss)
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-nss,
+[  --with-system-nss      Use system installed NSS],
+    _USE_SYSTEM_NSS=1 )
+
+if test -n "$_USE_SYSTEM_NSS"; then
+    AM_PATH_NSS(3.0.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
+fi
+
 if test -z "$SKIP_LIBRARY_CHECKS"; then
 dnl system JPEG support
 dnl ========================================================
@@ -6698,6 +6712,10 @@
 AC_SUBST(NSPR_LIBS)
 AC_SUBST(MOZ_NATIVE_NSPR)
 
+AC_SUBST(NSS_CFLAGS)
+AC_SUBST(NSS_LIBS)
+AC_SUBST(MOZ_NATIVE_NSS)
+
 AC_SUBST(CFLAGS)
 AC_SUBST(CXXFLAGS)
 AC_SUBST(CPPFLAGS)
Index: mozilla/configure
===================================================================
RCS file: /cvsroot/mozilla/configure,v
retrieving revision 1.1492.2.17
diff -u -r1.1492.2.17 configure
--- mozilla/configure	4 Oct 2005 06:01:48 -0000	1.1492.2.17
+++ mozilla/configure	15 Dec 2005 05:40:53 -0000
@@ -44,6 +44,13 @@
   --with-nspr-exec-prefix=PFX
                           Exec prefix where NSPR is installed"
 ac_help="$ac_help
+  --with-system-nss      Use system installed NSS"
+ac_help="$ac_help
+  --with-nss-prefix=PFX  Prefix where NSS is installed"
+ac_help="$ac_help
+  --with-nss-exec-prefix=PFX
+                          Exec prefix where NSS is installed"
+ac_help="$ac_help
   --with-system-jpeg[=PFX]
                           Use system libjpeg [installed at prefix PFX]"
 ac_help="$ac_help
@@ -1020,6 +1027,7 @@
 MOZPNG=10207
 MOZZLIB=1.2.3
 NSPR_VERSION=4
+NSS_VERSION=3
 
 GLIB_VERSION=1.2.0
 GTK_VERSION=1.2.0
@@ -11300,6 +11308,123 @@
     fi
 fi
 
+
+# Check whether --with-system-nss or --without-system-nss was given.
+if test "${with_system_nss+set}" = set; then
+  withval="$with_system_nss"
+  if test "$withval" = "yes"; then
+    _USE_SYSTEM_NSS=1 
+  elif test "$withval" = "no"; then
+    :
+  else
+    { echo "configure: error: Option, system-nss, does not take an argument ($withval)." 1>&2; exit 1; }
+  fi
+fi
+
+
+if test -n "$_USE_SYSTEM_NSS"; then
+    
+# Check whether --with-nss-prefix or --without-nss-prefix was given.
+if test "${with_nss_prefix+set}" = set; then
+  withval="$with_nss_prefix"
+  nss_config_prefix="$withval"
+else
+  nss_config_prefix=""
+fi
+
+
+# Check whether --with-nss-exec-prefix or --without-nss-exec-prefix was given.
+if test "${with_nss_exec_prefix+set}" = set; then
+  withval="$with_nss_exec_prefix"
+  nss_config_exec_prefix="$withval"
+else
+  nss_config_exec_prefix=""
+fi
+
+
+	if test -n "$nss_config_exec_prefix"; then
+		nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix"
+		if test -z "$NSS_CONFIG"; then
+			NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config
+		fi
+	fi
+	if test -n "$nss_config_prefix"; then
+		nss_config_args="$nss_config_args --prefix=$nss_config_prefix"
+		if test -z "$NSS_CONFIG"; then
+			NSS_CONFIG=$nss_config_prefix/bin/nss-config
+		fi
+	fi
+
+	unset ac_cv_path_NSS_CONFIG
+	# Extract the first word of "nss-config", so it can be a program name with args.
+set dummy nss-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:11363: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_NSS_CONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$NSS_CONFIG" in
+  /*)
+  ac_cv_path_NSS_CONFIG="$NSS_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)			 
+  ac_cv_path_NSS_CONFIG="$NSS_CONFIG" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_NSS_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_NSS_CONFIG" && ac_cv_path_NSS_CONFIG="no"
+  ;;
+esac
+fi
+NSS_CONFIG="$ac_cv_path_NSS_CONFIG"
+if test -n "$NSS_CONFIG"; then
+  echo "$ac_t""$NSS_CONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+	min_nss_version=3.0.0
+	echo $ac_n "checking for NSS - version >= $min_nss_version (skipping)""... $ac_c" 1>&6
+echo "configure:11398: checking for NSS - version >= $min_nss_version (skipping)" >&5
+
+	no_nss=""
+	if test "$NSS_CONFIG" = "no"; then
+		no_nss="yes"
+	else
+		NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
+		NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`
+
+				nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
+			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+		nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
+			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+		nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
+			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+	fi
+
+	if test -z "$no_nss"; then
+		echo "$ac_t""yes" 1>&6
+		MOZ_NATIVE_NSS=1     
+	else
+		echo "$ac_t""no" 1>&6
+	fi
+
+
+	
+	
+
+
+fi
+
 if test -z "$SKIP_LIBRARY_CHECKS"; then
 # Check whether --with-system-jpeg or --without-system-jpeg was given.
 if test "${with_system_jpeg+set}" = set; then
@@ -19473,6 +19602,9 @@
 s%@NSPR_CONFIG@%$NSPR_CONFIG%g
 s%@NSPR_CFLAGS@%$NSPR_CFLAGS%g
 s%@NSPR_LIBS@%$NSPR_LIBS%g
+s%@NSS_CONFIG@%$NSS_CONFIG%g
+s%@NSS_CFLAGS@%$NSS_CFLAGS%g
+s%@NSS_LIBS@%$NSS_LIBS%g
 s%@GTK_CONFIG@%$GTK_CONFIG%g
 s%@GTK_CFLAGS@%$GTK_CFLAGS%g
 s%@GTK_LIBS@%$GTK_LIBS%g
@@ -19753,6 +19885,7 @@
 s%@MOZ_PNG_CFLAGS@%$MOZ_PNG_CFLAGS%g
 s%@MOZ_PNG_LIBS@%$MOZ_PNG_LIBS%g
 s%@MOZ_NATIVE_NSPR@%$MOZ_NATIVE_NSPR%g
+s%@MOZ_NATIVE_NSS@%$MOZ_NATIVE_NSS%g
 s%@COMPILE_CFLAGS@%$COMPILE_CFLAGS%g
 s%@COMPILE_CXXFLAGS@%$COMPILE_CXXFLAGS%g
 s%@CROSS_COMPILE@%$CROSS_COMPILE%g
Index: mozilla/aclocal.m4
===================================================================
RCS file: /cvsroot/mozilla/aclocal.m4,v
retrieving revision 1.14
diff -u -r1.14 aclocal.m4
--- mozilla/aclocal.m4	13 May 2004 03:12:47 -0000	1.14
+++ mozilla/aclocal.m4	15 Dec 2005 05:40:53 -0000
@@ -8,6 +8,7 @@
 builtin(include, build/autoconf/libIDL.m4)dnl
 builtin(include, build/autoconf/libIDL-2.m4)dnl
 builtin(include, build/autoconf/nspr.m4)dnl
+builtin(include, build/autoconf/nss.m4)dnl
 builtin(include, build/autoconf/libart.m4)dnl
 builtin(include, build/autoconf/pkg.m4)dnl
 builtin(include, build/autoconf/freetype2.m4)dnl
Index: mozilla/config/autoconf.mk.in
===================================================================
RCS file: /cvsroot/mozilla/config/autoconf.mk.in,v
retrieving revision 3.363.2.1
diff -u -r3.363.2.1 autoconf.mk.in
--- mozilla/config/autoconf.mk.in	17 Aug 2005 17:17:17 -0000	3.363.2.1
+++ mozilla/config/autoconf.mk.in	15 Dec 2005 05:40:53 -0000
@@ -229,6 +229,7 @@
 MOZ_INSURE_EXCLUDE_DIRS = @MOZ_INSURE_EXCLUDE_DIRS@
 
 MOZ_NATIVE_NSPR = @MOZ_NATIVE_NSPR@
+MOZ_NATIVE_NSS = @MOZ_NATIVE_NSS@
 
 CROSS_COMPILE   = @CROSS_COMPILE@
 
@@ -384,6 +385,48 @@
 NSPR_CFLAGS	= @NSPR_CFLAGS@
 NSPR_LIBS	= @NSPR_LIBS@
 
+NSS_CONFIG	= @NSS_CONFIG@
+NSS_CFLAGS	= @NSS_CFLAGS@
+NSS_LIBS	= @NSS_LIBS@
+
+ifdef MOZ_NATIVE_NSS
+NSS_DEP_LIBS	= \
+	$(NULL)
+NSS_LIBS += \
+	-lcrmf \
+	$(NULL)
+else
+NSS_DEP_LIBS	= \
+	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
+	$(DIST)/lib/$(DLL_PREFIX)smime3$(DLL_SUFFIX) \
+	$(DIST)/lib/$(DLL_PREFIX)ssl3$(DLL_SUFFIX) \
+	$(DIST)/lib/$(DLL_PREFIX)nss3$(DLL_SUFFIX) \
+	$(DIST)/lib/$(DLL_PREFIX)softokn3$(DLL_SUFFIX) \
+	$(NULL)
+NSS_LIBS = \
+	$(LIBS_DIR) \
+	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
+	-lsmime3 \
+	-lssl3 \
+	-lnss3 \
+	-lsoftokn3 \
+	$(NULL)
+endif
+
+ifneq (,$(filter OS2 WINNT WINCE, $(OS_ARCH)))
+ifndef GNU_CC
+ifndef MOZ_NATIVE_NSS
+NSS_LIBS	= \
+	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
+	$(DIST)/lib/$(LIB_PREFIX)smime3.$(IMPORT_LIB_SUFFIX) \
+	$(DIST)/lib/$(LIB_PREFIX)ssl3.$(IMPORT_LIB_SUFFIX) \
+	$(DIST)/lib/$(LIB_PREFIX)nss3.$(IMPORT_LIB_SUFFIX) \
+	$(DIST)/lib/$(LIB_PREFIX)softokn3.$(IMPORT_LIB_SUFFIX) \
+	$(NULL)
+endif
+endif
+endif
+
 LDAP_CFLAGS	= @LDAP_CFLAGS@
 LDAP_LIBS	= @LDAP_LIBS@
 XPCOM_GLUE_LDOPTS = @XPCOM_GLUE_LDOPTS@
Index: mozilla/config/config.mk
===================================================================
RCS file: /cvsroot/mozilla/config/config.mk,v
retrieving revision 3.337
diff -u -r3.337 config.mk
--- mozilla/config/config.mk	28 Jul 2005 19:48:11 -0000	3.337
+++ mozilla/config/config.mk	15 Dec 2005 05:40:54 -0000
@@ -138,39 +138,6 @@
 FINAL_LINK_COMPS = $(DEPTH)/config/final-link-comps
 FINAL_LINK_COMP_NAMES = $(DEPTH)/config/final-link-comp-names
 
-# 
-# NSS libs needed for final link in static build
-# 
-
-NSS_LIBS	= \
-	$(LIBS_DIR) \
-	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
-	-lsmime3 \
-	-lssl3 \
-	-lnss3 \
-	-lsoftokn3 \
-	$(NULL)
-
-ifneq (,$(filter OS2 WINNT WINCE, $(OS_ARCH)))
-ifndef GNU_CC
-NSS_LIBS	= \
-	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
-	$(DIST)/lib/$(LIB_PREFIX)smime3.$(IMPORT_LIB_SUFFIX) \
-	$(DIST)/lib/$(LIB_PREFIX)ssl3.$(IMPORT_LIB_SUFFIX) \
-	$(DIST)/lib/$(LIB_PREFIX)nss3.$(IMPORT_LIB_SUFFIX) \
-	$(DIST)/lib/$(LIB_PREFIX)softokn3.$(IMPORT_LIB_SUFFIX) \
-	$(NULL)
-endif
-endif
-
-NSS_DEP_LIBS	= \
-	$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
-	$(DIST)/lib/$(DLL_PREFIX)smime3$(DLL_SUFFIX) \
-	$(DIST)/lib/$(DLL_PREFIX)ssl3$(DLL_SUFFIX) \
-	$(DIST)/lib/$(DLL_PREFIX)nss3$(DLL_SUFFIX) \
-	$(DIST)/lib/$(DLL_PREFIX)softokn3$(DLL_SUFFIX) \
-	$(NULL)
-
 MOZ_UNICHARUTIL_LIBS = $(DIST)/lib/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX)
 MOZ_REGISTRY_LIBS          = $(DIST)/lib/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX)
 MOZ_WIDGET_SUPPORT_LIBS    = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX)
Index: mozilla/build/autoconf/nss.m4
===================================================================
RCS file: mozilla/build/autoconf/nss.m4
diff -N mozilla/build/autoconf/nss.m4
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mozilla/build/autoconf/nss.m4	15 Dec 2005 05:40:54 -0000
@@ -0,0 +1,67 @@
+# -*- tab-width: 4; -*-
+# Configure paths for NSS
+# Public domain - Chris Seawood <cls@seawood.org> 2001-04-05
+# Based upon gtk.m4 (also PD) by Owen Taylor
+
+dnl AM_PATH_NSS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for NSS, and define NSS_CFLAGS and NSS_LIBS
+AC_DEFUN(AM_PATH_NSS,
+[dnl
+
+AC_ARG_WITH(nss-prefix,
+	[  --with-nss-prefix=PFX  Prefix where NSS is installed],
+	nss_config_prefix="$withval",
+	nss_config_prefix="")
+
+AC_ARG_WITH(nss-exec-prefix,
+	[  --with-nss-exec-prefix=PFX
+                          Exec prefix where NSS is installed],
+	nss_config_exec_prefix="$withval",
+	nss_config_exec_prefix="")
+
+	if test -n "$nss_config_exec_prefix"; then
+		nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix"
+		if test -z "$NSS_CONFIG"; then
+			NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config
+		fi
+	fi
+	if test -n "$nss_config_prefix"; then
+		nss_config_args="$nss_config_args --prefix=$nss_config_prefix"
+		if test -z "$NSS_CONFIG"; then
+			NSS_CONFIG=$nss_config_prefix/bin/nss-config
+		fi
+	fi
+
+	unset ac_cv_path_NSS_CONFIG
+	AC_PATH_PROG(NSS_CONFIG, nss-config, no)
+	min_nss_version=ifelse([$1], ,3.0.0,$1)
+	AC_MSG_CHECKING(for NSS - version >= $min_nss_version (skipping))
+
+	no_nss=""
+	if test "$NSS_CONFIG" = "no"; then
+		no_nss="yes"
+	else
+		NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
+		NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`
+
+		dnl Skip version check for now
+		nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+		nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+		nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+	fi
+
+	if test -z "$no_nss"; then
+		AC_MSG_RESULT(yes)
+		ifelse([$2], , :, [$2])     
+	else
+		AC_MSG_RESULT(no)
+	fi
+
+
+	AC_SUBST(NSS_CFLAGS)
+	AC_SUBST(NSS_LIBS)
+
+])
Index: mozilla/security/manager/Makefile.in
===================================================================
RCS file: /cvsroot/mozilla/security/manager/Makefile.in,v
retrieving revision 1.57
diff -u -r1.57 Makefile.in
--- mozilla/security/manager/Makefile.in	2 Jun 2005 02:03:05 -0000	1.57
+++ mozilla/security/manager/Makefile.in	15 Dec 2005 05:40:54 -0000
@@ -46,6 +46,8 @@
 MODULE = psm
 
 PACKAGE_FILE = psm.pkg
+
+ifndef MOZ_NATIVE_NSS
 PACKAGE_VARS += \
 	NSS3_LIB \
 	SMIME3_LIB \
@@ -57,6 +59,7 @@
 	$(NULL)
 
 LOADABLE_ROOT_MODULE = $(DLL_PREFIX)nssckbi$(DLL_SUFFIX)
+endif
 
 NSS3_LIB = $(DLL_PREFIX)nss3$(DLL_SUFFIX)
 SMIME3_LIB = $(DLL_PREFIX)smime3$(DLL_SUFFIX)
@@ -147,6 +150,7 @@
 export:: .nss.cleaned
 
 .nss.cleaned: .nss.checkout
+ifndef MOZ_NATIVE_NSS
 	$(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
 	$(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
 ifndef SKIP_CHK
@@ -154,9 +158,12 @@
 	$(MAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
 endif
 	touch $@
+endif
 
 .nss.checkout:
+ifndef MOZ_NATIVE_NSS
 	touch $(srcdir)/$@
+endif
 
 dependclean export packages chrome::
 	$(MAKE) -C boot $@
@@ -167,12 +174,15 @@
 endif
 
 libs::
+ifndef MOZ_NATIVE_NSS
 	$(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS)
+endif
 ifeq ($(OS_ARCH),WINNT)
 	cd $(DIST)/lib; cp -f $(LIB_PREFIX)dbm$(MOZ_BITS).$(LIB_SUFFIX) $(LIB_PREFIX)dbm.$(LIB_SUFFIX)
 else
 	cd $(DIST)/lib; cp -f $(LIB_PREFIX)mozdbm_s.$(LIB_SUFFIX) $(LIB_PREFIX)dbm.$(LIB_SUFFIX); $(RANLIB) $(LIB_PREFIX)dbm.$(LIB_SUFFIX)
 endif
+ifndef MOZ_NATIVE_NSS
 	$(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
 ifndef SKIP_CHK
 	$(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
@@ -210,6 +220,7 @@
 	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_HYBRID_MODULE) $(DIST)/bin
 endif
 endif
+endif
 	$(MAKE) -C boot $@
 	$(MAKE) -C ssl $@
 	$(MAKE) -C locales $@
@@ -218,6 +229,7 @@
 endif
 
 install::
+ifndef MOZ_NATIVE_NSS
 	$(SYSINSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DESTDIR)$(mozappdir)
 ifndef SKIP_CHK
 	$(SYSINSTALL) -m 644 $(DIST)/lib/$(SOFTOKEN3_CHK) $(DESTDIR)$(mozappdir)
@@ -232,6 +244,7 @@
 	$(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_HYBRID_CHK) $(DESTDIR)$(mozappdir)
 	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_HYBRID_MODULE) $(DESTDIR)$(mozappdir)
 endif
+endif
 	$(MAKE) -C boot $@
 	$(MAKE) -C ssl $@
 	$(MAKE) -C locales $@
@@ -246,15 +259,18 @@
 ifdef MOZ_XUL
 	$(MAKE) -C pki $@
 endif
+ifndef MOZ_NATIVE_NSS
 	$(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
 	$(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
 ifndef SKIP_CHK
 	$(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean
 	$(MAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
 endif
+endif
 
 echo-requires-recursive::
 	$(MAKE) -C boot $@
 	$(MAKE) -C ssl $@
 	$(MAKE) -C pki $@
 	$(MAKE) -C locales $@
+
Index: mozilla/security/manager/ssl/src/Makefile.in
===================================================================
RCS file: /cvsroot/mozilla/security/manager/ssl/src/Makefile.in,v
retrieving revision 1.67
diff -u -r1.67 Makefile.in
--- mozilla/security/manager/ssl/src/Makefile.in	3 Aug 2005 05:24:18 -0000	1.67
+++ mozilla/security/manager/ssl/src/Makefile.in	15 Dec 2005 05:40:56 -0000
@@ -123,8 +123,13 @@
 
 # Use local includes because they are inserted before INCLUDES
 # so that Mozilla's nss.h is used, not glibc's
+ifdef MOZ_NATIVE_NSS
+LOCAL_INCLUDES += $(NSS_CFLAGS) \
+                  $(NULL)
+else
 LOCAL_INCLUDES += -I$(DIST)/public/nss \
                   $(NULL)
+endif
 
 EXTRA_DSO_LDOPTS += \
 		$(MOZ_UNICHARUTIL_LIBS) \
Index: mozilla/security/manager/ssl/src/nsNSSComponent.cpp
===================================================================
RCS file: /cvsroot/mozilla/security/manager/ssl/src/nsNSSComponent.cpp,v
retrieving revision 1.126.2.1
diff -u -r1.126.2.1 nsNSSComponent.cpp
--- mozilla/security/manager/ssl/src/nsNSSComponent.cpp	26 Aug 2005 06:41:50 -0000	1.126.2.1
+++ mozilla/security/manager/ssl/src/nsNSSComponent.cpp	15 Dec 2005 05:41:00 -0000
@@ -488,14 +488,6 @@
 }
 
 
-#ifdef XP_MAC
-#ifdef DEBUG
-#define LOADABLE_CERTS_MODULE NS_LITERAL_CSTRING("NSSckbiDebug.shlb")
-#else
-#define LOADABLE_CERTS_MODULE NS_LITERAL_CSTRING("NSSckbi.shlb")
-#endif /*DEBUG*/ 
-#endif /*XP_MAC*/
-
 static void setOCSPOptions(nsIPrefBranch * pref);
 
 NS_IMETHODIMP
@@ -689,40 +681,40 @@
 
     const char *possible_ckbi_locations[] = {
       NS_GRE_DIR,
-      NS_XPCOM_CURRENT_PROCESS_DIR
+      NS_XPCOM_CURRENT_PROCESS_DIR,
+      0
     };
-    
+
     for (size_t il = 0; il < sizeof(possible_ckbi_locations)/sizeof(const char*); ++il) {
       nsCOMPtr<nsILocalFile> mozFile;
-      directoryService->Get( possible_ckbi_locations[il],
-                             NS_GET_IID(nsILocalFile), 
-                             getter_AddRefs(mozFile));
+      char *fullModuleName = nsnull;
+
+      if (!possible_ckbi_locations[il])
+      {
+        fullModuleName = PR_GetLibraryName(nsnull, "nssckbi");
+      }
+      else
+      {
+        directoryService->Get( possible_ckbi_locations[il],
+                               NS_GET_IID(nsILocalFile), 
+                               getter_AddRefs(mozFile));
     
-      if (!mozFile) {
-        continue;
+        if (!mozFile) {
+          continue;
+        }
+
+        nsCAutoString processDir;
+        mozFile->GetNativePath(processDir);
+        fullModuleName = PR_GetLibraryName(processDir.get(), "nssckbi");
       }
 
-      char *fullModuleName = nsnull;
-#ifdef XP_MAC
-      nsCAutoString nativePath;
-      mozFile->AppendNative(NS_LITERAL_CSTRING("Essential Files"));
-      mozFile->AppendNative(LOADABLE_CERTS_MODULE);
-      mozFile->GetNativePath(nativePath);    
-      fullModuleName = (char *) nativePath.get();
-#else
-      nsCAutoString processDir;
-      mozFile->GetNativePath(processDir);
-      fullModuleName = PR_GetLibraryName(processDir.get(), "nssckbi");
-#endif
       /* If a module exists with the same name, delete it. */
       NS_ConvertUCS2toUTF8 modNameUTF8(modName);
       int modType;
       SECMOD_DeleteModule(NS_CONST_CAST(char*, modNameUTF8.get()), &modType);
       SECStatus rv_add = 
         SECMOD_AddNewModule(NS_CONST_CAST(char*, modNameUTF8.get()), fullModuleName, 0, 0);
-#ifndef XP_MAC
-      PR_Free(fullModuleName); // allocated by NSPR
-#endif
+      PR_FreeLibraryName(fullModuleName); // allocated by NSPR
       if (SECSuccess == rv_add) {
         // found a module, no need to try other directories
         break;
bgstack15