diff --git a/src/backend/port/dynloader/unixware.c b/src/backend/port/dynloader/unixware.c
new file mode 100644
index 0000000000000000000000000000000000000000..0ae1c69dee1b60e7fd2c4881c96e6b6cd2ce6339
--- /dev/null
+++ b/src/backend/port/dynloader/unixware.c
@@ -0,0 +1,4 @@
+/* Dummy file used for nothing at this point
+ *
+ * see unixware.h
+ */
diff --git a/src/backend/port/dynloader/unixware.h b/src/backend/port/dynloader/unixware.h
new file mode 100644
index 0000000000000000000000000000000000000000..edc3a3b18e002ce0e812538e5ab632295f6b15bb
--- /dev/null
+++ b/src/backend/port/dynloader/unixware.h
@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ *
+ * unixware.h--
+ *	  port-specific prototypes for Intel x86/UNIXWARE 7
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * unixware.h,v 1.2 1995/03/17 06:40:18 andrew Exp
+ *
+ *-------------------------------------------------------------------------
+  */
+#ifndef PORT_PROTOS_H
+#define PORT_PROTOS_H
+
+#include <dlfcn.h>
+#include "fmgr.h"				/* for func_ptr */
+#include "utils/dynamic_loader.h"
+
+ /* dynloader.c */
+/*
+ * Dynamic Loader on Intel x86/Intel SVR4.
+ *
+ * this dynamic loader uses the system dynamic loading interface for shared
+ * libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
+ * library as the file to be dynamically loaded.
+ *
+  */
+#define pg_dlopen(f)	dlopen(f,RTLD_LAZY)
+#define pg_dlsym		dlsym
+#define pg_dlclose		dlclose
+#define pg_dlerror		dlerror
+
+#endif	/* PORT_PROTOS_H */
diff --git a/src/config.guess b/src/config.guess
index a1563dabf1a5d0b2c087970a5d880e971b203e7d..0db17eaca2f1a62e1c16b673b4c0b21b08ade414 100755
--- a/src/config.guess
+++ b/src/config.guess
@@ -450,6 +450,9 @@ EOF
     i?86:DYNIX/ptx:4*:*)
 	echo i386-sequent-sysv4
 	exit 0 ;;
+    i[34]86:UnixWare:*:*)
+	echo ${UNAME_MACHINE}-unixware-sysv${UNAME_RELEASE}
+	exit 0 ;;
     i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
 		echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
diff --git a/src/configure b/src/configure
index 0236de2bdb0b5dcb694c150a2ef574e51ada6011..8ee5b3948b7d66428d5039bc95f98df67bb6238c 100755
--- a/src/configure
+++ b/src/configure
@@ -626,6 +626,7 @@ nextstep*) os=nextstep need_tas=no ;;
 		    *) os=unknown need_tas=no ;;
        esac ;;
    sysv4*) os=svr4 need_tas=no ;;
+   sysv5*) os=unixware need_tas=no ;;
 *) echo ""
    echo "*************************************************************"
    echo "configure does not currently recognize your operating system,"
diff --git a/src/configure.in b/src/configure.in
index c58a1eb2db07d9e414637c3eb1c2b7522987e264..74a0f4f5957f7ed1ef5c0bb6079aabbb133cf2e6 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -32,6 +32,7 @@ nextstep*) os=nextstep need_tas=no ;;
 		    *) os=unknown need_tas=no ;;
        esac ;;
    sysv4*) os=svr4 need_tas=no ;;
+   sysv5*) os=unixware need_tas=no ;;
 *) echo ""
    echo "*************************************************************"
    echo "configure does not currently recognize your operating system,"
diff --git a/src/include/port/unixware.h b/src/include/port/unixware.h
new file mode 100644
index 0000000000000000000000000000000000000000..e552202f5f97d28be07f353103a632e6de978b48
--- /dev/null
+++ b/src/include/port/unixware.h
@@ -0,0 +1,32 @@
+#define USE_POSIX_TIME
+#define NO_EMPTY_STMTS
+#define USE_POSIX_SIGNALS
+#define SYSV_DIRENT
+
+#define HAS_TEST_AND_SET
+#define NEED_I386_TAS_ASM
+/***************************************
+ * Define this if you are compiling with
+ * the native UNIXWARE C compiler.
+ ***************************************/
+#define UNIXWARE
+typedef unsigned char slock_t;
+
+/***************************************************************
+ * The following include will get the needed prototype for the 
+ * strcasecmp() function. 
+ ***************************************************************/
+#include <strings.h>
+
+#ifndef			BIG_ENDIAN
+#define			BIG_ENDIAN		4321
+#endif
+#ifndef			LITTLE_ENDIAN
+#define			LITTLE_ENDIAN	1234
+#endif
+#ifndef			PDP_ENDIAN
+#define			PDP_ENDIAN		3412
+#endif
+#ifndef			BYTE_ORDER
+#define			BYTE_ORDER		LITTLE_ENDIAN
+#endif
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 70a0f4226c4648b11af1ce82ba1855487c2583f9..e3658b742cd6a0a63499c3f3845db1391f311af5 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.40 1998/07/19 01:19:54 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.41 1998/07/19 04:16:59 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -188,23 +188,22 @@ tas(volatile slock_t *lock)
 #if defined(NEED_I386_TAS_ASM)
 /* non gcc i386 based things */
 
-#if defined(USE_UNIVEL_CC)
+#if defined(USE_UNIVEL_CC) || defined(UNIXWARE)
 #define TAS(lock)	tas(lock)
 
-asm int
+asm int 
 tas(slock_t *s_lock)
 {
-	%lab locked;
-	/* Upon entry, %eax will contain the pointer to the lock byte */
-	pushl % ebx
-	xchgl % eax, %ebx
-	xor % eax, %eax
-	movb $255, %al
+% mem s_lock
+	pushl	%ebx
+	movl	s_lock,%ebx
+	movl	$255,%eax
 	lock
-	xchgb % al, (%ebx)
-	popl % ebx
+	xchgb	%al,(%ebx)
+	popl	%ebx
 }
-#endif /* USE_UNIVEL_CC */
+
+#endif /* USE_UNIVEL_CC || UNIXWARE */
 
 #endif /* NEED_I386_TAS_ASM */
 
diff --git a/src/include/version.h.in b/src/include/version.h.in
index 699b136bfbdeebad59702e5eeb0fdbe594f7e16b..e295925d669cf2b5b4584d932fb24d4f133396cd 100644
--- a/src/include/version.h.in
+++ b/src/include/version.h.in
@@ -4,7 +4,7 @@
  *	  this file contains the interface to version.c.
  *	  Also some parameters.
  *
- * $Header: /cvsroot/pgsql/src/include/Attic/version.h.in,v 1.2 1998/06/09 22:59:04 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/include/Attic/version.h.in,v 1.3 1998/07/19 04:16:53 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -20,6 +20,6 @@ void SetPgVersion(const char *path, char **reason_p);
 
 #define PG_VERFILE		"PG_VERSION"
 
-#define PG_VERSION_STR  "PostgreSQL " ## PG_RELEASE ## "." ## PG_VERSION ## "." ## PG_SUBVERSION ## " on @host@, compiled by @CC@ @CC_VERSION@"
+#define PG_VERSION_STR  "PostgreSQL " PG_RELEASE "." PG_VERSION "." PG_SUBVERSION " on @host@, compiled by @CC@ @CC_VERSION@"
 
 #endif
diff --git a/src/makefiles/Makefile.unixware b/src/makefiles/Makefile.unixware
new file mode 100644
index 0000000000000000000000000000000000000000..442994ca4f785c71c9f8478940bbe8b41586d328
--- /dev/null
+++ b/src/makefiles/Makefile.unixware
@@ -0,0 +1,7 @@
+LDFLAGS+= -Wl,-Bexport
+
+%.so: %.o
+	$(LD) -G -Bdynamic -o $@ $<
+
+INSTALL= /usr/ucb/install
+
diff --git a/src/template/unixware b/src/template/unixware
new file mode 100644
index 0000000000000000000000000000000000000000..d68d4aaa63a0ce298655c22328ea251fb7bc6985
--- /dev/null
+++ b/src/template/unixware
@@ -0,0 +1,8 @@
+AROPT:crs
+CFLAGS:-Xa -v -O -K i486,host,inline,loop_unroll,alloca -Dsvr4
+SHARED_LIB:-K PIC
+SRCH_INC:
+SRCH_LIB:
+USE_LOCALE:no
+DLSUFFIX:.so
+CC:cc