Bugzilla bug 184517: merged the Solaris packaging support from the NSPRPUB_RELEASE_4_1_BRANCH
authorwtc%netscape.com
Wed, 11 Dec 2002 20:06:17 +0000
branchNSPRPUB_RELEASE_4_1_BRANCH
changeset 2602 18ee4b307f9457417ffdb3c6880092e004d633e2
parent 2599 a4ae694b9701ce5cef2820ac45dc314cd9de85e9
child 2636 3f7100f92966efe76f0a41fcf408146c3530bdbd
push idunknown
push userunknown
push dateunknown
bugs184517
Bugzilla bug 184517: merged the Solaris packaging support from the NSPRPUB_RELEASE_4_1_2_SUN_PKG_BRANCH to the NSPRPUB_RELEASE_4_1_BRANCH. On the NSPRPUB_RELEASE_4_1_BRANCH one needs to set BUILD_SUN_PKG=1 to build NSPR with the new filtee library name (libnspr_flt4.so).
Makefile
config/SunOS5.mk
config/module.df
config/rules.mk
lib/ds/Makefile
lib/ds/plds.def
lib/libc/src/Makefile
lib/libc/src/plc.def
pkg/solaris/Makefile
pkg/solaris/Makefile.com
pkg/solaris/Makefile.targ
pkg/solaris/SUNWpr/Makefile
pkg/solaris/SUNWpr/depend
pkg/solaris/SUNWpr/pkginfo.tmpl
pkg/solaris/SUNWpr/prototype_com
pkg/solaris/SUNWpr/prototype_i386
pkg/solaris/SUNWpr/prototype_sparc
pkg/solaris/SUNWprx/Makefile
pkg/solaris/SUNWprx/depend
pkg/solaris/SUNWprx/pkginfo.tmpl
pkg/solaris/SUNWprx/prototype_com
pkg/solaris/SUNWprx/prototype_sparc
pkg/solaris/bld_awk_pkginfo.ksh
pkg/solaris/common_files/copyright
pr/include/prcountr.h
pr/include/prolock.h
pr/include/prtrace.h
pr/src/Makefile
pr/src/md/unix/Makefile
pr/src/misc/prcountr.c
pr/src/misc/prolock.c
pr/src/misc/prtrace.c
pr/src/nspr.def
--- a/Makefile
+++ b/Makefile
@@ -117,10 +117,16 @@ endif
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/imports.df; \
 	cd $(OBJDIR_NAME); \
 	cp -f mdbinary.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(OBJDIR_NAME); \
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/mdbinary.jar; \
 	cd include; \
 	cp -f mdheader.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(OBJDIR_NAME); \
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/mdheader.jar
 
+solarispkg:
+	@echo Making Solaris packages.
+	rm -rf pkg/$(OBJDIR)
+	cp -r pkg/solaris pkg/$(OBJDIR)
+	$(MAKE) -C pkg/$(OBJDIR) publish
+
 depend:
 	@echo "NSPR20 has no dependencies.  Skipped."
--- a/config/SunOS5.mk
+++ b/config/SunOS5.mk
@@ -155,28 +155,40 @@ endif
 # Purify doesn't like -MDupdate
 NOMD_OS_CFLAGS		= $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
 
 MKSHLIB			= $(LD) $(DSO_LDOPTS)
 
 # ld options:
 # -G: produce a shared object
 # -z defs: no unresolved symbols allowed
-DSO_LDOPTS		= -G -h $(notdir $@)
+DSO_LDOPTS		= -G -h $(notdir $@) -z combreloc -z defs
 
 # -KPIC generates position independent code for use in shared libraries.
 # (Similarly for -fPIC in case of gcc.)
 ifdef NS_USE_GCC
 DSO_CFLAGS		= -fPIC
 else
 DSO_CFLAGS		= -KPIC
 endif
 
 NOSUCHFILE		= /no-such-file
 
+ifeq ($(BUILD_SUN_PKG),1)
+#
+# There is an assembly language implementation of the NSPR atomic functions
+# available for UltraSparc systems.  On Solaris, these are used by setting up a
+# "filtee" which contains those routines.  The "filter" (libnspr.so, for
+# instance) loads the filtee if it can find it, based on what's passed in
+# through the -f option to ld.  See the nspr Makefile for how this is used.
+#
+ifeq ($(OS_TEST),sun4u)
+ULTRASPARC_LIBRARY = nspr_flt
+endif
+else
 #
 # Library of atomic functions for UltraSparc systems
 #
 # The nspr makefiles build ULTRASPARC_LIBRARY (which contains assembly language
 # implementation of the nspr atomic functions for UltraSparc systems) in addition
 # to libnspr.so. (The actual name of the library is
 # lib$(ULTRASPARC_LIBRARY)$(MOD_VERSION).so
 #
@@ -189,8 +201,9 @@ NOSUCHFILE		= /no-such-file
 # accident on non-UltraSparc systems.
 # The directory containing the ultrasparc libraries should be in LD_LIBRARY_PATH.
 #
 ifeq ($(OS_TEST),sun4u)
 ULTRASPARC_LIBRARY = ultrasparc
 ULTRASPARC_FILTER_LIBRARY = libatomic.so
 DSO_LDOPTS		+= -f $(ULTRASPARC_FILTER_LIBRARY)
 endif
+endif
--- a/config/module.df
+++ b/config/module.df
@@ -33,8 +33,10 @@
 
 # 
 # Module description file
 #
 # A module is also called a component or a subsystem.
 
 MOD_NAME = nspr20
 MOD_VERSION = 4
+MOD_MINOR = 1
+MOD_PATCH = 3
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -305,17 +305,17 @@ ifeq ($(OS_TARGET), WIN16)
 	wlib $(OS_LIB_FLAGS) $@ +$(SHARED_LIBRARY)
 endif
 
 ifeq ($(OS_TARGET), OS2)
 $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
 	$(IMPLIB) $@ $(SHARED_LIBRARY).def
 endif
     
-$(SHARED_LIBRARY): $(OBJS)
+$(SHARED_LIBRARY): $(OBJS) $(MAPFILE)
 	@$(MAKE_OBJDIR)
 	rm -f $@
 ifdef USE_AUTOCONF
 	$(MKSHLIB) $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
 else
 ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
 	echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms
 	nm -B -C -g $(OBJS) \
@@ -380,16 +380,23 @@ ifeq ($(OS_TARGET),OS2)
 	$(RC) -DOS2 -r $(RESNAME) $(RES)
 else
 # The resource compiler does not understand the -U option.
 	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$(RES) $(RESNAME)
 endif
 	@echo $(RES) finished
 endif
 
+$(MAPFILE): $(LIBRARY_NAME).def
+	@$(MAKE_OBJDIR)
+ifeq ($(OS_ARCH),SunOS)
+	grep -v ';-' $(LIBRARY_NAME).def | \
+	 sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
+endif
+
 $(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
 	@$(MAKE_OBJDIR)
 ifeq ($(OS_ARCH), WINNT)
 	$(CCC) -Fo$@ -c $(CCCFLAGS) $<
 else
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 	$(CCC) -Fo$@ -c $(CCCFLAGS) $<
 else
--- a/lib/ds/Makefile
+++ b/lib/ds/Makefile
@@ -36,16 +36,23 @@
 MOD_DEPTH = ../..
 
 include $(MOD_DEPTH)/config/config.mk
 
 # Disable optimization of the nspr on SunOS4.1.3
 ifeq ($(OS_ARCH),SunOS)
 ifeq ($(OS_RELEASE),4.1.3_U1)
 OPTIMIZER =
+else
+OS_LIBS += -lc
+ifeq ($(BUILD_SUN_PKG),1)
+MAPFILE = $(OBJDIR)/pldsmap.sun
+ALL_TRASH += $(MAPFILE)
+MKSHLIB += -M $(MAPFILE)
+endif
 endif
 endif
 
 INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include
 
 CSRCS = \
 	plarena.c \
 	plhash.c \
new file mode 100644
--- /dev/null
+++ b/lib/ds/plds.def
@@ -0,0 +1,33 @@
+# nm -n -C -p libplds4.so | awk '/[^ ]* T PL_/ {print $3}'
+NSPR_4.0 {
+    global:
+PL_ArenaAllocate;
+PL_ArenaFinish;
+PL_ArenaGrow;
+PL_ArenaRelease;
+PL_CompactArenaPool;
+PL_CompareStrings;
+PL_CompareValues;
+PL_FinishArenaPool;
+PL_FreeArenaPool;
+PL_HashString;
+PL_HashTableAdd;
+PL_HashTableDestroy;
+PL_HashTableDump;
+PL_HashTableEnumerateEntries;
+PL_HashTableLookup;
+PL_HashTableRawAdd;
+PL_HashTableRawLookup;
+PL_HashTableRawRemove;
+PL_HashTableRemove;
+PL_InitArenaPool;
+PL_NewHashTable;
+libVersionPoint;
+    local: *;
+};
+
+NSPR_4.1 {
+    global:
+PL_HashTableLookupConst;
+PL_HashTableRawLookupConst;
+} NSPR_4.0;
--- a/lib/libc/src/Makefile
+++ b/lib/libc/src/Makefile
@@ -36,16 +36,23 @@
 MOD_DEPTH = ../../..
 
 include $(MOD_DEPTH)/config/config.mk
 
 # Disable optimization of the nspr on SunOS4.1.3
 ifeq ($(OS_ARCH),SunOS)
 ifeq ($(OS_RELEASE),4.1.3_U1)
 OPTIMIZER =
+else
+OS_LIBS += -lc
+ifeq ($(BUILD_SUN_PKG),1)
+MAPFILE = $(OBJDIR)/plcmap.sun
+ALL_TRASH += $(MAPFILE)
+MKSHLIB += -M $(MAPFILE)
+endif
 endif
 endif
 
 INCLUDES = -I$(DIST)/include
 
 CSRCS =\
 	plvrsion.c  \
 	strlen.c  \
new file mode 100644
--- /dev/null
+++ b/lib/libc/src/plc.def
@@ -0,0 +1,44 @@
+# nm -n -C -p libplc4.so | awk '/[^ ]* T PL_/ {print $3}'
+NSPR_4.0 {
+    global:
+PL_Base64Decode;
+PL_Base64Encode;
+PL_CreateOptState;
+PL_DestroyOptState;
+PL_FPrintError;
+PL_GetNextOpt;
+PL_PrintError;
+PL_strcasecmp;
+PL_strcaserstr;
+PL_strcasestr;
+PL_strcat;
+PL_strcatn;
+PL_strchr;
+PL_strcmp;
+PL_strcpy;
+PL_strdup;
+PL_strfree;
+PL_strlen;
+PL_strncasecmp;
+PL_strncaserstr;
+PL_strncasestr;
+PL_strncat;
+PL_strnchr;
+PL_strncmp;
+PL_strncpy;
+PL_strncpyz;
+PL_strndup;
+PL_strnlen;
+PL_strnpbrk;
+PL_strnprbrk;
+PL_strnrchr;
+PL_strnrstr;
+PL_strnstr;
+PL_strpbrk;
+PL_strprbrk;
+PL_strrchr;
+PL_strrstr;
+PL_strstr;
+libVersionPoint;
+    local: *;
+};
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/Makefile
@@ -0,0 +1,55 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+
+MOD_DEPTH = ../..
+
+%: %.ksh
+	$(RM) $@
+	cp $< $@
+	chmod +x $@
+
+ifeq ($(USE_64), 1)
+DIRS = \
+	SUNWprx
+else
+DIRS = \
+	SUNWpr
+endif
+
+PROTO = \
+	$(ROOT) \
+	$(ROOT)/usr \
+	$(ROOT)/usr/lib \
+	$(ROOT)/usr/lib/mps
+
+ifdef USE_64
+PROTO += $(ROOT)/usr/lib/mps/sparcv9
+endif
+
+include Makefile.com
+
+awk_pkginfo: bld_awk_pkginfo
+	./bld_awk_pkginfo -m $(MACH) -p "$(PRODUCT_VERSION)" -o $@ -v $(PRODUCT_VERSION)
+
+all:: awk_pkginfo $(PROTO)
+publish: awk_pkginfo $(PROTO)
+	+$(LOOP_OVER_DIRS)
+
+clean clobber::
+	$(RM) awk_pkginfo bld_awk_pkginfo
+	$(RM) -r $(ROOT)
+
+$(ROOT) $(ROOT)/%:
+	mkdir -p $@
+
+ifdef USE_64
+$(ROOT)/usr/lib/mps/sparcv9:
+	$(LN) -sf ../../../../$(DIST)/lib $@
+else
+$(ROOT)/usr/lib/mps:
+	$(LN) -sf ../../../$(DIST)/lib $@
+endif
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/Makefile.com
@@ -0,0 +1,30 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+
+MACH = $(shell mach)
+
+PUBLISH_ROOT = $(DIST)
+ifeq ($(MOD_DEPTH),../..)
+ROOT = ROOT
+else
+ROOT = $(subst ../../,,$(MOD_DEPTH))/ROOT
+endif
+
+PKGARCHIVE = $(PUBLISH_ROOT)/pkgarchive
+DATAFILES = copyright
+FILES = $(DATAFILES) pkginfo
+
+PACKAGE = $(shell basename `pwd`)
+
+PRODUCT_VERSION = $(MOD_VERSION).$(MOD_MINOR).$(MOD_PATCH)
+LN = /usr/bin/ln
+
+CLOBBERFILES = $(FILES)
+
+include $(MOD_DEPTH)/config/rules.mk
+
+# vim: ft=make
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/Makefile.targ
@@ -0,0 +1,26 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+
+pkginfo: pkginfo.tmpl ../awk_pkginfo
+	$(RM) $@; nawk -f ../awk_pkginfo $@.tmpl > $@
+
+pkg: $(PKGARCHIVE)
+	pkgmk -f prototype_$(MACH) -d $(PKGARCHIVE) -r $(ROOT) -o $(PACKAGE)
+
+$(PKGARCHIVE):
+	[ -d $(PKGARCHIVE) ] || mkdir -p $(PKGARCHIVE)
+
+$(DATAFILES): %: ../common_files/%
+	$(RM) $@; cp ../common_files/$@ $@
+
+$(MACHDATAFILES): %: ../common_files/%_$(MACH)
+	$(RM) $@; cp ../common_files/$@_$(MACH) $@
+
+clobber clean::
+	-$(RM) $(CLOBBERFILES) $(CLEANFILES)
+
+.PHONY: pkg
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWpr/Makefile
@@ -0,0 +1,16 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+
+MOD_DEPTH = ../../..
+include ../Makefile.com
+
+DATAFILES += 
+
+all:: $(FILES)
+publish:: all pkg
+
+include ../Makefile.targ
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWpr/depend
@@ -0,0 +1,27 @@
+# Copyright 2002 Microsystems, Inc.  All Rights Reserved.
+# Use is subject to license terms.
+#
+#	$Id$
+#
+# This package information file defines software dependencies associated
+# with the pkg.  You can define three types of pkg dependencies with this file:
+#	 P indicates a prerequisite for installation
+#	 I indicates an incompatible package
+#	 R indicates a reverse dependency
+# <pkg.abbr> see pkginfo(4), PKG parameter
+# <name> see pkginfo(4), NAME parameter
+# <version> see pkginfo(4), VERSION parameter
+# <arch> see pkginfo(4), ARCH parameter
+# <type> <pkg.abbr> <name>
+# 	(<arch>)<version>
+# 	(<arch>)<version>
+# 	...
+# <type> <pkg.abbr> <name>
+# ...
+
+P SUNWcar	Core Architecture, (Root)
+P SUNWkvm	Core Architecture, (Kvm)
+P SUNWcsr	Core Solaris, (Root)
+P SUNWcsu	Core Solaris, (Usr)
+P SUNWcsd	Core Solaris Devices
+P SUNWcsl	Core Solaris Libraries
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWpr/pkginfo.tmpl
@@ -0,0 +1,34 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+#
+# This required package information file describes characteristics of the
+# package, such as package abbreviation, full package name, package version,
+# and package architecture.
+#
+PKG="SUNWpr"
+NAME="Netscape Portable Runtime"
+ARCH="ISA"
+VERSION="NSPRVERS,REV=0.0.0"
+SUNW_PRODNAME="Netscape Portable Runtime"
+SUNW_PRODVERS="NSPRVERS"
+SUNW_PKGTYPE="usr"
+MAXINST="1000"
+CATEGORY="system"
+DESC="Netscape Portable Runtime Interface"
+VENDOR="Sun Microsystems, Inc."
+HOTLINE="Please contact your local service provider"
+EMAIL=""
+CLASSES="none"
+BASEDIR=/
+SUNW_PKGVERS="1.0"
+#VSTOCK="<reserved by Release Engineering for package part #>"
+#ISTATES="<developer defined>"
+#RSTATES='<developer defined>'
+#ULIMIT="<developer defined>"
+#ORDER="<developer defined>"
+#PSTAMP="<developer defined>"
+#INTONLY="<developer defined>"
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWpr/prototype_com
@@ -0,0 +1,31 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+# This required package information file contains a list of package contents.
+# The 'pkgmk' command uses this file to identify the contents of a package
+# and their location on the development machine when building the package.
+# Can be created via a text editor or through use of the 'pkgproto' command.
+
+#!search <pathname pathname ...>	# where to find pkg objects
+#!include <filename>			# include another 'prototype' file
+#!default <mode> <owner> <group>	# default used if not specified on entry
+#!<param>=<value>			# puts parameter in pkg environment
+
+# packaging files
+i copyright
+i pkginfo
+i depend
+#
+# source locations relative to the prototype file
+#
+# SUNWpr
+#
+d none usr 755 root sys
+d none usr/lib 755 root bin
+d none usr/lib/mps 755 root bin
+f none usr/lib/mps/libnspr4.so 755 root bin
+f none usr/lib/mps/libplc4.so 755 root bin
+f none usr/lib/mps/libplds4.so 755 root bin
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWpr/prototype_i386
@@ -0,0 +1,30 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+# This required package information file contains a list of package contents.
+# The 'pkgmk' command uses this file to identify the contents of a package
+# and their location on the development machine when building the package.
+# Can be created via a text editor or through use of the 'pkgproto' command.
+
+#!search <pathname pathname ...>	# where to find pkg objects
+#!include <filename>			# include another 'prototype' file
+#!default <mode> <owner> <group>	# default used if not specified on entry
+#!<param>=<value>			# puts parameter in pkg environment
+
+#
+# Include ISA independent files (prototype_com)
+#
+!include prototype_com
+#
+#
+#
+# List files which are i386 specific here
+#
+# source locations relative to the prototype file
+#
+#
+# SUNWpr
+#
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWpr/prototype_sparc
@@ -0,0 +1,33 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+# This required package information file contains a list of package contents.
+# The 'pkgmk' command uses this file to identify the contents of a package
+# and their location on the development machine when building the package.
+# Can be created via a text editor or through use of the 'pkgproto' command.
+
+#!search <pathname pathname ...>	# where to find pkg objects
+#!include <filename>			# include another 'prototype' file
+#!default <mode> <owner> <group>	# default used if not specified on entry
+#!<param>=<value>			# puts parameter in pkg environment
+
+#
+# Include ISA independent files (prototype_com)
+#
+!include prototype_com
+#
+#
+#
+# List files which are SPARC specific here
+#
+# source locations relative to the prototype file
+#
+#
+# SUNWpr
+#
+d none usr/lib/mps/cpu 755 root bin
+d none usr/lib/mps/cpu/sparcv8plus 755 root bin
+f none usr/lib/mps/cpu/sparcv8plus/libnspr_flt4.so 755 root bin
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWprx/Makefile
@@ -0,0 +1,16 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+
+MOD_DEPTH = ../../..
+include ../Makefile.com
+
+DATAFILES += 
+
+all:: $(FILES)
+publish:: all pkg
+
+include ../Makefile.targ
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWprx/depend
@@ -0,0 +1,30 @@
+# Copyright 2002 Microsystems, Inc.  All Rights Reserved.
+# Use is subject to license terms.
+#
+#	$Id$
+#
+# This package information file defines software dependencies associated
+# with the pkg.  You can define three types of pkg dependencies with this file:
+#	 P indicates a prerequisite for installation
+#	 I indicates an incompatible package
+#	 R indicates a reverse dependency
+# <pkg.abbr> see pkginfo(4), PKG parameter
+# <name> see pkginfo(4), NAME parameter
+# <version> see pkginfo(4), VERSION parameter
+# <arch> see pkginfo(4), ARCH parameter
+# <type> <pkg.abbr> <name>
+# 	(<arch>)<version>
+# 	(<arch>)<version>
+# 	...
+# <type> <pkg.abbr> <name>
+# ...
+
+P SUNWcar	Core Architecture, (Root)
+P SUNWkvm	Core Architecture, (Kvm)
+P SUNWcsr	Core Solaris, (Root)
+P SUNWcsu	Core Solaris, (Usr)
+P SUNWcsd	Core Solaris Devices
+P SUNWcsl	Core Solaris Libraries
+P SUNWcarx	Core Architecture, (Root) (64-bit)
+P SUNWcsxu	Core Solaris (Usr) (64-bit)
+P SUNWcslx	Core Solaris Libraries (64-bit)
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWprx/pkginfo.tmpl
@@ -0,0 +1,35 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+#
+# This required package information file describes characteristics of the
+# package, such as package abbreviation, full package name, package version,
+# and package architecture.
+#
+PKG="SUNWprx"
+NAME="Netscape Portable Runtime (64-bit)"
+ARCH="ISA"
+SUNW_ISA="sparcv9"
+VERSION="NSPRVERS,REV=0.0.0"
+SUNW_PRODNAME="Netscape Portable Runtime"
+SUNW_PRODVERS="NSPRVERS"
+SUNW_PKGTYPE="usr"
+MAXINST="1000"
+CATEGORY="system"
+DESC="Netscape Portable Runtime Interface (64-bit)"
+VENDOR="Sun Microsystems, Inc."
+HOTLINE="Please contact your local service provider"
+EMAIL=""
+CLASSES="none"
+BASEDIR=/
+SUNW_PKGVERS="1.0"
+#VSTOCK="<reserved by Release Engineering for package part #>"
+#ISTATES="<developer defined>"
+#RSTATES='<developer defined>'
+#ULIMIT="<developer defined>"
+#ORDER="<developer defined>"
+#PSTAMP="<developer defined>"
+#INTONLY="<developer defined>"
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWprx/prototype_com
@@ -0,0 +1,28 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+# This required package information file contains a list of package contents.
+# The 'pkgmk' command uses this file to identify the contents of a package
+# and their location on the development machine when building the package.
+# Can be created via a text editor or through use of the 'pkgproto' command.
+
+#!search <pathname pathname ...>	# where to find pkg objects
+#!include <filename>			# include another 'prototype' file
+#!default <mode> <owner> <group>	# default used if not specified on entry
+#!<param>=<value>			# puts parameter in pkg environment
+
+# packaging files
+i copyright
+i pkginfo
+i depend
+#
+# source locations relative to the prototype file
+#
+# SUNWprx
+#
+d none usr 755 root sys
+d none usr/lib 755 root bin
+d none usr/lib/mps 755 root bin
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/SUNWprx/prototype_sparc
@@ -0,0 +1,35 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+# This required package information file contains a list of package contents.
+# The 'pkgmk' command uses this file to identify the contents of a package
+# and their location on the development machine when building the package.
+# Can be created via a text editor or through use of the 'pkgproto' command.
+
+#!search <pathname pathname ...>	# where to find pkg objects
+#!include <filename>			# include another 'prototype' file
+#!default <mode> <owner> <group>	# default used if not specified on entry
+#!<param>=<value>			# puts parameter in pkg environment
+
+#
+# Include ISA independent files (prototype_com)
+#
+!include prototype_com
+#
+#
+#
+# List files which are SPARC specific here
+#
+# source locations relative to the prototype file
+#
+#
+# SUNWprx
+#
+s none usr/lib/mps/64=sparcv9
+d none usr/lib/mps/sparcv9 755 root bin
+f none usr/lib/mps/sparcv9/libnspr4.so 755 root bin
+f none usr/lib/mps/sparcv9/libplc4.so 755 root bin
+f none usr/lib/mps/sparcv9/libplds4.so 755 root bin
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/bld_awk_pkginfo.ksh
@@ -0,0 +1,105 @@
+#!/usr/bin/ksh -p
+#
+#ident	"$Id$"
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+# Simple script which builds the awk_pkginfo awk script.  This awk script
+# is used to convert the pkginfo.tmpl files into pkginfo files
+# for the build.
+#
+
+usage()
+{
+   cat <<-EOF
+usage: bld_awk_pkginfo -p <prodver> -m <mach> -o <awk_script> [-v <version>]
+EOF
+}
+
+#
+# Awk strings
+#
+# two VERSION patterns: one for Dewey decimal, one for Dewey plus ,REV=n
+# the first has one '=' the second has two or more '='
+#
+VERSION1="VERSION=[^=]*$"
+VERSION2="VERSION=[^=]*=.*$"
+PRODVERS="^SUNW_PRODVERS="
+ARCH='ARCH=\"ISA\"'
+
+#
+# parse command line
+#
+mach=""
+prodver=""
+awk_script=""
+version="NSPRVERS"
+
+while getopts o:p:m:v: c
+do
+   case $c in
+   o)
+      awk_script=$OPTARG
+      ;;
+   m)
+      mach=$OPTARG
+      ;;
+   p)
+      prodver=$OPTARG
+      ;;
+   v)
+      version=$OPTARG
+      ;;
+   \?)
+      usage
+      exit 1
+      ;;
+   esac
+done
+
+if [[ ( -z $prodver ) || ( -z $mach ) || ( -z $awk_script ) ]]
+then
+   usage
+   exit 1
+fi
+
+if [[ -f $awk_script ]]
+then
+	rm -f $awk_script
+fi
+
+#
+# Build REV= field based on date
+#
+rev=$(date "+%Y.%m.%d.%H.%M")
+
+#
+# Build awk script which will process all the
+# pkginfo.tmpl files.
+#
+# the first VERSION pattern is replaced with a leading quotation mark
+#
+rm -f $awk_script
+cat << EOF > $awk_script
+/$VERSION1/ {
+      sub(/\=[^=]*$/,"=\"$rev\"")
+      print
+      next
+   }
+/$VERSION2/ {
+      sub(/\=[^=]*$/,"=$rev\"")
+      sub(/NSPRVERS/,"$version")
+      print
+      next
+   }
+/$PRODVERS/ { 
+      printf "SUNW_PRODVERS=\"%s\"\n", "$prodver" 
+      next
+   }
+/$ARCH/ {
+      printf "ARCH=\"%s\"\n", "$mach"
+      next
+   }
+{ print }
+EOF
new file mode 100644
--- /dev/null
+++ b/pkg/solaris/common_files/copyright
@@ -0,0 +1,28 @@
+The contents of this package are subject to the Mozilla Public License
+Version 1.1 (the "License"); you may not use this package except in
+compliance with the License. You may obtain a copy of the License at
+http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+License for the specific language governing rights and limitations
+under the License.
+
+The Original Code is the Netscape Portable Runtime (NSPR).
+
+The Initial Developer of the Original Code is Netscape Communications
+Corporation.  Portions created by Netscape are Copyright (C) 1998-2000
+Netscape Communications Corporation.  All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this package may be used under the terms
+of the GNU General Public License Version 2 or later (the "GPL"), in
+which case the provisions of the GPL are applicable instead of those
+above.  If you wish to allow use of your version of this package only
+under the terms of the GPL and not to allow others to use your version
+of this package under the MPL, indicate your decision by deleting the
+provisions above and replace them with the notice and other provisions
+required by the GPL.  If you do not delete the provisions above, a
+recipient may use your version of this package under either the MPL or
+the GPL.
--- a/pr/include/prcountr.h
+++ b/pr/include/prcountr.h
@@ -111,17 +111,16 @@ PR_BEGIN_EXTERN_C
 **
 */
 typedef void *  PRCounterHandle;
 
 #define PRCOUNTER_NAME_MAX 31
 #define PRCOUNTER_DESC_MAX 255
 
 
-#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_DEFINE_COUNTER() -- Define a PRCounterHandle
 ** 
 ** DESCRIPTION: PR_DEFINE_COUNTER() is used to define a counter
 ** handle.
 ** 
 */
@@ -130,18 +129,22 @@ typedef void *  PRCounterHandle;
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_INIT_COUNTER_HANDLE() -- Set the value of a PRCounterHandle
 ** 
 ** DESCRIPTION: 
 ** PR_INIT_COUNTER_HANDLE() sets the value of a PRCounterHandle
 ** to value.
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_INIT_COUNTER_HANDLE(handle,value)\
     (handle) = (PRCounterHandle)(value)
+#else
+#define PR_INIT_COUNTER_HANDLE(handle,value)
+#endif
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_CreateCounter() -- Create a counter
 ** 
 ** DESCRIPTION: PR_CreateCounter() creates a counter object and
 ** initializes it to zero.
 ** 
 ** The macro form takes as its first argument the name of the
@@ -162,18 +165,22 @@ typedef void *  PRCounterHandle;
 ** OUTPUTS:
 ** 
 ** RETURNS:
 **  PRCounterHandle.
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_CREATE_COUNTER(handle,qName,rName,description)\
    (handle) = PR_CreateCounter((qName),(rName),(description))
+#else
+#define PR_CREATE_COUNTER(handle,qName,rName,description)
+#endif
 
 NSPR_API(PRCounterHandle) 
 	PR_CreateCounter( 
 		const char *qName, 
     	const char *rName, 
         const char *description 
 );
 
@@ -189,17 +196,21 @@ NSPR_API(PRCounterHandle)
 ** OUTPUTS: 
 **  The counter is destroyed.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_DESTROY_COUNTER(handle) PR_DestroyCounter((handle))
+#else
+#define PR_DESTROY_COUNTER(handle)
+#endif
 
 NSPR_API(void) 
 	PR_DestroyCounter( 
 		PRCounterHandle handle 
 );
 
 
 /* -----------------------------------------------------------------------
@@ -217,18 +228,22 @@ NSPR_API(void)
 ** OUTPUTS:
 ** 
 ** RETURNS: 
 **  PRCounterHandle or PRCounterError.
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_GET_COUNTER_HANDLE_FROM_NAME(handle,qName,rName)\
     (handle) = PR_GetCounterHandleFromName((qName),(rName))
+#else
+#define PR_GET_COUNTER_HANDLE_FROM_NAME(handle,qName,rName)
+#endif
 
 NSPR_API(PRCounterHandle) 
 	PR_GetCounterHandleFromName( 
     	const char *qName, 
     	const char *rName 
 );
 
 /* -----------------------------------------------------------------------
@@ -246,18 +261,22 @@ NSPR_API(PRCounterHandle)
 ** OUTPUTS: Pointers to the Counter Feature's copies of the names
 ** used when the counters were created.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_GET_COUNTER_NAME_FROM_HANDLE(handle,qName,rName,description)\
     PR_GetCounterNameFromHandle((handle),(qName),(rName),(description))
+#else
+#define PR_GET_COUNTER_NAME_FROM_HANDLE(handle,qName,rName,description )
+#endif
 
 NSPR_API(void) 
 	PR_GetCounterNameFromHandle( 
     	PRCounterHandle handle,  
 	    const char **qName, 
 	    const char **rName, 
 		const char **description 
 );
@@ -274,17 +293,21 @@ NSPR_API(void)
 ** 
 ** OUTPUTS: The counter is incrementd.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_INCREMENT_COUNTER(handle) PR_IncrementCounter(handle)
+#else
+#define PR_INCREMENT_COUNTER(handle)
+#endif
 
 NSPR_API(void) 
 	PR_IncrementCounter( 
 		PRCounterHandle handle
 );
 
 
 /* -----------------------------------------------------------------------
@@ -299,17 +322,21 @@ NSPR_API(void)
 ** 
 ** OUTPUTS: the counter is decremented.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_DECREMENT_COUNTER(handle) PR_DecrementCounter(handle)
+#else
+#define PR_DECREMENT_COUNTER(handle)
+#endif
 
 NSPR_API(void) 
 	PR_DecrementCounter( 
 		PRCounterHandle handle
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_AddToCounter() -- Add a value to a counter.
@@ -323,18 +350,22 @@ NSPR_API(void)
 ** 
 ** OUTPUTS: new value for counter.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_ADD_TO_COUNTER(handle,value)\
     PR_AddToCounter((handle),(value))
+#else
+#define PR_ADD_TO_COUNTER(handle,value)
+#endif
 
 NSPR_API(void) 
 	PR_AddToCounter( 
     	PRCounterHandle handle, 
 	    PRUint32 value 
 );
 
 
@@ -353,18 +384,22 @@ NSPR_API(void)
 ** 
 ** OUTPUTS: new value for counter
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_SUBTRACT_FROM_COUNTER(handle,value)\
     PR_SubtractFromCounter((handle),(value))
+#else
+#define PR_SUBTRACT_FROM_COUNTER(handle,value)
+#endif
 
 NSPR_API(void) 
 	PR_SubtractFromCounter( 
     	PRCounterHandle handle, 
 	    PRUint32 value 
 );
 
 
@@ -379,18 +414,22 @@ NSPR_API(void)
 ** 
 ** OUTPUTS:
 ** 
 ** RETURNS: The value of the referenced counter
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_GET_COUNTER(counter,handle)\
     (counter) = PR_GetCounter((handle))
+#else
+#define PR_GET_COUNTER(counter,handle) 0
+#endif
 
 NSPR_API(PRUint32) 
 	PR_GetCounter( 
 		PRCounterHandle handle 
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_SetCounter() -- Replace the content of counter
@@ -407,17 +446,21 @@ NSPR_API(PRUint32)
 ** 
 ** OUTPUTS:
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_SET_COUNTER(handle,value) PR_SetCounter((handle),(value))
+#else
+#define PR_SET_COUNTER(handle,value)
+#endif
 
 NSPR_API(void) 
 	PR_SetCounter( 
 		PRCounterHandle handle, 
 		PRUint32 value 
 );
 
 
@@ -445,18 +488,22 @@ NSPR_API(void)
 **  A concurrent PR_CreateCounter() or PR_DestroyCounter() may
 ** cause unpredictable results.
 ** 
 ** A PRCounterHandle returned from this function may only be used
 ** in another PR_FindNextCounterQname() function call; other
 ** operations may cause unpredictable results.
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
     (next) = PR_FindNextCounterQname((handle))
+#else
+#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
+#endif
 
 NSPR_API(PRCounterHandle) 
 	PR_FindNextCounterQname( 
         PRCounterHandle handle
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_FindNextCounterRname() -- Retreive the next RName counter
@@ -484,45 +531,24 @@ NSPR_API(PRCounterHandle)
 **  A concurrent PR_CreateCounter() or PR_DestroyCounter() may
 ** cause unpredictable results.
 ** 
 ** A PRCounterHandle returned from this function may only be used
 ** in another PR_FindNextCounterRname() function call; other
 ** operations may cause unpredictable results.
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_FIND_NEXT_COUNTER_RNAME(next,rhandle,qhandle)\
     (next) = PR_FindNextCounterRname((rhandle),(qhandle))
+#else
+#define PR_FIND_NEXT_COUNTER_RNAME(next,rhandle,qhandle)
+#endif
 
 NSPR_API(PRCounterHandle) 
 	PR_FindNextCounterRname( 
         PRCounterHandle rhandle,
         PRCounterHandle qhandle
 );
 
-
-#else /* ( !(defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)) */
-/*
-** When counters are not compiled in, provide macros that 
-** evaluate to No-Ops.
-**
-*/
-
-#define PR_DEFINE_COUNTER(name) PRCounterHandle name
-#define PR_INIT_COUNTER_HANDLE(handle,value)
-#define PR_CREATE_COUNTER(handle,qName,rName,description)
-#define PR_DESTROY_COUNTER(handle)
-#define PR_GET_COUNTER_HANDLE_FROM_NAME(handle,qName,rName)
-#define PR_GET_COUNTER_NAME_FROM_HANDLE(handle,qName,rName,description )
-#define PR_INCREMENT_COUNTER(handle)
-#define PR_DECREMENT_COUNTER(handle)
-#define PR_ADD_TO_COUNTER(handle,value)
-#define PR_SUBTRACT_FROM_COUNTER(handle,value)
-#define PR_GET_COUNTER(counter,handle) 0
-#define PR_SET_COUNTER(handle,value)
-#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
-#define PR_FIND_NEXT_COUNTER_RNAME(next,rhandle,qhandle)
-
-#endif /* ( !(defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)) */
-
 PR_END_EXTERN_C
 
 #endif /* prcountr_h___ */
--- a/pr/include/prolock.h
+++ b/pr/include/prolock.h
@@ -34,18 +34,16 @@
 
 #ifndef prolock_h___
 #define prolock_h___
 
 #include "prtypes.h"
 
 PR_BEGIN_EXTERN_C
 
-#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
-
 /*
 ** A locking mechanism, built on the existing PRLock definiion,
 ** is provided that will permit applications to define a Lock
 ** Hierarchy (or Lock Ordering) schema. An application designed
 ** using the Ordered Lock functions will terminate with a
 ** diagnostic message when a lock inversion condition is
 ** detected. 
 ** 
@@ -75,17 +73,28 @@ PR_BEGIN_EXTERN_C
 */
 
 /*
 ** Opaque type for ordered lock.
 ** ... Don't even think of looking in here.
 **
 */
 
+#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
 typedef void * PROrderedLock;
+#else
+/*
+** Map PROrderedLock and methods onto PRLock when ordered locking
+** is not compiled in.
+**  
+*/
+#include <prlock.h>
+
+typedef PRLock PROrderedLock;
+#endif
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_CreateOrderedLock() -- Create an Ordered Lock
 ** 
 ** DESCRIPTION: PR_CreateOrderedLock() creates an ordered lock.
 ** 
 ** INPUTS:
 **  order: user defined order of this lock.
@@ -93,18 +102,22 @@ typedef void * PROrderedLock;
 ** 
 ** OUTPUTS: returned
 ** 
 ** RETURNS: PR_OrderedLock pointer
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
 #define PR_CREATE_ORDERED_LOCK(order,name)\
     PR_CreateOrderedLock((order),(name))
+#else
+#define PR_CREATE_ORDERED_LOCK(order) PR_NewLock()
+#endif
 
 NSPR_API(PROrderedLock *) 
     PR_CreateOrderedLock( 
         PRInt32 order,
         const char *name
 );
 
 /* -----------------------------------------------------------------------
@@ -117,17 +130,21 @@ NSPR_API(PROrderedLock *)
 ** 
 ** OUTPUTS: the lock is destroyed
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
 #define PR_DESTROY_ORDERED_LOCK(lock) PR_DestroyOrderedLock((lock))
+#else
+#define PR_DESTROY_ORDERED_LOCK(lock) PR_DestroyLock((lock))
+#endif
 
 NSPR_API(void) 
     PR_DestroyOrderedLock( 
         PROrderedLock *lock 
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_LockOrderedLock() -- Lock an ordered lock
@@ -141,17 +158,21 @@ NSPR_API(void)
 ** 
 ** OUTPUTS: The lock is held or the fucntion asserts.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
 #define PR_LOCK_ORDERED_LOCK(lock) PR_LockOrderedLock((lock))
+#else
+#define PR_LOCK_ORDERED_LOCK(lock) PR_Lock((lock))
+#endif
 
 NSPR_API(void) 
     PR_LockOrderedLock( 
         PROrderedLock *lock 
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_UnlockOrderedLock() -- unlock and Ordered Lock
@@ -165,48 +186,22 @@ NSPR_API(void)
 ** 
 ** RETURNS:
 **  PR_SUCCESS
 **  PR_FAILURE
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
 #define PR_UNLOCK_ORDERED_LOCK(lock) PR_UnlockOrderedLock((lock))
+#else
+#define PR_UNLOCK_ORDERED_LOCK(lock) PR_Unlock((lock))
+#endif
 
 NSPR_API(PRStatus) 
     PR_UnlockOrderedLock( 
         PROrderedLock *lock 
 );
 
-#else /* !(defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)) */
-/*
-** Map PROrderedLock and methods onto PRLock when ordered locking
-** is not compiled in.
-**  
-*/
-#include <prlock.h>
-
-typedef PRLock PROrderedLock;
-
-#define PR_CREATE_ORDERED_LOCK(order) PR_NewLock()
-#define PR_DESTROY_ORDERED_LOCK(lock) PR_DestroyLock((lock))
-#define PR_LOCK_ORDERED_LOCK(lock) PR_Lock((lock))
-#define PR_UNLOCK_ORDERED_LOCK(lock) PR_Unlock((lock))
-
-#endif /* !(defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)) */
-
 PR_END_EXTERN_C
 
 #endif /* prolock_h___ */
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/pr/include/prtrace.h
+++ b/pr/include/prtrace.h
@@ -98,17 +98,16 @@ PR_BEGIN_EXTERN_C
 
 /*
 ** Opaque type for the trace handle 
 ** ... Don't even think about looking in here.
 **
 */
 typedef void *  PRTraceHandle;
 
-#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 /*
 ** PRTraceEntry -- A trace entry in the in-memory trace buffer
 ** looks like this.
 **
 */
 typedef struct PRTraceEntry
 {
     PRThread        *thread;        /* The thread creating the trace entry */
@@ -148,18 +147,22 @@ typedef enum PRTraceOption
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_INIT_TRACE_HANDLE() -- Set the value of a PRTraceHandle
 ** 
 ** DESCRIPTION: 
 ** PR_INIT_TRACE_HANDLE() sets the value of a PRTraceHandle
 ** to value. e.g. PR_INIT_TRACE_HANDLE( myHandle, NULL );
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_INIT_TRACE_HANDLE(handle,value)\
     (handle) = (PRCounterHandle)(value)
+#else
+#define PR_INIT_TRACE_HANDLE(handle,value)
+#endif
 
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_CreateTrace() -- Create a trace handle
 ** 
 ** DESCRIPTION:
 **  PR_CreateTrace() creates a new trace handle. Tracing is
 **  enabled for this handle when it is created. The trace handle
@@ -187,18 +190,22 @@ typedef enum PRTraceOption
 **  qName is limited to 31 characters.
 **  rName is limited to 31 characters.
 **  description is limited to 255 characters.
 ** 
 */
 #define PRTRACE_NAME_MAX 31
 #define PRTRACE_DESC_MAX 255
 
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_CREATE_TRACE(handle,qName,rName,description)\
     (handle) = PR_CreateTrace((qName),(rName),(description))
+#else
+#define PR_CREATE_TRACE(handle,qName,rName,description)
+#endif
 
 NSPR_API(PRTraceHandle)
 	PR_CreateTrace( 
     	const char *qName,          /* QName for this trace handle */
 	    const char *rName,          /* RName for this trace handle */
 	    const char *description     /* description for this trace handle */
 );
 
@@ -217,18 +224,22 @@ NSPR_API(PRTraceHandle)
 **  The trace handle is unregistered.
 **  The QName, RName and description are removed.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_DESTROY_TRACE(handle)\
     PR_DestroyTrace((handle))
+#else
+#define PR_DESTROY_TRACE(handle)
+#endif
 
 NSPR_API(void) 
 	PR_DestroyTrace( 
 		PRTraceHandle handle    /* Handle to be destroyed */
 );
 
 
 /* -----------------------------------------------------------------------
@@ -254,18 +265,22 @@ NSPR_API(void)
 **  A PRTraceEntry is (conditionally) formatted in the in-memory
 ** trace buffer.
 ** 
 ** RETURNS: void.
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_TRACE(handle,ud0,ud1,ud2,ud3,ud4,ud5,ud6,ud7)\
     PR_Trace((handle),(ud0),(ud1),(ud2),(ud3),(ud4),(ud5),(ud6),(ud7))
+#else
+#define PR_TRACE(handle,ud0,ud1,ud2,ud3,ud4,ud5,ud6,ud7)
+#endif
 
 NSPR_API(void) 
 	PR_Trace( 
     	PRTraceHandle handle,       /* use this trace handle */
 	    PRUint32    userData0,      /* User supplied data word 0 */
 	    PRUint32    userData1,      /* User supplied data word 1 */
 	    PRUint32    userData2,      /* User supplied data word 2 */
 	    PRUint32    userData3,      /* User supplied data word 3 */
@@ -337,18 +352,22 @@ NSPR_API(void)
 ** OUTPUTS:
 **  The operation of the Trace Facility may be changed.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_SET_TRACE_OPTION(command,value)\
     PR_SetTraceOption((command),(value))
+#else
+#define PR_SET_TRACE_OPTION(command,value)
+#endif
 
 NSPR_API(void) 
 	PR_SetTraceOption( 
 	    PRTraceOption command,  /* One of the enumerated values */
 	    void *value             /* command value or NULL */
 );
 
 
@@ -371,18 +390,22 @@ NSPR_API(void)
 ** OUTPUTS:
 **  dependent on command.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_GET_TRACE_OPTION(command,value)\
     PR_GetTraceOption((command),(value))
+#else
+#define PR_GET_TRACE_OPTION(command,value)
+#endif
 
 NSPR_API(void) 
 	PR_GetTraceOption( 
     	PRTraceOption command,  /* One of the enumerated values */
 	    void *value             /* command value or NULL */
 );
 
 /* -----------------------------------------------------------------------
@@ -403,18 +426,22 @@ NSPR_API(void)
 ** 
 ** RETURNS: 
 **  PRTraceHandle associated with qName and rName or NULL when
 ** there is no match.
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_GET_TRACE_HANDLE_FROM_NAME(handle,qName,rName)\
     (handle) = PR_GetTraceHandleFromName((qName),(rName))
+#else
+#define PR_GET_TRACE_HANDLE_FROM_NAME(handle,qName,rName)
+#endif
 
 NSPR_API(PRTraceHandle) 
 	PR_GetTraceHandleFromName( 
     	const char *qName,      /* QName search argument */
         const char *rName       /* RName search argument */
 );
 
 /* -----------------------------------------------------------------------
@@ -431,18 +458,22 @@ NSPR_API(PRTraceHandle)
 ** rName and description. ... Don't mess with these values.
 ** They're mine.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_GET_TRACE_NAME_FROM_HANDLE(handle,qName,rName,description)\
     PR_GetTraceNameFromHandle((handle),(qName),(rName),(description))
+#else
+#define PR_GET_TRACE_NAME_FROM_HANDLE(handle,qName,rName,description)
+#endif
 
 NSPR_API(void) 
 	PR_GetTraceNameFromHandle( 
     	PRTraceHandle handle,       /* handle as search argument */
 	    const char **qName,         /* pointer to associated QName */
 	    const char **rName,         /* pointer to associated RName */
     	const char **description    /* pointer to associated description */
 );
@@ -469,18 +500,22 @@ NSPR_API(void)
 **  PRTraceHandle or NULL when there are no trace handles.
 ** 
 ** RESTRICTIONS:
 **  Iterating thru the trace handles via FindFirst/FindNext
 ** should be done under protection of the trace handle lock.
 ** See: PR_SetTraceOption( PRLockTraceHandles ).
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_FIND_NEXT_TRACE_QNAME(next,handle)\
     (next) = PR_FindNextTraceQname((handle))
+#else
+#define PR_FIND_NEXT_TRACE_QNAME(next,handle)
+#endif
 
 NSPR_API(PRTraceHandle) 
 	PR_FindNextTraceQname( 
         PRTraceHandle handle
 );
 
 
 /* -----------------------------------------------------------------------
@@ -507,18 +542,22 @@ NSPR_API(PRTraceHandle)
 **  PRTraceHandle or NULL when there are no trace handles.
 ** 
 ** RESTRICTIONS:
 **  Iterating thru the trace handles via FindNext should be done
 ** under protection of the trace handle lock. See: (
 ** PR_SetTraceOption( PRLockTraceHandles ).
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_FIND_NEXT_TRACE_RNAME(next,rhandle,qhandle)\
     (next) = PR_FindNextTraceRname((rhandle),(qhandle))
+#else
+#define PR_FIND_NEXT_TRACE_RNAME(next,rhandle,qhandle)
+#endif
 
 NSPR_API(PRTraceHandle) 
 	PR_FindNextTraceRname( 
         PRTraceHandle rhandle,
         PRTraceHandle qhandle
 );
 
 /* -----------------------------------------------------------------------
@@ -559,18 +598,22 @@ NSPR_API(PRTraceHandle)
 ** 
 ** RESTRICTIONS:
 ** Only one thread can call PR_RecordTraceEntries() within a
 ** process.
 ** 
 ** On error, PR_RecordTraceEntries() may return prematurely.
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_RECORD_TRACE_ENTRIES()\
 	PR_RecordTraceEntries()
+#else
+#define PR_RECORD_TRACE_ENTRIES()
+#endif
     
 NSPR_API(void)
 	PR_RecordTraceEntries(
         void 
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_GetTraceEntries() -- Retreive trace entries from
@@ -607,45 +650,26 @@ NSPR_API(void)
 ** 
 ** RESTRICTIONS:
 ** This is a real performance pig. The copy out operation is bad
 ** enough, but depending on then frequency of calls to the
 ** function, serious performance impact to the operating
 ** application may be realized. ... YMMV.
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_GET_TRACE_ENTRIES(buffer,count,found)\
         PR_GetTraceEntries((buffer),(count),(found))
-
+#else
+#define PR_GET_TRACE_ENTRIES(buffer,count,found)
+#endif
 
 NSPR_API(PRIntn)
     PR_GetTraceEntries(
         PRTraceEntry    *buffer,    /* where to write output */
         PRInt32         count,      /* number to get */
         PRInt32         *found      /* number you got */
 );
 
-#else /* !(defined (DEBUG) || defined (FORCE_NSPR_TRACE)) */
-/*
-** Define the Trace Facility macros as No-Ops for when the trace
-** facility is to be compiled-out of the application.
-**
-*/
-#define PR_DEFINE_TRACE(name) PRTraceHandle name
-#define PR_INIT_TRACE_HANDLE(handle,value)
-#define PR_CREATE_TRACE(handle,qName,rName,description)
-#define PR_DESTROY_TRACE(handle)
-#define PR_TRACE(handle,ud0,ud1,ud2,ud3,ud4,ud5,ud6,ud7)
-#define PR_SET_TRACE_OPTION(command,value)
-#define PR_GET_TRACE_OPTION(command,value)
-#define PR_GET_TRACE_HANDLE_FROM_NAME(handle,qName,rName)
-#define PR_GET_TRACE_NAME_FROM_HANDLE(handle,qName,rName,description)
-#define PR_FIND_NEXT_TRACE_QNAME(next,handle)
-#define PR_FIND_NEXT_TRACE_RNAME(next,rhandle,qhandle)
-#define PR_GET_TRACE_ENTRIES(buffer,count,found)
-#define PR_RECORD_TRACE_ENTRIES()
-
-#endif /* !(defined (DEBUG) || defined (FORCE_NSPR_TRACE)) */
-
 PR_END_EXTERN_C
 
 #endif /* prtrace_h___ */
 
--- a/pr/src/Makefile
+++ b/pr/src/Makefile
@@ -62,25 +62,37 @@ endif
 
 # Disable optimization of the nspr on SunOS4.1.3
 ifeq ($(OS_ARCH),SunOS)
 ifeq ($(OS_RELEASE),4.1.3_U1)
 OPTIMIZER =
 export OPTIMIZER
 OS_LIBS			= -lm
 else	# 4.1.3_U1
+ifeq ($(BUILD_SUN_PKG),1)
+MAPFILE = $(OBJDIR)/nsprmap.sun
+ALL_TRASH += $(MAPFILE)
+MKSHLIB += -M $(MAPFILE)
+endif
 ifdef USE_PTHREADS
-OS_LIBS			= -lpthread -lthread -lposix4 -lsocket -lnsl -ldl
+OS_LIBS			= -lpthread -lthread -lposix4 -lsocket -lnsl -ldl -lc
 else
 ifdef LOCAL_THREADS_ONLY
-OS_LIBS			= -lsocket -lnsl -ldl
+OS_LIBS			= -lsocket -lnsl -ldl -lc
 else
-OS_LIBS			= -lthread -lposix4 -lsocket -lnsl -ldl
+OS_LIBS			= -lthread -lposix4 -lsocket -lnsl -ldl -lc
 endif	# LOCAL_THREADS_ONLY
 endif	# USE_PTHREADS
+ifeq ($(BUILD_SUN_PKG),1)
+ifeq ($(OS_TEST),sun4u)
+ifndef USE_64
+DSO_LDOPTS		+= -f \$$ORIGIN/cpu/\$$ISALIST/lib$(ULTRASPARC_LIBRARY)$(LIBRARY_VERSION).so
+endif
+endif	# sun4u
+endif
 endif	# 4.1.3_U1
 endif	# SunOS
 
 ifeq ($(OS_ARCH), IRIX)
 ifeq ($(USE_PTHREADS), 1)
 OS_LIBS = -lpthread
 endif
 endif
--- a/pr/src/md/unix/Makefile
+++ b/pr/src/md/unix/Makefile
@@ -314,18 +314,23 @@ export:: $(TARGETS)
 #endif
 #endif
 #endif
 
 ifeq ($(OS_ARCH),SunOS)
 ifneq ($(OS_RELEASE),4.1.3_U1)
 ifeq ($(OS_TEST),sun4u)
 $(SHARED_LIBRARY): $(ULTRASPARC_ASOBJS)
+ifeq ($(BUILD_SUN_PKG),1)
+	$(LD) -G -z text -z endfiltee -o $@ $(ULTRASPARC_ASOBJS)
+	$(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/lib/cpu/sparcv8plus
+else
 	$(LD) -G -z text -o $@ $(ULTRASPARC_ASOBJS)
 	$(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/lib
+endif
 
 $(ULTRASPARC_ASOBJS): $(ULTRASPARC_ASFILES)
 ifeq ($(USE_64),1)
 	/usr/ccs/bin/as -o $@ -K PIC -P -D_ASM -D__STDC__=0 -xarch=v9 $<
 else
 	/usr/ccs/bin/as -o $@ -K PIC -P -D_ASM -D__STDC__=0 -xarch=v8plus $<
 endif
 
--- a/pr/src/misc/prcountr.c
+++ b/pr/src/misc/prcountr.c
@@ -63,17 +63,16 @@
 ** individual counters. Candidates are: the global lock; a lock
 ** per RName structure; Atomic operations (Note that there are
 ** not adaquate atomic operations (yet) to achieve this goal). At
 ** this writing (6/19/98) , the update of the counter variable in
 ** a QName structure is unprotected.
 **
 */
 
-#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #include "prcountr.h"
 #include "prclist.h"
 #include "prlock.h"
 #include "prlog.h"
 #include "prmem.h"
 #include <string.h>
 
 /*
@@ -497,19 +496,8 @@ PR_IMPLEMENT(PRCounterHandle)
     else
         rnp = (RName *)PR_NEXT_LINK( &rnp->link );
 
     PR_LOG( lm, PR_LOG_DEBUG, ("PR_Counter: FindNextRname: Rhandle: %p, QHandle: %p, Returns: %p", 
         rhandle, qhandle, rnp ));
 
     return((PRCounterHandle)rnp);
 } /*  end PR_FindNextCounterRname() */
-
-
-#else  /* !(defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)) */
-/*
-** NSPR Counters are not defined in this case
-**
-**
-*/
-/* Some compilers don't like an empty compilation unit. */
-static int dummy = 0;
-#endif /* defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) */
--- a/pr/src/misc/prolock.c
+++ b/pr/src/misc/prolock.c
@@ -33,17 +33,16 @@
  */
 
 /*
 **  prolock.c -- NSPR Ordered Lock
 ** 
 **  Implement the API defined in prolock.h
 ** 
 */
-#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #include "prolock.h"
 #include "prlog.h"
 #include "prerror.h"
 
 PR_IMPLEMENT(PROrderedLock *) 
     PR_CreateOrderedLock( 
         PRInt32 order,
         const char *name
@@ -91,18 +90,8 @@ PR_IMPLEMENT(PRStatus)
 {
 #ifdef XP_MAC
 #pragma unused( lock )
 #endif
     PR_ASSERT(!"Not implemented"); /* Not implemented yet */
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
     return PR_FAILURE;
 } /*  end PR_UnlockOrderedLock() */
-
-#else /* ! defined(FORCE_NSPR_ORDERED_LOCK) */
-/*
-** NSPR Ordered Lock is not defined when !DEBUG and !FORCE_NSPR_ORDERED_LOCK
-**  
-*/
-
-/* Some compilers don't like an empty compilation unit. */
-static int dummy = 0;
-#endif /* defined(FORCE_NSPR_ORDERED_LOCK */
--- a/pr/src/misc/prtrace.c
+++ b/pr/src/misc/prtrace.c
@@ -36,17 +36,16 @@
 ** prtrace.c -- NSPR Trace Instrumentation
 **
 ** Implement the API defined in prtrace.h
 **
 **
 **
 */
 
-#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #include <string.h>
 #include "prtrace.h"
 #include "prclist.h"
 #include "prlock.h"
 #include "prcvar.h"
 #include "prio.h"
 #include "prlog.h"
 #include "prenv.h"
@@ -912,19 +911,9 @@ PR_IMPLEMENT(PRIntn)
     *found = copied;
     rc = ( fetchLostData == PR_TRUE )? 1 : 0;
     fetchLostData = PR_FALSE;
 
     PR_Unlock( traceLock );
     return rc;
 } /* end PR_GetTraceEntries() */
 
-#else /* !defined(FORCE_NSPR_TRACE) */
-/*
-** The trace facility is not defined when !DEBUG and !FORCE_NSPR_TRACE
-**
-*/
-
-/* Some compilers don't like an empty compilation unit. */
-static int dummy = 0;
-#endif /* defined(FORCE_NSPR_TRACE) */
-
 /* end prtrace.c */
new file mode 100644
--- /dev/null
+++ b/pr/src/nspr.def
@@ -0,0 +1,390 @@
+# nm -n -C -p libnspr4.so | awk '/[^ ]* T PR_/ {print $3}'
+NSPR_4.0 {
+	global:
+		LL_MaxInt;
+		LL_MinInt;
+		LL_Zero;
+		PR_Abort;
+		PR_AddToCounter;
+		PR_Accept;
+		PR_AcceptRead;
+		PR_Access;
+		PR_AddWaitFileDesc;
+		PR_AllocFileDesc;
+		PR_Assert;
+		PR_AtomicAdd;
+		PR_AtomicDecrement;
+		PR_AtomicIncrement;
+		PR_AtomicSet;
+		PR_AttachSharedMemory;
+		PR_AttachThread;
+		PR_Available;
+		PR_Available64;
+		PR_Bind;
+		PR_BlockClockInterrupts;
+		PR_BlockInterrupt;
+		PR_CEnterMonitor;
+		PR_CExitMonitor;
+		PR_CNotify;
+		PR_CNotifyAll;
+		PR_CSetOnMonitorRecycle;
+		PR_CWait;
+		PR_CallOnce;
+		PR_Calloc;
+		PR_CancelJob;
+		PR_CancelWaitFileDesc;
+		PR_CancelWaitGroup;
+		PR_CeilingLog2;
+		PR_ChangeFileDescNativeHandle;
+		PR_Cleanup;
+		PR_ClearInterrupt;
+		PR_ClearThreadGCAble;
+		PR_Close;
+		PR_CloseDir;
+		PR_CloseFileMap;
+		PR_CloseSemaphore;
+		PR_CloseSharedMemory;
+		PR_Connect;
+		PR_CreateCounter;
+		PR_ConvertIPv4AddrToIPv6;
+		PR_CreateAlarm;
+		PR_CreateFileMap;
+		PR_CreateIOLayerStub;
+		PR_CreateOrderedLock;
+		PR_CreateMWaitEnumerator;
+		PR_CreatePipe;
+		PR_CreateProcess;
+		PR_CreateProcessDetached;
+		PR_CreateSocketPollFd;
+		PR_CreateStack;
+		PR_CreateThread;
+		PR_CreateThreadGCAble;
+		PR_CreateTrace;
+		PR_CreateThreadPool;
+		PR_DecrementCounter;
+		PR_CreateWaitGroup;
+		PR_Delete;
+		PR_DeleteSemaphore;
+		PR_DeleteSharedMemory;
+		PR_DestroyAlarm;
+		PR_DestroyCounter;
+		PR_DestroyCondVar;
+		PR_DestroyLock;
+		PR_DestroyMWaitEnumerator;
+		PR_DestroyOrderedLock;
+		PR_DestroyMonitor;
+		PR_DestroyPollableEvent;
+		PR_DestroyProcessAttr;
+		PR_DestroyRWLock;
+		PR_DestroySem;
+		PR_DestroySocketPollFd;
+		PR_DestroyTrace;
+		PR_DestroyStack;
+		PR_DestroyWaitGroup;
+		PR_DetachProcess;
+		PR_DetachSharedMemory;
+		PR_DetachThread;
+		PR_DisableClockInterrupts;
+		PR_EnableClockInterrupts;
+		PR_EnterMonitor;
+		PR_EnumerateHostEnt;
+		PR_EnumerateThreads;
+		PR_EnumerateWaitGroup;
+		PR_ErrorInstallCallback;
+		PR_ErrorInstallTable;
+		PR_ErrorLanguages;
+		PR_ErrorToName;
+		PR_ErrorToString;
+		PR_ExitMonitor;
+		PR_ExplodeTime;
+		PR_ExportFileMapAsString;
+		PR_FD_CLR;
+		PR_FD_ISSET;
+		PR_FD_NCLR;
+		PR_FD_NISSET;
+		PR_FD_NSET;
+		PR_FD_SET;
+		PR_FD_ZERO;
+		PR_FileDesc2NativeHandle;
+		PR_FindSymbol;
+		PR_FindSymbolAndLibrary;
+		PR_FloorLog2;
+		PR_FormatTime;
+		PR_FindNextCounterQname;
+		PR_FindNextCounterRname;
+		PR_FindNextTraceQname;
+		PR_FindNextTraceRname;
+		PR_FormatTimeUSEnglish;
+		PR_Free;
+		PR_FreeLibraryName;
+		PR_GMTParameters;
+		PR_GetConnectStatus;
+		PR_GetCurrentThread;
+		PR_GetDefaultIOMethods;
+		PR_GetDescType;
+		PR_GetDirectorySeparator;
+		PR_GetCounter;
+		PR_GetCounterHandleFromName;
+		PR_GetCounterNameFromHandle;
+		PR_GetDirectorySepartor;
+		PR_GetEnv;
+		PR_GetError;
+		PR_GetErrorText;
+		PR_GetErrorTextLength;
+		PR_GetFileInfo;
+		PR_GetFileInfo64;
+		PR_GetFileMethods;
+		PR_GetGCRegisters;
+		PR_GetHostByAddr;
+		PR_GetHostByName;
+		PR_GetIPNodeByName;
+		PR_GetIdentitiesLayer;
+		PR_GetInheritedFD;
+		PR_GetInheritedFileMap;
+		PR_GetLayersIdentity;
+		PR_GetLibraryName;
+		PR_GetLibraryPath;
+		PR_GetMonitorEntryCount;
+		PR_GetNameForIdentity;
+		PR_GetOSError;
+		PR_GetOpenFileInfo;
+		PR_GetOpenFileInfo64;
+		PR_GetPageShift;
+		PR_GetPageSize;
+		PR_GetPeerName;
+		PR_GetPipeMethods;
+		PR_GetProtoByName;
+		PR_GetProtoByNumber;
+		PR_GetRandomNoise;
+		PR_GetSP;
+		PR_GetSockName;
+		PR_GetSocketOption;
+		PR_GetSpecialFD;
+		PR_GetStackSpaceLeft;
+		PR_GetSysfdTableMax;
+		PR_GetSystemInfo;
+		PR_GetTCPMethods;
+		PR_GetThreadAffinityMask;
+		PR_GetThreadID;
+		PR_GetThreadPriority;
+		PR_GetThreadPrivate;
+		PR_GetThreadScope;
+		PR_GetThreadState;
+		PR_GetThreadType;
+		PR_GetUDPMethods;
+		PR_GetUniqueIdentity;
+		PR_ImplodeTime;
+		PR_ImportFile;
+		PR_ImportFileMapFromString;
+		PR_ImportTCPSocket;
+		PR_ImportUDPSocket;
+		PR_GetTraceEntries;
+		PR_GetTraceHandleFromName;
+		PR_GetTraceNameFromHandle;
+		PR_GetTraceOption;
+		PR_Init;
+		PR_Initialize;
+		PR_InitializeNetAddr;
+		PR_Initialized;
+		PR_Interrupt;
+		PR_IntervalNow;
+		PR_IntervalToMicroseconds;
+		PR_IntervalToMilliseconds;
+		PR_IncrementCounter;
+		PR_IntervalToSeconds;
+		PR_IsNetAddrType;
+		PR_JoinJob;
+		PR_JoinThread;
+		PR_JoinThreadPool;
+		PR_KillProcess;
+		PR_Listen;
+		PR_LoadLibrary;
+		PR_LoadLibraryWithFlags;
+		PR_LoadStaticLibrary;
+		PR_LocalTimeParameters;
+		PR_Lock;
+		PR_LockFile;
+		PR_LogFlush;
+		PR_LogPrint;
+		PR_MakeDir;
+		PR_Malloc;
+		PR_MemMap;
+		PR_MemUnmap;
+		PR_MicrosecondsToInterval;
+		PR_MillisecondsToInterval;
+		PR_LockOrderedLock;
+		PR_MkDir;
+		PR_NetAddrToString;
+		PR_NewCondVar;
+		PR_NewLock;
+		PR_NewLogModule;
+		PR_NewMonitor;
+		PR_NewNamedMonitor;
+		PR_NewPollableEvent;
+		PR_NewProcessAttr;
+		PR_NewRWLock;
+		PR_NewSem;
+		PR_NewTCPSocket;
+		PR_NewTCPSocketPair;
+		PR_NewThreadPrivateIndex;
+		PR_NewUDPSocket;
+		PR_NormalizeTime;
+		PR_Notify;
+		PR_NotifyAll;
+		PR_NotifyAllCondVar;
+		PR_NotifyCondVar;
+		PR_Now;
+		PR_Open;
+		PR_OpenAnonFileMap;
+		PR_OpenDir;
+		PR_OpenFile;
+		PR_OpenSemaphore;
+		PR_OpenSharedMemory;
+		PR_OpenTCPSocket;
+		PR_OpenUDPSocket;
+		PR_ParseTimeString;
+		PR_Poll;
+		PR_PopIOLayer;
+		PR_PostSem;
+		PR_PostSemaphore;
+		PR_ProcessAttrSetCurrentDirectory;
+		PR_ProcessAttrSetInheritableFD;
+		PR_ProcessAttrSetInheritableFileMap;
+		PR_ProcessAttrSetStdioRedirect;
+		PR_ProcessExit;
+		PR_PushIOLayer;
+		PR_QueueJob;
+		PR_QueueJob_Accept;
+		PR_QueueJob_Connect;
+		PR_QueueJob_Read;
+		PR_QueueJob_Timer;
+		PR_QueueJob_Write;
+		PR_RWLock_Rlock;
+		PR_RWLock_Unlock;
+		PR_RWLock_Wlock;
+		PR_Read;
+		PR_ReadDir;
+		PR_Realloc;
+		PR_Recv;
+		PR_RecvFrom;
+		PR_Rename;
+		PR_ResetAlarm;
+		PR_ResetProcessAttr;
+		PR_ResumeAll;
+		PR_RmDir;
+		PR_ScanStackPointers;
+		PR_RecordTraceEntries;
+		PR_SecondsToInterval;
+		PR_Seek;
+		PR_Seek64;
+		PR_Select;
+		PR_Send;
+		PR_SendFile;
+		PR_SendTo;
+		PR_SetAlarm;
+		PR_SetConcurrency;
+		PR_SetError;
+		PR_SetErrorText;
+		PR_SetFDCacheSize;
+		PR_SetFDInheritable;
+		PR_SetLibraryPath;
+		PR_SetLogBuffering;
+		PR_SetLogFile;
+		PR_SetNetAddr;
+		PR_SetPollableEvent;
+		PR_SetSocketOption;
+		PR_SetCounter;
+		PR_SetStdioRedirect;
+		PR_SetSysfdTableSize;
+		PR_SetThreadAffinityMask;
+		PR_SetThreadDumpProc;
+		PR_SetThreadGCAble;
+		PR_SetThreadPriority;
+		PR_SetThreadPrivate;
+		PR_SetThreadRecycleMode;
+		PR_Shutdown;
+		PR_ShutdownThreadPool;
+		PR_Sleep;
+		PR_Socket;
+		PR_StackPop;
+		PR_StackPush;
+		PR_Stat;
+		PR_StringToNetAddr;
+		PR_SuspendAll;
+		PR_Sync;
+		PR_TLockFile;
+		PR_ThreadScanStackPointers;
+		PR_SetTraceOption;
+		PR_TicksPerSecond;
+		PR_TransmitFile;
+		PR_USPacificTimeParameters;
+		PR_UnblockClockInterrupts;
+		PR_UnblockInterrupt;
+		PR_UnloadLibrary;
+		PR_SubtractFromCounter;
+		PR_Unlock;
+		PR_UnlockFile;
+		PR_VersionCheck;
+		PR_Wait;
+		PR_WaitCondVar;
+		PR_WaitForPollableEvent;
+		PR_Trace;
+		PR_WaitProcess;
+		PR_WaitRecvReady;
+		PR_WaitSem;
+		PR_WaitSemaphore;
+		PR_Write;
+		PR_Writev;
+		PR_Yield;
+		PR_UnlockOrderedLock;
+		PR_cnvtf;
+		PR_dtoa;
+		PR_fprintf;
+		PR_htonl;
+		PR_htonll;
+		PR_htons;
+		PR_ntohl;
+		PR_ntohll;
+		PR_ntohs;
+		PR_smprintf;
+		PR_smprintf_free;
+		PR_snprintf;
+		PR_sprintf_append;
+		PR_sscanf;
+		PR_strtod;
+		PR_sxprintf;
+		PR_vfprintf;
+		PR_vsmprintf;
+		PR_vsnprintf;
+		PR_vsprintf_append;
+		PR_vsxprintf;
+		PRP_DestroyNakedCondVar;
+		PRP_NakedBroadcast;
+		PRP_NakedNotify;
+		PRP_NakedWait;
+		PRP_NewNakedCondVar;
+		PRP_TryLock;
+		libVersionPoint;
+	local: *;
+};
+
+NSPRprivate {
+	global:
+		GetExecutionEnvironment;
+		SetExecutionEnvironment;
+	local: *;
+};
+
+NSPR_4.1 {
+	global:
+		PR_ConnectContinue;
+		PR_CreateIOLayer;
+		PR_EmulateAcceptRead;
+		PR_EmulateSendFile;
+		PR_FindFunctionSymbol;
+		PR_FindFunctionSymbolAndLibrary;
+		PR_GetMemMapAlignment;
+		PR_GetNumberOfProcessors;
+		PR_ImportPipe;
+		PR_SetEnv;
+} NSPR_4.0;