Bug 839141 - Upgrade Mozilla to NSS 3.14.3, landing its dependency NSPR 4.9.5, r=wtc, a=akeybl
authorKai Engert <kaie@kuix.de>
Sun, 17 Mar 2013 00:34:13 +0100
changeset 110117 902b2c3f4d6bc2ef30d585789760a9775c6426d2
parent 110116 e7bfee631d7bb6750005e8752d4236f2cf4077eb
child 110118 747c40b60d2bd377248af84b80c55ddf2be5184c
push id190
push userkaie@kuix.de
push dateSat, 16 Mar 2013 23:38:50 +0000
reviewerswtc, akeybl
bugs839141
milestone17.0.4esrpre
Bug 839141 - Upgrade Mozilla to NSS 3.14.3, landing its dependency NSPR 4.9.5, r=wtc, a=akeybl
nsprpub/TAG-INFO
nsprpub/admin/repackage.sh
nsprpub/config/Makefile.in
nsprpub/config/nsinstall.c
nsprpub/config/pathsub.h
nsprpub/config/prdepend.h
nsprpub/configure
nsprpub/configure.in
nsprpub/lib/ds/Makefile.in
nsprpub/lib/libc/src/Makefile.in
nsprpub/lib/prstreams/Makefile.in
nsprpub/lib/prstreams/tests/testprstrm/Makefile.in
nsprpub/lib/tests/Makefile.in
nsprpub/pr/include/gencfg.c
nsprpub/pr/include/md/_aix.h
nsprpub/pr/include/md/_bsdi.h
nsprpub/pr/include/md/_darwin.h
nsprpub/pr/include/md/_dgux.h
nsprpub/pr/include/md/_freebsd.h
nsprpub/pr/include/md/_hpux.h
nsprpub/pr/include/md/_linux.cfg
nsprpub/pr/include/md/_linux.h
nsprpub/pr/include/md/_ncr.cfg
nsprpub/pr/include/md/_ncr.h
nsprpub/pr/include/md/_nec.cfg
nsprpub/pr/include/md/_nec.h
nsprpub/pr/include/md/_netbsd.h
nsprpub/pr/include/md/_nextstep.cfg
nsprpub/pr/include/md/_nextstep.h
nsprpub/pr/include/md/_nto.h
nsprpub/pr/include/md/_openbsd.h
nsprpub/pr/include/md/_osf1.h
nsprpub/pr/include/md/_qnx.h
nsprpub/pr/include/md/_reliantunix.cfg
nsprpub/pr/include/md/_reliantunix.h
nsprpub/pr/include/md/_riscos.h
nsprpub/pr/include/md/_scoos.h
nsprpub/pr/include/md/_solaris.h
nsprpub/pr/include/md/_sony.cfg
nsprpub/pr/include/md/_sony.h
nsprpub/pr/include/md/_sunos4.cfg
nsprpub/pr/include/md/_sunos4.h
nsprpub/pr/include/md/_symbian.h
nsprpub/pr/include/md/_unixos.h
nsprpub/pr/include/md/_unixware.h
nsprpub/pr/include/md/prosdep.h
nsprpub/pr/include/md/sunos4.h
nsprpub/pr/include/prinit.h
nsprpub/pr/include/private/primpl.h
nsprpub/pr/include/prlong.h
nsprpub/pr/include/prtime.h
nsprpub/pr/include/prtypes.h
nsprpub/pr/src/Makefile.in
nsprpub/pr/src/cplus/tests/Makefile.in
nsprpub/pr/src/io/Makefile.in
nsprpub/pr/src/io/prfile.c
nsprpub/pr/src/io/prlayer.c
nsprpub/pr/src/io/prmapopt.c
nsprpub/pr/src/io/prscanf.c
nsprpub/pr/src/linking/Makefile.in
nsprpub/pr/src/linking/prlink.c
nsprpub/pr/src/malloc/Makefile.in
nsprpub/pr/src/md/beos/beos_errors.c
nsprpub/pr/src/md/prosdep.c
nsprpub/pr/src/md/unix/Makefile.in
nsprpub/pr/src/md/unix/darwin.c
nsprpub/pr/src/md/unix/ncr.c
nsprpub/pr/src/md/unix/nec.c
nsprpub/pr/src/md/unix/nextstep.c
nsprpub/pr/src/md/unix/os_ReliantUNIX.s
nsprpub/pr/src/md/unix/reliantunix.c
nsprpub/pr/src/md/unix/sony.c
nsprpub/pr/src/md/unix/sunos4.c
nsprpub/pr/src/md/unix/unix.c
nsprpub/pr/src/md/unix/unix_errors.c
nsprpub/pr/src/md/unix/uxproces.c
nsprpub/pr/src/md/unix/uxrng.c
nsprpub/pr/src/md/unix/uxwrap.c
nsprpub/pr/src/misc/prerrortable.c
nsprpub/pr/src/misc/prinrval.c
nsprpub/pr/src/misc/prnetdb.c
nsprpub/pr/src/misc/prtime.c
nsprpub/pr/src/pthreads/Makefile.in
nsprpub/pr/src/pthreads/ptio.c
nsprpub/pr/src/pthreads/ptthread.c
nsprpub/pr/src/threads/combined/Makefile.in
nsprpub/pr/tests/Makefile.in
nsprpub/pr/tests/dll/Makefile.in
nsprpub/pr/tests/pushtop.c
nsprpub/pr/tests/runtests.pl
nsprpub/pr/tests/runtests.sh
nsprpub/pr/tests/vercheck.c
nsprpub/tools/Makefile.in
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_9_2_RTM
+NSPR_4_9_5_RTM
deleted file mode 100755
--- a/nsprpub/admin/repackage.sh
+++ /dev/null
@@ -1,179 +0,0 @@
-#! /bin/sh
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# ------------------------------------------------------------------
-# repackage.sh -- Repackage NSPR from /s/b/c to mozilla.org format
-#
-# syntax: repackage.sh
-#
-# Description:
-# repackage.sh creates NSPR binary distributions for mozilla.org from
-# the internal binary distributions in /share/builds/components/nspr20.
-# There are reasons why we can't just push the internal binary distributions
-# to mozilla.org. External developers prefer to use the common archive 
-# file format for their platforms, rather than the jar files we use internally.
-#
-# On Unix, we create a tar.gz file.  On Windows, we create a zip file.
-# For example: NSPR 4.1.1, these would be nspr-4.1.1.tar.gz and nspr-4.1.1.zip.
-#
-# When unpacked, nspr-4.1.1.tar.gz or nspr-4.1.1.zip should expand to a
-# nspr-4.1.1 directory that contains three subdirectories: include, lib,
-# and bin.  The header files, with the correct line endings for the
-# platform, are in nspr-4.1.1/include.  The libraries are in nspr-4.1.1/lib.
-# The executable programs are in nspr-4.1.1/bin.
-# 
-# Note! Files written with Gnu tar are not readable by some non-Gnu
-# versions. Sun, in particular.
-# 
-# 
-# 
-# 
-# ------------------------------------------------------------------
-
-FROMTOP=/share/builds/components/nspr20/v4.9.2
-TOTOP=./v4.9.2
-NSPRDIR=nspr-4.9.2
-SOURCETAG=NSPR_4_9_2_RTM
-
-#
-# enumerate Unix object directories on /s/b/c
-UNIX_OBJDIRS="
-HP-UXB.11.11_64_DBG.OBJ
-HP-UXB.11.11_64_OPT.OBJ
-HP-UXB.11.11_DBG.OBJ
-HP-UXB.11.11_OPT.OBJ
-HP-UXB.11.23_ia64_32_DBG.OBJ
-HP-UXB.11.23_ia64_32_OPT.OBJ
-HP-UXB.11.23_ia64_64_DBG.OBJ
-HP-UXB.11.23_ia64_64_OPT.OBJ
-Linux2.4_x86_glibc_PTH_DBG.OBJ
-Linux2.4_x86_glibc_PTH_OPT.OBJ
-Linux2.6_x86_64_glibc_PTH_DBG.OBJ
-Linux2.6_x86_64_glibc_PTH_OPT.OBJ
-Linux2.6_x86_glibc_PTH_DBG.OBJ
-Linux2.6_x86_glibc_PTH_OPT.OBJ
-SunOS5.9_64_DBG.OBJ
-SunOS5.9_64_OPT.OBJ
-SunOS5.9_DBG.OBJ
-SunOS5.9_OPT.OBJ
-"
-#
-# enumerate Windows object directories on /s/b/c
-WIN_OBJDIRS="
-WIN954.0_DBG.OBJ
-WIN954.0_DBG.OBJD
-WIN954.0_OPT.OBJ
-WINNT5.0_DBG.OBJ
-WINNT5.0_DBG.OBJD
-WINNT5.0_OPT.OBJ
-"
-
-#
-# Create the destination directory.
-#
-echo "removing directory $TOTOP"
-rm -rf $TOTOP
-echo "creating directory $TOTOP"
-mkdir -p $TOTOP
-
-#
-# Generate the tar.gz files for Unix platforms.
-#
-for OBJDIR in $UNIX_OBJDIRS; do
-    echo "removing directory $NSPRDIR"
-    rm -rf $NSPRDIR
-    echo "creating directory $NSPRDIR"
-    mkdir $NSPRDIR
-
-    echo "creating directory $NSPRDIR/include"
-    mkdir $NSPRDIR/include
-    echo "copying $FROMTOP/$OBJDIR/include"
-    cp -r $FROMTOP/$OBJDIR/include $NSPRDIR
-
-    echo "copying $FROMTOP/$OBJDIR/lib"
-    cp -r $FROMTOP/$OBJDIR/lib $NSPRDIR
-
-    echo "copying $FROMTOP/$OBJDIR/bin"
-    cp -r $FROMTOP/$OBJDIR/bin $NSPRDIR
-
-    echo "creating directory $TOTOP/$OBJDIR"
-    mkdir $TOTOP/$OBJDIR
-    echo "creating $TOTOP/$OBJDIR/$NSPRDIR.tar"
-    tar cvf $TOTOP/$OBJDIR/$NSPRDIR.tar $NSPRDIR
-    echo "gzipping $TOTOP/$OBJDIR/$NSPRDIR.tar"
-    gzip $TOTOP/$OBJDIR/$NSPRDIR.tar
-done
-
-#
-# Generate the zip files for Windows platforms.
-#
-for OBJDIR in $WIN_OBJDIRS; do
-    echo "removing directory $NSPRDIR"
-    rm -rf $NSPRDIR
-    echo "creating directory $NSPRDIR"
-    mkdir $NSPRDIR
-
-    echo "creating directory $NSPRDIR/include"
-    mkdir $NSPRDIR/include
-    echo "creating directory $NSPRDIR/include/private"
-    mkdir $NSPRDIR/include/private
-    echo "creating directory $NSPRDIR/include/obsolete"
-    mkdir $NSPRDIR/include/obsolete
-
-    # copy headers and adjust unix line-end to Windows line-end
-    # Note: Watch out for the "sed" command line.
-    # when editing the command, take care to preserve the "^M" as the literal
-    # cntl-M character! in vi, use "cntl-v cntl-m" to enter it!
-    #
-    headers=`ls $FROMTOP/$OBJDIR/include/*.h`
-    for header in $headers; do
-        sed -e 's/$/
/g' $header > $NSPRDIR/include/`basename $header`
-    done
-    headers=`ls $FROMTOP/$OBJDIR/include/obsolete/*.h`
-    for header in $headers; do
-        sed -e 's/$/
/g' $header > $NSPRDIR/include/obsolete/`basename $header`
-    done
-    headers=`ls $FROMTOP/$OBJDIR/include/private/*.h`
-    for header in $headers; do
-        sed -e 's/$/
/g' $header > $NSPRDIR/include/private/`basename $header`
-    done
-
-    echo "copying $FROMTOP/$OBJDIR/lib"
-    cp -r $FROMTOP/$OBJDIR/lib $NSPRDIR
-
-    echo "copying $FROMTOP/$OBJDIR/bin"
-    cp -r $FROMTOP/$OBJDIR/bin $NSPRDIR
-
-    echo "creating directory $TOTOP/$OBJDIR"
-    mkdir -p $TOTOP/$OBJDIR
-    echo "creating $TOTOP/$OBJDIR/$NSPRDIR.zip"
-    zip -r $TOTOP/$OBJDIR/$NSPRDIR.zip $NSPRDIR
-done
-
-#
-# package the source from CVS
-#
-echo "Packaging source"
-echo "removing directory $NSPRDIR"
-rm -rf $NSPRDIR
-echo "creating directory $NSPRDIR"
-mkdir $NSPRDIR
-myWD=`pwd`
-cd $NSPRDIR
-echo "Pulling source from CVS with tag $SOURCETAG"
-cvs co -r $SOURCETAG mozilla/nsprpub
-cd $myWD
-mkdir $TOTOP/src
-echo "Creating source tar file: $TOTOP/src/$NSPRDIR.tar"
-tar cvf $TOTOP/src/$NSPRDIR.tar $NSPRDIR
-echo "gzip $TOTOP/src/$NSPRDIR.tar"
-gzip $TOTOP/src/$NSPRDIR.tar
-
-#
-# Remove the working directory.
-#
-echo "removing directory $NSPRDIR"
-rm -rf $NSPRDIR
-# --- end repackage.sh ---------------------------------------------
--- a/nsprpub/config/Makefile.in
+++ b/nsprpub/config/Makefile.in
@@ -39,17 +39,17 @@ ifeq (,$(CROSS_COMPILE)$(filter-out WINN
 PROG_SUFFIX = .exe
 else
 PROG_SUFFIX =
 endif
 
 # Temporary workaround to disable the generation of
 # library build time because now.c uses the 'long long'
 # data type that's not available on some platforms.
-ifeq (,$(filter-out NEC NEXTSTEP QNX SCOOS UNIXWARE,$(OS_ARCH)))
+ifeq (,$(filter-out QNX SCOOS UNIXWARE,$(OS_ARCH)))
 DEFINES += -DOMIT_LIB_BUILD_TIME
 endif
 
 ifeq ($(OS_ARCH), IRIX)
     ifeq ($(basename $(OS_RELEASE)),6)
         ifndef NS_USE_GCC
             ifeq ($(USE_N32),1)
                 XLDOPTS += -n32 -Wl,-woff,85
--- a/nsprpub/config/nsinstall.c
+++ b/nsprpub/config/nsinstall.c
@@ -33,58 +33,30 @@
 #if defined(BEOS)
 #undef HAVE_FCHMOD
 #endif
 
 /*
  * Does getcwd() take NULL as the first argument and malloc
  * the result buffer?
  */
-#if !defined(DARWIN) && !defined(NEXTSTEP)
+#if !defined(DARWIN)
 #define GETCWD_CAN_MALLOC
 #endif
 
-#ifdef NEXTSTEP
-#include <bsd/libc.h>
-
-/*
-** balazs.pataki@sztaki.hu: The getcwd is broken in NEXTSTEP (returns 0),
-** when called on a mounted fs. Did anyone notice this? Here's an ugly
-** workaround ...
-*/
-#define getcwd(b,s)   my_getcwd(b,s)
-
-static char *
-my_getcwd (char *buf, size_t size)
-{
-    FILE *pwd = popen("pwd", "r");
-    char *result = fgets(buf, size, pwd);
-
-    if (result) {
-        buf[strlen(buf)-1] = '\0';
-    }
-    pclose (pwd);
-    return buf;
-}
-#endif /* NEXTSTEP */
-
 #if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) 
 #include <getopt.h>
 #endif
 
-#if defined(SCO) || defined(UNIXWARE) || defined(SNI) || defined(NCR) || defined(NEC) || defined(NEXTSTEP)
+#if defined(SCO) || defined(UNIXWARE)
 #if !defined(S_ISLNK) && defined(S_IFLNK)
 #define S_ISLNK(a)	(((a) & S_IFMT) == S_IFLNK)
 #endif
 #endif
 
-#if defined(SNI)
-extern int fchmod(int fildes, mode_t mode);
-#endif
-
 #ifdef QNX
 #define d_ino d_stat.st_ino
 #endif
 
 static void
 usage(void)
 {
     fprintf(stderr,
--- a/nsprpub/config/pathsub.h
+++ b/nsprpub/config/pathsub.h
@@ -8,20 +8,16 @@
 /*
 ** Pathname subroutines.
 **
 ** Brendan Eich, 8/29/95
 */
 #include <limits.h>
 #include <sys/types.h>
 
-#if SUNOS4
-#include "../pr/include/md/sunos4.h"
-#endif
-
 #ifndef PATH_MAX
 #define PATH_MAX 1024
 #endif
 
 /*
  * Just prevent stupidity
  */
 #undef NAME_MAX
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -5,9 +5,8 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
-
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -731,17 +731,17 @@ echo "$ac_t""$build" 1>&6
 test "$host_alias" != "$target_alias" &&
   test "$program_prefix$program_suffix$program_transform_name" = \
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
 
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=9
-MOD_PATCH_VERSION=2
+MOD_PATCH_VERSION=5
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
 USE_CPLUS=
@@ -873,17 +873,17 @@ if test "${with_android_platform+set}" =
 fi
 
 
 case "$target" in
 arm-linux*-android*|*-linuxandroid*)
     android_tool_prefix="arm-linux-androideabi"
     ;;
 i?86-*android*)
-    android_tool_prefix="i686-android-linux"
+    android_tool_prefix="i686-linux-android"
     ;;
 mipsel-*android*)
     android_tool_prefix="mipsel-linux-android"
     ;;
 *)
     android_tool_prefix="$target_os"
     ;;
 esac
@@ -968,16 +968,24 @@ echo "configure:954: checking for androi
 
         if test -d "$android_platform" ; then
             echo "$ac_t""$android_platform" 1>&6
         else
             { echo "configure: error: not found. You have to specify --with-android-platform=/path/to/ndk/platform." 1>&2; exit 1; }
         fi
     fi
 
+            case "$target_cpu" in
+    i?86)
+        if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then
+                        android_tool_prefix="i686-android-linux"
+        fi
+        ;;
+    esac
+
         AS="$android_toolchain"/bin/"$android_tool_prefix"-as
     CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
     CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
     CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
     LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
     AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
     RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
     STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
@@ -1299,17 +1307,17 @@ if test -z "$CXX"; then
 
     esac
 fi
 
 if test -z "$SKIP_PATH_CHECKS"; then
     # Extract the first word of "$WHOAMI whoami", so it can be a program name with args.
 set dummy $WHOAMI whoami; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1308: checking for $ac_word" >&5
+echo "configure:1316: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_WHOAMI'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   case "$WHOAMI" in
   /*)
   ac_cv_path_WHOAMI="$WHOAMI" # Let the user override the test with a path.
   ;;
   ?:/*)			 
@@ -1371,23 +1379,23 @@ if test "$target" != "$host" -o -n "$CRO
     echo "cross compiling from $host to $target"
     cross_compiling=yes
 
     _SAVE_CC="$CC"
     _SAVE_CFLAGS="$CFLAGS"
     _SAVE_LDFLAGS="$LDFLAGS"
 
     echo $ac_n "checking for $host compiler""... $ac_c" 1>&6
-echo "configure:1380: checking for $host compiler" >&5
+echo "configure:1388: checking for $host compiler" >&5
     for ac_prog in $HOST_CC gcc cc /usr/ucb/cc
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1386: checking for $ac_word" >&5
+echo "configure:1394: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_HOST_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$HOST_CC"; then
   ac_cv_prog_HOST_CC="$HOST_CC" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -1423,26 +1431,26 @@ test -n "$HOST_CC" || HOST_CC=""""
         HOST_LDFLAGS="$LDFLAGS"
     fi
 
     CC="$HOST_CC"
     CFLAGS="$HOST_CFLAGS"
     LDFLAGS="$HOST_LDFLAGS"
 
     echo $ac_n "checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1432: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
+echo "configure:1440: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
     cat > conftest.$ac_ext <<EOF
-#line 1434 "configure"
+#line 1442 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:1441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_prog_host_cc_works=1 echo "$ac_t""yes" 1>&6
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   { echo "configure: error: installation or configuration problem: $host compiler $HOST_CC cannot create executables." 1>&2; exit 1; } 
 fi
@@ -1467,17 +1475,17 @@ rm -f conftest*
         ;;
     esac
 
     for ac_prog in $CC "${target_alias}-gcc" "${target}-gcc"
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1476: checking for $ac_word" >&5
+echo "configure:1484: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -1501,17 +1509,17 @@ fi
 test -n "$CC" && break
 done
 test -n "$CC" || CC="echo"
 
     unset ac_cv_prog_CC
     # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1510: checking for $ac_word" >&5
+echo "configure:1518: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -1531,17 +1539,17 @@ if test -n "$CC"; then
 else
   echo "$ac_t""no" 1>&6
 fi
 
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1540: checking for $ac_word" >&5
+echo "configure:1548: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
@@ -1582,17 +1590,17 @@ else
 fi
 
   if test -z "$CC"; then
     case "`uname -s`" in
     *win32* | *WIN32*)
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1591: checking for $ac_word" >&5
+echo "configure:1599: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -1614,33 +1622,33 @@ else
 fi
  ;;
     esac
   fi
   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1623: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1631: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 1634 "configure"
+#line 1642 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
     ac_cv_prog_cc_cross=no
   else
     ac_cv_prog_cc_cross=yes
   fi
 else
@@ -1656,31 +1664,31 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAG
 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1665: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1673: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1670: checking whether we are using GNU C" >&5
+echo "configure:1678: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
 fi
 fi
 
 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
@@ -1689,17 +1697,17 @@ if test $ac_cv_prog_gcc = yes; then
 else
   GCC=
 fi
 
 ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1698: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1706: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
   ac_cv_prog_cc_g=yes
 else
   ac_cv_prog_cc_g=no
@@ -1726,17 +1734,17 @@ else
 fi
 
     if test -n "$USE_CPLUS"; then
         for ac_prog in $CXX "${target_alias}-g++" "${target}-g++"
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1735: checking for $ac_word" >&5
+echo "configure:1743: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CXX"; then
   ac_cv_prog_CXX="$CXX" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -1762,17 +1770,17 @@ done
 test -n "$CXX" || CXX="echo"
 
         unset ac_cv_prog_CXX
         for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1771: checking for $ac_word" >&5
+echo "configure:1779: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CXX"; then
   ac_cv_prog_CXX="$CXX" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -1794,33 +1802,33 @@ else
 fi
 
 test -n "$CXX" && break
 done
 test -n "$CXX" || CXX="gcc"
 
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1803: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:1811: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cxx_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 1814 "configure"
+#line 1822 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:1819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
     ac_cv_prog_cxx_cross=no
   else
     ac_cv_prog_cxx_cross=yes
   fi
 else
@@ -1836,31 +1844,31 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAG
 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
 if test $ac_cv_prog_cxx_works = no; then
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1845: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1853: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1850: checking whether we are using GNU C++" >&5
+echo "configure:1858: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.C <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
 fi
 fi
 
 echo "$ac_t""$ac_cv_prog_gxx" 1>&6
 
@@ -1869,17 +1877,17 @@ if test $ac_cv_prog_gxx = yes; then
 else
   GXX=
 fi
 
 ac_test_CXXFLAGS="${CXXFLAGS+set}"
 ac_save_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS=
 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1878: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1886: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo 'void f(){}' > conftest.cc
 if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
   ac_cv_prog_cxx_g=yes
 else
   ac_cv_prog_cxx_g=no
@@ -1914,17 +1922,17 @@ fi
         ;;
     esac
 
     for ac_prog in $RANLIB "${target_alias}-ranlib" "${target}-ranlib"
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1923: checking for $ac_word" >&5
+echo "configure:1931: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -1949,17 +1957,17 @@ test -n "$RANLIB" && break
 done
 test -n "$RANLIB" || RANLIB="echo"
 
     for ac_prog in $AR "${target_alias}-ar" "${target}-ar"
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1958: checking for $ac_word" >&5
+echo "configure:1966: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$AR"; then
   ac_cv_prog_AR="$AR" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -1984,17 +1992,17 @@ test -n "$AR" && break
 done
 test -n "$AR" || AR="echo"
 
     for ac_prog in $AS "${target_alias}-as" "${target}-as"
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1993: checking for $ac_word" >&5
+echo "configure:2001: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$AS"; then
   ac_cv_prog_AS="$AS" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -2019,17 +2027,17 @@ test -n "$AS" && break
 done
 test -n "$AS" || AS="echo"
 
     for ac_prog in $LD "${target_alias}-ld" "${target}-ld"
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2028: checking for $ac_word" >&5
+echo "configure:2036: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$LD"; then
   ac_cv_prog_LD="$LD" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -2054,17 +2062,17 @@ test -n "$LD" && break
 done
 test -n "$LD" || LD="echo"
 
     for ac_prog in $STRIP "${target_alias}-strip" "${target}-strip"
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2063: checking for $ac_word" >&5
+echo "configure:2071: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$STRIP"; then
   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -2089,17 +2097,17 @@ test -n "$STRIP" && break
 done
 test -n "$STRIP" || STRIP="echo"
 
     for ac_prog in $WINDRES "${target_alias}-windres" "${target}-windres"
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2098: checking for $ac_word" >&5
+echo "configure:2106: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$WINDRES"; then
   ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -2124,17 +2132,17 @@ test -n "$WINDRES" && break
 done
 test -n "$WINDRES" || WINDRES="echo"
 
 
 else
     # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2133: checking for $ac_word" >&5
+echo "configure:2141: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -2154,17 +2162,17 @@ if test -n "$CC"; then
 else
   echo "$ac_t""no" 1>&6
 fi
 
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2163: checking for $ac_word" >&5
+echo "configure:2171: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
@@ -2205,17 +2213,17 @@ else
 fi
 
   if test -z "$CC"; then
     case "`uname -s`" in
     *win32* | *WIN32*)
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2214: checking for $ac_word" >&5
+echo "configure:2222: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -2237,33 +2245,33 @@ else
 fi
  ;;
     esac
   fi
   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2246: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2254: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2257 "configure"
+#line 2265 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
     ac_cv_prog_cc_cross=no
   else
     ac_cv_prog_cc_cross=yes
   fi
 else
@@ -2279,31 +2287,31 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAG
 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2288: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2296: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2293: checking whether we are using GNU C" >&5
+echo "configure:2301: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
 fi
 fi
 
 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
@@ -2312,17 +2320,17 @@ if test $ac_cv_prog_gcc = yes; then
 else
   GCC=
 fi
 
 ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2321: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2329: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
   ac_cv_prog_cc_g=yes
 else
   ac_cv_prog_cc_g=no
@@ -2352,17 +2360,17 @@ fi
         if test "$CC" = "cl" -a -z "$CXX"; then
             CXX=$CC
         else        
             for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2361: checking for $ac_word" >&5
+echo "configure:2369: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CXX"; then
   ac_cv_prog_CXX="$CXX" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -2384,33 +2392,33 @@ else
 fi
 
 test -n "$CXX" && break
 done
 test -n "$CXX" || CXX="gcc"
 
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2393: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:2401: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cxx_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2404 "configure"
+#line 2412 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:2409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
     ac_cv_prog_cxx_cross=no
   else
     ac_cv_prog_cxx_cross=yes
   fi
 else
@@ -2426,31 +2434,31 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAG
 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
 if test $ac_cv_prog_cxx_works = no; then
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2435: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2443: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:2440: checking whether we are using GNU C++" >&5
+echo "configure:2448: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.C <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
 fi
 fi
 
 echo "$ac_t""$ac_cv_prog_gxx" 1>&6
 
@@ -2459,17 +2467,17 @@ if test $ac_cv_prog_gxx = yes; then
 else
   GXX=
 fi
 
 ac_test_CXXFLAGS="${CXXFLAGS+set}"
 ac_save_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS=
 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:2468: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:2476: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo 'void f(){}' > conftest.cc
 if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
   ac_cv_prog_cxx_g=yes
 else
   ac_cv_prog_cxx_g=no
@@ -2493,72 +2501,72 @@ else
   else
     CXXFLAGS=
   fi
 fi
 
         fi
     fi
     echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2502: checking how to run the C preprocessor" >&5
+echo "configure:2510: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     # This must be in double quotes, not single quotes, because CPP may get
   # substituted into the Makefile and "${CC-cc}" will confuse make.
   CPP="${CC-cc} -E"
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2517 "configure"
+#line 2525 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2534 "configure"
+#line 2542 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2540: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2551 "configure"
+#line 2559 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
@@ -2575,17 +2583,17 @@ fi
 else
   ac_cv_prog_CPP="$CPP"
 fi
 echo "$ac_t""$CPP" 1>&6
 
     # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2584: checking for $ac_word" >&5
+echo "configure:2592: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
@@ -2607,17 +2615,17 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
     for ac_prog in as
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2616: checking for $ac_word" >&5
+echo "configure:2624: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   case "$AS" in
   /*)
   ac_cv_path_AS="$AS" # Let the user override the test with a path.
   ;;
   ?:/*)			 
@@ -2648,17 +2656,17 @@ test -n "$AS" && break
 done
 test -n "$AS" || AS="$CC"
 
     for ac_prog in ar
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2657: checking for $ac_word" >&5
+echo "configure:2665: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   case "$AR" in
   /*)
   ac_cv_path_AR="$AR" # Let the user override the test with a path.
   ;;
   ?:/*)			 
@@ -2689,17 +2697,17 @@ test -n "$AR" && break
 done
 test -n "$AR" || AR="echo not_ar"
 
     for ac_prog in ld link
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2698: checking for $ac_word" >&5
+echo "configure:2706: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   case "$LD" in
   /*)
   ac_cv_path_LD="$LD" # Let the user override the test with a path.
   ;;
   ?:/*)			 
@@ -2730,17 +2738,17 @@ test -n "$LD" && break
 done
 test -n "$LD" || LD="echo not_ld"
 
     for ac_prog in strip
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2739: checking for $ac_word" >&5
+echo "configure:2747: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   case "$STRIP" in
   /*)
   ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path.
   ;;
   ?:/*)			 
@@ -2771,17 +2779,17 @@ test -n "$STRIP" && break
 done
 test -n "$STRIP" || STRIP="echo not_strip"
 
     for ac_prog in windres
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2780: checking for $ac_word" >&5
+echo "configure:2788: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   case "$WINDRES" in
   /*)
   ac_cv_path_WINDRES="$WINDRES" # Let the user override the test with a path.
   ;;
   ?:/*)			 
@@ -2839,39 +2847,39 @@ esac
 
 if test "$cross_compiling"  = "yes"; then
     CROSS_COMPILE=1
 else
     CROSS_COMPILE=
 fi
 
 echo $ac_n "checking for gcc -pipe support""... $ac_c" 1>&6
-echo "configure:2848: checking for gcc -pipe support" >&5
+echo "configure:2856: checking for gcc -pipe support" >&5
 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
     echo '#include <stdio.h>' > dummy-hello.c
     echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
     ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
     cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
     if test $? = 0; then
         _res_as_stdin="yes"
     else
         _res_as_stdin="no"
     fi
     if test "$_res_as_stdin" = "yes"; then
         _SAVE_CFLAGS=$CFLAGS
         CFLAGS="$CFLAGS -pipe"
         cat > conftest.$ac_ext <<EOF
-#line 2863 "configure"
+#line 2871 "configure"
 #include "confdefs.h"
  #include <stdio.h> 
 int main() {
 printf("Hello World\n");
 ; return 0; }
 EOF
-if { (eval echo configure:2870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   _res_gcc_pipe="yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   _res_gcc_pipe="no" 
 fi
@@ -2891,26 +2899,26 @@ else
     echo "$ac_t""no" 1>&6
 fi
 
 
 _SAVE_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
 
 echo $ac_n "checking whether C compiler supports -fprofile-generate""... $ac_c" 1>&6
-echo "configure:2900: checking whether C compiler supports -fprofile-generate" >&5
+echo "configure:2908: checking whether C compiler supports -fprofile-generate" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2902 "configure"
+#line 2910 "configure"
 #include "confdefs.h"
 
 int main() {
 return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:2909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    PROFILE_GEN_CFLAGS="-fprofile-generate"
                  result="yes" 
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   result="no"
@@ -2923,17 +2931,17 @@ if test $result = "yes"; then
    PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
    PROFILE_USE_LDFLAGS="-fprofile-use"
 fi
 
 CFLAGS="$_SAVE_CFLAGS"
 
 if test "$GNU_CC"; then
     echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6
-echo "configure:2932: checking for visibility(hidden) attribute" >&5
+echo "configure:2940: checking for visibility(hidden) attribute" >&5
 if eval "test \"`echo '$''{'ac_cv_visibility_hidden'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.c <<EOF
         int foo __attribute__ ((visibility ("hidden"))) = 1;
 EOF
         ac_cv_visibility_hidden=no
         if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
@@ -2947,17 +2955,17 @@ fi
 
 echo "$ac_t""$ac_cv_visibility_hidden" 1>&6
     if test "$ac_cv_visibility_hidden" = "yes"; then
         cat >> confdefs.h <<\EOF
 #define HAVE_VISIBILITY_HIDDEN_ATTRIBUTE 1
 EOF
 
         echo $ac_n "checking for visibility pragma support""... $ac_c" 1>&6
-echo "configure:2956: checking for visibility pragma support" >&5
+echo "configure:2964: checking for visibility pragma support" >&5
 if eval "test \"`echo '$''{'ac_cv_visibility_pragma'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.c <<EOF
 #pragma GCC visibility push(hidden)
             int foo_hidden = 1;
 #pragma GCC visibility push(default)
             int foo_default = 1;
@@ -3000,17 +3008,17 @@ fi # GNU_CC
 fi # SKIP_COMPILER_CHECKS
 
 if test -z "$SKIP_PATH_CHECKS"; then
     for ac_prog in perl5 perl
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3009: checking for $ac_word" >&5
+echo "configure:3017: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   case "$PERL" in
   /*)
   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
   ;;
   ?:/*)			 
@@ -3322,24 +3330,24 @@ yes)
 no)
     MOZ_THUMB2=
     thumb_flag="-marm"
     ;;
 *)
     _SAVE_CFLAGS="$CFLAGS"
     CFLAGS="$arch_flag"
     cat > conftest.$ac_ext <<EOF
-#line 3331 "configure"
+#line 3339 "configure"
 #include "confdefs.h"
 
 int main() {
 return sizeof(__thumb2__);
 ; return 0; }
 EOF
-if { (eval echo configure:3338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   MOZ_THUMB2=1
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   MOZ_THUMB2=
 fi
@@ -3391,26 +3399,26 @@ no)
     ;;
 esac
 
 all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag`
 if test -n "$all_flags"; then
     _SAVE_CFLAGS="$CFLAGS"
     CFLAGS="$all_flags"
     echo $ac_n "checking whether the chosen combination of compiler flags ($all_flags) works""... $ac_c" 1>&6
-echo "configure:3400: checking whether the chosen combination of compiler flags ($all_flags) works" >&5
+echo "configure:3408: checking whether the chosen combination of compiler flags ($all_flags) works" >&5
     cat > conftest.$ac_ext <<EOF
-#line 3402 "configure"
+#line 3410 "configure"
 #include "confdefs.h"
 
 int main() {
 return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:3409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   { echo "configure: error: no" 1>&2; exit 1; }
 fi
@@ -3457,27 +3465,27 @@ EOF
 
     cat >> confdefs.h <<\EOF
 #define SYSV 1
 EOF
 
     DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
     ac_safe=`echo "sys/atomic_op.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/atomic_op.h""... $ac_c" 1>&6
-echo "configure:3466: checking for sys/atomic_op.h" >&5
+echo "configure:3474: checking for sys/atomic_op.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3471 "configure"
+#line 3479 "configure"
 #include "confdefs.h"
 #include <sys/atomic_op.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3484: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -3624,36 +3632,36 @@ EOF
     PR_MD_ARCH_DIR=beos
     RESOLVE_LINK_SYMBOLS=1
     case "${target_cpu}" in
     i*86)
         _OPTIMIZE_FLAGS=-O2
         _DEBUG_FLAGS='-gdwarf-2 -O0'
         MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
         echo $ac_n "checking for gethostbyaddr in -lbind""... $ac_c" 1>&6
-echo "configure:3633: checking for gethostbyaddr in -lbind" >&5
+echo "configure:3641: checking for gethostbyaddr in -lbind" >&5
 ac_lib_var=`echo bind'_'gethostbyaddr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3641 "configure"
+#line 3649 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char gethostbyaddr();
 
 int main() {
 gethostbyaddr()
 ; return 0; }
 EOF
-if { (eval echo configure:3652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=no"
 fi
@@ -3852,27 +3860,27 @@ EOF
             CPU_ARCH=ppc
             ;;
     esac
     if test "`echo $CC | grep -c '\-arch '`" = "0"; then
         CC="$CC -arch $CPU_ARCH"
     fi
     ac_safe=`echo "crt_externs.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for crt_externs.h""... $ac_c" 1>&6
-echo "configure:3861: checking for crt_externs.h" >&5
+echo "configure:3869: checking for crt_externs.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3866 "configure"
+#line 3874 "configure"
 #include "confdefs.h"
 #include <crt_externs.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -4772,90 +4780,16 @@ EOF
         OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
         OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV'
         DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV'
     fi
     _DEBUG_FLAGS=-Zi
     _OPTIMIZE_FLAGS=-O2
     ;;
 
-*-ncr-sysv*)
-    cat >> confdefs.h <<\EOF
-#define XP_UNIX 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define SVR4 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define SYSV 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define NCR 1
-EOF
-
-    USE_NSPR_THREADS=1
-    if test "$OS_RELEASE" = "2.03"; then
-        cat >> confdefs.h <<\EOF
-#define _PR_STAT_HAS_ST_ATIM 1
-EOF
-
-    else
-        cat >> confdefs.h <<\EOF
-#define _PR_STAT_HAS_ST_ATIM_UNION 1
-EOF
-
-    fi
-
-    if test -z "$GNU_CC"; then
-        CFLAGS="$CFLAGS -Hnocopyr"
-        CXXFLAGS="$CXXFLAGS -Hnocopyr"
-    else
-        CFLAGS="$CFLAGS -fPIC -Wall"
-        CXXFLAGS="$CXXFLAGS -fPIC -Wall"
-        DSO_LDOPTS=-G
-    fi
-    MDCPUCFG_H=_ncr.cfg
-    PR_MD_CSRCS=ncr.c
-    ;;
-
-mips-nec-sysv*)
-    cat >> confdefs.h <<\EOF
-#define XP_UNIX 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define SVR4 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define __SVR4 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define NEC 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define nec_ews 1
-EOF
-
-    USE_NSPR_THREADS=1
-    if test -z "$GNU_CC"; then
-        CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
-        CXX=g++
-    fi
-    OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
-    DSO_LDOPTS=-G
-    MDCPUCFG_H=_nec.cfg
-    PR_MD_CSRCS=nec.c
-    ;;
-
 *-netbsd*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define NETBSD 1
 EOF
@@ -4887,79 +4821,16 @@ EOF
         fi
     fi
 
     if test "$LIBRUNPATH"; then
         DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
     fi
     ;;
 
-mips-sony-newsos*)
-    cat >> confdefs.h <<\EOF
-#define XP_UNIX 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define SONY 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define SYSV 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define SVR4 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define __svr4 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define __svr4__ 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define HAVE_SVID_GETTOD 1
-EOF
-
-    USE_NSPR_THREADS=1
-    CFLAGS="$CFLAGS -Xa -fullwarn"
-    CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
-    DSO_LDOPTS=-G
-    MDCPUCFG_H=_sony.cfg
-    PR_MD_CSRCS=sony.c
-    ;;
-
-*-nextstep*|*-openstep*)
-    cat >> confdefs.h <<\EOF
-#define XP_UNIX 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define NEXTSTEP 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define HAVE_BSD_FLOCK 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
-EOF
-
-    CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
-    CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
-    USE_NSPR_THREADS=1
-    DLL_SUFFIX=dylib
-    MDCPUCFG_H=_nextstep.cfg
-    PR_MD_CSRCS=nextstep.c
-    ;;
-
-
 *-nto*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define NTO 1
 EOF
@@ -5043,27 +4914,27 @@ EOF
     if test -z "$GNU_CC"; then
         CC="$CC -std1 -ieee_with_inexact"
         if test "$OS_RELEASE" != "V2.0"; then
             CC="$CC -readonly_strings"
         fi
         _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
         ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6
-echo "configure:5052: checking for machine/builtins.h" >&5
+echo "configure:4923: checking for machine/builtins.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5057 "configure"
+#line 4928 "configure"
 #include "confdefs.h"
 #include <machine/builtins.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -5181,106 +5052,16 @@ EOF
     CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
     USE_NSPR_THREADS=1
     CPU_ARCH=x86
     DSO_LDOPTS='-b elf -G'
     MDCPUCFG_H=_scoos.cfg
     PR_MD_SRCS=scoos.c
     ;;
 
-*-sinix*)
-    cat >> confdefs.h <<\EOF
-#define XP_UNIX 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define SVR4 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define SNI 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define RELIANTUNIX 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define sinix 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define HAVE_SVID_GETTOD 1
-EOF
-
-    if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
-        cat >> confdefs.h <<\EOF
-#define i386 1
-EOF
-
-        CPU_ARCH=x86
-    else
-        CPU_ARCH=mips
-    fi
-
-    if test "$GNU_CC"; then
-        AS='$(CC) -x assembler-with-cpp'
-        if test "$CPU_ARCH" = "mips"; then
-            LD=gld
-        fi
-        CFLAGS="$CFLAGS -Wall -Wno-format"
-    else
-        AS='/usr/bin/cc'
-        _OPTIMIZE_FLAGS='-O -F Olimit,4000'
-    fi
-
-    DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
-
-    if test "$OS_RELEASE" = "5.43"; then
-        cat >> confdefs.h <<\EOF
-#define IP_MULTICAST 1
-EOF
-
-    fi
-
-    OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
-    USE_NSPR_THREADS=1
-    MDCPUCFG_H=_reliantunix.cfg
-    PR_MD_CSRCS=reliantunix.c
-    if test "${OS_ARCH}" = "mips"; then
-        PR_MD_ASFILES=os_ReliantUNIX.s
-    fi
-    ;;
-
-*-sunos*)
-    cat >> confdefs.h <<\EOF
-#define XP_UNIX 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define SUNOS4 1
-EOF
-
-    CFLAGS="$CFLAGS -Wall -Wno-format"
-    if test "$USE_MDUPDATE"; then
-        CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
-    fi
-    CPU_ARCH=sparc
-    DLL_SUFFIX=so.1.0
-    DSO_LDOPTS=
-    DSO_CFLAGS=-fPIC
-    USE_NSPR_THREADS=1
-    if test "$OS_RELEASE" = "4.1.3_U1"; then
-        _OPTIMIZE_FLAGS=
-        OS_LIBS="$OS_LIBS -lm"
-    fi
-    MDCPUCFG_H=_sunos4.cfg
-    PR_MD_CSRCS=sunos4.c
-    ;;
-
 *-solaris*)
     if test -z "$USE_NSPR_THREADS"; then
         USE_PTHREADS=1
     fi
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
@@ -5702,63 +5483,63 @@ if test -z "$SKIP_LIBRARY_CHECKS"; then
 
 
 
 case $target in
 *-darwin*|*-beos*|*-os2*)
     ;;
 *)
     echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:5711: checking for dlopen in -ldl" >&5
+echo "configure:5492: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5719 "configure"
+#line 5500 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char dlopen();
 
 int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:5730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
 LIBS="$ac_save_LIBS"
 
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-echo "configure:5747: checking for dlfcn.h" >&5
+echo "configure:5528: checking for dlfcn.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5752 "configure"
+#line 5533 "configure"
 #include "confdefs.h"
 #include <dlfcn.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -5781,23 +5562,23 @@ fi
     ;;
 esac
 
 
 
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:5790: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:5571: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 5796 "configure"
+#line 5577 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "$ac_pattern" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=yes
@@ -5805,17 +5586,17 @@ else
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=no
 fi
 rm -f conftest*
 
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 5814 "configure"
+#line 5595 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "$ac_pattern" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=yes
@@ -5831,22 +5612,22 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional
   fi
 fi
 
 _SAVE_LIBS="$LIBS"
 LIBS="$LIBS $OS_LIBS"
 for ac_func in lchown strerror dladdr
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5840: checking for $ac_func" >&5
+echo "configure:5621: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5845 "configure"
+#line 5626 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char $ac_func();
@@ -5859,17 +5640,17 @@ int main() {
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
 $ac_func();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:5868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
@@ -5911,17 +5692,17 @@ if test "$CCACHE" != "no"; then
             fi
         fi
     fi
     for ac_prog in $CCACHE ccache
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5920: checking for $ac_word" >&5
+echo "configure:5701: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CCACHE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   case "$CCACHE" in
   /*)
   ac_cv_path_CCACHE="$CCACHE" # Let the user override the test with a path.
   ;;
   ?:/*)			 
@@ -5970,17 +5751,17 @@ if test "${enable_strip+set}" = set; the
 fi
 
 
 case "${target_os}" in
 hpux*)
 if test -z "$GNU_CC"; then
 
     echo $ac_n "checking for +Olit support""... $ac_c" 1>&6
-echo "configure:5979: checking for +Olit support" >&5
+echo "configure:5760: checking for +Olit support" >&5
 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
                   ac_cv_hpux_usable_olit_option=no
         rm -f conftest*
         echo 'int main() { return 0; }' | cat > conftest.c
         ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
         if test $? -eq 0; then
@@ -6012,17 +5793,17 @@ darwin*)
     _HAVE_PTHREADS=1
     ;;
 wince*)
     _HAVE_PTHREADS=
     ;;
 *)
     
 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:6021: checking for pthread_create in -lpthreads" >&5
+echo "configure:5802: checking for pthread_create in -lpthreads" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -6034,17 +5815,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:6043: checking for pthread_create in -lpthread" >&5
+echo "configure:5824: checking for pthread_create in -lpthread" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -6056,17 +5837,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:6065: checking for pthread_create in -lc_r" >&5
+echo "configure:5846: checking for pthread_create in -lc_r" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -6078,17 +5859,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
-echo "configure:6087: checking for pthread_create in -lc" >&5
+echo "configure:5868: checking for pthread_create in -lc" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -6196,17 +5977,17 @@ if test "${enable_ipv6+set}" = set; then
       fi
 fi
 
 
 if test -n "$USE_PTHREADS"; then
       rm -f conftest*
    ac_cv_have_dash_pthread=no
    echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
-echo "configure:6205: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:5986: checking whether ${CC-cc} accepts -pthread" >&5
    echo 'int main() { return 0; }' | cat > conftest.c
    ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
    if test $? -eq 0; then
 	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 	    ac_cv_have_dash_pthread=yes
 		case "$target_os" in
 	    freebsd*)
 # Freebsd doesn't use -pthread for compiles, it uses them for linking
@@ -6219,17 +6000,17 @@ echo "configure:6205: checking whether $
 	fi
     fi
     rm -f conftest*
     echo "$ac_t""$ac_cv_have_dash_pthread" 1>&6
 
 			    ac_cv_have_dash_pthreads=no
     if test "$ac_cv_have_dash_pthread" = "no"; then
 	    echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
-echo "configure:6228: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:6009: checking whether ${CC-cc} accepts -pthreads" >&5
     	echo 'int main() { return 0; }' | cat > conftest.c
 	    ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
     	if test $? -eq 0; then
 	    	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 			    ac_cv_have_dash_pthreads=yes
 			    CFLAGS="$CFLAGS -pthreads"
 			    CXXFLAGS="$CXXFLAGS -pthreads"
 		    fi
@@ -6804,17 +6585,17 @@ trap 'rm -f $CONFIG_STATUS conftest*; ex
 # Protect against Makefile macro expansion.
 cat > conftest.defs <<\EOF
 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
 s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
 s%\[%\\&%g
 s%\]%\\&%g
 s%\$%$$%g
 EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' ' | tr '\015' ' '` # Manually modified for MKS support.
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
 rm -f conftest.defs
 
 
 # Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
 rm -f $CONFIG_STATUS
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -10,17 +10,17 @@ AC_INIT(config/libc_r.h)
 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
 AC_CANONICAL_SYSTEM
 
 dnl ========================================================
 dnl = Defaults
 dnl ========================================================
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=9
-MOD_PATCH_VERSION=2
+MOD_PATCH_VERSION=5
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
 USE_CPLUS=
@@ -122,17 +122,17 @@ AC_ARG_WITH(android-platform,
                           location of platform dir],
     android_platform=$withval)
 
 case "$target" in
 arm-linux*-android*|*-linuxandroid*)
     android_tool_prefix="arm-linux-androideabi"
     ;;
 i?86-*android*)
-    android_tool_prefix="i686-android-linux"
+    android_tool_prefix="i686-linux-android"
     ;;
 mipsel-*android*)
     android_tool_prefix="mipsel-linux-android"
     ;;
 *)
     android_tool_prefix="$target_os"
     ;;
 esac
@@ -216,16 +216,27 @@ case "$target" in
 
         if test -d "$android_platform" ; then
             AC_MSG_RESULT([$android_platform])
         else
             AC_MSG_ERROR([not found. You have to specify --with-android-platform=/path/to/ndk/platform.])
         fi
     fi
 
+    dnl Old NDK support. If minimum requirement is changed to NDK r8b,
+    dnl please remove this.
+    case "$target_cpu" in
+    i?86)
+        if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then
+            dnl Old NDK toolchain name
+            android_tool_prefix="i686-android-linux"
+        fi
+        ;;
+    esac
+
     dnl set up compilers
     AS="$android_toolchain"/bin/"$android_tool_prefix"-as
     CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
     CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
     CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
     LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
     AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
     RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
@@ -2060,57 +2071,16 @@ tools are selected during the Xcode/Deve
         OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
         OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV'
         DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV'
     fi
     _DEBUG_FLAGS=-Zi
     _OPTIMIZE_FLAGS=-O2
     ;;
 
-*-ncr-sysv*)
-    AC_DEFINE(XP_UNIX)
-    AC_DEFINE(SVR4)
-    AC_DEFINE(SYSV)
-    AC_DEFINE(NCR)
-    USE_NSPR_THREADS=1
-    if test "$OS_RELEASE" = "2.03"; then
-        AC_DEFINE(_PR_STAT_HAS_ST_ATIM)
-    else
-        AC_DEFINE(_PR_STAT_HAS_ST_ATIM_UNION)
-    fi
-
-    if test -z "$GNU_CC"; then
-        CFLAGS="$CFLAGS -Hnocopyr"
-        CXXFLAGS="$CXXFLAGS -Hnocopyr"
-    else
-        CFLAGS="$CFLAGS -fPIC -Wall"
-        CXXFLAGS="$CXXFLAGS -fPIC -Wall"
-        DSO_LDOPTS=-G
-    fi
-    MDCPUCFG_H=_ncr.cfg
-    PR_MD_CSRCS=ncr.c
-    ;;
-
-mips-nec-sysv*)
-    AC_DEFINE(XP_UNIX)
-    AC_DEFINE(SVR4)
-    AC_DEFINE(__SVR4)
-    AC_DEFINE(NEC)
-    AC_DEFINE(nec_ews)
-    USE_NSPR_THREADS=1
-    if test -z "$GNU_CC"; then
-        CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
-        CXX=g++
-    fi
-    OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
-    DSO_LDOPTS=-G
-    MDCPUCFG_H=_nec.cfg
-    PR_MD_CSRCS=nec.c
-    ;;
-
 *-netbsd*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(NETBSD)
     AC_DEFINE(HAVE_BSD_FLOCK)
     if test -z "$USE_NSPR_THREADS"; then
         USE_PTHREADS=1
     fi
     MDCPUCFG_H=_netbsd.cfg
@@ -2133,46 +2103,16 @@ mips-nec-sysv*)
         fi
     fi
 
     if test "$LIBRUNPATH"; then
         DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
     fi
     ;;
 
-mips-sony-newsos*)
-    AC_DEFINE(XP_UNIX)
-    AC_DEFINE(SONY)
-    AC_DEFINE(SYSV)
-    AC_DEFINE(SVR4)
-    AC_DEFINE(__svr4)
-    AC_DEFINE(__svr4__)
-    AC_DEFINE(HAVE_SVID_GETTOD)
-    USE_NSPR_THREADS=1
-    CFLAGS="$CFLAGS -Xa -fullwarn"
-    CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
-    DSO_LDOPTS=-G
-    MDCPUCFG_H=_sony.cfg
-    PR_MD_CSRCS=sony.c
-    ;;
-
-*-nextstep*|*-openstep*)
-    AC_DEFINE(XP_UNIX)
-    AC_DEFINE(NEXTSTEP)
-    AC_DEFINE(HAVE_BSD_FLOCK)
-    AC_DEFINE(_POSIX_SOURCE)
-    CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
-    CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
-    USE_NSPR_THREADS=1
-    DLL_SUFFIX=dylib
-    MDCPUCFG_H=_nextstep.cfg
-    PR_MD_CSRCS=nextstep.c
-    ;;
-
-
 *-nto*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(NTO)
     AC_DEFINE(_QNX_SOURCE)
     AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
     MDCPUCFG_H=_nto.cfg
     PR_MD_CSRCS=nto.c
     MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
@@ -2275,76 +2215,16 @@ mips-sony-newsos*)
     CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
     USE_NSPR_THREADS=1
     CPU_ARCH=x86
     DSO_LDOPTS='-b elf -G'
     MDCPUCFG_H=_scoos.cfg
     PR_MD_SRCS=scoos.c
     ;;
 
-*-sinix*)
-    AC_DEFINE(XP_UNIX)
-    AC_DEFINE(SVR4)
-    AC_DEFINE(SNI)
-    AC_DEFINE(RELIANTUNIX)
-    AC_DEFINE(sinix)
-    AC_DEFINE(HAVE_SVID_GETTOD)
-    if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
-        AC_DEFINE(i386)
-        CPU_ARCH=x86
-    else
-        CPU_ARCH=mips
-    fi
-
-    if test "$GNU_CC"; then
-        AS='$(CC) -x assembler-with-cpp'
-        if test "$CPU_ARCH" = "mips"; then
-            LD=gld
-        fi
-        CFLAGS="$CFLAGS -Wall -Wno-format"
-    else
-        AS='/usr/bin/cc'
-        _OPTIMIZE_FLAGS='-O -F Olimit,4000'
-    fi
-
-    DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
-
-    if test "$OS_RELEASE" = "5.43"; then
-        AC_DEFINE(IP_MULTICAST)
-    fi
-
-    OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
-    USE_NSPR_THREADS=1
-    MDCPUCFG_H=_reliantunix.cfg
-    PR_MD_CSRCS=reliantunix.c
-    if test "${OS_ARCH}" = "mips"; then
-        PR_MD_ASFILES=os_ReliantUNIX.s
-    fi
-    ;;
-
-*-sunos*)
-    AC_DEFINE(XP_UNIX)
-    AC_DEFINE(SUNOS4)
-    CFLAGS="$CFLAGS -Wall -Wno-format"
-    if test "$USE_MDUPDATE"; then
-        CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
-    fi
-    CPU_ARCH=sparc
-    DLL_SUFFIX=so.1.0
-    DSO_LDOPTS=
-    DSO_CFLAGS=-fPIC
-    USE_NSPR_THREADS=1
-    if test "$OS_RELEASE" = "4.1.3_U1"; then
-        _OPTIMIZE_FLAGS=
-        OS_LIBS="$OS_LIBS -lm"
-    fi
-    MDCPUCFG_H=_sunos4.cfg
-    PR_MD_CSRCS=sunos4.c
-    ;;
-
 *-solaris*)
     if test -z "$USE_NSPR_THREADS"; then
         USE_PTHREADS=1
     fi
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(SVR4)
     AC_DEFINE(SYSV)
     AC_DEFINE(__svr4)
--- a/nsprpub/lib/ds/Makefile.in
+++ b/nsprpub/lib/ds/Makefile.in
@@ -68,23 +68,20 @@ endif
 ifeq ($(OS_ARCH),OS2)
 MAPFILE = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).def
 GARBAGE += $(MAPFILE)
 MKSHLIB += $(MAPFILE)
 endif
 
 EXTRA_LIBS = $(LIBNSPR)
 
-# On NCR and SCOOS, we can't link with extra libraries when
+# On SCOOS, we can't link with extra libraries when
 # we build a shared library.  If we do so, the linker doesn't
 # complain, but we would run into weird problems at run-time.
 # Therefore on these platforms, we link just the .o files.
-ifeq ($(OS_ARCH),NCR)
-EXTRA_LIBS =
-endif
 ifeq ($(OS_ARCH),SCOOS)
 EXTRA_LIBS =
 endif
 
 ifdef RESOLVE_LINK_SYMBOLS
 EXTRA_LIBS += $(OS_LIBS)
 endif
 
--- a/nsprpub/lib/libc/src/Makefile.in
+++ b/nsprpub/lib/libc/src/Makefile.in
@@ -77,23 +77,20 @@ endif
 ifeq ($(OS_ARCH),OS2)
 MAPFILE = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).def
 GARBAGE += $(MAPFILE)
 MKSHLIB += $(MAPFILE)
 endif
 
 EXTRA_LIBS = $(LIBNSPR)
 
-# On NCR and SCOOS, we can't link with extra libraries when
+# On SCOOS, we can't link with extra libraries when
 # we build a shared library.  If we do so, the linker doesn't
 # complain, but we would run into weird problems at run-time.
 # Therefore on these platforms, we link just the .o files.
-ifeq ($(OS_ARCH),NCR)
-EXTRA_LIBS =
-endif
 ifeq ($(OS_ARCH),SCOOS)
 EXTRA_LIBS =
 endif
 
 ifdef RESOLVE_LINK_SYMBOLS
 EXTRA_LIBS += $(OS_LIBS)
 endif
 
--- a/nsprpub/lib/prstreams/Makefile.in
+++ b/nsprpub/lib/prstreams/Makefile.in
@@ -72,23 +72,20 @@ ifeq ($(OS_ARCH),BeOS)
 endif
 
 ifeq ($(OS_ARCH), UNIXWARE)
     OS_LIBS += -lC
 endif
 
 EXTRA_LIBS = $(LIBNSPR)
 
-# On NCR and SCOOS, we can't link with extra libraries when
+# On SCOOS, we can't link with extra libraries when
 # we build a shared library.  If we do so, the linker doesn't
 # complain, but we would run into weird problems at run-time.
 # Therefore on these platforms, we link just the object files.
-ifeq ($(OS_ARCH),NCR)
-    EXTRA_LIBS =
-endif
 ifeq ($(OS_ARCH),SCOOS)
     EXTRA_LIBS =
 endif
 
 ifdef RESOLVE_LINK_SYMBOLS
 EXTRA_LIBS += $(OS_LIBS)
 endif
 
--- a/nsprpub/lib/prstreams/tests/testprstrm/Makefile.in
+++ b/nsprpub/lib/prstreams/tests/testprstrm/Makefile.in
@@ -78,48 +78,28 @@ LIBPRSTRMS = -lprstrms$(MOD_MAJOR_VERSIO
 else
 LDOPTS += -brtl
 EXTRA_LIBS = -ldl
 endif
 endif
 
 # Solaris
 ifeq ($(OS_ARCH), SunOS)
-ifneq ($(OS_RELEASE), 4.1.3_U1)
 ifdef NS_USE_GCC
 LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
 else
 LDOPTS += -R $(PWD)/$(dist_libdir)
 # CC on SunOS 5.5.x needs to link with -lpthread even though we already
 # linked with this system library when we built libnspr.so.
 ifdef USE_PTHREADS
 EXTRA_LIBS = -lpthread
 endif # USE_PTHREADS
 endif # NS_USE_GCC
-endif # 4.1.3_U1
 endif # SunOS
 
-ifeq ($(OS_ARCH), NCR)
-# XXX: We see some strange problems when we link with libnspr.so.
-# So for now we use static libraries on NCR.  The shared library
-# stuff below is commented out.
-LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
-LIBPRSTRMS = $(dist_libdir)/libprstrms$(MOD_MAJOR_VERSION).a
-EXTRA_LIBS = -lsocket -lnsl -ldl
-
-# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
-# implicitly by $(CC)) again even though we already linked with these
-# system libraries when we built libnspr.so.
-#EXTRA_LIBS = -lsocket -lnsl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
-# option for ld on other platforms.
-#export LD_RUN_PATH = $(PWD)/$(dist_libdir)
-endif
-
 ifeq ($(OS_ARCH), SCOOS)
 # SCO Unix needs to link against -lsocket again even though we
 # already linked with these system libraries when we built libnspr.so.
 EXTRA_LIBS = -lsocket
 # This hardcodes in the executable programs the directory to find
 # libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
 # option for ld on other platforms.
 export LD_RUN_PATH = $(PWD)/$(dist_libdir)
--- a/nsprpub/lib/tests/Makefile.in
+++ b/nsprpub/lib/tests/Makefile.in
@@ -97,44 +97,31 @@ endif
 ifeq ($(OS_ARCH),AIX)
 LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
 LIBPR = -lnspr$(MOD_MAJOR_VERSION)_shr
 LIBPLC = -lplc$(MOD_MAJOR_VERSION)_shr
 endif
 
 # Solaris
 ifeq ($(OS_ARCH), SunOS)
-ifneq ($(OS_RELEASE), 4.1.3_U1)
 ifdef NS_USE_GCC
 LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
 else
 LDOPTS += -R $(PWD)/$(dist_libdir)
 endif
-endif
 
 # SunOS 5.5 needs to link with -lpthread, even though we already
 # linked with this system library when we built libnspr.so.
 ifeq ($(OS_RELEASE), 5.5)
 ifdef USE_PTHREADS
 EXTRA_LIBS = -lpthread
 endif
 endif
 endif # SunOS
 
-ifeq ($(OS_ARCH), NCR)
-# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
-# implicitly by $(CC)) again even though we already linked with these
-# system libraries when we built libnspr.so.
-EXTRA_LIBS = -lsocket -lnsl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
-# option for ld on other platforms.
-export LD_RUN_PATH = $(PWD)/$(dist_libdir)
-endif
-
 #####################################################
 #
 # The rules
 #
 #####################################################
 
 include $(topsrcdir)/config/rules.mk
 
--- a/nsprpub/pr/include/gencfg.c
+++ b/nsprpub/pr/include/gencfg.c
@@ -7,25 +7,19 @@
 
 #if defined(sgi)
 #ifndef IRIX
 	error - IRIX is not defined
 #endif
 #endif
 
 #if defined(__sun)
-#if defined(__svr4) || defined(__svr4__) || defined(__SVR4)
 #ifndef SOLARIS
 	error - SOLARIS is not defined
 #endif
-#else
-#ifndef SUNOS4
-	error - SUNOS4 is not defined
-#endif
-#endif
 #endif
 
 #if defined(__hpux)
 #ifndef HPUX
 	error - HPUX is not defined
 #endif
 #endif
 
@@ -65,34 +59,28 @@
 #endif
 
 #if defined(__APPLE__)
 #ifndef DARWIN
       error - DARWIN is not defined
 #endif
 #endif
 
-#if defined(__NeXT__)
-#ifndef NEXTSTEP
-      error - NEXTSTEP is not defined
-#endif
-#endif
-
 /************************************************************************/
 
 /* Generate cpucfg.h */
 
 #ifdef XP_PC
 #ifdef WIN32
 #define INT64	_PRInt64
 #else
 #define INT64	long
 #endif
 #else
-#if defined(HPUX) || defined(NECSVR4) || defined(SCO) || defined(UNIXWARE) || defined (NCR)
+#if defined(HPUX) || defined(SCO) || defined(UNIXWARE)
 #define INT64	long
 #else
 #define INT64	long long
 #endif
 #endif
 
 struct align_short {
     char c;
--- a/nsprpub/pr/include/md/_aix.h
+++ b/nsprpub/pr/include/md/_aix.h
@@ -50,25 +50,26 @@
 #endif
 #endif
 #define _PR_HAVE_SYSV_SEMAPHORES
 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
 #define _PR_ACCEPT_INHERIT_NONBLOCK
 
 /* Timer operations */
 #if defined(AIX_TIMERS)
+#define _MD_INTERVAL_INIT()
+
 extern PRIntervalTime _MD_AixGetInterval(void);
 #define _MD_GET_INTERVAL _MD_AixGetInterval
 
 extern PRIntervalTime _MD_AixIntervalPerSec(void);
 #define _MD_INTERVAL_PER_SEC _MD_AixIntervalPerSec
 
 #else  /* defined(AIX_TIMERS) */
-#define _MD_GET_INTERVAL        _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC    _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 #endif  /* defined(AIX_TIMERS) */
 
 #ifdef AIX_HAVE_ATOMIC_OP_H
 /* The atomic operations */
 #include <sys/atomic_op.h>
 #define _PR_HAVE_ATOMIC_OPS
 #ifndef IS_64
 #define _PR_HAVE_ATOMIC_CAS
--- a/nsprpub/pr/include/md/_bsdi.h
+++ b/nsprpub/pr/include/md/_bsdi.h
@@ -171,12 +171,11 @@ struct _MDCPU {
 #endif /* ! _PR_PTHREADS */
 
 #define _MD_EARLY_INIT          _MD_EarlyInit
 #define _MD_FINAL_INIT			_PR_UnixInit
 
 #include <sys/syscall.h>
 #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
 
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 
 #endif /* nspr_bsdi_defs_h___ */
--- a/nsprpub/pr/include/md/_darwin.h
+++ b/nsprpub/pr/include/md/_darwin.h
@@ -275,22 +275,24 @@ extern void _MD_SET_PRIORITY(struct _MDT
 extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
 extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
 extern void _MD_YIELD(void);
 
 #endif /* ! _PR_PTHREADS */
 
 #define _MD_EARLY_INIT          _MD_EarlyInit
 #define _MD_FINAL_INIT			_PR_UnixInit
-#define _MD_GET_INTERVAL        _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC    _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_INIT       _PR_Mach_IntervalInit
+#define _MD_GET_INTERVAL        _PR_Mach_GetInterval
+#define _MD_INTERVAL_PER_SEC    _PR_Mach_TicksPerSecond
 
 extern void             _MD_EarlyInit(void);
-extern PRIntervalTime   _PR_UNIX_GetInterval(void);
-extern PRIntervalTime   _PR_UNIX_TicksPerSecond(void);
+extern void             _PR_Mach_IntervalInit(void);
+extern PRIntervalTime   _PR_Mach_GetInterval(void);
+extern PRIntervalTime   _PR_Mach_TicksPerSecond(void);
 
 /*
  * We wrapped the select() call.  _MD_SELECT refers to the built-in,
  * unwrapped version.
  */
 #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
 
 /* For writev() */
--- a/nsprpub/pr/include/md/_dgux.h
+++ b/nsprpub/pr/include/md/_dgux.h
@@ -153,18 +153,17 @@ struct _MDCPU {
 #define _MD_IOQ_LOCK()
 #define _MD_IOQ_UNLOCK()
 
 /*
  * The following are copied from _sunos.h, _aix.h.  This means
  * some of them should probably be moved into _unixos.h.  But
  * _irix.h seems to be quite different in regard to these macros.
  */
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 
 #define _MD_EARLY_INIT		_MD_EarlyInit
 #define _MD_FINAL_INIT		_PR_UnixInit
 #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
 #define _MD_INIT_THREAD         _MD_InitializeThread
 #define _MD_EXIT_THREAD(thread)
 #define	_MD_SUSPEND_THREAD(thread)
 #define	_MD_RESUME_THREAD(thread)
--- a/nsprpub/pr/include/md/_freebsd.h
+++ b/nsprpub/pr/include/md/_freebsd.h
@@ -210,23 +210,20 @@ extern PRStatus _MD_CREATE_THREAD(
 extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
 extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
 extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
 extern void _MD_YIELD(void);
 
 #endif /* ! _PR_PTHREADS */
 
 extern void _MD_EarlyInit(void);
-extern PRIntervalTime _PR_UNIX_GetInterval(void);
-extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
 
 #define _MD_EARLY_INIT                  _MD_EarlyInit
 #define _MD_FINAL_INIT			_PR_UnixInit
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 
 /*
  * We wrapped the select() call.  _MD_SELECT refers to the built-in,
  * unwrapped version.
  */
 #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
 
 #if defined(_PR_POLL_AVAILABLE)
--- a/nsprpub/pr/include/md/_hpux.h
+++ b/nsprpub/pr/include/md/_hpux.h
@@ -264,18 +264,17 @@ struct _MDCPU {
 
 #if defined(HPUX_LW_TIMER)
 extern void _PR_HPUX_LW_IntervalInit(void);
 extern PRIntervalTime _PR_HPUX_LW_GetInterval(void);
 #define _MD_INTERVAL_INIT                 _PR_HPUX_LW_IntervalInit
 #define _MD_GET_INTERVAL                  _PR_HPUX_LW_GetInterval
 #define _MD_INTERVAL_PER_SEC()            1000
 #else
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 #endif
 
 /*
  * We wrapped the select() call.  _MD_SELECT refers to the built-in,
  * unwrapped version.
  */
 #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
 
--- a/nsprpub/pr/include/md/_linux.cfg
+++ b/nsprpub/pr/include/md/_linux.cfg
@@ -207,16 +207,63 @@
 #define PR_ALIGN_OF_POINTER 8
 #define PR_ALIGN_OF_WORD    8
 
 #define PR_BYTES_PER_WORD_LOG2  3
 #define PR_BYTES_PER_DWORD_LOG2 3
 
 #elif defined(__x86_64__)
 
+#ifdef __ILP32__
+
+#define IS_LITTLE_ENDIAN 1
+#undef  IS_BIG_ENDIAN
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   4
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   4
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    32
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    32
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   5
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   5
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    4
+#define PR_ALIGN_OF_INT64   4
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  4
+#define PR_ALIGN_OF_POINTER 4
+#define PR_ALIGN_OF_WORD    4
+
+#define PR_BYTES_PER_WORD_LOG2   2
+#define PR_BYTES_PER_DWORD_LOG2  3
+
+#else
+
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #define IS_64
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
 #define PR_BYTES_PER_INT64  8
@@ -251,16 +298,18 @@
 #define PR_ALIGN_OF_FLOAT   4
 #define PR_ALIGN_OF_DOUBLE  8
 #define PR_ALIGN_OF_POINTER 8
 #define PR_ALIGN_OF_WORD    8
 
 #define PR_BYTES_PER_WORD_LOG2  3
 #define PR_BYTES_PER_DWORD_LOG2 3
 
+#endif
+
 #elif defined(__mc68000__)
 
 #undef  IS_LITTLE_ENDIAN
 #define IS_BIG_ENDIAN 1
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
--- a/nsprpub/pr/include/md/_linux.h
+++ b/nsprpub/pr/include/md/_linux.h
@@ -621,23 +621,20 @@ extern PRStatus _MD_CREATE_THREAD(
 extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
 extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
 extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
 extern void _MD_YIELD(void);
 
 #endif /* ! _PR_PTHREADS */
 
 extern void _MD_EarlyInit(void);
-extern PRIntervalTime _PR_UNIX_GetInterval(void);
-extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
 
 #define _MD_EARLY_INIT                  _MD_EarlyInit
 #define _MD_FINAL_INIT                  _PR_UnixInit
-#define _MD_GET_INTERVAL                _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC            _PR_UNIX_TicksPerSecond
+#define HAVE_CLOCK_MONOTONIC
 
 /*
  * We wrapped the select() call.  _MD_SELECT refers to the built-in,
  * unwrapped version.
  */
 #define _MD_SELECT __select
 
 #ifdef _PR_POLL_AVAILABLE
deleted file mode 100644
--- a/nsprpub/pr/include/md/_ncr.cfg
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_cpucfg___
-#define nspr_cpucfg___
-
-#ifndef XP_UNIX
-#define XP_UNIX
-#endif
-
-#ifndef NCR
-#define NCR
-#endif
-
-#define IS_LITTLE_ENDIAN 1
-#undef  IS_BIG_ENDIAN
-#undef	HAVE_LONG_LONG
-#undef	HAVE_ALIGNED_DOUBLES
-#undef	HAVE_ALIGNED_LONGLONGS
-
-#define PR_BYTES_PER_BYTE   1
-#define PR_BYTES_PER_SHORT  2
-#define PR_BYTES_PER_INT    4
-#define PR_BYTES_PER_INT64  8
-#define PR_BYTES_PER_LONG   4
-#define PR_BYTES_PER_FLOAT  4
-#define PR_BYTES_PER_DOUBLE 8
-#define PR_BYTES_PER_WORD   4
-#define PR_BYTES_PER_DWORD  8
-#define PR_BYTES_PER_WORD_LOG2   2
-#define PR_BYTES_PER_DWORD_LOG2  3
-
-#define PR_BITS_PER_BYTE    8
-#define PR_BITS_PER_SHORT   16
-#define PR_BITS_PER_INT     32
-#define PR_BITS_PER_INT64   64
-#define PR_BITS_PER_LONG    32
-#define PR_BITS_PER_FLOAT   32
-#define PR_BITS_PER_DOUBLE  64
-#define PR_BITS_PER_WORD    32
-
-#define PR_BITS_PER_BYTE_LOG2   3
-#define PR_BITS_PER_SHORT_LOG2  4
-#define PR_BITS_PER_INT_LOG2    5
-#define PR_BITS_PER_INT64_LOG2  6
-#define PR_BITS_PER_LONG_LOG2   5
-#define PR_BITS_PER_FLOAT_LOG2  5
-#define PR_BITS_PER_DOUBLE_LOG2 6
-#define PR_BITS_PER_WORD_LOG2   5
-
-#define PR_ALIGN_OF_SHORT   2
-#define PR_ALIGN_OF_INT     4
-#define PR_ALIGN_OF_LONG    4
-#define PR_ALIGN_OF_INT64   4
-#define PR_ALIGN_OF_FLOAT   4
-#define PR_ALIGN_OF_DOUBLE  4
-#define PR_ALIGN_OF_POINTER 4
-
-#define _PR_POLL_BACKCOMPAT
-
-#ifndef NO_NSPR_10_SUPPORT
-
-#define BYTES_PER_BYTE		PR_BYTES_PER_BYTE
-#define BYTES_PER_SHORT 	PR_BYTES_PER_SHORT
-#define BYTES_PER_INT 		PR_BYTES_PER_INT
-#define BYTES_PER_INT64		PR_BYTES_PER_INT64
-#define BYTES_PER_LONG		PR_BYTES_PER_LONG
-#define BYTES_PER_FLOAT		PR_BYTES_PER_FLOAT
-#define BYTES_PER_DOUBLE	PR_BYTES_PER_DOUBLE
-#define BYTES_PER_WORD		PR_BYTES_PER_WORD
-#define BYTES_PER_DWORD		PR_BYTES_PER_DWORD
-
-#define BITS_PER_BYTE		PR_BITS_PER_BYTE
-#define BITS_PER_SHORT		PR_BITS_PER_SHORT
-#define BITS_PER_INT		PR_BITS_PER_INT
-#define BITS_PER_INT64		PR_BITS_PER_INT64
-#define BITS_PER_LONG		PR_BITS_PER_LONG
-#define BITS_PER_FLOAT		PR_BITS_PER_FLOAT
-#define BITS_PER_DOUBLE		PR_BITS_PER_DOUBLE
-#define BITS_PER_WORD		PR_BITS_PER_WORD
-
-#define BITS_PER_BYTE_LOG2	PR_BITS_PER_BYTE_LOG2
-#define BITS_PER_SHORT_LOG2	PR_BITS_PER_SHORT_LOG2
-#define BITS_PER_INT_LOG2	PR_BITS_PER_INT_LOG2
-#define BITS_PER_INT64_LOG2	PR_BITS_PER_INT64_LOG2
-#define BITS_PER_LONG_LOG2	PR_BITS_PER_LONG_LOG2
-#define BITS_PER_FLOAT_LOG2	PR_BITS_PER_FLOAT_LOG2
-#define BITS_PER_DOUBLE_LOG2 	PR_BITS_PER_DOUBLE_LOG2
-#define BITS_PER_WORD_LOG2	PR_BITS_PER_WORD_LOG2
-
-#define ALIGN_OF_SHORT		PR_ALIGN_OF_SHORT
-#define ALIGN_OF_INT		PR_ALIGN_OF_INT
-#define ALIGN_OF_LONG		PR_ALIGN_OF_LONG
-#define ALIGN_OF_INT64		PR_ALIGN_OF_INT64
-#define ALIGN_OF_FLOAT		PR_ALIGN_OF_FLOAT
-#define ALIGN_OF_DOUBLE		PR_ALIGN_OF_DOUBLE
-#define ALIGN_OF_POINTER	PR_ALIGN_OF_POINTER
-#define ALIGN_OF_WORD		PR_ALIGN_OF_WORD
-
-#define BYTES_PER_WORD_LOG2	PR_BYTES_PER_WORD_LOG2
-#define BYTES_PER_DWORD_LOG2	PR_BYTES_PER_DWORD_LOG2
-#define WORDS_PER_DWORD_LOG2	PR_WORDS_PER_DWORD_LOG2
-
-#endif /* NO_NSPR_10_SUPPORT */
-
-#endif /* nspr_cpucfg___ */
deleted file mode 100644
--- a/nsprpub/pr/include/md/_ncr.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_unixware_defs_h___
-#define nspr_unixware_defs_h___
-
-/*
- * Internal configuration macros
- */
-
-#define PR_LINKER_ARCH	"ncr"
-#define _PR_SI_SYSNAME		"NCR"
-#define _PR_SI_ARCHITECTURE	"x86"
-#define PR_DLL_SUFFIX		".so"
-
-#define _PR_VMBASE	 	0x30000000
-#define _PR_STACK_VMBASE	0x50000000
-#define _MD_DEFAULT_STACK_SIZE	65536L
-#define _MD_MMAP_FLAGS          MAP_PRIVATE
-
-#define	HAVE_DLL
-#define	USE_DLFCN
-#define _PR_RECV_BROKEN /* recv doesn't work on Unix Domain Sockets */
-
-#if !defined (HAVE_STRERROR)
-#define HAVE_STRERROR
-#endif
-
-#ifndef	HAVE_WEAK_IO_SYMBOLS
-#define	HAVE_WEAK_IO_SYMBOLS
-#endif
-
-#define _PR_POLL_AVAILABLE
-#define _PR_USE_POLL
-#define _PR_NO_LARGE_FILES
-
-#undef  HAVE_STACK_GROWING_UP
-#define HAVE_NETCONFIG
-#define NEED_STRFTIME_LOCK
-#define NEED_TIME_R
-#define NEED_LOCALTIME_R
-#define NEED_GMTIME_R  
-#define NEED_ASCTIME_R
-#define NEED_STRTOK_R
-#define NEED_CTIME_R
-#define _PR_NEED_STRCASECMP
-
-#define USE_SETJMP
-
-#include <setjmp.h>
-
-#define _SETJMP setjmp
-#define _LONGJMP longjmp
-#define _PR_CONTEXT_TYPE         jmp_buf
-#define _MD_GET_SP(_t)           (_t)->md.context[4]
-#define _PR_NUM_GCREGS	_JBLEN
-
-#define CONTEXT(_th) ((_th)->md.context)
-
-/*
-** Initialize the thread context preparing it to execute _main.
-*/
-#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
-{								  \
-    *status = PR_TRUE; \
-    if(_SETJMP(CONTEXT(_thread))) (*_main)(); \
-    _MD_GET_SP(_thread) = (int) ((_sp) - 128); \
-}
-
-#define _MD_SWITCH_CONTEXT(_thread)  \
-    if (!_SETJMP(CONTEXT(_thread))) { \
-	(_thread)->md.errcode = errno;  \
-	_PR_Schedule();		     \
-    }
-
-/*
-** Restore a thread context, saved by _MD_SWITCH_CONTEXT
-*/
-#define _MD_RESTORE_CONTEXT(_thread) \
-{				     \
-    errno = (_thread)->md.errcode;	     \
-    _MD_SET_CURRENT_THREAD(_thread); \
-    _LONGJMP(CONTEXT(_thread), 1);    \
-}
-
-/* Machine-dependent (MD) data structures.
- * Don't use SVR4 native threads (yet). 
- */
-
-struct _MDThread {
-    _PR_CONTEXT_TYPE context;
-    int id;
-    int errcode;
-};
-
-struct _MDThreadStack {
-    PRInt8 notused;
-};
-
-struct _MDLock {
-    PRInt8 notused;
-};
-
-struct _MDSemaphore {
-    PRInt8 notused;
-};
-
-struct _MDCVar {
-    PRInt8 notused;
-};
-
-struct _MDSegment {
-    PRInt8 notused;
-};
-
-/*
- * md-specific cpu structure field
- */
-#define _PR_MD_MAX_OSFD FD_SETSIZE
-
-struct _MDCPU_Unix {
-    PRCList ioQ;
-    PRUint32 ioq_timeout;
-    PRInt32 ioq_max_osfd;
-    PRInt32 ioq_osfd_cnt;
-#ifndef _PR_USE_POLL
-    fd_set fd_read_set, fd_write_set, fd_exception_set;
-    PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
-				fd_exception_cnt[_PR_MD_MAX_OSFD];
-#else
-	struct pollfd *ioq_pollfds;
-	int ioq_pollfds_size;
-#endif	/* _PR_USE_POLL */
-};
-
-#define _PR_IOQ(_cpu)			((_cpu)->md.md_unix.ioQ)
-#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
-#define _PR_FD_READ_SET(_cpu)		((_cpu)->md.md_unix.fd_read_set)
-#define _PR_FD_READ_CNT(_cpu)		((_cpu)->md.md_unix.fd_read_cnt)
-#define _PR_FD_WRITE_SET(_cpu)		((_cpu)->md.md_unix.fd_write_set)
-#define _PR_FD_WRITE_CNT(_cpu)		((_cpu)->md.md_unix.fd_write_cnt)
-#define _PR_FD_EXCEPTION_SET(_cpu)	((_cpu)->md.md_unix.fd_exception_set)
-#define _PR_FD_EXCEPTION_CNT(_cpu)	((_cpu)->md.md_unix.fd_exception_cnt)
-#define _PR_IOQ_TIMEOUT(_cpu)		((_cpu)->md.md_unix.ioq_timeout)
-#define _PR_IOQ_MAX_OSFD(_cpu)		((_cpu)->md.md_unix.ioq_max_osfd)
-#define _PR_IOQ_OSFD_CNT(_cpu)		((_cpu)->md.md_unix.ioq_osfd_cnt)
-#define _PR_IOQ_POLLFDS(_cpu)		((_cpu)->md.md_unix.ioq_pollfds)
-#define _PR_IOQ_POLLFDS_SIZE(_cpu)	((_cpu)->md.md_unix.ioq_pollfds_size)
-
-#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)	32
-
-struct _MDCPU {
-	struct _MDCPU_Unix md_unix;
-};
-
-#define _MD_INIT_LOCKS()
-#define _MD_NEW_LOCK(lock) PR_SUCCESS
-#define _MD_FREE_LOCK(lock)
-#define _MD_LOCK(lock)
-#define _MD_UNLOCK(lock)
-#define _MD_INIT_IO()
-#define _MD_IOQ_LOCK()
-#define _MD_IOQ_UNLOCK()
-
-/*
- * The following are copied from _sunos.h, _aix.h.  This means
- * some of them should probably be moved into _unixos.h.  But
- * _irix.h seems to be quite different in regard to these macros.
- */
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
-
-#define _MD_EARLY_INIT		_MD_EarlyInit
-#define _MD_FINAL_INIT		_PR_UnixInit
-#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
-#define _MD_INIT_THREAD         _MD_InitializeThread
-#define _MD_EXIT_THREAD(thread)
-#define	_MD_SUSPEND_THREAD(thread)
-#define	_MD_RESUME_THREAD(thread)
-#define _MD_CLEAN_THREAD(_thread)
-
-/*
- * We wrapped the select() call.  _MD_SELECT refers to the built-in,
- * unwrapped version.
- */
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/select.h>
-extern int _select(int nfds, fd_set *readfds, fd_set *writefds,
-	fd_set *execptfds, struct timeval *timeout);
-#define _MD_SELECT _select
-
-#define _MD_POLL _poll
-extern int _poll(struct pollfd *fds, unsigned long nfds, int timeout);
-
-#endif /* nspr_ncr_defs_h */
deleted file mode 100644
--- a/nsprpub/pr/include/md/_nec.cfg
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_cpucfg___
-#define nspr_cpucfg___
-
-#ifndef XP_UNIX
-#define XP_UNIX
-#endif
-
-#ifndef NEC
-#define NEC
-#endif
-
-#undef  IS_LITTLE_ENDIAN
-#define IS_BIG_ENDIAN 1
-#undef  HAVE_LONG_LONG
-#undef  HAVE_ALIGNED_DOUBLES
-#undef  HAVE_ALIGNED_LONGLONGS
-
-#define PR_BYTES_PER_BYTE   1
-#define PR_BYTES_PER_SHORT  2
-#define PR_BYTES_PER_INT    4
-#define PR_BYTES_PER_INT64  8
-#define PR_BYTES_PER_LONG   4
-#define PR_BYTES_PER_FLOAT  4
-#define PR_BYTES_PER_DOUBLE 8
-#define PR_BYTES_PER_WORD   4
-#define PR_BYTES_PER_DWORD  8
-
-#define PR_BITS_PER_BYTE    8
-#define PR_BITS_PER_SHORT   16
-#define PR_BITS_PER_INT     32
-#define PR_BITS_PER_INT64   64
-#define PR_BITS_PER_LONG    32
-#define PR_BITS_PER_FLOAT   32
-#define PR_BITS_PER_DOUBLE  64
-#define PR_BITS_PER_WORD    32
-
-#define PR_BITS_PER_BYTE_LOG2   3
-#define PR_BITS_PER_SHORT_LOG2  4
-#define PR_BITS_PER_INT_LOG2    5
-#define PR_BITS_PER_INT64_LOG2  6
-#define PR_BITS_PER_LONG_LOG2   5
-#define PR_BITS_PER_FLOAT_LOG2  5
-#define PR_BITS_PER_DOUBLE_LOG2 6
-#define PR_BITS_PER_WORD_LOG2   5
-
-#define PR_ALIGN_OF_SHORT   2
-#define PR_ALIGN_OF_INT     4
-#define PR_ALIGN_OF_LONG    4
-#define PR_ALIGN_OF_INT64   4
-#define PR_ALIGN_OF_FLOAT   4
-#define PR_ALIGN_OF_DOUBLE  8
-#define PR_ALIGN_OF_POINTER 4
-#define PR_ALIGN_OF_WORD    4
-
-#define PR_BYTES_PER_WORD_LOG2  2
-#define PR_BYTES_PER_DWORD_LOG2 3
-
-#ifndef NO_NSPR_10_SUPPORT
-
-#define BYTES_PER_BYTE		PR_BYTES_PER_BYTE
-#define BYTES_PER_SHORT 	PR_BYTES_PER_SHORT
-#define BYTES_PER_INT 		PR_BYTES_PER_INT
-#define BYTES_PER_INT64		PR_BYTES_PER_INT64
-#define BYTES_PER_LONG		PR_BYTES_PER_LONG
-#define BYTES_PER_FLOAT		PR_BYTES_PER_FLOAT
-#define BYTES_PER_DOUBLE	PR_BYTES_PER_DOUBLE
-#define BYTES_PER_WORD		PR_BYTES_PER_WORD
-#define BYTES_PER_DWORD		PR_BYTES_PER_DWORD
-
-#define BITS_PER_BYTE		PR_BITS_PER_BYTE
-#define BITS_PER_SHORT		PR_BITS_PER_SHORT
-#define BITS_PER_INT		PR_BITS_PER_INT
-#define BITS_PER_INT64		PR_BITS_PER_INT64
-#define BITS_PER_LONG		PR_BITS_PER_LONG
-#define BITS_PER_FLOAT		PR_BITS_PER_FLOAT
-#define BITS_PER_DOUBLE		PR_BITS_PER_DOUBLE
-#define BITS_PER_WORD		PR_BITS_PER_WORD
-
-#define BITS_PER_BYTE_LOG2	PR_BITS_PER_BYTE_LOG2
-#define BITS_PER_SHORT_LOG2	PR_BITS_PER_SHORT_LOG2
-#define BITS_PER_INT_LOG2	PR_BITS_PER_INT_LOG2
-#define BITS_PER_INT64_LOG2	PR_BITS_PER_INT64_LOG2
-#define BITS_PER_LONG_LOG2	PR_BITS_PER_LONG_LOG2
-#define BITS_PER_FLOAT_LOG2	PR_BITS_PER_FLOAT_LOG2
-#define BITS_PER_DOUBLE_LOG2 	PR_BITS_PER_DOUBLE_LOG2
-#define BITS_PER_WORD_LOG2	PR_BITS_PER_WORD_LOG2
-
-#define ALIGN_OF_SHORT		PR_ALIGN_OF_SHORT
-#define ALIGN_OF_INT		PR_ALIGN_OF_INT
-#define ALIGN_OF_LONG		PR_ALIGN_OF_LONG
-#define ALIGN_OF_INT64		PR_ALIGN_OF_INT64
-#define ALIGN_OF_FLOAT		PR_ALIGN_OF_FLOAT
-#define ALIGN_OF_DOUBLE		PR_ALIGN_OF_DOUBLE
-#define ALIGN_OF_POINTER	PR_ALIGN_OF_POINTER
-#define ALIGN_OF_WORD		PR_ALIGN_OF_WORD
-
-#define BYTES_PER_WORD_LOG2	PR_BYTES_PER_WORD_LOG2
-#define BYTES_PER_DWORD_LOG2	PR_BYTES_PER_DWORD_LOG2
-#define WORDS_PER_DWORD_LOG2	PR_WORDS_PER_DWORD_LOG2
-
-#endif /* NO_NSPR_10_SUPPORT */
-
-#endif /* nspr_cpucfg___ */
deleted file mode 100644
--- a/nsprpub/pr/include/md/_nec.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_nec_defs_h___
-#define nspr_nec_defs_h___
- 
-/*
- * Internal configuration macros
- */
-
-#define PR_LINKER_ARCH  "nec"
-#define _PR_SI_SYSNAME "NEC"
-#define _PR_SI_ARCHITECTURE "mips"
-#define PR_DLL_SUFFIX		".so"
- 
-#define _PR_STACK_VMBASE        0x50000000
-#define _MD_DEFAULT_STACK_SIZE  65536L
-#define _MD_MMAP_FLAGS          MAP_PRIVATE
-
-#undef  HAVE_STACK_GROWING_UP
-#define HAVE_DLL
-#define USE_DLFCN
-#define NEED_TIME_R
-#define NEED_STRFTIME_LOCK
-#define _PR_POLL_AVAILABLE
-#define _PR_USE_POLL
-#define _PR_NO_LARGE_FILES
-#define _PR_STAT_HAS_ST_ATIM_UNION
- 
-#include <ucontext.h>
-#include <sys/regset.h>
- 
-#define PR_NUM_GCREGS   NGREG
-#define PR_CONTEXT_TYPE ucontext_t
- 
-#define CONTEXT(_thread) (&(_thread)->md.context)
- 
-#define _MD_GET_SP(_t)    (_t)->md.context.uc_mcontext.gregs[CXT_SP]
- 
-/*
-** Initialize the thread context preparing it to execute "e(o,a)"
-*/
-#define _MD_INIT_CONTEXT(thread, _sp, _main, status)               \
-{                                                                   \
-    *status = PR_TRUE; \
-    getcontext(CONTEXT(thread));                                    \
-    CONTEXT(thread)->uc_stack.ss_sp = (char*) (thread)->stack->stackBottom; \
-    CONTEXT(thread)->uc_stack.ss_size = (thread)->stack->stackSize; \
-    _MD_GET_SP(thread) = (greg_t) _sp - 64;             \
-    makecontext(CONTEXT(thread), _main, 0);              \
-}
- 
-#define _MD_SWITCH_CONTEXT(_thread)      \
-    if (!getcontext(CONTEXT(_thread))) { \
-        (_thread)->md.errcode = errno;      \
-        _PR_Schedule();                  \
-    }
- 
-/*
-** Restore a thread context, saved by _MD_SWITCH_CONTEXT
-*/
-#define _MD_RESTORE_CONTEXT(_thread)   \
-{                                      \
-    ucontext_t *uc = CONTEXT(_thread); \
-    uc->uc_mcontext.gregs[CXT_V0] = 1; \
-    uc->uc_mcontext.gregs[CXT_A3] = 0; \
-    errno = (_thread)->md.errcode;     \
-    _MD_SET_CURRENT_THREAD(_thread);   \
-    setcontext(uc);                    \
-}
-
-/* Machine-dependent (MD) data structures */
-
-struct _MDThread {
-    PR_CONTEXT_TYPE context;
-    int id;
-    int errcode;
-};
-
-struct _MDThreadStack {
-    PRInt8 notused;
-};
-
-struct _MDLock {
-    PRInt8 notused;
-};
-
-struct _MDSemaphore {
-    PRInt8 notused;
-};
-
-struct _MDCVar {
-    PRInt8 notused;
-};
-
-struct _MDSegment {
-    PRInt8 notused;
-};
-
-/*
- * md-specific cpu structure field
- */
-#define _PR_MD_MAX_OSFD FD_SETSIZE
-
-struct _MDCPU_Unix {
-    PRCList ioQ;
-    PRUint32 ioq_timeout;
-    PRInt32 ioq_max_osfd;
-    PRInt32 ioq_osfd_cnt;
-#ifndef _PR_USE_POLL
-    fd_set fd_read_set, fd_write_set, fd_exception_set;
-    PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
-				fd_exception_cnt[_PR_MD_MAX_OSFD];
-#else
-	struct pollfd *ioq_pollfds;
-	int ioq_pollfds_size;
-#endif	/* _PR_USE_POLL */
-};
-
-#define _PR_IOQ(_cpu)			((_cpu)->md.md_unix.ioQ)
-#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
-#define _PR_FD_READ_SET(_cpu)		((_cpu)->md.md_unix.fd_read_set)
-#define _PR_FD_READ_CNT(_cpu)		((_cpu)->md.md_unix.fd_read_cnt)
-#define _PR_FD_WRITE_SET(_cpu)		((_cpu)->md.md_unix.fd_write_set)
-#define _PR_FD_WRITE_CNT(_cpu)		((_cpu)->md.md_unix.fd_write_cnt)
-#define _PR_FD_EXCEPTION_SET(_cpu)	((_cpu)->md.md_unix.fd_exception_set)
-#define _PR_FD_EXCEPTION_CNT(_cpu)	((_cpu)->md.md_unix.fd_exception_cnt)
-#define _PR_IOQ_TIMEOUT(_cpu)		((_cpu)->md.md_unix.ioq_timeout)
-#define _PR_IOQ_MAX_OSFD(_cpu)		((_cpu)->md.md_unix.ioq_max_osfd)
-#define _PR_IOQ_OSFD_CNT(_cpu)		((_cpu)->md.md_unix.ioq_osfd_cnt)
-#define _PR_IOQ_POLLFDS(_cpu)		((_cpu)->md.md_unix.ioq_pollfds)
-#define _PR_IOQ_POLLFDS_SIZE(_cpu)	((_cpu)->md.md_unix.ioq_pollfds_size)
-
-#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)	32
-
-struct _MDCPU {
-	struct _MDCPU_Unix md_unix;
-};
-
-#define _MD_INIT_LOCKS()
-#define _MD_NEW_LOCK(lock) PR_SUCCESS
-#define _MD_FREE_LOCK(lock)
-#define _MD_LOCK(lock)
-#define _MD_UNLOCK(lock)
-#define _MD_INIT_IO()
-#define _MD_IOQ_LOCK()
-#define _MD_IOQ_UNLOCK()
-
-#define _MD_EARLY_INIT          _MD_EarlyInit
-#define _MD_FINAL_INIT			_PR_UnixInit
-#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
-#define _MD_INIT_THREAD         _MD_InitializeThread
-#define _MD_EXIT_THREAD(thread)
-#define _MD_CLEAN_THREAD(_thread)
-
-#define _MD_SELECT _select
-#define _MD_POLL _poll
-
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
- 
-#endif /* nspr_nec_defs_h___ */
--- a/nsprpub/pr/include/md/_netbsd.h
+++ b/nsprpub/pr/include/md/_netbsd.h
@@ -203,23 +203,20 @@ struct _MDCPU {
 #define _MD_EXIT_THREAD(thread)
 #define _MD_SUSPEND_THREAD(thread)      _MD_suspend_thread
 #define _MD_RESUME_THREAD(thread)       _MD_resume_thread
 #define _MD_CLEAN_THREAD(_thread)
 
 #endif /* ! _PR_PTHREADS */
 
 extern void _MD_EarlyInit(void);
-extern PRIntervalTime _PR_UNIX_GetInterval(void);
-extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
 
 #define _MD_EARLY_INIT                  _MD_EarlyInit
 #define _MD_FINAL_INIT			_PR_UnixInit
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 
 /*
  * We wrapped the select() call.  _MD_SELECT refers to the built-in,
  * unwrapped version.
  */
 #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
 #if defined(_PR_POLL_AVAILABLE)
 #include <poll.h>
deleted file mode 100644
--- a/nsprpub/pr/include/md/_nextstep.cfg
+++ /dev/null
@@ -1,223 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_cpucfg___
-#define nspr_cpucfg___
-
-#ifndef XP_UNIX
-#define XP_UNIX
-#endif
-
-#ifndef NEXTSTEP
-#define NEXTSTEP
-#endif
-
-/*	Platform specific
-*/
-#if defined(__sparc__)
-
-/* Check these
-*/
-#undef  IS_LITTLE_ENDIAN
-#define IS_BIG_ENDIAN 1
-#define	HAVE_LONG_LONG
-#undef	HAVE_ALIGNED_DOUBLES
-#define	HAVE_ALIGNED_LONGLONGS 1
-
-#define PR_BYTES_PER_BYTE   1
-#define PR_BYTES_PER_SHORT  2
-#define PR_BYTES_PER_INT    4
-#define PR_BYTES_PER_INT64  8
-#define PR_BYTES_PER_LONG   4
-#define PR_BYTES_PER_FLOAT  4
-#define PR_BYTES_PER_DOUBLE 8
-/* Taken from _solaris.cfg
-*/
-#define PR_BYTES_PER_WORD   4
-#define PR_BYTES_PER_DWORD  8
-#define PR_BYTES_PER_WORD_LOG2   2
-#define PR_BYTES_PER_DWORD_LOG2  3
-
-#define PR_BITS_PER_BYTE    8
-#define PR_BITS_PER_SHORT   16
-#define PR_BITS_PER_INT     32
-#define PR_BITS_PER_INT64   64
-#define PR_BITS_PER_LONG    32
-#define PR_BITS_PER_FLOAT   32
-#define PR_BITS_PER_DOUBLE  64
-/* Taken from _solaris.cfg
-*/
-#define PR_BITS_PER_WORD    32
-
-#define PR_BITS_PER_BYTE_LOG2   3
-#define PR_BITS_PER_SHORT_LOG2  4
-#define PR_BITS_PER_INT_LOG2    5
-#define PR_BITS_PER_INT64_LOG2  6
-#define PR_BITS_PER_LONG_LOG2   5
-#define PR_BITS_PER_FLOAT_LOG2  5
-#define PR_BITS_PER_DOUBLE_LOG2 6
-/* Taken from _solaris.cfg
-*/
-#define PR_BITS_PER_WORD_LOG2   5
-
-#define PR_ALIGN_OF_SHORT   2
-#define PR_ALIGN_OF_INT     4
-#define PR_ALIGN_OF_LONG    4
-#define PR_ALIGN_OF_INT64   8
-#define PR_ALIGN_OF_FLOAT   4
-#define PR_ALIGN_OF_DOUBLE  8
-#define PR_ALIGN_OF_POINTER 4
-
-#define PR_WORDS_PER_DWORD_LOG2  1
-
-#elif defined(__m68k__)
-
-/* Check these
-*/
-#undef  IS_LITTLE_ENDIAN
-#define IS_BIG_ENDIAN 1
-#define	HAVE_LONG_LONG
-#undef	HAVE_ALIGNED_DOUBLES
-#define	HAVE_ALIGNED_LONGLONGS 1
-
-#define PR_BYTES_PER_BYTE   1
-#define PR_BYTES_PER_SHORT  2
-#define PR_BYTES_PER_INT    4
-#define PR_BYTES_PER_INT64  8
-#define PR_BYTES_PER_LONG   4
-#define PR_BYTES_PER_FLOAT  4
-#define PR_BYTES_PER_DOUBLE 8
-#define PR_BYTES_PER_WORD   4
-#define PR_BYTES_PER_DWORD  8
-#define PR_BYTES_PER_WORD_LOG2   2
-#define PR_BYTES_PER_DWORD_LOG2  3
-
-#define PR_BITS_PER_BYTE    8
-#define PR_BITS_PER_SHORT   16
-#define PR_BITS_PER_INT     32
-#define PR_BITS_PER_INT64   64
-#define PR_BITS_PER_LONG    32
-#define PR_BITS_PER_FLOAT   32
-#define PR_BITS_PER_DOUBLE  64
-#define PR_BITS_PER_WORD    32
-
-#define PR_BITS_PER_BYTE_LOG2   3
-#define PR_BITS_PER_SHORT_LOG2  4
-#define PR_BITS_PER_INT_LOG2    5
-#define PR_BITS_PER_INT64_LOG2  6
-#define PR_BITS_PER_LONG_LOG2   5
-#define PR_BITS_PER_FLOAT_LOG2  5
-#define PR_BITS_PER_DOUBLE_LOG2 6
-#define PR_BITS_PER_WORD_LOG2   5
-
-#define PR_ALIGN_OF_SHORT   2
-#define PR_ALIGN_OF_INT     2
-#define PR_ALIGN_OF_LONG    2
-#define PR_ALIGN_OF_INT64   2
-#define PR_ALIGN_OF_FLOAT   2
-#define PR_ALIGN_OF_DOUBLE  2
-#define PR_ALIGN_OF_POINTER 2
-
-#define PR_WORDS_PER_DWORD_LOG2  1
-
-#elif defined(__i386__)
-
-/* Check these
-*/
-#define IS_LITTLE_ENDIAN 1
-#undef  IS_BIG_ENDIAN
-#define	HAVE_LONG_LONG
-#undef	HAVE_ALIGNED_DOUBLES
-#define	HAVE_ALIGNED_LONGLONGS 1
-
-#define PR_BYTES_PER_BYTE   1
-#define PR_BYTES_PER_SHORT  2
-#define PR_BYTES_PER_INT    4
-#define PR_BYTES_PER_INT64  8
-#define PR_BYTES_PER_LONG   4
-#define PR_BYTES_PER_FLOAT  4
-#define PR_BYTES_PER_DOUBLE 8
-#define PR_BYTES_PER_WORD   4
-#define PR_BYTES_PER_DWORD  8
-
-#define PR_BITS_PER_BYTE    8
-#define PR_BITS_PER_SHORT   16
-#define PR_BITS_PER_INT     32
-#define PR_BITS_PER_INT64   64
-#define PR_BITS_PER_LONG    32
-#define PR_BITS_PER_FLOAT   32
-#define PR_BITS_PER_DOUBLE  64
-#define PR_BITS_PER_WORD    32
-
-#define PR_BITS_PER_BYTE_LOG2   3
-#define PR_BITS_PER_SHORT_LOG2  4
-#define PR_BITS_PER_INT_LOG2    5
-#define PR_BITS_PER_INT64_LOG2  6
-#define PR_BITS_PER_LONG_LOG2   5
-#define PR_BITS_PER_FLOAT_LOG2  5
-#define PR_BITS_PER_DOUBLE_LOG2 6
-#define PR_BITS_PER_WORD_LOG2   5
-
-#define PR_ALIGN_OF_SHORT   2
-#define PR_ALIGN_OF_INT     4
-#define PR_ALIGN_OF_LONG    4
-#define PR_ALIGN_OF_INT64   4
-#define PR_ALIGN_OF_FLOAT   4
-#define PR_ALIGN_OF_DOUBLE  4
-#define PR_ALIGN_OF_POINTER 4
-#define PR_ALIGN_OF_WORD    4
-
-#define PR_BYTES_PER_WORD_LOG2   2
-#define PR_BYTES_PER_DWORD_LOG2  3
-#define PR_WORDS_PER_DWORD_LOG2  1
-#endif /* defined(__somearch__) */
-
-
-#ifndef NO_NSPR_10_SUPPORT
-
-#define BYTES_PER_BYTE		PR_BYTES_PER_BYTE
-#define BYTES_PER_SHORT 	PR_BYTES_PER_SHORT
-#define BYTES_PER_INT 		PR_BYTES_PER_INT
-#define BYTES_PER_INT64		PR_BYTES_PER_INT64
-#define BYTES_PER_LONG		PR_BYTES_PER_LONG
-#define BYTES_PER_FLOAT		PR_BYTES_PER_FLOAT
-#define BYTES_PER_DOUBLE	PR_BYTES_PER_DOUBLE
-#define BYTES_PER_WORD		PR_BYTES_PER_WORD
-#define BYTES_PER_DWORD		PR_BYTES_PER_DWORD
-
-#define BITS_PER_BYTE		PR_BITS_PER_BYTE
-#define BITS_PER_SHORT		PR_BITS_PER_SHORT
-#define BITS_PER_INT		PR_BITS_PER_INT
-#define BITS_PER_INT64		PR_BITS_PER_INT64
-#define BITS_PER_LONG		PR_BITS_PER_LONG
-#define BITS_PER_FLOAT		PR_BITS_PER_FLOAT
-#define BITS_PER_DOUBLE		PR_BITS_PER_DOUBLE
-#define BITS_PER_WORD		PR_BITS_PER_WORD
-
-#define BITS_PER_BYTE_LOG2	PR_BITS_PER_BYTE_LOG2
-#define BITS_PER_SHORT_LOG2	PR_BITS_PER_SHORT_LOG2
-#define BITS_PER_INT_LOG2	PR_BITS_PER_INT_LOG2
-#define BITS_PER_INT64_LOG2	PR_BITS_PER_INT64_LOG2
-#define BITS_PER_LONG_LOG2	PR_BITS_PER_LONG_LOG2
-#define BITS_PER_FLOAT_LOG2	PR_BITS_PER_FLOAT_LOG2
-#define BITS_PER_DOUBLE_LOG2 	PR_BITS_PER_DOUBLE_LOG2
-#define BITS_PER_WORD_LOG2	PR_BITS_PER_WORD_LOG2
-
-#define ALIGN_OF_SHORT		PR_ALIGN_OF_SHORT
-#define ALIGN_OF_INT		PR_ALIGN_OF_INT
-#define ALIGN_OF_LONG		PR_ALIGN_OF_LONG
-#define ALIGN_OF_INT64		PR_ALIGN_OF_INT64
-#define ALIGN_OF_FLOAT		PR_ALIGN_OF_FLOAT
-#define ALIGN_OF_DOUBLE		PR_ALIGN_OF_DOUBLE
-#define ALIGN_OF_POINTER	PR_ALIGN_OF_POINTER
-#define ALIGN_OF_WORD		PR_ALIGN_OF_WORD
-
-#define BYTES_PER_WORD_LOG2	PR_BYTES_PER_WORD_LOG2
-#define BYTES_PER_DWORD_LOG2	PR_BYTES_PER_DWORD_LOG2
-#define WORDS_PER_DWORD_LOG2	PR_WORDS_PER_DWORD_LOG2
-
-#endif /* NO_NSPR_10_SUPPORT */
-
-#endif /* nspr_cpucfg___ */
deleted file mode 100644
--- a/nsprpub/pr/include/md/_nextstep.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_nextstep_defs_h___
-#define nspr_nextstep_defs_h___
-
-#include "prthread.h"
-
-#include <bsd/libc.h>
-#include <bsd/syscall.h>
-
-/*	syscall() is not declared in NEXTSTEP's syscall.h ...
-*/
-extern int syscall(int number, ...);
-
-/*
- * Internal configuration macros
- */
-
-#define PR_LINKER_ARCH	"nextstep"
-#define _PR_SI_SYSNAME  "NEXTSTEP"
-#if defined(__sparc__)
-#define _PR_SI_ARCHITECTURE "sparc"
-#elif defined(__m68k__)
-#define _PR_SI_ARCHITECTURE "m68k"
-#elif defined(__i386__)
-#define _PR_SI_ARCHITECTURE "x86"
-#else
-error Unknown NEXTSTEP architecture
-#endif
-#define PR_DLL_SUFFIX		".so"
-
-#define _PR_VMBASE              0x30000000
-#define _PR_STACK_VMBASE	0x50000000
-#define _MD_DEFAULT_STACK_SIZE	65536L
-#define _MD_MMAP_FLAGS          MAP_PRIVATE
-
-#undef  HAVE_STACK_GROWING_UP
-
-#define HAVE_WEAK_MALLOC_SYMBOLS
-
-#define HAVE_DLL
-#define USE_MACH_DYLD
-#define _PR_STAT_HAS_ONLY_ST_ATIME
-#define _PR_NO_LARGE_FILES
-
-#define USE_SETJMP
-
-#ifndef _PR_PTHREADS
-
-#include <setjmp.h>
-
-#define PR_CONTEXT_TYPE	jmp_buf
-
-#define CONTEXT(_th) ((_th)->md.context)
-
-/* balazs.pataki@sztaki.hu:
-** __sparc__ is checked
-** __m68k__ is checked
-** __i386__ is a guess (one of the two defines should work)
-*/
-#if defined(__sparc__)
-#define _MD_GET_SP(_th)		(_th)->md.context[2]
-#elif defined(__m68k__)
-#define _MD_GET_SP(_th)		(_th)->md.context[2]
-#elif defined(__i386__)
-/* One of this two must be OK ... try using sc_onstack
-*/
-#define _MD_GET_SP(_th)    (((struct sigcontext *) (_th)->md.context)->sc_onstack)
-//#define _MD_GET_SP(_th)		(_th)->md.context[0].sc_esp
-#else
-error Unknown NEXTSTEP architecture
-#endif
-
-#define PR_NUM_GCREGS	_JBLEN
-
-/*
-** Initialize a thread context to run "_main()" when started
-*/
-#define _MD_INIT_CONTEXT(_thread, _sp, _main, status)  \
-{  \
-    *status = PR_TRUE;  \
-    if (setjmp(CONTEXT(_thread))) {  \
-        _main();  \
-    }  \
-    _MD_GET_SP(_thread) = (int) ((_sp) - 64); \
-}
-
-#define _MD_SWITCH_CONTEXT(_thread)  \
-    if (!setjmp(CONTEXT(_thread))) {  \
-	(_thread)->md.errcode = errno;  \
-	_PR_Schedule();  \
-    }
-
-/*
-** Restore a thread context, saved by _MD_SWITCH_CONTEXT
-*/
-#define _MD_RESTORE_CONTEXT(_thread) \
-{   \
-    errno = (_thread)->md.errcode;  \
-    _MD_SET_CURRENT_THREAD(_thread);  \
-    longjmp(CONTEXT(_thread), 1);  \
-}
-
-/* Machine-dependent (MD) data structures */
-
-struct _MDThread {
-    PR_CONTEXT_TYPE context;
-    int id;
-    int errcode;
-};
-
-struct _MDThreadStack {
-    PRInt8 notused;
-};
-
-struct _MDLock {
-    PRInt8 notused;
-};
-
-struct _MDSemaphore {
-    PRInt8 notused;
-};
-
-struct _MDCVar {
-    PRInt8 notused;
-};
-
-struct _MDSegment {
-    PRInt8 notused;
-};
-
-/*
- * md-specific cpu structure field
- */
-#define _PR_MD_MAX_OSFD FD_SETSIZE
-
-struct _MDCPU_Unix {
-    PRCList ioQ;
-    PRUint32 ioq_timeout;
-    PRInt32 ioq_max_osfd;
-    PRInt32 ioq_osfd_cnt;
-#ifndef _PR_USE_POLL
-    fd_set fd_read_set, fd_write_set, fd_exception_set;
-    PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
-				fd_exception_cnt[_PR_MD_MAX_OSFD];
-#else
-	struct pollfd *ioq_pollfds;
-	int ioq_pollfds_size;
-#endif	/* _PR_USE_POLL */
-};
-
-#define _PR_IOQ(_cpu)			((_cpu)->md.md_unix.ioQ)
-#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
-#define _PR_FD_READ_SET(_cpu)		((_cpu)->md.md_unix.fd_read_set)
-#define _PR_FD_READ_CNT(_cpu)		((_cpu)->md.md_unix.fd_read_cnt)
-#define _PR_FD_WRITE_SET(_cpu)		((_cpu)->md.md_unix.fd_write_set)
-#define _PR_FD_WRITE_CNT(_cpu)		((_cpu)->md.md_unix.fd_write_cnt)
-#define _PR_FD_EXCEPTION_SET(_cpu)	((_cpu)->md.md_unix.fd_exception_set)
-#define _PR_FD_EXCEPTION_CNT(_cpu)	((_cpu)->md.md_unix.fd_exception_cnt)
-#define _PR_IOQ_TIMEOUT(_cpu)		((_cpu)->md.md_unix.ioq_timeout)
-#define _PR_IOQ_MAX_OSFD(_cpu)		((_cpu)->md.md_unix.ioq_max_osfd)
-#define _PR_IOQ_OSFD_CNT(_cpu)		((_cpu)->md.md_unix.ioq_osfd_cnt)
-#define _PR_IOQ_POLLFDS(_cpu)		((_cpu)->md.md_unix.ioq_pollfds)
-#define _PR_IOQ_POLLFDS_SIZE(_cpu)	((_cpu)->md.md_unix.ioq_pollfds_size)
-
-#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)	32
-
-struct _MDCPU {
-	struct _MDCPU_Unix md_unix;
-};
-
-#define _MD_INIT_LOCKS()
-#define _MD_NEW_LOCK(lock) PR_SUCCESS
-#define _MD_FREE_LOCK(lock)
-#define _MD_LOCK(lock)
-#define _MD_UNLOCK(lock)
-#define _MD_INIT_IO()
-#define _MD_IOQ_LOCK()
-#define _MD_IOQ_UNLOCK()
-
-extern PRStatus _MD_InitializeThread(PRThread *thread);
-
-#define _MD_INIT_RUNNING_CPU(cpu)       _MD_unix_init_running_cpu(cpu)
-#define _MD_INIT_THREAD                 _MD_InitializeThread
-#define _MD_EXIT_THREAD(thread)
-#define _MD_SUSPEND_THREAD(thread)      _MD_suspend_thread
-#define _MD_RESUME_THREAD(thread)       _MD_resume_thread
-#define _MD_CLEAN_THREAD(_thread)
-
-extern PRStatus _MD_CREATE_THREAD(
-    PRThread *thread,
-    void (*start) (void *),
-    PRThreadPriority priority,
-    PRThreadScope scope,
-    PRThreadState state,
-    PRUint32 stackSize);
-extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
-extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
-extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
-extern void _MD_YIELD(void);
-
-#endif /* ! _PR_PTHREADS */
-
-extern void _MD_EarlyInit(void);
-extern PRIntervalTime _PR_UNIX_GetInterval(void);
-extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
-
-#define _MD_EARLY_INIT                  _MD_EarlyInit
-#define _MD_FINAL_INIT			_PR_UnixInit
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
-
-/*
- * We wrapped the select() call.  _MD_SELECT refers to the built-in,
- * unwrapped version.
- */
-#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
-
-/* For writev() */
-#include <sys/uio.h>
-
-/* signal.h */
-/* 	balazs.pataki@sztaki.hu: this is stolen from sunos4.h. The things is that
-** 	NEXTSTEP doesn't support these flags for `struct sigaction's sa_flags, so
-**	I have to fake them ...
-*/
-#define SA_RESTART 0
-
-/* mmap */
-/* 	balazs.pataki@sztaki.hu: NEXTSTEP doesn't have mmap, at least not 
-**	publically. We have sys/mman.h, but it doesn't declare mmap(), and
-**	PROT_NONE is also missing. syscall.h has entries for mmap, munmap, and 
-**	mprotect so I wrap these in nextstep.c as  mmap(), munmap() and mprotect()
-**	and pray for it to work.
-**	
-*/
-caddr_t mmap(caddr_t addr, size_t len, int prot, int flags,
-          int fildes, off_t off);
-int munmap(caddr_t addr, size_t len);
-int mprotect(caddr_t addr, size_t len, int prot);
-
-/*	my_mmap() is implemented in nextstep.c and is based on map_fd() of mach.
-*/
-caddr_t my_mmap(caddr_t addr, size_t len, int prot, int flags,
-          int fildes, off_t off);
-int my_munmap(caddr_t addr, size_t len);
-
-
-/*	string.h
-*/
-/* balazs.pataki@sztaki.hu: this is missing so implemenetd in nextstep.c ...
-*/
-char *strdup(const char *s1);
-
-/* unistd.h
-*/
-/* 	balazs.pataki@sztaki.hu: these functions are hidden, though correctly 
-**	implemented in NEXTSTEP. Here I give the declaration for them to be used
-**	by prmalloc.c, and I have a wrapped syscall() version of them in nextstep.c
-*/
-int brk(void *endds);
-void *sbrk(int incr);
-
-#endif /* nspr_nextstep_defs_h___ */
--- a/nsprpub/pr/include/md/_nto.h
+++ b/nsprpub/pr/include/md/_nto.h
@@ -162,18 +162,17 @@ struct _MDCPU {
 #define _MD_NEW_LOCK(lock)		PR_SUCCESS
 #define _MD_FREE_LOCK(lock)
 #define _MD_LOCK(lock)
 #define _MD_UNLOCK(lock)
 #define _MD_INIT_IO()
 #define _MD_IOQ_LOCK()
 #define _MD_IOQ_UNLOCK()
 
-#define _MD_GET_INTERVAL		_PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC		_PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 #define _MD_EARLY_INIT			_MD_EarlyInit
 #define _MD_FINAL_INIT			_PR_UnixInit
 #define _MD_INIT_RUNNING_CPU(cpu)	_MD_unix_init_running_cpu(cpu)
 #define _MD_INIT_THREAD			_MD_InitializeThread
 #define _MD_EXIT_THREAD(thread)
 #define	_MD_SUSPEND_THREAD(thread)
 #define	_MD_RESUME_THREAD(thread)
 #define _MD_CLEAN_THREAD(_thread)
--- a/nsprpub/pr/include/md/_openbsd.h
+++ b/nsprpub/pr/include/md/_openbsd.h
@@ -187,18 +187,17 @@ struct _MDCPU {
 #define _MD_SUSPEND_THREAD(thread)      _MD_suspend_thread
 #define _MD_RESUME_THREAD(thread)       _MD_resume_thread
 #define _MD_CLEAN_THREAD(_thread)
 
 #endif /* ! _PR_PTHREADS */
 
 #define _MD_EARLY_INIT                  _MD_EarlyInit
 #define _MD_FINAL_INIT			_PR_UnixInit
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 
 /*
  * We wrapped the select() call.  _MD_SELECT refers to the built-in,
  * unwrapped version.
  */
 #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
 #include <poll.h>
 #define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
--- a/nsprpub/pr/include/md/_osf1.h
+++ b/nsprpub/pr/include/md/_osf1.h
@@ -181,18 +181,17 @@ struct _MDCPU {
 #define _MD_IOQ_LOCK()
 #define _MD_IOQ_UNLOCK()
 
 /*
  * The following are copied from _sunos.h, _aix.h.  This means
  * some of them should probably be moved into _unixos.h.  But
  * _irix.h seems to be quite different in regard to these macros.
  */
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 
 #define _MD_EARLY_INIT		_MD_EarlyInit
 #define _MD_FINAL_INIT		_PR_UnixInit
 #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
 #define _MD_INIT_THREAD         _MD_InitializeThread
 #define _MD_EXIT_THREAD(thread)
 #define	_MD_SUSPEND_THREAD(thread)
 #define	_MD_RESUME_THREAD(thread)
--- a/nsprpub/pr/include/md/_qnx.h
+++ b/nsprpub/pr/include/md/_qnx.h
@@ -153,18 +153,17 @@ struct _MDCPU {
 #define _MD_NEW_LOCK(lock)		PR_SUCCESS
 #define _MD_FREE_LOCK(lock)
 #define _MD_LOCK(lock)
 #define _MD_UNLOCK(lock)
 #define _MD_INIT_IO()
 #define _MD_IOQ_LOCK()
 #define _MD_IOQ_UNLOCK()
 
-#define _MD_GET_INTERVAL		_PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC		_PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 #define _MD_EARLY_INIT			_MD_EarlyInit
 #define _MD_FINAL_INIT			_PR_UnixInit
 #define _MD_INIT_RUNNING_CPU(cpu)	_MD_unix_init_running_cpu(cpu)
 #define _MD_INIT_THREAD			_MD_InitializeThread
 #define _MD_EXIT_THREAD(thread)
 #define	_MD_SUSPEND_THREAD(thread)
 #define	_MD_RESUME_THREAD(thread)
 #define _MD_CLEAN_THREAD(_thread)
deleted file mode 100644
--- a/nsprpub/pr/include/md/_reliantunix.cfg
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_cpucfg___
-#define nspr_cpucfg___
-
-#ifndef XP_UNIX
-#define XP_UNIX
-#endif
-
-#ifndef RELIANTUNIX
-#define RELIANTUNIX
-#endif
-
-#undef  IS_LITTLE_ENDIAN
-#define IS_BIG_ENDIAN 1
-#undef HAVE_LONG_LONG
-#undef  HAVE_ALIGNED_DOUBLES
-#undef  HAVE_ALIGNED_LONGLONGS
-
-#define PR_BYTES_PER_BYTE   1
-#define PR_BYTES_PER_SHORT  2
-#define PR_BYTES_PER_INT    4
-#define PR_BYTES_PER_INT64  8
-#define PR_BYTES_PER_LONG   4
-#define PR_BYTES_PER_FLOAT  4
-#define PR_BYTES_PER_WORD   4
-#define PR_BYTES_PER_DWORD  8
-#define PR_BYTES_PER_DOUBLE 8
-
-#define PR_BITS_PER_BYTE    8
-#define PR_BITS_PER_SHORT   16
-#define PR_BITS_PER_INT     32
-#define PR_BITS_PER_INT64   64
-#define PR_BITS_PER_LONG    32
-#define PR_BITS_PER_FLOAT   32
-#define PR_BITS_PER_WORD    32
-#define PR_BITS_PER_DWORD   64
-#define PR_BITS_PER_DOUBLE  64
-
-#define PR_BITS_PER_BYTE_LOG2   3
-#define PR_BITS_PER_SHORT_LOG2  4
-#define PR_BITS_PER_INT_LOG2    5
-#define PR_BITS_PER_INT64_LOG2  6
-#define PR_BITS_PER_LONG_LOG2   5
-#define PR_BITS_PER_FLOAT_LOG2  5
-#define PR_BITS_PER_WORD_LOG2   5
-#define PR_BITS_PER_DWORD_LOG2  6
-#define PR_BITS_PER_DOUBLE_LOG2 6
-
-#define PR_BYTES_PER_WORD_LOG2  2
-#define PR_BYTES_PER_DWORD_LOG2 3
-#define PR_WORDS_PER_DWORD_LOG2 1
-
-#define PR_ALIGN_OF_SHORT   2
-#define PR_ALIGN_OF_INT     4
-#define PR_ALIGN_OF_LONG    4
-#define PR_ALIGN_OF_INT64   8
-#define PR_ALIGN_OF_FLOAT   4
-#define PR_ALIGN_OF_WORD    4
-#define PR_ALIGN_OF_DOUBLE  8
-#define PR_ALIGN_OF_POINTER 4
-
-#define _PR_POLL_BACKCOMPAT
-
-#ifndef NO_NSPR_10_SUPPORT
-
-#define BYTES_PER_BYTE		PR_BYTES_PER_BYTE
-#define BYTES_PER_SHORT 	PR_BYTES_PER_SHORT
-#define BYTES_PER_INT 		PR_BYTES_PER_INT
-#define BYTES_PER_INT64		PR_BYTES_PER_INT64
-#define BYTES_PER_LONG		PR_BYTES_PER_LONG
-#define BYTES_PER_FLOAT		PR_BYTES_PER_FLOAT
-#define BYTES_PER_DOUBLE	PR_BYTES_PER_DOUBLE
-#define BYTES_PER_WORD		PR_BYTES_PER_WORD
-#define BYTES_PER_DWORD		PR_BYTES_PER_DWORD
-
-#define BITS_PER_BYTE		PR_BITS_PER_BYTE
-#define BITS_PER_SHORT		PR_BITS_PER_SHORT
-#define BITS_PER_INT		PR_BITS_PER_INT
-#define BITS_PER_INT64		PR_BITS_PER_INT64
-#define BITS_PER_LONG		PR_BITS_PER_LONG
-#define BITS_PER_FLOAT		PR_BITS_PER_FLOAT
-#define BITS_PER_DOUBLE		PR_BITS_PER_DOUBLE
-#define BITS_PER_WORD		PR_BITS_PER_WORD
-
-#define BITS_PER_BYTE_LOG2	PR_BITS_PER_BYTE_LOG2
-#define BITS_PER_SHORT_LOG2	PR_BITS_PER_SHORT_LOG2
-#define BITS_PER_INT_LOG2	PR_BITS_PER_INT_LOG2
-#define BITS_PER_INT64_LOG2	PR_BITS_PER_INT64_LOG2
-#define BITS_PER_LONG_LOG2	PR_BITS_PER_LONG_LOG2
-#define BITS_PER_FLOAT_LOG2	PR_BITS_PER_FLOAT_LOG2
-#define BITS_PER_DOUBLE_LOG2 	PR_BITS_PER_DOUBLE_LOG2
-#define BITS_PER_WORD_LOG2	PR_BITS_PER_WORD_LOG2
-
-#define ALIGN_OF_SHORT		PR_ALIGN_OF_SHORT
-#define ALIGN_OF_INT		PR_ALIGN_OF_INT
-#define ALIGN_OF_LONG		PR_ALIGN_OF_LONG
-#define ALIGN_OF_INT64		PR_ALIGN_OF_INT64
-#define ALIGN_OF_FLOAT		PR_ALIGN_OF_FLOAT
-#define ALIGN_OF_DOUBLE		PR_ALIGN_OF_DOUBLE
-#define ALIGN_OF_POINTER	PR_ALIGN_OF_POINTER
-#define ALIGN_OF_WORD		PR_ALIGN_OF_WORD
-
-#define BYTES_PER_WORD_LOG2	PR_BYTES_PER_WORD_LOG2
-#define BYTES_PER_DWORD_LOG2	PR_BYTES_PER_DWORD_LOG2
-#define WORDS_PER_DWORD_LOG2	PR_WORDS_PER_DWORD_LOG2
-
-#endif /* NO_NSPR_10_SUPPORT */
-
-#endif /* nspr_cpucfg___ */
deleted file mode 100644
--- a/nsprpub/pr/include/md/_reliantunix.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * reliantunix.h
- * 5/18/96 Taken from nec.h -- chrisk@netscape.com
- * 3/14/97 Modified for nspr20 -- chrisk@netscape.com
- */
-#ifndef nspr_reliantunix_defs_h___
-#define nspr_reliantunix_defs_h___
-
-/*
- * Internal configuration macros
- */
-
-#define PR_LINKER_ARCH	"sinix"
-#define _PR_SI_SYSNAME	"SINIX"
-#define _PR_SI_ARCHITECTURE "mips"
-#define PR_DLL_SUFFIX ".so"
-
-#define _PR_VMBASE		0x30000000
-#define _PR_STACK_VMBASE	0x50000000
-#define _MD_DEFAULT_STACK_SIZE	(2*65536L)
-#define _MD_MMAP_FLAGS		MAP_PRIVATE|MAP_FIXED
-
-#undef  HAVE_STACK_GROWING_UP
-#define HAVE_DLL
-#define USE_DLFCN
-#define NEED_STRFTIME_LOCK
-#define NEED_TIME_R
-#define HAVE_NETCONFIG
-#define HAVE_WEAK_IO_SYMBOLS
-#define HAVE_WEAK_MALLOC_SYMBOLS
-#define _PR_RECV_BROKEN /* recv doesn't work on Unix Domain Sockets */
-#define _PR_POLL_AVAILABLE
-#define _PR_USE_POLL
-#define _PR_STAT_HAS_ST_ATIM
-#define _PR_NO_LARGE_FILES
-
-/*
- * Mike Patnode indicated that it is possibly safe now to use context-switching
- * calls that do not change the signal mask, like setjmp vs. sigsetjmp.
- * So we'll use our homegrown, getcontext/setcontext-compatible stuff which 
- * will save us the getcontext/setcontext system calls at each context switch.
- * It already works in FastTrack 2.01, so it should do it here :-)
- *  - chrisk 040497
- */
-#define USE_SETCXT /* temporarily disabled... */
-
-#include <ucontext.h>
- 
-#ifdef USE_SETCXT
-/* use non-syscall machine language replacement */
-#define _GETCONTEXT		getcxt
-#define _SETCONTEXT		setcxt
-/* defined in os_ReliantUNIX.s */
-extern int getcxt(ucontext_t *);
-extern int setcxt(ucontext_t *);
-#else
-#define _GETCONTEXT		getcontext
-#define _SETCONTEXT		setcontext
-#endif
-
-#define _MD_GET_SP(_t)		(_t)->md.context.uc_mcontext.gpregs[CXT_SP]
-#define _PR_CONTEXT_TYPE	ucontext_t
-#define _PR_NUM_GCREGS		NGREG
- 
-#define CONTEXT(_thread) (&(_thread)->md.context)
-
-#define _PR_IS_NATIVE_THREAD_SUPPORTED() 0
- 
-/*
-** Machine-dependent (MD) data structures.
-*/
-struct _MDThread {
-    _PR_CONTEXT_TYPE context;
-    int id;
-    int errcode;
-};
-
-struct _MDThreadStack {
-    PRInt8 notused;
-};
-
-struct _MDLock {
-    PRInt8 notused;
-};
-
-struct _MDSemaphore {
-    PRInt8 notused;
-};
-
-struct _MDCVar {
-    PRInt8 notused;
-};
-
-struct _MDSegment {
-    PRInt8 notused;
-};
-
-/*
- * md-specific cpu structure field
- */
-#define _PR_MD_MAX_OSFD FD_SETSIZE
-
-struct _MDCPU_Unix {
-    PRCList ioQ;
-    PRUint32 ioq_timeout;
-    PRInt32 ioq_max_osfd;
-    PRInt32 ioq_osfd_cnt;
-#ifndef _PR_USE_POLL
-    fd_set fd_read_set, fd_write_set, fd_exception_set;
-    PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
-				fd_exception_cnt[_PR_MD_MAX_OSFD];
-#else
-	struct pollfd *ioq_pollfds;
-	int ioq_pollfds_size;
-#endif	/* _PR_USE_POLL */
-};
-
-#define _PR_IOQ(_cpu)			((_cpu)->md.md_unix.ioQ)
-#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
-#define _PR_FD_READ_SET(_cpu)		((_cpu)->md.md_unix.fd_read_set)
-#define _PR_FD_READ_CNT(_cpu)		((_cpu)->md.md_unix.fd_read_cnt)
-#define _PR_FD_WRITE_SET(_cpu)		((_cpu)->md.md_unix.fd_write_set)
-#define _PR_FD_WRITE_CNT(_cpu)		((_cpu)->md.md_unix.fd_write_cnt)
-#define _PR_FD_EXCEPTION_SET(_cpu)	((_cpu)->md.md_unix.fd_exception_set)
-#define _PR_FD_EXCEPTION_CNT(_cpu)	((_cpu)->md.md_unix.fd_exception_cnt)
-#define _PR_IOQ_TIMEOUT(_cpu)		((_cpu)->md.md_unix.ioq_timeout)
-#define _PR_IOQ_MAX_OSFD(_cpu)		((_cpu)->md.md_unix.ioq_max_osfd)
-#define _PR_IOQ_OSFD_CNT(_cpu)		((_cpu)->md.md_unix.ioq_osfd_cnt)
-#define _PR_IOQ_POLLFDS(_cpu)		((_cpu)->md.md_unix.ioq_pollfds)
-#define _PR_IOQ_POLLFDS_SIZE(_cpu)	((_cpu)->md.md_unix.ioq_pollfds_size)
-
-#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)	32
-
-struct _MDCPU {
-	struct _MDCPU_Unix md_unix;
-};
-
-#define _MD_INIT_LOCKS()
-#define _MD_NEW_LOCK(lock) PR_SUCCESS
-#define _MD_FREE_LOCK(lock)
-#define _MD_LOCK(lock)
-#define _MD_UNLOCK(lock)
-#define _MD_INIT_IO()
-#define _MD_IOQ_LOCK()
-#define _MD_IOQ_UNLOCK()
-
-/*
-** Initialize the thread context preparing it to execute "_main()"
-** - get a nice, fresh context
-** - set its SP to the stack we allcoated for it
-** - set it to start things at "e"
-*/
-#define _MD_INIT_CONTEXT(thread, _sp, _main, status)                \
-    PR_BEGIN_MACRO                                                  \
-    *status = PR_TRUE;                                              \
-    _GETCONTEXT(CONTEXT(thread));                                   \
-    /* this is supposed to point to the stack BASE, not to SP */    \
-    CONTEXT(thread)->uc_stack.ss_sp = thread->stack->stackBottom;   \
-    CONTEXT(thread)->uc_stack.ss_size = thread->stack->stackSize;   \
-    CONTEXT(thread)->uc_mcontext.gpregs[CXT_SP] = ((unsigned long)_sp - 128) & 0xfffffff8; \
-    CONTEXT(thread)->uc_mcontext.gpregs[CXT_T9] = _main;            \
-    CONTEXT(thread)->uc_mcontext.gpregs[CXT_EPC] = _main;           \
-    CONTEXT(thread)->uc_mcontext.gpregs[CXT_RA] = 0;                \
-    thread->no_sched = 0;                                           \
-    PR_END_MACRO
- 
-/*
-** Save current context as it is scheduled away
-*/
-#define _MD_SWITCH_CONTEXT(_thread)       \
-    PR_BEGIN_MACRO                        \
-    if (!_GETCONTEXT(CONTEXT(_thread))) { \
-	_MD_SAVE_ERRNO(_thread);          \
-	_MD_SET_LAST_THREAD(_thread);     \
-        _PR_Schedule();                   \
-    }                                     \
-    PR_END_MACRO
- 
-/*
-** Restore a thread context, saved by _MD_SWITCH_CONTEXT or set up
-**  by _MD_INIT_CONTEXT
-**  CXT_V0 is the register that holds the return value.
-**   We must set it to 1 so that we can see if the return from
-**   getcontext() is the result of calling getcontext() or
-**   setcontext()...
-**   setting a context got with getcontext() appears to
-**   return from getcontext(), too!
-**  CXT_A3 is the register that holds status when returning
-**   from a syscall. It is set to 0 to indicate success,
-**   because we want getcontext() on the other side of the magic
-**   door to be ok.
-*/
-#define _MD_RESTORE_CONTEXT(_thread)   \
-    PR_BEGIN_MACRO                     \
-    ucontext_t *uc = CONTEXT(_thread); \
-    uc->uc_mcontext.gpregs[CXT_V0] = 1;\
-    uc->uc_mcontext.gpregs[CXT_A3] = 0;\
-    _MD_RESTORE_ERRNO(_thread);        \
-    _MD_SET_CURRENT_THREAD(_thread);   \
-    _SETCONTEXT(uc);                   \
-    PR_END_MACRO
-
-#define _MD_SAVE_ERRNO(t)	 (t)->md.errcode = errno;
-#define _MD_RESTORE_ERRNO(t)	 errno = (t)->md.errcode;
-
-#define _MD_GET_INTERVAL	_PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC	_PR_UNIX_TicksPerSecond
-
-#define _MD_EARLY_INIT		_MD_EarlyInit
-#define _MD_FINAL_INIT		_PR_UnixInit
-#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
-#define _MD_INIT_THREAD		_MD_InitializeThread
-#define _MD_EXIT_THREAD(thread)
-#define _MD_SUSPEND_THREAD(thread)
-#define _MD_RESUME_THREAD(thread)
-#define _MD_CLEAN_THREAD(_thread)
-
-#if !defined(S_ISSOCK) && defined(S_IFSOCK)
-#define S_ISSOCK(mode)   ((mode&0xF000) == 0xC000)
-#endif
-#if !defined(S_ISLNK) && defined(S_IFLNK)
-#define S_ISLNK(mode)   ((mode&0xA000) == 0xC000)
-#endif
-
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/select.h>
-extern int _select(int nfds, fd_set *readfds, fd_set *writefds,
-	fd_set *execptfds, struct timeval *timeout);
-#define _MD_SELECT(nfds,r,w,e,tv) _select(nfds,r,w,e,tv)
-#define _MD_POLL _poll
-
-#endif /* nspr_reliantunix_defs_h___ */
--- a/nsprpub/pr/include/md/_riscos.h
+++ b/nsprpub/pr/include/md/_riscos.h
@@ -149,18 +149,17 @@ struct _MDCPU {
 #define _MD_NEW_LOCK(lock)		PR_SUCCESS
 #define _MD_FREE_LOCK(lock)
 #define _MD_LOCK(lock)
 #define _MD_UNLOCK(lock)
 #define _MD_INIT_IO()
 #define _MD_IOQ_LOCK()
 #define _MD_IOQ_UNLOCK()
 
-#define _MD_GET_INTERVAL		_PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC		_PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 #define _MD_EARLY_INIT			_MD_EarlyInit
 #define _MD_FINAL_INIT			_PR_UnixInit
 #define _MD_INIT_RUNNING_CPU(cpu)	_MD_unix_init_running_cpu(cpu)
 #define _MD_INIT_THREAD			_MD_InitializeThread
 #define _MD_EXIT_THREAD(thread)
 #define	_MD_SUSPEND_THREAD(thread)
 #define	_MD_RESUME_THREAD(thread)
 #define _MD_CLEAN_THREAD(_thread)
--- a/nsprpub/pr/include/md/_scoos.h
+++ b/nsprpub/pr/include/md/_scoos.h
@@ -158,15 +158,14 @@ struct _MDCPU {
 #define _MD_FINAL_INIT				_PR_UnixInit
 #define _MD_INIT_RUNNING_CPU(cpu) 	_MD_unix_init_running_cpu(cpu)
 #define _MD_INIT_THREAD         	_MD_InitializeThread
 #define _MD_EXIT_THREAD(thread)
 #define	_MD_SUSPEND_THREAD(thread)
 #define	_MD_RESUME_THREAD(thread)
 #define _MD_CLEAN_THREAD(_thread)
 
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 
 #define _MD_SELECT		_select
 #define _MD_POLL		_poll
 
 #endif /* nspr_scoos5_defs_h___ */
--- a/nsprpub/pr/include/md/_solaris.h
+++ b/nsprpub/pr/include/md/_solaris.h
@@ -105,16 +105,17 @@ struct _md_sockaddr_in6 {
 };
 #endif
 #if defined(_PR_PTHREADS)
 #define _PR_HAVE_GETHOST_R
 #define _PR_HAVE_GETHOST_R_POINTER
 #endif
 
 #include "prinrval.h"
+#define _MD_INTERVAL_INIT()
 NSPR_API(PRIntervalTime) _MD_Solaris_GetInterval(void);
 #define _MD_GET_INTERVAL                  _MD_Solaris_GetInterval
 NSPR_API(PRIntervalTime) _MD_Solaris_TicksPerSecond(void);
 #define _MD_INTERVAL_PER_SEC              _MD_Solaris_TicksPerSecond
 
 #if defined(_PR_HAVE_ATOMIC_OPS)
 /*
 ** Atomic Operations
@@ -434,19 +435,17 @@ struct _MDCPU_Unix {
 #define _PR_IOQ_POLLFDS_SIZE(_cpu)	((_cpu)->md.md_unix.ioq_pollfds_size)
 
 #define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)	32
 
 struct _MDCPU {
 	struct _MDCPU_Unix md_unix;
 };
 
-#ifndef _PR_PTHREADS
 #define _MD_INIT_LOCKS()
-#endif
 #define _MD_NEW_LOCK(lock)				PR_SUCCESS
 #define _MD_FREE_LOCK(lock)
 #define _MD_LOCK(lock)
 #define _MD_UNLOCK(lock)
 #define _MD_INIT_IO()
 #define _MD_IOQ_LOCK()
 #define _MD_IOQ_UNLOCK()
 
@@ -462,21 +461,16 @@ extern PRStatus _MD_WAKEUP_WAITER(struct
 extern void     _MD_YIELD(void);
 extern PRStatus _MD_InitializeThread(PRThread *thread);
 extern void     _MD_SET_PRIORITY(struct _MDThread *thread,
 	PRThreadPriority newPri);
 extern PRStatus _MD_CREATE_THREAD(PRThread *thread, void (*start) (void *),
 	PRThreadPriority priority, PRThreadScope scope, PRThreadState state,
         PRUint32 stackSize);
 
-NSPR_API(PRIntervalTime)				_MD_Solaris_GetInterval(void);
-#define _MD_GET_INTERVAL				_MD_Solaris_GetInterval
-NSPR_API(PRIntervalTime)				_MD_Solaris_TicksPerSecond(void);
-#define _MD_INTERVAL_PER_SEC			_MD_Solaris_TicksPerSecond
-
 /* The following defines the unwrapped versions of select() and poll(). */
 extern int _select(int nfds, fd_set *readfds, fd_set *writefds,
 	fd_set *exceptfds, struct timeval *timeout);
 #define _MD_SELECT	_select
 
 #include <stropts.h>
 #include <poll.h>
 #define _MD_POLL _poll
deleted file mode 100644
--- a/nsprpub/pr/include/md/_sony.cfg
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_cpucfg___
-#define nspr_cpucfg___
-
-#ifndef XP_UNIX
-#define XP_UNIX
-#endif
-
-#ifndef SONY
-#define SONY
-#endif
-
-#undef  IS_LITTLE_ENDIAN
-#define IS_BIG_ENDIAN 1
-
-#define PR_BYTES_PER_BYTE   1
-#define PR_BYTES_PER_SHORT  2
-#define PR_BYTES_PER_INT    4
-#define PR_BYTES_PER_INT64  8
-#define PR_BYTES_PER_LONG   4
-#define PR_BYTES_PER_FLOAT  4
-#define PR_BYTES_PER_DOUBLE 8
-#define PR_BYTES_PER_WORD   4
-#define PR_BYTES_PER_DWORD  8
-
-#define PR_BITS_PER_BYTE    8
-#define PR_BITS_PER_SHORT   16
-#define PR_BITS_PER_INT     32
-#define PR_BITS_PER_INT64   64
-#define PR_BITS_PER_LONG    32
-#define PR_BITS_PER_FLOAT   32
-#define PR_BITS_PER_DOUBLE  64
-#define PR_BITS_PER_WORD    32
-
-#define PR_BITS_PER_BYTE_LOG2   3
-#define PR_BITS_PER_SHORT_LOG2  4
-#define PR_BITS_PER_INT_LOG2    5
-#define PR_BITS_PER_INT64_LOG2  6
-#define PR_BITS_PER_LONG_LOG2   5
-#define PR_BITS_PER_FLOAT_LOG2  5
-#define PR_BITS_PER_DOUBLE_LOG2 6
-#define PR_BITS_PER_WORD_LOG2   5
-
-#define PR_ALIGN_OF_SHORT   2
-#define PR_ALIGN_OF_INT     4
-#define PR_ALIGN_OF_LONG    4
-#define PR_ALIGN_OF_INT64   8
-#define PR_ALIGN_OF_FLOAT   4
-#define PR_ALIGN_OF_DOUBLE  8
-#define PR_ALIGN_OF_POINTER 4
-
-#define PR_BYTES_PER_WORD_LOG2   2
-#define PR_BYTES_PER_DWORD_LOG2  3
-
-#undef  HAVE_LONG_LONG
-#undef  HAVE_ALIGNED_DOUBLES
-#undef  HAVE_ALIGNED_LONGLONGS
-
-#ifndef NO_NSPR_10_SUPPORT
-
-#define BYTES_PER_BYTE		PR_BYTES_PER_BYTE
-#define BYTES_PER_SHORT 	PR_BYTES_PER_SHORT
-#define BYTES_PER_INT 		PR_BYTES_PER_INT
-#define BYTES_PER_INT64		PR_BYTES_PER_INT64
-#define BYTES_PER_LONG		PR_BYTES_PER_LONG
-#define BYTES_PER_FLOAT		PR_BYTES_PER_FLOAT
-#define BYTES_PER_DOUBLE	PR_BYTES_PER_DOUBLE
-#define BYTES_PER_WORD		PR_BYTES_PER_WORD
-#define BYTES_PER_DWORD		PR_BYTES_PER_DWORD
-
-#define BITS_PER_BYTE		PR_BITS_PER_BYTE
-#define BITS_PER_SHORT		PR_BITS_PER_SHORT
-#define BITS_PER_INT		PR_BITS_PER_INT
-#define BITS_PER_INT64		PR_BITS_PER_INT64
-#define BITS_PER_LONG		PR_BITS_PER_LONG
-#define BITS_PER_FLOAT		PR_BITS_PER_FLOAT
-#define BITS_PER_DOUBLE		PR_BITS_PER_DOUBLE
-#define BITS_PER_WORD		PR_BITS_PER_WORD
-
-#define BITS_PER_BYTE_LOG2	PR_BITS_PER_BYTE_LOG2
-#define BITS_PER_SHORT_LOG2	PR_BITS_PER_SHORT_LOG2
-#define BITS_PER_INT_LOG2	PR_BITS_PER_INT_LOG2
-#define BITS_PER_INT64_LOG2	PR_BITS_PER_INT64_LOG2
-#define BITS_PER_LONG_LOG2	PR_BITS_PER_LONG_LOG2
-#define BITS_PER_FLOAT_LOG2	PR_BITS_PER_FLOAT_LOG2
-#define BITS_PER_DOUBLE_LOG2 	PR_BITS_PER_DOUBLE_LOG2
-#define BITS_PER_WORD_LOG2	PR_BITS_PER_WORD_LOG2
-
-#define ALIGN_OF_SHORT		PR_ALIGN_OF_SHORT
-#define ALIGN_OF_INT		PR_ALIGN_OF_INT
-#define ALIGN_OF_LONG		PR_ALIGN_OF_LONG
-#define ALIGN_OF_INT64		PR_ALIGN_OF_INT64
-#define ALIGN_OF_FLOAT		PR_ALIGN_OF_FLOAT
-#define ALIGN_OF_DOUBLE		PR_ALIGN_OF_DOUBLE
-#define ALIGN_OF_POINTER	PR_ALIGN_OF_POINTER
-#define ALIGN_OF_WORD		PR_ALIGN_OF_WORD
-
-#define BYTES_PER_WORD_LOG2	PR_BYTES_PER_WORD_LOG2
-#define BYTES_PER_DWORD_LOG2	PR_BYTES_PER_DWORD_LOG2
-#define WORDS_PER_DWORD_LOG2	PR_WORDS_PER_DWORD_LOG2
-
-#endif /* NO_NSPR_10_SUPPORT */
-
-#endif /* nspr_cpucfg___ */
deleted file mode 100644
--- a/nsprpub/pr/include/md/_sony.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_sony_defs_h___
-#define nspr_sony_defs_h___
- 
-#define PR_LINKER_ARCH		"sony"
-#define _PR_SI_SYSNAME		"SONY"
-#define _PR_SI_ARCHITECTURE	"mips"
-#define PR_DLL_SUFFIX		".so"
- 
-#define _PR_VMBASE		0x30000000
-#define _PR_STACK_VMBASE	0x50000000
-#define _MD_DEFAULT_STACK_SIZE	65536L
-#define _MD_MMAP_FLAGS          MAP_PRIVATE
-
-#define _MD_GET_INTERVAL	_PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC	_PR_UNIX_TicksPerSecond
-
-#if defined(_PR_LOCAL_THREADS_ONLY)
-#include <ucontext.h>
-#include <sys/regset.h>
- 
-#define PR_NUM_GCREGS	NGREG
-#define PR_CONTEXT_TYPE	ucontext_t
- 
-#define CONTEXT(_thread)	(&(_thread)->md.context)
- 
-#define _MD_GET_SP(_t)		(_t)->md.context.uc_mcontext.gregs[CXT_SP]
- 
-/*
-** Initialize the thread context preparing it to execute _main()
-*/
-#define _MD_INIT_CONTEXT(_thread, _sp, _main, status)               \
-{                                                                   \
-    *status = PR_TRUE;  \
-    getcontext(CONTEXT(_thread));                                    \
-    CONTEXT(_thread)->uc_stack.ss_sp = (char*) (_thread)->stack->stackBottom; \
-    CONTEXT(_thread)->uc_stack.ss_size = (_thread)->stack->stackSize; \
-    _MD_GET_SP(_thread) = (greg_t) (_sp) - 64;             \
-    makecontext(CONTEXT(_thread), _main, 0);              \
-}
- 
-#define _MD_SWITCH_CONTEXT(_thread)      \
-    if (!getcontext(CONTEXT(_thread))) { \
-        (_thread)->md.errcode = errno;      \
-        _PR_Schedule();                  \
-    }
- 
-/*
-** Restore a thread context, saved by _MD_SWITCH_CONTEXT
-*/
-#define _MD_RESTORE_CONTEXT(_thread)   \
-{                                      \
-    ucontext_t *uc = CONTEXT(_thread); \
-    uc->uc_mcontext.gregs[CXT_V0] = 1; \
-    uc->uc_mcontext.gregs[CXT_A3] = 0; \
-    _MD_SET_CURRENT_THREAD(_thread);      \
-    errno = (_thread)->md.errcode;        \
-    setcontext(uc);                    \
-}
-
-/* Machine-dependent (MD) data structures */
-
-struct _MDThread {
-    PR_CONTEXT_TYPE context;
-    int id;
-    int errcode;
-};
-
-struct _MDThreadStack {
-    PRInt8 notused;
-};
-
-struct _MDLock {
-    PRInt8 notused;
-};
-
-struct _MDSemaphore {
-    PRInt8 notused;
-};
-
-struct _MDCVar {
-    PRInt8 notused;
-};
-
-struct _MDSegment {
-    PRInt8 notused;
-};
-
-/*
- * md-specific cpu structure field
- */
-#define _PR_MD_MAX_OSFD FD_SETSIZE
-
-struct _MDCPU_Unix {
-    PRCList ioQ;
-    PRUint32 ioq_timeout;
-    PRInt32 ioq_max_osfd;
-    PRInt32 ioq_osfd_cnt;
-#ifndef _PR_USE_POLL
-    fd_set fd_read_set, fd_write_set, fd_exception_set;
-    PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
-				fd_exception_cnt[_PR_MD_MAX_OSFD];
-#else
-	struct pollfd *ioq_pollfds;
-	int ioq_pollfds_size;
-#endif	/* _PR_USE_POLL */
-};
-
-#define _PR_IOQ(_cpu)			((_cpu)->md.md_unix.ioQ)
-#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
-#define _PR_FD_READ_SET(_cpu)		((_cpu)->md.md_unix.fd_read_set)
-#define _PR_FD_READ_CNT(_cpu)		((_cpu)->md.md_unix.fd_read_cnt)
-#define _PR_FD_WRITE_SET(_cpu)		((_cpu)->md.md_unix.fd_write_set)
-#define _PR_FD_WRITE_CNT(_cpu)		((_cpu)->md.md_unix.fd_write_cnt)
-#define _PR_FD_EXCEPTION_SET(_cpu)	((_cpu)->md.md_unix.fd_exception_set)
-#define _PR_FD_EXCEPTION_CNT(_cpu)	((_cpu)->md.md_unix.fd_exception_cnt)
-#define _PR_IOQ_TIMEOUT(_cpu)		((_cpu)->md.md_unix.ioq_timeout)
-#define _PR_IOQ_MAX_OSFD(_cpu)		((_cpu)->md.md_unix.ioq_max_osfd)
-#define _PR_IOQ_OSFD_CNT(_cpu)		((_cpu)->md.md_unix.ioq_osfd_cnt)
-#define _PR_IOQ_POLLFDS(_cpu)		((_cpu)->md.md_unix.ioq_pollfds)
-#define _PR_IOQ_POLLFDS_SIZE(_cpu)	((_cpu)->md.md_unix.ioq_pollfds_size)
-
-#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)	32
-
-struct _MDCPU {
-    struct _MDCPU_Unix md_unix;
-};
-
-#define _MD_INIT_LOCKS()
-#define _MD_NEW_LOCK(lock) PR_SUCCESS
-#define _MD_FREE_LOCK(lock)
-#define _MD_LOCK(lock)
-#define _MD_UNLOCK(lock)
-#define _MD_INIT_IO()
-#define _MD_IOQ_LOCK()
-#define _MD_IOQ_UNLOCK()
-
-#define _MD_EARLY_INIT          	_MD_EarlyInit
-#define _MD_FINAL_INIT			_PR_UnixInit
-#define _MD_INIT_RUNNING_CPU(cpu)	_MD_unix_init_running_cpu(cpu)
-#define _MD_INIT_THREAD			_MD_InitializeThread
-#define _MD_EXIT_THREAD(thread)
-#define	_MD_SUSPEND_THREAD(thread)
-#define	_MD_RESUME_THREAD(thread)
-#define _MD_CLEAN_THREAD(_thread)
-
-/* The following defines unwrapped versions of select() and poll(). */
-extern int _select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
-#define _MD_SELECT              _select
-
-#include <sys/poll.h>
-extern int _poll(struct pollfd *fds, unsigned long nfds, int timeout);
-#define _MD_POLL _poll
- 
-#endif /* _PR_LOCAL_THREADS_ONLY */
- 
-#undef	HAVE_STACK_GROWING_UP
-#define	HAVE_DLL
-#define	USE_DLFCN
-#define	NEED_TIME_R
-#define NEED_STRFTIME_LOCK
- 
-/*
-** Missing function prototypes
-*/
-extern int gethostname(char *name, int namelen);
- 
-#endif /* nspr_sony_defs_h___ */
deleted file mode 100644
--- a/nsprpub/pr/include/md/_sunos4.cfg
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_cpucfg___
-#define nspr_cpucfg___
-
-#ifndef XP_UNIX
-#define XP_UNIX
-#endif
-
-#ifndef SUNOS4
-#define SUNOS4
-#endif
-
-#undef  IS_LITTLE_ENDIAN
-#define IS_BIG_ENDIAN 1
-#undef  HAVE_LONG_LONG
-#define	HAVE_ALIGNED_DOUBLES
-#undef	HAVE_ALIGNED_LONGLONGS
-
-#define PR_BYTES_PER_BYTE   1
-#define PR_BYTES_PER_SHORT  2
-#define PR_BYTES_PER_INT    4
-#define PR_BYTES_PER_INT64  8
-#define PR_BYTES_PER_LONG   4
-#define PR_BYTES_PER_FLOAT  4
-#define PR_BYTES_PER_DOUBLE 8
-#define PR_BYTES_PER_WORD   4
-#define PR_BYTES_PER_DWORD  8
-#define PR_BYTES_PER_WORD_LOG2   2
-#define PR_BYTES_PER_DWORD_LOG2  3
-
-#define PR_BITS_PER_BYTE    8
-#define PR_BITS_PER_SHORT   16
-#define PR_BITS_PER_INT     32
-#define PR_BITS_PER_INT64   64
-#define PR_BITS_PER_LONG    32
-#define PR_BITS_PER_FLOAT   32
-#define PR_BITS_PER_DOUBLE  64
-#define PR_BITS_PER_WORD    32
-
-#define PR_BITS_PER_BYTE_LOG2   3
-#define PR_BITS_PER_SHORT_LOG2  4
-#define PR_BITS_PER_INT_LOG2    5
-#define PR_BITS_PER_INT64_LOG2  6
-#define PR_BITS_PER_LONG_LOG2   5
-#define PR_BITS_PER_FLOAT_LOG2  5
-#define PR_BITS_PER_DOUBLE_LOG2 6
-#define PR_BITS_PER_WORD_LOG2   5
-
-#define PR_ALIGN_OF_SHORT   2
-#define PR_ALIGN_OF_INT     4
-#define PR_ALIGN_OF_LONG    4
-#define PR_ALIGN_OF_INT64   8
-#define PR_ALIGN_OF_FLOAT   4
-#define PR_ALIGN_OF_DOUBLE  8
-#define PR_ALIGN_OF_POINTER 4
-
-#ifndef NO_NSPR_10_SUPPORT
-
-#define BYTES_PER_BYTE		PR_BYTES_PER_BYTE
-#define BYTES_PER_SHORT 	PR_BYTES_PER_SHORT
-#define BYTES_PER_INT 		PR_BYTES_PER_INT
-#define BYTES_PER_INT64		PR_BYTES_PER_INT64
-#define BYTES_PER_LONG		PR_BYTES_PER_LONG
-#define BYTES_PER_FLOAT		PR_BYTES_PER_FLOAT
-#define BYTES_PER_DOUBLE	PR_BYTES_PER_DOUBLE
-#define BYTES_PER_WORD		PR_BYTES_PER_WORD
-#define BYTES_PER_DWORD		PR_BYTES_PER_DWORD
-
-#define BITS_PER_BYTE		PR_BITS_PER_BYTE
-#define BITS_PER_SHORT		PR_BITS_PER_SHORT
-#define BITS_PER_INT		PR_BITS_PER_INT
-#define BITS_PER_INT64		PR_BITS_PER_INT64
-#define BITS_PER_LONG		PR_BITS_PER_LONG
-#define BITS_PER_FLOAT		PR_BITS_PER_FLOAT
-#define BITS_PER_DOUBLE		PR_BITS_PER_DOUBLE
-#define BITS_PER_WORD		PR_BITS_PER_WORD
-
-#define BITS_PER_BYTE_LOG2	PR_BITS_PER_BYTE_LOG2
-#define BITS_PER_SHORT_LOG2	PR_BITS_PER_SHORT_LOG2
-#define BITS_PER_INT_LOG2	PR_BITS_PER_INT_LOG2
-#define BITS_PER_INT64_LOG2	PR_BITS_PER_INT64_LOG2
-#define BITS_PER_LONG_LOG2	PR_BITS_PER_LONG_LOG2
-#define BITS_PER_FLOAT_LOG2	PR_BITS_PER_FLOAT_LOG2
-#define BITS_PER_DOUBLE_LOG2 	PR_BITS_PER_DOUBLE_LOG2
-#define BITS_PER_WORD_LOG2	PR_BITS_PER_WORD_LOG2
-
-#define ALIGN_OF_SHORT		PR_ALIGN_OF_SHORT
-#define ALIGN_OF_INT		PR_ALIGN_OF_INT
-#define ALIGN_OF_LONG		PR_ALIGN_OF_LONG
-#define ALIGN_OF_INT64		PR_ALIGN_OF_INT64
-#define ALIGN_OF_FLOAT		PR_ALIGN_OF_FLOAT
-#define ALIGN_OF_DOUBLE		PR_ALIGN_OF_DOUBLE
-#define ALIGN_OF_POINTER	PR_ALIGN_OF_POINTER
-#define ALIGN_OF_WORD		PR_ALIGN_OF_WORD
-
-#define BYTES_PER_WORD_LOG2	PR_BYTES_PER_WORD_LOG2
-#define BYTES_PER_DWORD_LOG2	PR_BYTES_PER_DWORD_LOG2
-#define WORDS_PER_DWORD_LOG2	PR_WORDS_PER_DWORD_LOG2
-
-#endif /* NO_NSPR_10_SUPPORT */
-
-#endif /* ifndef nspr_cpucfg___ */
deleted file mode 100644
--- a/nsprpub/pr/include/md/_sunos4.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_sunos_defs_h___
-#define nspr_sunos_defs_h___
-
-#include "md/sunos4.h"
-
-/* On SunOS 4, memset is declared in memory.h */
-#include <memory.h>
-#include <errno.h>
-#include <sys/syscall.h>
-
-/*
- * Internal configuration macros
- */
-
-#define PR_LINKER_ARCH	"sunos"
-#define _PR_SI_SYSNAME	"SUNOS"
-#define _PR_SI_ARCHITECTURE "sparc"
-#define PR_DLL_SUFFIX		".so.1.0"
-
-/*
-** For sunos type machines, don't specify an address because the
-** NetBSD/SPARC O.S. does the wrong thing.
-*/
-#define _PR_VMBASE		0x30000000
-#define _PR_STACK_VMBASE	0x50000000
-#define _MD_DEFAULT_STACK_SIZE	65536L
-#define _MD_MMAP_FLAGS          MAP_PRIVATE
-
-#undef  HAVE_STACK_GROWING_UP
-#undef	HAVE_WEAK_IO_SYMBOLS
-#undef	HAVE_WEAK_MALLOC_SYMBOLS
-#define	HAVE_DLL
-#define	USE_DLFCN
-#define NEED_STRFTIME_LOCK
-#define NEED_TIME_R
-#define HAVE_BSD_FLOCK
-#define _PR_NO_LARGE_FILES
-#define _PR_STAT_HAS_ONLY_ST_ATIME
-
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
-
-#define USE_SETJMP
-
-#include <setjmp.h>
-
-#define _MD_GET_SP(_t)    (_t)->md.context[2]
-
-#define PR_NUM_GCREGS	_JBLEN
-
-#define CONTEXT(_th) ((_th)->md.context)
-
-/*
-** Initialize the thread context preparing it to execute _main.
-*/
-#define _MD_INIT_CONTEXT(_thread, _sp, _main, status)	      \
-    PR_BEGIN_MACRO				      \
-	int *context = (_thread)->md.context;	      \
-        *status = PR_TRUE;              \
-	asm("ta 3");					\
-	(void) setjmp(context);			      \
-	(_thread)->md.context[2] = (int) ((_sp) - 64); \
-	(_thread)->md.context[2] &= ~7;		\
-	(_thread)->md.context[3] = (int) _main;  \
-	(_thread)->md.context[4] = (int) _main + 4;  \
-    PR_END_MACRO
-
-#define _MD_SWITCH_CONTEXT(_thread)  \
-    asm("ta 3");			\
-    if (!setjmp(CONTEXT(_thread))) { \
-	(_thread)->md.errcode = errno;  \
-	_PR_Schedule();		     \
-    }
-
-/*
-** Restore a thread context, saved by _MD_SWITCH_CONTEXT
-*/
-#define _MD_RESTORE_CONTEXT(_thread) \
-{				     \
-    errno = (_thread)->md.errcode;	     \
-    _MD_SET_CURRENT_THREAD(_thread);	 \
-    longjmp(CONTEXT(_thread), 1);    \
-}
-
-#pragma unknown_control_flow(longjmp)
-#pragma unknown_control_flow(setjmp)
-#pragma unknown_control_flow(_PR_Schedule)
-
-/*
-** Missing function prototypes
-*/
-
-extern int socket (int domain, int type, int protocol);
-extern int getsockname (int s, struct sockaddr *name, int *namelen);
-extern int getpeername (int s, struct sockaddr *name, int *namelen);
-extern int getsockopt (int s, int level, int optname, char* optval, int* optlen);
-extern int setsockopt (int s, int level, int optname, const char* optval, int optlen);
-extern int accept (int s, struct sockaddr *addr, int *addrlen);
-extern int listen (int s, int backlog);
-extern int brk(void *);
-extern void *sbrk(int);
-
-
-/* Machine-dependent (MD) data structures.  SunOS 4 has no native threads. */
-
-struct _MDThread {
-    jmp_buf context;
-    int id;
-    int errcode;
-};
-
-struct _MDThreadStack {
-    PRInt8 notused;
-};
-
-struct _MDLock {
-    PRInt8 notused;
-};
-
-struct _MDSemaphore {
-    PRInt8 notused;
-};
-
-struct _MDCVar {
-    PRInt8 notused;
-};
-
-struct _MDSegment {
-    PRInt8 notused;
-};
-
-/*
- * md-specific cpu structure field
- */
-#define _PR_MD_MAX_OSFD FD_SETSIZE
-
-struct _MDCPU_Unix {
-    PRCList ioQ;
-    PRUint32 ioq_timeout;
-    PRInt32 ioq_max_osfd;
-    PRInt32 ioq_osfd_cnt;
-#ifndef _PR_USE_POLL
-    fd_set fd_read_set, fd_write_set, fd_exception_set;
-    PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
-				fd_exception_cnt[_PR_MD_MAX_OSFD];
-#else
-	struct pollfd *ioq_pollfds;
-	int ioq_pollfds_size;
-#endif	/* _PR_USE_POLL */
-};
-
-#define _PR_IOQ(_cpu)			((_cpu)->md.md_unix.ioQ)
-#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
-#define _PR_FD_READ_SET(_cpu)		((_cpu)->md.md_unix.fd_read_set)
-#define _PR_FD_READ_CNT(_cpu)		((_cpu)->md.md_unix.fd_read_cnt)
-#define _PR_FD_WRITE_SET(_cpu)		((_cpu)->md.md_unix.fd_write_set)
-#define _PR_FD_WRITE_CNT(_cpu)		((_cpu)->md.md_unix.fd_write_cnt)
-#define _PR_FD_EXCEPTION_SET(_cpu)	((_cpu)->md.md_unix.fd_exception_set)
-#define _PR_FD_EXCEPTION_CNT(_cpu)	((_cpu)->md.md_unix.fd_exception_cnt)
-#define _PR_IOQ_TIMEOUT(_cpu)		((_cpu)->md.md_unix.ioq_timeout)
-#define _PR_IOQ_MAX_OSFD(_cpu)		((_cpu)->md.md_unix.ioq_max_osfd)
-#define _PR_IOQ_OSFD_CNT(_cpu)		((_cpu)->md.md_unix.ioq_osfd_cnt)
-#define _PR_IOQ_POLLFDS(_cpu)		((_cpu)->md.md_unix.ioq_pollfds)
-#define _PR_IOQ_POLLFDS_SIZE(_cpu)	((_cpu)->md.md_unix.ioq_pollfds_size)
-
-#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)	32
-
-struct _MDCPU {
-	struct _MDCPU_Unix md_unix;
-};
-
-#define _MD_INIT_LOCKS()
-#define _MD_NEW_LOCK(lock) PR_SUCCESS
-#define _MD_FREE_LOCK(lock)
-#define _MD_LOCK(lock)
-#define _MD_UNLOCK(lock)
-#define _MD_INIT_IO()
-#define _MD_IOQ_LOCK()
-#define _MD_IOQ_UNLOCK()
-
-/* These are copied from _solaris.h */
-
-#define _MD_EARLY_INIT          _MD_EarlyInit
-#define _MD_FINAL_INIT			_PR_UnixInit
-#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
-#define _MD_INIT_THREAD         _MD_InitializeThread
-#define _MD_EXIT_THREAD(thread)
-#define	_MD_SUSPEND_THREAD(thread)
-#define	_MD_RESUME_THREAD(thread)
-#define _MD_CLEAN_THREAD(_thread)
-
-/*
- * We wrapped the select() call.  _MD_SELECT refers to the built-in,
- * unwrapped version.
- */
-#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
-#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
-
-#endif /* nspr_sparc_defs_h___ */
--- a/nsprpub/pr/include/md/_symbian.h
+++ b/nsprpub/pr/include/md/_symbian.h
@@ -34,20 +34,17 @@
 #define _PR_HAVE_SYSV_SEMAPHORES
 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
 
 #ifndef _PR_PTHREADS
 #error "Classic NSPR is not implemented"
 #endif
 
 extern void _MD_EarlyInit(void);
-extern PRIntervalTime _PR_UNIX_GetInterval(void);
-extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
 
 #define _MD_EARLY_INIT                  _MD_EarlyInit
 #define _MD_FINAL_INIT                  _PR_UnixInit
-#define _MD_GET_INTERVAL                _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC            _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 
 /* For writev() */
 #include <sys/uio.h>
 
 #endif /* nspr_symbian_defs_h___ */
--- a/nsprpub/pr/include/md/_unixos.h
+++ b/nsprpub/pr/include/md/_unixos.h
@@ -10,17 +10,17 @@
  * If FD_SETSIZE is not defined on the command line, set the default value
  * before include select.h
  */
 /*
  * Linux: FD_SETSIZE is defined in /usr/include/sys/select.h and should
  * not be redefined.
  */
 #if !defined(LINUX) && !defined(__GNU__) && !defined(__GLIBC__) \
-    && !defined(DARWIN) && !defined(NEXTSTEP)
+    && !defined(DARWIN)
 #ifndef FD_SETSIZE
 #define FD_SETSIZE  4096
 #endif
 #endif
 
 #include <unistd.h>
 #include <stddef.h>
 #include <sys/stat.h>
@@ -142,17 +142,17 @@ extern void _MD_unix_init_running_cpu(st
 ** work - it just means that we don't really have a functional
 ** redzone.
 */
 #include <sys/mman.h>
 #ifndef PROT_NONE
 #define PROT_NONE 0x0
 #endif
 
-#if defined(DEBUG) && !defined(DARWIN) && !defined(NEXTSTEP)
+#if defined(DEBUG) && !defined(DARWIN)
 #if !defined(SOLARIS)	
 #include <string.h>  /* for memset() */
 #define _MD_INIT_STACK(ts,REDZONE)					\
     PR_BEGIN_MACRO                 					\
 	(void) mprotect((void*)ts->seg->vaddr, REDZONE, PROT_NONE);	\
 	(void) mprotect((void*) ((char*)ts->seg->vaddr + REDZONE + ts->stackSize),\
 			REDZONE, PROT_NONE);				\
     /*									\
@@ -289,19 +289,32 @@ extern void		_MD_FreeSegment(PRSegment *
 #define _MD_INIT_SEGS			_MD_InitSegs
 #define _MD_ALLOC_SEGMENT		_MD_AllocSegment
 #define _MD_FREE_SEGMENT		_MD_FreeSegment
 
 #endif /* !defined(_PR_PTHREADS) */
 
 /************************************************************************/
 
-#if !defined(HPUX_LW_TIMER)
+#ifdef _MD_INTERVAL_USE_GTOD
+extern PRIntervalTime   _PR_UNIX_GetInterval(void);
+extern PRIntervalTime   _PR_UNIX_TicksPerSecond(void);
 #define _MD_INTERVAL_INIT()
+#define _MD_GET_INTERVAL		_PR_UNIX_GetInterval
+#define _MD_INTERVAL_PER_SEC		_PR_UNIX_TicksPerSecond
 #endif
+
+#ifdef HAVE_CLOCK_MONOTONIC
+extern PRIntervalTime   _PR_UNIX_GetInterval2(void);
+extern PRIntervalTime   _PR_UNIX_TicksPerSecond2(void);
+#define _MD_INTERVAL_INIT()
+#define _MD_GET_INTERVAL		_PR_UNIX_GetInterval2
+#define _MD_INTERVAL_PER_SEC		_PR_UNIX_TicksPerSecond2
+#endif
+
 #define _MD_INTERVAL_PER_MILLISEC()	(_PR_MD_INTERVAL_PER_SEC() / 1000)
 #define _MD_INTERVAL_PER_MICROSEC()	(_PR_MD_INTERVAL_PER_SEC() / 1000000)
 
 /************************************************************************/
 
 #define _MD_ERRNO()             	(errno)
 #define _MD_GET_SOCKET_ERROR()		(errno)
 
--- a/nsprpub/pr/include/md/_unixware.h
+++ b/nsprpub/pr/include/md/_unixware.h
@@ -153,18 +153,17 @@ struct _MDCPU {
 #define _MD_IOQ_LOCK()
 #define _MD_IOQ_UNLOCK()
 
 /*
  * The following are copied from _sunos.h, _aix.h.  This means
  * some of them should probably be moved into _unixos.h.  But
  * _irix.h seems to be quite different in regard to these macros.
  */
-#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
-#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
+#define _MD_INTERVAL_USE_GTOD
 
 #define _MD_EARLY_INIT		_MD_EarlyInit
 #define _MD_FINAL_INIT		_PR_UnixInit
 #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
 #define _MD_INIT_THREAD         _MD_InitializeThread
 #define _MD_EXIT_THREAD(thread)
 #define	_MD_SUSPEND_THREAD(thread)
 #define	_MD_RESUME_THREAD(thread)
--- a/nsprpub/pr/include/md/prosdep.h
+++ b/nsprpub/pr/include/md/prosdep.h
@@ -56,43 +56,25 @@ PR_BEGIN_EXTERN_C
 #include "md/_linux.h"
 
 #elif defined(OSF1)
 #include "md/_osf1.h"
 
 #elif defined(DARWIN)
 #include "md/_darwin.h"
 
-#elif defined(NEXTSTEP)
-#include "md/_nextstep.h"
-
 #elif defined(SOLARIS)
 #include "md/_solaris.h"
 
-#elif defined(SUNOS4)
-#include "md/_sunos4.h"
-
-#elif defined(SNI)
-#include "md/_reliantunix.h"
-
-#elif defined(SONY)
-#include "md/_sony.h"
-
-#elif defined(NEC)
-#include "md/_nec.h"
-
 #elif defined(SCO)
 #include "md/_scoos.h"
 
 #elif defined(UNIXWARE)
 #include "md/_unixware.h"
 
-#elif defined(NCR)
-#include "md/_ncr.h"
-
 #elif defined(DGUX)
 #include "md/_dgux.h"
 
 #elif defined(QNX)
 #include "md/_qnx.h"
 
 #elif defined(NTO)
 #include "md/_nto.h"
deleted file mode 100644
--- a/nsprpub/pr/include/md/sunos4.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef pr_sunos4_h___
-#define pr_sunos4_h___
-
-#ifndef SVR4
-
-/*
-** Hodge podge of random missing prototypes for the Sunos4 system
-*/
-#include <stdio.h>
-#include <stdarg.h>
-#include <time.h>
-#include <limits.h>
-#include <sys/types.h>
-
-#define PATH_MAX _POSIX_PATH_MAX
-
-struct timeval;
-struct timezone;
-struct itimerval;
-struct sockaddr;
-struct stat;
-struct tm;
-
-/* ctype.h */
-extern int tolower(int);
-extern int toupper(int);
-
-/* errno.h */
-extern char *sys_errlist[];
-extern int sys_nerr;
-
-#define strerror(e) sys_errlist[((unsigned)(e) < sys_nerr) ? e : 0]
-
-extern void perror(const char *);
-
-/* getopt */
-extern char *optarg;
-extern int optind;
-extern int getopt(int argc, char **argv, char *spec);
-
-/* math.h */
-extern int srandom(long val);
-extern long random(void);
-
-/* memory.h */
-#define memmove(to,from,len) bcopy((char*)(from),(char*)(to),len)
-
-extern void bcopy(const char *, char *, int);
-
-/* signal.h */
-/*
-** SunOS4 sigaction hides interrupts by default, so we can safely define
-** SA_RESTART to 0.
-*/
-#define SA_RESTART 0
-
-/* stdio.h */
-extern int printf(const char *, ...);
-extern int fprintf(FILE *, const char *, ...);
-extern int vprintf(const char *, va_list);
-extern int vfprintf(FILE *, const char *, va_list);
-extern char *vsprintf(char *, const char *, va_list);
-extern int scanf(const char *, ...);
-extern int sscanf(const char *, const char *, ...);
-extern int fscanf(FILE *, const char *, ...);
-extern int fgetc(FILE *);
-extern int fputc(int, FILE *);
-extern int fputs(const char *, FILE *);
-extern int puts(const char *);
-extern int fread(void *, size_t, size_t, FILE *);
-extern int fwrite(const char *, int, int, FILE *);
-extern int fseek(FILE *, long, int);
-extern long ftell(FILE *);
-extern int rewind(FILE *);
-extern int fflush(FILE *);
-extern int _flsbuf(unsigned char, FILE *);
-extern int fclose(FILE *);
-extern int remove(const char *);
-extern int setvbuf(FILE *, char *, int, size_t);
-extern int system(const char *);
-extern FILE *popen(const char *, const char *);
-extern int pclose(FILE *);
-
-/* stdlib.h */
-#define strtoul strtol
-
-extern int isatty(int fildes);
-extern long strtol(const char *, char **, int);
-extern int putenv(const char *);
-extern void srand48(long);
-extern long lrand48(void);
-extern double drand48(void);
-
-/* string.h */
-extern int strcasecmp(const char *, const char *);
-extern int strncasecmp(const char *, const char *, size_t);
-extern int strcoll(const char *, const char *);
-
-/* time.h */
-extern time_t mktime(struct tm *);
-extern size_t strftime(char *, size_t, const char *, const struct tm *);
-extern int gettimeofday(struct timeval *, struct timezone *);
-extern int setitimer(int, struct itimerval *, struct itimerval *);
-extern time_t time(time_t *);
-extern time_t timegm(struct tm *);
-extern struct tm *localtime(const time_t *);
-extern struct tm *gmtime(const time_t *);
-
-/* unistd.h */
-extern int rename(const char *, const char *);
-extern int ioctl(int, int, int *arg);
-extern int connect(int, struct sockaddr *, int);
-extern int readlink(const char *, char *, int);
-extern int symlink(const char *, const char *);
-extern int ftruncate(int, off_t);
-extern int fchmod(int, mode_t);
-extern int fchown(int, uid_t, gid_t);
-extern int lstat(const char *, struct stat *);
-extern int fstat(int, struct stat *);
-extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-extern int gethostname(char *, int);
-extern char *getwd(char *);
-extern int getpagesize(void);
-
-#endif /* SVR4 */
-
-#endif /* pr_sunos4_h___ */
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -26,20 +26,20 @@ PR_BEGIN_EXTERN_C
 /*
 ** NSPR's version is used to determine the likelihood that the version you
 ** used to build your component is anywhere close to being compatible with
 ** what is in the underlying library.
 **
 ** The format of the version string is
 **     "<major version>.<minor version>[.<patch level>] [<Beta>]"
 */
-#define PR_VERSION  "4.9.2"
+#define PR_VERSION  "4.9.5"
 #define PR_VMAJOR   4
 #define PR_VMINOR   9
-#define PR_VPATCH   2
+#define PR_VPATCH   5
 #define PR_BETA     PR_FALSE
 
 /*
 ** PRVersionCheck
 **
 ** The basic signature of the function that is called to provide version
 ** checking. The result will be a boolean that indicates the likelihood
 ** that the underling library will perform as the caller expects.
--- a/nsprpub/pr/include/private/primpl.h
+++ b/nsprpub/pr/include/private/primpl.h
@@ -1821,17 +1821,16 @@ extern void _PR_InitZones(void);
 extern void _PR_DestroyZones(void);
 #endif
 
 /* Overriding malloc, free, etc. */
 #if !defined(_PR_NO_PREEMPT) && defined(XP_UNIX) \
         && !defined(_PR_PTHREADS) && !defined(_PR_GLOBAL_THREADS_ONLY) \
         && !defined(PURIFY) \
         && !defined(DARWIN) \
-        && !defined(NEXTSTEP) \
         && !defined(QNX) \
         && !(defined (UNIXWARE) && defined (USE_SVR4_THREADS))
 #define _PR_OVERRIDE_MALLOC
 #endif
 
 /*************************************************************************
 * External machine-dependent code provided by each OS.                     *                                                                     *
 *************************************************************************/
--- a/nsprpub/pr/include/prlong.h
+++ b/nsprpub/pr/include/prlong.h
@@ -30,17 +30,17 @@ PR_BEGIN_EXTERN_C
 NSPR_API(PRInt64) LL_MaxInt(void);
 NSPR_API(PRInt64) LL_MinInt(void);
 NSPR_API(PRInt64) LL_Zero(void);
 NSPR_API(PRUint64) LL_MaxUint(void);
 
 #if defined(HAVE_LONG_LONG)
 
 /* Keep this in sync with prtypes.h. */
-#if PR_BYTES_PER_LONG == 8 && !defined(__APPLE__)
+#if PR_BYTES_PER_LONG == 8 && !defined(PR_ALTERNATE_INT64_TYPEDEF)
 #define LL_MAXINT   9223372036854775807L
 #define LL_MININT   (-LL_MAXINT - 1L)
 #define LL_ZERO     0L
 #define LL_MAXUINT  18446744073709551615UL
 #define LL_INIT(hi, lo)  ((hi ## L << 32) + lo ## L)
 #elif defined(WIN32) && !defined(__GNUC__)
 #define LL_MAXINT   9223372036854775807i64
 #define LL_MININT   (-LL_MAXINT - 1i64)
--- a/nsprpub/pr/include/prtime.h
+++ b/nsprpub/pr/include/prtime.h
@@ -241,35 +241,22 @@ NSPR_API(PRStatus) PR_ParseTimeStringToE
  * if the time/date string can't be parsed.
  */
 
 NSPR_API(PRStatus) PR_ParseTimeString (
 	const char *string,
 	PRBool default_to_gmt,
 	PRTime *result);
 
-/*
- * FIXME: should we also have a formatting function, such as asctime, ctime,
- * and strftime in standard C library?  But this would involve
- * internationalization issues.  Might want to provide a US English version.
- */
-
-/**********************************************************************/
-/*********************** OLD COMPATIBILITYFUNCTIONS *******************/
-/**********************************************************************/
-#ifndef NO_NSPR_10_SUPPORT
-
 /* Format a time value into a buffer. Same semantics as strftime() */
 NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt,
                                            const PRExplodedTime *tm);
 
 /* Format a time value into a buffer. Time is always in US English format, regardless
  * of locale setting.
  */
 NSPR_API(PRUint32)
 PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize,
                         const char* format, const PRExplodedTime* tm );
 
-#endif /* NO_NSPR_10_SUPPORT */
-
 PR_END_EXTERN_C
 
 #endif /* prtime_h___ */
--- a/nsprpub/pr/include/prtypes.h
+++ b/nsprpub/pr/include/prtypes.h
@@ -200,16 +200,46 @@
 ** MACROS:      PR_ARRAY_SIZE
 ** DESCRIPTION:
 **  The number of elements in an array.
 ***********************************************************************/
 #define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
 
 PR_BEGIN_EXTERN_C
 
+/*
+** Starting in NSPR 4.9.5, NSPR's exact-width integer types should match
+** the exact-width integer types defined in <stdint.h>. This allows sloppy
+** code to use PRInt{N} and int{N}_t interchangeably.
+**
+** The 8-bit and 16-bit integer types can only be defined using char and
+** short. All platforms define the 32-bit integer types using int. So only
+** the 64-bit integer types could be defined differently.
+**
+** NSPR's original strategy was to use the "shortest" 64-bit integer type:
+** if long is 64-bit, then prefer it over long long. This strategy is also
+** used by Linux/glibc, FreeBSD, and NetBSD.
+**
+** Other platforms use a different strategy: simply define the 64-bit
+** integer types using long long. We define the PR_ALTERNATE_INT64_TYPEDEF
+** macro on these platforms. Note that PR_ALTERNATE_INT64_TYPEDEF is for
+** internal use by NSPR headers only. Do not define or test this macro in
+** your code.
+**
+** NOTE: NSPR can't use <stdint.h> because C99 requires C++ code to define
+** __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS to make all the macros
+** defined in <stdint.h> available. This strange requirement is gone in
+** C11. When most platforms ignore this C99 requirement, NSPR will be able
+** to use <stdint.h>. A patch to do that is in NSPR bug 634793.
+*/
+
+#if defined(__APPLE__) || defined(__ANDROID__) || defined(__OpenBSD__)
+#define PR_ALTERNATE_INT64_TYPEDEF
+#endif
+
 /************************************************************************
 ** TYPES:       PRUint8
 **              PRInt8
 ** DESCRIPTION:
 **  The int8 types are known to be 8 bits each. There is no type that
 **      is equivalent to a plain "char".
 ************************************************************************/
 #if PR_BYTES_PER_BYTE == 1
@@ -326,22 +356,17 @@ typedef long PRInt32;
 ** MACROS:      PR_INT64_MAX
 **              PR_INT64_MIN
 **              PR_UINT64_MAX
 ** DESCRIPTION:
 **  The maximum and minimum values of a PRInt64 or PRUint64.
 ************************************************************************/
 #ifdef HAVE_LONG_LONG
 /* Keep this in sync with prlong.h. */
-/*
- * On 64-bit Mac OS X, uint64 needs to be defined as unsigned long long to
- * match uint64_t, otherwise our uint64 typedef conflicts with the uint64
- * typedef in cssmconfig.h, which CoreServices.h includes indirectly.
- */
-#if PR_BYTES_PER_LONG == 8 && !defined(__APPLE__)
+#if PR_BYTES_PER_LONG == 8 && !defined(PR_ALTERNATE_INT64_TYPEDEF)
 typedef long PRInt64;
 typedef unsigned long PRUint64;
 #define PR_INT64(x)  x ## L
 #define PR_UINT64(x) x ## UL
 #elif defined(WIN32) && !defined(__GNUC__)
 typedef __int64  PRInt64;
 typedef unsigned __int64 PRUint64;
 #define PR_INT64(x)  x ## i64
--- a/nsprpub/pr/src/Makefile.in
+++ b/nsprpub/pr/src/Makefile.in
@@ -28,19 +28,16 @@ ifeq ($(USE_CPLUS), 1)
 	DIRS += cplus
 endif
 
 #
 # Define platform-dependent OS_LIBS
 #
 
 ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OS_LIBS			= -lm
-else	# 4.1.3_U1
 MAPFILE = $(OBJDIR)/nsprmap.sun
 GARBAGE += $(MAPFILE)
 ifdef NS_USE_GCC
 ifdef GCC_USE_GNU_LD
 MKSHLIB += -Wl,--version-script,$(MAPFILE)
 else
 MKSHLIB += -Wl,-M,$(MAPFILE)
 endif
@@ -62,17 +59,16 @@ OS_LIBS			= -lpthread ${LIBRT} -lsocket 
 else
 OS_LIBS			= -lsocket -lnsl -ldl -lc
 endif	# USE_PTHREADS
 ifeq ($(CPU_ARCH),sparc)
 ifndef USE_64
 DSO_LDOPTS	+= -Wl,-f,\$$ORIGIN/cpu/\$$ISALIST/lib$(ULTRASPARC_LIBRARY)$(LIBRARY_VERSION).so
 endif
 endif	# sparc
-endif	# 4.1.3_U1
 endif	# SunOS
 
 ifeq ($(OS_ARCH), IRIX)
 ifeq ($(USE_PTHREADS), 1)
 OS_LIBS = -lpthread
 endif
 OS_LIBS += -lc
 endif
@@ -117,27 +113,32 @@ ifeq ($(OS_ARCH),OSF1)
 ifeq ($(USE_PTHREADS), 1)
 OS_LIBS 	= -lpthread -lrt
 endif
 ifneq ($(OS_RELEASE),V2.0)
 OS_LIBS		+= -lc_r
 endif
 endif
 
-ifeq ($(OS_ARCH),Linux)
+# Linux, GNU/Hurd, and GNU/kFreeBSD systems
+ifneq (,$(filter Linux GNU%,$(OS_ARCH)))
 ifeq ($(USE_PTHREADS), 1)
 ifeq ($(OS_TARGET),Android)
 # Android has no libpthread.so in NDK
 OS_LIBS		= -ldl
 else
 OS_LIBS		= -lpthread -ldl
 endif
 else
 OS_LIBS		= -ldl
 endif
+ifneq ($(OS_TARGET),Android)
+# Android has no librt - realtime functions are in libc
+OS_LIBS		+= -lrt
+endif
 endif
 
 ifeq ($(OS_ARCH),HP-UX)
 ifeq ($(USE_PTHREADS), 1)
 ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
 OS_LIBS 	= -ldce
 else
 OS_LIBS 	= -lpthread -lrt
@@ -157,20 +158,16 @@ DSO_LDOPTS	+= +I PR_HPUX10xInit
 endif
 endif
 endif
 
 ifeq ($(OS_ARCH),UNIXWARE)
 OS_LIBS		= -lsocket -lc
 endif
 
-ifeq ($(OS_ARCH),NEWS-OS)
-OS_LIBS		= -lsocket -lnsl -lgen -lresolv
-endif
-
 ifeq ($(OS_ARCH),WINNT)
 ifdef NS_USE_GCC
 OS_LIBS		= -ladvapi32 -lwsock32 -lwinmm
 else
 OS_LIBS		= advapi32.lib wsock32.lib winmm.lib
 endif
 endif
 
--- a/nsprpub/pr/src/cplus/tests/Makefile.in
+++ b/nsprpub/pr/src/cplus/tests/Makefile.in
@@ -64,22 +64,20 @@ ifeq ($(OS_ARCH), IRIX)
                 LDOPTS += -Wl,-woff,85
             endif
         endif
     endif
 endif
 
 # Solaris
 ifeq ($(OS_ARCH), SunOS)
-    ifneq ($(OS_RELEASE), 4.1.3_U1)
-        ifdef NS_USE_GCC
-            LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
-        else
-            LDOPTS += -R $(PWD)/$(dist_libdir)
-        endif
+    ifdef NS_USE_GCC
+        LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
+    else
+        LDOPTS += -R $(PWD)/$(dist_libdir)
     endif
 
 # SunOS 5.5 needs to link with -lpthread, even though we already
 # linked with this system library when we built libnspr.so.
     ifeq ($(OS_RELEASE), 5.5)
         ifdef USE_PTHREADS
             EXTRA_LIBS = -lpthread
         endif
@@ -131,34 +129,16 @@ ifeq ($(OS_ARCH), Linux)
     else
         LDOPTS += -Xlinker -rpath $(PWD)/$(dist_libdir)
         ifeq ($(USE_PTHREADS),1)
             EXTRA_LIBS = -lpthread
         endif
     endif
 endif
 
-ifeq ($(OS_ARCH), NCR)
-# XXX: We see some strange problems when we link with libnspr.so.
-# So for now we use static libraries on NCR.  The shared library
-# stuff below is commented out.
-LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
-LIBPL = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
-EXTRA_LIBS = -lsocket -lnsl -ldl
-
-# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
-# implicitly by $(CC)) again even though we already linked with these
-# system libraries when we built libnspr.so.
-#EXTRA_LIBS = -lsocket -lnsl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
-# option for ld on other platforms.
-#export LD_RUN_PATH = $(PWD)/$(dist_libdir)
-endif
-
 ifeq ($(OS_ARCH), SCO_SV)
 # SCO Unix needs to link against -lsocket again even though we
 # already linked with these system libraries when we built libnspr.so.
 EXTRA_LIBS = -lsocket
 # This hardcodes in the executable programs the directory to find
 # libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
 # option for ld on other platforms.
 export LD_RUN_PATH = $(PWD)/$(dist_libdir)
--- a/nsprpub/pr/src/io/Makefile.in
+++ b/nsprpub/pr/src/io/Makefile.in
@@ -9,23 +9,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 CSRCS = \
     prfdcach.c \
     prmwait.c \
     priometh.c \
     pripv6.c \
 	prmapopt.c \
     prlayer.c \
     prlog.c \
--- a/nsprpub/pr/src/io/prfile.c
+++ b/nsprpub/pr/src/io/prfile.c
@@ -360,26 +360,26 @@ PR_IMPLEMENT(PRFileDesc*) PR_OpenFile(
             _PR_MD_INIT_FD_INHERITABLE(fd, PR_FALSE);
         }
     }
     return fd;
 }
 
 PR_IMPLEMENT(PRInt32) PR_GetSysfdTableMax(void)
 {
-#if defined(XP_UNIX) && !defined(AIX) && !defined(NEXTSTEP) && !defined(QNX)
+#if defined(XP_UNIX) && !defined(AIX) && !defined(QNX)
     struct rlimit rlim;
 
     if ( getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
        /* XXX need to call PR_SetError() */
        return -1;
     }
 
     return rlim.rlim_max;
-#elif defined(AIX) || defined(NEXTSTEP) || defined(QNX)
+#elif defined(AIX) || defined(QNX)
     return sysconf(_SC_OPEN_MAX);
 #elif defined(WIN32)
     /*
      * There is a systemwide limit of 65536 user handles.
      */
     return 16384;
 #elif defined (WIN16)
     return FOPEN_MAX;
@@ -393,17 +393,17 @@ PR_IMPLEMENT(PRInt32) PR_GetSysfdTableMa
    return -1;
 #else
     write me;
 #endif
 }
 
 PR_IMPLEMENT(PRInt32) PR_SetSysfdTableSize(int table_size)
 {
-#if defined(XP_UNIX) && !defined(AIX) && !defined(NEXTSTEP) && !defined(QNX)
+#if defined(XP_UNIX) && !defined(AIX) && !defined(QNX)
     struct rlimit rlim;
     PRInt32 tableMax = PR_GetSysfdTableMax();
 
     if (tableMax < 0) 
         return -1;
 
     if (tableMax > FD_SETSIZE)
         tableMax = FD_SETSIZE;
@@ -428,17 +428,17 @@ PR_IMPLEMENT(PRInt32) PR_SetSysfdTableSi
       APIRET rc = NO_ERROR;
       rc = DosSetMaxFH(table_size);
       if (rc == NO_ERROR)
         return table_size;
       else
         return -1;
     } 
     return tableMax;
-#elif defined(AIX) || defined(NEXTSTEP) || defined(QNX) \
+#elif defined(AIX) || defined(QNX) \
         || defined(WIN32) || defined(WIN16) || defined(XP_BEOS)
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
     return -1;
 #else
     write me;
 #endif
 }
 
--- a/nsprpub/pr/src/io/prlayer.c
+++ b/nsprpub/pr/src/io/prlayer.c
@@ -518,16 +518,21 @@ PR_IMPLEMENT(PRStatus) PR_PushIOLayer(
     if (stack == insert)
     {
 		/* going on top of the stack */
 		/* old-style stack */	
 		PRFileDesc copy = *stack;
 		*stack = *fd;
 		*fd = copy;
 		fd->higher = stack;
+		if (fd->lower)
+		{
+			PR_ASSERT(fd->lower->higher == stack);
+			fd->lower->higher = fd;
+		}
 		stack->lower = fd;
 		stack->higher = NULL;
 	} else {
         /*
 		 * going somewhere in the middle of the stack for both old and new
 		 * style stacks, or going on top of stack for new style stack
 		 */
         fd->lower = insert;
@@ -556,16 +561,20 @@ PR_IMPLEMENT(PRFileDesc*) PR_PopIOLayer(
     if (extract == stack) {
         /* popping top layer of the stack */
 		/* old style stack */
         PRFileDesc copy = *stack;
         extract = stack->lower;
         *stack = *extract;
         *extract = copy;
         stack->higher = NULL;
+        if (stack->lower) {
+            PR_ASSERT(stack->lower->higher == extract);
+            stack->lower->higher = stack;
+        }
 	} else if ((PR_IO_LAYER_HEAD == stack->identity) &&
 					(extract == stack->lower) && (extract->lower == NULL)) {
 			/*
 			 * new style stack
 			 * popping the only layer in the stack; delete the stack too
 			 */
 			stack->lower = NULL;
 			_PR_DestroyIOLayer(stack);
--- a/nsprpub/pr/src/io/prmapopt.c
+++ b/nsprpub/pr/src/io/prmapopt.c
@@ -28,21 +28,16 @@
 #endif
 #ifndef IP_TOS
 #define IP_TOS 8
 #endif
 #endif
 
 #include "primpl.h"
 
-#if defined(NEXTSTEP)
-/* NEXTSTEP is special: this must come before netinet/tcp.h. */
-#include <netinet/in_systm.h>  /* n_short, n_long, n_time */
-#endif
-
 #ifdef HAVE_NETINET_TCP_H
 #include <netinet/tcp.h>  /* TCP_NODELAY, TCP_MAXSEG */
 #endif
 
 #ifndef _PR_PTHREADS
 
 PRStatus PR_CALLBACK _PR_SocketGetSocketOption(PRFileDesc *fd, PRSocketOptionData *data)
 {
@@ -354,25 +349,19 @@ PRStatus PR_CALLBACK _PR_SocketSetSocket
  * appropriate header files.  Then any undefined socket options
  * are really missing.
  */
 
 #if !defined(SO_LINGER)
 #error "SO_LINGER is not defined"
 #endif
 
-/*
- * Some platforms, such as NCR 2.03, don't have TCP_NODELAY defined
- * in <netinet/tcp.h>
- */
-#if !defined(NCR)
 #if !defined(TCP_NODELAY)
 #error "TCP_NODELAY is not defined"
 #endif
-#endif
 
 /*
  * Make sure the value of _PR_NO_SUCH_SOCKOPT is not
  * a valid socket option.
  */
 #define _PR_NO_SUCH_SOCKOPT -1
 
 #ifndef SO_KEEPALIVE
--- a/nsprpub/pr/src/io/prscanf.c
+++ b/nsprpub/pr/src/io/prscanf.c
@@ -11,19 +11,16 @@
  * Acknowledgment: The implementation is inspired by the source code
  * in P.J. Plauger's "The Standard C Library," Prentice-Hall, 1992.
  */
 
 #include <limits.h>
 #include <ctype.h>
 #include <string.h>
 #include <stdlib.h>
-#ifdef SUNOS4
-#include "md/sunos4.h"  /* for strtoul */
-#endif
 #include "prprf.h"
 #include "prdtoa.h"
 #include "prlog.h"
 #include "prerror.h"
 
 /*
  * A function that reads a character from 'stream'.
  * Returns the character read, or EOF if end of stream is reached.
--- a/nsprpub/pr/src/linking/Makefile.in
+++ b/nsprpub/pr/src/linking/Makefile.in
@@ -10,23 +10,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 CSRCS =           \
 	prlink.c   \
 	$(NULL)
 
 TARGETS	= $(OBJS)
 
 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
--- a/nsprpub/pr/src/linking/prlink.c
+++ b/nsprpub/pr/src/linking/prlink.c
@@ -49,18 +49,18 @@
 #endif
 #endif /* XP_UNIX */
 
 #define _PR_DEFAULT_LD_FLAGS PR_LD_LAZY
 
 /*
  * On these platforms, symbols have a leading '_'.
  */
-#if defined(SUNOS4) || (defined(DARWIN) && defined(USE_MACH_DYLD)) \
-    || defined(NEXTSTEP) || defined(XP_OS2) \
+#if (defined(DARWIN) && defined(USE_MACH_DYLD)) \
+    || defined(XP_OS2) \
     || ((defined(OPENBSD) || defined(NETBSD)) && !defined(__ELF__))
 #define NEED_LEADING_UNDERSCORE
 #endif
 
 #define PR_LD_PATHW 0x8000  /* for PR_LibSpec_PathnameU */
 
 /************************************************************************/
 
@@ -954,22 +954,29 @@ pr_LoadLibraryByPathname(const char *nam
 ** Unload a shared library which was loaded via PR_LoadLibrary
 */
 PR_IMPLEMENT(PRStatus) 
 PR_UnloadLibrary(PRLibrary *lib)
 {
     int result = 0;
     PRStatus status = PR_SUCCESS;
 
-    if ((lib == 0) || (lib->refCount <= 0)) {
+    if (lib == 0) {
         PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
         return PR_FAILURE;
     }
 
     PR_EnterMonitor(pr_linker_lock);
+
+    if (lib->refCount <= 0) {
+        PR_ExitMonitor(pr_linker_lock);
+        PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
+        return PR_FAILURE;
+    }
+
     if (--lib->refCount > 0) {
     PR_LOG(_pr_linker_lm, PR_LOG_MIN,
            ("%s decr => %d",
         lib->name, lib->refCount));
     goto done;
     }
 
 #ifdef XP_BEOS
--- a/nsprpub/pr/src/malloc/Makefile.in
+++ b/nsprpub/pr/src/malloc/Makefile.in
@@ -9,23 +9,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 TARGETS	= $(OBJS)
 
 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
 DEFINES += -D_NSPR_BUILD_
 
 CSRCS = prmalloc.c prmem.c
 
--- a/nsprpub/pr/src/md/beos/beos_errors.c
+++ b/nsprpub/pr/src/md/beos/beos_errors.c
@@ -984,17 +984,17 @@ void _MD_unix_map_connect_error(int err)
 			break;
 		case EINTR:
 			PR_SetError(PR_PENDING_INTERRUPT_ERROR, err);
 			break;
 		case EINVAL:
 			PR_SetError(PR_INVALID_ARGUMENT_ERROR, err);
 			break;
 		case EIO:
-#if defined(UNIXWARE) || defined(SNI) || defined(NEC)
+#if defined(UNIXWARE)
 			/*
 			 * On some platforms, if we connect to a port on
 			 * the local host (the loopback address) that no
 			 * process is listening on, we get EIO instead
 			 * of ECONNREFUSED.
 			 */
 			PR_SetError(PR_CONNECT_REFUSED_ERROR, err);
 #else
--- a/nsprpub/pr/src/md/prosdep.c
+++ b/nsprpub/pr/src/md/prosdep.c
@@ -4,19 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "prbit.h"
 #include "prsystem.h"
 
 #ifdef XP_UNIX
 #include <unistd.h>
 #endif
-#ifdef SUNOS4
-#include "md/sunos4.h"
-#endif
 #ifdef _WIN32
 #include <windows.h>
 #endif 
 #ifdef XP_BEOS
 #include <OS.h>
 #endif
 
 PRInt32 _pr_pageShift;
@@ -26,20 +23,20 @@ PRInt32 _pr_pageSize;
 ** Get system page size
 */
 static void GetPageSize(void)
 {
 	PRInt32 pageSize;
 
     /* Get page size */
 #ifdef XP_UNIX
-#if defined SUNOS4 || defined BSDI || defined AIX \
+#if defined BSDI || defined AIX \
         || defined LINUX || defined __GNU__ || defined __GLIBC__ \
         || defined FREEBSD || defined NETBSD || defined OPENBSD \
-        || defined DARWIN || defined NEXTSTEP || defined SYMBIAN
+        || defined DARWIN || defined SYMBIAN
     _pr_pageSize = getpagesize();
 #elif defined(HPUX)
     /* I have no idea. Don't get me started. --Rob */
     _pr_pageSize = sysconf(_SC_PAGE_SIZE);
 #else
     _pr_pageSize = sysconf(_SC_PAGESIZE);
 #endif
 #endif /* XP_UNIX */
--- a/nsprpub/pr/src/md/unix/Makefile.in
+++ b/nsprpub/pr/src/md/unix/Makefile.in
@@ -31,45 +31,42 @@ CSRCS += pthreads_user.c
 endif
 
 CSRCS += $(PR_MD_CSRCS)
 ASFILES += $(PR_MD_ASFILES)
 
 TARGETS = $(OBJS)
 
 ifeq ($(OS_ARCH),SunOS)
-	ifneq ($(OS_RELEASE),4.1.3_U1)
-		ifeq ($(CPU_ARCH),sparc)
+	ifeq ($(CPU_ARCH),sparc)
 		ifdef USE_64
 			ULTRASPARC_ASFILES = os_SunOS_sparcv9.s
 			ULTRASPARC_ASOBJS = $(addprefix $(OBJDIR)/,$(ULTRASPARC_ASFILES:.s=.$(OBJ_SUFFIX)))
 		else
 			LIBRARY_NAME = $(ULTRASPARC_LIBRARY)
 			LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
 			ULTRASPARC_ASFILES = os_SunOS_ultrasparc.s
 			ULTRASPARC_ASOBJS = $(addprefix $(OBJDIR)/,$(ULTRASPARC_ASFILES:.s=.$(OBJ_SUFFIX)))
 			TARGETS		+= $(ULTRASPARC_ASOBJS) $(SHARED_LIBRARY)
 			RELEASE_LIBS = $(SHARED_LIBRARY)
 			RELEASE_LIBS_DEST = $(RELEASE_LIB_DIR)/cpu/sparcv8plus
 			lib_subdir = cpu/sparcv8plus
 		endif
-		endif
 	endif
 endif
 
 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
 DEFINES	+= -D_NSPR_BUILD_
 
 include $(topsrcdir)/config/rules.mk
 
 export:: $(TARGETS)
 
 ifeq ($(OS_ARCH),SunOS)
-ifneq ($(OS_RELEASE),4.1.3_U1)
 ifeq ($(CPU_ARCH),sparc)
 
 ifdef USE_64
 $(ULTRASPARC_ASOBJS): $(ULTRASPARC_ASFILES)
 	/usr/ccs/bin/as -o $@ -K PIC -P -D_ASM -D__STDC__=0 -xarch=v9 $<
 else
 $(SHARED_LIBRARY): $(ULTRASPARC_ASOBJS)
 	$(LD) -G -z text -z endfiltee -o $@ $(ULTRASPARC_ASOBJS)
@@ -95,9 +92,8 @@ endif
 	/usr/ccs/bin/as -o $@ -K PIC -P -D_ASM -D__STDC__=0 -xarch=v8plus $<
 
 clean::
 	rm -rf $(ULTRASPARC_ASOBJS)
 endif
 
 endif
 endif
-endif
--- a/nsprpub/pr/src/md/unix/darwin.c
+++ b/nsprpub/pr/src/md/unix/darwin.c
@@ -1,19 +1,54 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "primpl.h"
 
+#include <mach/mach_time.h>
+
 void _MD_EarlyInit(void)
 {
 }
 
+/*
+ * The multiplier (as a fraction) for converting the Mach absolute time
+ * unit to nanoseconds.
+ */
+static mach_timebase_info_data_t machTimebaseInfo;
+
+void _PR_Mach_IntervalInit(void)
+{
+    kern_return_t rv;
+
+    rv = mach_timebase_info(&machTimebaseInfo);
+    PR_ASSERT(rv == KERN_SUCCESS);
+}
+
+PRIntervalTime _PR_Mach_GetInterval(void)
+{
+    uint64_t time;
+
+    /*
+     * mach_absolute_time returns the time in the Mach absolute time unit.
+     * Convert it to milliseconds. See Mac Technical Q&A QA1398.
+     */
+    time = mach_absolute_time();
+    time = time * machTimebaseInfo.numer / machTimebaseInfo.denom /
+           PR_NSEC_PER_MSEC;
+    return (PRIntervalTime)time;
+}  /* _PR_Mach_GetInterval */
+
+PRIntervalTime _PR_Mach_TicksPerSecond(void)
+{
+    return 1000;
+}
+
 PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
 {
 #if !defined(_PR_PTHREADS)
     if (isCurrent) {
 	(void) setjmp(CONTEXT(t));
     }
     *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
     return (PRWord *) CONTEXT(t);
deleted file mode 100644
--- a/nsprpub/pr/src/md/unix/ncr.c
+++ /dev/null
@@ -1,363 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * NCR 3.0  - cloned from UnixWare by ruslan
- */
-#include "primpl.h"
-
-#include <setjmp.h>
-
-void _MD_EarlyInit(void)
-{
-}
-
-PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
-{
-    if (isCurrent) {
-	(void) setjmp(CONTEXT(t));
-    }
-    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
-    return (PRWord *) CONTEXT(t);
-}
-
-#ifdef ALARMS_BREAK_TCP /* I don't think they do */
-
-PRInt32 _MD_connect(PRInt32 osfd, const PRNetAddr *addr, PRInt32 addrlen,
-                        PRIntervalTime timeout)
-{
-    PRInt32 rv;
-
-    _MD_BLOCK_CLOCK_INTERRUPTS();
-    rv = _connect(osfd,addr,addrlen);
-    _MD_UNBLOCK_CLOCK_INTERRUPTS();
-}
-
-PRInt32 _MD_accept(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen,
-                        PRIntervalTime timeout)
-{
-    PRInt32 rv;
-
-    _MD_BLOCK_CLOCK_INTERRUPTS();
-    rv = _accept(osfd,addr,addrlen);
-    _MD_UNBLOCK_CLOCK_INTERRUPTS();
-    return(rv);
-}
-#endif
-
-/*
- * These are also implemented in pratom.c using NSPR locks.  Any reason
- * this might be better or worse?  If you like this better, define
- * _PR_HAVE_ATOMIC_OPS in include/md/unixware.h
- */
-#ifdef _PR_HAVE_ATOMIC_OPS
-/* Atomic operations */
-#include  <stdio.h>
-static FILE *_uw_semf;
-
-void
-_MD_INIT_ATOMIC(void)
-{
-    /* Sigh.  Sure wish SYSV semaphores weren't such a pain to use */
-    if ((_uw_semf = tmpfile()) == NULL)
-        PR_ASSERT(0);
-
-    return;
-}
-
-void
-_MD_ATOMIC_INCREMENT(PRInt32 *val)
-{
-    flockfile(_uw_semf);
-    (*val)++;
-    unflockfile(_uw_semf);
-}
-
-void
-_MD_ATOMIC_ADD(PRInt32 *ptr, PRInt32 val)
-{
-    flockfile(_uw_semf);
-    (*ptr) += val;
-    unflockfile(_uw_semf);
-}
-
-
-void
-_MD_ATOMIC_DECREMENT(PRInt32 *val)
-{
-    flockfile(_uw_semf);
-    (*val)--;
-    unflockfile(_uw_semf);
-}
-
-void
-_MD_ATOMIC_SET(PRInt32 *val, PRInt32 newval)
-{
-    flockfile(_uw_semf);
-    *val = newval;
-    unflockfile(_uw_semf);
-}
-#endif
-
-void
-_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
-{
-    return;
-}
-
-PRStatus
-_MD_InitializeThread(PRThread *thread)
-{
-	return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
-{
-    PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    _PR_MD_SWITCH_CONTEXT(thread);
-    return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAKEUP_WAITER(PRThread *thread)
-{
-    if (thread) {
-	PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    }
-    return PR_SUCCESS;
-}
-
-/* These functions should not be called for Unixware */
-void
-_MD_YIELD(void)
-{
-    PR_NOT_REACHED("_MD_YIELD should not be called for Unixware.");
-}
-
-PRStatus
-_MD_CREATE_THREAD(
-    PRThread *thread,
-    void (*start) (void *),
-    PRUintn priority,
-    PRThreadScope scope,
-    PRThreadState state,
-    PRUint32 stackSize)
-{
-    PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for Unixware.");
-    return PR_FAILURE;
-}
-
-/*
- This is temp. replacement for localtime_r. Normally PR_ExplodeTime should
- be used as to my understanding
-*/
-
-/*
-** $$$$$ THEN WHY ARE WE DOING THIS? - AOF $$$$$
-*/
-
-#define NEED_LOCALTIME_R
-#define NEED_GMTIME_R
-#define NEED_ASCTIME_R
-#define NEED_STRTOK_R
-#define NEED_CTIME_R
-
-#if defined (NEED_LOCALTIME_R) || defined (NEED_CTIME_R) || defined (NEED_ASCTIME_R) || defined (NEED_GMTIME_R) || defined (NEED_STRTOK_R)
-#include "prlock.h"
-#endif
-
-#if defined (NEED_LOCALTIME_R)
-
-static PRLock *localtime_r_monitor = NULL;
-
-struct tm *localtime_r (const time_t *clock, struct tm *result)
-{
-    struct tm *tmPtr;
-    int needLock = PR_Initialized();  /* We need to use a lock to protect
-                                       * against NSPR threads only when the
-                                       * NSPR thread system is activated. */
-
-    if (needLock) {
-        if (localtime_r_monitor == NULL) {
-
-            localtime_r_monitor = PR_NewLock();
-        }
-        PR_Lock(localtime_r_monitor);
-    }
-
-    /*
-     * On Windows, localtime() returns a NULL pointer if 'clock'
-     * represents a time before midnight January 1, 1970.  In
-     * that case, we also return a NULL pointer and the struct tm
-     * object pointed to by 'result' is not modified.
-     */
-
-    tmPtr = localtime(clock);
-    if (tmPtr) {
-        *result = *tmPtr;
-    } else {
-        result = NULL;
-    }
-
-    if (needLock) PR_Unlock(localtime_r_monitor);
-
-    return result;
-}
-
-#endif
-
-#if defined (NEED_GMTIME_R)
-
-static PRLock *gmtime_r_monitor = NULL;
-
-struct tm *gmtime_r (const time_t *clock, struct tm *result)
-{
-    struct tm *tmPtr;
-    int needLock = PR_Initialized();  /* We need to use a lock to protect
-                                       * against NSPR threads only when the
-                                       * NSPR thread system is activated. */
-
-    if (needLock) {
-        if (gmtime_r_monitor == NULL) {
-            gmtime_r_monitor = PR_NewLock();
-        }
-        PR_Lock(gmtime_r_monitor);
-    }
-
-    tmPtr = gmtime(clock);
-    if (tmPtr) {
-        *result = *tmPtr;
-    } else {
-        result = NULL;
-    }
-
-    if (needLock) PR_Unlock(gmtime_r_monitor);
-
-    return result;
-}
-
-#endif
-
-#if defined (NEED_CTIME_R)
-
-static PRLock *ctime_r_monitor = NULL;
-
-char  *ctime_r (const time_t *clock, char *buf, int buflen)
-{
-    char *cbuf;
-    int needLock = PR_Initialized();  /* We need to use a lock to protect
-                                       * against NSPR threads only when the
-                                       * NSPR thread system is activated. */
-
-    if (needLock) {
-
-        if (ctime_r_monitor == NULL) {
-            ctime_r_monitor = PR_NewLock();
-        }
-        PR_Lock(ctime_r_monitor);
-    }
-
-    cbuf = ctime (clock);
-    if (cbuf) {
-        strncpy (buf, cbuf, buflen - 1);
-        buf[buflen - 1] = 0;
-    }
-
-    if (needLock) PR_Unlock(ctime_r_monitor);
-
-    return cbuf;
-}
-
-#endif
-
-#if defined (NEED_ASCTIME_R)
-
-static PRLock *asctime_r_monitor = NULL;
-
-
-char  *asctime_r (const struct tm  *tm, char *buf, int buflen)
-{
-    char *cbuf;
-    int needLock = PR_Initialized();  /* We need to use a lock to protect
-                                       * against NSPR threads only when the
-                                       * NSPR thread system is activated. */
-
-    if (needLock) {
-        if (asctime_r_monitor == NULL) {
-            asctime_r_monitor = PR_NewLock();
-        }
-        PR_Lock(asctime_r_monitor);
-    }
-
-    cbuf = asctime (tm);
-    if (cbuf) {
-        strncpy (buf, cbuf, buflen - 1);
-        buf[buflen - 1] = 0;
-    }
-
-    if (needLock) PR_Unlock(asctime_r_monitor);
-
-    return cbuf;
-
-}
-#endif
-
-#if defined (NEED_STRTOK_R)
-
-char *
-strtok_r (s, delim, last)
-        register char *s;
-        register const char *delim;
-        register char **last;
-{
-        register char *spanp;
-        register int c, sc;
-        char *tok;
-
-
-        if (s == NULL && (s = *last) == NULL)
-                return (NULL);
-
-        /*
-         * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
-         */
-cont:
-
-        c = *s++;
-        for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
-                if (c == sc)
-                        goto cont;
-        }
-
-        if (c == 0) {           /* no non-delimiter characters */
-                *last = NULL;
-                return (NULL);
-        }
-        tok = s - 1;
-
-        /*
-         * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
-         * Note that delim must have one NUL; we stop if we see that, too.
-         */
-        for (;;) {
-                c = *s++;
-                spanp = (char *)delim;
-                do {
-                        if ((sc = *spanp++) == c) {
-                                if (c == 0)
-                                        s = NULL;
-
-                                else
-                                        s[-1] = 0;
-                                *last = s;
-                                return (tok);
-                        }
-                } while (sc != 0);
-        }
-        /* NOTREACHED */
-}
-
-#endif
deleted file mode 100644
--- a/nsprpub/pr/src/md/unix/nec.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "primpl.h"
-
-void _MD_EarlyInit(void)
-{
-}
-
-PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
-{
-    if (isCurrent) {
-	(void) setjmp(CONTEXT(t));
-    }
-    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
-    return (PRWord *) CONTEXT(t);
-}
-
-void
-_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
-{
-    return;
-}
-
-PRStatus
-_MD_InitializeThread(PRThread *thread)
-{
-	return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
-{
-    PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    _PR_MD_SWITCH_CONTEXT(thread);
-    return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAKEUP_WAITER(PRThread *thread)
-{
-    if (thread) {
-	PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    }
-    return PR_SUCCESS;
-}
-
-/* These functions should not be called for NEC */
-void
-_MD_YIELD(void)
-{
-    PR_NOT_REACHED("_MD_YIELD should not be called for NEC.");
-}
-
-PRStatus
-_MD_CREATE_THREAD(
-    PRThread *thread,
-    void (*start) (void *),
-    PRThreadPriority priority,
-    PRThreadScope scope,
-    PRThreadState state,
-    PRUint32 stackSize)
-{
-    PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for NEC.");
-	return PR_FAILURE;
-}
deleted file mode 100644
--- a/nsprpub/pr/src/md/unix/nextstep.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "primpl.h"
-
-#import <mach/mach.h>
-#import <mach/mach_error.h>
-#import <mach-o/dyld.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <syscall.h>
-
-
-
-/*	These functions are hidden in NEXTSTEP, but beacuse they have syscall()
-**	entries I can wrap these into their corresponding missing function.
-*/
-caddr_t
-mmap(caddr_t addr, size_t len, int prot, int flags,
-          int fildes, off_t off)
-{
-	return (caddr_t) syscall (SYS_mmap, addr, len, prot, flags, fildes, off);
-}
-
-int
-munmap(caddr_t addr, size_t len)
-{
-	return syscall (SYS_munmap, addr, len);
-}
-
-int
-mprotect(caddr_t addr, size_t len, int prot)
-{
-	return syscall (SYS_mprotect, addr, len, prot);
-}
-
-
-/* If found the brk() symbol in the sahred libraries but no syscall() entry ...
-** I don't know whether it will work ...
-int brk(void *endds)
-{
-	return syscall ();
-}
-*/
-
-void *sbrk(int incr)
-{
-	return (void *) syscall (SYS_sbrk, incr);
-}
-
-/*	These are my mach based versions, untested and probably bad ...
-*/
-caddr_t my_mmap(caddr_t addr, size_t len, int prot, int flags,
-          int fildes, off_t off)
-{
-	kern_return_t ret_val;
-	
-	/*	First map ...
-	*/
-	ret_val = map_fd ( fildes, 					/* fd				*/
-	                  (vm_offset_t) off,		/* offset			*/
-					  (vm_offset_t*)&addr,		/* address			*/
-					  TRUE, 					/* find_space		*/
-					  (vm_size_t) len);			/* size				*/
-
-	if (ret_val != KERN_SUCCESS) {
-    	mach_error("Error calling map_fd() in mmap", ret_val );
-		return (caddr_t)0;
-	}
-	
-	/*	... then protect (this is probably bad)
-	*/
-	ret_val = vm_protect( task_self(),			/* target_task 		*/
-						 (vm_address_t)addr,	/* address			*/
-						 (vm_size_t) len,		/* size 			*/
-						 FALSE,					/* set_maximum		*/
-						 (vm_prot_t) prot);		/* new_protection	*/
-	if (ret_val != KERN_SUCCESS) {
-		mach_error("vm_protect in mmap()", ret_val );
-		return (caddr_t)0;
-	}
-	
-	return addr;
-}
-
-int my_munmap(caddr_t addr, size_t len)
-{
-	kern_return_t ret_val;
-
-	ret_val = vm_deallocate(task_self(),
-	 						(vm_address_t) addr,
-							(vm_size_t) len);
-
-	if (ret_val != KERN_SUCCESS) {
-		mach_error("vm_deallocate in munmap()", ret_val);
-		return -1;
-	}
-	
-	return 0;
-}
-
-int my_mprotect(caddr_t addr, size_t len, int prot)
-{
-	vm_prot_t mach_prot;
-	kern_return_t ret_val;
-	
-	switch (prot) {
-		case PROT_READ:		mach_prot = VM_PROT_READ;		break;
-		case PROT_WRITE:	mach_prot = VM_PROT_WRITE;		break;
-		case PROT_EXEC:		mach_prot = VM_PROT_EXECUTE;	break;
-		case PROT_NONE:		mach_prot = VM_PROT_NONE;		break;
-	}
-	
-	ret_val = vm_protect(task_self(),			/* target_task 		*/
-						 (vm_address_t)addr,	/* address			*/
-						 (vm_size_t) len,		/* size 			*/
-						 FALSE,					/* set_maximum		*/
-						 (vm_prot_t) prot);		/* new_protection	*/
-
-	if (ret_val != KERN_SUCCESS) {
-		mach_error("vm_protect in mprotect()", ret_val);
-		return -1;
-	}
-	
-	return 0;
-}
-
-char *strdup(const char *s1)
-{
-	int len = strlen (s1);
-	char *copy = (char*) malloc (len+1);
-	
-	if (copy == (char*)0)
-		return (char*)0;
-
-	strcpy (copy, s1);
-
-	return copy;
-}
-
-/* Stub rld functions
-*/
-extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromFile(
-    const char *pathName,
-    NSObjectFileImage *objectFileImage)
-{
-	return NSObjectFileImageFailure;
-}
-
-extern void * NSAddressOfSymbol(
-    NSSymbol symbol)
-{
-	return NULL;
-}
-
-extern NSModule NSLinkModule(
-    NSObjectFileImage objectFileImage, 
-    const char *moduleName, /* can be NULL */
-    enum bool bindNow)
-{
-	return NULL;
-}
-
-extern NSSymbol NSLookupAndBindSymbol(
-    const char *symbolName)
-{
-	return NULL;
-}
-
-extern enum bool NSUnLinkModule(
-    NSModule module, 
-    enum bool keepMemoryMapped)
-{
-	return 0;
-}
-
-
-
-void _MD_EarlyInit(void)
-{
-}
-
-PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
-{
-#ifndef _PR_PTHREADS
-    if (isCurrent) {
-	(void) sigsetjmp(CONTEXT(t), 1);
-    }
-    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
-    return (PRWord *) CONTEXT(t);
-#else
-	*np = 0;
-	return NULL;
-#endif
-}
-
-#ifndef _PR_PTHREADS
-
-void
-_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
-{
-    return;
-}
-
-PRStatus
-_MD_InitializeThread(PRThread *thread)
-{
-	return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
-{
-    PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    _PR_MD_SWITCH_CONTEXT(thread);
-    return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAKEUP_WAITER(PRThread *thread)
-{
-    if (thread) {
-	PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    }
-    return PR_SUCCESS;
-}
-
-/* These functions should not be called for NEXTSTEP */
-void
-_MD_YIELD(void)
-{
-    PR_NOT_REACHED("_MD_YIELD should not be called for NEXTSTEP.");
-}
-
-PRStatus
-_MD_CREATE_THREAD(
-    PRThread *thread,
-    void (*start) (void *),
-    PRThreadPriority priority,
-    PRThreadScope scope,
-    PRThreadState state,
-    PRUint32 stackSize)
-{
-    PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for NEXTSTEP.");
-	return PR_FAILURE;
-}
-
-#endif
deleted file mode 100644
--- a/nsprpub/pr/src/md/unix/os_ReliantUNIX.s
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* We want position independent code */
-#define PIC
-
-#include <sys/asm.h>
-#include <sys/regdef.h>
-#include <sys/syscall.h>
-
-	.file 1 "os_ReliantUNIX.s"
-	.option pic2
-	.text
-
-	.align	2
-	.globl	getcxt
-	.ent	getcxt
-getcxt:
-	.frame	sp,0,$31		# vars= 0, regs= 0/0, args= 0, extra= 0
-	# saved integer regs
-	sw	ra,180(a0)	# gpregs[CXT_EPC]
-	sw	gp,152(a0)	# gpregs[CXT_GP]
-	sw	sp,156(a0)	# gpregs[CXT_SP]
-	sw	s8,160(a0)	# gpregs[CXT_S8]
-	sw	s0,104(a0)	# gpregs[CXT_S0]
-	sw	s1,108(a0)	# gpregs[CXT_S1]
-	sw	s2,112(a0)	# gpregs[CXT_S2]
-	sw	s3,116(a0)	# gpregs[CXT_S3]
-	sw	s4,120(a0)	# gpregs[CXT_S4]
-	sw	s5,124(a0)	# gpregs[CXT_S5]
-	sw	s6,128(a0)	# gpregs[CXT_S6]
-	sw	s7,132(a0)	# gpregs[CXT_S7]
-	# csr
-	cfc1	v0,$31
-	# saved float regs
-	s.d	$f20,264(a0)	# fpregs.fp_r.fp_dregs[10]
-	s.d	$f22,272(a0)	# fpregs.fp_r.fp_dregs[11]
-	s.d	$f24,280(a0)	# fpregs.fp_r.fp_dregs[12]
-	s.d	$f26,288(a0)	# fpregs.fp_r.fp_dregs[13]
-	s.d	$f28,296(a0)	# fpregs.fp_r.fp_dregs[14]
-	s.d	$f30,304(a0)	# fpregs.fp_r.fp_dregs[15]
-	sw	v0,312(a0)	# fpregs.fp_csr
-
-	# give no illusions about the contents
-	li	v0,0x0c		# UC_CPU | UC_MAU
-	sw	v0,0(a0)	# uc_flags
-
-	move	v0,zero
-	j	ra
-	.end	getcxt
-
-	.align	2
-	.globl	setcxt
-	.ent	setcxt
-setcxt:
-	.frame	sp,0,$31		# vars= 0, regs= 0/0, args= 0, extra= 0
-	lw	v0,312(a0)	# fpregs.fp_csr
-	li	v1,0xfffc0fff	# mask out exception cause bits
-	and	v0,v0,v1
-	# saved integer regs
-	lw	t9,180(a0)	# gpregs[CXT_EPC]
-	lw	ra,180(a0)	# gpregs[CXT_EPC]
-	lw	gp,152(a0)	# gpregs[CXT_GP]
-	lw	sp,156(a0)	# gpregs[CXT_SP]
-	ctc1	v0,$31		# fp_csr
-	lw	s8,160(a0)	# gpregs[CXT_S8]
-	lw	s0,104(a0)	# gpregs[CXT_S0]
-	lw	s1,108(a0)	# gpregs[CXT_S1]
-	lw	s2,112(a0)	# gpregs[CXT_S2]
-	lw	s3,116(a0)	# gpregs[CXT_S3]
-	lw	s4,120(a0)	# gpregs[CXT_S4]
-	lw	s5,124(a0)	# gpregs[CXT_S5]
-	lw	s6,128(a0)	# gpregs[CXT_S6]
-	lw	s7,132(a0)	# gpregs[CXT_S7]
-	# saved float regs
-	l.d	$f20,264(a0)	# fpregs.fp_r.fp_dregs[10]
-	l.d	$f22,272(a0)	# fpregs.fp_r.fp_dregs[11]
-	l.d	$f24,280(a0)	# fpregs.fp_r.fp_dregs[12]
-	l.d	$f26,288(a0)	# fpregs.fp_r.fp_dregs[13]
-	l.d	$f28,296(a0)	# fpregs.fp_r.fp_dregs[14]
-	l.d	$f30,304(a0)	# fpregs.fp_r.fp_dregs[15]
-
-	# load these, too
-	# they were not saved, but maybe the user modified them...
-	lw	v0,48(a0)
-	lw	v1,52(a0)
-	lw	a1,60(a0)
-	lw	a2,64(a0)
-	lw	a3,68(a0)
-	lw	a0,56(a0)	# there is no way back
-
-	j	ra
-
-	.end	setcxt
deleted file mode 100644
--- a/nsprpub/pr/src/md/unix/reliantunix.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * SINIX (ReliantUNIX) 5.4 - copied from unixware.c by chrisk 040497
- */
-#include "primpl.h"
-
-#include <ucontext.h>
-
-void _MD_EarlyInit(void)
-{
-}
-
-PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
-{
-    if (isCurrent) {
-	(void) _GETCONTEXT(CONTEXT(t));
-    }
-    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
-    return (PRWord *) CONTEXT(t);
-}
-
-#ifdef ALARMS_BREAK_TCP /* I don't think they do */
-
-PRInt32 _MD_connect(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen,
-                        PRIntervalTime timeout)
-{
-    PRInt32 rv;
-
-    _MD_BLOCK_CLOCK_INTERRUPTS();
-    rv = _connect(osfd,addr,addrlen);
-    _MD_UNBLOCK_CLOCK_INTERRUPTS();
-}
-
-PRInt32 _MD_accept(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen,
-                        PRIntervalTime timeout)
-{
-    PRInt32 rv;
-
-    _MD_BLOCK_CLOCK_INTERRUPTS();
-    rv = _accept(osfd,addr,addrlen);
-    _MD_UNBLOCK_CLOCK_INTERRUPTS();
-    return(rv);
-}
-#endif
-
-void
-_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
-{
-    return;
-}
-
-PRStatus
-_MD_InitializeThread(PRThread *thread)
-{
-	return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
-{
-    PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    _PR_MD_SWITCH_CONTEXT(thread);
-    return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAKEUP_WAITER(PRThread *thread)
-{
-    if (thread) {
-	PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    }
-    return PR_SUCCESS;
-}
-
-/* These functions should not be called for SINIX */
-/* Why? Just copied it from UNIXWARE... flying-by-night, chrisk 040497 */
-void
-_MD_YIELD(void)
-{
-    PR_NOT_REACHED("_MD_YIELD should not be called for SINIX.");
-}
-
-PRStatus
-_MD_CREATE_THREAD(
-    PRThread *thread,
-    void (*start) (void *),
-    PRUintn priority,
-    PRThreadScope scope,
-    PRThreadState state,
-    PRUint32 stackSize)
-{
-    PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SINIX.");
-#if defined(SNI) && !defined(__GNUC__)
-    /* make compiler happy */
-    return (PRStatus)NULL;
-#endif
-}
deleted file mode 100644
--- a/nsprpub/pr/src/md/unix/sony.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "primpl.h"
-
-#include <signal.h>
-
-void _MD_EarlyInit(void)
-{
-}
-
-PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
-{
-#ifndef _PR_PTHREADS
-    if (isCurrent) {
-	(void) setjmp(CONTEXT(t), 1);
-    }
-    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
-    return (PRWord *) CONTEXT(t);
-#else
-	*np = 0;
-	return NULL;
-#endif
-}
-
-#ifndef _PR_PTHREADS
-void
-_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
-{
-    return;
-}
-
-PRStatus
-_MD_InitializeThread(PRThread *thread)
-{
-	return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
-{
-    PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    _PR_MD_SWITCH_CONTEXT(thread);
-    return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAKEUP_WAITER(PRThread *thread)
-{
-    if (thread) {
-	PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    }
-    return PR_SUCCESS;
-}
-
-/* These functions should not be called for Sony */
-void
-_MD_YIELD(void)
-{
-    PR_NOT_REACHED("_MD_YIELD should not be called for SONY.");
-}
-
-PRStatus
-_MD_CREATE_THREAD(
-    PRThread *thread,
-    void (*start) (void *),
-    PRThreadPriority priority,
-    PRThreadScope scope,
-    PRThreadState state,
-    PRUint32 stackSize)
-{
-    PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SONY.");
-	return PR_FAILURE;
-}
-#endif /* ! _PR_PTHREADS */
deleted file mode 100644
--- a/nsprpub/pr/src/md/unix/sunos4.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <setjmp.h>
-#include "primpl.h"
-
-void _MD_EarlyInit(void)
-{
-}
-
-PRStatus _MD_CREATE_THREAD(PRThread *thread, 
-					void (*start)(void *), 
-					PRThreadPriority priority,
-					PRThreadScope scope, 
-					PRThreadState state, 
-					PRUint32 stackSize) 
-{
-    PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SunOS 4.1.3.");
-    return PR_FAILURE;
-}
-
-void _MD_SET_PRIORITY(_MDThread *md_thread, PRUintn newPri)
-{
-    PR_NOT_REACHED("_MD_SET_PRIORITY should not be called for user-level threads.");
-}
-
-PRStatus
-_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
-{
-    PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    _PR_MD_SWITCH_CONTEXT(thread);
-    return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAKEUP_WAITER(PRThread *thread)
-{
-    if (thread) {
-	PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    }
-    return PR_SUCCESS;
-}
-
-PRStatus _MD_InitializeThread(PRThread *thread)
-{
-	return PR_SUCCESS;
-}
-
-void
-_MD_YIELD(void)
-{
-    PR_NOT_REACHED("_MD_YIELD should not be called for SunOS 4.1.3.");
-}
-
-PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
-{
-    if (isCurrent) {
-	(void) setjmp(CONTEXT(t));
-    }
-    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
-    return (PRWord *) CONTEXT(t);
-}
--- a/nsprpub/pr/src/md/unix/unix.c
+++ b/nsprpub/pr/src/md/unix/unix.c
@@ -17,37 +17,36 @@
 #include <unistd.h>
 #include <sys/utsname.h>
 
 #ifdef _PR_POLL_AVAILABLE
 #include <poll.h>
 #endif
 
 /* To get FIONREAD */
-#if defined(NCR) || defined(UNIXWARE) || defined(NEC) || defined(SNI) \
-        || defined(SONY)
+#if defined(UNIXWARE)
 #include <sys/filio.h>
 #endif
 
 #if defined(NTO)
 #include <sys/statvfs.h>
 #endif
 
 /*
  * Make sure _PRSockLen_t is 32-bit, because we will cast a PRUint32* or
  * PRInt32* pointer to a _PRSockLen_t* pointer.
  */
 #if defined(HAVE_SOCKLEN_T) \
     || (defined(__GLIBC__) && __GLIBC__ >= 2)
 #define _PRSockLen_t socklen_t
 #elif defined(IRIX) || defined(HPUX) || defined(OSF1) || defined(SOLARIS) \
-    || defined(AIX4_1) || defined(LINUX) || defined(SONY) \
-    || defined(BSDI) || defined(SCO) || defined(NEC) || defined(SNI) \
-    || defined(SUNOS4) || defined(NCR) || defined(DARWIN) \
-    || defined(NEXTSTEP) || defined(QNX)
+    || defined(AIX4_1) || defined(LINUX) \
+    || defined(BSDI) || defined(SCO) \
+    || defined(DARWIN) \
+    || defined(QNX)
 #define _PRSockLen_t int
 #elif (defined(AIX) && !defined(AIX4_1)) || defined(FREEBSD) \
     || defined(NETBSD) || defined(OPENBSD) || defined(UNIXWARE) \
     || defined(DGUX) || defined(NTO) || defined(RISCOS)
 #define _PRSockLen_t size_t
 #else
 #error "Cannot determine architecture"
 #endif
@@ -763,17 +762,17 @@ PRInt32 _MD_recv(PRFileDesc *fd, void *b
     PRInt32 rv, err;
     PRThread *me = _PR_MD_CURRENT_THREAD();
 
 /*
  * Many OS's (Solaris, Unixware) have a broken recv which won't read
  * from socketpairs.  As long as we don't use flags on socketpairs, this
  * is a decent fix. - mikep
  */
-#if defined(UNIXWARE) || defined(SOLARIS) || defined(NCR)
+#if defined(UNIXWARE) || defined(SOLARIS)
     while ((rv = read(osfd,buf,amount)) == -1) {
 #else
     while ((rv = recv(osfd,buf,amount,flags)) == -1) {
 #endif
         err = _MD_ERRNO();
         if ((err == EAGAIN) || (err == EWOULDBLOCK)) {
             if (fd->secret->nonblocking) {
                 break;
@@ -2172,21 +2171,17 @@ void _MD_MakeNonblock(PRFileDesc *fd)
     flags = fcntl(osfd, F_GETFL, 0);
 
     /*
      * Use O_NONBLOCK (POSIX-style non-blocking I/O) whenever possible.
      * On SunOS 4, we must use FNDELAY (BSD-style non-blocking I/O),
      * otherwise connect() still blocks and can be interrupted by SIGALRM.
      */
 
-#ifdef SUNOS4
-    fcntl(osfd, F_SETFL, flags | FNDELAY);
-#else
     fcntl(osfd, F_SETFL, flags | O_NONBLOCK);
-#endif
     }
 
 PRInt32 _MD_open(const char *name, PRIntn flags, PRIntn mode)
 {
     PRInt32 osflags;
     PRInt32 rv, err;
 
     if (flags & PR_RDWR) {
@@ -3012,31 +3007,61 @@ PR_Now(void)
     LL_I2L(s2us, PR_USEC_PER_SEC);
     LL_I2L(s, tv.tv_sec);
     LL_I2L(us, tv.tv_usec);
     LL_MUL(s, s, s2us);
     LL_ADD(s, s, us);
     return s;
 }
 
+#if defined(_MD_INTERVAL_USE_GTOD)
+/*
+ * This version of interval times is based on the time of day
+ * capability offered by the system. This isn't valid for two reasons:
+ * 1) The time of day is neither linear nor montonically increasing
+ * 2) The units here are milliseconds. That's not appropriate for our use.
+ */
 PRIntervalTime _PR_UNIX_GetInterval()
 {
     struct timeval time;
     PRIntervalTime ticks;
 
     (void)GETTIMEOFDAY(&time);  /* fallicy of course */
     ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC;  /* that's in milliseconds */
     ticks += (PRUint32)time.tv_usec / PR_USEC_PER_MSEC;  /* so's that */
     return ticks;
-}  /* _PR_SUNOS_GetInterval */
+}  /* _PR_UNIX_GetInterval */
 
 PRIntervalTime _PR_UNIX_TicksPerSecond()
 {
     return 1000;  /* this needs some work :) */
 }
+#endif
+
+#if defined(HAVE_CLOCK_MONOTONIC)
+PRIntervalTime _PR_UNIX_GetInterval2()
+{
+    struct timespec time;
+    PRIntervalTime ticks;
+
+    if (clock_gettime(CLOCK_MONOTONIC, &time) != 0) {
+        fprintf(stderr, "clock_gettime failed: %d\n", errno);
+        abort();
+    }
+
+    ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC;
+    ticks += (PRUint32)time.tv_nsec / PR_NSEC_PER_MSEC;
+    return ticks;
+}
+
+PRIntervalTime _PR_UNIX_TicksPerSecond2()
+{
+    return 1000;
+}
+#endif
 
 #if !defined(_PR_PTHREADS)
 /*
  * Wait for I/O on multiple descriptors.
  *
  * Return 0 if timed out, return -1 if interrupted,
  * else return the number of ready descriptors.
  */
@@ -3287,17 +3312,17 @@ int _MD_unix_get_nonblocking_connect_err
                 return errno;
             } else {
                 return err;
             }		
         }
     } else {
         return ECONNREFUSED;
     }	
-#elif defined(NCR) || defined(UNIXWARE) || defined(SNI) || defined(NEC)
+#elif defined(UNIXWARE)
     /*
      * getsockopt() fails with EPIPE, so use getmsg() instead.
      */
 
     int rv;
     int flags = 0;
     rv = getmsg(osfd, NULL, NULL, &flags);
     PR_ASSERT(-1 == rv || 0 == rv);
--- a/nsprpub/pr/src/md/unix/unix_errors.c
+++ b/nsprpub/pr/src/md/unix/unix_errors.c
@@ -526,17 +526,17 @@ void _MD_unix_map_accept_error(int err)
 void _MD_unix_map_connect_error(int err)
 {
     PRErrorCode prError;
 
     switch (err) {
         case EACCES:
             prError = PR_ADDRESS_NOT_SUPPORTED_ERROR;
             break;
-#if defined(UNIXWARE) || defined(SNI) || defined(NEC)
+#if defined(UNIXWARE)
         /*
          * On some platforms, if we connect to a port on the local host 
          * (the loopback address) that no process is listening on, we get 
          * EIO instead of ECONNREFUSED.
          */
         case EIO:
             prError = PR_CONNECT_REFUSED_ERROR;
             break;
--- a/nsprpub/pr/src/md/unix/uxproces.c
+++ b/nsprpub/pr/src/md/unix/uxproces.c
@@ -706,21 +706,16 @@ static void pr_InstallSigchldHandler()
 #endif  /* !defined(_PR_NATIVE_THREADS) */
 
 static PRStatus _MD_InitProcesses(void)
 {
 #if !defined(_PR_NATIVE_THREADS)
     int rv;
     int flags;
 #endif
-#ifdef SUNOS4
-#define _PR_NBIO_FLAG FNDELAY
-#else
-#define _PR_NBIO_FLAG O_NONBLOCK
-#endif
 
 #ifdef AIX
     {
         void *handle = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
         pr_wp.forkptr = (pid_t (*)(void)) dlsym(handle, "f_fork");
         if (!pr_wp.forkptr) {
             pr_wp.forkptr = fork;
         }
@@ -734,19 +729,19 @@ static PRStatus _MD_InitProcesses(void)
 #if defined(_PR_NATIVE_THREADS)
     pr_wp.numProcs = 0;
     pr_wp.cv = PR_NewCondVar(pr_wp.ml);
     PR_ASSERT(NULL != pr_wp.cv);
 #else
     rv = pipe(pr_wp.pipefd);
     PR_ASSERT(0 == rv);
     flags = fcntl(pr_wp.pipefd[0], F_GETFL, 0);
-    fcntl(pr_wp.pipefd[0], F_SETFL, flags | _PR_NBIO_FLAG);
+    fcntl(pr_wp.pipefd[0], F_SETFL, flags | O_NONBLOCK);
     flags = fcntl(pr_wp.pipefd[1], F_GETFL, 0);
-    fcntl(pr_wp.pipefd[1], F_SETFL, flags | _PR_NBIO_FLAG);
+    fcntl(pr_wp.pipefd[1], F_SETFL, flags | O_NONBLOCK);
 
 #ifndef _PR_SHARE_CLONES
     pr_InstallSigchldHandler();
 #endif
 #endif  /* !_PR_NATIVE_THREADS */
 
     pr_wp.thread = PR_CreateThread(PR_SYSTEM_THREAD,
 	    WaitPidDaemonThread, NULL, PR_PRIORITY_NORMAL,
--- a/nsprpub/pr/src/md/unix/uxrng.c
+++ b/nsprpub/pr/src/md/unix/uxrng.c
@@ -20,24 +20,16 @@ GetHighResClock(void *buf, size_t maxbyt
     hrtime_t t;
     t = gethrtime();
     if (t) {
 	    return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t));
     }
     return 0;
 }
 
-#elif defined(SUNOS4)
-
-static size_t
-GetHighResClock(void *buf, size_t maxbytes)
-{
-    return 0;
-}
-
 #elif defined(HPUX)
 
 #ifdef __ia64
 #include <ia64/sys/inline.h>
 
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
@@ -129,24 +121,16 @@ static size_t GetDevURandom( void *buf, 
 } /* end GetDevURandom() */
 
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {             
     return(GetDevURandom( buf, maxbytes ));
 }
 
-#elif defined(NCR)
-
-static size_t
-GetHighResClock(void *buf, size_t maxbytes)
-{
-    return 0;
-}
-
 #elif defined(IRIX)
 #include <fcntl.h>
 #undef PRIVATE
 #include <sys/mman.h>
 #include <sys/syssgi.h>
 #include <sys/immu.h>
 #include <sys/systeminfo.h>
 #include <sys/utsname.h>
@@ -220,44 +204,16 @@ static size_t GetHighResClock(void *buf,
 
     s0[0] = *iotimer_addr;
     if (cntr_size > 4)
 	s0[1] = *(iotimer_addr + 1);
     memcpy(buf, (char *)&s0[0], cntr_size);
     return _pr_CopyLowBits(buf, maxbuf, &s0, cntr_size);
 }
 
-#elif defined(SONY)
-
-static size_t
-GetHighResClock(void *buf, size_t maxbytes)
-{
-    return 0;
-}
-
-#elif defined(SNI)
-#include <sys/times.h>
-
-static size_t
-GetHighResClock(void *buf, size_t maxbytes)
-{
-    int ticks;
-    struct tms buffer;
-
-    ticks=times(&buffer);
-    return _pr_CopyLowBits(buf, maxbytes, &ticks, sizeof(ticks));
-}
-
-#elif defined(NEC)
-
-static size_t
-GetHighResClock(void *buf, size_t maxbytes)
-{
-    return 0;
-}
 #elif defined(SCO) || defined(UNIXWARE) || defined(BSDI) || defined(NTO) \
     || defined(QNX) || defined(DARWIN) || defined(RISCOS)
 #include <sys/times.h>
 
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
     int ticks;
--- a/nsprpub/pr/src/md/unix/uxwrap.c
+++ b/nsprpub/pr/src/md/unix/uxwrap.c
@@ -65,19 +65,16 @@ void PR_SetXtHackOkayToReleaseXLockFn(in
  *    Wrap up the select system call so that we can deschedule
  *    a thread that tries to wait for i/o.
  *
  *-----------------------------------------------------------------------
  */
 
 #if defined(HPUX9)
 int select(size_t width, int *rl, int *wl, int *el, const struct timeval *tv)
-#elif defined(NEXTSTEP)
-int wrap_select(int width, fd_set *rd, fd_set *wr, fd_set *ex,
-        const struct timeval *tv)
 #elif defined(AIX_RENAME_SELECT)
 int wrap_select(unsigned long width, void *rl, void *wl, void *el,
         struct timeval *tv)
 #elif defined(_PR_SELECT_CONST_TIMEVAL)
 int select(int width, fd_set *rd, fd_set *wr, fd_set *ex,
         const struct timeval *tv)
 #else
 int select(int width, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *tv)
@@ -253,17 +250,17 @@ int select(int width, fd_set *rd, fd_set
                     nbits++;
                 }
                 if (ex && (unixpd->in_flags & _PR_UNIX_POLL_WRITE)
                         && (unixpd->out_flags & PR_POLL_EXCEPT)) {
                     FD_SET(unixpd->osfd, ex);
                     nbits++;
                 }
                 PR_ASSERT(nbits > 0);
-#if defined(HPUX) || defined(SOLARIS) || defined(SUNOS4) || defined(OSF1) || defined(AIX)
+#if defined(HPUX) || defined(SOLARIS) || defined(OSF1) || defined(AIX)
                 retVal += nbits;
 #else /* IRIX */
                 retVal += 1;
 #endif
             }
         }
     }
 
--- a/nsprpub/pr/src/misc/prerrortable.c
+++ b/nsprpub/pr/src/misc/prerrortable.c
@@ -20,19 +20,16 @@ used in advertising or publicity pertain
 of the software without specific, written prior permission.
 M.I.T. and the M.I.T. S.I.P.B. make no representations about
 the suitability of this software for any purpose.  It is
 provided "as is" without express or implied warranty.
 
 */
 
 #include <string.h>
-#ifdef SUNOS4
-#include "md/sunos4.h"  /* for strerror */
-#endif
 #include <assert.h>
 #include <errno.h>
 #include "prmem.h"
 #include "prerror.h"
 
 #define	ERRCODE_RANGE	8	/* # of bits to shift table number */
 #define	BITS_PER_CHAR	6	/* # bits to shift per character in name */
 
--- a/nsprpub/pr/src/misc/prinrval.c
+++ b/nsprpub/pr/src/misc/prinrval.c
@@ -27,23 +27,16 @@ void _PR_InitClock(void)
         PRIntervalTime ticksPerSec = PR_TicksPerSecond();
 
         PR_ASSERT(ticksPerSec >= PR_INTERVAL_MIN);
         PR_ASSERT(ticksPerSec <= PR_INTERVAL_MAX);
     }
 #endif /* DEBUG */
 }
 
-/*
- * This version of interval times is based on the time of day
- * capability offered by system. This isn't valid for two reasons:
- * 1) The time of day is neither linear nor montonically increasing
- * 2) The units here are milliseconds. That's not appropriate for our use.
- */
-
 PR_IMPLEMENT(PRIntervalTime) PR_IntervalNow(void)
 {
     if (!_pr_initialized) _PR_ImplicitInitialization();
     return _PR_MD_GET_INTERVAL();
 }  /* PR_IntervalNow */
 
 PR_EXTERN(PRUint32) PR_TicksPerSecond(void)
 {
--- a/nsprpub/pr/src/misc/prnetdb.c
+++ b/nsprpub/pr/src/misc/prnetdb.c
@@ -1993,17 +1993,17 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInf
 #else
 #if defined(_PR_INET6_PROBE)
     if (!_pr_ipv6_is_present()) {
         return pr_GetAddrInfoByNameFB(hostname, af, flags);
     }
 #endif
     {
         PRADDRINFO *res, hints;
-        PRStatus rv;
+        int rv;
 
         /*
          * we assume a RFC 2553 compliant getaddrinfo.  this may at some
          * point need to be customized as platforms begin to adopt the
          * RFC 3493.
          */
 
         memset(&hints, 0, sizeof(hints));
--- a/nsprpub/pr/src/misc/prtime.c
+++ b/nsprpub/pr/src/misc/prtime.c
@@ -1690,17 +1690,17 @@ PR_FormatTime(char *buf, int buflen, con
         a.tm_yday = tm->tm_yday;
         a.tm_isdst = tm->tm_params.tp_dst_offset ? 1 : 0;
 
         /*
          * On some platforms, for example SunOS 4, struct tm has two
          * additional fields: tm_zone and tm_gmtoff.
          */
 
-#if defined(SUNOS4) || (__GLIBC__ >= 2) || defined(XP_BEOS) \
+#if (__GLIBC__ >= 2) || defined(XP_BEOS) \
         || defined(NETBSD) || defined(OPENBSD) || defined(FREEBSD) \
         || defined(DARWIN) || defined(SYMBIAN) || defined(ANDROID)
         a.tm_zone = NULL;
         a.tm_gmtoff = tm->tm_params.tp_gmt_offset +
                       tm->tm_params.tp_dst_offset;
 #endif
     } else {
         ap = NULL;
--- a/nsprpub/pr/src/pthreads/Makefile.in
+++ b/nsprpub/pr/src/pthreads/Makefile.in
@@ -10,23 +10,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 CSRCS = \
 	ptio.c \
 	ptsynch.c \
 	ptthread.c \
 	ptmisc.c \
 	$(NULL)
 
 TARGETS	= $(OBJS)
--- a/nsprpub/pr/src/pthreads/ptio.c
+++ b/nsprpub/pr/src/pthreads/ptio.c
@@ -1145,17 +1145,17 @@ void _PR_InitIO(void)
      * 5.3 says.  So we have to turn it off.  Find out whether we
      * are running on such a system.
      */
     {
         int osfd;
         osfd = socket(AF_INET6, SOCK_STREAM, 0);
         if (osfd != -1) {
             int on;
-            int optlen = sizeof(on);
+            socklen_t optlen = sizeof(on);
             if (getsockopt(osfd, IPPROTO_IPV6, IPV6_V6ONLY,
                     &on, &optlen) == 0) {
                 _pr_ipv6_v6only_on_by_default = on;
             }
             close(osfd);
         }
     }
 #endif
@@ -4845,17 +4845,17 @@ PR_IMPLEMENT(PRInt32) PR_FD_NISSET(PRInt
        if (set->narray[index] == fd) {
            return 1;
        }
     return 0;
 }
 
 #include <sys/types.h>
 #include <sys/time.h>
-#if !defined(SUNOS4) && !defined(HPUX) \
+#if !defined(HPUX) \
     && !defined(LINUX) && !defined(__GNU__) && !defined(__GLIBC__)
 #include <sys/select.h>
 #endif
 
 static PRInt32
 _PR_getset(PR_fd_set *pr_set, fd_set *set)
 {
     PRUint32 index;
--- a/nsprpub/pr/src/pthreads/ptthread.c
+++ b/nsprpub/pr/src/pthreads/ptthread.c
@@ -38,17 +38,17 @@ static PRIntn pt_schedpriv = 0;
 extern PRLock *_pr_sleeplock;
 
 static struct _PT_Bookeeping
 {
     PRLock *ml;                 /* a lock to protect ourselves */
     PRCondVar *cv;              /* used to signal global things */
     PRInt32 system, user;       /* a count of the two different types */
     PRUintn this_many;          /* number of threads allowed for exit */
-    pthread_key_t key;          /* private private data key */
+    pthread_key_t key;          /* thread private data key */
     PRThread *first, *last;     /* list of threads we know about */
 #if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
     PRInt32 minPrio, maxPrio;   /* range of scheduling priorities */
 #endif
 } pt_book = {0};
 
 static void _pt_thread_death(void *arg);
 static void _pt_thread_death_internal(void *arg, PRBool callDestructors);
@@ -970,16 +970,18 @@ void _PR_Fini(void)
         /*
          * PR_FALSE, because it is unsafe to call back to the 
          * thread private data destructors at final cleanup.
          */
         _pt_thread_death_internal(thred, PR_FALSE);
         rv = pthread_setspecific(pt_book.key, NULL);
         PR_ASSERT(0 == rv);
     }
+    rv = pthread_key_delete(pt_book.key);
+    PR_ASSERT(0 == rv);
     /* TODO: free other resources used by NSPR */
     /* _pr_initialized = PR_FALSE; */
 }  /* _PR_Fini */
 
 PR_IMPLEMENT(PRStatus) PR_Cleanup(void)
 {
     PRThread *me = PR_GetCurrentThread();
     int rv;
--- a/nsprpub/pr/src/threads/combined/Makefile.in
+++ b/nsprpub/pr/src/threads/combined/Makefile.in
@@ -10,23 +10,16 @@ MOD_DEPTH	= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 ifdef USE_PTHREADS
 CSRCS =         \
 	$(NULL)
 else
 CSRCS =         \
     prucpu.c      \
 	prucv.c      \
 	prulock.c    \
--- a/nsprpub/pr/tests/Makefile.in
+++ b/nsprpub/pr/tests/Makefile.in
@@ -109,16 +109,17 @@ CSRCS =             \
 	prftest.c		\
 	prftest1.c		\
 	prftest2.c		\
 	primblok.c		\
 	priotest.c		\
 	provider.c		\
 	prpoll.c		\
 	prpollml.c		\
+	pushtop.c		\
 	ranfile.c       \
 	randseed.c      \
 	reinit.c        \
 	rmdir.c			\
 	rwlocktest.c    \
 	sel_spd.c  		\
 	selct_er.c	    \
 	selct_nm.c	    \
@@ -290,67 +291,30 @@ ifeq ($(OS_ARCH),AIX)
     ifneq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
         LDOPTS += -brtl
         EXTRA_LIBS = -ldl
     endif
 endif
 
 # Solaris
 ifeq ($(OS_ARCH), SunOS)
-    ifneq ($(OS_RELEASE), 4.1.3_U1)
-        ifdef NS_USE_GCC
-            LDOPTS += -Xlinker -R -Xlinker $(ABSOLUTE_LIB_DIR)
-        else
-            ifeq ($(USE_CPLUS), 1)
-                CC = CC
-            endif
-            LDOPTS += -R $(ABSOLUTE_LIB_DIR)
+    ifdef NS_USE_GCC
+        LDOPTS += -Xlinker -R -Xlinker $(ABSOLUTE_LIB_DIR)
+    else
+        ifeq ($(USE_CPLUS), 1)
+            CC = CC
         endif
+        LDOPTS += -R $(ABSOLUTE_LIB_DIR)
     endif
 
     ifdef USE_PTHREADS
         EXTRA_LIBS = -lpthread
     endif
 endif # SunOS
 
-ifeq ($(OS_ARCH), NEC)
-    EXTRA_LIBS = $(OS_LIBS)
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
-# option for ld on other platforms.
-    export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
-endif
-
-ifeq ($(OS_ARCH), NCR)
-# NCR needs to link against -lsocket -lnsl -ldl (and -lc, which is
-# linked implicitly by $(CC)).  Note that we did not link with these
-# system libraries when we built libnspr.so.
-    EXTRA_LIBS = -lsocket -lnsl -ldl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
-# option for ld on other platforms.
-    export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
-endif
-
-ifeq ($(OS_ARCH), NEXTSTEP)
-# balazs.pataki@sztaki.hu: linkage is done in a different pass in the `tests'
-# modeul, so we have to pass the `-posix' flag by "hand" to `ld'
-LDOPTS += -posix
-endif
-
-ifeq ($(OS_ARCH), NEWS-OS)
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
-# option for ld on other platforms.
-#export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
-    LIBNSPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
-    LIBPLC = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
-    EXTRA_LIBS = -lsocket -lnsl -lgen -lresolv
-endif
-
 ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH)))
     LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
     ifeq ($(USE_PTHREADS),1)
         EXTRA_LIBS = -lpthread
     endif
 endif
 
 ifeq ($(OS_ARCH), SCOOS)
@@ -358,24 +322,16 @@ ifeq ($(OS_ARCH), SCOOS)
 # already linked with these system libraries when we built libnspr.so.
 EXTRA_LIBS = -lsocket
 # This hardcodes in the executable programs the directory to find
 # libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
 # option for ld on other platforms.
 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
 endif
 
-ifeq ($(OS_ARCH),SINIX)
-EXTRA_LIBS = -lsocket -lnsl -lresolv -ldl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
-# option for ld on other platforms.
-export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
-endif
-
 ifeq ($(OS_ARCH),OpenUNIX)
 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
 ifeq ($(USE_PTHREADS),1)
 LDOPTS += -pthread
 endif
 endif
 
 ifeq ($(OS_ARCH), UNIXWARE)
@@ -478,25 +434,23 @@ endif # AIX_PRE_4_2
 
 export:: $(TARGETS)
 clean::
 	rm -f $(TARGETS)
 
 # The following tests call BSD socket functions, so they need to link
 # with -lsocket on some platforms.
 ifeq ($(OS_ARCH),SunOS)
-ifneq ($(OS_RELEASE),4.1.3_U1)
 ifeq ($(USE_IPV6),1)
 $(OBJDIR)/gethost: $(OBJDIR)/gethost.o
 	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
 endif
 $(OBJDIR)/prpoll: $(OBJDIR)/prpoll.o
 	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
 endif
-endif
 
 ifeq ($(USE_PTHREADS), 1)
 $(OBJDIR)/attach: $(OBJDIR)/attach.o
 	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/foreign: $(OBJDIR)/foreign.o
 	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/provider: $(OBJDIR)/provider.o
 	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
--- a/nsprpub/pr/tests/dll/Makefile.in
+++ b/nsprpub/pr/tests/dll/Makefile.in
@@ -9,23 +9,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 CSRCS = mygetval.c mysetval.c
 
 INCLUDES = -I$(dist_includedir)
 
 OBJS = $(OBJDIR)/mygetval.$(OBJ_SUFFIX) \
 	$(OBJDIR)/mysetval.$(OBJ_SUFFIX)
 
 ifeq ($(OS_TARGET), WIN16)
new file mode 100644
--- /dev/null
+++ b/nsprpub/pr/tests/pushtop.c
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/* A regression test for bug 794316 */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "prio.h"
+
+static PRIOMethods dummyMethods;
+
+int main()
+{
+    PRDescIdentity topId, middleId, bottomId;
+    PRFileDesc *top, *middle, *bottom;
+    PRFileDesc *fd;
+
+    topId = PR_GetUniqueIdentity("top");
+    middleId = PR_GetUniqueIdentity("middle");
+    bottomId = PR_GetUniqueIdentity("bottom");
+
+    top = PR_CreateIOLayerStub(topId, &dummyMethods);
+    middle = PR_CreateIOLayerStub(middleId, &dummyMethods);
+    bottom = PR_CreateIOLayerStub(bottomId, &dummyMethods);
+
+    fd = bottom;
+    PR_PushIOLayer(fd, PR_TOP_IO_LAYER, middle);
+    PR_PushIOLayer(fd, PR_TOP_IO_LAYER, top);
+
+    top = fd;
+    middle = top->lower;
+    bottom = middle->lower;
+
+    /* Verify that the higher pointers are correct. */
+    if (middle->higher != top) {
+        fprintf(stderr, "middle->higher is wrong\n");
+        fprintf(stderr, "FAILED\n");
+        exit(1);
+    }
+    if (bottom->higher != middle) {
+        fprintf(stderr, "bottom->higher is wrong\n");
+        fprintf(stderr, "FAILED\n");
+        exit(1);
+    }
+
+    top = PR_PopIOLayer(fd, topId);
+    top->dtor(top);
+
+    middle = fd;
+    bottom = middle->lower;
+
+    /* Verify that the higher pointer is correct. */
+    if (bottom->higher != middle) {
+        fprintf(stderr, "bottom->higher is wrong\n");
+        fprintf(stderr, "FAILED\n");
+        exit(1);
+    }
+
+    middle = PR_PopIOLayer(fd, middleId);
+    middle->dtor(middle);
+    if (fd->identity != bottomId) {
+        fprintf(stderr, "The bottom layer has the wrong identity\n");
+        fprintf(stderr, "FAILED\n");
+        exit(1);
+    }
+    fd->dtor(fd);
+
+    printf("PASS\n");
+    return 0;
+}
--- a/nsprpub/pr/tests/runtests.pl
+++ b/nsprpub/pr/tests/runtests.pl
@@ -308,16 +308,17 @@ sub win_test_prog {
 "pipeself",
 "poll_nm",
 "poll_to",
 "pollable",
 "prftest",
 "primblok",
 "provider",
 "prpollml",
+"pushtop",
 "ranfile",
 "randseed",
 "reinit",
 "rwlocktest",
 "sel_spd",
 "selct_er",
 "selct_nm",
 "selct_to",
--- a/nsprpub/pr/tests/runtests.sh
+++ b/nsprpub/pr/tests/runtests.sh
@@ -138,16 +138,17 @@ pipeping2
 pipeself
 poll_nm
 poll_to
 pollable
 prftest
 primblok
 provider
 prpollml
+pushtop
 ranfile
 randseed
 reinit
 rwlocktest
 sel_spd
 selct_er
 selct_nm
 selct_to
--- a/nsprpub/pr/tests/vercheck.c
+++ b/nsprpub/pr/tests/vercheck.c
@@ -15,47 +15,47 @@
  */
 
 #include "prinit.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 
 /*
- * This release (4.9.2) is backward compatible with the
+ * This release (4.9.5) is backward compatible with the
  * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x,
- * 4.8.x, 4.9, and 4.9.1 releases.  It, of course,
- * is compatible with itself.
+ * 4.8.x, 4.9, 4.9.1, 4.9.2, 4.9.3, and 4.9.4 releases.
+ * It, of course, is compatible with itself.
  */
 static char *compatible_version[] = {
     "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3",
     "4.2", "4.2.1", "4.2.2", "4.3", "4.4", "4.4.1",
     "4.5", "4.5.1",
     "4.6", "4.6.1", "4.6.2", "4.6.3", "4.6.4", "4.6.5",
     "4.6.6", "4.6.7", "4.6.8",
     "4.7", "4.7.1", "4.7.2", "4.7.3", "4.7.4", "4.7.5",
     "4.7.6",
     "4.8", "4.8.1", "4.8.2", "4.8.3", "4.8.4", "4.8.5",
     "4.8.6", "4.8.7", "4.8.8", "4.8.9",
-    "4.9", "4.9.1", PR_VERSION
+    "4.9", "4.9.1", "4.9.2", "4.9.3", "4.9.4", PR_VERSION
 };
 
 /*
  * This release is not backward compatible with the old
  * NSPR 2.1 and 3.x releases.
  *
  * Any release is incompatible with future releases and
  * patches.
  */
 static char *incompatible_version[] = {
     "2.1 19980529",
     "3.0", "3.0.1",
     "3.1", "3.1.1", "3.1.2", "3.1.3",
     "3.5", "3.5.1",
-    "4.9.3",
+    "4.9.6",
     "4.10", "4.10.1",
     "10.0", "11.1", "12.14.20"
 };
 
 int main(int argc, char **argv)
 {
     int idx;
     int num_compatible = sizeof(compatible_version) / sizeof(char *);
--- a/nsprpub/tools/Makefile.in
+++ b/nsprpub/tools/Makefile.in
@@ -81,51 +81,31 @@ endif
 ifeq ($(OS_ARCH),AIX)
 LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
 LIBPR = -lnspr$(NSPR_VERSION)_shr
 LIBPLC = -lplc$(NSPR_VERSION)_shr
 endif
 
 # Solaris
 ifeq ($(OS_ARCH), SunOS)
-ifneq ($(OS_RELEASE), 4.1.3_U1)
 ifdef NS_USE_GCC
 LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
 else
 LDOPTS += -R $(PWD)/$(dist_libdir)
 endif
-endif
 
 # SunOS 5.5 needs to link with -lpthread, even though we already
 # linked with this system library when we built libnspr.so.
 ifeq ($(OS_RELEASE), 5.5)
 ifdef USE_PTHREADS
 EXTRA_LIBS = -lpthread
 endif
 endif
 endif # SunOS
 
-ifeq ($(OS_ARCH), NCR)
-# XXX: We see some strange problems when we link with libnspr.so.
-# So for now we use static libraries on NCR.  The shared library
-# stuff below is commented out.
-LIBPR = $(dist_libdir)/libnspr$(NSPR_VERSION).a
-LIBPLC = $(dist_libdir)/libplc$(NSPR_VERSION).a
-EXTRA_LIBS = -lsocket -lnsl -ldl
-
-# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
-# implicitly by $(CC)) again even though we already linked with these
-# system libraries when we built libnspr.so.
-#EXTRA_LIBS = -lsocket -lnsl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
-# option for ld on other platforms.
-#export LD_RUN_PATH = $(PWD)/$(dist_libdir)
-endif
-
 ifeq ($(OS_ARCH), SCOOS)
 # SCO Unix needs to link against -lsocket again even though we
 # already linked with these system libraries when we built libnspr.so.
 EXTRA_LIBS = -lsocket
 # This hardcodes in the executable programs the directory to find
 # libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
 # option for ld on other platforms.
 export LD_RUN_PATH = $(PWD)/$(dist_libdir)