diff -urN mozilla/cmd/stubfe/Makefile cmd/stubfe/Makefile
--- mozilla/cmd/stubfe/Makefile	Mon Jul 27 21:48:28 1998
+++ cmd/stubfe/Makefile	Thu Aug 20 19:42:35 1998
@@ -542,6 +542,18 @@
 endif
 
 ########################################
+# NetBSD
+ifeq ($(OS_ARCH),NetBSD)
+OTHER_LIBS	= -lm $(OS_LIBS)
+endif
+
+########################################
+# OpenBSD
+ifeq ($(OS_ARCH),OpenBSD)
+OTHER_LIBS	= -lm $(OS_LIBS)
+endif
+
+########################################
 # BSDI
 ifeq ($(OS_ARCH),BSD_OS)
 OTHER_LIBS	= -lm $(OS_LIBS)
diff -urN mozilla/cmd/xfe/Makefile cmd/xfe/Makefile
--- mozilla/cmd/xfe/Makefile	Mon Jul 27 21:48:28 1998
+++ cmd/xfe/Makefile	Thu Aug 20 20:51:18 1998
@@ -604,6 +604,34 @@
 endif
 
 ########################################
+# NetBSD
+# Work around linker semantics that will never find our own libutil on 1.3.x
+ifeq ($(OS_ARCH),NetBSD)
+ifeq ($(OS_MINOR),3)
+FOOL_GMAKE	= $(EXPORT_LDFLAGS:$(DIST)/lib/lib%.a=-l%)
+DSO_EX_LIBS	= $(FOOL_GMAKE:-lutil=$(DIST)/lib/libutil.a)
+endif
+ifdef LIBRUNPATH
+OS_LIBS		+= -R$(LIBRUNPATH)
+endif
+OTHER_LIBS	= -L/usr/X11R6/lib -lXm -lXt -lXmu -lXext -lX11 -lSM -lICE -lm $(OS_LIBS)
+endif
+
+########################################
+# OpenBSD
+# Copied from NetBSD...
+ifeq ($(OS_ARCH),OpenBSD)
+#ifeq ($(OS_MINOR),3)
+#FOOL_GMAKE	= $(EXPORT_LDFLAGS:$(DIST)/lib/lib%.a=-l%)
+#DSO_EX_LIBS	= $(FOOL_GMAKE:-lutil=$(DIST)/lib/libutil.a)
+#endif
+ifdef LIBRUNPATH
+OS_LIBS		+= -R$(LIBRUNPATH)
+endif
+OTHER_LIBS	= -L/usr/X11R6/lib -lXm -lXt -lXmu -lXext -lX11 -lSM -lICE -lm $(OS_LIBS)
+endif
+
+########################################
 # BSDI
 ifeq ($(OS_ARCH),BSD_OS)
 OTHER_LIBS	= $(MOTIF)/libXm.a $(LOC_LIB_DIR)/libXt.a $(X11R6LIBS) $(LOC_LIB_DIR)/libXmu.a \
diff -urN mozilla/cmd/xfe/Microline3.0/XmL/Grid.c cmd/xfe/Microline3.0/XmL/Grid.c
--- mozilla/cmd/xfe/Microline3.0/XmL/Grid.c	Mon Jul 27 21:48:32 1998
+++ cmd/xfe/Microline3.0/XmL/Grid.c	Thu Aug 20 19:42:36 1998
@@ -30,6 +30,9 @@
 #include <Xm/Text.h>
 #include <Xm/DrawnB.h>
 #include <Xm/CutPaste.h>
+#ifndef MOTIF11
+#include <Xm/DropSMgr.h>
+#endif
 #include <X11/StringDefs.h>
 #include <X11/cursorfont.h>
 #include <stdio.h>
diff -urN mozilla/cmd/xfe/dialogs.c cmd/xfe/dialogs.c
--- mozilla/cmd/xfe/dialogs.c	Mon Jul 27 21:48:29 1998
+++ cmd/xfe/dialogs.c	Thu Aug 20 19:42:38 1998
@@ -278,7 +278,7 @@
   (void) fe_dialog (parent, "error", message, FALSE, 0, FALSE, FALSE, 0);
 }
 
-#if !defined(__FreeBSD__) && !defined(MKLINUX) && !defined(LINUX_GLIBC_2)
+#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(MKLINUX) && !defined(LINUX_GLIBC_2)
 #include <sys/errno.h>
 extern char *sys_errlist[];
 extern int sys_nerr;
diff -urN mozilla/cmd/xfe/movemail.c cmd/xfe/movemail.c
--- mozilla/cmd/xfe/movemail.c	Mon Jul 27 21:48:31 1998
+++ cmd/xfe/movemail.c	Thu Aug 20 19:42:38 1998
@@ -40,7 +40,7 @@
 #include "xfe.h"
 
 #include <sys/errno.h>
-#if !defined(__FreeBSD__) && !defined(LINUX_GLIBC_2)
+#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(LINUX_GLIBC_2)
 extern char *sys_errlist[];
 extern int sys_nerr;
 #endif
diff -urN mozilla/cmd/xfe/mozilla.c cmd/xfe/mozilla.c
--- mozilla/cmd/xfe/mozilla.c	Mon Jul 27 21:48:31 1998
+++ cmd/xfe/mozilla.c	Thu Aug 20 19:42:37 1998
@@ -1889,6 +1889,10 @@
 	strcat (buf, "IRIX");
 #elif defined(__FreeBSD__)
 	strcat (buf, "FreeBSD");
+#elif defined(__NetBSD__)
+	strcat (buf, "NetBSD");
+#elif defined(__OpenBSD__)
+	strcat (buf, "OpenBSD");
 #elif defined(__386BSD__)
 	strcat (buf, "BSD/386");
 #elif defined(__osf__)
@@ -3543,7 +3547,7 @@
 
 #else  /* !OLD_UNIX_FILES */
 
-#if !defined(__FreeBSD__) && !defined(MKLINUX) && !defined(LINUX_GLIBC_2)
+#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(MKLINUX) && !defined(LINUX_GLIBC_2)
 extern char *sys_errlist[];
 extern int sys_nerr;
 #endif
diff -urN mozilla/cmd/xfe/prefdialogs.c cmd/xfe/prefdialogs.c
--- mozilla/cmd/xfe/prefdialogs.c	Mon Jul 27 21:48:31 1998
+++ cmd/xfe/prefdialogs.c	Thu Aug 20 19:42:38 1998
@@ -76,7 +76,7 @@
 
 /* For sys_errlist and sys_nerr */
 #include <sys/errno.h>
-#if !defined(__FreeBSD__) && !defined(LINUX_GLIBC_2)
+#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(LINUX_GLIBC_2)
 extern char *sys_errlist[];
 extern int sys_nerr;
 #endif
diff -urN mozilla/cmd/xfe/src/HTMLView.cpp cmd/xfe/src/HTMLView.cpp
--- mozilla/cmd/xfe/src/HTMLView.cpp	Mon Jul 27 21:48:55 1998
+++ cmd/xfe/src/HTMLView.cpp	Thu Aug 20 19:42:36 1998
@@ -350,7 +350,7 @@
   scroller = fe_MakeScrolledWindow (m_contextData, pane, "scroller");
   XtVaSetValues (CONTEXT_DATA (m_contextData)->scrolled,
 				 XmNborderWidth, 0, 
-#if defined(__FreeBSD__)||defined(BSDI)||defined(LINUX)||defined(IRIX)
+#if defined(__FreeBSD__)||defined(BSDI)||defined(LINUX)||defined(IRIX)||defined(__NetBSD__)||defined(__OpenBSD__)
 				 // Allow for resolutions > 1000 pixels.
 				 // This causes the vertical scrollbar not to show
 				 // up on Solaris 2.4, bug in Motif (77998).  
diff -urN mozilla/cmd/xfe/src/context_funcs.cpp cmd/xfe/src/context_funcs.cpp
--- mozilla/cmd/xfe/src/context_funcs.cpp	Mon Jul 27 21:49:11 1998
+++ cmd/xfe/src/context_funcs.cpp	Thu Aug 20 19:42:36 1998
@@ -76,6 +76,11 @@
 #define STATFS statfs
 #elif defined(BSDI)
 #include <sys/mount.h>    /* for statfs() */
+#elif defined(NETBSD)
+#include <sys/mount.h>    /* for statfs() */
+#define STATFS statfs
+#elif defined(OPENBSD)
+#include <sys/mount.h>    /* for statfs() */
 #define STATFS statfs
 #else
 #include <sys/statfs.h>  /* for statfs() */
diff -urN mozilla/config/OpenBSD.mk config/OpenBSD.mk
--- mozilla/config/OpenBSD.mk	Wed Dec 31 16:00:00 1969
+++ config/OpenBSD.mk	Thu Aug 20 21:02:34 1998
@@ -0,0 +1,101 @@
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL.  You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation.  Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+# Reserved.
+#
+
+######################################################################
+# Config stuff for OpenBSD
+######################################################################
+#
+######################################################################
+# Version-independent
+######################################################################
+
+ARCH			:= openbsd
+ifeq (86,$(findstring 86,$(OS_TEST)))
+CPU_ARCH		:= x86
+else
+CPU_ARCH		:= $(OS_TEST)
+endif
+GFX_ARCH		:= x
+
+OS_INCLUDES		= -I/usr/X11R6/include
+G++INCLUDES		= -I/usr/include/g++
+LOC_LIB_DIR		=
+MOTIF			=
+MOTIFLIB		=
+OS_LIBS			=
+
+OS_MINOR		= $(shell echo $(OS_RELEASE) | cut -f2 -d.)
+
+# Don't define BSD, because it's already defined in /usr/include/sys/param.h.
+PLATFORM_FLAGS		= -DOPENBSD $(DSO_CFLAGS)
+MOVEMAIL_FLAGS		= -DHAVE_STRERROR
+PORT_FLAGS		= -DSW_THREADS -DNEED_UINT -DHAVE_LCHOWN -DNTOHL_ENDIAN_H -DHAVE_FILIO_H -DNEED_SYS_TIME_H -DNEED_UINT_T -DHAVE_BSD_FLOCK
+PDJAVA_FLAGS		= -mx128m
+OS_GPROF_FLAGS		= -pg
+LD_FLAGS		= -L/usr/X11R6/lib -lXm
+
+OS_CFLAGS		= $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
+
+LOCALE_MAP		= $(DEPTH)/cmd/xfe/intl/bsd386.lm
+EN_LOCALE		= C
+DE_LOCALE		= de_DE.ISO8859-1
+FR_LOCALE		= fr_FR.ISO8859-1
+JP_LOCALE		= ja
+SJIS_LOCALE		= ja_JP.SJIS
+KR_LOCALE		= ko_KR.EUC
+CN_LOCALE		= zh
+TW_LOCALE		= zh
+I2_LOCALE		= i2
+
+######################################################################
+# Version-specific stuff
+######################################################################
+
+######################################################################
+# Overrides for defaults in config.mk (or wherever)
+######################################################################
+
+DLL_SUFFIX		= so.1.0
+EMACS			= /usr/bin/true
+JAVA_PROG		= $(JAVA_BIN)java
+RANLIB			= /usr/bin/ranlib
+
+######################################################################
+# Other
+######################################################################
+
+ifeq ($(USE_PTHREADS),1)
+OS_LIBS			= -lc_r
+else
+OS_LIBS			= -lc
+PORT_FLAGS		+= -D_PR_LOCAL_THREADS_ONLY
+endif
+
+BUILD_UNIX_PLUGINS	= 1
+
+MKSHLIB			= $(LD) $(DSO_LDOPTS)
+
+DSO_CFLAGS		= -fPIC
+DSO_LDFLAGS		= 
+
+# not all arch's support shared libs
+#
+ifneq (,$(filter alpha mips pmax,$(CPU_ARCH)))
+DSO_LDOPTS		= -shared
+else
+DSO_LDOPTS		= -Bshareable
+endif
diff -urN mozilla/config/config.guess config/config.guess
--- mozilla/config/config.guess	Mon Jul 27 21:44:26 1998
+++ config/config.guess	Thu Aug 20 20:59:19 1998
@@ -196,6 +196,12 @@
     i[3456]86:NetBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-netbsd${UNAME_RELEASE}
 	exit 0 ;;
+    hp3[0-9][05]:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:OpenBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
     *:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux
 	exit 0 ;;
diff -urN mozilla/config/config.mk config/config.mk
--- mozilla/config/config.mk	Mon Jul 27 21:44:26 1998
+++ config/config.mk	Thu Aug 20 19:42:42 1998
@@ -83,7 +83,7 @@
 # but save the version to allow multiple versions of the same base
 # platform to be built in the same tree.
 #
-ifneq (,$(filter FreeBSD HP-UX IRIX Linux NetBSD OSF1 SunOS,$(OS_ARCH)))
+ifneq (,$(filter FreeBSD HP-UX IRIX Linux NetBSD OpenBSD OSF1 SunOS,$(OS_ARCH)))
 OS_VERS		:= $(suffix $(OS_RELEASE))
 OS_RELEASE	:= $(basename $(OS_RELEASE))
 
diff -urN mozilla/config/mkdepend/imakemdep.h config/mkdepend/imakemdep.h
--- mozilla/config/mkdepend/imakemdep.h	Mon Jul 27 21:44:27 1998
+++ config/mkdepend/imakemdep.h	Thu Aug 20 21:01:18 1998
@@ -235,7 +235,7 @@
 #ifdef _CRAY
 #define DEFAULT_CPP "/lib/pcpp"
 #endif
-#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
+#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
 #define DEFAULT_CPP "/usr/libexec/cpp"
 #endif
 #ifdef	MACH
@@ -273,7 +273,7 @@
 #ifdef unix
 	"-Uunix",	/* remove unix symbol so that filename unix.c okay */
 #endif
-#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(MACH)
+#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(MACH)
 # ifdef __i386__
 	"-D__i386__",
 # endif
@@ -715,6 +715,9 @@
 #endif
 #ifdef __NetBSD__
 	{"__NetBSD__", "1"},
+#endif
+#ifdef __OpenBSD__
+	{"__OpenBSD__", "1"},
 #endif
 #ifdef __EMX__
 	{"__EMX__", "1"},
diff -urN mozilla/config/rules.mk config/rules.mk
--- mozilla/config/rules.mk	Mon Jul 27 21:44:27 1998
+++ config/rules.mk	Thu Aug 20 19:42:43 1998
@@ -106,7 +106,7 @@
 ifeq ($(OS_ARCH),HP-UX)
 SHARED_LIBRARY		:= $(LIBRARY:.a=.sl)
 else
-ifneq (,$(filter FreeBSD NetBSD,$(OS_ARCH)))
+ifneq (,$(filter FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
 SHARED_LIBRARY		:= $(LIBRARY:.a=.so.1.0)
 else
 ifeq ($(OS_ARCH)$(OS_RELEASE),SunOS4.1)
diff -urN mozilla/dbm/include/mcom_db.h dbm/include/mcom_db.h
--- mozilla/dbm/include/mcom_db.h	Mon Jul 27 21:43:48 1998
+++ dbm/include/mcom_db.h	Thu Aug 20 19:42:39 1998
@@ -200,7 +200,7 @@
 #define	RET_SUCCESS	 0
 #define	RET_SPECIAL	 1
 
-#if defined(__386BSD__) || defined(SCO)
+#if defined(__386BSD__) || defined(SCO) || defined(__NetBSD__) || defined(__OpenBSD__)
 #define	__BIT_TYPES_DEFINED__
 #endif
 
diff -urN mozilla/js/src/prmjtime.c js/src/prmjtime.c
--- mozilla/js/src/prmjtime.c	Mon Jul 27 21:42:20 1998
+++ js/src/prmjtime.c	Thu Aug 20 19:42:39 1998
@@ -301,7 +301,7 @@
     PRInt64  maxtimet;
     struct tm tm;
     PRMJTime prtm;
-#if defined( XP_PC ) || defined( FREEBSD ) || defined ( HPUX9 ) || defined ( SNI )
+#if defined( XP_PC ) || defined( FREEBSD ) || defined ( HPUX9 ) || defined ( SNI ) || defined( NETBSD ) || defined( OPENBSD )
     struct tm *ptm;
 #endif
 
@@ -320,7 +320,7 @@
     }
     LL_L2UI(local,time);
     PRMJ_basetime(time,&prtm);
-#if defined( XP_PC ) || defined( FREEBSD ) || defined ( HPUX9 ) || defined ( SNI )
+#if defined( XP_PC ) || defined( FREEBSD ) || defined ( HPUX9 ) || defined ( SNI ) || defined( NETBSD ) || defined( OPENBSD )
     ptm = localtime(&local);
     if(!ptm){
       return LL_ZERO;
diff -urN mozilla/modules/libreg/src/vr_stubs.h modules/libreg/src/vr_stubs.h
--- mozilla/modules/libreg/src/vr_stubs.h	Mon Jul 27 21:43:10 1998
+++ modules/libreg/src/vr_stubs.h	Thu Aug 20 19:42:39 1998
@@ -29,7 +29,7 @@
 #ifdef XP_MAC
 #include <stat.h>
 #else
-#if defined(BSDI) && !defined(BSDI_2)
+#if (defined(BSDI) && !defined(BSDI_2)) || defined(NETBSD) || defined(OPENBSD)
 #include <sys/types.h>
 #endif
 #include <sys/stat.h>
diff -urN mozilla/modules/schedulr/src/Makefile modules/schedulr/src/Makefile
--- mozilla/modules/schedulr/src/Makefile	Mon Jul 27 21:43:18 1998
+++ modules/schedulr/src/Makefile	Thu Aug 20 19:42:39 1998
@@ -17,8 +17,8 @@
 
 DEPTH		= ../../..
 
-MODULE		= schedulr 
-LIBRARY_NAME	= sched 
+MODULE		= schedulr
+LIBRARY_NAME	= sched
 
 REQUIRES	= nspr util
 
diff -urN mozilla/network/main/mkconect.c network/main/mkconect.c
--- mozilla/network/main/mkconect.c	Mon Jul 27 21:43:29 1998
+++ network/main/mkconect.c	Thu Aug 20 19:42:40 1998
@@ -81,7 +81,7 @@
 
 #include <resolv.h>
 
-#if !defined(__osf__) && !defined(AIXV3) && !defined(_HPUX_SOURCE) && !defined(__386BSD__) && !defined(__linux) && !defined(SCO_SV)
+#if !defined(__osf__) && !defined(AIXV3) && !defined(_HPUX_SOURCE) && !defined(__386BSD__) && !defined(__linux) && !defined(SCO_SV) && !defined(__NetBSD__) && !defined(__OpenBSD__)
 #include <sys/filio.h>
 #endif
 
diff -urN mozilla/network/main/mksockrw.c network/main/mksockrw.c
--- mozilla/network/main/mksockrw.c	Mon Jul 27 21:43:29 1998
+++ network/main/mksockrw.c	Thu Aug 20 19:42:40 1998
@@ -47,7 +47,7 @@
 
 #include <resolv.h>
 
-#if !defined(__osf__) && !defined(AIXV3) && !defined(_HPUX_SOURCE) && !defined(__386BSD__) && !defined(__linux) && !defined(SCO_SV)
+#if !defined(__osf__) && !defined(AIXV3) && !defined(_HPUX_SOURCE) && !defined(__386BSD__) && !defined(__linux) && !defined(SCO_SV) && !defined(__NetBSD__) && !defined(__OpenBSD__)
 #include <sys/filio.h>
 #endif
 
diff -urN mozilla/network/main/prefetch.c network/main/prefetch.c
--- mozilla/network/main/prefetch.c	Mon Jul 27 21:43:30 1998
+++ network/main/prefetch.c	Thu Aug 20 19:42:41 1998
@@ -177,7 +177,7 @@
       }
 }
 
-PRIVATE void
+MODULE_PRIVATE void
 pre_Finished(URL_Struct* url_struct, int status, MWContext* context)
 {
 	/* this should change to update the colors of 
diff -urN mozilla/network/protocol/ftp/mkftp.c network/protocol/ftp/mkftp.c
--- mozilla/network/protocol/ftp/mkftp.c	Mon Jul 27 21:43:31 1998
+++ network/protocol/ftp/mkftp.c	Thu Aug 20 19:42:41 1998
@@ -60,7 +60,7 @@
 #endif /* XP_OS2 */
 
 #ifdef XP_UNIX
-#if !defined(__osf__) && !defined(AIXV3) && !defined(_HPUX_SOURCE) && !defined(__386BSD__) && !defined(__linux) && !defined(SCO_SV)
+#if !defined(__osf__) && !defined(AIXV3) && !defined(_HPUX_SOURCE) && !defined(__386BSD__) && !defined(__linux) && !defined(SCO_SV) || defined(__NetBSD__) || defined(__OpenBSD__)
 #include <sys/filio.h>
 #endif
 #endif /* XP_UNIX */ 
diff -urN mozilla/nsprpub/config/OpenBSD.mk nsprpub/config/OpenBSD.mk
--- mozilla/nsprpub/config/OpenBSD.mk	Wed Dec 31 16:00:00 1969
+++ nsprpub/config/OpenBSD.mk	Thu Aug 20 19:42:43 1998
@@ -0,0 +1,62 @@
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL.  You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+# 
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+# 
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation.  Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+# Reserved.
+#
+
+#
+# Config stuff for OpenBSD
+#
+
+include $(MOD_DEPTH)/config/UNIX.mk
+
+CC			= gcc
+CCC			= g++
+RANLIB			= ranlib
+
+OS_REL_CFLAGS		=
+ifeq (86,$(findstring 86,$(OS_TEST)))
+CPU_ARCH		= x86
+else
+CPU_ARCH		= $(OS_TEST)
+endif
+
+OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DOPENBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
+
+ifeq ($(USE_PTHREADS),1)
+OS_LIBS			= -lc_r
+# XXX probably should define _THREAD_SAFE too.
+else
+OS_LIBS			= -lc
+DEFINES			+= -D_PR_LOCAL_THREADS_ONLY
+endif
+
+ARCH			= openbsd
+
+DSO_CFLAGS		= -fPIC
+DSO_LDFLAGS		=
+DSO_LDOPTS		= -Bshareable
+ifeq ($(OS_TEST),alpha)
+DSO_LDOPTS		= -shared
+endif
+ifeq ($(OS_TEST),mips)
+DSO_LDOPTS		= -shared
+endif
+ifeq ($(OS_TEST),pmax)  
+DSO_LDOPTS		= -shared
+endif
+
+MKSHLIB			= $(LD) $(DSO_LDOPTS)
+
+G++INCLUDES		= -I/usr/include/g++
diff -urN mozilla/nsprpub/pr/include/md/Makefile nsprpub/pr/include/md/Makefile
--- mozilla/nsprpub/pr/include/md/Makefile	Mon Jul 27 21:43:36 1998
+++ nsprpub/pr/include/md/Makefile	Thu Aug 20 19:42:43 1998
@@ -59,6 +59,10 @@
 MDCPUCFG_H = _netbsd.cfg
 endif
 
+ifeq ($(OS_ARCH),OpenBSD)
+MDCPUCFG_H = _openbsd.cfg
+endif
+
 ifeq ($(OS_ARCH),HP-UX)
 MDCPUCFG_H = _hpux.cfg
 endif
diff -urN mozilla/nsprpub/pr/include/md/_openbsd.cfg nsprpub/pr/include/md/_openbsd.cfg
--- mozilla/nsprpub/pr/include/md/_openbsd.cfg	Wed Dec 31 16:00:00 1969
+++ nsprpub/pr/include/md/_openbsd.cfg	Thu Aug 20 19:42:42 1998
@@ -0,0 +1,262 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL.  You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ * 
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ * 
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation.  Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+ * Reserved.
+ */
+
+#ifndef nspr_cpucfg___
+#define nspr_cpucfg___
+
+#ifndef XP_UNIX
+#define XP_UNIX
+#endif
+
+#ifndef OPENBSD
+#define OPENBSD
+#endif
+
+#if defined(__i386__) || defined(__arm32__)
+
+#define IS_LITTLE_ENDIAN 1
+#undef  IS_BIG_ENDIAN
+#define	HAVE_LONG_LONG
+#undef	HAVE_ALIGNED_DOUBLES
+#undef	HAVE_ALIGNED_LONGLONGS
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   4
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   4
+#define PR_BYTES_PER_DWORD  8
+#define PR_BYTES_PER_WORD_LOG2   2
+#define PR_BYTES_PER_DWORD_LOG2  3
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    32
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    32
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   5
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   5
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    4
+#define PR_ALIGN_OF_INT64   4
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  4
+#define PR_ALIGN_OF_POINTER 4
+
+#elif defined(__sparc__)
+
+#undef IS_LITTLE_ENDIAN 1
+#define  IS_BIG_ENDIAN 1
+#define HAVE_LONG_LONG
+#define  HAVE_ALIGNED_DOUBLES
+#define  HAVE_ALIGNED_LONGLONGS
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   4
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   4
+#define PR_BYTES_PER_DWORD  8
+#define PR_BYTES_PER_WORD_LOG2   2
+#define PR_BYTES_PER_DWORD_LOG2  3
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    32
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    32
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   5
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   5
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    4
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  8
+#define PR_ALIGN_OF_POINTER 4
+
+#elif defined(__alpha__)
+#define IS_LITTLE_ENDIAN 1
+#undef  IS_BIG_ENDIAN
+#define IS_64
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   8
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   8
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    64
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    64
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   6
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   6
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    8
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  8
+#define PR_ALIGN_OF_POINTER 8
+
+#define PR_BYTES_PER_WORD_LOG2  3
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#elif defined(__powerpc__) || defined(__m68k__)
+
+#undef  IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN    1
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   4
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   4
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    32
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    32
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   5
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   5
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    4
+#define PR_ALIGN_OF_INT64   4
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  4
+#define PR_ALIGN_OF_POINTER 4
+
+#define PR_BYTES_PER_WORD_LOG2   2
+#define PR_BYTES_PER_DWORD_LOG2  3
+
+#else
+
+#error Must define constants for type sizes here.
+
+#endif
+
+
+#ifndef NO_NSPR_10_SUPPORT
+
+#define BYTES_PER_BYTE		PR_BYTES_PER_BYTE
+#define BYTES_PER_SHORT 	PR_BYTES_PER_SHORT
+#define BYTES_PER_INT 		PR_BYTES_PER_INT
+#define BYTES_PER_INT64		PR_BYTES_PER_INT64
+#define BYTES_PER_LONG		PR_BYTES_PER_LONG
+#define BYTES_PER_FLOAT		PR_BYTES_PER_FLOAT
+#define BYTES_PER_DOUBLE	PR_BYTES_PER_DOUBLE
+#define BYTES_PER_WORD		PR_BYTES_PER_WORD
+#define BYTES_PER_DWORD		PR_BYTES_PER_DWORD
+
+#define BITS_PER_BYTE		PR_BITS_PER_BYTE
+#define BITS_PER_SHORT		PR_BITS_PER_SHORT
+#define BITS_PER_INT		PR_BITS_PER_INT
+#define BITS_PER_INT64		PR_BITS_PER_INT64
+#define BITS_PER_LONG		PR_BITS_PER_LONG
+#define BITS_PER_FLOAT		PR_BITS_PER_FLOAT
+#define BITS_PER_DOUBLE		PR_BITS_PER_DOUBLE
+#define BITS_PER_WORD		PR_BITS_PER_WORD
+
+#define BITS_PER_BYTE_LOG2	PR_BITS_PER_BYTE_LOG2
+#define BITS_PER_SHORT_LOG2	PR_BITS_PER_SHORT_LOG2
+#define BITS_PER_INT_LOG2	PR_BITS_PER_INT_LOG2
+#define BITS_PER_INT64_LOG2	PR_BITS_PER_INT64_LOG2
+#define BITS_PER_LONG_LOG2	PR_BITS_PER_LONG_LOG2
+#define BITS_PER_FLOAT_LOG2	PR_BITS_PER_FLOAT_LOG2
+#define BITS_PER_DOUBLE_LOG2 	PR_BITS_PER_DOUBLE_LOG2
+#define BITS_PER_WORD_LOG2	PR_BITS_PER_WORD_LOG2
+
+#define ALIGN_OF_SHORT		PR_ALIGN_OF_SHORT
+#define ALIGN_OF_INT		PR_ALIGN_OF_INT
+#define ALIGN_OF_LONG		PR_ALIGN_OF_LONG
+#define ALIGN_OF_INT64		PR_ALIGN_OF_INT64
+#define ALIGN_OF_FLOAT		PR_ALIGN_OF_FLOAT
+#define ALIGN_OF_DOUBLE		PR_ALIGN_OF_DOUBLE
+#define ALIGN_OF_POINTER	PR_ALIGN_OF_POINTER
+#define ALIGN_OF_WORD		PR_ALIGN_OF_WORD
+
+#define BYTES_PER_WORD_LOG2	PR_BYTES_PER_WORD_LOG2
+#define BYTES_PER_DWORD_LOG2	PR_BYTES_PER_DWORD_LOG2
+#define WORDS_PER_DWORD_LOG2	PR_WORDS_PER_DWORD_LOG2
+
+#endif /* NO_NSPR_10_SUPPORT */
+
+#endif /* nspr_cpucfg___ */
diff -urN mozilla/nsprpub/pr/include/md/_openbsd.h nsprpub/pr/include/md/_openbsd.h
--- mozilla/nsprpub/pr/include/md/_openbsd.h	Wed Dec 31 16:00:00 1969
+++ nsprpub/pr/include/md/_openbsd.h	Thu Aug 20 19:53:34 1998
@@ -0,0 +1,171 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL.  You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ * 
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ * 
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation.  Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+ * Reserved.
+ */
+
+#ifndef nspr_openbsd_defs_h___
+#define nspr_openbsd_defs_h___
+
+#include <sys/syscall.h>
+
+#define PR_LINKER_ARCH	"openbsd"
+#define _PR_SI_SYSNAME  "OpenBSD"
+#if defined(__i386__)
+#define _PR_SI_ARCHITECTURE "x86"
+#elif defined(__alpha__)
+#define _PR_SI_ARCHITECTURE "alpha"
+#elif defined(__m68k__)
+#define _PR_SI_ARCHITECTURE "m68k"
+#elif defined(__powerpc__)
+#define _PR_SI_ARCHITECTURE "powerpc"
+#elif defined(__sparc__)
+#define _PR_SI_ARCHITECTURE "sparc"
+#elif defined(__arm32__)
+#define _PR_SI_ARCHITECTURE "arm32"
+#endif
+
+#define PR_DLL_SUFFIX		".so.1.0"
+
+#define _PR_VMBASE              0x30000000
+#define _PR_STACK_VMBASE	0x50000000
+#define _MD_DEFAULT_STACK_SIZE	65536L
+#define _MD_MMAP_FLAGS          MAP_PRIVATE
+
+#undef  HAVE_STACK_GROWING_UP
+#define HAVE_DLL
+#define USE_DLFCN
+#define _PR_HAVE_SOCKADDR_LEN
+
+#define USE_SETJMP
+
+#ifndef _PR_PTHREADS
+#include <setjmp.h>
+
+#define PR_CONTEXT_TYPE	sigjmp_buf
+
+#define CONTEXT(_th) ((_th)->md.context)
+
+#if defined(__i386__) || defined(__sparc__) || defined(__m68k__) || defined(__powerpc__)
+#define JB_SP_INDEX 2
+#elif defined(__alpha__)
+#define JB_SP_INDEX 34
+#elif defined(__arm32__)
+/*
+ * On the arm32, the jmpbuf regs underwent a namechange after NetBSD 1.3
+ */
+#ifdef JMPBUF_REG_R13
+#define JB_SP_INDEX JMPBUF_REG_R13
+#else
+#define JB_SP_INDEX _JB_REG_R13
+#endif
+#else
+#error "Need to define SP index in jmp_buf here"
+#endif
+#define _MD_GET_SP(_th)    (_th)->md.context[JB_SP_INDEX]
+
+#define PR_NUM_GCREGS	_JBLEN
+
+/*
+** Initialize a thread context to run "_main()" when started
+*/
+#define _MD_INIT_CONTEXT(_thread, _sp, _main, status)  \
+{  \
+    *status = PR_TRUE;  \
+    if (sigsetjmp(CONTEXT(_thread), 1)) {  \
+        _main();  \
+    }  \
+    _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
+}
+
+#define _MD_SWITCH_CONTEXT(_thread)  \
+    if (!sigsetjmp(CONTEXT(_thread), 1)) {  \
+        (_thread)->md.errcode = errno;  \
+        _PR_Schedule();  \
+    }
+
+/*
+** Restore a thread context, saved by _MD_SWITCH_CONTEXT
+*/
+#define _MD_RESTORE_CONTEXT(_thread) \
+{   \
+    errno = (_thread)->md.errcode;  \
+    _MD_SET_CURRENT_THREAD(_thread);  \
+    siglongjmp(CONTEXT(_thread), 1);  \
+}
+
+/* Machine-dependent (MD) data structures */
+
+struct _MDThread {
+    PR_CONTEXT_TYPE context;
+    int id;
+    int errcode;
+};
+
+struct _MDThreadStack {
+    PRInt8 notused;
+};
+
+struct _MDLock {
+    PRInt8 notused;
+};
+
+struct _MDSemaphore {
+    PRInt8 notused;
+};
+
+struct _MDCVar {
+    PRInt8 notused;
+};
+
+struct _MDSegment {
+    PRInt8 notused;
+};
+
+struct _MDCPU {
+    struct _MDCPU_Unix md_unix;
+};
+
+#define _MD_INIT_LOCKS()
+#define _MD_NEW_LOCK(lock) PR_SUCCESS
+#define _MD_FREE_LOCK(lock)
+#define _MD_LOCK(lock)
+#define _MD_UNLOCK(lock)
+#define _MD_INIT_IO()
+#define _MD_IOQ_LOCK()
+#define _MD_IOQ_UNLOCK()
+
+#define _MD_INIT_RUNNING_CPU(cpu)       _MD_unix_init_running_cpu(cpu)
+#define _MD_INIT_THREAD                 _MD_InitializeThread
+#define _MD_EXIT_THREAD(thread)
+#define _MD_SUSPEND_THREAD(thread)      _MD_suspend_thread
+#define _MD_RESUME_THREAD(thread)       _MD_resume_thread
+#define _MD_CLEAN_THREAD(_thread)
+
+#endif /* ! _PR_PTHREADS */
+
+#define _MD_EARLY_INIT                  _MD_EarlyInit
+#define _MD_FINAL_INIT			_PR_UnixInit
+#define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
+#define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
+
+/*
+ * We wrapped the select() call.  _MD_SELECT refers to the built-in,
+ * unwrapped version.
+ */
+#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
+#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
+
+#endif /* nspr_openbsd_defs_h___ */
diff -urN mozilla/nsprpub/pr/include/md/_pth.h nsprpub/pr/include/md/_pth.h
--- mozilla/nsprpub/pr/include/md/_pth.h	Mon Jul 27 21:43:36 1998
+++ nsprpub/pr/include/md/_pth.h	Thu Aug 20 19:55:30 1998
@@ -70,7 +70,7 @@
 #define PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
 #elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
 	|| defined(HPUX) || defined(LINUX) || defined(FREEBSD) \
-	|| defined(NETBSD)
+	|| defined(NETBSD) || defined(OPENBSD)
 #define PTHREAD_ZERO_THR_HANDLE(t)        (t) = 0
 #define PTHREAD_THR_HANDLE_IS_ZERO(t)     (t) == 0
 #define PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
@@ -136,7 +136,7 @@
  */
 #if defined(_PR_DCETHREADS) || defined(FREEBSD) \
 	|| (defined(LINUX) && defined(__alpha)) \
-	|| defined(NETBSD)
+	|| defined(NETBSD) || defined(OPENBSD)
 #define PT_NO_ATFORK
 #endif
 
@@ -144,7 +144,7 @@
  * These platforms don't have sigtimedwait()
  */
 #if (defined(AIX) && !defined(AIX4_3)) || defined(LINUX) \
-	|| defined(FREEBSD) || defined(NETBSD)
+	|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD)
 #define PT_NO_SIGTIMEDWAIT
 #endif
 
@@ -186,7 +186,7 @@
  */
 #define PT_PRIO_MIN            1
 #define PT_PRIO_MAX            127
-#elif defined(FREEBSD) || defined(NETBSD) /* XXX */
+#elif defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) /* XXX */
 #define PT_PRIO_MIN            0
 #define PT_PRIO_MAX            126
 #else
@@ -215,7 +215,7 @@
 #define PTHREAD_YIELD()             sched_yield()
 #elif defined(LINUX)
 #define PTHREAD_YIELD()            	sched_yield()
-#elif defined(FREEBSD) || defined(NETBSD)
+#elif defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD)
 #define PTHREAD_YIELD()                 pthread_yield()
 #else
 #error "Need to define PTHREAD_YIELD for this platform"
diff -urN mozilla/nsprpub/pr/include/md/_unixos.h nsprpub/pr/include/md/_unixos.h
--- mozilla/nsprpub/pr/include/md/_unixos.h	Mon Jul 27 21:43:37 1998
+++ nsprpub/pr/include/md/_unixos.h	Thu Aug 20 19:55:25 1998
@@ -50,7 +50,7 @@
         || defined(BSDI) || defined(SONY)
 #include <sys/select.h>
 #elif defined(SUNOS4) || defined(SCO) || defined(FREEBSD) \
-        || defined(NETBSD) || defined(RHAPSODY)
+        || defined(NETBSD) || defined(OPENBSD) || defined(RHAPSODY)
 #include <sys/types.h>
 #elif defined(LINUX)
 #include <sys/time.h>
diff -urN mozilla/nsprpub/pr/include/md/prosdep.h nsprpub/pr/include/md/prosdep.h
--- mozilla/nsprpub/pr/include/md/prosdep.h	Mon Jul 27 21:43:37 1998
+++ nsprpub/pr/include/md/prosdep.h	Thu Aug 20 19:55:20 1998
@@ -62,6 +62,9 @@
 #elif defined(NETBSD)
 #include "md/_netbsd.h"
 
+#elif defined(OPENBSD)
+#include "md/_openbsd.h"
+
 #elif defined(BSDI)
 #include "md/_bsdi.h"
 
diff -urN mozilla/nsprpub/pr/src/md/prosdep.c nsprpub/pr/src/md/prosdep.c
--- mozilla/nsprpub/pr/src/md/prosdep.c	Mon Jul 27 21:43:38 1998
+++ nsprpub/pr/src/md/prosdep.c	Thu Aug 20 19:57:11 1998
@@ -42,7 +42,7 @@
     /* Get page size */
 #ifdef XP_UNIX
 #if defined SUNOS4 || defined LINUX || defined BSDI || defined AIX \
-	|| defined FREEBSD || defined NETBSD || defined RHAPSODY
+	|| defined FREEBSD || defined NETBSD || defined OPENBSD || defined RHAPSODY
     _pr_pageSize = getpagesize();
 #elif defined(HPUX)
     /* I have no idea. Don't get me started. --Rob */
diff -urN mozilla/nsprpub/pr/src/md/unix/Makefile nsprpub/pr/src/md/unix/Makefile
--- mozilla/nsprpub/pr/src/md/unix/Makefile	Mon Jul 27 21:43:38 1998
+++ nsprpub/pr/src/md/unix/Makefile	Thu Aug 20 19:58:35 1998
@@ -61,6 +61,10 @@
 	netbsd.c \
 	$(NULL)
 
+OPENBSD_CSRCS = \
+	openbsd.c \
+	$(NULL)
+
 BSDI_CSRCS = \
 	bsdi.c \
 	$(NULL)
@@ -129,6 +133,9 @@
 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)
diff -urN mozilla/nsprpub/pr/src/md/unix/objs.mk nsprpub/pr/src/md/unix/objs.mk
--- mozilla/nsprpub/pr/src/md/unix/objs.mk	Mon Jul 27 21:43:38 1998
+++ nsprpub/pr/src/md/unix/objs.mk	Thu Aug 20 20:01:22 1998
@@ -53,6 +53,10 @@
 	netbsd.c \
 	$(NULL)
 
+OPENBSD_CSRCS = \
+	openbsd.c \
+	$(NULL)
+
 BSDI_CSRCS = \
 	bsdi.c \
 	$(NULL)
@@ -122,6 +126,9 @@
 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)
diff -urN mozilla/nsprpub/pr/src/md/unix/openbsd.c nsprpub/pr/src/md/unix/openbsd.c
--- mozilla/nsprpub/pr/src/md/unix/openbsd.c	Wed Dec 31 16:00:00 1969
+++ nsprpub/pr/src/md/unix/openbsd.c	Thu Aug 20 20:02:01 1998
@@ -0,0 +1,102 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL.  You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ * 
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ * 
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation.  Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+ * Reserved.
+ */
+
+#include "primpl.h"
+
+#include <signal.h>
+#include <poll.h>
+#include <sys/syscall.h>
+
+void _MD_EarlyInit(void)
+{
+    /*
+     * Ignore FPE because coercion of a NaN to an int causes SIGFPE
+     * to be raised.
+     */
+    struct sigaction act;
+
+    act.sa_handler = SIG_IGN;
+    sigemptyset(&act.sa_mask);
+    act.sa_flags = SA_RESTART;
+    sigaction(SIGFPE, &act, 0);
+}
+
+PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
+{
+#ifndef _PR_PTHREADS
+    if (isCurrent) {
+        (void) sigsetjmp(CONTEXT(t), 1);
+    }
+    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
+    return (PRWord *) CONTEXT(t);
+#else
+    *np = 0;
+    return NULL;
+#endif
+}
+
+#ifndef _PR_PTHREADS
+void
+_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
+{
+    return;
+}
+
+PRStatus
+_MD_InitializeThread(PRThread *thread)
+{
+    return PR_SUCCESS;
+}
+
+PRStatus
+_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
+{
+    PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
+    _PR_MD_SWITCH_CONTEXT(thread);
+    return PR_SUCCESS;
+}
+
+PRStatus
+_MD_WAKEUP_WAITER(PRThread *thread)
+{
+    if (thread) {
+        PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
+    }
+    return PR_SUCCESS;
+}
+
+/* These functions should not be called for OpenBSD */
+void
+_MD_YIELD(void)
+{
+    PR_NOT_REACHED("_MD_YIELD should not be called for OpenBSD.");
+}
+
+PRStatus
+_MD_CREATE_THREAD(
+    PRThread *thread,
+    void (*start) (void *),
+    PRThreadPriority priority,
+    PRThreadScope scope,
+    PRThreadState state,
+    PRUint32 stackSize)
+{
+    PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for OpenBSD.");
+    return PR_FAILURE;
+}
+#endif /* ! _PR_PTHREADS */
diff -urN mozilla/nsprpub/pr/src/md/unix/unix.c nsprpub/pr/src/md/unix/unix.c
--- mozilla/nsprpub/pr/src/md/unix/unix.c	Mon Jul 27 21:43:38 1998
+++ nsprpub/pr/src/md/unix/unix.c	Thu Aug 20 19:59:28 1998
@@ -48,7 +48,7 @@
     || defined(SUNOS4) || defined(NCR) || defined(RHAPSODY)
 #define _PRSockLen_t int
 #elif (defined(AIX) && !defined(AIX4_1)) || defined(FREEBSD) \
-    || defined(NETBSD) || defined(UNIXWARE)
+    || defined(NETBSD) || defined(OPENBSD) || defined(UNIXWARE)
 #define _PRSockLen_t size_t
 #else
 #error "Cannot determine architecture"
diff -urN mozilla/nsprpub/pr/src/md/unix/uxwrap.c nsprpub/pr/src/md/unix/uxwrap.c
--- mozilla/nsprpub/pr/src/md/unix/uxwrap.c	Mon Jul 27 21:43:38 1998
+++ nsprpub/pr/src/md/unix/uxwrap.c	Thu Aug 20 20:01:13 1998
@@ -326,6 +326,8 @@
 int poll(struct pollfd filedes[], int nfds, int timeout)
 #elif defined(NETBSD)
 int poll(struct pollfd *filedes, nfds_t nfds, int timeout)
+#elif defined(OPENBSD)
+int poll(struct pollfd *filedes, int nfds, int timeout)
 #else
 int poll(struct pollfd *filedes, unsigned long nfds, int timeout)
 #endif
diff -urN mozilla/nsprpub/pr/src/pthreads/ptio.c nsprpub/pr/src/pthreads/ptio.c
--- mozilla/nsprpub/pr/src/pthreads/ptio.c	Mon Jul 27 21:43:39 1998
+++ nsprpub/pr/src/pthreads/ptio.c	Thu Aug 20 20:47:53 1998
@@ -75,7 +75,7 @@
 #elif defined(IRIX) || (defined(AIX) && !defined(AIX4_1)) \
     || defined(OSF1) || defined(SOLARIS) \
     || defined(HPUX10_30) || defined(HPUX11) || defined(LINUX) \
-    || defined(FREEBSD) || defined(NETBSD)
+    || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD)
 #define _PRSelectFdSetArg_t fd_set *
 #else
 #error "Cannot determine architecture"
@@ -2506,7 +2506,8 @@
 #endif
 
 #if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
-    || defined(AIX) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD)
+    || defined(AIX) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD) \
+    || defined(OPENBSD)
 #define _PR_FCNTL_FLAGS O_NONBLOCK
 #else
 #error "Can't determine architecture"
diff -urN mozilla/nsprpub/pr/src/pthreads/ptthread.c nsprpub/pr/src/pthreads/ptthread.c
--- mozilla/nsprpub/pr/src/pthreads/ptthread.c	Mon Jul 27 21:43:39 1998
+++ nsprpub/pr/src/pthreads/ptthread.c	Thu Aug 20 20:49:25 1998
@@ -194,11 +194,11 @@
 
     if (EPERM != pt_schedpriv)
     {
-#if !defined(_PR_DCETHREADS) && !defined(FREEBSD) && !defined(NETBSD)
+#if !defined(_PR_DCETHREADS) && !defined(FREEBSD) && !defined(NETBSD) && !defined(OPENBSD)
         struct sched_param schedule;
 #endif
 
-#if !defined(FREEBSD) && !defined(NETBSD)
+#if !defined(FREEBSD) && !defined(NETBSD) && !defined(OPENBSD)
         rv = pthread_attr_setinheritsched(&tattr, PTHREAD_EXPLICIT_SCHED);
         PR_ASSERT(0 == rv);
 #endif
@@ -208,7 +208,7 @@
 #if defined(_PR_DCETHREADS)
         rv = pthread_attr_setprio(&tattr, pt_PriorityMap(priority));
         PR_ASSERT(0 == rv);
-#elif !defined(FREEBSD) && !defined(NETBSD)
+#elif !defined(FREEBSD) && !defined(NETBSD) && !defined(OPENBSD)
         rv = pthread_attr_getschedparam(&tattr, &schedule);
         PR_ASSERT(0 == rv);
         schedule.sched_priority = pt_PriorityMap(priority);
@@ -550,7 +550,7 @@
     rv = pthread_setprio(thred->id, pt_PriorityMap(newPri));
     /* pthread_setprio returns the old priority */
     PR_ASSERT(-1 != rv);
-#elif !defined(FREEBSD) && !defined(NETBSD)
+#elif !defined(FREEBSD) && !defined(NETBSD) && !defined(OPENBSD)
     if (EPERM != pt_schedpriv)
     {
         int policy;
@@ -751,7 +751,7 @@
      * conflict with the use of these two signals in our GC support.
      * So we don't know how to support GC on Linux pthreads.
      */
-#if !defined(LINUX) && !defined(FREEBSD) && !defined(NETBSD)
+#if !defined(LINUX) && !defined(FREEBSD) && !defined(NETBSD) && !defined(OPENBSD)
 	init_pthread_gc_support();
 #endif
 
@@ -1036,7 +1036,7 @@
 	pthread_cond_signal(&me->suspendResumeCV);
 	while (me->suspend & PT_THREAD_SUSPENDED)
 	{
-#if !defined(FREEBSD) && !defined(NETBSD)  /*XXX*/
+#if !defined(FREEBSD) && !defined(NETBSD) && !defined(OPENBSD) /*XXX*/
         PRIntn rv;
 	    sigwait(&sigwait_set, &rv);
 #endif
diff -urN mozilla/sun-java/stubs/include/typedefs_md.h sun-java/stubs/include/typedefs_md.h
--- mozilla/sun-java/stubs/include/typedefs_md.h	Mon Jul 27 21:46:06 1998
+++ sun-java/stubs/include/typedefs_md.h	Thu Aug 20 21:03:16 1998
@@ -43,7 +43,7 @@
 
 typedef prword_t uintVP_t; /* unsigned that is same size as a void pointer */
 
-#if !defined(BSDI) && !defined(IRIX6_2) && !defined(IRIX6_3) && !defined(LINUX) && !defined(SOLARIS2_6) && !defined(HPUX10_20) && !defined(HPUX10_30) && !defined(HPUX11) && !defined(RHAPSODY) && !defined(NETBSD)
+#if !defined(BSDI) && !defined(IRIX6_2) && !defined(IRIX6_3) && !defined(LINUX) && !defined(SOLARIS2_6) && !defined(HPUX10_20) && !defined(HPUX10_30) && !defined(HPUX11) && !defined(RHAPSODY) && !defined(NETBSD) && !defined(OPENBSD)
 typedef int64 int64_t;
 #else
 /*
