Clean up nspr client branch after autoconf landing. NSPRPUB_CLIENT_BRANCH
authorcls%seawood.org
Sat, 31 Mar 2001 02:28:59 +0000
branchNSPRPUB_CLIENT_BRANCH
changeset 1798 f4ae9132a9f86181bdacc047f4f3c06f9b50df7a
parent 1797 7c506b081469168ec086f703a861489c9a2a7099
child 1799 7b88dc97f6b6a0c5c8637343499c22e6e7c77c78
push idunknown
push userunknown
push dateunknown
bugs73919
Clean up nspr client branch after autoconf landing. Remove win16 & non-USE_AUTOCONF Makefile ifdefs. Set RESOLVE_LINK_SYMBOLS for win32 Set LIBNSPR & LIBPLC in configure.in Update PR_MD_CSRCS & PR_MD_ASFILES for non-tinderbox ports. Remove USE_AUTOCONF ifdefs around needed platform specific idefs. Bug #73919 r=bryner
config/autoconf.mk.in
config/config.mk
config/rules.mk
configure
configure.in
lib/ds/Makefile.in
lib/libc/src/Makefile.in
lib/msgc/src/Makefile.in
lib/prstreams/Makefile.in
pr/include/md/Makefile.in
pr/src/Makefile.in
pr/src/md/Makefile.in
pr/src/md/unix/Makefile.in
pr/src/md/unix/objs.mk
pr/src/memory/Makefile.in
pr/src/misc/Makefile.in
pr/src/threads/Makefile.in
pr/tests/Makefile.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -12,16 +12,19 @@ libdir		= @libdir@
 OBJDIR_NAME	= @OBJDIR_NAME@
 OBJDIR		= @OBJDIR@
 OBJ_SUFFIX	= @OBJ_SUFFIX@
 LIB_SUFFIX	= @LIB_SUFFIX@
 DLL_SUFFIX	= @DLL_SUFFIX@
 MOD_VERSION	= @NSPR_VERSION@
 MOD_NAME	= @NSPR_MODNAME@
 
+LIBNSPR		= @LIBNSPR@
+LIBPLC		= @LIBPLC@
+
 CROSS_COMPILE	= @CROSS_COMPILE@
 BUILD_OPT	= @MOZ_OPTIMIZE@
 
 USE_CPLUS	= @USE_CPLUS@
 USE_IPV6	= @USE_IPV6@
 USE_N32		= @USE_N32@
 USE_64		= @USE_64@
 GC_LEAK_DETECTOR = @GC_LEAK_DETECTOR@
--- a/config/config.mk
+++ b/config/config.mk
@@ -35,18 +35,16 @@ NSPR_CONFIG_MK	= 1
 ifndef topsrcdir
 topsrcdir=$(MOD_DEPTH)
 endif
 
 ifndef srcdir
 srcdir=.
 endif
 
-ifdef USE_AUTOCONF
-
 NFSPWD		= $(MOD_DEPTH)/config/nfspwd
 
 CFLAGS		= $(CC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
 		  $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
 CCCFLAGS	= $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
 		  $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
 # For purify
 NOMD_CFLAGS	= $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
@@ -80,19 +78,17 @@ endif
 endif # WINNT || OS2
 
 ifdef BUILD_DEBUG_GC
 DEFINES		+= -DDEBUG_GC
 endif
 
 GARBAGE		+= $(DEPENDENCIES) core $(wildcard core.[0-9]*)
 
-ifdef USE_AUTOCONF
 DIST_GARBAGE += Makefile
-endif
 
 DEFINES += -DFORCE_PR_LOG
 
 ifeq ($(_PR_NO_CLOCK_TIMER),1)
 DEFINES += -D_PR_NO_CLOCK_TIMER
 endif
 
 ifeq ($(USE_PTHREADS), 1)
@@ -102,118 +98,16 @@ endif
 ifeq ($(PTHREADS_USER), 1)
 DEFINES += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM
 endif
 
 ifeq ($(USE_IPV6),1)
 DEFINES += -D_PR_INET6
 endif
 
-else # ! USE_AUTOCONF
-
-ifndef NSPR_MY_CONFIG_MK
-NSPR_MY_CONFIG_MK = $(MOD_DEPTH)/config/my_config.mk
-endif
-
-#
-# The variable definitions in this file are used to
-# override variable values set by NSPR's build system.
-# This file, if present, is included at the end of config.mk.
-#
-# For example:
-#
-# DIST=/usr/local/nspr
-#
-ifndef NSPR_MY_OVERRIDES_MK
-NSPR_MY_OVERRIDES_MK = $(MOD_DEPTH)/config/my_overrides.mk
-endif
-
--include $(NSPR_MY_CONFIG_MK)
-
-include $(MOD_DEPTH)/config/module.df
-
-include $(MOD_DEPTH)/config/arch.mk
-
-ifndef NSDEPTH
-NSDEPTH = $(MOD_DEPTH)/..
-endif
-
-#
-# Default command macros; can be overridden in <arch>.mk.
-#
-# XXX FIXME: I removed CCF and LINKEXE.
-AS		= $(CC)
-ASFLAGS		= $(CFLAGS)
-PURIFY		= purify $(PURIFYOPTIONS)
-LINK_DLL	= $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS)
-NFSPWD		= $(MOD_DEPTH)/config/nfspwd
-
-CFLAGS		= $(CC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
-		  $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
-CCCFLAGS	= $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
-		  $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
-# For purify
-NOMD_CFLAGS	= $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
-		  $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
-
-include $(MOD_DEPTH)/config/$(OS_TARGET).mk
-
-# Figure out where the binary code lives.
-BUILD		= $(OBJDIR_NAME)
-OBJDIR		= $(OBJDIR_NAME)
-DIST		= $(NSDEPTH)/dist/$(OBJDIR_NAME)
-ifeq ($(MOZ_BITS),16)
-MOZ_INCL	= $(NSDEPTH)/dist/public/win16
-MOZ_DIST	= $(NSDEPTH)/dist/WIN16D_D.OBJ
-endif
-
-# if not using autoconf, set these values accordingly
-prefix		= $(DIST)
-exec_prefix	= $(prefix)
-bindir		= $(prefix)/bin
-includedir	= $(prefix)/include
-libdir		= $(prefix)/lib
-
-VPATH		= $(OBJDIR)
-DEPENDENCIES	= $(OBJDIR)/.md
-
-ifdef BUILD_DEBUG_GC
-DEFINES		+= -DDEBUG_GC
-endif
-
-GARBAGE		+= $(DEPENDENCIES) core $(wildcard core.[0-9]*)
-
-####################################################################
-#
-# The NSPR-specific configuration
-#
-####################################################################
-
-OS_CFLAGS += -DFORCE_PR_LOG
-
-ifeq ($(_PR_NO_CLOCK_TIMER),1)
-OS_CFLAGS += -D_PR_NO_CLOCK_TIMER
-endif
-
-ifeq ($(USE_PTHREADS), 1)
-OS_CFLAGS += -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
-endif
-
-ifeq ($(PTHREADS_USER), 1)
-OS_CFLAGS += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM
-endif
-
-ifeq ($(USE_IPV6),1)
-OS_CFLAGS += -D_PR_INET6
-endif
-
-ifdef GC_LEAK_DETECTOR
-OS_CFLAGS += -DGC_LEAK_DETECTOR
-endif
-
 ####################################################################
 #
 # Configuration for the release process
 #
 ####################################################################
 
 MDIST = /m/dist
 ifeq ($(OS_ARCH),WINNT)
@@ -224,11 +118,22 @@ endif
 # RELEASE_DIR is ns/dist/<module name>
 
 RELEASE_DIR = $(NSDEPTH)/dist/release/$(MOD_NAME)
 
 RELEASE_INCLUDE_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/include
 RELEASE_BIN_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/bin
 RELEASE_LIB_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/lib
 
--include $(NSPR_MY_OVERRIDES_MK)
+#
+# The variable definitions in this file are used to
+# override variable values set by NSPR's build system.
+# This file, if present, is included at the end of config.mk.
+#
+# For example:
+#
+# DIST=/usr/local/nspr
+#
+ifndef NSPR_MY_OVERRIDES_MK
+NSPR_MY_OVERRIDES_MK = $(MOD_DEPTH)/config/my_overrides.mk
+endif
 
-endif # USE_AUTOCONF
+-include $(NSPR_MY_OVERRIDES_MK)
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -84,17 +84,17 @@ endif
 
 ifdef LIBRARY_NAME
 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
 
 #
 # Win95, Win16, and OS/2 require library names conforming to the 8.3 rule.
 # other platforms do not.
 #
-ifeq (,$(filter-out WIN95 WIN16 OS2,$(OS_TARGET)))
+ifeq (,$(filter-out WIN95 OS2,$(OS_TARGET)))
 LIBRARY		= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
 SHARED_LIBRARY	= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
 IMPORT_LIBRARY	= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
 else
 LIBRARY		= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
 SHARED_LIBRARY	= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
 IMPORT_LIBRARY	= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
 endif
@@ -127,35 +127,19 @@ endif
 # of assembly language source files).
 #
 
 ifndef OBJS
 OBJS		= $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \
 		  $(addprefix $(OBJDIR)/,$(ASFILES:.s=.$(OBJ_SUFFIX)))
 endif
 
-ifeq ($(OS_TARGET), WIN16)
-	comma := ,
-	empty :=
-	space := $(empty) $(empty)
-	W16OBJS = $(subst $(space),$(comma)$(space),$(strip $(OBJS)))
-	W16TEMP =$(OS_LIBS) $(EXTRA_LIBS)
-    ifeq ($(strip $(W16TEMP)),)
-		W16LIBS =
-    else
-		W16LIBS = library $(subst $(space),$(comma)$(space),$(strip $(W16TEMP)))
-    endif
-	W16DEF = $(notdir $(basename $(SHARED_LIBRARY))).DEF
-endif
-
 ifeq ($(OS_ARCH), WINNT)
-ifneq ($(OS_TARGET), WIN16)
 OBJS += $(RES)
 endif
-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
@@ -276,29 +260,20 @@ ifdef BUILD_OPT
 endif
 
 $(LIBRARY): $(OBJS)
 	@$(MAKE_OBJDIR)
 	rm -f $@
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 	$(AR) $(subst /,\\,$(OBJS)) $(AR_FLAGS)
 else
-ifdef USE_AUTOCONF
 	$(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS)
-else
-	$(AR) $(OBJS) $(AR_EXTRA_ARGS)
-endif # USE_AUTOCONF
 endif
 	$(RANLIB) $@
 
-ifeq ($(OS_TARGET), WIN16)
-$(IMPORT_LIBRARY): $(SHARED_LIBRARY)
-	wlib $(OS_LIB_FLAGS) $@ +$(SHARED_LIBRARY)
-endif
-
 ifeq ($(OS_TARGET), OS2)
 $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
 	$(IMPLIB) $@ $(SHARED_LIBRARY).def
 endif
     
 $(SHARED_LIBRARY): $(OBJS)
 	@$(MAKE_OBJDIR)
 	rm -f $@
@@ -307,35 +282,17 @@ ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
 	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 ($(OS_TARGET), WIN16)
-	echo system windows dll initinstance >w16link
-	echo option map >>w16link
-	echo option oneautodata >>w16link
-	echo option heapsize=32K >>w16link
-	echo option $(OS_DLL_OPTION) >>w16link
-	echo debug $(DEBUGTYPE) all >>w16link
-	echo name $@ >>w16link
-	echo file >>w16link
-	echo $(W16OBJS) >>w16link
-	echo $(W16IMPORTS) >>w16link
-	echo $(W16LIBS) >>w16link
-	echo $(W16_EXPORTS) >>w16link
-	echo libfile libentry >>w16link
-	$(LINK) @w16link.
-	rm w16link
-else	# WIN16
-	$(LINK_DLL) -MAP $(DLLBASE) $(OS_LIBS) $(EXTRA_LIBS) $(OBJS)
-endif # 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"
@@ -345,21 +302,17 @@ else	# OS2
 ifeq ($(OS_TARGET), OpenVMS)
 	@if test ! -f $(OBJDIR)/VMSuni.opt; then \
 	    echo "Creating universal symbol option file $(OBJDIR)/VMSuni.opt";\
 	    create_opt_uni $(OBJS); \
 	fi
 	$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OBJDIR)/VMSuni.opt
 	@echo "`translate $@`" > $(@:.$(DLL_SUFFIX)=.vms)
 else	# OpenVMS
-ifdef USE_AUTOCONF
 	$(MKSHLIB) $(OBJS) $(EXTRA_LIBS)
-else
-	$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
-endif   # USE_AUTOCONF
 endif	# OpenVMS
 endif   # OS2
 endif	# WINNT
 endif	# AIX 4.1
 ifdef BUILD_OPT
 	$(STRIP) $@
 endif
 
@@ -389,24 +342,17 @@ 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)
-ifeq ($(OS_TARGET), WIN16)
-#	$(MOD_DEPTH)/config/w16opt $(WCCFLAGS3)
-	echo $(WCCFLAGS3) >w16wccf
-	$(CC) -zq -fo$(OBJDIR)\\$*.$(OBJ_SUFFIX)  @w16wccf $*.c
-	rm w16wccf
-else
 	$(CC) -Fo$@ -c $(CFLAGS) $<
-endif
 else
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 	$(CC) -Fo$@ -c $(CFLAGS) $<
 else
 	$(CC) -o $@ -c $(CFLAGS) $<
 endif
 endif
 
--- a/configure
+++ b/configure
@@ -685,16 +685,18 @@ USE_MDUPDATE=
 _OPTIMIZE_FLAGS=-O
 _DEBUG_FLAGS=-g
 MOZ_DEBUG=1
 MOZ_OPTIMIZE=
 OBJDIR=.
 OBJDIR_NAME=.
 NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
 NOSUCHFILE=/no-such-file
+LIBNSPR='-L$(libdir) -lnspr$(MOD_VERSION)'
+LIBPLC='-L$(libdir) -lplc$(MOD_VERSION)'
 
 RESOLVE_LINK_SYMBOLS=
 
 CFLAGS="${CFLAGS=}"
 CXXFLAGS="${CXXFLAGS=}"
 LDFLAGS="${LDFLAGS=}"
 HOST_CFLAGS="${HOST_CFLAGS=}"
 HOST_LDFLAGS="${HOST_LDFLAGS=}"
@@ -816,17 +818,17 @@ if test "${enable_mdupdate+set}" = set; 
       fi 
 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:825: checking for $ac_word" >&5
+echo "configure:827: 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.
   ;;
   ?:/*)			 
@@ -881,24 +883,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:890: checking for $host compiler" >&5
+echo "configure:892: 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:897: checking for $ac_word" >&5
+echo "configure:899: 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"
@@ -935,26 +937,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:944: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
+echo "configure:946: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
     cat > conftest.$ac_ext <<EOF
-#line 946 "configure"
+#line 948 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:955: \"$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
@@ -965,17 +967,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:974: checking for $ac_word" >&5
+echo "configure:976: 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"
@@ -1000,17 +1002,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:1009: checking for $ac_word" >&5
+echo "configure:1011: 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"
@@ -1030,17 +1032,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:1039: checking for $ac_word" >&5
+echo "configure:1041: 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
@@ -1081,17 +1083,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:1090: checking for $ac_word" >&5
+echo "configure:1092: 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"
@@ -1113,33 +1115,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:1122: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1124: 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 1133 "configure"
+#line 1135 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1140: \"$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
@@ -1155,31 +1157,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:1164: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1166: 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:1169: checking whether we are using GNU C" >&5
+echo "configure:1171: 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:1178: \"$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:1180: \"$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
 
@@ -1188,17 +1190,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:1197: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1199: 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
@@ -1225,17 +1227,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:1234: checking for $ac_word" >&5
+echo "configure:1236: 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"
@@ -1262,17 +1264,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:1271: checking for $ac_word" >&5
+echo "configure:1273: 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"
@@ -1294,33 +1296,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:1303: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:1305: 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 1314 "configure"
+#line 1316 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:1319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1321: \"$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
@@ -1336,31 +1338,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:1345: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1347: 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:1350: checking whether we are using GNU C++" >&5
+echo "configure:1352: 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:1359: \"$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:1361: \"$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
 
@@ -1369,17 +1371,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:1378: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1380: 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
@@ -1406,17 +1408,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:1415: checking for $ac_word" >&5
+echo "configure:1417: 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"
@@ -1443,17 +1445,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:1452: checking for $ac_word" >&5
+echo "configure:1454: 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"
@@ -1480,17 +1482,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:1489: checking for $ac_word" >&5
+echo "configure:1491: 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"
@@ -1517,17 +1519,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:1526: checking for $ac_word" >&5
+echo "configure:1528: 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"
@@ -1554,17 +1556,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:1563: checking for $ac_word" >&5
+echo "configure:1565: 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"
@@ -1591,17 +1593,17 @@ 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:1600: checking for $ac_word" >&5
+echo "configure:1602: 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"
@@ -1628,17 +1630,17 @@ 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:1637: checking for $ac_word" >&5
+echo "configure:1639: 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"
@@ -1666,17 +1668,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:1675: checking for $ac_word" >&5
+echo "configure:1677: 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"
@@ -1698,33 +1700,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:1707: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:1709: 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 1718 "configure"
+#line 1720 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:1723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1725: \"$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
@@ -1740,31 +1742,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:1749: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1751: 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:1754: checking whether we are using GNU C++" >&5
+echo "configure:1756: 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:1763: \"$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:1765: \"$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
 
@@ -1773,17 +1775,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:1782: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1784: 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
@@ -1810,17 +1812,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:1819: checking for $ac_word" >&5
+echo "configure:1821: 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"
@@ -1840,17 +1842,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:1849: checking for $ac_word" >&5
+echo "configure:1851: 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
@@ -1891,17 +1893,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:1900: checking for $ac_word" >&5
+echo "configure:1902: 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"
@@ -1923,33 +1925,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:1932: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1934: 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 1943 "configure"
+#line 1945 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1950: \"$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
@@ -1965,31 +1967,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:1974: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1976: 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:1979: checking whether we are using GNU C" >&5
+echo "configure:1981: 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:1988: \"$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:1990: \"$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
 
@@ -1998,17 +2000,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:2007: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2009: 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
@@ -2033,17 +2035,17 @@ else
     CFLAGS=
   fi
 fi
 
     fi
     # 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:2042: checking for $ac_word" >&5
+echo "configure:2044: 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"
@@ -2065,17 +2067,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:2074: checking for $ac_word" >&5
+echo "configure:2076: 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.
   ;;
   ?:/*)			 
@@ -2106,17 +2108,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:2115: checking for $ac_word" >&5
+echo "configure:2117: 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.
   ;;
   ?:/*)			 
@@ -2147,17 +2149,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:2156: checking for $ac_word" >&5
+echo "configure:2158: 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.
   ;;
   ?:/*)			 
@@ -2188,17 +2190,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:2197: checking for $ac_word" >&5
+echo "configure:2199: 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.
   ;;
   ?:/*)			 
@@ -2229,17 +2231,17 @@ 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:2238: checking for $ac_word" >&5
+echo "configure:2240: 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.
   ;;
   ?:/*)			 
@@ -2270,17 +2272,17 @@ 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:2279: checking for $ac_word" >&5
+echo "configure:2281: 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.
   ;;
   ?:/*)			 
@@ -2336,17 +2338,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:2345: checking for $ac_word" >&5
+echo "configure:2347: 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.
   ;;
   ?:/*)			 
@@ -2556,17 +2558,16 @@ EOF
 #define AIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define SYSV 1
 EOF
 
     DSO_LDOPTS='-brtl -bM:SRE -bnoentry -bexpall'
-    OS_LIBS="-lc_r $OS_LIBS"
     case "${target_os}" in
     aix3.2*)
         USE_NSPR_THREADS=1
         cat >> confdefs.h <<\EOF
 #define _PR_LOCAL_THREADS_ONLY 1
 EOF
 
         cat >> confdefs.h <<\EOF
@@ -2600,16 +2601,17 @@ EOF
         cat >> confdefs.h <<\EOF
 #define AIX4_1 1
 EOF
 
         MKSHLIB=
         DSO_LDOPTS=
         USE_PTHREADS=1
         AIX_LINK_OPTS='-bnso -berok'
+        LIBNSPR='-L$(libdir) -lnspr$(MOD_VERSION)_shr'
         ;;
     aix4.3*)
         cat >> confdefs.h <<\EOF
 #define AIX_HAVE_ATOMIC_OP_H 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define AIX_TIMERS 1
@@ -2921,16 +2923,17 @@ EOF
 
     cat >> confdefs.h <<\EOF
 #define hpux 1
 EOF
 
     DLL_SUFFIX=sl
     DSO_LDOPTS='-b +h $(notdir $@)'
     PR_MD_CSRCS=hpux.c
+    PR_MD_ASFILES=os_HPUX.s
     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"
@@ -3278,16 +3281,17 @@ EOF
 #define XP_PC 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define WIN32 1
 EOF
 
     PR_MD_ARCH_DIR=windows
+    RESOLVE_LINK_SYMBOLS=1
 
     if test -n "$GNU_CC"; then
         cat >> confdefs.h <<\EOF
 #define NONAMELESSUNION 1
 EOF
 
         MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@'
     else
@@ -3313,48 +3317,55 @@ EOF
             OPTIMIZER=-O2
             DLLFLAGS='-OUT:"$@"'
             OBJDIR_TAG=_OPT
 
             if test -n "$MOZ_PROFILE"; then
                 OPTIMIZER="$OPTIMIZER -Z7"
                 DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV"
                 LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
-    fi
+            fi
         else
             if test -n "$USE_DEBUG_RTL"; then
                 CFLAGS="$CFLAGS -MDd"
             else
                 CFLAGS="$CFLAGS -MD"
             fi
             OPTIMIZER="-Od -Z7"
             DLLFLAGS='-DEBUG -DEBUGTYPE:CV -OUT:"$@"'
             if test -n "$GLOWCODE"; then
                 DLLFLAGS='-DEBUG -DEBUGTYPE:both -INCLUDE:_GlowCode -OUT:"$@"'
+                DLL_LIBS='$(GLOWDIR)/glowcode.lib'
             fi
             OBJDIR_TAG=_DBG
             LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
             if test -n "$PROFILE"; then
                 LDFLAGS="$LDFLAGS -PROFILE -MAP"
                 DLLFLAGS="$DLLFLAGS -PROFILE -MAP"
             fi
         fi
-    fi
+        
+        if test "$OS_TARGET" = "WINNT"; then
+            CFLAGS="$CFLAGS -GT"
+            LIBNSPR='$(libdir)/libnspr$(MOD_VERSION).$(LIB_SUFFIX)'
+            LIBPLC='$(libdir)/libplc$(MOD_VERSION).$(LIB_SUFFIX)'
+        else
+            LIBNSPR='$(libdir)/nspr$(MOD_VERSION).$(LIB_SUFFIX)'
+            LIBPLC='$(libdir)/plc$(MOD_VERSION).$(LIB_SUFFIX)'
+        fi
+    fi # GNU_CC
 
     if test -n "$USE_STATIC_TLS"; then
         cat >> confdefs.h <<\EOF
 #define _PR_USE_STATIC_TLS 1
 EOF
 
     fi
 
     if test "$OS_TARGET" = "WINNT"; then
-        if test -z "$GNU_CC"; then
-            CFLAGS="$CFLAGS -GT"
-        fi
         if test "$CPU_ARCH" = "x86"; then
             CFLAGS="$CFLAGS -G5"
         fi
         cat >> confdefs.h <<\EOF
 #define WINNT 1
 EOF
 
     else
@@ -3462,16 +3473,18 @@ EOF
     if test -z "$GNU_CC"; then
         CFLAGS="$CFLAGS -Hnocopyr"
         CXXFLAGS="$CXXFLAGS -Hnocopyr"
     else
         CFLAGS="$CFLAGS -fPIC -Wall -pipe"
         CXXFLAGS="$CXXFLAGS -fPIC -Wall -pipe"
         DSO_LDOPTS=-G
     fi
+    MDCPUCFG_H=_ncr.cfg
+    PR_MD_CSRCS=ncr.c
     ;;
 
 mips-nec-sysv*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -3492,16 +3505,18 @@ EOF
 
     USE_NSPR_THREADS=1
     if test -z "$GNU_CC"; then
         CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
         CXX=g++
     fi
     OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
     DSO_LDOPTS=-G
+    MDCPUCFG_H=_nec.cfg
+    PR_MD_CSRCS=nec.c
     ;;
 
 *-netbsd*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -3526,16 +3541,18 @@ EOF
     fi
     CFLAGS="$CFLAGS -ansi -Wall -pipe"
     CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe"
     DSO_CFLAGS='-fPIC -DPIC'
     DSO_LDOPTS='-x -shared'
     if test "$LIBRUNPATH"; then
         DSO_LDOPTS="$DSO_LDOPTS -R$(LIBRUNPATH)"
     fi
+    MDCPUCFG_H=_netbsd.cfg
+    PR_MD_CSRCS=netbsd.c
     ;;
 
 mips-sony-newsos*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -3561,16 +3578,18 @@ EOF
     cat >> confdefs.h <<\EOF
 #define HAVE_SVID_GETTOD 1
 EOF
 
     USE_NSPR_THREADS=1
     CFLAGS="$CFLAGS -Xa -fullwarn"
     CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
     DSO_LDOPTS=-G
+    MDCPUCFG_H=_sony.cfg
+    PR_MD_CSRCS=sony.c
     ;;
 
 *-nextstep*|*-openstep*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -3584,16 +3603,18 @@ EOF
     cat >> confdefs.h <<\EOF
 #define _POSIX_SOURCE 1
 EOF
 
     CFLAGS="$CFLAGS -Wall -fno-common -pipe -traditional-cpp -posix"
     CXXFLAGS="$CXXFLAGS -Wall -fno-common -pipe -traditional-cpp -posix"
     USE_NSPR_THREADS=1
     DLL_SUFFIX=dylib
+    MDCPUCFG_H=_nextstep.cfg
+    PR_MD_CSRCS=nextstep.c
     ;;
 
 
 *-nto*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
@@ -3717,32 +3738,36 @@ EOF
 EOF
 
         cat >> confdefs.h <<\EOF
 #define OSF1_HAVE_MACHINE_BUILTINS_H 1
 EOF
 
     fi
     DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
+    MDCPUCFG_H=_osf1.cfg
+    PR_MD_CSRCS=osf1.c
     ;;
 
 *-qnx*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define QNX 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define _PR_NEED_H_ERRNO 1
 EOF
 
     USE_NSPR_THREADS=1
+    MDCPUCFG_H=_qnx.cfg
+    PR_MD_CSRCS=qnx.c
     ;;
 
 *-rhapsody*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -3767,16 +3792,18 @@ EOF
 EOF
 
         CPU_ARCH=ppc
     fi
     DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load'
     MKSHLIB='$(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS) -o $@'
     DLL_SUFFIX=dylib
     USE_PTHREADS=1
+    MDCPUCFG_H=_rhapsody.cfg
+    PR_MD_CSRCS=rhapsody.c
     ;;
 
 *-*-sco*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -3799,16 +3826,18 @@ EOF
 #define _PR_NEED_H_ERRNO 1
 EOF
 
     CC='cc -b elf -KPIC'
     CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
     USE_NSPR_THREADS=1
     CPU_ARCH=x86
     DSO_LDOPTS='-b elf -G'
+    MDCPUCFG_H=_scoos.cfg
+    PR_MD_SRCS=scoos.c
     ;;
 
 *-sinix*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -3859,16 +3888,21 @@ EOF
         cat >> confdefs.h <<\EOF
 #define IP_MULTICAST 1
 EOF
 
     fi
 
     OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
     USE_NSPR_THREADS=1
+    MDCPUCFG_H=_reliantunix.cfg
+    PR_MD_CSRCS=reliantunix.c
+    if test "${OS_ARCH}" = "mips"; then
+        PR_MD_ASFILES=os_ReliantUNIX.s
+    fi
     ;;
 
 *-sunos*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -3879,16 +3913,22 @@ EOF
     if test "$USE_MDUPDATE"; then
         CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
     fi
     CPU_ARCH=sparc
     DLL_SUFFIX=so.1.0
     DSO_LDOPTS=
     DSO_CFLAGS=-fPIC
     USE_NSPR_THREADS=1
+    if test "$OS_RELEASE" = "4.1.3_U1"; then
+        _OPTIMIZE_FLAGS=
+        OS_LIBS="$OS_LIBS -lm"
+    fi
+    MDCPUCFG_H=_sunos4.cfg
+    PR_MD_CSRCS=sunos4.c
     ;;
 
 *-solaris*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -4015,30 +4055,33 @@ EOF
     USE_NSPR_THREADS=1
     if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
         cat >> confdefs.h <<\EOF
 #define _PR_NO_LARGE_FILES 1
 EOF
 
         CC='$(NSDEPTH)/build/hcc cc'
         CXX='$(NSDEPTH)/build/hcpp CC'
+        MDCPUCFG_H=_unixware.cfg
     else
         cat >> confdefs.h <<\EOF
 #define _LARGEFILE64_SOURCE 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define _PR_HAVE_OFF64_T 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define _PR_HAVE_SOCKADDR_LEN 1
 EOF
 
+        MDCPUCFG_H=_unixware7.cfg
     fi
+    PR_MD_CSRCS=unixware.c
     DSO_LDOPTS=-G
     CPU_ARCH=x86
     ;;
 
 *-os2*)
     cat >> confdefs.h <<\EOF
 #define XP_OS2 1
 EOF
@@ -4132,16 +4175,18 @@ EOF
         _DEBUG_FLAGS=/Ti+ 
         if test -n "$MOZ_DEBUG"; then
           DLLFLAGS='/O:$@ /DLL /INC:_dllentry /MAP:$(@:.dll=.map) /nologo /DEBUG /NOE'
           EXEFLAGS='/OUT:$@ /PMTYPE:VIO /MAP:$(@:.exe=.map) /nologo /DEBUG /NOE'
         else
           DLLFLAGS='/O:$@ /DLL /INC:_dllentry /MAP:$(@:.dll=.map) /nologo'
           EXEFLAGS='/OUT:$@ /PMTYPE:VIO /MAP:$(@:.exe=.map) /nologo'
         fi
+        LIBNSPR='$(libdir)/nspr$(MOD_VERSION).$(LIB_SUFFIX)'
+        LIBPLC='$(libdir)/plc$(MOD_VERSION).$(LIB_SUFFIX)'
         ;;
     esac
 
     ;;
 
 *)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
@@ -4153,22 +4198,22 @@ esac
 
 if test "$enable_shared" = no; then
     MKSHLIB=
 fi
 
 if test -z "$SKIP_LIBRARY_CHECKS"; then
 
 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:4162: checking for dlopen" >&5
+echo "configure:4207: 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 4167 "configure"
+#line 4212 "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();
@@ -4181,17 +4226,17 @@ int main() {
 #if defined (__stub_dlopen) || defined (__stub___dlopen)
 choke me
 #else
 dlopen();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:4190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4235: \"$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
@@ -4200,36 +4245,36 @@ 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:4209: checking for dlopen in -ldl" >&5
+echo "configure:4254: 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 4217 "configure"
+#line 4262 "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:4228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4273: \"$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
@@ -4246,72 +4291,72 @@ fi
 
 
 fi
 
 
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:4255: checking how to run the C preprocessor" >&5
+echo "configure:4300: 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 4270 "configure"
+#line 4315 "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:4276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4321: \"$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 4287 "configure"
+#line 4332 "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:4293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4338: \"$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 4304 "configure"
+#line 4349 "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:4310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4355: \"$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*
@@ -4327,23 +4372,23 @@ fi
   CPP="$ac_cv_prog_CPP"
 else
   ac_cv_prog_CPP="$CPP"
 fi
 echo "$ac_t""$CPP" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:4336: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:4381: 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 4342 "configure"
+#line 4387 "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
@@ -4351,17 +4396,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 4360 "configure"
+#line 4405 "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
@@ -4375,22 +4420,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:4384: checking for $ac_func" >&5
+echo "configure:4429: 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 4389 "configure"
+#line 4434 "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();
@@ -4403,17 +4448,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:4412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4457: \"$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
@@ -4434,17 +4479,17 @@ done
 
 
 
 
 
 
 
 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:4443: checking for pthread_create in -lpthreads" >&5
+echo "configure:4488: checking for pthread_create in -lpthreads" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { int a = 1;  } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -4456,17 +4501,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:4465: checking for pthread_create in -lpthread" >&5
+echo "configure:4510: checking for pthread_create in -lpthread" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { int a = 1;  } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -4478,17 +4523,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:4487: checking for pthread_create in -lc_r" >&5
+echo "configure:4532: checking for pthread_create in -lc_r" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { int a = 1;  } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -4500,17 +4545,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
-echo "configure:4509: checking for pthread_create in -lc" >&5
+echo "configure:4554: checking for pthread_create in -lc" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { int a = 1;  } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -4650,33 +4695,33 @@ 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:4659: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:4704: 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"
 	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:4675: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:4720: 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
@@ -4729,31 +4774,40 @@ else
 #define _PR_LOCAL_THREADS_ONLY 1
 EOF
 
         fi
     fi
 fi
 
 case "$target" in
-*-aix4.1*)
-    if test -z "$USE_PTHREADS"; then
-        cat >> confdefs.h <<\EOF
-#define AIX_RENAME_SELECT 1
-EOF
-
+*-aix*)
+    if test -n "$USE_NSPR_THREADS"; then
+        OS_LIBS="$OS_LIBS -lc"
+    else
+        OS_LIBS="$OS_LIBS -lc_r"
     fi
-    ;;
-*-aix4.23*)
-    if test -z "$USE_NSPR_THREADS"; then
-        cat >> confdefs.h <<\EOF
+    case "$target_os" in
+    aix4.1*)
+        if test -z "$USE_PTHREADS"; then
+            cat >> confdefs.h <<\EOF
+#define AIX_RENAME_SELECT 1
+EOF
+
+        fi
+        ;;
+    aix4.23*)
+        if test -z "$USE_NSPR_THREADS"; then
+            cat >> confdefs.h <<\EOF
 #define HAVE_POINTER_LOCALTIME_R 1
 EOF
 
-    fi
+        fi
+        ;;
+    esac
     ;;
 *-bsdi*)
     if test -n "$USE_PTHREADS"; then
         cat >> confdefs.h <<\EOF
 #define _PR_NEED_PTHREAD_INIT 1
 EOF
 
     fi
@@ -4919,16 +4973,19 @@ fi
 
 
 
 
 
 
 
 
+
+
+
 MAKEFILES="
 Makefile 
 config/Makefile
 config/autoconf.mk
 config/nsprincl.mk
 config/nsprincl.sh
 lib/Makefile 
 lib/ds/Makefile 
@@ -5148,16 +5205,18 @@ s%@USE_IPV6@%$USE_IPV6%g
 s%@USE_N32@%$USE_N32%g
 s%@USE_64@%$USE_64%g
 s%@GC_LEAK_DETECTOR@%$GC_LEAK_DETECTOR%g
 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%@NSPR_VERSION@%$NSPR_VERSION%g
 s%@NSPR_MODNAME@%$NSPR_MODNAME%g
 s%@MDCPUCFG_H@%$MDCPUCFG_H%g
 s%@MOZ_WIN32_TARGET@%$MOZ_WIN32_TARGET%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
--- a/configure.in
+++ b/configure.in
@@ -47,16 +47,18 @@ USE_MDUPDATE=
 _OPTIMIZE_FLAGS=-O
 _DEBUG_FLAGS=-g
 MOZ_DEBUG=1
 MOZ_OPTIMIZE=
 OBJDIR=.
 OBJDIR_NAME=.
 NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
 NOSUCHFILE=/no-such-file
+LIBNSPR='-L$(libdir) -lnspr$(MOD_VERSION)'
+LIBPLC='-L$(libdir) -lplc$(MOD_VERSION)'
 
 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 =
@@ -476,17 +478,16 @@ dnl Override of system specific target o
 dnl ========================================================
 case "$target" in
 
 *-aix*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(AIX)
     AC_DEFINE(SYSV)
     DSO_LDOPTS='-brtl -bM:SRE -bnoentry -bexpall'
-    OS_LIBS="-lc_r $OS_LIBS"
     case "${target_os}" in
     aix3.2*)
         USE_NSPR_THREADS=1
         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
         AC_DEFINE(AIX_RENAME_SELECT)
         AC_DEFINE(_PR_NO_LARGE_FILES)
         AIX_LINK_OPTS='-bnso -berok'
         PR_MD_ASFILES=os_AIX.s
@@ -496,16 +497,17 @@ case "$target" in
         AC_DEFINE(AIX_HAVE_ATOMIC_OP_H)
         AC_DEFINE(AIX_TIMERS)
         AC_DEFINE(_PR_NO_LARGE_FILES)
         AC_DEFINE(AIX4_1)
         MKSHLIB=
         DSO_LDOPTS=
         USE_PTHREADS=1
         AIX_LINK_OPTS='-bnso -berok'
+        LIBNSPR='-L$(libdir) -lnspr$(MOD_VERSION)_shr'
         ;;
     aix4.3*)
         AC_DEFINE(AIX_HAVE_ATOMIC_OP_H)
         AC_DEFINE(AIX_TIMERS)
         AC_DEFINE(_PR_HAVE_OFF64_T)
         AC_DEFINE(AIX4_3)
         AC_DEFINE(HAVE_SOCKLEN_T)
         USE_IPV6=1
@@ -667,16 +669,17 @@ case "$target" in
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(HPUX)
     AC_DEFINE(_HPUX_SOURCE)
     AC_DEFINE(hppa)
     AC_DEFINE(hpux)
     DLL_SUFFIX=sl
     DSO_LDOPTS='-b +h $(notdir $@)'
     PR_MD_CSRCS=hpux.c
+    PR_MD_ASFILES=os_HPUX.s
     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"
@@ -910,16 +913,17 @@ case "$target" in
         ;;
     esac    
     ;;
 
 *-mingw*|*-cygwin*|*-msvc*)
     AC_DEFINE(XP_PC)
     AC_DEFINE(WIN32)
     PR_MD_ARCH_DIR=windows
+    RESOLVE_LINK_SYMBOLS=1
 
     if test -n "$GNU_CC"; then
         AC_DEFINE(NONAMELESSUNION)
         MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@'
     else
         CC=cl
         CXX=cl
         LD=link
@@ -942,45 +946,52 @@ case "$target" in
             OPTIMIZER=-O2
             DLLFLAGS='-OUT:"$@"'
             OBJDIR_TAG=_OPT
 
             if test -n "$MOZ_PROFILE"; then
                 OPTIMIZER="$OPTIMIZER -Z7"
                 DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV"
                 LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
-    fi
+            fi
         else
             if test -n "$USE_DEBUG_RTL"; then
                 CFLAGS="$CFLAGS -MDd"
             else
                 CFLAGS="$CFLAGS -MD"
             fi
             OPTIMIZER="-Od -Z7"
             DLLFLAGS='-DEBUG -DEBUGTYPE:CV -OUT:"$@"'
             if test -n "$GLOWCODE"; then
                 DLLFLAGS='-DEBUG -DEBUGTYPE:both -INCLUDE:_GlowCode -OUT:"$@"'
+                DLL_LIBS='$(GLOWDIR)/glowcode.lib'
             fi
             OBJDIR_TAG=_DBG
             LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
             if test -n "$PROFILE"; then
                 LDFLAGS="$LDFLAGS -PROFILE -MAP"
                 DLLFLAGS="$DLLFLAGS -PROFILE -MAP"
             fi
         fi
-    fi
+        
+        if test "$OS_TARGET" = "WINNT"; then
+            CFLAGS="$CFLAGS -GT"
+            LIBNSPR='$(libdir)/libnspr$(MOD_VERSION).$(LIB_SUFFIX)'
+            LIBPLC='$(libdir)/libplc$(MOD_VERSION).$(LIB_SUFFIX)'
+        else
+            LIBNSPR='$(libdir)/nspr$(MOD_VERSION).$(LIB_SUFFIX)'
+            LIBPLC='$(libdir)/plc$(MOD_VERSION).$(LIB_SUFFIX)'
+        fi
+    fi # GNU_CC
 
     if test -n "$USE_STATIC_TLS"; then
         AC_DEFINE(_PR_USE_STATIC_TLS)
     fi
 
     if test "$OS_TARGET" = "WINNT"; then
-        if test -z "$GNU_CC"; then
-            CFLAGS="$CFLAGS -GT"
-        fi
         if test "$CPU_ARCH" = "x86"; then
             CFLAGS="$CFLAGS -G5"
         fi
         AC_DEFINE(WINNT)
     else
         AC_DEFINE(WIN95)
         AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
     fi
@@ -1049,31 +1060,35 @@ case "$target" in
     if test -z "$GNU_CC"; then
         CFLAGS="$CFLAGS -Hnocopyr"
         CXXFLAGS="$CXXFLAGS -Hnocopyr"
     else
         CFLAGS="$CFLAGS -fPIC -Wall -pipe"
         CXXFLAGS="$CXXFLAGS -fPIC -Wall -pipe"
         DSO_LDOPTS=-G
     fi
+    MDCPUCFG_H=_ncr.cfg
+    PR_MD_CSRCS=ncr.c
     ;;
 
 mips-nec-sysv*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(SVR4)
     AC_DEFINE(__SVR4)
     AC_DEFINE(NEC)
     AC_DEFINE(nec_ews)
     USE_NSPR_THREADS=1
     if test -z "$GNU_CC"; then
         CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
         CXX=g++
     fi
     OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
     DSO_LDOPTS=-G
+    MDCPUCFG_H=_nec.cfg
+    PR_MD_CSRCS=nec.c
     ;;
 
 *-netbsd*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(NETBSD)
     AC_DEFINE(HAVE_BSD_FLOCK)
     if test -z "$OBJECT_FMT"; then
         if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
@@ -1089,41 +1104,47 @@ mips-nec-sysv*)
     fi
     CFLAGS="$CFLAGS -ansi -Wall -pipe"
     CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe"
     DSO_CFLAGS='-fPIC -DPIC'
     DSO_LDOPTS='-x -shared'
     if test "$LIBRUNPATH"; then
         DSO_LDOPTS="$DSO_LDOPTS -R$(LIBRUNPATH)"
     fi
+    MDCPUCFG_H=_netbsd.cfg
+    PR_MD_CSRCS=netbsd.c
     ;;
 
 mips-sony-newsos*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(SONY)
     AC_DEFINE(SYSV)
     AC_DEFINE(SVR4)
     AC_DEFINE(__svr4)
     AC_DEFINE(__svr4__)
     AC_DEFINE(HAVE_SVID_GETTOD)
     USE_NSPR_THREADS=1
     CFLAGS="$CFLAGS -Xa -fullwarn"
     CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
     DSO_LDOPTS=-G
+    MDCPUCFG_H=_sony.cfg
+    PR_MD_CSRCS=sony.c
     ;;
 
 *-nextstep*|*-openstep*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(NEXTSTEP)
     AC_DEFINE(HAVE_BSD_FLOCK)
     AC_DEFINE(_POSIX_SOURCE)
     CFLAGS="$CFLAGS -Wall -fno-common -pipe -traditional-cpp -posix"
     CXXFLAGS="$CXXFLAGS -Wall -fno-common -pipe -traditional-cpp -posix"
     USE_NSPR_THREADS=1
     DLL_SUFFIX=dylib
+    MDCPUCFG_H=_nextstep.cfg
+    PR_MD_CSRCS=nextstep.c
     ;;
 
 
 *-nto*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(NTO)
     AC_DEFINE(_QNX_SOURCE)
     AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
@@ -1199,23 +1220,27 @@ mips-sony-newsos*)
 
     if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
         AC_DEFINE(HAVE_INT_LOCALTIME_R)
     else
         AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
         AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H)
     fi
     DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
+    MDCPUCFG_H=_osf1.cfg
+    PR_MD_CSRCS=osf1.c
     ;;
 
 *-qnx*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(QNX)
     AC_DEFINE(_PR_NEED_H_ERRNO)
     USE_NSPR_THREADS=1
+    MDCPUCFG_H=_qnx.cfg
+    PR_MD_CSRCS=qnx.c
     ;;
 
 *-rhapsody*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(RHAPSODY)
     AC_DEFINE(HAVE_BSD_FLOCK)
     CFLAGS="$CFLAGS -Wmost -fno-common -pipe"    
     if echo $OS_TEST | grep -c 86 2>/dev/null; then
@@ -1225,30 +1250,34 @@ mips-sony-newsos*)
     else
         AC_DEFINE(ppc)
         CPU_ARCH=ppc
     fi
     DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load'
     MKSHLIB='$(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS) -o $@'
     DLL_SUFFIX=dylib
     USE_PTHREADS=1
+    MDCPUCFG_H=_rhapsody.cfg
+    PR_MD_CSRCS=rhapsody.c
     ;;
 
 *-*-sco*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(SCO)
     AC_DEFINE(sco)
     AC_DEFINE(SYSV)
     AC_DEFINE(_SVID3)
     AC_DEFINE(_PR_NEED_H_ERRNO)
     CC='cc -b elf -KPIC'
     CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
     USE_NSPR_THREADS=1
     CPU_ARCH=x86
     DSO_LDOPTS='-b elf -G'
+    MDCPUCFG_H=_scoos.cfg
+    PR_MD_SRCS=scoos.c
     ;;
 
 *-sinix*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(SVR4)
     AC_DEFINE(SNI)
     AC_DEFINE(RELIANTUNIX)
     AC_DEFINE(sinix)
@@ -1275,30 +1304,41 @@ mips-sony-newsos*)
     DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
 
     if test "$OS_RELEASE" = "5.43"; then
         AC_DEFINE(IP_MULTICAST)
     fi
 
     OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
     USE_NSPR_THREADS=1
+    MDCPUCFG_H=_reliantunix.cfg
+    PR_MD_CSRCS=reliantunix.c
+    if test "${OS_ARCH}" = "mips"; then
+        PR_MD_ASFILES=os_ReliantUNIX.s
+    fi
     ;;
 
 *-sunos*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(SUNOS4)
     CFLAGS="$CFLAGS -Wall -Wno-format"
     if test "$USE_MDUPDATE"; then
         CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
     fi
     CPU_ARCH=sparc
     DLL_SUFFIX=so.1.0
     DSO_LDOPTS=
     DSO_CFLAGS=-fPIC
     USE_NSPR_THREADS=1
+    if test "$OS_RELEASE" = "4.1.3_U1"; then
+        _OPTIMIZE_FLAGS=
+        OS_LIBS="$OS_LIBS -lm"
+    fi
+    MDCPUCFG_H=_sunos4.cfg
+    PR_MD_CSRCS=sunos4.c
     ;;
 
 *-solaris*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(SVR4)
     AC_DEFINE(SYSV)
     AC_DEFINE(__svr4)
     AC_DEFINE(__svr4__)
@@ -1374,21 +1414,24 @@ mips-sony-newsos*)
     AC_DEFINE(UNIXWARE)
     AC_DEFINE(SVR4)
     AC_DEFINE(SYSV)
     USE_NSPR_THREADS=1
     if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
         AC_DEFINE(_PR_NO_LARGE_FILES)
         CC='$(NSDEPTH)/build/hcc cc'
         CXX='$(NSDEPTH)/build/hcpp CC'
+        MDCPUCFG_H=_unixware.cfg
     else
         AC_DEFINE(_LARGEFILE64_SOURCE)
         AC_DEFINE(_PR_HAVE_OFF64_T)
         AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
+        MDCPUCFG_H=_unixware7.cfg
     fi
+    PR_MD_CSRCS=unixware.c
     DSO_LDOPTS=-G
     CPU_ARCH=x86
     ;;
 
 *-os2*)
     AC_DEFINE(XP_OS2)
     AC_DEFINE(BSD_SELECT)
     AC_DEFINE(XP_PC)
@@ -1452,16 +1495,18 @@ mips-sony-newsos*)
         _DEBUG_FLAGS=/Ti+ 
         if test -n "$MOZ_DEBUG"; then
           DLLFLAGS='/O:$@ /DLL /INC:_dllentry /MAP:$(@:.dll=.map) /nologo /DEBUG /NOE'
           EXEFLAGS='/OUT:$@ /PMTYPE:VIO /MAP:$(@:.exe=.map) /nologo /DEBUG /NOE'
         else
           DLLFLAGS='/O:$@ /DLL /INC:_dllentry /MAP:$(@:.dll=.map) /nologo'
           EXEFLAGS='/OUT:$@ /PMTYPE:VIO /MAP:$(@:.exe=.map) /nologo'
         fi
+        LIBNSPR='$(libdir)/nspr$(MOD_VERSION).$(LIB_SUFFIX)'
+        LIBPLC='$(libdir)/plc$(MOD_VERSION).$(LIB_SUFFIX)'
         ;;
     esac
 
     ;;
 
 *)
     AC_DEFINE(XP_UNIX)
     ;;
@@ -1743,25 +1788,34 @@ else
         if test -n "$USE_NSPR_THREADS"; then
     	    AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
         fi
     fi
 fi
 dnl Special thread exceptions
 
 case "$target" in
-*-aix4.1*)
-    if test -z "$USE_PTHREADS"; then
-        AC_DEFINE(AIX_RENAME_SELECT)
+*-aix*)
+    if test -n "$USE_NSPR_THREADS"; then
+        OS_LIBS="$OS_LIBS -lc"
+    else
+        OS_LIBS="$OS_LIBS -lc_r"
     fi
-    ;;
-*-aix4.[23]*)
-    if test -z "$USE_NSPR_THREADS"; then
-        AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
-    fi
+    case "$target_os" in
+    aix4.1*)
+        if test -z "$USE_PTHREADS"; then
+            AC_DEFINE(AIX_RENAME_SELECT)
+        fi
+        ;;
+    aix4.[23]*)
+        if test -z "$USE_NSPR_THREADS"; then
+            AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
+        fi
+        ;;
+    esac
     ;;
 *-bsdi*)
     if test -n "$USE_PTHREADS"; then
         AC_DEFINE(_PR_NEED_PTHREAD_INIT)
     fi
     ;;
 *-hpux*)
     if test "$USE_PTHREADS"; then
@@ -1852,16 +1906,19 @@ AC_SUBST(USE_64)
 AC_SUBST(GC_LEAK_DETECTOR)
 
 AC_SUBST(USE_PTHREADS)
 AC_SUBST(USE_BTHREADS)
 AC_SUBST(USE_USER_PTHREADS)
 AC_SUBST(USE_NATIVE_THREADS)
 AC_SUBST(USE_NSPR_THREADS)
 
+AC_SUBST(LIBNSPR)
+AC_SUBST(LIBPLC)
+
 AC_SUBST(NSPR_VERSION)
 AC_SUBST(NSPR_MODNAME)
 AC_SUBST(MDCPUCFG_H)
 AC_SUBST(MOZ_WIN32_TARGET)
 AC_SUBST(PR_MD_CSRCS)
 AC_SUBST(PR_MD_ASFILES)
 AC_SUBST(PR_MD_ARCH_DIR)
 AC_SUBST(CPU_ARCH)
--- a/lib/ds/Makefile.in
+++ b/lib/ds/Makefile.in
@@ -21,25 +21,16 @@ MOD_DEPTH	= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-ifndef USE_AUTOCONF
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-endif #!USE_AUTOCONF
-
 INCLUDES = -I$(includedir) -I$(topsrcdir)/pr/include
 
 CSRCS = \
 	plarena.c \
 	plhash.c \
 	plvrsion.c \
 	$(NULL)
 
@@ -47,72 +38,26 @@ HEADERS = \
 	plarenas.h \
 	plarena.h \
 	plhash.h \
 	$(NULL)
 
 HEADERS := $(addprefix $(srcdir)/, $(HEADERS))
 
 ifeq ($(OS_ARCH), WINNT)
-ifeq ($(OS_TARGET), WIN16)
-# OS_CFLAGS = $(OS_EXE_CFLAGS)
-EXTRA_LIBS = $(libdir)/nspr$(MOD_VERSION).$(LIB_SUFFIX)
-else
 DLLBASE=/BASE:0x30000000
 RES=$(OBJDIR)/plds.res
 RESNAME=plds.rc
 OS_LIBS = user32.lib
-ifeq ($(OS_TARGET),WIN95)
-EXTRA_LIBS = $(libdir)/nspr$(MOD_VERSION).lib
-else
-EXTRA_LIBS = $(libdir)/libnspr$(MOD_VERSION).lib
-endif
-
-ifdef MOZ_DEBUG
-ifdef GLOWCODE
-EXTRA_LIBS += $(GLOWDIR)/glowcode.lib
-endif
-endif
-endif
-
-ifndef USE_AUTOCONF
-
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-EXTRA_LIBS = $(libdir)/nspr$(MOD_VERSION).$(LIB_SUFFIX)
+endif # WINNT
 
-else
-ifeq ($(OS_ARCH), AIX)
-ifeq ($(CLASSIC_NSPR),1)
-OS_LIBS += -lc
-else
-OS_LIBS += -lc_r
-endif
-endif
-ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
-EXTRA_LIBS = -L$(libdir) -lnspr$(MOD_VERSION)_shr
-else
-EXTRA_LIBS = -L$(libdir) -lnspr$(MOD_VERSION)
-endif
-endif
-endif
-
-# On NCR and SCOOS, we can't link with extra libraries when
-# we build a shared library.  If we do so, the linker doesn't
-# complain, but we would run into weird problems at run-time.
-# Therefore on these platforms, we link just the .o files.
-ifeq ($(OS_ARCH),NCR)
-EXTRA_LIBS =
-endif
-ifeq ($(OS_ARCH),SCOOS)
-EXTRA_LIBS =
-endif
-endif #!USE_AUTOCONF
+EXTRA_LIBS = $(LIBNSPR)
 
 ifdef RESOLVE_LINK_SYMBOLS
-EXTRA_LIBS := -L$(libdir) -lnspr$(MOD_VERSION) $(OS_LIBS)
+EXTRA_LIBS += $(OS_LIBS)
 endif
 
 LIBRARY_NAME	= plds
 LIBRARY_VERSION	= $(MOD_VERSION)
 
 RELEASE_HEADERS = $(HEADERS)
 RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
 RELEASE_LIBS	= $(TARGETS)
--- a/lib/libc/src/Makefile.in
+++ b/lib/libc/src/Makefile.in
@@ -21,25 +21,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-ifndef USE_AUTOCONF
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-endif #!USE_AUTOCONF
-
 INCLUDES = -I$(includedir)
 
 CSRCS =\
 	plvrsion.c  \
 	strlen.c  \
 	strcpy.c  \
 	strdup.c  \
 	strcat.c  \
@@ -55,70 +46,25 @@ CSRCS =\
 	$(NULL)
 
 LIBRARY_NAME	= plc
 LIBRARY_VERSION	= $(MOD_VERSION)
 
 RELEASE_LIBS = $(TARGETS)
 
 ifeq ($(OS_ARCH),WINNT)
-ifeq ($(OS_TARGET), WIN16)
-EXTRA_LIBS = $(libdir)/nspr$(MOD_VERSION).lib
-else
 DLLBASE=/BASE:0x30000000
 RES=$(OBJDIR)/plc.res
 RESNAME=plc.rc
-ifeq ($(OS_TARGET),WIN95)
-EXTRA_LIBS = $(libdir)/nspr$(MOD_VERSION).lib
-else
-EXTRA_LIBS = $(libdir)/libnspr$(MOD_VERSION).lib
-endif
-
-ifdef MOZ_DEBUG
-ifdef GLOWCODE
-EXTRA_LIBS += $(GLOWDIR)/glowcode.lib
-endif
-endif
-endif
-
-ifndef USE_AUTOCONF
-
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-EXTRA_LIBS = $(libdir)/nspr$(MOD_VERSION).$(LIB_SUFFIX)
+endif # WINNT
 
-else
-ifeq ($(OS_ARCH), AIX)
-ifeq ($(CLASSIC_NSPR),1)
-OS_LIBS += -lc
-else
-OS_LIBS += -lc_r
-endif
-endif
-ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
-EXTRA_LIBS = -L$(libdir) -lnspr$(MOD_VERSION)_shr
-else
-EXTRA_LIBS = -L$(libdir) -lnspr$(MOD_VERSION)
-endif
-endif
-endif
-
-# On NCR and SCOOS, we can't link with extra libraries when
-# we build a shared library.  If we do so, the linker doesn't
-# complain, but we would run into weird problems at run-time.
-# Therefore on these platforms, we link just the .o files.
-ifeq ($(OS_ARCH),NCR)
-EXTRA_LIBS =
-endif
-ifeq ($(OS_ARCH),SCOOS)
-EXTRA_LIBS =
-endif
-endif #!USE_AUTOCONF
+EXTRA_LIBS = $(LIBNSPR)
 
 ifdef RESOLVE_LINK_SYMBOLS
-EXTRA_LIBS := -L$(libdir) -lnspr$(MOD_VERSION) $(OS_LIBS)
+EXTRA_LIBS += $(OS_LIBS)
 endif
 
 GARBAGE += $(TINC)
 
 include $(topsrcdir)/config/rules.mk
 
 #
 # Version information generation (begin)
--- a/lib/msgc/src/Makefile.in
+++ b/lib/msgc/src/Makefile.in
@@ -21,90 +21,44 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 INCLUDES = -I$(includedir) -I../include
 
 CSRCS = prgcapi.c prmsgc.c
 
 ifeq ($(OS_ARCH),WINNT)
-ifeq ($(OS_TARGET),WIN16)
-CSRCS += win16gc.c
-else
 CSRCS += win32gc.c
-endif
 else
 ifeq ($(OS_ARCH),OS2)
 CSRCS += os2gc.c
 else
 CSRCS += unixgc.c
 endif
 endif
 
 NSPR_VERSION = $(MOD_VERSION)
 
+EXTRA_LIBS = $(LIBNSPR)
+
+ifdef RESOLVE_LINK_SYMBOLS
+EXTRA_LIBS += $(OS_LIBS)
+endif
+
 ifeq ($(OS_ARCH), WINNT)
-ifeq ($(OS_TARGET), WIN16)
-EXTRA_LIBS = $(libdir)/nspr$(NSPR_VERSION).lib
-else
 DLLBASE=/BASE:0x30000000
 #RES=$(OBJDIR)/ds.res
 #RESNAME=$(MOD_DEPTH)/pr/src/nspr.rc
 #OS_LIBS = user32.lib
-EXTRA_LIBS = $(libdir)/libnspr$(NSPR_VERSION).lib
-
-ifdef MOZ_DEBUG
-ifdef GLOWCODE
-EXTRA_LIBS += $(GLOWDIR)/glowcode.lib
-endif
-endif
-endif
-
-else
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-EXTRA_LIBS = $(libdir)/nspr$(NSPR_VERSION).$(LIB_SUFFIX)
-
-else
-ifeq ($(OS_ARCH), AIX)
-ifeq ($(CLASSIC_NSPR),1)
-OS_LIBS += -lc
-else
-OS_LIBS += -lc_r
-endif
-endif
-ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
-EXTRA_LIBS = -L$(libdir) -lnspr$(NSPR_VERSION)_shr
-else
-EXTRA_LIBS = -L$(libdir) -lnspr$(NSPR_VERSION)
-endif
-endif
-endif
-
-# On NCR and SCOOS, we can't link with extra libraries when
-# we build a shared library.  If we do so, the linker doesn't
-# complain, but we would run into weird problems at run-time.
-# Therefore on these platforms, we link just the .o files.
-ifeq ($(OS_ARCH),NCR)
-EXTRA_LIBS =
-endif
-ifeq ($(OS_ARCH),SCOOS)
-EXTRA_LIBS =
-endif
+endif # WINNT
 
 LIBRARY_NAME = msgc
 LIBRARY_VERSION = $(MOD_VERSION)
 
 RELEASE_LIBS = $(TARGETS)
 
 include $(topsrcdir)/config/rules.mk
 
--- a/lib/prstreams/Makefile.in
+++ b/lib/prstreams/Makefile.in
@@ -21,17 +21,16 @@ MOD_DEPTH	= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-ifndef USE_AUTOCONF
 # Disable optimization of the nspr on SunOS4.1.3
 ifeq ($(OS_ARCH),SunOS)
     ifeq ($(OS_RELEASE),4.1.3_U1)
         OPTIMIZER =
     else
         # The C++ compiler in Workshop 5.0 uses standard
         # iostreams as default.  -library=iostream will
         # allow Workshop 5.0 to work with classic iostreams.
@@ -48,55 +47,45 @@ ifeq ($(OS_ARCH), IRIX)
     ifneq ($(OS_RELEASE),5.3)
         CCC_ONLY_FLAGS += -exceptions
     endif
 endif
 
 ifeq ($(OS_ARCH), BeOS)
     CFLAGS += -frtti -fexceptions
 endif
-endif # !USE_AUTOCONF
 
 INCLUDES = -I$(includedir)
 
 HEADERS = $(wildcard $(srcdir)/*.h)
 
 CSRCS = \
 	plvrsion.c \
 	$(NULL)
 
 CXXSRCS = \
 	prstrms.cpp \
 	$(NULL)
 
 OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX)) $(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
 
-ifndef USE_AUTOCONF
+LIBRARY_NAME    = prstrms
+LIBRARY_VERSION = $(MOD_VERSION)
+
+RELEASE_HEADERS = $(HEADERS)
+RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
+RELEASE_LIBS    = $(TARGETS)
+
+include $(topsrcdir)/config/rules.mk
+
 ifeq ($(OS_ARCH), WINNT)
-    ifeq ($(OS_TARGET), WIN16)
-        EXTRA_LIBS = $(libdir)/nspr$(MOD_VERSION).lib
-    else
-        DLLBASE=/BASE:0x30000000
+	DLLBASE=/BASE:0x30000000
         RES=$(OBJDIR)/prstrms.res
         RESNAME=prstrms.rc
-        OS_LIBS = user32.lib
-        ifeq ($(OS_TARGET), WIN95)
-            EXTRA_LIBS = $(libdir)/nspr$(MOD_VERSION).lib
-        else
-            EXTRA_LIBS = $(libdir)/libnspr$(MOD_VERSION).lib
-        endif
-    endif
 else
-    ifeq ($(OS_ARCH),OS2)
-      ifeq ($(MOZ_OS2_TOOLS),VACPP)
-         EXTRA_LIBS = $(libdir)/nspr$(MOD_VERSION).$(LIB_SUFFIX)
-      else
-         EXTRA_LIBS = -L$(libdir) -lnspr$(MOD_VERSION) -lstdcpp
-      endif
-    else
     ifeq ($(OS_ARCH), AIX)
       ifeq ($(OS_RELEASE), 4.1)
         ifeq ($(CLASSIC_NSPR),1)
             OS_LIBS += -lC -lc
         else
             OS_LIBS += -lC_r -lc_r
         endif
       else
@@ -105,22 +94,16 @@ else
         ifeq ($(CLASSIC_NSPR),1)
             MKSHLIB = makeC++SharedLib -p 0
         else
             MKSHLIB = makeC++SharedLib_r -p 0
         endif
         OS_LIBS += -ldl
       endif
     endif
-    ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
-        EXTRA_LIBS = -L$(libdir) -lnspr$(MOD_VERSION)_shr
-    else
-        EXTRA_LIBS = -L$(libdir) -lnspr$(MOD_VERSION)
-    endif
-endif
 endif
 
 # On NCR and SCOOS, we can't link with extra libraries when
 # we build a shared library.  If we do so, the linker doesn't
 # complain, but we would run into weird problems at run-time.
 # Therefore on these platforms, we link just the object files.
 ifeq ($(OS_ARCH),NCR)
     EXTRA_LIBS =
@@ -130,30 +113,27 @@ ifeq ($(OS_ARCH),SCOOS)
 endif
 ifeq ($(OS_ARCH),BeOS)
     EXTRA_LIBS = -lstdc++.r4 -L$(libdir) -lnspr$(MOD_VERSION)
 endif
 
 ifeq ($(OS_ARCH), UNIXWARE)
     OS_LIBS += -lC
 endif
-endif # !USE_AUTOCONF
 
-ifdef RESOLVE_LINK_SYMBOLS
-EXTRA_LIBS := -L$(libdir) -lnspr$(MOD_VERSION)
+ifeq ($(OS_ARCH),WINNT)
+OS_LIBS	+= user32.lib
 endif
 
-LIBRARY_NAME    = prstrms
-LIBRARY_VERSION = $(MOD_VERSION)
+EXTRA_LIBS = $(LIBNSPR)
 
-RELEASE_HEADERS = $(HEADERS)
-RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
-RELEASE_LIBS    = $(TARGETS)
+ifdef RESOLVE_LINK_SYMBOLS
+EXTRA_LIBS += $(OS_LIBS)
+endif
 
-include $(topsrcdir)/config/rules.mk
 
 #
 # Version information generation (begin)
 #
 ECHO = echo
 TINC = $(OBJDIR)/_pl_bld.h
 PROD = $(notdir $(SHARED_LIBRARY))
 NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
@@ -177,19 +157,19 @@ endif
 	@$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
 
 
 $(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
 ifeq ($(OS_ARCH), WINNT)
 	$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
 else
 ifeq ($(MOZ_OS2_TOOLS), VACPP)
-	$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) plvrsion.c
+	$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
 else
-	$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) plvrsion.c
+	$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
 endif
 endif
 #
 # Version information generation (end)
 #
 
 export:: $(TARGETS) $(HEADERS)
 	$(INSTALL) -m 444 $(HEADERS) $(includedir)
--- a/pr/include/md/Makefile.in
+++ b/pr/include/md/Makefile.in
@@ -24,156 +24,16 @@ VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 HEADERS = $(wildcard $(srcdir)/*.h)
 CONFIGS = $(wildcard $(srcdir)/*.cfg)
 
 include $(topsrcdir)/config/rules.mk
 
-ifndef USE_AUTOCONF
-
-ifeq ($(OS_ARCH),IRIX)
-ifeq ($(USE_64), 1)
-MDCPUCFG_H = _irix64.cfg
-else
-MDCPUCFG_H = _irix32.cfg
-endif
-endif
-
-ifeq ($(OS_ARCH),WINNT)
-ifeq ($(OS_TARGET), WIN95)
-MDCPUCFG_H = _win95.cfg
-else
-ifeq ($(OS_TARGET), WIN16)
-MDCPUCFG_H = _win16.cfg
-else
-MDCPUCFG_H = _winnt.cfg
-endif
-endif
-endif
-
-ifeq ($(OS_ARCH),OS2)
-MDCPUCFG_H = _os2.cfg
-endif
-
-ifeq ($(OS_ARCH),AIX)
-ifeq ($(USE_64),1)
-MDCPUCFG_H = _aix64.cfg
-else
-ifeq ($(USE_IPV6),1)
-MDCPUCFG_H = _aix32in6.cfg
-else
-MDCPUCFG_H = _aix32.cfg
-endif
-endif
-endif
-
-ifeq ($(OS_ARCH),BSD_OS)
-MDCPUCFG_H = _bsdi.cfg
-endif
-
-ifeq ($(OS_ARCH),FreeBSD)
-MDCPUCFG_H = _freebsd.cfg
-endif
-
-ifeq ($(OS_ARCH),OpenBSD)
-MDCPUCFG_H = _openbsd.cfg
-endif
-
-ifeq ($(OS_ARCH),OpenVMS)
-MDCPUCFG_H = _openvms.cfg
-endif
-
-ifeq ($(OS_ARCH),NetBSD)
-MDCPUCFG_H = _netbsd.cfg
-endif
-
-ifeq ($(OS_ARCH),HP-UX)
-ifeq ($(USE_64), 1)
-MDCPUCFG_H = _hpux64.cfg
-else
-MDCPUCFG_H = _hpux32.cfg
-endif
-endif
-
-ifeq ($(OS_ARCH),Linux)
-MDCPUCFG_H = _linux.cfg
-endif
-
-ifeq ($(OS_ARCH),OSF1)
-MDCPUCFG_H = _osf1.cfg
-endif
-
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-MDCPUCFG_H = _sunos4.cfg
-else
-ifeq ($(USE_64),1)
-MDCPUCFG_H = _solaris64.cfg
-else
-MDCPUCFG_H = _solaris32.cfg
-endif
-endif
-endif
-
-ifeq ($(OS_ARCH),SINIX)
-MDCPUCFG_H = _reliantunix.cfg
-endif
-
-ifeq ($(OS_ARCH),Rhapsody)
-MDCPUCFG_H = _rhapsody.cfg
-endif
-
-ifeq ($(OS_ARCH),NEXTSTEP)
-MDCPUCFG_H = _nextstep.cfg
-endif
-
-ifeq ($(OS_ARCH),NEWS-OS)
-MDCPUCFG_H = _sony.cfg
-endif
-
-ifeq ($(OS_ARCH),NEC)
-MDCPUCFG_H = _nec.cfg
-endif
-
-ifeq ($(OS_ARCH),SCOOS)
-MDCPUCFG_H = _scoos.cfg
-endif
-
-ifeq ($(OS_ARCH),UNIXWARE)
-ifeq (,$(filter-out 2.1,$(OS_RELEASE)))
-MDCPUCFG_H = _unixware.cfg
-else
-MDCPUCFG_H = _unixware7.cfg
-endif
-endif
-
-ifeq ($(OS_ARCH),NCR)
-MDCPUCFG_H = _ncr.cfg
-endif
-
-ifeq ($(OS_ARCH),DGUX)
-MDCPUCFG_H = _dgux.cfg
-endif
-
-ifeq ($(OS_ARCH),QNX)
-MDCPUCFG_H = _qnx.cfg
-endif
-
-ifeq ($(OS_TARGET),NTO)
-MDCPUCFG_H = _nto.cfg
-endif
-
-ifeq ($(OS_ARCH),BeOS)
-MDCPUCFG_H = _beos.cfg
-endif
-
-endif # ! USE_AUTOCONF
-
 export:: $(MDCPUCFG_H)
 ifeq ($(MOZ_BITS),16)
 	cp $(includedir)/$(MDCPUCFG_H) $(includedir)/prcpucfg.h
 	$(INSTALL) -m 444 $(MDCPUCFG_H) $(MOZ_INCL)
 	mv -f $(includedir)/$(MDCPUCFG_H) $(MOZ_INCL)/prcpucfg.h
 else
 	$(INSTALL) -m 444 $(CONFIGS) $(includedir)/md
 	$(INSTALL) -m 444 $(srcdir)/$(MDCPUCFG_H) $(includedir)
--- a/pr/src/Makefile.in
+++ b/pr/src/Makefile.in
@@ -40,27 +40,23 @@ endif
 ifeq ($(USE_BTHREADS), 1)
 	DIRS += bthreads
 endif
 
 ifeq ($(USE_CPLUS), 1)
 	DIRS += cplus
 endif
 
-ifndef USE_AUTOCONF
-
 #
 # Define platform-dependent OS_LIBS
 #
 
 # Disable optimization of the nspr on SunOS4.1.3
 ifeq ($(OS_ARCH),SunOS)
 ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-export OPTIMIZER
 OS_LIBS			= -lm
 else	# 4.1.3_U1
 ifdef USE_PTHREADS
 OS_LIBS			= -lpthread -lthread -lposix4 -lsocket -lnsl -ldl
 else
 ifdef LOCAL_THREADS_ONLY
 OS_LIBS			= -lsocket -lnsl -ldl
 else
@@ -141,27 +137,25 @@ endif
 ifeq ($(OS_ARCH),UNIXWARE)
 OS_LIBS		= -lsocket -lc
 endif
 
 ifeq ($(OS_ARCH),NEWS-OS)
 OS_LIBS		= -lsocket -lnsl -lgen -lresolv
 endif
 
-ifdef GC_LEAK_DETECTOR
-OS_LIBS		+= -L$(libdir) -lboehm
+ifeq ($(OS_ARCH),WINNT)
+OS_LIBS		= advapi32.lib wsock32.lib
 endif
 
-endif # USE_AUTOCONF
+ifdef GC_LEAK_DETECTOR
+EXTRA_LIBS	= -L$(libdir) -lboehm
+endif
 
-ifeq ($(OS_ARCH),WINNT)
-ifneq ($(OS_TARGET),WIN16)
-OS_LIBS		= advapi32.lib wsock32.lib
-endif
-endif
+EXTRA_LIBS += $(OS_LIBS)
 
 #
 # Define platform-dependent OBJS
 #
 
 OBJS = \
     $(OBJDIR)/prvrsion.$(OBJ_SUFFIX) \
     io/$(OBJDIR)/prfdcach.$(OBJ_SUFFIX) \
@@ -255,129 +249,33 @@ OBJS += \
 	cplus/$(OBJDIR)/rctime.$(OBJ_SUFFIX)
 endif
 
 ifdef GC_LEAK_DETECTOR
 OBJS += memory/$(OBJDIR)/prgcleak.$(OBJ_SUFFIX)
 endif
 
 ifeq ($(OS_ARCH), WINNT)
-ifneq ($(OS_TARGET),WIN16)
 DLLBASE=/BASE:0x30000000
 RES=$(OBJDIR)/nspr.res
 RESNAME=nspr.rc
-ifdef MOZ_DEBUG
-ifdef GLOWCODE
-EXTRA_LIBS += $(GLOWDIR)/glowcode.lib
-endif
-endif
-endif
 endif # WINNT
 
-ifdef USE_AUTOCONF
-
 include $(srcdir)/md/$(PR_MD_ARCH_DIR)/objs.mk
 ifdef USE_BTHREADS
 include $(srcdir)/bthreads/objs.mk
 endif
 
-else
-
-ifeq ($(OS_ARCH), WINNT)
-ifeq ($(OS_TARGET), WIN16)
-OBJS +=	md/windows/$(OBJDIR)/w16null.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/w16proc.$(OBJ_SUFFIX)      \
-	md/windows/$(OBJDIR)/w16thred.$(OBJ_SUFFIX)      \
-	md/windows/$(OBJDIR)/w16fmem.$(OBJ_SUFFIX)      \
-	md/windows/$(OBJDIR)/w16sock.$(OBJ_SUFFIX)      \
-	md/windows/$(OBJDIR)/w16mem.$(OBJ_SUFFIX)      \
-    md/windows/$(OBJDIR)/w16io.$(OBJ_SUFFIX)       \
-    md/windows/$(OBJDIR)/w16gc.$(OBJ_SUFFIX)       \
-    md/windows/$(OBJDIR)/w16error.$(OBJ_SUFFIX)       \
-    md/windows/$(OBJDIR)/w16callb.$(OBJ_SUFFIX)       \
-	md/windows/$(OBJDIR)/ntinrval.$(OBJ_SUFFIX)
-EXTRA_LIBS += $(MOD_DEPTH)/tools/winsock.lib
-W16_EXPORTS = EXPORT _malloc.2=_PR_MD_malloc RESIDENT, \
-	_realloc.3=_PR_MD_realloc RESIDENT, \
-	_calloc.4=_PR_MD_calloc RESIDENT, \
-	_free.5=_PR_MD_free RESIDENT, \
-	_getenv.9=_PR_MD_getenv RESIDENT, \
-	_printf.11=_PR_MD_printf RESIDENT, \
-	_strftime.13=_PR_MD_strftime RESIDENT, \
-	_sscanf.33=_PR_MD_sscanf RESIDENT, \
-    _putenv.10=_PR_MD_putenv RESIDENT, \
-    _fprintf.12=_PR_MD_fprintf RESIDENT
-else
-ifeq ($(OS_TARGET), WIN95)
-OBJS +=	md/windows/$(OBJDIR)/w95io.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/w95sock.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/w95thred.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/w95cv.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/ntgc.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/ntmisc.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/ntinrval.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/ntsec.$(OBJ_SUFFIX)	\
-	md/windows/$(OBJDIR)/ntsem.$(OBJ_SUFFIX)	\
-	md/windows/$(OBJDIR)/win32_errors.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/w32ipcsem.$(OBJ_SUFFIX)	\
-	md/windows/$(OBJDIR)/w32poll.$(OBJ_SUFFIX)	\
-	md/windows/$(OBJDIR)/w32rng.$(OBJ_SUFFIX)	\
-	md/windows/$(OBJDIR)/w32shm.$(OBJ_SUFFIX)	\
-	md/windows/$(OBJDIR)/w95dllmain.$(OBJ_SUFFIX)
-else
-OBJS +=	md/windows/$(OBJDIR)/ntdllmn.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/ntio.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/ntgc.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/ntthread.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/ntmisc.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/ntinrval.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/ntsec.$(OBJ_SUFFIX)	\
-	md/windows/$(OBJDIR)/ntsem.$(OBJ_SUFFIX)	\
-	md/windows/$(OBJDIR)/win32_errors.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/w32ipcsem.$(OBJ_SUFFIX) \
-	md/windows/$(OBJDIR)/w32rng.$(OBJ_SUFFIX)	\
-	md/windows/$(OBJDIR)/w32shm.$(OBJ_SUFFIX)	\
-	md/windows/$(OBJDIR)/w32poll.$(OBJ_SUFFIX)
-endif
-endif
-
-ifeq ($(OS_ARCH),OS2)
-OBJS +=	md/os2/$(OBJDIR)/os2io.$(OBJ_SUFFIX) \
-	md/os2/$(OBJDIR)/os2sock.$(OBJ_SUFFIX) \
-	md/os2/$(OBJDIR)/os2thred.$(OBJ_SUFFIX) \
-	md/os2/$(OBJDIR)/os2cv.$(OBJ_SUFFIX) \
-	md/os2/$(OBJDIR)/os2gc.$(OBJ_SUFFIX) \
-	md/os2/$(OBJDIR)/os2misc.$(OBJ_SUFFIX) \
-	md/os2/$(OBJDIR)/os2inrval.$(OBJ_SUFFIX) \
-	md/os2/$(OBJDIR)/os2sem.$(OBJ_SUFFIX)	\
-	md/os2/$(OBJDIR)/os2_errors.$(OBJ_SUFFIX) \
-	md/os2/$(OBJDIR)/os2poll.$(OBJ_SUFFIX) \
-	md/os2/$(OBJDIR)/os2rng.$(OBJ_SUFFIX)
-else
-
-ifeq ($(OS_ARCH), BeOS)
-	include $(srcdir)/md/beos/objs.mk
-	include $(srcdir)/bthreads/objs.mk
-else
-	# Unix
-	include $(srcdir)/md/unix/objs.mk
-endif # BeOS
-endif # OS2
-endif # WINNT
-endif # !USE_AUTOCONF
-
 LIBRARY_NAME = nspr
 LIBRARY_VERSION = $(MOD_VERSION)
 
 RELEASE_LIBS = $(TARGETS)
 
 include $(topsrcdir)/config/rules.mk
 
-EXTRA_LIBS = $(OS_LIBS)
-
 ifeq ($(BUILD_AIX_RTL_LIBC),1)
 TARGETS		+= $(AIX_RTL_LIBC)
 # XXX is this a shared library?
 endif
 
 #
 # Version information generation (begin)
 #
--- a/pr/src/md/Makefile.in
+++ b/pr/src/md/Makefile.in
@@ -21,41 +21,17 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-ifdef USE_AUTOCONF
 DIRS = $(PR_MD_ARCH_DIR)
-else
-
-ifeq ($(OS_ARCH),WINNT)
-    DIRS = windows
-else
-  ifeq ($(OS_ARCH),OS2)
-    DIRS = os2
-  else
-  ifeq ($(OS_ARCH),BeOS)
-    DIRS = beos
-  else
-    DIRS = unix
-    endif
-  endif
-endif
-
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-endif # USE_AUTOCONF
 
 CSRCS =          \
 	prosdep.c \
 	$(NULL)
 
 TARGETS	= $(OBJS)
 
 INCLUDES = -I$(includedir) -I$(topsrcdir)/pr/include
--- a/pr/src/md/unix/Makefile.in
+++ b/pr/src/md/unix/Makefile.in
@@ -19,27 +19,16 @@ MOD_DEPTH	= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-ifndef USE_AUTOCONF
-
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
-endif # ! USE_AUTOCONF
-
 CSRCS =          \
 	unix.c    \
 	unix_errors.c    \
 	uxproces.c \
 	uxrng.c \
 	uxshm.c \
 	uxwrap.c \
 	$(NULL)
@@ -47,284 +36,42 @@ CSRCS =          \
 ifneq ($(USE_PTHREADS),1)
 CSRCS += uxpoll.c
 endif
 
 ifeq ($(PTHREADS_USER),1)
 CSRCS += pthreads_user.c
 endif
 
-ifndef USE_AUTOCONF
-
-IRIX_CSRCS =	 \
-	irix.c	 \
-	$(NULL)
-
-SUNOS4_CSRCS =	 \
-	sunos4.c	 \
-	$(NULL)
-
-SOLARIS_CSRCS = \
-	solaris.c	\
-	$(NULL)
-
-AIX_CSRCS =	\
-	aix.c	\
-	$(NULL)
-
-FREEBSD_CSRCS = \
-	freebsd.c \
-	$(NULL)
-
-NETBSD_CSRCS = \
-	netbsd.c \
-	$(NULL)
-
-OPENBSD_CSRCS = \
-       openbsd.c \
-       $(NULL)
-
-BSDI_CSRCS = \
-	bsdi.c \
-	$(NULL)
-
-HPUX_CSRCS = \
-	hpux.c \
-	$(NULL)
-
-OPENVMS_CSRCS = \
-       openvms.c \
-       $(NULL)
-
-OSF1_CSRCS = \
-	osf1.c \
-	$(NULL)
-
-LINUX_CSRCS = \
-	linux.c \
-	$(NULL)
-
-UNIXWARE_CSRCS = \
-	unixware.c \
-	$(NULL)
-
-RELIANTUNIX_CSRCS = \
-      reliantunix.c \
-      $(NULL)
-
-RHAPSODY_CSRCS = \
-	rhapsody.c \
-	$(NULL)
-
-NEXTSTEP_CSRCS = \
-	nextstep.c \
-	$(NULL)
-
-NEC_CSRCS = \
-	nec.c \
-	$(NULL)
-
-SONY_CSRCS = \
-	sony.c \
-	$(NULL)
-
-NCR_CSRCS = \
-	ncr.c \
-	$(NULL)
-
-SCOOS_CSRCS = \
-	scoos.c \
-	$(NULL)
-
-DGUX_CSRCS = \
-	dgux.c \
-	$(NULL)
-
-QNX_CSRCS = \
-	qnx.c \
-	$(NULL)
-
-NTO_CSRCS = \
-	nto.c \
-	$(NULL)
-
-ifeq ($(OS_ARCH),IRIX)
-CSRCS += $(IRIX_CSRCS)
-endif
-
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-CSRCS += $(SUNOS4_CSRCS)
-else
-CSRCS += $(SOLARIS_CSRCS)
-endif
-endif
-
-ifeq ($(OS_ARCH),AIX)
-CSRCS += $(AIX_CSRCS)
-endif
-ifeq ($(OS_ARCH),FreeBSD)
-CSRCS += $(FREEBSD_CSRCS)
-endif
-ifeq ($(OS_ARCH),NetBSD)
-CSRCS += $(NETBSD_CSRCS)
-endif
-ifeq ($(OS_ARCH),OpenBSD)
-CSRCS += $(OPENBSD_CSRCS)
-endif
-ifeq ($(OS_ARCH),BSD_OS)
-CSRCS += $(BSDI_CSRCS)
-endif
-ifeq ($(OS_ARCH),HP-UX)
-CSRCS += $(HPUX_CSRCS)
-endif
-ifeq ($(OS_ARCH),OpenVMS)
-CSRCS += $(OPENVMS_CSRCS)
-endif
-ifeq ($(OS_ARCH),OSF1)
-CSRCS += $(OSF1_CSRCS)
-endif
-ifeq ($(OS_ARCH),Linux)
-CSRCS += $(LINUX_CSRCS)
-endif
-ifeq ($(OS_ARCH),UNIXWARE)
-CSRCS += $(UNIXWARE_CSRCS)
-endif
-ifeq ($(OS_ARCH),SINIX)
-CSRCS += $(RELIANTUNIX_CSRCS)
-endif
-ifeq ($(OS_ARCH),Rhapsody)
-CSRCS += $(RHAPSODY_CSRCS)
-endif
-ifeq ($(OS_ARCH),NEXTSTEP)
-CSRCS += $(NEXTSTEP_CSRCS)
-endif
-ifeq ($(OS_ARCH),NEC)
-CSRCS += $(NEC_CSRCS)
-endif
-ifeq ($(OS_ARCH),NEWS-OS)
-CSRCS += $(SONY_CSRCS)
-endif
-ifeq ($(OS_ARCH),NCR)
-CSRCS += $(NCR_CSRCS)
-endif
-ifeq ($(OS_ARCH),SCOOS)
-CSRCS += $(SCOOS_CSRCS)
-endif
-ifeq ($(OS_ARCH),DGUX)
-CSRCS += $(DGUX_CSRCS)
-endif
-ifeq ($(OS_ARCH),NTO)
-CSRCS += $(NTO_CSRCS)
-endif
-ifeq ($(OS_ARCH),QNX)
-ifeq ($(OS_TARGET),NTO)
-CSRCS += $(NTO_CSRCS)
-else
-CSRCS += $(QNX_CSRCS)
-endif
-endif
-
-#
-# Some Unix platforms have an assembly language file.
-# E.g., AIX 3.2, Solaris (both sparc and x86).
-#
-ifeq ($(OS_ARCH), AIX)
-    ifeq ($(OS_RELEASE), 3.2)
-	ASFILES   = os_$(OS_ARCH).s
-    endif
-endif
-
-ifeq ($(OS_ARCH),SunOS)
-    ifneq ($(OS_RELEASE),4.1.3_U1)
-    ifneq ($(LOCAL_THREADS_ONLY),1)
-        ifeq ($(CPU_ARCH),x86)
-            ASFILES = os_$(OS_ARCH)_x86.s
-        else
-            ASFILES = os_$(OS_ARCH).s
-            ifneq ($(USE_64),1)
-            ASFILES += os_$(OS_ARCH)_32.s
-            endif
-        endif
-    endif
-    endif
-endif
-
-ifeq ($(OS_ARCH),Linux)
-    ifeq ($(CPU_ARCH),x86)
-        ASFILES   = os_Linux_x86.s
-    endif
-endif
-
-ifeq ($(OS_ARCH), SINIX)
-    ifeq ($(CPU_ARCH),mips)
-        ASFILES   = os_ReliantUNIX.s
-    endif
-endif
-
-ifeq ($(OS_ARCH)$(OS_RELEASE),BSD_OS2.1)
-    ASFILES = os_BSD_386_2.s
-endif
-
-ifeq ($(OS_ARCH), IRIX)
-    ASFILES   = os_Irix.s
-endif
-
-ifeq ($(OS_ARCH), HP-UX)
-    ASFILES   = os_HPUX.s
-endif
-
-TARGETS		= $(OBJS)
-
-ifeq ($(OS_ARCH),AIX)
-ifeq (,$(filter-out 3.2 4.1,$(OS_RELEASE)))
-ifneq ($(USE_PTHREADS), 1)
-#TARGETS		+= $(OBJDIR)/aixwrap.$(OBJ_SUFFIX)
-endif
-endif
-endif
-
 ifeq ($(OS_ARCH),SunOS)
 	ifneq ($(OS_RELEASE),4.1.3_U1)
 		ifeq ($(OS_TEST),sun4u)
 			LIBRARY_NAME = $(ULTRASPARC_LIBRARY)
 			LIBRARY_VERSION = $(MOD_VERSION)
 			ULTRASPARC_ASFILES = os_$(OS_ARCH)_ultrasparc.s
 			ULTRASPARC_ASOBJS = $(addprefix $(OBJDIR)/,$(ULTRASPARC_ASFILES:.s=.$(OBJ_SUFFIX)))
 			TARGETS		+= $(ULTRASPARC_ASOBJS) $(SHARED_LIBRARY)
 			RELEASE_LIBS = $(SHARED_LIBRARY)
 		endif
 	endif
 endif
 
-else # USE_AUTOCONF
-
 CSRCS += $(PR_MD_CSRCS)
 ASFILES += $(PR_MD_ASFILES)
 
 TARGETS = $(OBJS)
 
-endif # ! USE_AUTOCONF
-
 INCLUDES = -I$(includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
 DEFINES	+= -D_NSPR_BUILD_
 
 include $(topsrcdir)/config/rules.mk
 
 export:: $(TARGETS)
-#ifeq ($(OS_ARCH),AIX)
-#ifeq (,$(filter-out 3.2 4.1,$(OS_RELEASE)))
-#ifneq ($(USE_PTHREADS), 1)
-#	$(INSTALL) -m 444 $(OBJDIR)/aixwrap.$(OBJ_SUFFIX) $(libdir)
-#endif
-#endif
-#endif
 
-ifndef USE_AUTOCONF
 ifeq ($(OS_ARCH),SunOS)
 ifneq ($(OS_RELEASE),4.1.3_U1)
 ifeq ($(OS_TEST),sun4u)
 $(SHARED_LIBRARY): $(ULTRASPARC_ASOBJS)
 	$(LD) -G -z text -o $@ $(ULTRASPARC_ASOBJS)
 	$(INSTALL) -m 444 $(SHARED_LIBRARY) $(libdir)
 
 $(ULTRASPARC_ASOBJS): $(ULTRASPARC_ASFILES)
@@ -334,9 +81,8 @@ else
 	/usr/ccs/bin/as -o $@ -K PIC -P -D_ASM -D__STDC__=0 -xarch=v8plus $<
 endif
 
 clean::
 	rm -rf $(ULTRASPARC_ASOBJS)
 endif
 endif
 endif
-endif #!USE_AUTOCONF
--- a/pr/src/md/unix/objs.mk
+++ b/pr/src/md/unix/objs.mk
@@ -30,237 +30,14 @@ CSRCS =          \
 ifneq ($(USE_PTHREADS),1)
 CSRCS += uxpoll.c
 endif
 
 ifeq ($(PTHREADS_USER),1)
 CSRCS += pthreads_user.c
 endif
 
-ifdef USE_AUTOCONF
-
 CSRCS	+= $(PR_MD_CSRCS)
 ASFILES += $(PR_MD_ASFILES)
 
-else # ! USE_AUTOCONF
-IRIX_CSRCS =	 \
-	irix.c	 \
-	$(NULL)
-
-SUNOS4_CSRCS =	 \
-	sunos4.c	 \
-	$(NULL)
-
-SOLARIS_CSRCS = \
-	solaris.c	\
-	$(NULL)
-
-AIX_CSRCS =	\
-	aix.c	\
-	$(NULL)
-
-FREEBSD_CSRCS = \
-	freebsd.c \
-	$(NULL)
-
-NETBSD_CSRCS = \
-	netbsd.c \
-	$(NULL)
-
-OPENBSD_CSRCS = \
-	openbsd.c \
-	$(NULL)
-
-BSDI_CSRCS = \
-	bsdi.c \
-	$(NULL)
-
-HPUX_CSRCS = \
-	hpux.c \
-	$(NULL)
-
-OSF1_CSRCS = \
-	osf1.c \
-	$(NULL)
-
-OPENVMS_CSRCS = \
-	openvms.c \
-	$(NULL)
-
-LINUX_CSRCS = \
-	linux.c \
-	$(NULL)
-
-UNIXWARE_CSRCS = \
-	unixware.c \
-	$(NULL)
-
-RELIANTUNIX_CSRCS = \
-	reliantunix.c \
-	$(NULL)
-
-RHAPSODY_CSRCS = \
-	rhapsody.c \
-	$(NULL)
-
-NEXTSTEP_CSRCS = \
-	nextstep.c \
-	$(NULL)
-
-NEC_CSRCS = \
-	nec.c \
-	$(NULL)
-
-SONY_CSRCS = \
-	sony.c \
-	$(NULL)
-
-NCR_CSRCS = \
-	ncr.c \
-	$(NULL)
-
-SCOOS_CSRCS = \
-	scoos.c \
-	$(NULL)
-
-DGUX_CSRCS = \
-	dgux.c \
-	$(NULL)
-
-QNX_CSRCS = \
-	qnx.c \
-	$(NULL)
-
-NTO_CSRCS = \
-	nto.c \
-	$(NULL)
-
-ifeq ($(OS_ARCH),IRIX)
-CSRCS += $(IRIX_CSRCS)
-endif
-
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-CSRCS += $(SUNOS4_CSRCS)
-else
-CSRCS += $(SOLARIS_CSRCS)
-endif
-endif
-
-ifeq ($(OS_ARCH),AIX)
-CSRCS += $(AIX_CSRCS)
-endif
-ifeq ($(OS_ARCH),FreeBSD)
-CSRCS += $(FREEBSD_CSRCS)
-endif
-ifeq ($(OS_ARCH),NetBSD)
-CSRCS += $(NETBSD_CSRCS)
-endif
-ifeq ($(OS_ARCH),OpenBSD)
-CSRCS += $(OPENBSD_CSRCS)
-endif
-ifeq ($(OS_ARCH),BSD_OS)
-CSRCS += $(BSDI_CSRCS)
-endif
-ifeq ($(OS_ARCH),HP-UX)
-CSRCS += $(HPUX_CSRCS)
-endif
-ifeq ($(OS_ARCH),OSF1)
-CSRCS += $(OSF1_CSRCS)
-endif
-ifeq ($(OS_ARCH),OpenVMS)
-CSRCS += $(OPENVMS_CSRCS)
-endif
-ifeq ($(OS_ARCH),Linux)
-CSRCS += $(LINUX_CSRCS)
-endif
-ifeq ($(OS_ARCH),UNIXWARE)
-CSRCS += $(UNIXWARE_CSRCS)
-endif
-ifeq ($(OS_ARCH),SINIX)
-CSRCS += $(RELIANTUNIX_CSRCS)
-endif
-ifeq ($(OS_ARCH),Rhapsody)
-CSRCS += $(RHAPSODY_CSRCS)
-endif
-ifeq ($(OS_ARCH),NEXTSTEP)
-CSRCS += $(NEXTSTEP_CSRCS)
-endif
-ifeq ($(OS_ARCH),NEC)
-CSRCS += $(NEC_CSRCS)
-endif
-ifeq ($(OS_ARCH),NEWS-OS)
-CSRCS += $(SONY_CSRCS)
-endif
-ifeq ($(OS_ARCH),NCR)
-CSRCS += $(NCR_CSRCS)
-endif
-ifeq ($(OS_ARCH),SCOOS)
-CSRCS += $(SCOOS_CSRCS)
-endif
-ifeq ($(OS_ARCH),DGUX)
-CSRCS += $(DGUX_CSRCS)
-endif
-ifeq ($(OS_ARCH),NTO)
-CSRCS += $(NTO_CSRCS)
-endif
-ifeq ($(OS_ARCH),QNX)
-ifeq ($(OS_TARGET),NTO)
-CSRCS += $(NTO_CSRCS)
-else
-CSRCS += $(QNX_CSRCS)
-endif
-endif
- 
-#
-# Some Unix platforms have an assembly language file.
-# E.g., AIX 3.2, Solaris (both sparc and x86).
-#
-ifeq ($(OS_ARCH), AIX)
-    ifeq ($(OS_RELEASE), 3.2)
-	ASFILES   = os_$(OS_ARCH).s
-    endif
-endif
-
-ifeq ($(OS_ARCH),SunOS)
-    ifneq ($(OS_RELEASE),4.1.3_U1)
-    ifneq ($(LOCAL_THREADS_ONLY),1)
-        ifeq ($(CPU_ARCH),x86)
-            ASFILES = os_$(OS_ARCH)_x86.s
-        else
-            ASFILES = os_$(OS_ARCH).s
-            ifneq ($(USE_64),1)
-            ASFILES += os_$(OS_ARCH)_32.s
-            endif
-        endif
-    endif
-    endif
-endif
-
-ifeq ($(OS_ARCH),Linux)
-    ifeq ($(CPU_ARCH),x86)
-        ASFILES   = os_Linux_x86.s
-    endif
-endif
-
-ifeq ($(OS_ARCH), SINIX)
-    ifeq ($(CPU_ARCH),mips)
-        ASFILES   = os_ReliantUNIX.s
-    endif
-endif
-
-ifeq ($(OS_ARCH), HP-UX)
-    ASFILES   = os_HPUX.s
-endif
-
-ifeq ($(OS_ARCH), IRIX)
-    ASFILES   = os_Irix.s
-endif
-
-ifeq ($(OS_ARCH)$(OS_RELEASE),BSD_OS2.1)
-    ASFILES = os_BSD_386_2.s
-endif
-
-endif # !USE_AUTOCONF
-
 OBJS += $(addprefix md/unix/$(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX)))  \
 	$(addprefix md/unix/$(OBJDIR)/,$(ASFILES:.s=.$(OBJ_SUFFIX)))
 
--- a/pr/src/memory/Makefile.in
+++ b/pr/src/memory/Makefile.in
@@ -21,25 +21,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-ifndef USE_AUTOCONF
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-endif #!USE_AUTOCONF
-
 CSRCS = prseg.c prshm.c prshma.c
 
 ifdef GC_LEAK_DETECTOR
 CSRCS += prgcleak.c
 endif
 
 TARGETS	= $(OBJS)
 
--- a/pr/src/misc/Makefile.in
+++ b/pr/src/misc/Makefile.in
@@ -21,25 +21,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-ifndef USE_AUTOCONF
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-endif #!USE_AUTOCONF
-
 CSRCS = \
 	pralarm.c  \
 	pratom.c   \
 	prcountr.c \
 	prdtoa.c   \
 	prenv.c    \
 	prerr.c  \
 	prerror.c  \
@@ -70,25 +61,23 @@ TARGETS	= $(OBJS)
 INCLUDES = -I$(includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
 DEFINES	+= -D_NSPR_BUILD_
 
 RELEASE_BINS = compile-et.pl prerr.properties
 
 include $(topsrcdir)/config/rules.mk
 
-ifndef USE_AUTOCONF
 # An AIX Optimization bug causes PR_dtoa() to produce wrong result.
 # This suppresses optimization for this single compilation unit.
 ifeq ($(OS_ARCH), AIX)
-$(OBJDIR)/prdtoa.o:
+$(OBJDIR)/prdtoa.o: prdtoa.c
 	@$(MAKE_OBJDIR)
-	$(CC) -o $@ -c $(filter-out -O, $(CFLAGS)) prdtoa.c
+	$(CC) -o $@ -c $(filter-out -O, $(CFLAGS)) $<
 endif
-endif #!USE_AUTOCONF
 
 #
 # Generate prerr.h, prerr.c, and prerr.properties from prerr.et.
 #
 build_prerr:
 	$(PERL) $(srcdir)/compile-et.pl prerr.et
 
 export:: $(TARGETS)
--- a/pr/src/threads/Makefile.in
+++ b/pr/src/threads/Makefile.in
@@ -31,25 +31,16 @@ ifdef USE_PTHREADS
 else
 ifdef USE_BTHREADS
     DIRS =
 else
     DIRS = combined
 endif
 endif
 
-ifndef USE_AUTOCONF
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-endif
-
 ifdef USE_PTHREADS
 CSRCS = \
 	prcmon.c \
 	prrwlock.c   \
 	prtpd.c \
 	$(NULL)
 else
 ifdef USE_BTHREADS
--- a/pr/tests/Makefile.in
+++ b/pr/tests/Makefile.in
@@ -21,26 +21,17 @@ MOD_DEPTH	= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-ifeq ($(OS_TARGET), WIN16)
-OS_CFLAGS = $(OS_EXE_CFLAGS)
-W16STDIO = $(MOD_DEPTH)/pr/src/md/windows/$(OBJDIR)/w16stdio.$(OBJ_SUFFIX)
-endif
-
-ifeq ($(OS_TARGET),WIN16)
-DIRS = dll w16gui
-else
 DIRS = dll
-endif
 
 ifeq ($(OS_TARGET),OS2)
 OS_CFLAGS = $(OS_EXE_CFLAGS)
 endif
 
 CSRCS =             \
 	accept.c		\
 	acceptread.c	\
@@ -193,48 +184,26 @@ PROG_SUFFIX =
 endif
 
 PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX)))
 
 TARGETS = $(PROGS)
 
 INCLUDES = -I$(includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
-# Setting the variables LDOPTS and LIBPR.  We first initialize
-# them to the default values, then adjust them for some platforms.
-LDOPTS = -L$(libdir)
-LIBPR = -lnspr$(MOD_VERSION)
-LIBPLC = -lplc$(MOD_VERSION)
-
-ifndef USE_AUTOCONF
-
 ifeq ($(OS_ARCH), WINNT)
-ifeq ($(OS_TARGET), WIN16)
-  LIBPR = $(libdir)/nspr$(MOD_VERSION).lib
-  LIBPLC= $(libdir)/plc$(MOD_VERSION).lib
-else
   LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
-  ifeq ($(OS_TARGET), WIN95)
-    LIBPR = $(libdir)/nspr$(MOD_VERSION).$(LIB_SUFFIX)
-    LIBPLC= $(libdir)/plc$(MOD_VERSION).$(LIB_SUFFIX)
-  else
-    LIBPR = $(libdir)/libnspr$(MOD_VERSION).$(LIB_SUFFIX)
-    LIBPLC= $(libdir)/libplc$(MOD_VERSION).$(LIB_SUFFIX)
-  endif
   ifdef PROFILE                                                                              
     LDOPTS += -PROFILE -MAP                                                                  
   endif # profile
 endif
-endif
 
 ifeq ($(OS_ARCH),OS2)
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
   LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO
-  LIBPR  = $(libdir)/nspr$(MOD_VERSION).lib
-  LIBPLC = $(libdir)/plc$(MOD_VERSION).lib
 else
 ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
   LDOPTS = -Zlinker /PM:VIO
 endif
 endif
 endif
 
 ifneq ($(OS_ARCH), WINNT)
@@ -273,17 +242,17 @@ endif
 
 ifeq ($(OS_ARCH), OSF1)
     ifeq ($(USE_CPLUS), 1)
         CC = cxx
     endif
 # I haven't figured out how to pass -rpath to cc on OSF1 V3.2, so
 # we do static linking.
     ifeq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
-        LIBPR = $(libdir)/libnspr$(MOD_VERSION).a
+        LIBNSPR = $(libdir)/libnspr$(MOD_VERSION).a
         LIBPLC = $(libdir)/libplc$(MOD_VERSION).a
         EXTRA_LIBS = -lc_r
     else
         LDOPTS += -rpath $(ABSOLUTE_LIB_DIR)
     endif
 endif
 
 ifeq ($(OS_ARCH), HP-UX)
@@ -293,17 +262,17 @@ ifeq ($(OS_ARCH), HP-UX)
         EXTRA_LIBS = -lpthread
     endif
 endif
 
 # AIX
 ifeq ($(OS_ARCH),AIX)
     LDOPTS += -blibpath:$(ABSOLUTE_LIB_DIR):/usr/lib:/lib
     ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
-        LIBPR = -lnspr$(MOD_VERSION)_shr
+        LIBNSPR = -lnspr$(MOD_VERSION)_shr
         LIBPLC = -lplc$(MOD_VERSION)_shr
     else
         LDOPTS += -brtl
         EXTRA_LIBS = -ldl
     endif
 endif
 
 # Solaris
@@ -362,17 +331,17 @@ ifeq ($(OS_ARCH), NEXTSTEP)
 LDOPTS += -posix
 endif
 
 ifeq ($(OS_ARCH), NEWS-OS)
 # This hardcodes in the executable programs the directory to find
 # libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
 # option for ld on other platforms.
 #export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
-    LIBPR = $(libdir)/libnspr$(MOD_VERSION).a
+    LIBNSPR = $(libdir)/libnspr$(MOD_VERSION).a
     LIBPLC = $(libdir)/libplc$(MOD_VERSION).a
     EXTRA_LIBS = -lsocket -lnsl -lgen -lresolv
 endif
 
 ifeq ($(OS_ARCH), Linux)
     ifeq ($(OS_RELEASE), 1.2)
         EXTRA_LIBS = -ldl
     else
@@ -445,31 +414,25 @@ endif
 ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS NTO Rhapsody,$(OS_ARCH)))
 LIBPTHREAD =
 endif
 ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)
 LIBPTHREAD = -ldce
 endif
 endif
 
-endif # !USE_AUTOCONF
 
 #####################################################
 #
 # The rules
 #
 #####################################################
 
 include $(topsrcdir)/config/rules.mk
 
-ifdef USE_AUTOCONF
-$(OBJDIR)/%$(PROG_SUFFIX): %.c
-	$(CC) $< -o $@ $(CFLAGS) $(LDOPTS) $(LIBPLC) $(LIBPR) $(OS_LIBS)
-
-else
 AIX_PRE_4_2 = 0
 ifeq ($(OS_ARCH),AIX)
 ifeq ($(OS_RELEASE),4.1)
 ifneq ($(USE_PTHREADS), 1)
 #AIX_PRE_4_2 = 1
 endif
 endif
 endif
@@ -493,78 +456,56 @@ ifeq ($(AIX_PRE_4_2),1)
 
 else
 
 # All platforms that are not AIX pre-4.2.
 
 $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
 	@$(MAKE_OBJDIR)
 ifeq ($(OS_ARCH), WINNT)
-ifeq ($(OS_TARGET),WIN16)
-	echo system windows >w16link
-	echo name $@  >>w16link
-	echo option map >>w16link
-#	echo option CASEEXACT >>w16link
-	echo option stack=16K >>w16link
-	echo debug $(DEBUGTYPE) all >>w16link
-	echo file >>w16link
-	echo $< , >>w16link
-	echo $(W16STDIO) >>w16link
-	echo library  >>w16link
-	echo $(LIBPR),	     >>w16link
-	echo $(LIBPLC),		 >>w16link
-	echo winsock.lib     >>w16link
-	wlink @w16link.
-else
-	link $(LDOPTS) $(EXTRA_LDOPTS) $< $(LIBPLC) $(LIBPR) $(EXTRA_LIBS) wsock32.lib -out:$@
-endif
+	link $(LDOPTS) $(EXTRA_LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) wsock32.lib -out:$@
 else
 ifeq ($(OS_ARCH),OS2)
-	$(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
+	$(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(OS_LIBS) $(EXTRA_LIBS)
 else
-	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(EXTRA_LIBS) -o $@
-endif
-endif
-endif
-
-endif # !USE_AUTOCONF
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -o $@
+endif # OS/2
+endif # WINNT
+endif # AIX_PRE_4_2
 
 export:: $(TARGETS)
 clean::
 	rm -f $(TARGETS)
 
-ifndef USE_AUTOCONF
 # The following tests call BSD socket functions, so they need to link
 # with -lsocket on some platforms.
 ifeq ($(OS_ARCH),SunOS)
 ifneq ($(OS_RELEASE),4.1.3_U1)
 ifeq ($(USE_IPV6),1)
 $(OBJDIR)/gethost: $(OBJDIR)/gethost.o
-	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) -lsocket $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
 endif
 $(OBJDIR)/prpoll: $(OBJDIR)/prpoll.o
-	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) -lsocket $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
 endif
 endif
 
 ifeq ($(USE_PTHREADS), 1)
 $(OBJDIR)/attach: $(OBJDIR)/attach.o
-	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/foreign: $(OBJDIR)/foreign.o
-	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/provider: $(OBJDIR)/provider.o
-	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/socket: $(OBJDIR)/socket.o
-	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/testfile: $(OBJDIR)/testfile.o
-	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 endif
 
-endif # !USE_AUTOCONF
-
 #
 # Run the test programs with no arguments
 #
 # Test output goes to the file pointed to by the environment variable
 # NSPR_TEST_LOGFILE, if set, else to /dev/null
 #
 ECHO = echo
 PROGRAMS = $(notdir $(PROGS))