fixup commit for branch 'THUNDERBIRD_0_2_BRANCH' THUNDERBIRD_0_2_BRANCH
authorcvs2hg
Thu, 17 Jul 2003 23:13:48 +0000
branchTHUNDERBIRD_0_2_BRANCH
changeset 2880 1d57c0335277
parent 2152 2e4e3584962d
push idunknown
push userunknown
push dateunknown
fixup commit for branch 'THUNDERBIRD_0_2_BRANCH'
Makefile.in
admin/repackage.sh
build/autoconf/config.guess
build/autoconf/config.sub
build/cygwin-wrapper
config/AIX.mk
config/BSD_OS.mk
config/BeOS.mk
config/DGUX.mk
config/FreeBSD.mk
config/HP-UX.mk
config/IRIX.mk
config/Linux.mk
config/Makefile.in
config/NCR.mk
config/NEC.mk
config/NEWS-OS.mk
config/NEXTSTEP.mk
config/NTO.mk
config/NetBSD.mk
config/OS2.mk
config/OSF1.mk
config/OpenBSD.mk
config/OpenVMS.mk
config/QNX.mk
config/Rhapsody.mk
config/SCOOS.mk
config/SINIX.mk
config/SunOS.mk
config/SunOS4.mk
config/SunOS5.mk
config/UNIX.mk
config/UNIXWARE.mk
config/WIN32.mk
config/WIN95.mk
config/WINNT.mk
config/arch.mk
config/autoconf.mk.in
config/config.mk
config/module.df
config/now.c
config/nsinstall.c
config/nspr-config.in
config/rules.mk
config/win16.mk
configure
configure.in
lib/ds/Makefile.in
lib/ds/plarena.c
lib/ds/plds.def
lib/ds/plds_symvec.opt
lib/ds/plhash.c
lib/libc/src/Makefile.in
lib/libc/src/base64.c
lib/libc/src/plc.def
lib/libc/src/plc_symvec.opt
lib/libc/src/strstr.c
lib/msgc/src/Makefile.in
macbuild/NSPR.Debug.Prefix
macbuild/NSPR.Prefix
macbuild/NSPR20.toc
macbuild/NSPR20PPC.mcp
macbuild/NSPRCarbon.Prefix
macbuild/NSPRCarbonDebug.Prefix
macbuild/NSPRConfig.h
macbuild/NSPRDebug.Prefix
pkg/Makefile.in
pkg/linux/Makefile.in
pkg/linux/sun-nspr.spec
pkg/solaris/Makefile.com
pkg/solaris/Makefile.in
pkg/solaris/Makefile.targ
pkg/solaris/SUNWpr/Makefile.in
pkg/solaris/SUNWpr/depend
pkg/solaris/SUNWpr/pkginfo.tmpl
pkg/solaris/SUNWpr/prototype_com
pkg/solaris/SUNWpr/prototype_i386
pkg/solaris/SUNWpr/prototype_sparc
pkg/solaris/SUNWprx/Makefile.in
pkg/solaris/SUNWprx/depend
pkg/solaris/SUNWprx/pkginfo.tmpl
pkg/solaris/SUNWprx/prototype_com
pkg/solaris/SUNWprx/prototype_sparc
pkg/solaris/bld_awk_pkginfo.ksh
pkg/solaris/common_files/copyright
pr/include/md/Makefile.in
pr/include/md/_aix.h
pr/include/md/_aix32.cfg
pr/include/md/_aix32in6.cfg
pr/include/md/_beos.h
pr/include/md/_bsdi.h
pr/include/md/_darwin.cfg
pr/include/md/_darwin.h
pr/include/md/_freebsd.cfg
pr/include/md/_freebsd.h
pr/include/md/_hpux.h
pr/include/md/_hpux64.cfg
pr/include/md/_irix.h
pr/include/md/_linux.cfg
pr/include/md/_linux.h
pr/include/md/_macos.h
pr/include/md/_netbsd.h
pr/include/md/_nto.h
pr/include/md/_openvms.h
pr/include/md/_os2.h
pr/include/md/_os2_errors.h
pr/include/md/_osf1.h
pr/include/md/_pth.h
pr/include/md/_solaris.h
pr/include/md/_solaris32.cfg
pr/include/md/_solaris64.cfg
pr/include/md/_unixos.h
pr/include/md/_win16.h
pr/include/md/_win95.h
pr/include/md/_winnt.h
pr/include/obsolete/Makefile.in
pr/include/prcountr.h
pr/include/prerr.h
pr/include/prinet.h
pr/include/prinit.h
pr/include/prio.h
pr/include/private/Makefile.in
pr/include/private/primpl.h
pr/include/prlink.h
pr/include/prlong.h
pr/include/prolock.h
pr/include/prsystem.h
pr/include/prthread.h
pr/include/prtrace.h
pr/include/prtypes.h
pr/include/prwin16.h
pr/src/Makefile.in
pr/src/io/Makefile.in
pr/src/io/prdir.c
pr/src/io/prfdcach.c
pr/src/io/prfile.c
pr/src/io/prio.c
pr/src/io/priometh.c
pr/src/io/prlayer.c
pr/src/io/prlog.c
pr/src/io/prmapopt.c
pr/src/io/prmwait.c
pr/src/io/prprf.c
pr/src/io/prsocket.c
pr/src/io/prstdio.c
pr/src/linking/Makefile.in
pr/src/linking/prlink.c
pr/src/malloc/prmem.c
pr/src/md/beos/bfile.c
pr/src/md/beos/bmisc.c
pr/src/md/beos/bmmap.c
pr/src/md/beos/bnet.c
pr/src/md/beos/bproc.c
pr/src/md/mac/macdll.c
pr/src/md/mac/macio.c
pr/src/md/mac/macsocket.h
pr/src/md/mac/macsockotpt.c
pr/src/md/mac/macthr.c
pr/src/md/mac/mdcriticalregion.c
pr/src/md/mac/mdmac.c
pr/src/md/os2/Makefile.in
pr/src/md/os2/objs.mk
pr/src/md/os2/os2_errors.c
pr/src/md/os2/os2cv.c
pr/src/md/os2/os2emx.s
pr/src/md/os2/os2inrval.c
pr/src/md/os2/os2io.c
pr/src/md/os2/os2misc.c
pr/src/md/os2/os2poll.c
pr/src/md/os2/os2sock.c
pr/src/md/os2/os2thred.c
pr/src/md/os2/os2vacpp.asm
pr/src/md/unix/Makefile.in
pr/src/md/unix/darwin.c
pr/src/md/unix/irix.c
pr/src/md/unix/openvms.c
pr/src/md/unix/os_Darwin_ppc.s
pr/src/md/unix/unix.c
pr/src/md/unix/unix_errors.c
pr/src/md/unix/uxpoll.c
pr/src/md/unix/uxproces.c
pr/src/md/unix/uxrng.c
pr/src/md/unix/uxshm.c
pr/src/md/windows/Makefile.in
pr/src/md/windows/ntinrval.c
pr/src/md/windows/ntio.c
pr/src/md/windows/ntmisc.c
pr/src/md/windows/ntthread.c
pr/src/md/windows/w32poll.c
pr/src/md/windows/w95io.c
pr/src/md/windows/w95sock.c
pr/src/md/windows/w95thred.c
pr/src/misc/Makefile.in
pr/src/misc/compile-et.pl
pr/src/misc/pralarm.c
pr/src/misc/prcountr.c
pr/src/misc/prdtoa.c
pr/src/misc/prenv.c
pr/src/misc/prerr.c
pr/src/misc/prerr.et
pr/src/misc/prerr.properties
pr/src/misc/prerror.c
pr/src/misc/prinit.c
pr/src/misc/prinrval.c
pr/src/misc/prlong.c
pr/src/misc/prnetdb.c
pr/src/misc/prolock.c
pr/src/misc/prrng.c
pr/src/misc/prsystem.c
pr/src/misc/prtime.c
pr/src/misc/prtpool.c
pr/src/misc/prtrace.c
pr/src/nspr.def
pr/src/nspr_symvec.opt
pr/src/pthreads/Makefile.in
pr/src/pthreads/ptio.c
pr/src/pthreads/ptsynch.c
pr/src/pthreads/ptthread.c
pr/src/threads/combined/prucpu.c
pr/src/threads/combined/pruthr.c
pr/src/threads/prcthr.c
pr/src/threads/prtpd.c
pr/tests/Makefile.in
pr/tests/affinity.c
pr/tests/attach.c
pr/tests/dll/Makefile.in
pr/tests/libfilename.c
pr/tests/macbuild/NSPR20TestApp.mcp
pr/tests/runtests.ksh
pr/tests/runtests.sh
pr/tests/sigpipe.c
pr/tests/thrpool_server.c
pr/tests/vercheck.c
--- a/Makefile.in
+++ b/Makefile.in
@@ -36,21 +36,29 @@
 
 MOD_DEPTH	= .
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
+MAKE := $(patsubst -j%,,$(MAKE)) -j1
+
 DIRS = config pr lib
 
 ifdef MOZILLA_CLIENT
-PR_CLIENT_BUILD = 1
-PR_CLIENT_BUILD_UNIX = 1
+# Make nsinstall use absolute symlinks by default for Mozilla OSX builds
+# http://bugzilla.mozilla.org/show_bug.cgi?id=193164
+ifeq ($(OS_ARCH),Darwin)
+ifndef NSDISTMODE
+NSDISTMODE=absolute_symlink
+export NSDISTMODE
+endif
+endif
 endif
 
 DIST_GARBAGE = config.cache config.log config.status
 
 all:: config.status export
 
 include $(topsrcdir)/config/rules.mk
 
@@ -63,25 +71,16 @@ endif
 
 #
 # The -ll option of zip converts CR LF to LF.
 #
 ifeq ($(OS_ARCH),WINNT)
 ZIP_ASCII_OPT = -ll
 endif
 
-ifdef PR_CLIENT_BUILD
-export::
-	rm -r -f $(DIST)/../public/nspr
-ifdef PR_CLIENT_BUILD_UNIX
-	rm -f $(dist_libdir)/libnspr.a
-	rm -f $(dist_bindir)/libnspr.$(DLL_SUFFIX)
-endif
-endif
-
 # Delete config/autoconf.mk last because it is included by every makefile.
 distclean::
 	@echo "cd pr/tests; $(MAKE) $@"
 	@$(MAKE) -C pr/tests $@
 	rm -f config/autoconf.mk
 
 release::
 	echo $(BUILD_NUMBER) > $(RELEASE_DIR)/$(BUILD_NUMBER)/version.df
@@ -103,22 +102,22 @@ release::
 	echo "Manifest-Version: 1.0" > MANIFEST.MF; \
 	echo "" >> MANIFEST.MF; \
 	cd ..; rm -f mdheader.jar; zip $(ZIP_ASCII_OPT) -r mdheader.jar *; \
 	rm -rf META-INF
 ifeq ($(OS_ARCH),WINNT)
 	@if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); then \
 		rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \
 		echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)"; \
-		config/prmkdir.bat $(MDIST_DOS)\\$(MOD_NAME)\\$(BUILD_NUMBER); \
+		$(topsrcdir)/config/prmkdir.bat $(MDIST_DOS)\\$(MOD_NAME)\\$(BUILD_NUMBER); \
 	fi
 	@if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); then \
 		rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
 		echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)"; \
-		config/prmkdir.bat $(MDIST_DOS)\\$(MOD_NAME)\\$(BUILD_NUMBER)\\$(RELEASE_OBJDIR_NAME); \
+		$(topsrcdir)/config/prmkdir.bat $(MDIST_DOS)\\$(MOD_NAME)\\$(BUILD_NUMBER)\\$(RELEASE_OBJDIR_NAME); \
 	fi
 else
 	@if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); then \
 		rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \
 		echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)"; \
 		$(NSINSTALL) -D $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \
 		chmod 775 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \
 	fi
@@ -135,10 +134,14 @@ endif
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/imports.df; \
 	cd $(OBJDIR_NAME); \
 	cp -f mdbinary.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)/mdbinary.jar; \
 	cd include; \
 	cp -f mdheader.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)/mdheader.jar
 
+package:
+	@echo "cd pkg; $(MAKE) publish"
+	$(MAKE) -C pkg publish
+
 depend:
 	@echo "NSPR20 has no dependencies.  Skipped."
--- a/admin/repackage.sh
+++ b/admin/repackage.sh
@@ -55,42 +55,46 @@
 # 
 # 
 # 
 # 
 # ------------------------------------------------------------------
 #
 # These variables should be modified for each NSPR release.
 #
-FROMTOP=/share/builds/components/nspr20/v4.1.1
-TOTOP=./v4.1.1
-NSPRDIR=nspr-4.1.1
-SOURCETAG=NSPRPUB_RELEASE_4_1_1
+FROMTOP=/share/builds/components/nspr20/v4.3
+TOTOP=./v4.3
+NSPRDIR=nspr-4.3
+SOURCETAG=NSPR_4_3_RTM
 
 #
 # enumerate Unix object directories on /s/b/c
 UNIX_OBJDIRS="
 AIX4.3_64_DBG.OBJ
 AIX4.3_64_OPT.OBJ
 AIX4.3_DBG.OBJ
 AIX4.3_OPT.OBJ
 HP-UXB.11.00_64_DBG.OBJ
 HP-UXB.11.00_64_OPT.OBJ
 HP-UXB.11.00_DBG.OBJ
 HP-UXB.11.00_OPT.OBJ
 IRIX6.5_n32_PTH_DBG.OBJ
 IRIX6.5_n32_PTH_OPT.OBJ
 Linux2.2_x86_glibc_PTH_DBG.OBJ
 Linux2.2_x86_glibc_PTH_OPT.OBJ
-OSF1V4.0D_DBG.OBJ
-OSF1V4.0D_OPT.OBJ
+Linux2.4_x86_glibc_PTH_DBG.OBJ
+Linux2.4_x86_glibc_PTH_OPT.OBJ
+OSF1V5.0_DBG.OBJ
+OSF1V5.0_OPT.OBJ
 SunOS5.6_DBG.OBJ
 SunOS5.6_OPT.OBJ
-SunOS5.7_64_DBG.OBJ
-SunOS5.7_64_OPT.OBJ
+SunOS5.8_64_DBG.OBJ
+SunOS5.8_64_OPT.OBJ
+SunOS5.8_DBG.OBJ
+SunOS5.8_OPT.OBJ
 "
 #
 # enumerate Windows object directories on /s/b/c
 WIN_OBJDIRS="
 WIN954.0_DBG.OBJ
 WIN954.0_DBG.OBJD
 WIN954.0_OPT.OBJ
 WINNT4.0_DBG.OBJ
--- a/build/autoconf/config.guess
+++ b/build/autoconf/config.guess
@@ -1,14 +1,14 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
-timestamp='2001-10-05'
+timestamp='2003-02-22'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,17 +19,17 @@ timestamp='2001-10-05'
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Originally written by Per Bothner <bothner@cygnus.com>.
+# Originally written by Per Bothner <per@bothner.com>.
 # Please send patches to <config-patches@gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
 # exits with 0.  Otherwise, it exits with 1.
 #
 # The plan is that this can be called by configure scripts if you
@@ -83,40 +83,51 @@ while test $# -gt 0 ; do
   esac
 done
 
 if test $# != 0; then
   echo "$me: too many arguments$help" >&2
   exit 1
 fi
 
+trap 'exit 1' 1 2 15
 
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
 
-# CC_FOR_BUILD -- compiler used by this script.
 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
 # use `HOST_CC' if defined, but it is deprecated.
 
-set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int dummy(){}" > $dummy.c ;
-	for c in cc gcc c89 ; do
-	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
-	  if test $? = 0 ; then
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
 	     CC_FOR_BUILD="$c"; break ;
 	  fi ;
 	done ;
-	rm -f $dummy.c $dummy.o $dummy.rel ;
 	if test x"$CC_FOR_BUILD" = x ; then
 	  CC_FOR_BUILD=no_compiler_found ;
 	fi
 	;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac'
+esac ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
 	PATH=$PATH:/.attbin ; export PATH
 fi
 
 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
@@ -130,50 +141,61 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
 	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 	# switched to ELF, *-*-netbsd* would select the old
 	# object file format.  This provides both forward
 	# compatibility and a consistent mechanism for selecting the
 	# object file format.
-	# Determine the machine/vendor (is the vendor relevant).
-	case "${UNAME_MACHINE}" in
-	    amiga) machine=m68k-unknown ;;
-	    arm32) machine=arm-unknown ;;
-	    atari*) machine=m68k-atari ;;
-	    sun3*) machine=m68k-sun ;;
-	    mac68k) machine=m68k-apple ;;
-	    macppc) machine=powerpc-apple ;;
-	    hp3[0-9][05]) machine=m68k-hp ;;
-	    ibmrt|romp-ibm) machine=romp-ibm ;;
-	    sparc*) machine=`uname -p`-unknown ;;
-	    *) machine=${UNAME_MACHINE}-unknown ;;
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
 	# to ELF recently, or will in the future.
-	case "${UNAME_MACHINE}" in
-	    i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep __ELF__ >/dev/null
 		then
 		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
 		    # Return netbsd for either.  FIX?
 		    os=netbsd
 		else
 		    os=netbsdelf
 		fi
 		;;
 	    *)
 	        os=netbsd
 		;;
 	esac
 	# The OS release
-	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
 	exit 0 ;;
     amiga:OpenBSD:*:*)
 	echo m68k-unknown-openbsd${UNAME_RELEASE}
 	exit 0 ;;
@@ -212,73 +234,57 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	exit 0 ;;
     *:OpenBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
 	exit 0 ;;
     alpha:OSF1:*:*)
 	if test $UNAME_RELEASE = "V4.0"; then
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
 	fi
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
 	# A Vn.n version is a released version.
 	# A Tn.n version is a released field test version.
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	cat <<EOF >$dummy.s
-	.data
-\$Lformat:
-	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
-
-	.text
-	.globl main
-	.align 4
-	.ent main
-main:
-	.frame \$30,16,\$26,0
-	ldgp \$29,0(\$27)
-	.prologue 1
-	.long 0x47e03d80 # implver \$0
-	lda \$2,-1
-	.long 0x47e20c21 # amask \$2,\$1
-	lda \$16,\$Lformat
-	mov \$0,\$17
-	not \$1,\$18
-	jsr \$26,printf
-	ldgp \$29,0(\$26)
-	mov 0,\$16
-	jsr \$26,exit
-	.end main
-EOF
-	eval $set_cc_for_build
-	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
-	if test "$?" = 0 ; then
-		case `./$dummy` in
-			0-0)
-				UNAME_MACHINE="alpha"
-				;;
-			1-0)
-				UNAME_MACHINE="alphaev5"
-				;;
-			1-1)
-				UNAME_MACHINE="alphaev56"
-				;;
-			1-101)
-				UNAME_MACHINE="alphapca56"
-				;;
-			2-303)
-				UNAME_MACHINE="alphaev6"
-				;;
-			2-307)
-				UNAME_MACHINE="alphaev67"
-				;;
-			2-1307)
-				UNAME_MACHINE="alphaev68"
-				;;
-		esac
-	fi
-	rm -f $dummy.s $dummy
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
 	exit 0 ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
 	# of the specific Alpha model?
 	echo alpha-pc-interix
 	exit 0 ;;
@@ -286,16 +292,19 @@ EOF
 	echo alpha-dec-winnt3.5
 	exit 0 ;;
     Amiga*:UNIX_System_V:4.0:*)
 	echo m68k-unknown-sysv4
 	exit 0;;
     *:[Aa]miga[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-amigaos
 	exit 0 ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit 0 ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
 	exit 0 ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit 0;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
@@ -306,16 +315,20 @@ EOF
 		echo pyramid-pyramid-sysv3
 	else
 		echo pyramid-pyramid-bsd
 	fi
 	exit 0 ;;
     NILE*:*:*:dcosx)
 	echo pyramid-pyramid-svr4
 	exit 0 ;;
+    DRS?6000:UNIX_SV:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7 && exit 0 ;;
+	esac ;;
     sun4H:SunOS:5.*:*)
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit 0 ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit 0 ;;
     i86pc:SunOS:5.*:*)
 	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -334,17 +347,17 @@ EOF
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
 	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
 	exit 0 ;;
     sun3*:SunOS:*:*)
 	echo m68k-sun-sunos${UNAME_RELEASE}
 	exit 0 ;;
     sun*:*:4.2BSD:*)
-	UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
 	case "`/bin/arch`" in
 	    sun3)
 		echo m68k-sun-sunos${UNAME_RELEASE}
 		;;
 	    sun4)
 		echo sparc-sun-sunos${UNAME_RELEASE}
 		;;
@@ -412,25 +425,30 @@ EOF
 	#endif
 	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
 	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
 	#endif
 	#endif
 	  exit (-1);
 	}
 EOF
-	$CC_FOR_BUILD $dummy.c -o $dummy \
-	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-	  && rm -f $dummy.c $dummy && exit 0
-	rm -f $dummy.c $dummy
+	$CC_FOR_BUILD -o $dummy $dummy.c \
+	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+	  && exit 0
 	echo mips-mips-riscos${UNAME_RELEASE}
 	exit 0 ;;
     Motorola:PowerMAX_OS:*:*)
 	echo powerpc-motorola-powermax
 	exit 0 ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit 0 ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit 0 ;;
     Night_Hawk:Power_UNIX:*:*)
 	echo powerpc-harris-powerunix
 	exit 0 ;;
     m88k:CX/UX:7*:*)
 	echo m88k-harris-cxux7
 	exit 0 ;;
     m88k:*:4*:R4*)
 	echo m88k-motorola-sysv4
@@ -493,27 +511,26 @@ EOF
 		main()
 			{
 			if (!__power_pc())
 				exit(1);
 			puts("powerpc-ibm-aix3.2.5");
 			exit(0);
 			}
 EOF
-		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-		rm -f $dummy.c $dummy
+		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
 		echo rs6000-ibm-aix3.2.5
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
 		echo rs6000-ibm-aix3.2.4
 	else
 		echo rs6000-ibm-aix3.2
 	fi
 	exit 0 ;;
     *:AIX:*:[45])
-	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
 	else
 		IBM_ARCH=powerpc
 	fi
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
 	else
@@ -592,21 +609,31 @@ EOF
               #else  /* !defined(_SC_KERNEL_BITS) */
               	    puts ("hppa2.0"); break;
               #endif
               	default: puts ("hppa1.0"); break;
               	}
                   exit (0);
               }
 EOF
-		    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
-		    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
-		    rm -f $dummy.c $dummy
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
 		fi ;;
 	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    # avoid double evaluation of $set_cc_for_build
+	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
 	exit 0 ;;
     ia64:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	echo ia64-hp-hpux${HPUX_REV}
 	exit 0 ;;
     3050*:HI-UX:*:*)
 	eval $set_cc_for_build
@@ -630,18 +657,17 @@ EOF
 		}
 	    }
 	  else if (CPU_IS_HP_MC68K (cpu))
 	    puts ("m68k-hitachi-hiuxwe2");
 	  else puts ("unknown-hitachi-hiuxwe2");
 	  exit (0);
 	}
 EOF
-	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-	rm -f $dummy.c $dummy
+	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
 	echo unknown-hitachi-hiuxwe2
 	exit 0 ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
 	echo hppa1.1-hp-bsd
 	exit 0 ;;
     9000/8??:4.3bsd:*:*)
 	echo hppa1.0-hp-bsd
 	exit 0 ;;
@@ -677,85 +703,92 @@ EOF
 	echo c34-convex-bsd
         exit 0 ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
         exit 0 ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
         exit 0 ;;
-    CRAY*X-MP:*:*:*)
-	echo xmp-cray-unicos
-        exit 0 ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     CRAY*[A-Z]90:*:*:*)
 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     CRAY*TS:*:*:*)
 	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
-    CRAY*T3D:*:*:*)
-	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
     CRAY*T3E:*:*:*)
 	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     CRAY*SV1:*:*:*)
 	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
-    CRAY-2:*:*:*)
-	echo cray2-cray-unicos
-        exit 0 ;;
+    *:UNICOS/mp:*:*)
+	echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 
+	exit 0 ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
         exit 0 ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
 	exit 0 ;;
     sparc*:BSD/OS:*:*)
 	echo sparc-unknown-bsdi${UNAME_RELEASE}
 	exit 0 ;;
     *:BSD/OS:*:*)
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 	exit 0 ;;
     *:FreeBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	# Determine whether the default compiler uses glibc.
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#if __GLIBC__ >= 2
+	LIBC=gnu
+	#else
+	LIBC=
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
 	exit 0 ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit 0 ;;
     i*:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit 0 ;;
 #### MozillaHack 
 # Netscape's hacked uname
     xx:WINNT:* | xx:WIN95:*)
 	echo i586-pc-msvc
 	exit 0 ;;
-# MKS Toolkit
-    [34567]86:Windows_NT:*)
-	echo i386-pc-mksnt
-	exit 0 ;;
 ###  End MozillaHack
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit 0 ;;
+    x86:Interix*:3*)
+	echo i586-pc-interix3
+	exit 0 ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit 0 ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
 	# UNAME_MACHINE based on the output of uname instead of i386?
-	echo i386-pc-interix
+	echo i586-pc-interix
 	exit 0 ;;
     i*:UWIN*:*)
 	echo ${UNAME_MACHINE}-pc-uwin
 	exit 0 ;;
     p*:CYGWIN*:*)
 	echo powerpcle-unknown-cygwin
 	exit 0 ;;
     prep*:SunOS:5.*:*)
@@ -766,26 +799,58 @@ EOF
 	exit 0 ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit 0 ;;
     arm*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit 0 ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit 0 ;;
     m68*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit 0 ;;
     mips:Linux:*:*)
-	case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
-	  big)    echo mips-unknown-linux-gnu && exit 0 ;;
-	  little) echo mipsel-unknown-linux-gnu && exit 0 ;;
-	esac
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+	;;
+    mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips64
+	#undef mips64el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mips64el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips64
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
 	;;
     ppc:Linux:*:*)
 	echo powerpc-unknown-linux-gnu
 	exit 0 ;;
     ppc64:Linux:*:*)
 	echo powerpc64-unknown-linux-gnu
 	exit 0 ;;
     alpha:Linux:*:*)
@@ -824,82 +889,96 @@ EOF
 	exit 0 ;;
     x86_64:Linux:*:*)
 	echo x86_64-unknown-linux-gnu
 	exit 0 ;;
     i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
 	# first see if it will tell us. cd to the root directory to prevent
 	# problems with other programs or directories called `ld' in the path.
-	ld_supported_targets=`cd /; ld --help 2>&1 \
+	# Set LC_ALL=C to ensure ld outputs messages in English.
+	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
 			 | sed -ne '/supported targets:/!d
 				    s/[ 	][ 	]*/ /g
 				    s/.*supported targets: *//
 				    s/ .*//
 				    p'`
         case "$ld_supported_targets" in
 	  elf32-i386)
 		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
 		;;
 	  a.out-i386-linux)
 		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-		exit 0 ;;		
+		exit 0 ;;
 	  coff-i386)
 		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
 		exit 0 ;;
 	  "")
 		# Either a pre-BFD a.out linker (linux-gnuoldld) or
 		# one that does not give us useful --help.
 		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
 		exit 0 ;;
 	esac
 	# Determine whether the default compiler is a.out or elf
 	eval $set_cc_for_build
-	cat >$dummy.c <<EOF
-#include <features.h>
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-	int main (int argc, char *argv[]) {
-#else
-	int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __ELF__
-# ifdef __GLIBC__
-#  if __GLIBC__ >= 2
-    printf ("%s-pc-linux-gnu\n", argv[1]);
-#  else
-    printf ("%s-pc-linux-gnulibc1\n", argv[1]);
-#  endif
-# else
-   printf ("%s-pc-linux-gnulibc1\n", argv[1]);
-# endif
-#else
-  printf ("%s-pc-linux-gnuaout\n", argv[1]);
-#endif
-  return 0;
-}
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
+	#else
+	#ifdef __INTEL_COMPILER
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
 EOF
-	$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
-	rm -f $dummy.c $dummy
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
 	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
 	;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 	# earlier versions are messed up and put the nodename in both
 	# sysname and nodename.
 	echo i386-sequent-sysv4
 	exit 0 ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
         # I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 	exit 0 ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit 0 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit 0 ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit 0 ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit 0 ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
 	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
 		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
 	else
 		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 	fi
 	exit 0 ;;
@@ -911,32 +990,29 @@ EOF
 	esac
 	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
 	exit 0 ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
 		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
 	elif /bin/uname -X 2>/dev/null >/dev/null ; then
-		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
-		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
-		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
 			&& UNAME_MACHINE=i586
-		(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
 			&& UNAME_MACHINE=i686
-		(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
 			&& UNAME_MACHINE=i686
 		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
 	else
 		echo ${UNAME_MACHINE}-pc-sysv32
 	fi
 	exit 0 ;;
-    i*86:*DOS:*:*)
-	echo ${UNAME_MACHINE}-pc-msdosdjgpp
-	exit 0 ;;
     pc:*:*:*)
 	# Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
 	echo i386-pc-msdosdjgpp
         exit 0 ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
@@ -950,38 +1026,41 @@ EOF
 	else # Add other i860-SVR4 vendors below as they are discovered.
 	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 	fi
 	exit 0 ;;
     mini*:CTIX:SYS*5:*)
 	# "miniframe"
 	echo m68010-convergent-sysv
 	exit 0 ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit 0 ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit 0 ;;
     M68*:*:R3V[567]*:*)
 	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
           && echo i486-ncr-sysv4 && exit 0 ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
 	exit 0 ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
     TSUNAMI:LynxOS:2.*:*)
 	echo sparc-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
     rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 	echo powerpc-unknown-lynxos${UNAME_RELEASE}
@@ -1053,35 +1132,44 @@ EOF
 	echo i586-pc-beos
 	exit 0 ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
 	exit 0 ;;
     SX-5:SUPER-UX:*:*)
 	echo sx5-nec-superux${UNAME_RELEASE}
 	exit 0 ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
     Power*:Rhapsody:*:*)
 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
 	exit 0 ;;
     *:Rhapsody:*:*)
 	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
 	exit 0 ;;
     *:Darwin:*:*)
-	echo `uname -p`-apple-darwin${UNAME_RELEASE}
+	case `uname -p` in
+	    *86) UNAME_PROCESSOR=i686 ;;
+	    powerpc) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit 0 ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
-	if test "${UNAME_MACHINE}" = "x86pc"; then
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
 		UNAME_MACHINE=pc
 	fi
-	echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
 	exit 0 ;;
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit 0 ;;
-    NSR-[KW]:NONSTOP_KERNEL:*:*)
+    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
 	echo nsr-tandem-nsk${UNAME_RELEASE}
 	exit 0 ;;
     *:NonStop-UX:*:*)
 	echo mips-compaq-nonstopux
 	exit 0 ;;
     BS2000:POSIX*:*:*)
 	echo bs2000-siemens-sysv
 	exit 0 ;;
@@ -1094,19 +1182,16 @@ EOF
 	# operating systems.
 	if test "$cputype" = "386"; then
 	    UNAME_MACHINE=i386
 	else
 	    UNAME_MACHINE="$cputype"
 	fi
 	echo ${UNAME_MACHINE}-unknown-plan9
 	exit 0 ;;
-    i*86:OS/2:*:*)
-        echo ${UNAME_MACHINE}-pc-os2-emx
-	exit 0 ;;
     *:TOPS-10:*:*)
 	echo pdp10-unknown-tops10
 	exit 0 ;;
     *:TENEX:*:*)
 	echo pdp10-unknown-tenex
 	exit 0 ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 	echo pdp10-dec-tops20
@@ -1115,22 +1200,16 @@ EOF
 	echo pdp10-xkl-tops20
 	exit 0 ;;
     *:TOPS-20:*:*)
 	echo pdp10-unknown-tops20
 	exit 0 ;;
     *:ITS:*:*)
 	echo pdp10-unknown-its
 	exit 0 ;;
-    i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
-	exit 0 ;;
-    i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
-	exit 0 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 
 eval $set_cc_for_build
 cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
@@ -1241,18 +1320,17 @@ main ()
 #if defined (alliant) && defined (i860)
   printf ("i860-alliant-bsd\n"); exit (0);
 #endif
 
   exit (1);
 }
 EOF
 
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
-rm -f $dummy.c $dummy
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
 
 # Apollos put the system type in the environment.
 
 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
 if [ -x /usr/convex/getsysinfo ]
--- a/build/autoconf/config.sub
+++ b/build/autoconf/config.sub
@@ -1,14 +1,14 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
-timestamp='2001-10-05'
+timestamp='2003-02-22'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
 # can handle that machine.  It does not imply ALL GNU software can.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
@@ -113,17 +113,17 @@ case $# in
  *) echo "$me: too many arguments$help" >&2
     exit 1;;
 esac
 
 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
+  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
     then os=`echo $1 | sed 's/.*-/-/'`
     else os=; fi
@@ -219,45 +219,60 @@ case $os in
 		os=-mint
 		;;
 esac
 
 # Decode aliases for certain CPU-COMPANY combinations.
 case $basic_machine in
 	# Recognize the basic CPU types without company name.
 	# Some are omitted here because they have special meanings below.
+#### MozillaHack 
+# mips*el
+#### End MozillaHack 
 	1750a | 580 \
 	| a29k \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
-	| c4x | clipper \
-	| d10v | d30v | dsp16xx \
-	| fr30 \
+	| clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
+	| ip2k \
 	| m32r | m68000 | m68k | m88k | mcore \
-	| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
-	| mips64vr4100 | mips64vr4100el | mips64vr4300 \
-	| mips64vr4300el | mips64vr5000 | mips64vr5000el \
-	| mipsbe | mipseb | mips*el | mipsle | mipstx39 | mipstx39el \
-	| mipsisa32 \
+	| mips | mipsbe | mipseb | mips*el | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
+	| msp430 \
 	| ns16k | ns32k \
-	| openrisc \
+	| openrisc | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 	| pyramid \
-	| s390 | s390x \
-	| sh | sh[34] | sh[34]eb | shbe | shle \
-	| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
-	| stormy16 | strongarm \
+	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+	| strongarm \
 	| tahoe | thumb | tic80 | tron \
-	| v850 \
+	| v850 | v850e \
 	| we32k \
-	| x86 | xscale \
+	| x86 | xscale | xstormy16 | xtensa \
 	| z8k)
 		basic_machine=$basic_machine-unknown
 		;;
 	m6811 | m68hc11 | m6812 | m68hc12)
 		# Motorola 68HC11/12.
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -271,52 +286,71 @@ case $basic_machine in
 	  basic_machine=$basic_machine-pc
 	  ;;
 	# Object if more than one company name word.
 	*-*-*)
 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
 		exit 1
 		;;
 	# Recognize the basic CPU types with company name.
+#### MozillaHack 
+# mips*el
+#### End MozillaHack 
 	580-* \
 	| a29k-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-	| alphapca5[67]-* | arc-* \
-	| arm-*  | armbe-* | armle-* | armv*-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* \
 	| bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c54x-* \
-	| clipper-* | cray2-* | cydra-* \
-	| d10v-* | d30v-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
-	| f30[01]-* | f700-* | fr30-* | fx80-* \
+	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* \
 	| m32r-* \
-	| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
 	| m88110-* | m88k-* | mcore-* \
-	| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
-	| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
-	| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
-	| mipsle-* | mips*el-* | mipstx39-* | mipstx39el-* \
-	| none-* | np1-* | ns16k-* | ns32k-* \
+	| mips-* | mipsbe-* | mipseb-* | mips*el-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| msp430-* \
+	| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 	| pyramid-* \
 	| romp-* | rs6000-* \
-	| s390-* | s390x-* \
-	| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
-	| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
-	| sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
-	| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
-	| v850-* | vax-* \
+	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tron-* \
+	| v850-* | v850e-* | vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+	| xtensa-* \
 	| ymp-* \
 	| z8k-*)
 		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
 	386bsd)
 		basic_machine=i386-unknown
 		os=-bsd
@@ -371,16 +405,20 @@ case $basic_machine in
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
 		;;
 	balance)
 		basic_machine=ns32k-sequent
 		os=-dynix
 		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=-bsd
 		;;
 	convex-c2)
 		basic_machine=c2-convex
 		os=-bsd
 		;;
@@ -391,40 +429,40 @@ case $basic_machine in
 	convex-c34)
 		basic_machine=c34-convex
 		os=-bsd
 		;;
 	convex-c38)
 		basic_machine=c38-convex
 		os=-bsd
 		;;
-	cray | ymp)
-		basic_machine=ymp-cray
-		os=-unicos
-		;;
-	cray2)
-		basic_machine=cray2-cray
-		os=-unicos
-		;;
-	[cjt]90)
-		basic_machine=${basic_machine}-cray
+	cray | j90)
+		basic_machine=j90-cray
 		os=-unicos
 		;;
 	crds | unos)
 		basic_machine=m68k-crds
 		;;
 	cris | cris-* | etrax*)
 		basic_machine=cris-axis
 		;;
 	da30 | da30-*)
 		basic_machine=m68k-da30
 		;;
 	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
 		basic_machine=mips-dec
 		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
 	delta | 3300 | motorola-3300 | motorola-delta \
 	      | 3300-motorola | delta-motorola)
 		basic_machine=m68k-motorola
 		;;
 	delta88)
 		basic_machine=m88k-motorola
 		os=-sysv3
 		;;
@@ -593,50 +631,42 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-mingw32
 		;;
 #### MozillaHack 
 	i386-msvc | msvc)
 		basic_machine=i386-pc
 		os=-msvc
 		;;
-	i386-mksnt)
-		basic_machine=i386-pc
-		os=-mksnt
-		;;
 #### End MozillaHack 
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
 	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
 		basic_machine=m68k-atari
 		os=-mint
 		;;
-	mipsel*-linux*)
-		basic_machine=mipsel-unknown
-		os=-linux-gnu
-		;;
-	mips*-linux*)
-		basic_machine=mips-unknown
-		os=-linux-gnu
-		;;
 	mips3*-*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
 		;;
 	mips3*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
 		;;
 	mmix*)
 		basic_machine=mmix-knuth
 		os=-mmixware
 		;;
 	monitor)
 		basic_machine=m68k-rom68k
 		os=-coff
 		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
 		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
 		;;
@@ -699,23 +729,31 @@ case $basic_machine in
 		;;
 	nonstopux)
 		basic_machine=mips-compaq
 		os=-nonstopux
 		;;
 	np1)
 		basic_machine=np1-gould
 		;;
+	nv1)
+		basic_machine=nv1-cray
+		os=-unicosmp
+		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
 	op50n-* | op60c-*)
 		basic_machine=hppa1.1-oki
 		os=-proelf
 		;;
+	or32 | or32-*)
+		basic_machine=or32-unknown
+		os=-coff
+		;;
 	OSE68000 | ose68000)
 		basic_machine=m68000-ericsson
 		os=-ose
 		;;
 	os68k)
 		basic_machine=m68k-none
 		os=-os68k
 		;;
@@ -728,23 +766,23 @@ case $basic_machine in
 		os=-osf
 		;;
 	pbd)
 		basic_machine=sparc-tti
 		;;
 	pbb)
 		basic_machine=m68k-tti
 		;;
-        pc532 | pc532-*)
+	pc532 | pc532-*)
 		basic_machine=ns32k-pc532
 		;;
 	pentium | p5 | k5 | k6 | nexgen | viac3)
 		basic_machine=i586-pc
 		;;
-	pentiumpro | p6 | 6x86 | athlon)
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
 		basic_machine=i686-pc
 		;;
 	pentiumii | pentium2)
 		basic_machine=i686-pc
 		;;
 	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
 		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
@@ -755,32 +793,32 @@ case $basic_machine in
 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	pn)
 		basic_machine=pn-gould
 		;;
 	power)	basic_machine=power-ibm
 		;;
 	ppc)	basic_machine=powerpc-unknown
-	        ;;
+		;;
 	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppcle | powerpclittle | ppc-le | powerpc-little)
 		basic_machine=powerpcle-unknown
-	        ;;
+		;;
 	ppcle-* | powerpclittle-*)
 		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppc64)	basic_machine=powerpc64-unknown
-	        ;;
+		;;
 	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
 		basic_machine=powerpc64le-unknown
-	        ;;
+		;;
 	ppc64le-* | powerpc64little-*)
 		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ps2)
 		basic_machine=i386-ibm
 		;;
 	pw32)
 		basic_machine=i586-unknown
@@ -791,20 +829,32 @@ case $basic_machine in
 		os=-coff
 		;;
 	rm[46]00)
 		basic_machine=mips-siemens
 		;;
 	rtpc | rtpc-*)
 		basic_machine=romp-ibm
 		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
 	sa29200)
 		basic_machine=a29k-amd
 		os=-udi
 		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
 	sequent)
 		basic_machine=i386-sequent
 		;;
 	sh)
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
 	sparclite-wrs | simso-wrs)
@@ -869,29 +919,49 @@ case $basic_machine in
 		basic_machine=sv1-cray
 		os=-unicos
 		;;
 	symmetry)
 		basic_machine=i386-sequent
 		os=-dynix
 		;;
 	t3e)
-		basic_machine=t3e-cray
+		basic_machine=alphaev5-cray
 		os=-unicos
 		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+        tic4x | c4x*)
+		basic_machine=tic4x-unknown
+		os=-coff
+		;;
 	tic54x | c54x*)
 		basic_machine=tic54x-unknown
 		os=-coff
 		;;
+	tic55x | c55x*)
+		basic_machine=tic55x-unknown
+		os=-coff
+		;;
+	tic6x | c6x*)
+		basic_machine=tic6x-unknown
+		os=-coff
+		;;
 	tx39)
 		basic_machine=mipstx39-unknown
 		;;
 	tx39el)
 		basic_machine=mipstx39el-unknown
 		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
 	tower | tower-32)
 		basic_machine=m68k-ncr
 		;;
 	udi29k)
 		basic_machine=a29k-amd
 		os=-udi
 		;;
 	ultra3)
@@ -906,18 +976,18 @@ case $basic_machine in
 		basic_machine=vax-dec
 		os=-sysv
 		;;
 	vms)
 		basic_machine=vax-dec
 		os=-vms
 		;;
 	vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
-               ;;
+		basic_machine=f301-fujitsu
+		;;
 	vxworks960)
 		basic_machine=i960-wrs
 		os=-vxworks
 		;;
 	vxworks68)
 		basic_machine=m68k-wrs
 		os=-vxworks
 		;;
@@ -928,27 +998,23 @@ case $basic_machine in
 	w65*)
 		basic_machine=w65-wdc
 		os=-none
 		;;
 	w89k-*)
 		basic_machine=hppa1.1-winbond
 		os=-proelf
 		;;
-	windows32)
-		basic_machine=i386-pc
-		os=-windows32-msvcrt
+	xps | xps100)
+		basic_machine=xps100-honeywell
 		;;
-	xmp)
-		basic_machine=xmp-cray
+	ymp)
+		basic_machine=ymp-cray
 		os=-unicos
 		;;
-        xps | xps100)
-		basic_machine=xps100-honeywell
-		;;
 	z8k-*-coff)
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
 	none)
 		basic_machine=none-none
 		os=-none
 		;;
@@ -959,23 +1025,16 @@ case $basic_machine in
 		basic_machine=hppa1.1-winbond
 		;;
 	op50n)
 		basic_machine=hppa1.1-oki
 		;;
 	op60c)
 		basic_machine=hppa1.1-oki
 		;;
-	mips)
-		if [ x$os = x-linux-gnu ]; then
-			basic_machine=mips-unknown
-		else
-			basic_machine=mips-mips
-		fi
-		;;
 	romp)
 		basic_machine=romp-ibm
 		;;
 	rs6000)
 		basic_machine=rs6000-ibm
 		;;
 	vax)
 		basic_machine=vax-dec
@@ -985,41 +1044,40 @@ case $basic_machine in
 		basic_machine=pdp10-unknown
 		;;
 	pdp11)
 		basic_machine=pdp11-dec
 		;;
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sh3 | sh4 | sh3eb | sh4eb)
+	sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
 	sparc | sparcv9 | sparcv9b)
 		basic_machine=sparc-sun
 		;;
-        cydra)
+	cydra)
 		basic_machine=cydra-cydrome
 		;;
 	orion)
 		basic_machine=orion-highlevel
 		;;
 	orion105)
 		basic_machine=clipper-highlevel
 		;;
 	mac | mpw | mac-mpw)
 		basic_machine=m68k-apple
 		;;
 	pmac | pmac-mpw)
 		basic_machine=powerpc-apple
 		;;
-	c4x*)
-		basic_machine=c4x-none
-		os=-coff
-		;;
 	*-unknown)
 		# Make sure to match an already-canonicalized machine name.
 		;;
 	*)
 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
 		exit 1
 		;;
 esac
@@ -1058,48 +1116,55 @@ case $os in
 		;;
 	-gnu/linux*)
 		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
 		;;
 	# First accept the basic system types.
 	# The portable systems comes first.
 	# Each alternative MUST END IN A *, to match a version number.
 	# -sysv* is not here because it comes later, after sysvr4.
+#### MozillaHack 
+# msvc
+#### End MozillaHack 
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 	      | -aos* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
 	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
-	      | -msvc* | -mksnt* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -msvc* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-	      | -os2* | -vos*)
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
 		case $basic_machine in
 		    x86-* | i*86-*)
 			;;
 		    *)
 			os=-nto$os
 			;;
 		esac
 		;;
+	-nto-qnx*)
+		;;
 	-nto*)
-		os=-nto-qnx
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
 		;;
 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
 	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
 	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
 		;;
 	-mac*)
 		os=`echo $os | sed -e 's|mac|macos|'`
 		;;
@@ -1128,24 +1193,30 @@ case $os in
 		os=-bsd
 		;;
 	-dynix*)
 		os=-bsd
 		;;
 	-acis*)
 		os=-aos
 		;;
+	-atheos*)
+		os=-atheos
+		;;
 	-386bsd)
 		os=-bsd
 		;;
 	-ctix* | -uts*)
 		os=-sysv
 		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
 	-ns2 )
-	        os=-nextstep2
+		os=-nextstep2
 		;;
 	-nsk*)
 		os=-nsk
 		;;
 	# Preserve the version number of sinix5.
 	-sinix5.*)
 		os=`echo $os | sed -e 's|sinix|sysv|'`
 		;;
@@ -1174,18 +1245,24 @@ case $os in
 		os=-ose
 		;;
 	-es1800*)
 		os=-ose
 		;;
 	-xenix)
 		os=-xenix
 		;;
-        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-	        os=-mint
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
 		;;
 	-none)
 		;;
 	*)
 		# Get rid of the `-' at the beginning of $os.
 		os=`echo $os | sed 's/[^-]*-//'`
 		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
 		exit 1
@@ -1208,20 +1285,21 @@ case $basic_machine in
 		os=-riscix1.2
 		;;
 	arm*-rebel)
 		os=-linux
 		;;
 	arm*-semi)
 		os=-aout
 		;;
+	# This must come before the *-dec entry.
 	pdp10-*)
 		os=-tops20
 		;;
-        pdp11-*)
+	pdp11-*)
 		os=-none
 		;;
 	*-dec | vax-*)
 		os=-ultrix4.2
 		;;
 	m68*-apollo)
 		os=-domain
 		;;
@@ -1238,16 +1316,19 @@ case $basic_machine in
 		os=-aout
 		;;
 	mips*-cisco)
 		os=-elf
 		;;
 	mips*-*)
 		os=-elf
 		;;
+	or32-*)
+		os=-coff
+		;;
 	*-tti)	# must be before sparc entry or we get the wrong os.
 		os=-sysv3
 		;;
 	sparc-* | *-sun)
 		os=-sunos4.1.1
 		;;
 	*-be)
 		os=-beos
@@ -1301,29 +1382,29 @@ case $basic_machine in
 		os=-genix
 		;;
 	i370-*)
 		os=-mvs
 		;;
 	*-next)
 		os=-nextstep3
 		;;
-        *-gould)
+	*-gould)
 		os=-sysv
 		;;
-        *-highlevel)
+	*-highlevel)
 		os=-bsd
 		;;
 	*-encore)
 		os=-bsd
 		;;
-        *-sgi)
+	*-sgi)
 		os=-irix
 		;;
-        *-siemens)
+	*-siemens)
 		os=-sysv4
 		;;
 	*-masscomp)
 		os=-rtu
 		;;
 	f30[01]-fujitsu | f700-fujitsu)
 		os=-uxpv
 		;;
@@ -1385,17 +1466,17 @@ case $basic_machine in
 				vendor=ns
 				;;
 			-mvs* | -opened*)
 				vendor=ibm
 				;;
 			-ptx*)
 				vendor=sequent
 				;;
-			-vxsim* | -vxworks*)
+			-vxsim* | -vxworks* | -windiss*)
 				vendor=wrs
 				;;
 			-aux*)
 				vendor=apple
 				;;
 			-hms*)
 				vendor=hitachi
 				;;
new file mode 100755
--- /dev/null
+++ b/build/cygwin-wrapper
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Stupid wrapper to avoid win32 dospath/cygdrive issues
+#
+prog=$1
+shift
+if test -z "$prog"; then
+    exit 0
+fi
+mountpoint=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
+if test -z "$mountpoint"; then
+   print "Cannot determine cygwin mount points. Exiting"
+   exit 1
+fi
+mountpoint=`echo $mountpoint | sed 's|/$||'`
+if test "$prog" = "-up"; then
+   prog=$1
+   shift
+   args=`echo $* | sed -e "s|-I\([a-zA-Z]\):/|-I${mountpoint}/\1/|g;"`
+else
+   args=`echo $* | sed -e "s|${mountpoint}/\([a-zA-Z]\)/|\1:/|g;"`
+fi
+exec $prog $args
deleted file mode 100644
--- a/config/AIX.mk
+++ /dev/null
@@ -1,171 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for AIX.
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-#
-# XXX
-# Temporary define for the Client; to be removed when binary release is used
-#
-ifdef MOZILLA_CLIENT
-ifneq ($(USE_PTHREADS),1)
-CLASSIC_NSPR = 1
-endif
-endif
-
-#
-# There are three implementation strategies available on AIX:
-# pthreads, classic, and pthreads-user.
-#
-# On AIX 3.2, classic nspr is the default (and only) implementation
-# strategy.  On AIX 4.1 and later, the default is pthreads.
-# 
-ifeq ($(OS_RELEASE),3.2)
-CLASSIC_NSPR = 1
-endif
-
-ifeq ($(CLASSIC_NSPR),1)
-	PTHREADS_USER =
-	USE_PTHREADS =
-	IMPL_STRATEGY = _EMU
-	DEFINES += -D_PR_LOCAL_THREADS_ONLY
-else
-ifeq ($(PTHREADS_USER),1)
-	USE_PTHREADS =
-	IMPL_STRATEGY = _PTH_USER
-else
-	USE_PTHREADS = 1
-	IMPL_STRATEGY = _PTH
-endif
-endif
-
-# IPv6 support part of the standard AIX 4.3 release.
-ifneq (,$(filter-out 3.2 4.1 4.2,$(OS_RELEASE)))
-USE_IPV6 = 1
-endif
-
-ifeq ($(CLASSIC_NSPR),1)
-CC		= xlC
-CCC		= xlC
-else
-CC		= xlC_r
-CCC		= xlC_r
-endif
-OS_CFLAGS	= -qro -qroconst
-ifeq ($(USE_64),1)
-OBJECT_MODE	= 64
-export OBJECT_MODE
-COMPILER_TAG	= _64
-else
-COMPILER_TAG	= _32
-endif
-
-CPU_ARCH	= rs6000
-
-RANLIB		= ranlib
-
-OS_CFLAGS 	+= -DAIX -DSYSV
-ifeq ($(CC),xlC_r)
-OS_CFLAGS 	+= -qarch=com
-endif
-
-ifneq ($(OS_RELEASE),3.2)
-OS_CFLAGS	+= -DAIX_HAVE_ATOMIC_OP_H -DAIX_TIMERS
-endif
-
-ifeq (,$(filter-out 3.2 4.1,$(OS_RELEASE)))
-ifndef USE_PTHREADS
-OS_CFLAGS	+= -DAIX_RENAME_SELECT
-endif
-endif
-
-ifeq (,$(filter-out 3.2 4.1,$(OS_RELEASE)))
-OS_CFLAGS	+= -D_PR_NO_LARGE_FILES
-else
-OS_CFLAGS	+= -D_PR_HAVE_OFF64_T
-endif
-
-ifeq ($(OS_RELEASE),4.1)
-OS_CFLAGS	+= -DAIX4_1
-else
-DSO_LDOPTS	= -brtl -bM:SRE -bnoentry -bexpall
-MKSHLIB		= $(LD) $(DSO_LDOPTS)
-ifeq ($(OS_RELEASE),4.3)
-OS_CFLAGS	+= -DAIX4_3
-endif
-endif
-
-# Have the socklen_t data type
-ifeq ($(OS_RELEASE),4.3)
-OS_CFLAGS	+= -DHAVE_SOCKLEN_T
-endif
-
-ifneq (,$(filter-out 3.2 4.1 4.2,$(OS_RELEASE)))
-OS_CFLAGS	+= -DHAVE_FCNTL_FILE_LOCKING
-endif
-
-ifeq (,$(filter-out 4.2 4.3,$(OS_RELEASE)))
-# On these OS revisions, localtime_r() is declared if _THREAD_SAFE
-# is defined.
-ifneq ($(CLASSIC_NSPR),1)
-OS_CFLAGS	+= -DHAVE_POINTER_LOCALTIME_R
-endif
-endif
-
-ifeq (,$(filter-out 4.3,$(OS_RELEASE)))
-# On these OS revisions, gethostbyXXX() returns result in thread
-# specific storage.
-ifeq ($(USE_PTHREADS),1)
-OS_CFLAGS	+= -D_PR_HAVE_THREADSAFE_GETHOST
-endif
-endif
-
-#
-# Special link info for constructing AIX programs. On AIX we have to
-# statically link programs that use NSPR into a single .o, rewriting the
-# calls to select to call "aix". Once that is done we then can
-# link that .o with a .o built in nspr which implements the system call.
-#
-ifneq (,$(filter-out 3.2 4.1,$(OS_RELEASE)))
-AIX_LINK_OPTS	= -brtl -bnso -berok
-else
-AIX_LINK_OPTS	= -bnso -berok
-#AIX_LINK_OPTS	= -bnso -berok -brename:.select,.wrap_select -brename:.poll,.wrap_poll -bI:/usr/lib/syscalls.exp
-endif
-
-AIX_WRAP	= $(DIST)/lib/aixwrap.o
-AIX_TMP		= $(OBJDIR)/_aix_tmp.o
deleted file mode 100644
--- a/config/BSD_OS.mk
+++ /dev/null
@@ -1,91 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for BSD/OS Unix.
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-ifeq (,$(filter-out 1.1 4.%,$(OS_RELEASE)))
-CC		= gcc -Wall -Wno-format
-CCC		= g++
-else
-CC		= shlicc2
-CCC		= shlicc2
-endif
-RANLIB		= ranlib
-
-ifeq ($(USE_PTHREADS),1)
-IMPL_STRATEGY = _PTH
-DEFINES		+= -D_PR_NEED_PTHREAD_INIT
-else
-IMPL_STRATEGY = _EMU
-DEFINES		+= -D_PR_LOCAL_THREADS_ONLY
-endif
-
-OS_CFLAGS	= $(DSO_CFLAGS) -DBSDI -DHAVE_STRERROR -DNEED_BSDREGEX
-
-ifeq (86,$(findstring 86,$(OS_TEST)))
-CPU_ARCH	= x86
-endif
-ifeq (sparc,$(findstring sparc,$(OS_TEST)))
-CPU_ARCH	= sparc
-endif
-
-ifeq ($(OS_RELEASE),2.1)
-OS_CFLAGS	+= -D_PR_TIMESPEC_HAS_TS_SEC
-endif
-
-ifeq (,$(filter-out 1.1 2.1,$(OS_RELEASE)))
-OS_CFLAGS	+= -D_PR_BSDI_JMPBUF_IS_ARRAY
-else
-OS_CFLAGS	+= -D_PR_SELECT_CONST_TIMEVAL -D_PR_BSDI_JMPBUF_IS_STRUCT
-endif
-
-NOSUCHFILE	= /no-such-file
-
-ifeq ($(OS_RELEASE),1.1)
-OS_CFLAGS	+= -D_PR_STAT_HAS_ONLY_ST_ATIME -D_PR_NEED_H_ERRNO
-else
-OS_CFLAGS	+= -DHAVE_DLL -DUSE_DLFCN -D_PR_STAT_HAS_ST_ATIMESPEC
-OS_LIBS		= -ldl
-ifeq (,$(filter-out 4.%,$(OS_RELEASE)))
-MKSHLIB		= $(CC) $(DSO_LDOPTS)
-DSO_CFLAGS	= -fPIC
-DSO_LDOPTS	= -shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)
-else
-MKSHLIB		= $(LD) $(DSO_LDOPTS)
-DSO_LDOPTS	= -r
-endif
-endif
deleted file mode 100644
--- a/config/BeOS.mk
+++ /dev/null
@@ -1,139 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-
-######################################################################
-# Config stuff for BeOS (all architectures)
-######################################################################
-
-######################################################################
-# Version-independent
-######################################################################
-
-DEFINES			+= 
-XP_DEFINE		= -DXP_BEOS
-
-OBJ_SUFFIX              = o
-LIB_SUFFIX              = a
-DLL_SUFFIX              = so
-AR                      = ar cr $@
-STRIP			= strip
-
-ifdef BUILD_OPT
-DEFINES                 = -UDEBUG -DNDEBUG
-OBJDIR_TAG              = _OPT
-else
-DEFINES                 = -DDEBUG -UNDEBUG
-OBJDIR_TAG              = _DBG
-endif
-
-ifeq (PC,$(findstring PC,$(OS_TEST)))
-CPU_ARCH		= x86
-CC                      = gcc
-CCC                     = g++
-LD                      = gcc
-RANLIB                  = ranlib
-DSO_LDOPTS              = -nostart
-PORT_FLAGS		= -DHAVE_STRERROR
-ifdef BUILD_OPT
-OPTIMIZER		= -O2
-LDFLAGS			+= -s
-else
-OPTIMIZER		= -gdwarf-2 -O0
-endif
-else
-CPU_ARCH		= ppc
-CC                      = mwcc
-CCC                     = mwcc
-LD                      = mwld
-RANLIB                  = ranlib
-DSO_LDOPTS              = -xms -export pragma \
-					-init _init_routine_ \
-					-term _term_routine_ \
-					-lroot -lnet \
-					/boot/develop/lib/ppc/glue-noinit.a \
-					/boot/develop/lib/ppc/init_term_dyn.o \
-					/boot/develop/lib/ppc/start_dyn.o 
-
-PORT_FLAGS		= -DHAVE_STRERROR -D_POSIX_SOURCE
-ifdef BUILD_OPT
-OPTIMIZER		= -O2
-else
-OPTIMIZER		= -g -O0
-endif
-endif
-CPU_ARCH_TAG		= _$(CPU_ARCH)
-
-OS_INCLUDES		=  -I- -I. 
-#G++INCLUDES		= -I/usr/include/g++
-
-PLATFORM_FLAGS		= -DBeOS -DBEOS $(OS_INCLUDES)
-
-OS_CFLAGS		= $(DSO_CFLAGS) $(PLATFORM_FLAGS) $(PORT_FLAGS)
-
-USE_BTHREADS = 1
-
-MKSHLIB			= $(LD) $(DSO_LDOPTS)
-
-OBJDIR_NAME	= $(OS_CONFIG)_$(CPU_ARCH)$(OBJDIR_TAG).OBJ
-
-####################################################################
-#
-# One can define the makefile variable NSDISTMODE to control
-# how files are published to the 'dist' directory.  If not
-# defined, the default is "install using relative symbolic
-# links".  The two possible values are "copy", which copies files
-# but preserves source mtime, and "absolute_symlink", which
-# installs using absolute symbolic links.  The "absolute_symlink"
-# option requires NFSPWD.
-#
-####################################################################
-
-NSINSTALL       = $(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall
-
-ifeq ($(NSDISTMODE),copy)
-# copy files, but preserve source mtime
-INSTALL         = $(NSINSTALL) -t
-else
-ifeq ($(NSDISTMODE),absolute_symlink)
-# install using absolute symbolic links
-INSTALL         = $(NSINSTALL) -L `$(NFSPWD)`
-else
-# install using relative symbolic links
-INSTALL         = $(NSINSTALL) -R
-endif
-endif
-
-define MAKE_OBJDIR
-if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
-endef
deleted file mode 100644
--- a/config/DGUX.mk
+++ /dev/null
@@ -1,63 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for Data General DG/UX
-#
-# Initial DG/UX port by Marc Fraioli <fraioli@dg-rtp.dg.com>
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-CC		= gcc
-CCC		= g++
-
-RANLIB		= true
-
-DEFINES		+= -D_PR_LOCAL_THREADS_ONLY 
-OS_CFLAGS	= -DSVR4 -DSYSV -DDGUX -D_DGUX_SOURCE -D_POSIX4A_DRAFT6_SOURCE 
-
-MKSHLIB		= $(LD) $(DSO_LDOPTS)
-DSO_LDOPTS	= -G 
-
-CPU_ARCH	= x86
-ARCH		= dgux
-
-NOSUCHFILE	= /no-such-file
-
-ifdef BUILD_OPT
-OPTIMIZER	= -O2
-else
-# -g would produce a huge executable.
-OPTIMIZER	=
-endif
deleted file mode 100644
--- a/config/FreeBSD.mk
+++ /dev/null
@@ -1,82 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for FreeBSD
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-CC			= gcc
-CCC			= g++
-RANLIB			= ranlib
-
-ifeq ($(OS_TEST),alpha)
-CPU_ARCH		= alpha
-else
-OS_REL_CFLAGS		= -Di386
-CPU_ARCH		= x86
-endif
-CPU_ARCH_TAG		= _$(CPU_ARCH)
-
-OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe $(THREAD_FLAG) -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
-
-#
-# The default implementation strategy for FreeBSD is pthreads.
-#
-ifeq ($(CLASSIC_NSPR),1)
-IMPL_STRATEGY		= _EMU
-DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
-else
-USE_PTHREADS		= 1
-IMPL_STRATEGY		= _PTH
-DEFINES			+= -D_THREAD_SAFE
-THREAD_FLAG		+= -pthread
-endif
-
-ARCH			= freebsd
-
-MOZ_OBJFORMAT          := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
-
-ifeq ($(MOZ_OBJFORMAT),elf)
-DLL_SUFFIX		= so
-else
-DLL_SUFFIX		= so.1.0
-endif
-
-DSO_CFLAGS		= -fPIC
-DSO_LDOPTS		= -Bshareable
-
-MKSHLIB			= $(LD) $(DSO_LDOPTS)
-
-G++INCLUDES		= -I/usr/include/g++
deleted file mode 100644
--- a/config/HP-UX.mk
+++ /dev/null
@@ -1,203 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for HP-UX
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-DLL_SUFFIX	= sl
-
-ifdef NS_USE_GCC
-	CC			        = gcc
-	CCC			        = g++
-	OS_CFLAGS		    =
-	COMPILER_TAG        = _gcc
-else
-	CC			        = cc -Ae
-	CCC			        = CC -ext
-	OS_CFLAGS           = +ESlit
-endif
-
-RANLIB			= echo
-
-CPU_ARCH		= hppa
-
-OS_CFLAGS		+= $(DSO_CFLAGS) -DHPUX -D$(CPU_ARCH) -D_HPUX_SOURCE
-
-#
-# The header netdb.h on HP-UX 9 does not declare h_errno.
-# On 10.10 and 10.20, netdb.h declares h_errno only if
-# _XOPEN_SOURCE_EXTENDED is defined.  So we need to declare
-# h_errno ourselves.
-#
-ifeq ($(basename $(OS_RELEASE)),A.09)
-OS_CFLAGS		+= -D_PR_NEED_H_ERRNO
-endif
-ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
-OS_CFLAGS		+= -D_PR_NEED_H_ERRNO
-endif
-
-# Do we have localtime_r()?  Does it return 'int' or 'struct tm *'?
-ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
-OS_CFLAGS		+= -DHAVE_INT_LOCALTIME_R
-endif
-ifeq (,$(filter-out B.10.30 B.11.00,$(OS_RELEASE)))
-OS_CFLAGS		+= -DHAVE_POINTER_LOCALTIME_R
-endif
-
-#
-# XXX
-# Temporary define for the Client; to be removed when binary release is used
-#
-ifdef MOZILLA_CLIENT
-CLASSIC_NSPR = 1
-endif
-
-#
-# On HP-UX 9, the default (and only) implementation strategy is
-# classic nspr.
-#
-# On HP-UX 10.10 and 10.20, the default implementation strategy is
-# pthreads (actually DCE threads).  Classic nspr is also available.
-#
-# On HP-UX 10.30 and 11.00, the default implementation strategy is
-# pthreads.  Classic nspr and pthreads-user are also available.
-#
-ifeq ($(basename $(OS_RELEASE)),A.09)
-OS_CFLAGS		+= -DHPUX9
-DEFAULT_IMPL_STRATEGY = _EMU
-endif
-
-ifeq ($(OS_RELEASE),B.10.01)
-OS_CFLAGS		+= -DHPUX10
-DEFAULT_IMPL_STRATEGY = _EMU
-endif
-
-ifeq ($(OS_RELEASE),B.10.10)
-OS_CFLAGS		+= -DHPUX10 -DHPUX10_10
-DEFAULT_IMPL_STRATEGY = _PTH
-endif
-
-ifeq ($(OS_RELEASE),B.10.20)
-OS_CFLAGS		+= -DHPUX10 -DHPUX10_20
-ifndef NS_USE_GCC
-OS_CFLAGS		+= +DAportable +DS1.1
-endif
-DEFAULT_IMPL_STRATEGY = _PTH
-endif
-
-#
-# On 10.30 and 11.00, we use the new ANSI C++ compiler aCC.
-#
-
-ifeq ($(OS_RELEASE),B.10.30)
-ifndef NS_USE_GCC
-CCC			= /opt/aCC/bin/aCC -ext
-OS_CFLAGS		+= +DAportable +DS1.1
-endif
-OS_CFLAGS		+= -DHPUX10 -DHPUX10_30
-DEFAULT_IMPL_STRATEGY = _PTH
-endif
-
-# 11.00 is similar to 10.30.
-ifeq ($(OS_RELEASE),B.11.00)
-	ifndef NS_USE_GCC
-		CCC			        = /opt/aCC/bin/aCC -ext
-		ifeq ($(USE_64), 1)
-			OS_CFLAGS       += +DA2.0W +DS2.0
-			COMPILER_TAG    = _64
-		else
-			OS_CFLAGS       += +DAportable +DS2.0
-			COMPILER_TAG    = _32
-		endif
-	endif
-OS_CFLAGS		+= -DHPUX10 -DHPUX11 -D_LARGEFILE64_SOURCE -D_PR_HAVE_OFF64_T -DHAVE_FCNTL_FILE_LOCKING
-DEFAULT_IMPL_STRATEGY = _PTH
-endif
-
-ifeq ($(DEFAULT_IMPL_STRATEGY),_EMU)
-CLASSIC_NSPR = 1
-endif
-
-ifeq ($(DEFAULT_IMPL_STRATEGY),_PTH)
-USE_PTHREADS = 1
-IMPL_STRATEGY = _PTH
-ifeq ($(CLASSIC_NSPR),1)
-USE_PTHREADS =
-IMPL_STRATEGY = _EMU
-endif
-ifeq ($(PTHREADS_USER),1)
-USE_PTHREADS =
-IMPL_STRATEGY = _PTH_USER
-endif
-endif
-
-ifeq ($(CLASSIC_NSPR),1)
-DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
-endif
-
-ifeq (,$(filter-out A.09 B.10,$(basename $(OS_RELEASE))))
-DEFINES			+= -D_PR_NO_LARGE_FILES
-endif
-
-#
-# To use the true pthread (kernel thread) library on 10.30 and
-# 11.00, we should define _POSIX_C_SOURCE to be 199506L.
-# The _REENTRANT macro is deprecated.
-#
-
-ifdef USE_PTHREADS
-ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
-OS_CFLAGS		+= -D_REENTRANT -D_PR_DCETHREADS
-else
-OS_CFLAGS		+= -D_POSIX_C_SOURCE=199506L -D_PR_HAVE_THREADSAFE_GETHOST
-endif
-endif
-
-ifdef PTHREADS_USER
-OS_CFLAGS		+= -D_POSIX_C_SOURCE=199506L
-endif
-
-MKSHLIB			= $(LD) $(DSO_LDOPTS)
-
-DSO_LDOPTS		= -b +h $(notdir $@)
-
-# -fPIC or +Z generates position independent code for use in shared
-# libraries.
-ifdef NS_USE_GCC
-DSO_CFLAGS		= -fPIC
-else
-DSO_CFLAGS		= +Z
-endif
deleted file mode 100644
--- a/config/IRIX.mk
+++ /dev/null
@@ -1,158 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for IRIX
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-#
-# XXX
-# Temporary define for the Client; to be removed when binary release is used
-#
-ifdef MOZILLA_CLIENT
-ifneq ($(USE_PTHREADS),1)
-CLASSIC_NSPR = 1
-endif
-endif
-
-#
-# On IRIX 5.x, classic nspr (user-level threads on top of sprocs)
-# is the default (and only) implementation strategy.
-#
-# On IRIX 6.x and later, the default implementation strategy is
-# pthreads.  Classic nspr is also available.
-#
-ifeq ($(basename $(OS_RELEASE)),5)
-CLASSIC_NSPR = 1
-endif
-
-ifeq ($(CLASSIC_NSPR),1)
-	IMPL_STRATEGY = _MxN
-else
-	USE_PTHREADS = 1
-	USE_N32 = 1
-	IMPL_STRATEGY = _PTH
-endif
-
-ifdef NS_USE_GCC
-	CC			= gcc
-	COMPILER_TAG		= _gcc
-	AS			= $(CC) -x assembler-with-cpp -D_ASM -mips2
-	ODD_CFLAGS		= -Wall -Wno-format
-	ifdef BUILD_OPT
-		OPTIMIZER		= -O6
-	endif
-else
-	CC			= cc
-	CCC         = CC
-	ODD_CFLAGS		= -fullwarn -xansi
-	ifdef BUILD_OPT
-		ifneq ($(USE_N32),1)
-			OPTIMIZER		= -O -Olimit 4000
-		else
-			OPTIMIZER		= -O -OPT:Olimit=4000
-		endif
-	endif
-
-#
-# The default behavior is still -o32 generation, hence the explicit tests
-# for -n32 and -64 and implicitly assuming -o32. If that changes, ...
-#
-	ifeq ($(basename $(OS_RELEASE)),6)
-		ODD_CFLAGS += -multigot
-		SHLIB_LD_OPTS = -no_unresolved
-		ifeq ($(USE_N32),1)
-			ODD_CFLAGS += -n32 -woff 1209
-			COMPILER_TAG = _n32
-			LDOPTS += -n32
-        	SHLIB_LD_OPTS += -n32
-			ifeq ($(OS_RELEASE), 6_2)
-				LDOPTS += -Wl,-woff,85
-				SHLIB_LD_OPTS += -woff 85
-			endif
-		else
-			ifeq ($(USE_64),1)
-				ODD_CFLAGS +=  -64
-				COMPILER_TAG = _64
-			else
-				ODD_CFLAGS +=  -32
-				COMPILER_TAG = _o32
-			endif
-		endif
-	else
-		ODD_CFLAGS += -xgot
-	endif
-endif
-
-ODD_CFLAGS		+= -DSVR4 -DIRIX -DHAVE_FCNTL_FILE_LOCKING
-
-CPU_ARCH		= mips
-
-RANLIB			= /bin/true
-
-# For purify
-# XXX: should always define _SGI_MP_SOURCE
-NOMD_OS_CFLAGS		= $(ODD_CFLAGS) -D_SGI_MP_SOURCE
-
-ifeq ($(OS_RELEASE),5.3)
-OS_CFLAGS		+= -DIRIX5_3
-endif
-
-ifneq ($(basename $(OS_RELEASE)),5)
-OS_CFLAGS		+= -D_PR_HAVE_SGI_PRDA_PROCMASK
-endif
-
-ifeq (,$(filter-out 6.5,$(OS_RELEASE)))
-ifndef NS_USE_GCC
-OS_CFLAGS		+= -mips3
-endif
-OS_CFLAGS		+= -D_PR_HAVE_GETPROTO_R -D_PR_HAVE_GETPROTO_R_POINTER
-ifeq ($(USE_PTHREADS),1)
-OS_CFLAGS		+= -D_PR_HAVE_GETHOST_R -D_PR_HAVE_GETHOST_R_POINTER
-endif
-endif
-
-ifndef NO_MDUPDATE
-OS_CFLAGS		+= $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
-else
-OS_CFLAGS		+= $(NOMD_OS_CFLAGS)
-endif
-
-# -rdata_shared is an ld option that puts string constants and
-# const data into the text segment, where they will be shared
-# across processes and be read-only.
-MKSHLIB			= $(LD) $(SHLIB_LD_OPTS) -rdata_shared -shared -soname $(notdir $@)
-
-DSO_LDOPTS		= -elf -shared -all
deleted file mode 100644
--- a/config/Linux.mk
+++ /dev/null
@@ -1,131 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-######################################################################
-# Config stuff for Linux (all architectures)
-######################################################################
-
-######################################################################
-# Version-independent
-######################################################################
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-#
-# XXX
-# Temporary define for the Client; to be removed when binary release is used
-#
-ifdef MOZILLA_CLIENT
-ifneq ($(USE_PTHREADS),1)
-CLASSIC_NSPR = 1
-endif
-endif
-
-#
-# The default implementation strategy for Linux is pthreads.
-#
-ifeq ($(CLASSIC_NSPR),1)
-IMPL_STRATEGY		= _EMU
-DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
-else
-USE_PTHREADS		= 1
-IMPL_STRATEGY		= _PTH
-DEFINES			+= -D_REENTRANT
-endif
-
-ifeq (86,$(findstring 86,$(OS_TEST)))
-CPU_ARCH		:= x86
-else
-ifeq (,$(filter-out arm% sa110,$(OS_TEST)))
-CPU_ARCH		:= arm
-else
-CPU_ARCH		:= $(OS_TEST)
-endif
-endif
-CPU_ARCH_TAG		= _$(CPU_ARCH)
-
-CC			= gcc
-CCC			= g++
-RANLIB			= ranlib
-
-OS_INCLUDES		=
-G++INCLUDES		= -I/usr/include/g++
-
-PLATFORM_FLAGS		= -ansi -Wall -pipe -DLINUX -Dlinux
-PORT_FLAGS		= -D_POSIX_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -DHAVE_STRERROR -DHAVE_FCNTL_FILE_LOCKING
-
-OS_CFLAGS		= $(DSO_CFLAGS) $(PLATFORM_FLAGS) $(PORT_FLAGS)
-
-######################################################################
-# Version-specific stuff
-######################################################################
-
-ifeq ($(CPU_ARCH),alpha)
-PLATFORM_FLAGS		+= -D_ALPHA_ -D__alpha -mieee
-endif
-ifeq ($(CPU_ARCH),x86)
-PLATFORM_FLAGS		+= -Di386
-endif
-ifeq ($(CPU_ARCH),m68k)
-#
-# gcc on Linux/m68k either has a bug or triggers a code-sequence
-# bug in the 68060 which causes gcc to crash.  The simplest way to
-# avoid this is to enable a minimum level of optimization.
-#
-ifndef BUILD_OPT
-OPTIMIZER		+= -O
-endif
-PLATFORM_FLAGS		+= -m68020-40
-endif
-
-#
-# Linux 2.x has shared libraries.
-#
-
-MKSHLIB			= $(LD) $(DSO_LDOPTS) -soname $(notdir $@)
-ifdef BUILD_OPT
-OPTIMIZER		= -O2
-#   invoke 'strip' on *.so files in optimized builds
-STRIP = strip
-endif
-
-######################################################################
-# Overrides for defaults in config.mk (or wherever)
-######################################################################
-
-######################################################################
-# Other
-######################################################################
-
-DSO_CFLAGS		= -fPIC
-DSO_LDOPTS		= -shared
--- a/config/Makefile.in
+++ b/config/Makefile.in
@@ -85,17 +85,17 @@ ifeq ($(OS_ARCH), IRIX)
                 endif
             endif
         endif
     endif
 endif
 
 ifeq ($(OS_ARCH), HP-UX)
     ifeq ($(USE_64),1)
-        XLDOPTS += +DA2.0W
+        XLDOPTS += +DD64
     endif
 endif
 
 ifeq ($(MOZ_OS2_TOOLS),EMX)
 XCFLAGS = $(OS_CFLAGS)
 ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
 XLDOPTS = -Zlinker /PM:VIO
 endif
@@ -114,30 +114,32 @@ ifeq (,$(filter-out OS2 WINNT,$(OS_ARCH)
 TARGETS = $(PROGS)
 else
 PROGS	+= $(OBJDIR)/nsinstall$(PROG_SUFFIX)
 TARGETS = $(PROGS) $(PLSRCS:.pl=)
 endif
 
 OUTOPTION = -o # end of the line
 ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))
+ifndef NS_USE_GCC
 OUTOPTION = /Fe
 endif
+endif
 
 # Redefine MAKE_OBJDIR for just this directory
 define MAKE_OBJDIR
 if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); else true; fi
 endef
 
 export:: $(TARGETS)
 	rm -f $(dist_bindir)/nspr-config
 
 $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
 	@$(MAKE_OBJDIR)
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 	$(LD) $(EXEFLAGS) $<
 else
-	$(CC) $(XCFLAGS) $< $(XLDOPTS) $(OUTOPTION)$@
+	$(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@
 endif
 
 real_install:: nspr.m4
 	$(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal
 	$(NSINSTALL) -t -m 0644 $< $(DESTDIR)$(datadir)/aclocal
deleted file mode 100644
--- a/config/NCR.mk
+++ /dev/null
@@ -1,97 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for NCR SVR4 MP-RAS
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-###
-NS_USE_NATIVE = 1
-
-# NS_USE_GCC = 1
-
-export PATH:=$(PATH):/opt/ncc/bin
-###
-
-RANLIB          = true
-GCC_FLAGS_EXTRA = -pipe
-
-DEFINES		+= -DSVR4 -DSYSV -DHAVE_STRERROR -DNCR -D_PR_LOCAL_THREADS_ONLY
-
-ifeq (,$(filter-out 2.03,$(OS_RELEASE)))
-DEFINES		+= -D_PR_STAT_HAS_ST_ATIM
-else
-DEFINES		+= -D_PR_STAT_HAS_ST_ATIM_UNION
-endif
-
-ifdef NS_USE_NATIVE
-CC              = cc
-CCC             = ncc
-OS_CFLAGS	= -Hnocopyr
-#OS_LIBS         = -L/opt/ncc/lib 
-else
-#OS_LIBS		=
-endif
-
-CCC	= g++
-
-#OS_LIBS	       += -lsocket -lnsl -ldl -lc
-
-MKSHLIB		= $(LD) $(DSO_LDOPTS)
-#DSO_LDOPTS	= -G -z defs
-DSO_LDOPTS	= -G
-
-CPU_ARCH	= x86
-ARCH		= ncr
-
-NOSUCHFILE	= /no-such-file
-
-# now take care of default GCC (rus@5/5/97)
- 
-ifdef NS_USE_GCC
-# if gcc-settings are redefined already - don't touch it
-#
-ifeq (,$(findstring gcc, $(CC)))
-CC      = gcc
-CCC     = g++
-CXX     = g++
-COMPILER_TAG = _gcc
-# always use -fPIC - some makefiles are still broken and don't distinguish
-# situation when they build shared and static libraries
-CFLAGS  += -fPIC -Wall $(GCC_FLAGS_EXTRA)
-#OS_LIBS += -L/usr/local/lib -lstdc++ -lg++ -lgcc
-endif
-endif
-###
-
deleted file mode 100644
--- a/config/NEC.mk
+++ /dev/null
@@ -1,61 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for NEC Mips SYSV
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-CPU_ARCH		= mips
-
-ifdef NS_USE_GCC
-CC			= gcc
-CCC			= g++
-else
-CC			= $(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000
-CCC			= g++
-endif
-
-MKSHLIB			= $(LD) $(DSO_LDOPTS)
-
-RANLIB			= /bin/true
-
-DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
-OS_CFLAGS		= $(ODD_CFLAGS) -DSVR4 -D__SVR4 -DNEC -Dnec_ews -DHAVE_STRERROR
-OS_LIBS			= -lsocket -lnsl -ldl $(LDOPTIONS)
-LDOPTIONS		= -lc -L/usr/ucblib -lucb
-
-NOSUCHFILE		= /no-such-file
-
-DSO_LDOPTS		= -G
deleted file mode 100644
--- a/config/NEWS-OS.mk
+++ /dev/null
@@ -1,74 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-######################################################################
-# Config stuff for Sony NEWS-OS
-######################################################################
- 
-######################################################################
-# Version-independent
-######################################################################
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-ARCH			:= sony
-CPU_ARCH		:= mips
- 
-CC			= cc
-CCC			= CC
-RANLIB			= /bin/true
-
-OS_INCLUDES		= -I/usr/include
-G++INCLUDES		=
-#OS_LIBS			= -lsocket -lnsl -lgen -lresolv
-
-PLATFORM_FLAGS		= -Xa -fullwarn -DSONY
-PORT_FLAGS		= -DSYSV -DSVR4 -D__svr4 -D__svr4__ -D_PR_LOCAL_THREADS_ONLY -DHAVE_SVID_GETTOD
-
-OS_CFLAGS		= $(PLATFORM_FLAGS) $(PORT_FLAGS)
-
-######################################################################
-# Version-specific stuff
-######################################################################
-
-######################################################################
-# Overrides for defaults in config.mk (or wherever)
-######################################################################
-
-######################################################################
-# Other
-######################################################################
-
-MKSHLIB			= $(LD) $(DSO_LDOPTS)
- 
-DSO_LDOPTS		= -G
deleted file mode 100644
--- a/config/NEXTSTEP.mk
+++ /dev/null
@@ -1,68 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for NEXTSTEP
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-CC			= cc
-CCC			= cc++
-
-RANLIB			= ranlib
-
-OS_REL_CFLAGS		= -D$(shell uname -p)
-CPU_ARCH		:= $(shell uname -p)
-
-# "Commons" are tentative definitions in a global scope, like this:
-#     int x;
-# The meaning of a common is ambiguous.  It may be a true definition:
-#     int x = 0;
-# or it may be a declaration of a symbol defined in another file:
-#     extern int x;
-# Use the -fno-common option to force all commons to become true
-# definitions so that the linker can catch multiply-defined symbols.
-# Also, common symbols are not allowed with Rhapsody dynamic libraries.
-
-OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wall -fno-common -pipe -DNEXTSTEP -DHAVE_STRERROR -DHAVE_BSD_FLOCK -D_POSIX_SOURCE -traditional-cpp -posix
-
-DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
-
-ARCH			= $(CPU_ARCH)
-
-# May override this with -bundle to create a loadable module.
-#DSO_LDOPTS		= -dynamiclib
-
-#MKSHLIB			= $(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS)
-DLL_SUFFIX		= dylib
deleted file mode 100644
--- a/config/NTO.mk
+++ /dev/null
@@ -1,90 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1999-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-######################################################################
-# Config stuff for Neutrino
-######################################################################
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-#
-# XXX
-# Temporary define for the Client; to be removed when binary release is used
-#
-ifdef MOZILLA_CLIENT
-ifneq ($(USE_PTHREADS),1)
-CLASSIC_NSPR = 1
-endif
-endif
-
-#
-# The default implementation strategy for Linux is pthreads.
-#
-ifeq ($(CLASSIC_NSPR),1)
-IMPL_STRATEGY		= _EMU
-DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
-else
-USE_PTHREADS		= 1
-IMPL_STRATEGY		= _PTH
-DEFINES			+= -D_REENTRANT
-endif
-
-
-AR			 = qcc -Vgcc_ntox86 -M -a $@
-CC			 = qcc -Vgcc_ntox86
-LD			 = $(CC)
-CCC			 = $(CC)
-
-# Old Flags  -DNO_REGEX   -DSTRINGS_ALIGNED
-
-OS_CFLAGS	 = -Wc,-Wall -Wc,-Wno-parentheses -DNTO  \
-			   -D_QNX_SOURCE -DHAVE_POINTER_LOCALTIME_R -shared
-
-COMPILER_TAG = _qcc
-MKSHLIB		 = qcc -Vgcc_ntox86 -shared -Wl,-h$(@:$(OBJDIR)/%.so=%.so) -M
-
-RANLIB		 = ranlib
-G++INCLUDES	 =
-OS_LIBS		 =
-EXTRA_LIBS  = -lsocket
-
-ifdef BUILD_OPT
-OPTIMIZER = -O1
-else
-OPTIMIZER = -O1 -gstabs
-endif
-
-NOSUCHFILE	= /no-such-file
-
-GARBAGE		+= *.map
-
deleted file mode 100644
--- a/config/NetBSD.mk
+++ /dev/null
@@ -1,89 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for NetBSD
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-CC			= gcc
-CCC			= g++
-RANLIB			= ranlib
-
-ifndef OBJECT_FMT
-OBJECT_FMT		:= $(shell if echo __ELF__ | $${CC:-cc} -E - | grep -q __ELF__ ; then echo a.out ; else echo ELF ; fi)
-endif
-
-OS_REL_CFLAGS		=
-ifeq (86,$(findstring 86,$(OS_TEST)))
-CPU_ARCH		= x86
-else
-CPU_ARCH		= $(OS_TEST)
-endif
-
-OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DNETBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
-
-ifeq ($(USE_PTHREADS),1)
-OS_LIBS			= -lc_r
-# XXX probably should define _THREAD_SAFE too.
-else
-OS_LIBS			= -lc
-DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
-endif
-
-ARCH			= netbsd
-
-ifeq ($(OBJECT_FMT),ELF)
-DLL_SUFFIX		= so
-else
-DLL_SUFFIX		= so.1.0
-# XXX work around a bug in the a.out ld(1).
-OS_LIBS			=
-endif
-
-DSO_CFLAGS		= -fPIC -DPIC
-DSO_LDOPTS		= -shared
-ifeq ($(OBJECT_FMT),ELF)
-DSO_LDOPTS		+=-Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
-endif
-
-ifdef LIBRUNPATH
-#DSO_LDOPTS		+= -R$(LIBRUNPATH)
-DSO_LDOPTS		+= -Wl,-R$(LIBRUNPATH)
-endif
-
-#MKSHLIB		= $(LD) $(DSO_LDOPTS)
-MKSHLIB			= $(CC) $(DSO_LDOPTS)
-
-G++INCLUDES		= -I/usr/include/g++
deleted file mode 100644
--- a/config/OS2.mk
+++ /dev/null
@@ -1,171 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Configuration common to all (supported) versions of OS/2
-#
-# OS_CFLAGS is the command line options for the compiler when
-#   building the .DLL object files.
-# OS_EXE_CFLAGS is the command line options for the compiler
-#   when building the .EXE object files; this is for the test
-#   programs.
-# the macro OS_CFLAGS is set to OS_EXE_CFLAGS inside of the
-#   makefile for the pr/tests directory. ... Hack.
-
-# Specify toolset.  Default to EMX.
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-XP_OS2_VACPP = 1
-else
-ifeq ($(MOZ_OS2_TOOLS),PGCC)
-XP_OS2_EMX   = 1
-else
-MOZ_OS2_TOOLS = EMX
-XP_OS2_EMX   = 1
-endif
-endif
-
-ifeq ($(XP_OS2_EMX),1)
-MOZ_EMXTAG = $(subst .,,$(MOZ_OS2_EMX_OBJECTFORMAT))
-endif
-
-#
-# On OS/2 we proudly support gbash...
-#
-SHELL := GBASH.EXE
-
-CC			= icc -q -DXP_OS2 -N10
-CCC			= icc -q -DXP_OS2 -DOS2=4 -N10
-LINK			= -ilink
-AR			= -ilib /noignorecase /nologo /Out:$(subst /,\\,$@)
-RANLIB 			= @echo RANLIB
-BSDECHO 		= @echo BSDECHO
-STRIP			= @echo STRIP
-NSINSTALL 		= nsinstall
-INSTALL			= $(NSINSTALL)
-MAKE_OBJDIR 		= if test ! -d $(OBJDIR); then mkdir $(OBJDIR); fi
-IMPLIB 			= implib -nologo -noignorecase
-FILTER 			= cppfilt -b -p -q
-RC 			= rc.exe
-
-GARBAGE =
-
-XP_DEFINE 		= -DXP_PC
-LIB_SUFFIX 		= lib
-DLL_SUFFIX 		= dll
-OBJ_SUFFIX		= obj
-
-OS_CFLAGS     		= -W3 -Wcnd- -gm -gd+ -sd- -su4 -ge- -Mp
-OS_EXE_CFLAGS 		= -W3 -Wcnd- -gm -gd+ -sd- -su4 -Mp
-AR_EXTRA_ARGS 		= 
-
-ifdef BUILD_OPT
-OPTIMIZER		= -O+ -Oi 
-DEFINES 		= -UDEBUG -U_DEBUG -DNDEBUG
-DLLFLAGS		= -DLL -OUT:$@ -MAP:$(@:.dll=.map)
-EXEFLAGS    		= -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
-OBJDIR_TAG 		= _OPT
-else
-OPTIMIZER		= -Ti+ -DE
-DEFINES 		= -DDEBUG -D_DEBUG -DDEBUGPRINTS
-DLLFLAGS		= -DEBUG -DLL -OUT:$@ -MAP:$(@:.dll=.map)
-EXEFLAGS    		= -DEBUG -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
-OBJDIR_TAG 		= _DBG
-LDFLAGS 		= -DEBUG 
-endif
-
-DEFINES += -DOS2=4
-DEFINES += -D_X86_
-DEFINES += -D_PR_GLOBAL_THREADS_ONLY -DBSD_SELECT
-
-# Name of the binary code directories
-ifdef MOZ_LITE
-OBJDIR_NAME 		= $(subst OS2,NAV,$(OS_CONFIG))_$(MOZ_OS2_TOOLS)$(MOZ_EMXTAG)$(OBJDIR_TAG).OBJ
-else
-OBJDIR_NAME 		= $(OS_CONFIG)_$(MOZ_OS2_TOOLS)$(MOZ_EMXTAG)$(OBJDIR_TAG).OBJ
-endif
-
-OS_DLLFLAGS 		= -nologo -DLL -FREE -NOE
-
-ifdef XP_OS2_VACPP
-
-OS_LIBS 		= so32dll.lib tcp32dll.lib
-
-DEFINES += -DXP_OS2_VACPP -DTCPV40HDRS
-
-else
-CC			= gcc
-CCC			= gcc
-LINK			= gcc
-RC 			= rc.exe
-FILTER  		= emxexp
-IMPLIB  		= emximp -o
-
-# Determine which object format to use.  Two choices:
-# a.out and omf.  We default to omf.
-ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT), A.OUT)
-AR      	= ar -q $@
-LIB_SUFFIX	= a
-else
-OMF_FLAG 	= -Zomf
-AR		= emxomfar r $@
-LIB_SUFFIX	= lib
-endif
-
-OS_LIBS     		= -lsocket -lemxio
-
-DEFINES += -DXP_OS2 -DXP_OS2_EMX -DOS2EMX_PLAIN_CHAR
-
-OS_CFLAGS     		= $(OMF_FLAG) -Wall -Wno-unused -Zmtd
-OS_EXE_CFLAGS 		= $(OMF_FLAG) -Wall -Wno-unused -Zmtd
-OS_DLLFLAGS 		= $(OMF_FLAG) -Zmt -Zdll -Zcrtdll -o $@
-ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
-EXEFLAGS                += -Zlinker /DE
-endif
-
-ifdef BUILD_OPT
-OPTIMIZER		= -O3
-DLLFLAGS		= 
-EXEFLAGS    		= -Zmtd -o $@
-else
-OPTIMIZER		= -g #-s
-DLLFLAGS		= -g #-s
-EXEFLAGS		= -g $(OMF_FLAG) -Zmtd -L$(DIST)/lib -o $@   # -s
-ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
-EXEFLAGS                += -Zlinker /DE
-endif
-endif
-
-AR_EXTRA_ARGS 		=
-endif
-
-
deleted file mode 100644
--- a/config/OSF1.mk
+++ /dev/null
@@ -1,122 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for DEC OSF/1
-#
-
-#
-# The Bourne shell (sh) on OSF1 doesn't handle "set -e" correctly,
-# which we use to stop LOOP_OVER_DIRS submakes as soon as any
-# submake fails.  So we use the Korn shell instead.
-#
-SHELL			:= /usr/bin/ksh
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-#
-# XXX
-# Temporary define for the Client; to be removed when binary release is used
-#
-ifdef MOZILLA_CLIENT
-ifneq ($(USE_PTHREADS),1)
-CLASSIC_NSPR = 1
-endif
-endif
-
-#
-# Prior to OSF1 V4.0, classic nspr is the default (and only) implementation
-# strategy.
-#
-# On OSF1 V4.0, pthreads is the default implementation strategy.
-# Classic nspr is also available.
-#
-ifeq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
-CLASSIC_NSPR = 1
-endif
-
-ifeq ($(CLASSIC_NSPR), 1)
-	IMPL_STRATEGY = _EMU
-	DEFINES += -D_PR_LOCAL_THREADS_ONLY
-else
-	USE_PTHREADS = 1
-	IMPL_STRATEGY = _PTH
-endif
-
-CC			= cc $(NON_LD_FLAGS) -std1
-ifneq ($(OS_RELEASE),V2.0)
-CC			+= -readonly_strings
-endif
-# The C++ compiler cxx has -readonly_strings on by default.
-CCC			= cxx
-
-RANLIB			= /bin/true
-
-CPU_ARCH		= alpha
-
-ifdef BUILD_OPT
-OPTIMIZER		+= -Olimit 4000
-endif
-
-NON_LD_FLAGS		= -ieee_with_inexact
-
-OS_CFLAGS		= -DOSF1 -D_REENTRANT
-
-ifneq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
-OS_CFLAGS		+= -DOSF1_HAVE_MACHINE_BUILTINS_H
-endif
-
-ifneq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
-OS_CFLAGS		+= -DHAVE_FCNTL_FILE_LOCKING
-endif
-
-ifeq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
-OS_CFLAGS		+= -DHAVE_INT_LOCALTIME_R
-else
-OS_CFLAGS		+= -DHAVE_POINTER_LOCALTIME_R
-endif
-
-ifeq (,$(filter-out V4.0%,$(OS_RELEASE)))
-OS_CFLAGS		+= -DOSF1V4_MAP_PRIVATE_BUG
-endif
-
-ifeq ($(USE_PTHREADS),1)
-OS_CFLAGS		+= -pthread
-ifneq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
-OS_CFLAGS		+= -D_PR_HAVE_THREADSAFE_GETHOST
-endif
-endif
-
-# The command to build a shared library on OSF1.
-MKSHLIB = ld -shared -all -expect_unresolved "*" -soname $(notdir $@)
-DSO_LDOPTS		= -shared
deleted file mode 100644
--- a/config/OpenBSD.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for OpenBSD
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-CC                     = gcc
-CCC                    = g++
-RANLIB                 = ranlib
-
-OS_REL_CFLAGS          =
-ifeq (86,$(findstring 86,$(OS_TEST)))
-CPU_ARCH               = x86
-else
-CPU_ARCH               = $(OS_TEST)
-endif
-
-OS_CFLAGS              = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe $(THREAD_FLAG) -DOPENBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
-
-ifeq ($(USE_PTHREADS),1)
-THREAD_FLAG		+= -pthread
-# XXX probably should define _THREAD_SAFE too.
-else
-DEFINES                        += -D_PR_LOCAL_THREADS_ONLY
-endif
-
-ARCH                   = openbsd
-
-DLL_SUFFIX             = so.1.0
-
-DSO_CFLAGS             = -fPIC
-DSO_LDOPTS             = -Bshareable
-ifeq ($(OS_TEST),alpha)
-DSO_LDOPTS             = -shared
-endif
-ifeq ($(OS_TEST),mips)
-DSO_LDOPTS             = -shared
-endif
-ifeq ($(OS_TEST),pmax)  
-DSO_LDOPTS             = -shared
-endif
-
-MKSHLIB                        = $(LD) $(DSO_LDOPTS)
-
-G++INCLUDES            = -I/usr/include/g++
deleted file mode 100644
--- a/config/OpenVMS.mk
+++ /dev/null
@@ -1,67 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for Compaq OpenVMS
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-ifdef INTERNAL_TOOLS
-CC			= c89
-CCC			= cxx
-OPTIMIZER		= -O
-else
-CC			= ccc
-CCC			= ccc
-endif
-
-RANLIB			= /bin/true
-
-CPU_ARCH_TAG		= _$(CPU_ARCH)
-
-OS_CFLAGS              = -DVMS -DVMS_AS_IS -Wc,names=\(short,as\) \
-                         -DGENERIC_PTHREAD_REDEFINES -D_SOCKADDR_LEN
-OS_CXXFLAGS            = -DVMS -DVMS_AS_IS -Wc,names=\(short,as\) \
-                         -DGENERIC_PTHREAD_REDEFINES -D_SOCKADDR_LEN
-
-#
-# XCFLAGS are the only CFLAGS that are used during a link operation. Defining
-# OPTIMIZER in XCFLAGS means that each compilation line gets OPTIMIZER
-# included twice, but at least we get OPTIMIZER included in the link
-# operations; and OpenVMS needs it!
-#
-XCFLAGS                        += $(OPTIMIZER)
-
-# The command to build a shared library in POSIX on OpenVMS.
-MKSHLIB = vmsld $(OPTIMIZER)
deleted file mode 100644
--- a/config/QNX.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-######################################################################
-# Config stuff for QNX.
-######################################################################
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-CPU_ARCH	= x86
-
-ifndef NS_USE_GCC
-CC		= cc
-CCC		= cc
-endif
-RANLIB		= true
-
-G++INCLUDES	=
-OS_LIBS		=
-XLDOPTS		= -lunix
-
-OS_CFLAGS	= -DQNX -Di386 -D_PR_LOCAL_THREADS_ONLY -D_PR_NEED_H_ERRNO
-#IMPL_STRATEGY	= _EMU
-
-NOSUCHFILE	= /no-such-file
-
-GARBAGE		= $(wildcard *.err)
deleted file mode 100644
--- a/config/Rhapsody.mk
+++ /dev/null
@@ -1,83 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for Rhapsody
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-#
-# The default implementation strategy for Rhapsody is pthreads.
-#
-ifeq ($(CLASSIC_NSPR),1)
-IMPL_STRATEGY   = _EMU
-DEFINES         += -D_PR_LOCAL_THREADS_ONLY
-else
-USE_PTHREADS    = 1
-IMPL_STRATEGY   = _PTH
-endif
-
-CC              = cc
-CCC             = c++
-RANLIB			= ranlib
-
-ifeq (86,$(findstring 86,$(OS_TEST)))
-OS_REL_CFLAGS   = -mno-486 -Di386
-CPU_ARCH        = i386
-else
-OS_REL_CFLAGS   = -Dppc
-CPU_ARCH		= ppc
-endif
-
-# "Commons" are tentative definitions in a global scope, like this:
-#     int x;
-# The meaning of a common is ambiguous.  It may be a true definition:
-#     int x = 0;
-# or it may be a declaration of a symbol defined in another file:
-#     extern int x;
-# Use the -fno-common option to force all commons to become true
-# definitions so that the linker can catch multiply-defined symbols.
-# Also, common symbols are not allowed with Rhapsody dynamic libraries.
-
-OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wmost -fno-common -pipe -DRHAPSODY -DHAVE_STRERROR -DHAVE_BSD_FLOCK
-
-ARCH			= rhapsody
-
-# May override this with -bundle to create a loadable module.
-DSO_LDOPTS		= -dynamiclib -compatibility_version 1 -current_version 1 -all_load
-
-MKSHLIB			= $(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS)
-DLL_SUFFIX		= dylib
-
-G++INCLUDES		= -I/usr/include/g++
deleted file mode 100644
--- a/config/SCOOS.mk
+++ /dev/null
@@ -1,63 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for SCO OpenServer for x86.
-# SCO OpenServer 5, based on SVR3.2, is intended for small to
-# medium customers.
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-CC			= cc -b elf -KPIC
-CCC			= $(NSDEPTH)/build/hcpp CC +.cpp +w
-RANLIB			= /bin/true
-
-DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
-#
-# -DSCO - Changes to Netscape source (consistent with AIX, LINUX, etc..)
-# -Dsco - Needed for /usr/include/X11/*
-#
-OS_CFLAGS		= -DSYSV -D_SVID3 -DHAVE_STRERROR -D_PR_NEED_H_ERRNO -DSCO -Dsco
-#OS_LIBS			= -lpmapi -lsocket -lc
-
-MKSHLIB			= $(LD) $(DSO_LDOPTS)
-
-CPU_ARCH		= x86
-ARCH			= sco
-
-NOSUCHFILE		= /no-such-file
-
-BSDECHO			= /bin/echo
-
-DSO_LDOPTS		= -b elf -G
deleted file mode 100644
--- a/config/SINIX.mk
+++ /dev/null
@@ -1,108 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for SNI SINIX (aka ReliantUNIX)
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-ifeq (86,$(findstring 86,$(OS_TEST)))
-CPU_ARCH		= x86
-else
-CPU_ARCH		= mips
-endif
-CPU_ARCH_TAG		= _$(CPU_ARCH)
-
-# use gcc -tf-
-NS_USE_GCC		= 1
-
-ifeq ($(NS_USE_GCC),1)
-## gcc-2.7.2 homebrewn
-CC			= gcc
-COMPILER_TAG		= _gcc
-CCC			= g++
-AS			= $(CC) -x assembler-with-cpp
-ifeq ($(CPU_ARCH),mips)
-LD			= gld
-endif
-ODD_CFLAGS		= -Wall -Wno-format
-ifeq ($(CPU_ARCH),mips)
-# The -pipe flag only seems to work on the mips version of SINIX.
-ODD_CFLAGS		+= -pipe
-endif
-ifdef BUILD_OPT
-OPTIMIZER		= -O
-#OPTIMIZER		= -O6
-endif
-MKSHLIB			= $(LD) -G -z defs -h $(@:$(OBJDIR)/%.so=%.so)
-#DSO_LDOPTS		= -G -Xlinker -Blargedynsym
-else
-## native compiler (CDS++ 1.0)
-CC			= /usr/bin/cc
-CCC			= /usr/bin/CC
-AS			= /usr/bin/cc
-#ODD_CFLAGS		= -fullwarn -xansi
-ODD_CFLAGS		= 
-ifdef BUILD_OPT
-#OPTIMIZER		= -Olimit 4000
-OPTIMIZER		= -O -F Olimit,4000
-endif
-MKSHLIB			= $(LD) -G -z defs -h $(@:$(OBJDIR)/%.so=%.so)
-#DSO_LDOPTS		= -G -W l,-Blargedynsym
-endif
-
-ifeq ($(CPU_ARCH),x86)
-DEFINES			+= -Di386
-endif
-
-ODD_CFLAGS		+= -DSVR4 -DSNI -DRELIANTUNIX -Dsinix -DHAVE_SVID_GETTOD
-
-# On SINIX 5.43, need to define IP_MULTICAST in order to get the
-# IP multicast macro and struct definitions in netinet/in.h.
-# (SINIX 5.42 does not have IP multicast at all.)
-ifeq ($(OS_RELEASE),5.43)
-ODD_CFLAGS		+= -DIP_MULTICAST
-endif
-
-RANLIB			= /bin/true
-
-# For purify
-NOMD_OS_CFLAGS		= $(ODD_CFLAGS)
-
-# we do not have -MDupdate ...
-OS_CFLAGS		= $(NOMD_OS_CFLAGS)
-OS_LIBS			= -lsocket -lnsl -lresolv -ldl -lc
-NOSUCHFILE		= /no-such-file
-
-DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
deleted file mode 100644
--- a/config/SunOS.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for SunOS.
-# 4 and 5 are vastly different, so we use 2 different files.
-#
-ifeq ($(basename $(OS_RELEASE)),4.1)
-include $(MOD_DEPTH)/config/SunOS4.mk
-else
-include $(MOD_DEPTH)/config/SunOS5.mk
-endif
deleted file mode 100644
--- a/config/SunOS4.mk
+++ /dev/null
@@ -1,68 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for SunOS4.1
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-# SunOS 4 _requires_ that shared libs have a version number.
-# XXX FIXME: Version number should use NSPR_VERSION_NUMBER?
-DLL_SUFFIX	= so.1.0
-
-CC			= gcc
-CCC			= g++
-COMPILER_TAG		= _gcc
-
-RANLIB			= ranlib
-
-CPU_ARCH		= sparc
-
-DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
-# Purify doesn't like -MDupdate
-NOMD_OS_CFLAGS		= -Wall -Wno-format -DSUNOS4
-
-ifdef NO_MDUPDATE
-OS_CFLAGS		= $(DSO_CFLAGS) $(NOMD_OS_CFLAGS)
-else
-OS_CFLAGS		= $(DSO_CFLAGS) $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
-endif
-
-MKSHLIB			= $(LD) $(DSO_LDOPTS)
-
-NOSUCHFILE		= /no-such-file
-
-DSO_LDOPTS		=
-# -fPIC generates position-independent code for use in a shared library.
-DSO_CFLAGS		= -fPIC
deleted file mode 100644
--- a/config/SunOS5.mk
+++ /dev/null
@@ -1,196 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for SunOS 5.x on sparc and x86
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-#
-# XXX
-# Temporary define for the Client; to be removed when binary release is used
-#
-ifdef MOZILLA_CLIENT
-ifneq ($(USE_PTHREADS),1)
-LOCAL_THREADS_ONLY = 1
-endif
-ifndef NS_USE_NATIVE
-NS_USE_GCC = 1
-endif
-endif
-
-#
-# The default implementation strategy on Solaris is pthreads.
-# Global threads only and local threads only are also available.
-#
-ifeq ($(GLOBAL_THREADS_ONLY),1)
-  IMPL_STRATEGY = _NATIVE
-  DEFINES += -D_PR_GLOBAL_THREADS_ONLY
-else
-  ifeq ($(LOCAL_THREADS_ONLY),1)
-    IMPL_STRATEGY = _EMU
-    DEFINES += -D_PR_LOCAL_THREADS_ONLY
-  else
-    USE_PTHREADS = 1
-    IMPL_STRATEGY = _PTH
-  endif
-endif
-
-ifdef NS_USE_GCC
-CC			= gcc -Wall
-CCC			= g++ -Wall
-ASFLAGS			+= -Wa,-P
-COMPILER_TAG		= _gcc
-ifdef NO_MDUPDATE
-OS_CFLAGS		= $(NOMD_OS_CFLAGS)
-else
-OS_CFLAGS		= $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
-endif
-else
-CC			= cc -xstrconst
-CCC			= CC -Qoption cg -xstrconst
-ASFLAGS			+= -Wa,-P
-OS_CFLAGS		= $(NOMD_OS_CFLAGS)
-#
-# If we are building for a release, we want to put all symbol
-# tables in the debug executable or share library instead of
-# the .o files, so that our clients can run dbx on the debug
-# library without having the .o files around.
-#
-ifdef BUILD_NUMBER
-ifndef BUILD_OPT
-OS_CFLAGS		+= -xs
-endif
-endif
-endif
-
-ifeq ($(USE_64),1)
-ifndef INTERNAL_TOOLS
-ifndef NS_USE_GCC
-CC			+= -xarch=v9
-CCC			+= -xarch=v9
-endif
-endif
-COMPILER_TAG		= _64
-else
-COMPILER_TAG		= _32
-endif
-
-RANLIB			= echo
-
-OS_DEFINES		= -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -DHAVE_FCNTL_FILE_LOCKING
-
-ifeq ($(OS_TEST),i86pc)
-CPU_ARCH		= x86
-OS_DEFINES		+= -Di386
-# The default debug format, DWARF (-g), is not supported by gcc
-# on i386-ANY-sysv4/solaris, but the stabs format is.  It is
-# assumed that the Solaris assembler /usr/ccs/bin/as is used.
-# If your gcc uses GNU as, you do not need the -Wa,-s option.
-ifndef BUILD_OPT
-ifdef NS_USE_GCC
-OPTIMIZER		= -Wa,-s -gstabs
-endif
-endif
-else
-CPU_ARCH		= sparc
-endif
-CPU_ARCH_TAG		= _$(CPU_ARCH)
-
-ifeq (5.5,$(findstring 5.5,$(OS_RELEASE)))
-OS_DEFINES		+= -DSOLARIS2_5
-else
-ifeq (,$(filter-out 5.3 5.4,$(OS_RELEASE)))
-OS_DEFINES		+= -D_PR_NO_LARGE_FILES
-else
-OS_DEFINES		+= -D_PR_HAVE_OFF64_T
-# The lfcompile64(5) man page on Solaris 2.6 says:
-#     For applications that do not wish to conform to the POSIX or
-#     X/Open  specifications,  the  64-bit transitional interfaces
-#     are available by default.  No compile-time flags need to  be
-#     set.
-# But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
-# The native compiler, gcc 2.8.x, and egcs don't have this problem.
-ifdef NS_USE_GCC
-OS_DEFINES		+= -D_LARGEFILE64_SOURCE
-endif
-endif
-endif
-
-ifneq ($(LOCAL_THREADS_ONLY),1)
-OS_DEFINES		+= -D_REENTRANT -DHAVE_POINTER_LOCALTIME_R
-endif
-
-# Purify doesn't like -MDupdate
-NOMD_OS_CFLAGS		= $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
-
-MKSHLIB			= $(LD) $(DSO_LDOPTS)
-
-# ld options:
-# -G: produce a shared object
-# -z defs: no unresolved symbols allowed
-DSO_LDOPTS		= -G -h $(notdir $@)
-
-# -KPIC generates position independent code for use in shared libraries.
-# (Similarly for -fPIC in case of gcc.)
-ifdef NS_USE_GCC
-DSO_CFLAGS		= -fPIC
-else
-DSO_CFLAGS		= -KPIC
-endif
-
-NOSUCHFILE		= /no-such-file
-
-#
-# Library of atomic functions for UltraSparc systems
-#
-# The nspr makefiles build ULTRASPARC_LIBRARY (which contains assembly language
-# implementation of the nspr atomic functions for UltraSparc systems) in addition
-# to libnspr.so. (The actual name of the library is
-# lib$(ULTRASPARC_LIBRARY)$(MOD_VERSION).so
-#
-# The actual name of the filter-library, recorded in libnspr.so, is set to the
-# value of $(ULTRASPARC_FILTER_LIBRARY).
-# For an application to use the assembly-language implementation, a link should be
-# made so that opening ULTRASPARC_FILTER_LIBRARY results in opening
-# ULTRASPARC_LIBRARY. This indirection requires the user to explicitly set up
-# library for use on UltraSparc systems, thereby helping to avoid using it by
-# accident on non-UltraSparc systems.
-# The directory containing the ultrasparc libraries should be in LD_LIBRARY_PATH.
-#
-ifeq ($(OS_TEST),sun4u)
-ULTRASPARC_LIBRARY = ultrasparc
-ULTRASPARC_FILTER_LIBRARY = libatomic.so
-DSO_LDOPTS		+= -f $(ULTRASPARC_FILTER_LIBRARY)
-endif
deleted file mode 100644
--- a/config/UNIX.mk
+++ /dev/null
@@ -1,92 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-PR_UNIXOS	= 1
-XP_DEFINE	= -DXP_UNIX
-OBJ_SUFFIX	= o
-LIB_SUFFIX	= a
-DLL_SUFFIX	= so
-AR		= ar cr $@
-STRIP		= true
-
-ifdef BUILD_OPT
-OPTIMIZER	= -O
-DEFINES		= -UDEBUG -DNDEBUG
-OBJDIR_TAG	= _OPT
-else
-OPTIMIZER	= -g
-DEFINES		= -DDEBUG -UNDEBUG -DDEBUG_$(shell whoami)
-OBJDIR_TAG	= _DBG
-endif
-
-# Name of the binary code directories
-ifdef MOZILLA_CLIENT
-OBJDIR_NAME	= $(OS_CONFIG)$(CPU_ARCH_TAG)$(OBJDIR_TAG).OBJ
-else
-OBJDIR_NAME	= $(OS_CONFIG)$(CPU_ARCH_TAG)$(COMPILER_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
-endif
-
-MKDEPEND_DIR    = $(DEPTH)/config/mkdepend
-MKDEPEND 	= $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend
-MKDEPENDENCIES  = $(OBJDIR)/depend.mk
-
-####################################################################
-#
-# One can define the makefile variable NSDISTMODE to control
-# how files are published to the 'dist' directory.  If not
-# defined, the default is "install using relative symbolic
-# links".  The two possible values are "copy", which copies files
-# but preserves source mtime, and "absolute_symlink", which
-# installs using absolute symbolic links.  The "absolute_symlink"
-# option requires NFSPWD.
-#
-####################################################################
-
-NSINSTALL	= $(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall
-
-ifeq ($(NSDISTMODE),copy)
-# copy files, but preserve source mtime
-INSTALL		= $(NSINSTALL) -t
-else
-ifeq ($(NSDISTMODE),absolute_symlink)
-# install using absolute symbolic links
-INSTALL		= $(NSINSTALL) -L `$(NFSPWD)`
-else
-# install using relative symbolic links
-INSTALL		= $(NSINSTALL) -R
-endif
-endif
-
-define MAKE_OBJDIR
-if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); else true; fi
-endef
deleted file mode 100644
--- a/config/UNIXWARE.mk
+++ /dev/null
@@ -1,71 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for SCO UnixWare
-# UnixWare is intended for high-end enterprise customers.
-# UnixWare 2.1 and 2.1.1 are based on SVR4.  (2.1.2 is a maintenance
-# release.)
-# UnixWare 7 (codename Gemini) is based on what SCO calls SVR5.
-# The somewhat odd version number 7 was chosen to suggest that
-#     UnixWare 2 + OpenServer 5 = UnixWare 7
-#
-
-include $(MOD_DEPTH)/config/UNIX.mk
-
-ifeq (,$(filter-out 2.1,$(OS_RELEASE)))
-CC		= $(NSDEPTH)/build/hcc cc
-CCC		= $(NSDEPTH)/build/hcpp CC
-else
-CC		= cc
-CCC		= CC
-endif
-
-RANLIB		= true
-
-DEFINES		+= -D_PR_LOCAL_THREADS_ONLY
-OS_CFLAGS	= -DSVR4 -DSYSV -DUNIXWARE
-
-ifeq (,$(filter-out 2.1,$(OS_RELEASE)))
-OS_CFLAGS	+= -D_PR_NO_LARGE_FILES
-else
-OS_CFLAGS	+= -D_LARGEFILE64_SOURCE -D_PR_HAVE_OFF64_T -D_PR_HAVE_SOCKADDR_LEN
-endif
-
-MKSHLIB		= $(LD) $(DSO_LDOPTS)
-DSO_LDOPTS	= -G
-
-CPU_ARCH	= x86
-ARCH		= sco
-
-NOSUCHFILE	= /no-such-file
deleted file mode 100644
--- a/config/WIN32.mk
+++ /dev/null
@@ -1,176 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Configuration common to all versions of Windows NT
-# and Windows 95.
-#
-
-#
-# Client build: make sure we use the shmsdos.exe under $(MOZ_TOOLS).
-# $(MOZ_TOOLS_FLIPPED) is $(MOZ_TOOLS) with all the backslashes
-# flipped, so that gmake won't interpret them as escape characters.
-#
-ifdef PR_CLIENT_BUILD_WINDOWS
-SHELL := $(MOZ_TOOLS_FLIPPED)/bin/shmsdos.exe
-endif
-
-CC = cl
-CCC = cl
-LINK = link
-AR = lib -NOLOGO -OUT:"$@"
-RANLIB = echo
-BSDECHO = echo
-STRIP = echo
-NSINSTALL = nsinstall
-INSTALL	= $(NSINSTALL)
-define MAKE_OBJDIR
-if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
-endef
-RC = rc.exe
-
-GARBAGE = $(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb
-
-XP_DEFINE = -DXP_PC
-OBJ_SUFFIX = obj
-LIB_SUFFIX = lib
-DLL_SUFFIX = dll
-
-OS_CFLAGS = -W3 -nologo -GF -Gy
-
-ifdef BUILD_OPT
-OS_CFLAGS += -MD
-OPTIMIZER = -O2
-DEFINES = -UDEBUG -U_DEBUG -DNDEBUG
-DLLFLAGS = -OUT:"$@"
-OBJDIR_TAG = _OPT
-
-# Add symbolic information for use by a profiler
-ifdef MOZ_PROFILE
-OPTIMIZER += -Z7
-DLLFLAGS += -DEBUG -DEBUGTYPE:CV
-LDFLAGS += -DEBUG -DEBUGTYPE:CV
-endif
-
-else
-#
-# Define USE_DEBUG_RTL if you want to use the debug runtime library
-# (RTL) in the debug build
-#
-ifdef USE_DEBUG_RTL
-OS_CFLAGS += -MDd
-else
-OS_CFLAGS += -MD
-endif
-OPTIMIZER = -Od -Z7
-#OPTIMIZER = -Zi -Fd$(OBJDIR)/ -Od
-DEFINES = -DDEBUG -D_DEBUG -UNDEBUG
-
-DLLFLAGS = -DEBUG -DEBUGTYPE:CV -OUT:"$@"
-ifdef GLOWCODE
-DLLFLAGS = -DEBUG -DEBUGTYPE:both -INCLUDE:_GlowCode -OUT:"$@"
-endif
-
-OBJDIR_TAG = _DBG
-LDFLAGS = -DEBUG -DEBUGTYPE:CV
-#
-# When PROFILE=1 is defined, set the compile and link options
-# to build targets for use by the ms-win32 profiler
-#
-ifdef PROFILE
-LDFLAGS += -PROFILE -MAP
-DLLFLAGS += -PROFILE -MAP
-endif
-endif
-
-DEFINES += -DWIN32
-
-#
-# On Win95, we use the TlsXXX() interface by default because that
-# allows us to load the NSPR DLL dynamically at run time.
-# If you want to use static thread-local storage (TLS) for better
-# performance, build the NSPR library with USE_STATIC_TLS=1.
-#
-ifeq ($(USE_STATIC_TLS),1)
-DEFINES += -D_PR_USE_STATIC_TLS
-endif
-
-#
-# NSPR uses both fibers and static thread-local storage
-# (i.e., __declspec(thread) variables) on NT.  We need the -GT
-# flag to turn off certain compiler optimizations so that fibers
-# can use static TLS safely.
-#
-# Also, we optimize for Pentium (-G5) on NT.
-#
-ifeq ($(OS_TARGET),WINNT)
-OS_CFLAGS += -GT
-ifeq ($(CPU_ARCH),x86)
-OS_CFLAGS += -G5
-endif
-DEFINES += -DWINNT
-else
-DEFINES += -DWIN95 -D_PR_GLOBAL_THREADS_ONLY
-endif
-
-ifeq ($(CPU_ARCH),x86)
-DEFINES += -D_X86_
-else
-ifeq ($(CPU_ARCH),MIPS)
-DEFINES += -D_MIPS_
-else
-ifeq ($(CPU_ARCH),ALPHA)
-DEFINES += -D_ALPHA_=1
-else
-CPU_ARCH = processor_is_undefined
-endif
-endif
-endif
-
-# Name of the binary code directories
-
-ifeq ($(CPU_ARCH),x86)
-CPU_ARCH_TAG =
-else
-CPU_ARCH_TAG = $(CPU_ARCH)
-endif
-
-ifdef USE_DEBUG_RTL
-OBJDIR_SUFFIX = OBJD
-else
-OBJDIR_SUFFIX = OBJ
-endif
-
-OBJDIR_NAME = $(OS_CONFIG)$(CPU_ARCH_TAG)$(OBJDIR_TAG).$(OBJDIR_SUFFIX)
-
-OS_DLLFLAGS = -nologo -DLL -SUBSYSTEM:WINDOWS -PDB:NONE
deleted file mode 100644
--- a/config/WIN95.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for WIN95
-#
-
-include $(MOD_DEPTH)/config/WIN32.mk
deleted file mode 100644
--- a/config/WINNT.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# Config stuff for WINNT
-#
-
-include $(MOD_DEPTH)/config/WIN32.mk
deleted file mode 100644
--- a/config/arch.mk
+++ /dev/null
@@ -1,286 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#######################################################################
-# Master "Core Components" macros for getting the OS architecture     #
-#######################################################################
-
-#
-# Important internal static macros
-#
-
-OS_ARCH		:= $(subst /,_,$(shell uname -s))
-OS_RELEASE	:= $(shell uname -r)
-OS_TEST		:= $(shell uname -m)
-
-#
-# Tweak the default OS_ARCH and OS_RELEASE macros as needed.
-#
-ifeq ($(OS_ARCH),AIX)
-OS_RELEASE	:= $(shell uname -v).$(shell uname -r)
-endif
-ifeq ($(OS_ARCH),BSD_386)
-OS_ARCH		:= BSD_OS
-endif
-ifeq ($(OS_ARCH),dgux)
-OS_ARCH		:= DGUX
-endif
-ifeq ($(OS_ARCH),IRIX64)
-OS_ARCH		:= IRIX
-endif
-ifeq ($(OS_ARCH),UNIX_SV)
-ifneq ($(findstring NCR,$(shell grep NCR /etc/bcheckrc | head -1 )),)
-OS_ARCH		:= NCR
-else
-OS_ARCH		:= UNIXWARE
-OS_RELEASE	:= $(shell uname -v)
-endif
-endif
-ifeq ($(OS_ARCH),Mac OS)
-OS_ARCH		:= Rhapsody
-endif
-ifeq ($(OS_ARCH),Darwin)
-OS_ARCH		:= Rhapsody
-endif
-ifeq ($(OS_ARCH),ncr)
-OS_ARCH		:= NCR
-endif
-# This is the only way to correctly determine the actual OS version on NCR boxes.
-ifeq ($(OS_ARCH),NCR)
-OS_RELEASE	:= $(shell awk '{print $$3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$$/\2.\3/')
-endif
-ifeq ($(OS_ARCH),UNIX_System_V)
-OS_ARCH		:= NEC
-endif
-ifneq (,$(findstring POSIX_for_OpenVMS,$(OS_ARCH)))
-OS_ARCH		:= OpenVMS
-CPU_ARCH	:= $(shell uname -Wh)
-OS_RELEASE	:= $(shell uname -v)
-endif
-ifeq ($(OS_ARCH),QNX)
-	ifeq ($(OS_RELEASE),6.00)
-		OS_ARCH := NTO
-		OS_RELEASE := _$(OS_TEST)$(OS_RELEASE)
-	else
-		OS_RELEASE := $(shell uname -v | sed 's/^\([0-9]\)\([0-9]*\)$$/\1.\2/')
-	endif
-endif
-ifeq ($(OS_ARCH),SCO_SV)
-OS_ARCH		:= SCOOS
-OS_RELEASE	:= 5.0
-endif
-ifeq ($(OS_ARCH),SINIX-N)
-OS_ARCH		:= SINIX
-endif
-ifeq ($(OS_ARCH),SINIX-Y)
-OS_ARCH		:= SINIX
-endif
-ifeq ($(OS_ARCH),SINIX-Z)
-OS_ARCH		:= SINIX
-endif
-# SINIX changes name to ReliantUNIX with 5.43
-ifeq ($(OS_ARCH),ReliantUNIX-N)
-OS_ARCH		:= SINIX
-endif
-ifeq ($(OS_ARCH),UnixWare)
-OS_ARCH		:= UNIXWARE
-OS_RELEASE	:= $(shell uname -v)
-endif
-
-#
-# Handle FreeBSD 2.2-STABLE and Linux 2.0.30-osfmach3
-#
-
-ifeq (,$(filter-out Linux FreeBSD,$(OS_ARCH)))
-OS_RELEASE	:= $(shell echo "$(OS_RELEASE)" | sed 's/-.*//')
-endif
-
-#
-# Distinguish between OSF1 V4.0B and V4.0D
-#
-
-ifeq ($(OS_ARCH)$(OS_RELEASE),OSF1V4.0)
-	OS_VERSION := $(shell uname -v)
-	ifeq ($(OS_VERSION),564)
-		OS_RELEASE := V4.0B
-	endif
-	ifeq ($(OS_VERSION),878)
-		OS_RELEASE := V4.0D
-	endif
-endif
-
-#
-# Handle uname variants for OS/2.
-#
-
-ifeq ($(OS_ARCH),OS_2)
-	OS_ARCH		:= OS2
-	OS_RELEASE	:= 4.0
-endif
-
-#######################################################################
-# Master "Core Components" macros for getting the OS target           #
-#######################################################################
-
-#
-# Note: OS_TARGET should be specified on the command line for gmake.
-# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
-# The difference between the Win95 target and the WinNT target is that
-# the WinNT target uses Windows NT specific features not available
-# in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
-# at lesser performance (the Win95 target uses threads; the WinNT target
-# uses fibers).
-#
-# When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
-# is built. See: win16_3.11.mk for lots more about the Win16 target.
-#
-# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
-# cross-compilation.
-#
-
-#
-# The following hack allows one to build on a WIN95 machine (as if
-# s/he were cross-compiling on a WINNT host for a WIN95 target).
-# It also accomodates for MKS's uname.exe.  If you never intend
-# to do development on a WIN95 machine, you don't need this hack.
-#
-ifeq ($(OS_ARCH),WIN95)
-	OS_ARCH   := WINNT
-	OS_TARGET := WIN95
-endif
-ifeq ($(OS_ARCH),Windows_95)
-	OS_ARCH   := Windows_NT
-	OS_TARGET := WIN95
-endif
-ifeq ($(OS_ARCH),Windows_98)
-	OS_ARCH   := Windows_NT
-	OS_TARGET := WIN95
-endif
-ifeq ($(OS_ARCH),CYGWIN_95-4.0)
-	OS_ARCH   := CYGWIN_NT-4.0
-	OS_TARGET := WIN95
-endif
-ifeq ($(OS_ARCH),CYGWIN_98-4.10)
-	OS_ARCH   := CYGWIN_NT-4.0
-	OS_TARGET := WIN95
-endif
-ifeq ($(OS_ARCH),OS2)
-	OS_ARCH   := OS2
-	OS_TARGET := OS2
-endif
-
-#
-# On WIN32, we also define the variable CPU_ARCH.
-#
-
-ifeq ($(OS_ARCH), WINNT)
-	ifneq ($(subst /,_,$(shell uname -s)),OS_2)
-		CPU_ARCH := $(shell uname -p)
-	else
-		CPU_ARCH := $(shell uname -m)
-	endif
-	ifeq ($(CPU_ARCH),I386)
-		CPU_ARCH = x86
-	endif
-else
-#
-# If uname -s returns "Windows_NT", we assume that we are using
-# the uname.exe in MKS toolkit.
-#
-# The -r option of MKS uname only returns the major version number.
-# So we need to use its -v option to get the minor version number.
-# Moreover, it doesn't have the -p option, so we need to use uname -m.
-#
-ifeq ($(OS_ARCH), Windows_NT)
-	OS_ARCH = WINNT
-	OS_MINOR_RELEASE := $(shell uname -v)
-	ifeq ($(OS_MINOR_RELEASE),00)
-		OS_MINOR_RELEASE = 0
-	endif
-	OS_RELEASE := $(OS_RELEASE).$(OS_MINOR_RELEASE)
-	CPU_ARCH := $(shell uname -m)
-	#
-	# MKS's uname -m returns "586" on a Pentium machine.
-	#
-	ifneq (,$(findstring 86,$(CPU_ARCH)))
-		CPU_ARCH = x86
-	endif
-else
-#
-# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
-# the uname.exe in the Cygwin tools.
-#
-ifeq (CYGWIN_NT,$(findstring CYGWIN_NT,$(OS_ARCH)))
-	OS_RELEASE := $(patsubst CYGWIN_NT-%,%,$(OS_ARCH))
-	OS_ARCH = WINNT
-	CPU_ARCH := $(shell uname -m)
-	#
-	# Cygwin's uname -m returns "i686" on a Pentium Pro machine.
-	#
-	ifneq (,$(findstring 86,$(CPU_ARCH)))
-		CPU_ARCH = x86
-	endif
-else
-#
-# Prior to the Beta 20 release, Cygwin was called GNU-Win32.
-# If uname -s returns "CYGWIN32/NT", we assume that we are using
-# the uname.exe in the GNU-Win32 tools.
-#
-ifeq ($(OS_ARCH), CYGWIN32_NT)
-	OS_ARCH = WINNT
-	CPU_ARCH := $(shell uname -m)
-	#
-	# GNU-Win32's uname -m returns "i686" on a Pentium Pro machine.
-	#
-	ifneq (,$(findstring 86,$(CPU_ARCH)))
-		CPU_ARCH = x86
-	endif
-endif
-endif
-endif
-endif
-
-ifndef OS_TARGET
-	OS_TARGET := $(OS_ARCH)
-endif
-
-ifeq ($(OS_TARGET), WIN95)
-	OS_RELEASE := 4.0
-endif
-
-ifeq ($(OS_TARGET), WIN16)
-	OS_RELEASE :=
-#	OS_RELEASE := _3.11
-endif
-
-OS_CONFIG := $(OS_TARGET)$(OS_RELEASE)
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -25,17 +25,17 @@ OBJDIR		= @OBJDIR@
 OBJ_SUFFIX	= @OBJ_SUFFIX@
 LIB_SUFFIX	= @LIB_SUFFIX@
 DLL_SUFFIX	= @DLL_SUFFIX@
 ASM_SUFFIX	= @ASM_SUFFIX@
 MOD_NAME	= @NSPR_MODNAME@
 
 MOD_MAJOR_VERSION = @MOD_MAJOR_VERSION@
 MOD_MINOR_VERSION = @MOD_MINOR_VERSION@
-MOD_REVISION_VERSION = @MOD_REVISION_VERSION@
+MOD_PATCH_VERSION = @MOD_PATCH_VERSION@
 
 LIBNSPR		= @LIBNSPR@
 LIBPLC		= @LIBPLC@
 
 CROSS_COMPILE	= @CROSS_COMPILE@
 BUILD_OPT	= @MOZ_OPTIMIZE@
 
 USE_CPLUS	= @USE_CPLUS@
@@ -50,28 +50,29 @@ USE_BTHREADS	= @USE_BTHREADS@
 PTHREADS_USER	= @USE_USER_PTHREADS@
 CLASSIC_NSPR	= @USE_NSPR_THREADS@
 
 AS		= @AS@
 ASFLAGS		= @ASFLAGS@
 CC		= @CC@
 CCC		= @CXX@
 NS_USE_GCC	= @GNU_CC@
+GCC_USE_GNU_LD	= @GCC_USE_GNU_LD@
 AR		= @AR@
 AR_FLAGS	= @AR_FLAGS@
 LD		= @LD@
 RANLIB		= @RANLIB@
 PERL		= @PERL@
-DLLTOOL		= @DLLTOOL@
-WINDRES		= @WINDRES@
 RC		= @RC@
+RCFLAGS		= @RCFLAGS@
 STRIP		= @STRIP@
 NSINSTALL	= @NSINSTALL@
 FILTER		= @FILTER@
 IMPLIB		= @IMPLIB@
+CYGWIN_WRAPPER	= @CYGWIN_WRAPPER@
 
 OS_CPPFLAGS	= @CPPFLAGS@
 OS_CFLAGS	= $(OS_CPPFLAGS) @CFLAGS@ $(DSO_CFLAGS)
 OS_CXXFLAGS	= $(OS_CPPFLAGS) @CXXFLAGS@ $(DSO_CFLAGS)
 OS_LIBS         = @OS_LIBS@
 OS_LDFLAGS	= @LDFLAGS@
 OS_DLLFLAGS	= @OS_DLLFLAGS@
 DLLFLAGS	= @DLLFLAGS@
@@ -99,14 +100,13 @@ OS_TARGET	= @OS_TARGET@
 OS_ARCH		= @OS_ARCH@
 OS_RELEASE	= @OS_RELEASE@
 OS_TEST		= @OS_TEST@
 
 NOSUCHFILE	= @NOSUCHFILE@
 AIX_LINK_OPTS	= @AIX_LINK_OPTS@
 MOZ_OBJFORMAT	= @MOZ_OBJFORMAT@
 ULTRASPARC_LIBRARY = @ULTRASPARC_LIBRARY@
-ULTRASPARC_FILTER_LIBRARY = @ULTRASPARC_FILTER_LIBRARY@
 
 OBJECT_MODE	= @OBJECT_MODE@
 ifdef OBJECT_MODE
 export OBJECT_MODE
 endif
--- a/config/config.mk
+++ b/config/config.mk
@@ -71,26 +71,34 @@ NOMD_CCFLAGS	= $(CCC_ONLY_FLAGS) $(OPTIM
 LDFLAGS		= $(OS_LDFLAGS)
 
 define MAKE_OBJDIR
 if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
 endef
 
 LINK_DLL	= $(LD) $(OS_DLLFLAGS) $(DLLFLAGS)
 
+ifeq ($(OS_ARCH),Darwin)
+PWD := $(shell pwd)
+endif
+
 ifneq (,$(filter WINNT OS2, $(OS_ARCH)))
 INSTALL		= $(NSINSTALL)
 else
 ifeq ($(NSDISTMODE),copy)
 # copy files, but preserve source mtime
 INSTALL		= $(NSINSTALL) -t
 else
 ifeq ($(NSDISTMODE),absolute_symlink)
 # install using absolute symbolic links
+ifeq ($(OS_ARCH),Darwin)
+INSTALL		= $(NSINSTALL) -L $(PWD)
+else
 INSTALL		= $(NSINSTALL) -L `$(NFSPWD)`
+endif
 else
 # install using relative symbolic links
 INSTALL		= $(NSINSTALL) -R
 endif
 endif
 endif # WINNT || OS2
 
 DEPENDENCIES	= $(OBJDIR)/.md
@@ -122,16 +130,20 @@ endif
 ifeq ($(PTHREADS_USER), 1)
 DEFINES += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM
 endif
 
 ifeq ($(USE_IPV6),1)
 DEFINES += -D_PR_INET6
 endif
 
+ifeq ($(MOZ_UNICODE),1)
+DEFINES += -DMOZ_UNICODE
+endif
+
 ####################################################################
 #
 # Configuration for the release process
 #
 ####################################################################
 
 MDIST = /m/dist
 ifeq ($(OS_ARCH),WINNT)
deleted file mode 100644
--- a/config/module.df
+++ /dev/null
@@ -1,40 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-# 
-# Module description file
-#
-# A module is also called a component or a subsystem.
-
-MOD_NAME = nspr20
-MOD_VERSION = 4
--- a/config/now.c
+++ b/config/now.c
@@ -34,17 +34,19 @@
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #if defined(VMS)
 #include <sys/timeb.h>
 #elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
 #include <sys/time.h>
-#elif defined(WIN32) || defined(XP_OS2_VACPP)
+#elif defined(WIN32)
+#include <windows.h>
+#elif defined(XP_OS2_VACPP)
 #include <sys/timeb.h>
 #else
 #error "Architecture not supported"
 #endif
 
 
 int main(int argc, char **argv)
 {
@@ -81,22 +83,30 @@ int main(int argc, char **argv)
 #elif defined(BEOS) && defined(__POWERPC__)
     fprintf(stdout, "%Ld", now);  /* Metroworks on BeOS PPC */
 #else
     fprintf(stdout, "%lld", now);
 #endif
 
 #elif defined(WIN32)
     __int64 now;
-    struct timeb b;
-    ftime(&b);
-    now = b.time;
-    now *= 1000000;
-    now += (1000 * b.millitm);
+    FILETIME ft;
+    GetSystemTimeAsFileTime(&ft);
+    CopyMemory(&now, &ft, sizeof(now));
+    /*
+     * 116444736000000000 is the number of 100-nanosecond intervals
+     * between Jan. 1, 1601 and Jan. 1, 1970.
+     */
+#ifdef __GNUC__
+    now = (now - 116444736000000000LL) / 10LL;
+    fprintf(stdout, "%lld", now);
+#else
+    now = (now - 116444736000000000i64) / 10i64;
     fprintf(stdout, "%I64d", now);
+#endif
 
 #elif defined(XP_OS2_VACPP)
 /* no long long or i64 so we use a string */
 #include <string.h>
   char buf[24];
   char tbuf[7];
   time_t now;
   long mtime;
--- a/config/nsinstall.c
+++ b/config/nsinstall.c
@@ -360,35 +360,51 @@ main(int argc, char **argv)
 		if (wc < 0)
 		    fail("cannot write to %s", toname);
 	    }
 	    if (cc < 0)
 		fail("cannot read from %s", name);
 
 	    if (ftruncate(tofd, sb.st_size) < 0)
 		fail("cannot truncate %s", toname);
+	    /*
+	    ** On OpenVMS we can't chmod() until the file is closed, and we
+	    ** have to utime() last since fchown/chmod alter the timestamps.
+	    */
+#ifndef VMS
 	    if (dotimes) {
 		utb.actime = sb.st_atime;
 		utb.modtime = sb.st_mtime;
 		if (utime(toname, &utb) < 0)
 		    fail("cannot set times of %s", toname);
 	    }
 #ifdef HAVE_FCHMOD
 	    if (fchmod(tofd, mode) < 0)
 #else
 	    if (chmod(toname, mode) < 0)
 #endif
 		fail("cannot change mode of %s", toname);
+#endif
 	    if ((owner || group) && fchown(tofd, uid, gid) < 0)
 		fail("cannot change owner of %s", toname);
 
 	    /* Must check for delayed (NFS) write errors on close. */
 	    if (close(tofd) < 0)
 		fail("cannot write to %s", toname);
 	    close(fromfd);
+#ifdef VMS
+	    if (chmod(toname, mode) < 0)
+		fail("cannot change mode of %s", toname);
+	    if (dotimes) {
+		utb.actime = sb.st_atime;
+		utb.modtime = sb.st_mtime;
+		if (utime(toname, &utb) < 0)
+		    fail("cannot set times of %s", toname);
+	    }
+#endif
 	}
 
 	free(toname);
     }
 
     free(cwd);
     free(todir);
     return 0;
--- a/config/nspr-config.in
+++ b/config/nspr-config.in
@@ -1,17 +1,17 @@
 #!/bin/sh
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 exec_prefix_set=no
 
 major_version=@MOD_MAJOR_VERSION@
 minor_version=@MOD_MINOR_VERSION@
-revision_version=@MOD_REVISION_VERSION@
+patch_version=@MOD_PATCH_VERSION@
 
 usage()
 {
 	cat <<EOF
 Usage: nspr-config [OPTIONS] [LIBRARIES]
 Options:
 	[--prefix[=DIR]]
 	[--exec-prefix[=DIR]]
@@ -53,17 +53,17 @@ while test $# -gt 0; do
     --exec-prefix=*)
       exec_prefix=$optarg
       exec_prefix_set=yes
       ;;
     --exec-prefix)
       echo_exec_prefix=yes
       ;;
     --version)
-      echo ${major_version}.${minor_version}.${revision_version}
+      echo ${major_version}.${minor_version}.${patch_version}
       ;;
     --cflags)
       echo_cflags=yes
       ;;
     --libs)
       echo_libs=yes
       ;;
     nspr)
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -155,16 +155,29 @@ endif
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 EXTRA_LIBS := $(patsubst -l%,$(DIST)/lib/%.$(LIB_SUFFIX),$(EXTRA_LIBS))
 endif
 
 ALL_TRASH		= $(TARGETS) $(OBJS) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
 			  $(NOSUCHFILE) \
 			  so_locations
 
+ifeq ($(OS_ARCH),OpenVMS)
+ALL_TRASH		+= $(wildcard *.c*_defines)
+ifdef SHARED_LIBRARY
+VMS_SYMVEC_FILE		= $(SHARED_LIBRARY:.$(DLL_SUFFIX)=_symvec.opt)
+VMS_SYMVEC_FILE_MODULE	= $(srcdir)/$(LIBRARY_NAME)_symvec.opt
+ALL_TRASH		+= $(VMS_SYMVEC_FILE)
+endif
+endif
+
+ifndef RELEASE_LIBS_DEST
+RELEASE_LIBS_DEST	= $(RELEASE_LIB_DIR)
+endif
+
 ifdef DIRS
 LOOP_OVER_DIRS		=					\
 	@for d in $(DIRS); do					\
 		if test -d $$d; then				\
 			set -e;					\
 			echo "cd $$d; $(MAKE) $@";		\
 			$(MAKE) -C $$d $@;			\
 			set +e;					\
@@ -201,20 +214,20 @@ distclean::
 	rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) $(DIST_GARBAGE)
 	+$(LOOP_OVER_DIRS)
 
 real_install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS)
 ifdef RELEASE_BINS
 	$(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir)
 endif
 ifdef RELEASE_HEADERS
-	$(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)
+	$(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)/$(include_subdir)
 endif
 ifdef RELEASE_LIBS
-	$(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)
+	$(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir)
 endif
 	+$(LOOP_OVER_DIRS)
 
 release:: export
 ifdef RELEASE_BINS
 	@echo "Copying executable programs and scripts to release directory"
 	@if test -z "$(BUILD_NUMBER)"; then \
 		echo "BUILD_NUMBER must be defined"; \
@@ -233,23 +246,23 @@ endif
 ifdef RELEASE_LIBS
 	@echo "Copying libraries to release directory"
 	@if test -z "$(BUILD_NUMBER)"; then \
 		echo "BUILD_NUMBER must be defined"; \
 		false; \
 	else \
 		true; \
 	fi
-	@if test ! -d $(RELEASE_LIB_DIR); then \
-		rm -rf $(RELEASE_LIB_DIR); \
-		$(NSINSTALL) -D $(RELEASE_LIB_DIR);\
+	@if test ! -d $(RELEASE_LIBS_DEST); then \
+		rm -rf $(RELEASE_LIBS_DEST); \
+		$(NSINSTALL) -D $(RELEASE_LIBS_DEST);\
 	else \
 		true; \
 	fi
-	cp $(RELEASE_LIBS) $(RELEASE_LIB_DIR)
+	cp $(RELEASE_LIBS) $(RELEASE_LIBS_DEST)
 endif
 ifdef RELEASE_HEADERS
 	@echo "Copying header files to release directory"
 	@if test -z "$(BUILD_NUMBER)"; then \
 		echo "BUILD_NUMBER must be defined"; \
 		false; \
 	else \
 		true; \
@@ -269,17 +282,17 @@ alltags:
 	find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a
 	find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs ctags -a
 
 $(NFSPWD):
 	cd $(@D); $(MAKE) $(@F)
 
 $(PROGRAM): $(OBJS)
 	@$(MAKE_OBJDIR)
-ifeq ($(OS_ARCH),WINNT)
+ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
 	$(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
 else
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 	$(CC) $(OBJS) -Fe$@ $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
 else
 	$(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS)
 endif
 endif
@@ -293,99 +306,139 @@ endif
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 	$(AR) $(subst /,\\,$(OBJS)) $(AR_FLAGS)
 else
 	$(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS)
 endif
 	$(RANLIB) $@
 
 ifeq ($(OS_TARGET), OS2)
-$(IMPORT_LIBRARY): $(SHARED_LIBRARY)
-	$(IMPLIB) $@ $(SHARED_LIBRARY).def
+$(IMPORT_LIBRARY): $(MAPFILE)
+	rm -f $@
+	$(IMPLIB) $@ $(MAPFILE)
 endif
-    
-$(SHARED_LIBRARY): $(OBJS)
+
+$(SHARED_LIBRARY): $(OBJS) $(MAPFILE)
 	@$(MAKE_OBJDIR)
 	rm -f $@
 ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
 	echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms
 	nm -B -C -g $(OBJS) \
 		| awk '/ [T,D] / {print $$3}' \
 		| sed -e 's/^\.//' \
 		| sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms
 	$(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \
 		-bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS)
 else	# AIX 4.1
-ifeq ($(OS_ARCH), WINNT)
+ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
 	$(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS)
 else
-ifeq ($(OS_ARCH),OS2)
-# append ( >> ) doesn't seem to be working under OS/2 gmake. Run through OS/2 shell instead.	
-	@cmd /C "echo LIBRARY $(notdir $(basename $(SHARED_LIBRARY))) INITINSTANCE TERMINSTANCE >$@.def"
-	@cmd /C "echo PROTMODE >>$@.def"
-	@cmd /C "echo CODE    LOADONCALL MOVEABLE DISCARDABLE >>$@.def"
-	@cmd /C "echo DATA    PRELOAD MOVEABLE MULTIPLE NONSHARED >>$@.def"	
-	@cmd /C "echo EXPORTS >>$@.def"
-	@cmd /C "$(FILTER) $(LIBRARY) | grep -v _DLL_InitTerm >>$@.def"
-	$(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $@.def
-else	# OS2
+ifeq ($(MOZ_OS2_TOOLS),VACPP)
+	$(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(MAPFILE)
+else	# !os2 vacpp
 ifeq ($(OS_TARGET), OpenVMS)
-	@if test ! -f $(OBJDIR)/VMSuni.opt; then \
-	    echo "Creating universal symbol option file $(OBJDIR)/VMSuni.opt";\
-	    create_opt_uni $(OBJS); \
+	@if test ! -f $(VMS_SYMVEC_FILE); then \
+	  if test -f $(VMS_SYMVEC_FILE_MODULE); then \
+	    echo Creating component options file $(VMS_SYMVEC_FILE); \
+	    cp $(VMS_SYMVEC_FILE_MODULE) $(VMS_SYMVEC_FILE); \
+	  fi; \
 	fi
-	$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OBJDIR)/VMSuni.opt
-else	# OpenVMS
+endif	# OpenVMS
 	$(MKSHLIB) $(OBJS) $(EXTRA_LIBS)
-endif	# OpenVMS
-endif   # OS2
+endif   # OS2 vacpp
 endif	# WINNT
 endif	# AIX 4.1
 ifdef ENABLE_STRIP
 	$(STRIP) $@
 endif
 
 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
 $(RES): $(RESNAME)
 	@$(MAKE_OBJDIR)
 ifeq ($(OS_TARGET),OS2)
 	$(RC) -DOS2 -r $< $@
 else
 # The resource compiler does not understand the -U option.
-	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
+ifdef NS_USE_GCC
+	$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
+else
+	$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
+endif # GCC
 endif
 	@echo $(RES) finished
 endif
 
+$(MAPFILE): $(LIBRARY_NAME).def
+	@$(MAKE_OBJDIR)
+ifeq ($(OS_ARCH),SunOS)
+	grep -v ';-' $< | \
+	sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
+endif
+ifeq ($(OS_ARCH),OS2)
+	echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@
+	echo PROTMODE >> $@
+	echo CODE    LOADONCALL MOVEABLE DISCARDABLE >> $@
+	echo DATA    PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
+	echo EXPORTS >> $@
+	grep -v ';+' $< | grep -v ';-' | \
+	sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' >> $@
+endif
+
+#
+# Translate source filenames to absolute paths. This is required for
+# debuggers under Windows and OS/2 to find source files automatically.
+#
+
+ifeq ($(OS_ARCH),OS2)
+NEED_ABSOLUTE_PATH = 1
+endif
+
+ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
+NEED_ABSOLUTE_PATH = 1
+endif
+
+ifdef NEED_ABSOLUTE_PATH
+PWD := $(shell pwd)
+abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
+endif
+
 $(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
 	@$(MAKE_OBJDIR)
-ifeq ($(OS_ARCH), WINNT)
-	$(CCC) -Fo$@ -c $(CCCFLAGS) $<
+ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
+	$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
 else
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
-	$(CCC) -Fo$@ -c $(CCCFLAGS) $<
+	$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
+else
+ifdef NEED_ABSOLUTE_PATH
+	$(CCC) -o $@ -c $(CCCFLAGS) $(call abspath,$<)
 else
 	$(CCC) -o $@ -c $(CCCFLAGS) $<
 endif
 endif
+endif
 
 WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
 WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1))
 WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2))
 $(OBJDIR)/%.$(OBJ_SUFFIX): %.c
 	@$(MAKE_OBJDIR)
-ifeq ($(OS_ARCH), WINNT)
-	$(CC) -Fo$@ -c $(CFLAGS) $<
+ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
+	$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
 else
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
-	$(CC) -Fo$@ -c $(CFLAGS) $<
+	$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
+else
+ifdef NEED_ABSOLUTE_PATH
+	$(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
 else
 	$(CC) -o $@ -c $(CFLAGS) $<
 endif
 endif
+endif
 
 
 $(OBJDIR)/%.$(OBJ_SUFFIX): %.s
 	@$(MAKE_OBJDIR)
 	$(AS) -o $@ $(ASFLAGS) -c $<
 
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 $(OBJDIR)/%.$(OBJ_SUFFIX): %.asm
deleted file mode 100644
--- a/config/win16.mk
+++ /dev/null
@@ -1,116 +0,0 @@
-# 
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-# 
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-# 
-# The Original Code is the Netscape Portable Runtime (NSPR).
-# 
-# The Initial Developer of the Original Code is Netscape
-# Communications Corporation.  Portions created by Netscape are 
-# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
-# Rights Reserved.
-# 
-# Contributor(s):
-# 
-# Alternatively, the contents of this file may be used under the
-# terms of the GNU General Public License Version 2 or later (the
-# "GPL"), in which case the provisions of the GPL are applicable 
-# instead of those above.  If you wish to allow use of your 
-# version of this file only under the terms of the GPL and not to
-# allow others to use your version of this file under the MPL,
-# indicate your decision by deleting the provisions above and
-# replace them with the notice and other provisions required by
-# the GPL.  If you do not delete the provisions above, a recipient
-# may use your version of this file under either the MPL or the
-# GPL.
-# 
-
-#
-# win16_3.11.mk -- Make configuration for Win16
-#
-# This file configures gmake to build the Win16 variant of
-# NSPR 2.0. This file has the function of two files commonly
-# used on other platforms, for example: winnt.mk and
-# winnt4.0.mk. ... The packaging is easier and there is only
-# one variant of the Win16 target.
-# 
-# Win16 is built using the Watcom C/C++ version 11.0
-# compiler. You gotta set up the compiler first. Follow the
-# directions in the manual (Ha! ... really, its not a
-# problem). The Watcom compiler depends on a few environment
-# variables; these environment variables define where the
-# compiler components are installed; they must be set before
-# running the make.
-# 
-# Notes:
-# OS_CFLAGS is the command line options for the compiler when
-#   building the .DLL object files.
-# OS_EXE_CFLAGS is the command line options for the compiler
-#   when building the .EXE object files; this is for the test
-#   programs.
-# the macro OS_CFLAGS is set to OS_EXE_CFLAGS inside of the
-#   makefile for the pr/tests directory. ... Hack.
-# 
-# USE_WATCOM_DEBUG_DATA environment variable causes the
-#   watcom compiler flag to be set to -hw (otherwise
-#   it is set to -hc (codeview debug data)) for debug builds.
-#
-
-# -- configuration -----------------------------------------
-
-CC = wcc
-CCC = wcl
-LINK = wlink
-AR = wlib -q $@
-RC = wrc.exe /r /dWIN16=1 /bt=windows
-RANLIB = echo
-BSDECHO = echo
-STRIP = echo
-NSINSTALL = nsinstall
-INSTALL	= $(NSINSTALL)
-MAKE_OBJDIR = mkdir $(OBJDIR)
-
-XP_DEFINE = -DXP_PC
-OBJ_SUFFIX = obj
-LIB_SUFFIX = lib
-DLL_SUFFIX = dll
-
-ifdef BUILD_OPT
-OBJDIR_TAG = _O
-OPTIMIZER = -oneatx -oh -oi -ei -3 -fpi87 -fp3 -s
-else
-ifdef USE_WATCOM_DEBUG_DATA
-OPTIMIZER = -d2 -hw -s -DDEBUG
-DEBUGTYPE = watcom
-else
-OPTIMIZER = -d2 -hc -s -DDEBUG
-DEBUGTYPE = codeview
-endif
-OBJDIR_TAG = _D
-endif
-
-# XXX FIXME: I doubt we use this.  It is redundant with
-# SHARED_LIBRARY.
-ifdef DLL
-DLL := $(addprefix $(OBJDIR)/, $(DLL))
-endif
-
-
-CPU_ARCH = x86
-OS_CFLAGS = -ml -3 -bd -zc -zu -bt=windows -d_X86_ -dWIN16 -d_WINDLL
-OS_EXE_CFLAGS = -ml -3 -bt=windows -d_X86_ -dWIN16
-OS_LIB_FLAGS = -c -iro -n
-
-# Name of the binary code directories
-OBJDIR_NAME     = $(OS_CONFIG)$(OBJDIR_TAG).OBJ
-
-OS_DLL_OPTION = CASEEXACT
-OS_DLLFLAGS =
-OS_LIBS =
-W16_EXPORTS = #
--- a/configure
+++ b/configure
@@ -34,16 +34,19 @@ ac_help="$ac_help
   --enable-debug-rtl      Use the MSVC debug runtime library"
 ac_help="$ac_help
   --enable-n32            Enable n32 ABI support (IRIX only)"
 ac_help="$ac_help
   --enable-64bit          Enable 64-bit support (on certain platforms)"
 ac_help="$ac_help
   --enable-mdupdate       Enable use of certain compilers' mdupdate feature"
 ac_help="$ac_help
+  --enable-macos-target=VER (default=10.1)
+                          Set the minimum MacOS version needed at runtime"
+ac_help="$ac_help
   --enable-strip          Enable stripping of shared libs and programs"
 ac_help="$ac_help
   --with-pthreads         Use system pthreads library as thread subsystem"
 ac_help="$ac_help
   --enable-user-pthreads  Build using userland pthreads"
 ac_help="$ac_help
   --enable-nspr-threads   Build using classic nspr threads"
 ac_help="$ac_help
@@ -609,17 +612,17 @@ esac
 
 
 # Make sure we can run config.sub.
 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:618: checking host system type" >&5
+echo "configure:621: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
 NONE)
   case $nonopt in
   NONE)
     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
@@ -630,17 +633,17 @@ esac
 
 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:639: checking target system type" >&5
+echo "configure:642: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
 NONE)
   case $nonopt in
   NONE) target_alias=$host_alias ;;
   *) target_alias=$nonopt ;;
   esac ;;
@@ -648,17 +651,17 @@ esac
 
 target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:657: checking build system type" >&5
+echo "configure:660: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
 NONE)
   case $nonopt in
   NONE) build_alias=$host_alias ;;
   *) build_alias=$nonopt ;;
   esac ;;
@@ -672,67 +675,104 @@ 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=2
-MOD_REVISION_VERSION=0
+MOD_MINOR_VERSION=3
+MOD_PATCH_VERSION=0
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
 USE_CPLUS=
 USE_IPV6=
 USE_MDUPDATE=
+MACOS_DEPLOYMENT_TARGET=
 _OPTIMIZE_FLAGS=-O
 _DEBUG_FLAGS=-g
 MOZ_DEBUG=1
 MOZ_OPTIMIZE=
 OBJDIR=.
 OBJDIR_NAME=.
 OBJDIR_SUFFIX=OBJ
 NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
 NOSUCHFILE=/no-such-file
 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
+CYGWIN_WRAPPER=
 
 RESOLVE_LINK_SYMBOLS=
 
 CFLAGS="${CFLAGS=}"
 CXXFLAGS="${CXXFLAGS=}"
 LDFLAGS="${LDFLAGS=}"
 HOST_CFLAGS="${HOST_CFLAGS=}"
 HOST_LDFLAGS="${HOST_LDFLAGS=}"
 
 case "$target" in
-*-cygwin*)
+*-cygwin*|*-mingw*)
     # Check to see if we are really running in a msvc environemnt
     _WIN32_MSVC=
-    if test "$CC" = "cl" || test "$CXX" = "cl"; then
-        _WIN32_MSVC=1
-    elif test -z "$CC"; then
+    for ac_prog in 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:727: 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"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CC" && break
+done
+
+    if test "$CC" = "cl"; then
         echo 'main() { return 0; }' > dummy.c
-        cl -o dummy dummy.c
+        ${CC} -o dummy dummy.c >/dev/null 2>&1
         if test $? = 0; then
             _WIN32_MSVC=1
+            CXX=$CC
+        else
+            echo "configure: warning: $(CC) test failed.  Using normal feature tests" 1>&2
         fi
         rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
     fi
     ;;
 *-msvc*)
     _WIN32_MSVC=1
     ;;
-*-mksnt*)
+*-mks*)
     _WIN32_MSVC=1
     ;;
 esac
 
 if test -n "$_WIN32_MSVC"; then
     SKIP_PATH_CHECKS=1
     SKIP_COMPILER_CHECKS=1
     SKIP_LIBRARY_CHECKS=1
@@ -866,16 +906,25 @@ fi
 if test "${enable_mdupdate+set}" = set; then
   enableval="$enable_mdupdate"
    if test "$enableval" = "yes"; then
 	    USE_MDUPDATE=1
       fi 
 fi
 
 
+# Check whether --enable-macos-target or --disable-macos-target was given.
+if test "${enable_macos_target+set}" = set; then
+  enableval="$enable_macos_target"
+  MACOS_DEPLOYMENT_TARGET_STR=$enableval
+else
+  MACOS_DEPLOYMENT_TARGET_STR=10.1
+fi
+
+
 case "$target" in
 
 *-aix*)
     case "${target_os}" in
     aix3.2*)
         USE_NSPR_THREADS=1
         ;;
     *)
@@ -900,16 +949,20 @@ if test -z "$CC"; then
     *-hpux*)
         CC=cc
     ;;
 
     *-irix*)
         CC=cc
     ;;
 
+    *-openvms*)
+        CC=cc
+    ;;
+
     *-osf*)
         CC=cc
     ;;
 
     *-solaris*)
         CC=cc
     ;;
 
@@ -940,32 +993,36 @@ if test -z "$CXX"; then
             ;;
         esac
     ;;
 
     *-irix*)
         CXX=CC
     ;;
 
+    *-openvms*)
+        CXX=cxx
+    ;;
+
     *-osf*)
         CXX=cxx
     ;;
 
     *-solaris*)
         CXX=CC
     ;;
 
     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:964: checking for $ac_word" >&5
+echo "configure:1021: 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.
   ;;
   ?:/*)			 
@@ -988,30 +1045,36 @@ esac
 fi
 WHOAMI="$ac_cv_path_WHOAMI"
 if test -n "$WHOAMI"; then
   echo "$ac_t""$WHOAMI" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
-elif test -z "$WHOAMI"; then
-    WHOAMI=whoami
 fi
 
 if test -n "$MOZ_DEBUG"; then
     cat >> confdefs.h <<\EOF
 #define DEBUG 1
 EOF
 
-    cat >> confdefs.h <<EOF
-#define DEBUG_`$WHOAMI` 1
-EOF
-
     DEFINES="$DEFINES -UNDEBUG"
+
+    case "${target_os}" in
+    beos*)
+        DEFINES="$DEFINES -DDEBUG_${USER}"
+        ;;
+    msvc*|mks*|cygwin*|mingw*|os2*)
+        DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
+        ;;
+    *) 
+        DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
+        ;;
+    esac
 else
     cat >> confdefs.h <<\EOF
 #define NDEBUG 1
 EOF
 
     DEFINES="$DEFINES -UDEBUG"
 fi
 
@@ -1020,24 +1083,24 @@ if test "$target" != "$host"; then
     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:1029: checking for $host compiler" >&5
+echo "configure:1092: checking for $host compiler" >&5
     if test -z "$HOST_CC"; then
 	    for ac_prog in 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:1036: checking for $ac_word" >&5
+echo "configure:1099: 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"
@@ -1074,26 +1137,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:1083: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
+echo "configure:1146: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
     cat > conftest.$ac_ext <<EOF
-#line 1085 "configure"
+#line 1148 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:1092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1155: \"$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
@@ -1104,17 +1167,17 @@ rm -f conftest*
     LDFLAGS=$_SAVE_LDFLAGS
 
     if test -z "$CC"; then
 	    for ac_prog in "${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:1113: checking for $ac_word" >&5
+echo "configure:1176: 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"
@@ -1139,17 +1202,17 @@ test -n "$CC" && break
 done
 test -n "$CC" || CC="echo"
 
     fi
     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:1148: checking for $ac_word" >&5
+echo "configure:1211: 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"
@@ -1169,17 +1232,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:1178: checking for $ac_word" >&5
+echo "configure:1241: 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
@@ -1220,17 +1283,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:1229: checking for $ac_word" >&5
+echo "configure:1292: 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"
@@ -1252,33 +1315,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:1261: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1324: 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 1272 "configure"
+#line 1335 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1340: \"$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
@@ -1294,31 +1357,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:1303: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1366: 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:1308: checking whether we are using GNU C" >&5
+echo "configure:1371: 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:1317: \"$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:1380: \"$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
 
@@ -1327,17 +1390,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:1336: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1399: 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
@@ -1364,17 +1427,17 @@ else
 fi
 
     if test -z "$CXX"; then
 	    for ac_prog in "${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:1373: checking for $ac_word" >&5
+echo "configure:1436: 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"
@@ -1401,17 +1464,17 @@ test -n "$CXX" || CXX="echo"
 
     fi
     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:1410: checking for $ac_word" >&5
+echo "configure:1473: 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"
@@ -1433,33 +1496,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:1442: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:1505: 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 1453 "configure"
+#line 1516 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:1458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1521: \"$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
@@ -1475,31 +1538,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:1484: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1547: 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:1489: checking whether we are using GNU C++" >&5
+echo "configure:1552: 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:1498: \"$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:1561: \"$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
 
@@ -1508,17 +1571,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:1517: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1580: 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
@@ -1545,17 +1608,17 @@ else
 fi
 
     if test -z "$RANLIB"; then
 	    for ac_prog in "${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:1554: checking for $ac_word" >&5
+echo "configure:1617: 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"
@@ -1582,17 +1645,17 @@ test -n "$RANLIB" || RANLIB="echo"
 
     fi
     if test -z "$AR"; then
 	    for ac_prog in "${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:1591: checking for $ac_word" >&5
+echo "configure:1654: 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"
@@ -1619,17 +1682,17 @@ test -n "$AR" || AR="echo"
 
     fi
     if test -z "$AS"; then
 	    for ac_prog in "${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:1628: checking for $ac_word" >&5
+echo "configure:1691: 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"
@@ -1656,17 +1719,17 @@ test -n "$AS" || AS="echo"
 
     fi
     if test -z "$LD"; then
 	    for ac_prog in "${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:1665: checking for $ac_word" >&5
+echo "configure:1728: 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"
@@ -1693,17 +1756,17 @@ test -n "$LD" || LD="echo"
 
     fi
     if test -z "$STRIP"; then
 	    for ac_prog in "${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:1702: checking for $ac_word" >&5
+echo "configure:1765: 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"
@@ -1724,60 +1787,23 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
 test -n "$STRIP" && break
 done
 test -n "$STRIP" || STRIP="echo"
 
     fi
-    if test -z "$DLLTOOL"; then
-	    for ac_prog in "${target_alias}-dlltool" "${target}-dlltool"
-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:1739: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$DLLTOOL"; then
-  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_DLLTOOL="$ac_prog"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
-fi
-DLLTOOL="$ac_cv_prog_DLLTOOL"
-if test -n "$DLLTOOL"; then
-  echo "$ac_t""$DLLTOOL" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-test -n "$DLLTOOL" && break
-done
-test -n "$DLLTOOL" || DLLTOOL="echo"
-
-    fi
     if test -z "$WINDRES"; then
 	    for ac_prog in "${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:1776: checking for $ac_word" >&5
+echo "configure:1802: 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"
@@ -1805,17 +1831,17 @@ test -n "$WINDRES" || WINDRES="echo"
     fi
 
 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:1814: checking for $ac_word" >&5
+echo "configure:1840: 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"
@@ -1837,33 +1863,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:1846: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:1872: 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 1857 "configure"
+#line 1883 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:1862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1888: \"$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
@@ -1879,31 +1905,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:1888: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1914: 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:1893: checking whether we are using GNU C++" >&5
+echo "configure:1919: 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:1902: \"$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:1928: \"$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
 
@@ -1912,17 +1938,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:1921: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1947: 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
@@ -1949,17 +1975,17 @@ else
 fi
 
     if test "$CXX" = "cl" -a -z "$CC"; then
         CC=$CXX
     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:1958: checking for $ac_word" >&5
+echo "configure:1984: 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"
@@ -1979,17 +2005,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:1988: checking for $ac_word" >&5
+echo "configure:2014: 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
@@ -2030,17 +2056,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:2039: checking for $ac_word" >&5
+echo "configure:2065: 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"
@@ -2062,33 +2088,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:2071: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2097: 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 2082 "configure"
+#line 2108 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2113: \"$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
@@ -2104,31 +2130,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:2113: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2139: 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:2118: checking whether we are using GNU C" >&5
+echo "configure:2144: 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:2127: \"$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:2153: \"$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
 
@@ -2137,17 +2163,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:2146: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2172: 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
@@ -2170,72 +2196,72 @@ else
     CFLAGS="-O2"
   else
     CFLAGS=
   fi
 fi
 
     fi
     echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2179: checking how to run the C preprocessor" >&5
+echo "configure:2205: 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 2194 "configure"
+#line 2220 "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:2200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2226: \"$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 2211 "configure"
+#line 2237 "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:2217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2243: \"$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 2228 "configure"
+#line 2254 "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:2234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2260: \"$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*
@@ -2252,17 +2278,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:2261: checking for $ac_word" >&5
+echo "configure:2287: 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"
@@ -2284,17 +2310,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:2293: checking for $ac_word" >&5
+echo "configure:2319: 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.
   ;;
   ?:/*)			 
@@ -2325,17 +2351,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:2334: checking for $ac_word" >&5
+echo "configure:2360: 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.
   ;;
   ?:/*)			 
@@ -2366,17 +2392,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:2375: checking for $ac_word" >&5
+echo "configure:2401: 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.
   ;;
   ?:/*)			 
@@ -2407,17 +2433,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:2416: checking for $ac_word" >&5
+echo "configure:2442: 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.
   ;;
   ?:/*)			 
@@ -2443,63 +2469,22 @@ if test -n "$STRIP"; then
 else
   echo "$ac_t""no" 1>&6
 fi
 
 test -n "$STRIP" && break
 done
 test -n "$STRIP" || STRIP="echo not_strip"
 
-    for ac_prog in dlltool
-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:2457: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_DLLTOOL'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$DLLTOOL" in
-  /*)
-  ac_cv_path_DLLTOOL="$DLLTOOL" # Let the user override the test with a path.
-  ;;
-  ?:/*)			 
-  ac_cv_path_DLLTOOL="$DLLTOOL" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_DLLTOOL="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
-fi
-DLLTOOL="$ac_cv_path_DLLTOOL"
-if test -n "$DLLTOOL"; then
-  echo "$ac_t""$DLLTOOL" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-test -n "$DLLTOOL" && break
-done
-test -n "$DLLTOOL" || DLLTOOL="echo not_dlltool"
-
     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:2498: checking for $ac_word" >&5
+echo "configure:2483: 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.
   ;;
   ?:/*)			 
@@ -2539,51 +2524,51 @@ test -n "$WINDRES" || WINDRES="echo not_
 fi
 
 if test "$GCC" = "yes"; then
     GNU_CC=1
 fi
 if test "$GXX" = "yes"; then
     GNU_CXX=1
 fi
-if test "`echo | $AS -V 2>&1 | grep -c GNU`" != "0"; then
+if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
     GNU_AS=1
 fi
 rm -f a.out
 
 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:2560: checking for gcc -pipe support" >&5
+echo "configure:2545: 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"); exit(0); }' >> 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 2575 "configure"
+#line 2560 "configure"
 #include "confdefs.h"
  #include <stdio.h> 
 int main() {
 printf("Hello World\n");
 ; return 0; }
 EOF
-if { (eval echo configure:2582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2567: \"$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
@@ -2606,17 +2591,17 @@ fi
 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:2615: checking for $ac_word" >&5
+echo "configure:2600: 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.
   ;;
   ?:/*)			 
@@ -2666,22 +2651,31 @@ ASFLAGS='$(CFLAGS)'
 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
 OS_RELEASE=`uname -r`
 OS_TEST=`uname -m`
 
 if test "$OS_ARCH" = "IRIX64"; then
     OS_ARCH=IRIX
 fi
 
+if test "$OS_ARCH" = "AIX"; then
+    OS_RELEASE=`uname -v`.`uname -r`
+fi
+
+if test "$OS_ARCH" = "FreeBSD"; then
+    OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
+fi
+
 if test "$OS_ARCH" = "Linux"; then
     OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
-fi
-
-if test "$OS_ARCH" = "POSIX_for_OpenVMS_AXP"; then
-    OS_ARCH=OpenVMS
+    OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
+fi
+
+if test "$OS_ARCH" = "OpenVMS"; then
+    OS_RELEASE=`uname -v`
 fi
 
 #######################################################################
 # Master "Core Components" macros for getting the OS target           #
 #######################################################################
 
 #
 # Note: OS_TARGET should be specified on the command line for gmake.
@@ -2709,20 +2703,17 @@ if test "$OS_ARCH" = "WIN95"; then
     OS_ARCH=WINNT
     OS_TARGET=WIN95
 elif test "$OS_ARCH" = 'Windows_95'; then
     OS_ARCH=Windows_NT
     OS_TARGET=WIN95
 elif test "$OS_ARCH" = 'Windows_98'; then
     OS_ARCH=Windows_NT
     OS_TARGET=WIN95
-elif test "$OS_ARCH" = "CYGWIN_95-4.0"; then
-    OS_ARCH='CYGWIN_NT-4.0'
-    OS_TARGET=WIN95
-elif test "$OS_ARCH" = "CYGWIN_98-4.10"; then
+elif test "`echo $OS_ARCH | egrep -c '^(CYGWIN_9|CYGWIN_ME)' 2>/dev/null`" != 0; then
     OS_ARCH='CYGWIN_NT-4.0'
     OS_TARGET=WIN95
 elif test "$OS_ARCH" = "OS_2"; then
     OS_ARCH=OS2
     OS_TARGET=OS2
 fi
 
 #
@@ -2800,17 +2791,17 @@ if test "$OS_TARGET" = "WIN95"; then
 fi
 if test "$OS_TARGET" = "WIN16"; then
     OS_RELEASE=
 fi
 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
 
 
 case "$host" in
-*-mingw*|*-cygwin*|*-msvc*|*-mksnt*)
+*-mingw*|*-cygwin*|*-msvc*|*-mks*)
     ;;
 *-beos*)
     HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
     ;;
 *os2*)
     ;;
 *)
     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
@@ -2830,27 +2821,27 @@ EOF
 
     cat >> confdefs.h <<\EOF
 #define SYSV 1
 EOF
 
     DSO_LDOPTS='-brtl -bM:SRE -bnoentry -bexpall'
     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:2839: checking for sys/atomic_op.h" >&5
+echo "configure:2830: 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 2844 "configure"
+#line 2835 "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:2849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2840: \"$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
@@ -2917,17 +2908,17 @@ EOF
 #define AIX_TIMERS 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define _PR_HAVE_OFF64_T 1
 EOF
 
         cat >> confdefs.h <<\EOF
-#define AIX4_3 1
+#define AIX4_3_PLUS 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HAVE_SOCKLEN_T 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HAVE_FCNTL_FILE_LOCKING 1
@@ -2941,16 +2932,20 @@ EOF
 #define AIX_TIMERS 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define _PR_HAVE_OFF64_T 1
 EOF
 
         cat >> confdefs.h <<\EOF
+#define AIX4_3_PLUS 1
+EOF
+
+        cat >> confdefs.h <<\EOF
 #define HAVE_SOCKLEN_T 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HAVE_FCNTL_FILE_LOCKING 1
 EOF
 
         USE_IPV6=1
@@ -2962,21 +2957,17 @@ EOF
         CFLAGS="$CFLAGS -qarch=com"
     fi
     AIX_WRAP='$(DIST)/lib/aixwrap.o'
     AIX_TMP='./_aix_tmp.o'
     if test -n "$USE_64"; then
         MDCPUCFG_H=_aix64.cfg
         OBJECT_MODE=64
     else
-        if test -n "$USE_IPV6"; then
-            MDCPUCFG_H=_aix32in6.cfg
-        else
-            MDCPUCFG_H=_aix32.cfg
-        fi
+        MDCPUCFG_H=_aix32.cfg
     fi
     PR_MD_CSRCS=aix.c
     RESOLVE_LINK_SYMBOLS=1
     ;;
         
 *-beos*)
     cat >> confdefs.h <<\EOF
 #define XP_BEOS 1
@@ -2995,20 +2986,60 @@ EOF
 EOF
 
     DSO_LDOPTS=-nostart
     MDCPUCFG_H=_beos.cfg
     USE_BTHREADS=1
     PR_MD_ARCH_DIR=beos
     RESOLVE_LINK_SYMBOLS=1
     case "${target_cpu}" in
-    i?86)
+    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:3000: 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 3008 "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:3019: \"$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
+  OS_LIBS="$OS_LIBS -lbind -lsocket"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
         ;;
     powerpc)
         CC=mwcc
         CCC=mwcc
         LD=mwld
         DSO_LDOPTS='-xms -export pragma -init _init_routine_ -term _term_routine_ -lroot -lnet /boot/develop/lib/ppc/glue-noinit.a /boot/develop/lib/ppc/init_term_dyn.o /boot/develop/lib/ppc/start_dyn.o'
         _OPTIMIZE_FLAGS=-O2    
         _DEBUG_FLAGS='-g -O0'
@@ -3082,17 +3113,17 @@ EOF
 
         cat >> confdefs.h <<\EOF
 #define _PR_STAT_HAS_ST_ATIMESPEC 1
 EOF
 
         PR_MD_ASFILES=os_BSD_OS_386_2.s
         ;;
 
-    bsdi4.*)
+    bsdi4.* | bsdi5.*)
         cat >> confdefs.h <<\EOF
 #define _PR_SELECT_CONST_TIMEVAL 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define _PR_BSDI_JMPBUF_IS_STRUCT 1
 EOF
 
@@ -3108,17 +3139,17 @@ EOF
 #define _PR_STAT_HAS_ST_ATIMESPEC 1
 EOF
 
         MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
         DSO_CFLAGS=-fPIC
         DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
         STRIP="$STRIP -d"
         case "$target_os" in
-        bsdi4.2*)
+        bsdi4.2* | bsdi4.3* | bsdi5.*)
             cat >> confdefs.h <<\EOF
 #define _PR_HAVE_GETPROTO_R 1
 EOF
 
             cat >> confdefs.h <<\EOF
 #define _PR_HAVE_GETPROTO_R_POINTER 1
 EOF
 
@@ -3161,17 +3192,16 @@ EOF
 EOF
 
     cat >> confdefs.h <<\EOF
 #define HAVE_BSD_FLOCK 1
 EOF
 
     CFLAGS="$CFLAGS -Wmost -fno-common"
     if echo $OS_TEST | grep -c 86 2>/dev/null; then
-        CFLAGS="$CFLAGS -mno-486"
         cat >> confdefs.h <<\EOF
 #define i386 1
 EOF
 
         CPU_ARCH=i386
     else
         cat >> confdefs.h <<\EOF
 #define ppc 1
@@ -3183,16 +3213,44 @@ EOF
     # Use the standard preprocessor (cpp)
     CFLAGS="$CFLAGS -no-cpp-precomp"
     MKSHLIB='$(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS) -o $@'
     STRIP="$STRIP -x -S"
     DLL_SUFFIX=dylib
     USE_PTHREADS=1
     MDCPUCFG_H=_darwin.cfg
     PR_MD_CSRCS=darwin.c
+    if test "$CPU_ARCH" = "ppc"; then
+        PR_MD_ASFILES=os_Darwin_ppc.s
+    fi
+
+    # Add Mac OS X support for loading CFM & CFBundle plugins
+    if test -f /System/Library/Frameworks/Carbon.framework/Carbon; then
+        cat >> confdefs.h <<\EOF
+#define XP_MACOSX 1
+EOF
+
+        OS_TARGET=MacOSX
+
+                        
+        MACOS_VERSION_MAJOR=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 1`
+        MACOS_VERSION_MINOR=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 2`
+        MACOS_VERSION_MICRO=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 3`
+        if test -z "$MACOS_VERSION_MINOR"; then
+            MACOS_VERSION_MINOR=0
+        fi
+        if test -z "$MACOS_VERSION_MICRO"; then
+            MACOS_VERSION_MICRO=0
+        fi
+        MACOS_DEPLOYMENT_TARGET=`printf "%02d%02d%02d" "$MACOS_VERSION_MAJOR" "$MACOS_VERSION_MINOR" "$MACOS_VERSION_MICRO"`
+        cat >> confdefs.h <<EOF
+#define MACOS_DEPLOYMENT_TARGET $MACOS_DEPLOYMENT_TARGET
+EOF
+
+    fi
     ;;
 
 *-dgux*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -3244,18 +3302,19 @@ EOF
 
     CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
     MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
     if test "$MOZ_OBJFORMAT" = "elf"; then
         DLL_SUFFIX=so
     else
         DLL_SUFFIX=so.1.0
     fi
+    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
     DSO_CFLAGS=-fPIC
-    DSO_LDOPTS=-Bshareable
+    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
     MDCPUCFG_H=_freebsd.cfg
     PR_MD_CSRCS=freebsd.c
     ;;
 
 *-hpux*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
@@ -3267,30 +3326,42 @@ EOF
     cat >> confdefs.h <<\EOF
 #define _HPUX_SOURCE 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define hppa 1
 EOF
 
+    # OSF1 and HPUX report the POLLHUP event for a socket when the
+    # shutdown(SHUT_WR) operation is called for the remote end, even though
+    # the socket is still writeable. Use select(), instead of poll(), to
+    # workaround this problem.
+    cat >> confdefs.h <<\EOF
+#define _PR_POLL_WITH_SELECT 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define _USE_BIG_FDS 1
+EOF
+
     DLL_SUFFIX=sl
     DSO_LDOPTS='-b +h $(notdir $@)'
     PR_MD_CSRCS=hpux.c
-    PR_MD_ASFILES=os_HPUX.s
+    if test "$OS_TEST" != "ia64"; then
+        PR_MD_ASFILES=os_HPUX.s
+    fi
     if test -n "$USE_64"; then
         MDCPUCFG_H=_hpux64.cfg
     else
         MDCPUCFG_H=_hpux32.cfg
     fi
     if test -z "$GNU_CC"; then
         CC="$CC -Ae"
         CXX="$CXX -ext"
-        CFLAGS="$CFLAGS +ESlit"
-        CXXFLAGS="$CXXFLAGS +ESlit"
         DSO_CFLAGS=+Z
     else
         DSO_CFLAGS=-fPIC
     fi
 
     if test -n "$MOZILLA_CLIENT"; then
         DEFAULT_IMPL_STRATEGY=_EMU
     fi
@@ -3324,23 +3395,32 @@ EOF
 
     if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
         cat >> confdefs.h <<\EOF
 #define HAVE_INT_LOCALTIME_R 1
 EOF
 
     fi
 
-    if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11.00|B.11.11)' >/dev/null; then
+    if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
         cat >> confdefs.h <<\EOF
 #define HAVE_POINTER_LOCALTIME_R 1
 EOF
 
     fi
 
+    # HP-UX 11i (B.11.11) or higher
+    
+    case "$OS_RELEASE" in
+    [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[2-9]*|B.11.1[1-9]*)
+        USE_IPV6=1
+        ;;
+    esac
+    
+
     if test "$OS_RELEASE" = "B.10.01"; then
         cat >> confdefs.h <<\EOF
 #define HPUX10 1
 EOF
 
         DEFAULT_IMPL_STRATEGY=_EMU
     fi
 
@@ -3383,17 +3463,17 @@ EOF
 
         if test -z "$GNU_CC"; then
             CFLAGS="$CFLAGS +DAportable +DS1.1"
             CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
         fi
         DEFAULT_IMPL_STRATEGY=_PTH
     fi
 
-    if echo "$OS_RELEASE" | egrep '^(B.11.00|B.11.11)' >/dev/null; then
+    if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
         cat >> confdefs.h <<\EOF
 #define HPUX10 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HPUX11 1
 EOF
 
@@ -3406,21 +3486,31 @@ EOF
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HAVE_FCNTL_FILE_LOCKING 1
 EOF
 
         if test -z "$GNU_CC"; then
             if test -z "$USE_64"; then
-                CFLAGS="$CFLAGS +DAportable +DS2.0"
-                CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
+                if test "$OS_TEST" = "ia64"; then
+                    CFLAGS="$CFLAGS +DD32"
+                    CXXFLAGS="$CXXFLAGS +DD32"
+                else
+                    CFLAGS="$CFLAGS +DAportable +DS2.0"
+                    CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
+                fi
             else
-                CFLAGS="$CFLAGS +DA2.0W +DS2.0"
-                CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
+                if test "$OS_TEST" = "ia64"; then
+                    CFLAGS="$CFLAGS +DD64"
+                    CXXFLAGS="$CXXFLAGS +DD64"
+                else
+                    CFLAGS="$CFLAGS +DA2.0W +DS2.0"
+                    CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
+                fi
             fi
         fi
         DEFAULT_IMPL_STRATEGY=_PTH
     fi
 
     if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
         USE_NSPR_THREADS=1
         USE_PTHREADS=
@@ -3504,17 +3594,17 @@ EOF
 	    if test "$USE_N32"; then
 	        _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
 	    else
 	        _OPTIMIZE_FLAGS="-O -Olimit 4000"
 	    fi
 	    if test "$USE_MDUPDATE"; then
                 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
 	    fi
-	    case "$target}" in
+	    case "${target}" in
 	    *-irix6.*)
 	        CFLAGS="$CFLAGS -multigot"
 	        DSO_LDOPTS="-no_unresolved"
 	        if test "$USE_N32"; then
 		        CFLAGS="$CFLAGS -n32 -woff 1209"
 		        DSO_LDOPTS="$DSO_LDOPTS -n32"
 	        else
 		        if test "$USE_64"; then
@@ -3592,29 +3682,28 @@ EOF
     cat >> confdefs.h <<\EOF
 #define HAVE_FCNTL_FILE_LOCKING 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define LINUX 1
 EOF
 
-    cat >> confdefs.h <<\EOF
-#define linux 1
-EOF
-
     CFLAGS="$CFLAGS -ansi -Wall"
     CXXFLAGS="$CXXFLAGS -ansi -Wall"
     MDCPUCFG_H=_linux.cfg
     PR_MD_CSRCS=linux.c
     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
     DSO_CFLAGS=-fPIC
     DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
-    OS_LIBS="$OS_LIBS -lc"
     _OPTIMIZE_FLAGS=-O2
+    _DEBUG_FLAGS="-g -fno-inline"  # most people on linux use gcc/gdb, and that
+                                   # combo is not yet good at debugging inlined
+                                   # functions (even when using DWARF2 as the
+                                   # debugging format)
     COMPILER_TAG=_glibc
     if echo "$OS_TEST" | grep -c 86 >/dev/null; then
         CPU_ARCH=x86
     else
         CPU_ARCH=$OS_TEST
     fi
     CPU_ARCH_TAG=_${CPU_ARCH}
     case "${target_cpu}" in
@@ -3625,71 +3714,69 @@ EOF
 
         cat >> confdefs.h <<\EOF
 #define __alpha 1
 EOF
 
         CFLAGS="$CFLAGS -mieee"
         CXXFLAGS="$CXXFLAGS -mieee"
         ;;
-    i?86)
+    i*86)
         cat >> confdefs.h <<\EOF
 #define i386 1
 EOF
 
         PR_MD_ASFILES=os_Linux_x86.s
         ;;
     ia64)
         PR_MD_ASFILES=os_Linux_ia64.s
         ;;
     m68k)
-        CFLAGS="$CFLAGS -m68020-40"
-        CXXFLAGS="$CXXFLAGS -m68020-40"
-        #
-        # gcc on Linux/m68k either has a bug or triggers a code-sequence
-        # bug in the 68060 which causes gcc to crash.  The simplest way to
-        # avoid this is to enable a minimum level of optimization.
-        #
-        _DEBUG_FLAGS="$_DEBUG_FLAGS -O"
+        CFLAGS="$CFLAGS -m68020-60"
+        CXXFLAGS="$CXXFLAGS -m68020-60"
         ;;
     esac    
     ;;
 
-*-mingw*|*-cygwin*|*-msvc*|*-mksnt*)
+*-mingw*|*-cygwin*|*-msvc*|*-mks*)
     cat >> confdefs.h <<\EOF
 #define XP_PC 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define WIN32 1
 EOF
 
     PR_MD_ARCH_DIR=windows
     RESOLVE_LINK_SYMBOLS=1
+    NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
+    if test `echo "${PATH}" | grep -c \;` = 0; then
+        CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
+    fi
 
     if test -n "$GNU_CC"; then
-        cat >> confdefs.h <<\EOF
-#define NONAMELESSUNION 1
-EOF
-
-        MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@'
+        CC="$CC -mno-cygwin"
+        CXX="$CXX -mno-cygwin"
+        DLL_SUFFIX=dll
+        MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
+        RC=$WINDRES
+        RCFLAGS='-O coff'
     else
         CC=cl
         CXX=cl
         LD=link
         AR='lib -NOLOGO -OUT:"$@"'
         AR_FLAGS=
         RANLIB='echo not_ranlib'
         STRIP='echo not_strip'
-        NSINSTALL=nsinstall
         RC=rc.exe
         GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
-	    OBJ_SUFFIX=obj
-	    LIB_SUFFIX=lib
-	    DLL_SUFFIX=dll
+        OBJ_SUFFIX=obj
+        LIB_SUFFIX=lib
+        DLL_SUFFIX=dll
         
         CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
 
         if test -n "$MOZ_DEBUG"; then
             cat >> confdefs.h <<\EOF
 #define _DEBUG 1
 EOF
 
@@ -3751,16 +3838,18 @@ EOF
 #define WINNT 1
 EOF
 
     else
         cat >> confdefs.h <<\EOF
 #define WIN95 1
 EOF
 
+        # undefine WINNT as some versions of mingw gcc define it by default
+        DEFINES="$DEFINES -UWINNT"
         cat >> confdefs.h <<\EOF
 #define _PR_GLOBAL_THREADS_ONLY 1
 EOF
 
     fi
 
     if test "$CPU_ARCH" = "x86"; then
         CPU_ARCH_TAG=
@@ -3785,17 +3874,17 @@ EOF
 	    MDCPUCFG_H=_win16.cfg
 	    ;;
     *)
 	    { echo "configure: error: Missing OS_TARGET for ${target}.  Use --enable-win32-target to set." 1>&2; exit 1; }
    	;;
     esac
 
     case "$target_cpu" in
-    i?86)
+    i*86)
 	    cat >> confdefs.h <<\EOF
 #define _X86_ 1
 EOF
 
         ;;
     alpha)
 	    cat >> confdefs.h <<\EOF
 #define _ALPHA_ 1
@@ -4054,70 +4143,77 @@ EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define VMS 1
 EOF
 
     cat >> confdefs.h <<\EOF
-#define VMS_AS_IS 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define _SOCKADDR_LEN 1
-EOF
-
-    cat >> confdefs.h <<\EOF
-#define GENERIC_PTHREAD_REDEFINES 1
+#define PR_GETIPNODE_NOT_THREADSAFE 1
 EOF
 
     RESOLVE_LINK_SYMBOLS=1
-    CROSS_COMPILE=1
-    _HAVE_PTHREADS=1
-    HOST_CC=c89
-    HOST_CXX=cxx
-    HOST_CFLAGS=-O
-    HOST_CXXFLAGS=-O
-    CC=ccc
-    CXX=ccc
-    CFLAGS="$CFLAGS -Wc,names=\(short,as\)"
-    CXXFLAGS="$CXXFLAGS -Wc,names=\(short,as\)"
+    AR_FLAGS='c $@'
     MDCPUCFG_H=_openvms.cfg
     PR_MD_CSRCS=openvms.c
-    MKSHLIB='vmsld $(OPTIMIZER)'
+    DSO_LDOPTS='-shared -auto_symvec $(LDFLAGS)'
+    if test -n "$MOZ_DEBUG"; then
+      DSO_LDOPTS="$DSO_LDOPTS $_DEBUG_FLAGS"
+    else
+      DSO_LDOPTS="$DSO_LDOPTS $_OPTIMIZE_FLAGS"
+    fi
     ;;
 
 *-osf*)
     SHELL_OVERRIDE="SHELL		= /usr/bin/ksh"
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define OSF1 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define _REENTRANT 1
 EOF
 
-    ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
+    # OSF1 and HPUX report the POLLHUP event for a socket when the
+    # shutdown(SHUT_WR) operation is called for the remote end, even though
+    # the socket is still writeable. Use select(), instead of poll(), to
+    # workaround this problem.
+    cat >> confdefs.h <<\EOF
+#define _PR_POLL_WITH_SELECT 1
+EOF
+
+
+    if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
+        USE_NSPR_THREADS=1
+    fi
+
+    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:4106: checking for machine/builtins.h" >&5
+echo "configure:4202: 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 4111 "configure"
+#line 4207 "configure"
 #include "confdefs.h"
 #include <machine/builtins.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4212: \"$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
@@ -4131,27 +4227,19 @@ if eval "test \"`echo '$ac_cv_header_'$a
   cat >> confdefs.h <<\EOF
 #define OSF1_HAVE_MACHINE_BUILTINS_H 1
 EOF
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-
-    if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
-        USE_NSPR_THREADS=1
-    fi
-
-    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"
+    else
+        CFLAGS="$CFLAGS -mieee"
+        CXXFLAGS="$CXXFLAGS -mieee"
     fi
 
     if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
         cat >> confdefs.h <<\EOF
 #define HAVE_INT_LOCALTIME_R 1
 EOF
 
     else
@@ -4350,39 +4438,47 @@ EOF
 EOF
 
     if test -n "$USE_64"; then
         MDCPUCFG_H=_solaris64.cfg
     else
         MDCPUCFG_H=_solaris32.cfg
     fi
     PR_MD_CSRCS=solaris.c
-    DSO_LDOPTS='-G -h $(notdir $@)'
+    LD=/usr/ccs/bin/ld
+    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
+    RESOLVE_LINK_SYMBOLS=1
     if test -n "$GNU_CC"; then
         DSO_CFLAGS=-fPIC
+        if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
+            GCC_USE_GNU_LD=1
+        fi
+        DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs' 
     else
         DSO_CFLAGS=-KPIC
+        DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs'
     fi
     if test -z "$GNU_AS"; then
         ASFLAGS="$ASFLAGS -Wa,-P"
     fi
     if test -n "$GNU_CC"; then
         CFLAGS="$CFLAGS -Wall"
         CXXFLAGS="$CXXFLAGS -Wall"
         if test -n "$USE_MDUPDATE"; then
             CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
             CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
         fi
     else
-        CC="$CC -xstrconst"
-        CXX="$CXX -Qoption cg -xstrconst"
+        CFLAGS="$CFLAGS -xstrconst"
+        CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst"
         if test -z "$MOZ_OPTIMIZE"; then
             CFLAGS="$CFLAGS -xs"
             CXXFLAGS="$CXXFLAGS -xs"
         fi
+        _OPTIMIZE_FLAGS=-xO4
     fi
     if test -n "$USE_64" && test -z "$GNU_CC"; then
         CC="$CC -xarch=v9"
         CXX="$CXX -xarch=v9"
     fi
     if test "$OS_TEST" = "i86pc"; then
         cat >> confdefs.h <<\EOF
 #define i386 1
@@ -4438,21 +4534,24 @@ EOF
 
         fi
         ;;
     esac
     if test "$OS_TEST" = "sun4u"; then
         # 64-bit Solaris requires SPARC V9 architecture, so the following
         # is not needed.
         if test -z "$USE_64"; then
-            ULTRASPARC_LIBRARY=ultrasparc
-            ULTRASPARC_FILTER_LIBRARY=libatomic.so
-            DSO_LDOPTS="$DSO_LDOPTS -f "'$(ULTRASPARC_FILTER_LIBRARY)'
+            ULTRASPARC_LIBRARY=nspr_flt
         fi
     fi
+    # Purify requires that binaries linked against nspr also
+    # be linked against -lrt (or -lposix4) so add it to OS_LIBS
+    _rev=`uname -r`
+    _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
+    OS_LIBS="$OS_LIBS $_librt"
     ;;
 
 *-sco-sysv5*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -4497,105 +4596,105 @@ EOF
     ;;
 
 *-os2*)
     cat >> confdefs.h <<\EOF
 #define XP_OS2 1
 EOF
 
     cat >> confdefs.h <<\EOF
-#define BSD_SELECT 1
-EOF
-
-    cat >> confdefs.h <<\EOF
 #define XP_PC 1
 EOF
 
     cat >> confdefs.h <<\EOF
+#define BSD_SELECT 1
+EOF
+
+    cat >> confdefs.h <<\EOF
 #define _PR_GLOBAL_THREADS_ONLY 1
 EOF
 
-    OBJ_SUFFIX=obj
     LIB_SUFFIX=lib
     DLL_SUFFIX=dll
-    ASM_SUFFIX=asm
-    DLLTOOL=''
     RC=rc.exe
     PR_MD_ARCH_DIR=os2
     PROG_SUFFIX=.exe
     NSINSTALL=nsinstall
     MDCPUCFG_H=_os2.cfg
     RESOLVE_LINK_SYMBOLS=1
 
     # EMX/GCC build
-    if test "$GNU_CC"; then
+    if test -n "$GNU_CC"; then
         cat >> confdefs.h <<\EOF
 #define XP_OS2_EMX 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define OS2 1
 EOF
 
         AR=emxomfar
         AR_FLAGS='-p256 r $@'
-        CFLAGS="-Zmtd -Zomf"
-        HOST_CFLAGS="$CFLAGS"
-        CXXFLAGS="-Zmtd -Zomf"
+        CFLAGS="$CFLAGS -Wall -Zmtd -Zomf"
+        CXXFLAGS="$CFLAGS -Wall -Zmtd -Zomf"
+        MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
+        DSO_CFLAGS=
+        DSO_LDOPTS='-Zomf -Zdll -Zmtd'
+        _OPTIMIZE_FLAGS="-O2 -s"
+        _DEBUG_FLAGS="-g -fno-inline"
+        if test -n "$MOZ_OPTIMIZE"; then
+          DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
+        fi
         OS_LIBS="-lsocket -lemxio"
-        LD='$(CC)'
         IMPLIB='emximp -o'
-        FILTER='emxexp'
-        OS_DLLFLAGS='$(DSO_LDOPTS) -o $@'
-        _OPTIMIZE_FLAGS=-O3
-        _DEBUG_FLAGS=-g
-        if test -n "$MOZ_DEBUG"; then
-          DLLFLAGS='-g'
-          EXEFLAGS='-g $(OMF_FLAG) -Zmtd -L$(DIST)/lib -o $@'
-          DSO_LDOPTS='-g -Zomf -Zdll -Zmt -Zcrtdll -Zlinker /NOO'
-        else
-          DLLFLAGS=
-          EXEFLAGS='-Zmtd -o $@'
-          DSO_LDOPTS='-Zomf -Zdll -Zmt -Zcrtdll -Zlinker /NOO'
+        FILTER='emxexp -o'
+
+        if test -z "$EMXOMFLD_LINKER"; then
+          # using LINK386.EXE
+          DSO_LDOPTS="$DSO_LDOPTS -Zlinker /NOO"
         fi
-    fi
-    
+
+        # GCC for OS/2 currently predefines these, but we don't want them
+        DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
+
     # Visual Age C++ build
-    if test "$VACPP" = "yes"; then
+    elif test "$VACPP" = "yes"; then
         cat >> confdefs.h <<\EOF
 #define XP_OS2_VACPP 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define OS2 4
 EOF
 
         cat >> confdefs.h <<\EOF
 #define TCPV40HDRS 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define _X86_ 1
 EOF
 
+        OBJ_SUFFIX=obj
         AS=alp
         ASFLAGS='-Mb'
+        ASM_SUFFIX=asm
         AR=-ilib
         AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
         CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
         HOST_CFLAGS="$CFLAGS"
         OS_CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
         OS_EXE_CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
         CXXFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
         OS_LIBS='so32dll.lib tcp32dll.lib'
         LD='-ilink'
         MKSHLIB='$(LD) $(DSO_LDOPTS)'
         IMPLIB='implib -nologo -noignorecase'
         FILTER='cppfilt -q -B -P'
-        _OPTIMIZE_FLAGS='/O+ /Gl+ /Gx+ /qtune=pentium /qarch=pentium'
+        _OPTIMIZE_FLAGS='/O+ /Gl+ /qtune=pentium /qarch=pentium'
         _DEBUG_FLAGS='/Ti+ '
         LDFLAGS='/NOL /M /L'
         DLLFLAGS='/O:$@ /DLL /INC:_dllentry /MAP:$(@:.dll=.map) /L /NOL'
         EXEFLAGS='/OUT:$@ /PMTYPE:VIO /MAP:$(@:.exe=.map) /L /NOL'
         if test -n "$MOZ_DEBUG"; then
           LDFLAGS="$LDFLAGS /DE"
           DLLFLAGS="$DLLFLAGS /DE"
           EXEFLAGS="$EXEFLAGS /DE"
@@ -4616,118 +4715,109 @@ EOF
 EOF
 
     ;;
    
 esac
 
 if test -z "$SKIP_LIBRARY_CHECKS"; then
 
-echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:4626: checking for dlopen" >&5
-if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 4631 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen(); 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 dlopen();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-dlopen();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:4654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_dlopen=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_dlopen=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-
-    echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4673: checking for dlopen in -ldl" >&5
+
+
+case $target in
+*-darwin*)
+        ;;
+*)
+        echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "configure:4731: 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 4681 "configure"
+#line 4739 "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:4692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4750: \"$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:4767: 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 4772 "configure"
+#include "confdefs.h"
+#include <dlfcn.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4777: \"$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
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
   OS_LIBS="-ldl $OS_LIBS"
 else
   echo "$ac_t""no" 1>&6
 fi
 
-
-fi
+else
+  echo "$ac_t""no" 1>&6
+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:4720: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:4810: 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 4726 "configure"
+#line 4816 "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
@@ -4735,17 +4825,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 4744 "configure"
+#line 4834 "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
@@ -4759,22 +4849,22 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional
   if test $ac_cv_prog_gcc_traditional = yes; then
     CC="$CC -traditional"
   fi
 fi
 
 for ac_func in lchown strerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4768: checking for $ac_func" >&5
+echo "configure:4858: 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 4773 "configure"
+#line 4863 "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();
@@ -4787,17 +4877,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:4796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4886: \"$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
@@ -4821,96 +4911,131 @@ done
 
 # Check whether --enable-strip or --disable-strip was given.
 if test "${enable_strip+set}" = set; then
   enableval="$enable_strip"
    ENABLE_STRIP=1 
 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:4925: 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
+            if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
+                ac_cv_hpux_usable_olit_option=yes
+            fi
+        fi
+        rm -f conftest*
+        
+fi
+
+echo "$ac_t""$ac_cv_hpux_usable_olit_option" 1>&6
+
+    if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
+        CFLAGS="$CFLAGS +Olit=all"
+        CXXFLAGS="$CXXFLAGS +Olit=all"
+    else
+        CFLAGS="$CFLAGS +ESlit"
+        CXXFLAGS="$CXXFLAGS +ESlit"
+    fi
+fi
+;;
+esac
+
 
 
 
 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:4834: checking for pthread_create in -lpthreads" >&5
+echo "configure:4959: checking for pthread_create in -lpthreads" >&5
 echo "
     #include <pthread.h> 
-    void *foo(void *v) { int a = 1;  } 
+    void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
-        exit(0);
+        return 0;
     }" > dummy.c ;
     echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthreads $LDFLAGS $LIBS" 1>&5;
     ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthreads $LDFLAGS $LIBS 2>&5;
     _res=$? ;
     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:4856: checking for pthread_create in -lpthread" >&5
+echo "configure:4981: checking for pthread_create in -lpthread" >&5
 echo "
     #include <pthread.h> 
-    void *foo(void *v) { int a = 1;  } 
+    void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
-        exit(0);
+        return 0;
     }" > dummy.c ;
     echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthread $LDFLAGS $LIBS" 1>&5;
     ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthread $LDFLAGS $LIBS 2>&5;
     _res=$? ;
     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:4878: checking for pthread_create in -lc_r" >&5
+echo "configure:5003: checking for pthread_create in -lc_r" >&5
 echo "
     #include <pthread.h> 
-    void *foo(void *v) { int a = 1;  } 
+    void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
-        exit(0);
+        return 0;
     }" > dummy.c ;
     echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc_r $LDFLAGS $LIBS" 1>&5;
     ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc_r $LDFLAGS $LIBS 2>&5;
     _res=$? ;
     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:4900: checking for pthread_create in -lc" >&5
+echo "configure:5025: checking for pthread_create in -lc" >&5
 echo "
     #include <pthread.h> 
-    void *foo(void *v) { int a = 1;  } 
+    void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
-        exit(0);
+        return 0;
     }" > dummy.c ;
     echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS" 1>&5;
     ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS 2>&5;
     _res=$? ;
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1
@@ -4941,17 +5066,17 @@ if test "${with_pthreads+set}" = set; th
 	    else
 		    { echo "configure: error:  --with-pthreads specified for a system without pthread support " 1>&2; exit 1; };
 	    fi
 	  else
 	    USE_PTHREADS=
 	    _PTHREAD_LDFLAGS=
 	  fi
 else
-   if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USER_NSPR_THREADS"; then
+   if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
 	    USE_PTHREADS=1
 	    USE_USER_PTHREADS=
 	    USE_NSPR_THREADS=
 	  fi
 fi
 
 
 # Check whether --enable-user-pthreads or --disable-user-pthreads was given.
@@ -5019,16 +5144,18 @@ if test "${enable_cplus+set}" = set; the
 fi
  
 
 # Check whether --enable-ipv6 or --disable-ipv6 was given.
 if test "${enable_ipv6+set}" = set; then
   enableval="$enable_ipv6"
    if test "$enableval" = "yes"; then
 	    USE_IPV6=1
+      else
+	    USE_IPV6=
       fi
 fi
 
 
 
 # Check whether --enable-boehm or --disable-boehm was given.
 if test "${enable_boehm+set}" = set; then
   enableval="$enable_boehm"
@@ -5041,33 +5168,40 @@ EOF
     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:5050: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:5177: 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
-	    CFLAGS="$CFLAGS -pthread"
-	    CXXFLAGS="$CXXFLAGS -pthread"
+		case "$target_os" in
+	    freebsd*)
+# Freebsd doesn't use -pthread for compiles, it uses them for linking
+            ;;
+	    *)
+            CFLAGS="$CFLAGS -pthread"
+            CXXFLAGS="$CXXFLAGS -pthread"
+            ;;
+        esac
 	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:5066: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:5200: 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
@@ -5077,17 +5211,32 @@ echo "configure:5066: checking whether $
     fi
 
     case "$target" in
     *-solaris*)
         if test "$ac_cv_have_dash_pthreads" = "yes"; then
             _PTHREAD_LDFLAGS=
         fi
 	    ;;
-    *-freebsd*|*-openbsd*|*-bsdi*|*-netbsd*)
+    *-freebsd*)
+	    cat >> confdefs.h <<\EOF
+#define _REENTRANT 1
+EOF
+
+	    cat >> confdefs.h <<\EOF
+#define _THREAD_SAFE 1
+EOF
+
+	    	    if test "$ac_cv_have_dash_pthread" = "yes"; then
+	        _PTHREAD_LDFLAGS="-pthread"
+	    else
+	        _PTHREAD_LDFLAGS="-lc_r"
+	    fi
+	    ;;
+    *-openbsd*|*-bsdi*|*-netbsd*)
 	    cat >> confdefs.h <<\EOF
 #define _THREAD_SAFE 1
 EOF
 
 	    	    if test "$ac_cv_have_dash_pthread" = "yes"; then
 	        _PTHREAD_LDFLAGS=
 	    fi
 	    ;;
@@ -5142,16 +5291,30 @@ EOF
         fi
         if test -n "$USE_PTHREADS"; then
             cat >> confdefs.h <<\EOF
 #define _PR_HAVE_THREADSAFE_GETHOST 1
 EOF
 
         fi
         ;;
+    *)
+        if test -z "$USE_NSPR_THREADS"; then
+            cat >> confdefs.h <<\EOF
+#define HAVE_POINTER_LOCALTIME_R 1
+EOF
+
+        fi
+        if test -n "$USE_PTHREADS"; then
+            cat >> confdefs.h <<\EOF
+#define _PR_HAVE_THREADSAFE_GETHOST 1
+EOF
+
+        fi
+        ;;
     esac
     ;;
 *-bsdi*)
     if test -n "$USE_PTHREADS"; then
         cat >> confdefs.h <<\EOF
 #define _PR_NEED_PTHREAD_INIT 1
 EOF
 
@@ -5217,22 +5380,22 @@ EOF
 *-linux*)
     if test -n "$USE_NSPR_THREADS"; then
         cat >> confdefs.h <<\EOF
 #define _PR_LOCAL_THREADS_ONLY 1
 EOF
 
     fi
     ;;
-*-mingw*|*-cygwin*|*-msvc*|*-mksnt*)
+*-mingw*|*-cygwin*|*-msvc*|*-mks*)
         USE_PTHREADS=
     _PTHREAD_LDFLAGS=
     USE_USER_PTHREADS=
     ;;
-*-netbsd*)
+*-netbsd*|*-openbsd*)
     if test -n "$USE_NSPR_THREADS"; then
         cat >> confdefs.h <<\EOF
 #define _PR_LOCAL_THREADS_ONLY 1
 EOF
 
     fi
     ;;
 *-osf*)
@@ -5323,16 +5486,25 @@ else
 fi
 
 if test -n "$USE_64"; then
     COMPILER_TAG=_64
 fi
 
 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
 
+case "$target_os" in
+mingw*|cygwin*|msvc*|mks*)
+    CC="\$(CYGWIN_WRAPPER) $CC"
+    CXX="\$(CYGWIN_WRAPPER) $CXX"
+    RC="\$(CYGWIN_WRAPPER) $RC"
+    ;;
+esac
+
+
 
 
 
 
 
 
 
 
@@ -5425,16 +5597,21 @@ config/nsprincl.mk
 config/nsprincl.sh
 config/nspr-config
 lib/Makefile 
 lib/ds/Makefile 
 lib/libc/Makefile 
 lib/libc/include/Makefile 
 lib/libc/src/Makefile 
 lib/tests/Makefile
+pkg/Makefile
+pkg/linux/Makefile
+pkg/solaris/Makefile
+pkg/solaris/SUNWpr/Makefile
+pkg/solaris/SUNWprx/Makefile
 pr/Makefile 
 pr/include/Makefile 
 pr/include/md/Makefile 
 pr/include/obsolete/Makefile 
 pr/include/private/Makefile 
 pr/src/Makefile 
 pr/src/io/Makefile 
 pr/src/linking/Makefile 
@@ -5615,37 +5792,37 @@ s%@target_alias@%$target_alias%g
 s%@target_cpu@%$target_cpu%g
 s%@target_vendor@%$target_vendor%g
 s%@target_os@%$target_os%g
 s%@build@%$build%g
 s%@build_alias@%$build_alias%g
 s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
+s%@CC@%$CC%g
 s%@dist_prefix@%$dist_prefix%g
 s%@dist_bindir@%$dist_bindir%g
 s%@dist_includedir@%$dist_includedir%g
 s%@dist_libdir@%$dist_libdir%g
 s%@WHOAMI@%$WHOAMI%g
 s%@HOST_CC@%$HOST_CC%g
-s%@CC@%$CC%g
 s%@CXX@%$CXX%g
 s%@RANLIB@%$RANLIB%g
 s%@AR@%$AR%g
 s%@AS@%$AS%g
 s%@LD@%$LD%g
 s%@STRIP@%$STRIP%g
-s%@DLLTOOL@%$DLLTOOL%g
 s%@WINDRES@%$WINDRES%g
 s%@CPP@%$CPP%g
 s%@PERL@%$PERL%g
 s%@SHELL_OVERRIDE@%$SHELL_OVERRIDE%g
 s%@MOZILLA_CLIENT@%$MOZILLA_CLIENT%g
 s%@HOST_CFLAGS@%$HOST_CFLAGS%g
 s%@GNU_CC@%$GNU_CC%g
+s%@GCC_USE_GNU_LD@%$GCC_USE_GNU_LD%g
 s%@CROSS_COMPILE@%$CROSS_COMPILE%g
 s%@MOZ_OPTIMIZE@%$MOZ_OPTIMIZE%g
 s%@USE_CPLUS@%$USE_CPLUS%g
 s%@USE_IPV6@%$USE_IPV6%g
 s%@USE_N32@%$USE_N32%g
 s%@USE_64@%$USE_64%g
 s%@OBJECT_MODE@%$OBJECT_MODE%g
 s%@GC_LEAK_DETECTOR@%$GC_LEAK_DETECTOR%g
@@ -5654,17 +5831,17 @@ s%@USE_PTHREADS@%$USE_PTHREADS%g
 s%@USE_BTHREADS@%$USE_BTHREADS%g
 s%@USE_USER_PTHREADS@%$USE_USER_PTHREADS%g
 s%@USE_NATIVE_THREADS@%$USE_NATIVE_THREADS%g
 s%@USE_NSPR_THREADS@%$USE_NSPR_THREADS%g
 s%@LIBNSPR@%$LIBNSPR%g
 s%@LIBPLC@%$LIBPLC%g
 s%@MOD_MAJOR_VERSION@%$MOD_MAJOR_VERSION%g
 s%@MOD_MINOR_VERSION@%$MOD_MINOR_VERSION%g
-s%@MOD_REVISION_VERSION@%$MOD_REVISION_VERSION%g
+s%@MOD_PATCH_VERSION@%$MOD_PATCH_VERSION%g
 s%@NSPR_MODNAME@%$NSPR_MODNAME%g
 s%@MDCPUCFG_H@%$MDCPUCFG_H%g
 s%@PR_MD_CSRCS@%$PR_MD_CSRCS%g
 s%@PR_MD_ASFILES@%$PR_MD_ASFILES%g
 s%@PR_MD_ARCH_DIR@%$PR_MD_ARCH_DIR%g
 s%@CPU_ARCH@%$CPU_ARCH%g
 s%@OBJ_SUFFIX@%$OBJ_SUFFIX%g
 s%@LIB_SUFFIX@%$LIB_SUFFIX%g
@@ -5672,37 +5849,39 @@ s%@DLL_SUFFIX@%$DLL_SUFFIX%g
 s%@ASM_SUFFIX@%$ASM_SUFFIX%g
 s%@MKSHLIB@%$MKSHLIB%g
 s%@DSO_CFLAGS@%$DSO_CFLAGS%g
 s%@DSO_LDOPTS@%$DSO_LDOPTS%g
 s%@OS_TARGET@%$OS_TARGET%g
 s%@OS_ARCH@%$OS_ARCH%g
 s%@OS_RELEASE@%$OS_RELEASE%g
 s%@OS_TEST@%$OS_TEST%g
+s%@MACOS_DEPLOYMENT_TARGET@%$MACOS_DEPLOYMENT_TARGET%g
 s%@DEFINES@%$DEFINES%g
 s%@AR_FLAGS@%$AR_FLAGS%g
 s%@ASFLAGS@%$ASFLAGS%g
 s%@FILTER@%$FILTER%g
 s%@IMPLIB@%$IMPLIB%g
 s%@OS_LIBS@%$OS_LIBS%g
 s%@RESOLVE_LINK_SYMBOLS@%$RESOLVE_LINK_SYMBOLS%g
 s%@AIX_LINK_OPTS@%$AIX_LINK_OPTS%g
 s%@NOSUCHFILE@%$NOSUCHFILE%g
 s%@MOZ_OBJFORMAT@%$MOZ_OBJFORMAT%g
 s%@ULTRASPARC_LIBRARY@%$ULTRASPARC_LIBRARY%g
-s%@ULTRASPARC_FILTER_LIBRARY@%$ULTRASPARC_FILTER_LIBRARY%g
 s%@OBJDIR@%$OBJDIR%g
 s%@OBJDIR_NAME@%$OBJDIR_NAME%g
 s%@RELEASE_OBJDIR_NAME@%$RELEASE_OBJDIR_NAME%g
 s%@NSINSTALL@%$NSINSTALL%g
 s%@OPTIMIZER@%$OPTIMIZER%g
 s%@RC@%$RC%g
+s%@RCFLAGS@%$RCFLAGS%g
 s%@DLLFLAGS@%$DLLFLAGS%g
 s%@EXEFLAGS@%$EXEFLAGS%g
 s%@OS_DLLFLAGS@%$OS_DLLFLAGS%g
+s%@CYGWIN_WRAPPER@%$CYGWIN_WRAPPER%g
 
 CEOF
 EOF
 
 cat >> $CONFIG_STATUS <<\EOF
 
 # Split the substitutions into bite-sized pieces for seds with
 # small command number limits, like on Digital OSF/1 and HP-UX.
--- a/configure.in
+++ b/configure.in
@@ -38,39 +38,41 @@ 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=2
-MOD_REVISION_VERSION=0
+MOD_MINOR_VERSION=3
+MOD_PATCH_VERSION=0
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
 USE_CPLUS=
 USE_IPV6=
 USE_MDUPDATE=
+MACOS_DEPLOYMENT_TARGET=
 _OPTIMIZE_FLAGS=-O
 _DEBUG_FLAGS=-g
 MOZ_DEBUG=1
 MOZ_OPTIMIZE=
 OBJDIR=.
 OBJDIR_NAME=.
 OBJDIR_SUFFIX=OBJ
 NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
 NOSUCHFILE=/no-such-file
 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
+CYGWIN_WRAPPER=
 
 dnl Link in libraries necessary to resolve all symbols for shared libs
 RESOLVE_LINK_SYMBOLS=
 
 dnl ========================================================
 dnl =
 dnl = Dont change the following lines.  Doing so breaks:
 dnl =
@@ -79,34 +81,36 @@ dnl =
 dnl ========================================================
 CFLAGS="${CFLAGS=}"
 CXXFLAGS="${CXXFLAGS=}"
 LDFLAGS="${LDFLAGS=}"
 HOST_CFLAGS="${HOST_CFLAGS=}"
 HOST_LDFLAGS="${HOST_LDFLAGS=}"
 
 case "$target" in
-*-cygwin*)
+*-cygwin*|*-mingw*)
     # Check to see if we are really running in a msvc environemnt
     _WIN32_MSVC=
-    if test "$CC" = "cl" || test "$CXX" = "cl"; then
-        _WIN32_MSVC=1
-    elif test -z "$CC"; then
+    AC_CHECK_PROGS(CC, cl)
+    if test "$CC" = "cl"; then
         echo 'main() { return 0; }' > dummy.c
-        cl -o dummy dummy.c
+        ${CC} -o dummy dummy.c >/dev/null 2>&1
         if test $? = 0; then
             _WIN32_MSVC=1
+            CXX=$CC
+        else
+            AC_MSG_WARN([$(CC) test failed.  Using normal feature tests])
         fi
         rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
     fi
     ;;
 *-msvc*)
     _WIN32_MSVC=1
     ;;
-*-mksnt*)
+*-mks*)
     _WIN32_MSVC=1
     ;;
 esac
 
 if test -n "$_WIN32_MSVC"; then
     SKIP_PATH_CHECKS=1
     SKIP_COMPILER_CHECKS=1
     SKIP_LIBRARY_CHECKS=1
@@ -207,16 +211,22 @@ AC_ARG_ENABLE(64bit,
       fi ])
 
 AC_ARG_ENABLE(mdupdate,
     [  --enable-mdupdate       Enable use of certain compilers' mdupdate feature],
     [ if test "$enableval" = "yes"; then
 	    USE_MDUPDATE=1
       fi ])
 
+AC_ARG_ENABLE(macos-target,
+             [  --enable-macos-target=VER (default=10.1)
+                          Set the minimum MacOS version needed at runtime],
+             [MACOS_DEPLOYMENT_TARGET_STR=$enableval],
+             [MACOS_DEPLOYMENT_TARGET_STR=10.1])
+
 dnl ========================================================
 dnl =
 dnl = Set the threading model
 dnl =
 dnl ========================================================
 case "$target" in
 
 *-aix*)
@@ -251,16 +261,20 @@ if test -z "$CC"; then
     *-hpux*)
         CC=cc
     ;;
 
     *-irix*)
         CC=cc
     ;;
 
+    *-openvms*)
+        CC=cc
+    ;;
+
     *-osf*)
         CC=cc
     ;;
 
     *-solaris*)
         CC=cc
     ;;
 
@@ -296,37 +310,50 @@ if test -z "$CXX"; then
             ;;
         esac
     ;;
 
     *-irix*)
         CXX=CC
     ;;
 
+    *-openvms*)
+        CXX=cxx
+    ;;
+
     *-osf*)
         CXX=cxx
     ;;
 
     *-solaris*)
         CXX=CC
     ;;
 
     esac
 fi
 
 if test -z "$SKIP_PATH_CHECKS"; then
     AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
-elif test -z "$WHOAMI"; then
-    WHOAMI=whoami
 fi
 
 if test -n "$MOZ_DEBUG"; then
     AC_DEFINE(DEBUG)
-    AC_DEFINE_UNQUOTED(DEBUG_`$WHOAMI`)
     DEFINES="$DEFINES -UNDEBUG"
+
+    case "${target_os}" in
+    beos*)
+        DEFINES="$DEFINES -DDEBUG_${USER}"
+        ;;
+    msvc*|mks*|cygwin*|mingw*|os2*)
+        DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
+        ;;
+    *) 
+        DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
+        ;;
+    esac
 else
     AC_DEFINE(NDEBUG)
     DEFINES="$DEFINES -UDEBUG"
 fi
 
 if test -z "$SKIP_COMPILER_CHECKS"; then
 dnl ========================================================
 dnl Checks for compilers.
@@ -387,19 +414,16 @@ if test "$target" != "$host"; then
 	    AC_CHECK_PROGS(AS, "${target_alias}-as" "${target}-as", echo)
     fi
     if test -z "$LD"; then
 	    AC_CHECK_PROGS(LD, "${target_alias}-ld" "${target}-ld", echo)
     fi
     if test -z "$STRIP"; then
 	    AC_CHECK_PROGS(STRIP, "${target_alias}-strip" "${target}-strip", echo)
     fi
-    if test -z "$DLLTOOL"; then
-	    AC_CHECK_PROGS(DLLTOOL, "${target_alias}-dlltool" "${target}-dlltool", echo)
-    fi
     if test -z "$WINDRES"; then
 	    AC_CHECK_PROGS(WINDRES, "${target_alias}-windres" "${target}-windres", echo)
     fi
 
 else
     AC_PROG_CXX
     if test "$CXX" = "cl" -a -z "$CC"; then
         CC=$CXX
@@ -407,50 +431,49 @@ else
         AC_PROG_CC
     fi
     AC_PROG_CPP
     AC_PROG_RANLIB
     AC_PATH_PROGS(AS, as, $CC)
     AC_PATH_PROGS(AR, ar, echo not_ar)
     AC_PATH_PROGS(LD, ld link, echo not_ld)
     AC_PATH_PROGS(STRIP, strip, echo not_strip)
-    AC_PATH_PROGS(DLLTOOL, dlltool, echo not_dlltool)
     AC_PATH_PROGS(WINDRES, windres, echo not_windres)
     if test -z "$HOST_CC"; then
 	    HOST_CC="$CC"
     fi
     if test -z "$HOST_CFLAGS"; then
 	    HOST_CFLAGS="$CFLAGS"
     fi
 fi
 
 if test "$GCC" = "yes"; then
     GNU_CC=1
 fi
 if test "$GXX" = "yes"; then
     GNU_CXX=1
 fi
-if test "`echo | $AS -V 2>&1 | grep -c GNU`" != "0"; then
+if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
     GNU_AS=1
 fi
 rm -f a.out
 
 if test "$cross_compiling"  = "yes"; then
     CROSS_COMPILE=1
 else
     CROSS_COMPILE=
 fi
 
 dnl ========================================================
 dnl Check for gcc -pipe support
 dnl ========================================================
 AC_MSG_CHECKING([for gcc -pipe support])
 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"); exit(0); }' >> 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
@@ -504,22 +527,31 @@ ASFLAGS='$(CFLAGS)'
 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
 OS_RELEASE=`uname -r`
 OS_TEST=`uname -m`
 
 if test "$OS_ARCH" = "IRIX64"; then
     OS_ARCH=IRIX
 fi
 
-if test "$OS_ARCH" = "Linux"; then
+if test "$OS_ARCH" = "AIX"; then
+    OS_RELEASE=`uname -v`.`uname -r`
+fi
+
+if test "$OS_ARCH" = "FreeBSD"; then
     OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
 fi
 
-if test "$OS_ARCH" = "POSIX_for_OpenVMS_AXP"; then
-    OS_ARCH=OpenVMS
+if test "$OS_ARCH" = "Linux"; then
+    OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
+    OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
+fi
+
+if test "$OS_ARCH" = "OpenVMS"; then
+    OS_RELEASE=`uname -v`
 fi
 
 #######################################################################
 # Master "Core Components" macros for getting the OS target           #
 #######################################################################
 
 #
 # Note: OS_TARGET should be specified on the command line for gmake.
@@ -547,20 +579,17 @@ if test "$OS_ARCH" = "WIN95"; then
     OS_ARCH=WINNT
     OS_TARGET=WIN95
 elif test "$OS_ARCH" = 'Windows_95'; then
     OS_ARCH=Windows_NT
     OS_TARGET=WIN95
 elif test "$OS_ARCH" = 'Windows_98'; then
     OS_ARCH=Windows_NT
     OS_TARGET=WIN95
-elif test "$OS_ARCH" = "CYGWIN_95-4.0"; then
-    OS_ARCH='CYGWIN_NT-4.0'
-    OS_TARGET=WIN95
-elif test "$OS_ARCH" = "CYGWIN_98-4.10"; then
+elif test "`echo $OS_ARCH | egrep -c '^(CYGWIN_9|CYGWIN_ME)' 2>/dev/null`" != 0; then
     OS_ARCH='CYGWIN_NT-4.0'
     OS_TARGET=WIN95
 elif test "$OS_ARCH" = "OS_2"; then
     OS_ARCH=OS2
     OS_TARGET=OS2
 fi
 
 #
@@ -642,17 +671,17 @@ fi
 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
 
 dnl ========================================================
 
 dnl ========================================================
 dnl Override of system specific host options
 dnl ========================================================
 case "$host" in
-*-mingw*|*-cygwin*|*-msvc*|*-mksnt*)
+*-mingw*|*-cygwin*|*-msvc*|*-mks*)
     ;;
 *-beos*)
     HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
     ;;
 *os2*)
     ;;
 *)
     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
@@ -690,66 +719,64 @@ case "$target" in
     aix4.2*)
         AC_DEFINE(AIX_TIMERS)
         AC_DEFINE(_PR_HAVE_OFF64_T)
         AIX_LINK_OPTS='-brtl -bnso -berok'
         ;;
     aix4.3*)
         AC_DEFINE(AIX_TIMERS)
         AC_DEFINE(_PR_HAVE_OFF64_T)
-        AC_DEFINE(AIX4_3)
+        AC_DEFINE(AIX4_3_PLUS)
         AC_DEFINE(HAVE_SOCKLEN_T)
         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
         USE_IPV6=1
         AIX_LINK_OPTS='-brtl -bnso -berok'
         ;;
     *)
         AC_DEFINE(AIX_TIMERS)
         AC_DEFINE(_PR_HAVE_OFF64_T)
+        AC_DEFINE(AIX4_3_PLUS)
         AC_DEFINE(HAVE_SOCKLEN_T)
         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
         USE_IPV6=1
         AIX_LINK_OPTS='-brtl -bnso -berok'
         ;;
     esac
     CFLAGS="$CFLAGS -qro -qroconst"
     if echo "$CC" | grep -c xlC_r; then
         CFLAGS="$CFLAGS -qarch=com"
     fi
     AIX_WRAP='$(DIST)/lib/aixwrap.o'
     AIX_TMP='./_aix_tmp.o'
     if test -n "$USE_64"; then
         MDCPUCFG_H=_aix64.cfg
         OBJECT_MODE=64
     else
-        if test -n "$USE_IPV6"; then
-            MDCPUCFG_H=_aix32in6.cfg
-        else
-            MDCPUCFG_H=_aix32.cfg
-        fi
+        MDCPUCFG_H=_aix32.cfg
     fi
     PR_MD_CSRCS=aix.c
     RESOLVE_LINK_SYMBOLS=1
     ;;
         
 *-beos*)
     AC_DEFINE(XP_BEOS)
     AC_DEFINE(BeOS)
     AC_DEFINE(BEOS)
     AC_DEFINE(_POSIX_SOURCE)
     DSO_LDOPTS=-nostart
     MDCPUCFG_H=_beos.cfg
     USE_BTHREADS=1
     PR_MD_ARCH_DIR=beos
     RESOLVE_LINK_SYMBOLS=1
     case "${target_cpu}" in
-    i?86)
+    i*86)
         _OPTIMIZE_FLAGS=-O2
         _DEBUG_FLAGS='-gdwarf-2 -O0'
         MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
+        AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
         ;;
     powerpc)
         CC=mwcc
         CCC=mwcc
         LD=mwld
         DSO_LDOPTS='-xms -export pragma -init _init_routine_ -term _term_routine_ -lroot -lnet /boot/develop/lib/ppc/glue-noinit.a /boot/develop/lib/ppc/init_term_dyn.o /boot/develop/lib/ppc/start_dyn.o'
         _OPTIMIZE_FLAGS=-O2    
         _DEBUG_FLAGS='-g -O0'
@@ -790,28 +817,28 @@ case "$target" in
         AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
         AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
         AC_DEFINE(HAVE_DLL)
         AC_DEFINE(USE_DLFCN)
         AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
         PR_MD_ASFILES=os_BSD_OS_386_2.s
         ;;
 
-    bsdi4.*)
+    bsdi4.* | bsdi5.*)
         AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
         AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
         AC_DEFINE(HAVE_DLL)
         AC_DEFINE(USE_DLFCN)
         AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
         MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
         DSO_CFLAGS=-fPIC
         DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
         STRIP="$STRIP -d"
         case "$target_os" in
-        bsdi4.2*)
+        bsdi4.2* | bsdi4.3* | bsdi5.*)
             AC_DEFINE(_PR_HAVE_GETPROTO_R)
             AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
             ;;
         esac
         ;;
     *)
         AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
         AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
@@ -824,32 +851,56 @@ case "$target" in
     ;;
 
 *-darwin*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(DARWIN)
     AC_DEFINE(HAVE_BSD_FLOCK)
     CFLAGS="$CFLAGS -Wmost -fno-common"
     if echo $OS_TEST | grep -c 86 2>/dev/null; then
-        CFLAGS="$CFLAGS -mno-486"
         AC_DEFINE(i386)
         CPU_ARCH=i386
     else
         AC_DEFINE(ppc)
         CPU_ARCH=ppc
     fi
     DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@'
     # Use the standard preprocessor (cpp)
     CFLAGS="$CFLAGS -no-cpp-precomp"
     MKSHLIB='$(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS) -o $@'
     STRIP="$STRIP -x -S"
     DLL_SUFFIX=dylib
     USE_PTHREADS=1
     MDCPUCFG_H=_darwin.cfg
     PR_MD_CSRCS=darwin.c
+    if test "$CPU_ARCH" = "ppc"; then
+        PR_MD_ASFILES=os_Darwin_ppc.s
+    fi
+
+    # Add Mac OS X support for loading CFM & CFBundle plugins
+    if test -f /System/Library/Frameworks/Carbon.framework/Carbon; then
+        AC_DEFINE(XP_MACOSX)
+        OS_TARGET=MacOSX
+
+        dnl The C preprocessor can only handle integers in comparisons, so
+        dnl convert the version to the form AABBCC where AA=major release,
+        dnl BB=minor release, and CC=point/micro release.
+
+        MACOS_VERSION_MAJOR=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 1`
+        MACOS_VERSION_MINOR=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 2`
+        MACOS_VERSION_MICRO=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 3`
+        if test -z "$MACOS_VERSION_MINOR"; then
+            MACOS_VERSION_MINOR=0
+        fi
+        if test -z "$MACOS_VERSION_MICRO"; then
+            MACOS_VERSION_MICRO=0
+        fi
+        MACOS_DEPLOYMENT_TARGET=`printf "%02d%02d%02d" "$MACOS_VERSION_MAJOR" "$MACOS_VERSION_MINOR" "$MACOS_VERSION_MICRO"`
+        AC_DEFINE_UNQUOTED(MACOS_DEPLOYMENT_TARGET, $MACOS_DEPLOYMENT_TARGET)
+    fi
     ;;
 
 *-dgux*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
     AC_DEFINE(SVR4)
     AC_DEFINE(SYSV)
     AC_DEFINE(DGUX)
@@ -871,41 +922,48 @@ case "$target" in
     AC_DEFINE(HAVE_BSD_FLOCK)
     CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
     MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
     if test "$MOZ_OBJFORMAT" = "elf"; then
         DLL_SUFFIX=so
     else
         DLL_SUFFIX=so.1.0
     fi
+    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
     DSO_CFLAGS=-fPIC
-    DSO_LDOPTS=-Bshareable
+    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
     MDCPUCFG_H=_freebsd.cfg
     PR_MD_CSRCS=freebsd.c
     ;;
 
 *-hpux*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(HPUX)
     AC_DEFINE(_HPUX_SOURCE)
     AC_DEFINE(hppa)
+    # OSF1 and HPUX report the POLLHUP event for a socket when the
+    # shutdown(SHUT_WR) operation is called for the remote end, even though
+    # the socket is still writeable. Use select(), instead of poll(), to
+    # workaround this problem.
+    AC_DEFINE(_PR_POLL_WITH_SELECT)
+    AC_DEFINE(_USE_BIG_FDS)
     DLL_SUFFIX=sl
     DSO_LDOPTS='-b +h $(notdir $@)'
     PR_MD_CSRCS=hpux.c
-    PR_MD_ASFILES=os_HPUX.s
+    if test "$OS_TEST" != "ia64"; then
+        PR_MD_ASFILES=os_HPUX.s
+    fi
     if test -n "$USE_64"; then
         MDCPUCFG_H=_hpux64.cfg
     else
         MDCPUCFG_H=_hpux32.cfg
     fi
     if test -z "$GNU_CC"; then
         CC="$CC -Ae"
         CXX="$CXX -ext"
-        CFLAGS="$CFLAGS +ESlit"
-        CXXFLAGS="$CXXFLAGS +ESlit"
         DSO_CFLAGS=+Z
     else
         DSO_CFLAGS=-fPIC
     fi
 
     if test -n "$MOZILLA_CLIENT"; then
         DEFAULT_IMPL_STRATEGY=_EMU
     fi
@@ -924,20 +982,29 @@ case "$target" in
     if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
         AC_DEFINE(_PR_NEED_H_ERRNO)
     fi
 
     if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
         AC_DEFINE(HAVE_INT_LOCALTIME_R)
     fi
 
-    if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11.00|B.11.11)' >/dev/null; then
+    if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
         AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
     fi
 
+    # HP-UX 11i (B.11.11) or higher
+    changequote(<<,>>)
+    case "$OS_RELEASE" in
+    [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[2-9]*|B.11.1[1-9]*)
+        USE_IPV6=1
+        ;;
+    esac
+    changequote([,])
+
     if test "$OS_RELEASE" = "B.10.01"; then
         AC_DEFINE(HPUX10)
         DEFAULT_IMPL_STRATEGY=_EMU
     fi
 
     if test "$OS_RELEASE" = "B.10.10"; then
         AC_DEFINE(HPUX10)
         AC_DEFINE(HPUX10_10)
@@ -959,29 +1026,39 @@ case "$target" in
         AC_DEFINE(HPUX10_30)
         if test -z "$GNU_CC"; then
             CFLAGS="$CFLAGS +DAportable +DS1.1"
             CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
         fi
         DEFAULT_IMPL_STRATEGY=_PTH
     fi
 
-    if echo "$OS_RELEASE" | egrep '^(B.11.00|B.11.11)' >/dev/null; then
+    if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
         AC_DEFINE(HPUX10)
         AC_DEFINE(HPUX11)
         AC_DEFINE(_LARGEFILE64_SOURCE)
         AC_DEFINE(_PR_HAVE_OFF64_T)
         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
         if test -z "$GNU_CC"; then
             if test -z "$USE_64"; then
-                CFLAGS="$CFLAGS +DAportable +DS2.0"
-                CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
+                if test "$OS_TEST" = "ia64"; then
+                    CFLAGS="$CFLAGS +DD32"