aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1998-01-17 23:33:58 +0000
committerMarc G. Fournier <scrappy@hub.org>1998-01-17 23:33:58 +0000
commit36c1c94bca30a730bec1bb9f5163ccfbb7565fed (patch)
tree98c64f5e4985dc203b9ca30cfa062af8a485ce8d
parent98c7cb11dea7f0f91662ae6d4ec1fd13b8f9e553 (diff)
downloadpostgresql-36c1c94bca30a730bec1bb9f5163ccfbb7565fed.tar.gz
postgresql-36c1c94bca30a730bec1bb9f5163ccfbb7565fed.zip
From: "Billy G. Allie" <Bill.Allie@mug.org>
The attached patches will allow postgreSQL to compile successfully on SCO UNIXWARE 2.1.x. The patches fix the following problems: 1. Configure did not properly recognize the UNIXWARE system as needing the univel port. It used the sys4 port. 2. Configure did not properly process the CC flag in the template file. 3. There was no working test and set locking implementation for the native UNIXWARE compiler. 4. The test and set locking used for Intel X86 that was selected by defining NEED_I386_TAS_ASM could fail in a multi-processor environment. 5. The makefiles for libpq and libpgtcl did not make a shared library for the univel port.
-rw-r--r--src/backend/port/univel/port-protos.h2
-rwxr-xr-xsrc/configure23
-rw-r--r--src/configure.in23
-rw-r--r--src/include/port/univel.h13
-rw-r--r--src/include/storage/s_lock.h21
-rw-r--r--src/interfaces/libpgtcl/Makefile.in11
-rw-r--r--src/interfaces/libpq/Makefile.in8
-rw-r--r--src/makefiles/Makefile.univel7
-rw-r--r--src/template/univel8
9 files changed, 70 insertions, 46 deletions
diff --git a/src/backend/port/univel/port-protos.h b/src/backend/port/univel/port-protos.h
index 97d23fe6ac8..9cafdd84e1d 100644
--- a/src/backend/port/univel/port-protos.h
+++ b/src/backend/port/univel/port-protos.h
@@ -1,7 +1,7 @@
/*-------------------------------------------------------------------------
*
* port-protos.h--
- * port-specific prototypes for Intel x86/Intel SVR4
+ * port-specific prototypes for Intel x86/UNIXWARE
*
*
* Copyright (c) 1994, Regents of the University of California
diff --git a/src/configure b/src/configure
index fbf182efd78..f00af007887 100755
--- a/src/configure
+++ b/src/configure
@@ -589,13 +589,13 @@ nextstep*) os=nextstep;;
hpux*) os=hpux;;
osf*) os=alpha;;
sco*) os=sco;;
- sysv4*) os=svr4;;
machten*) os=machten;;
sysv4.2*)
case "$host_vendor" in
univel) os=univel;;
*) os=unknown;;
esac ;;
+ sysv4*) os=svr4;;
*) echo ""
echo "*************************************************************"
echo "configure does not currently recognize your operating system,"
@@ -682,16 +682,17 @@ fi
export TEMPLATE
echo ""
-AROPT=`grep AROPT $TEMPLATE | awk -F: '{print $2}'`
-SHARED_LIB=`grep SHARED_LIB $TEMPLATE | awk -F: '{print $2}'`
-CFLAGS=`grep CFLAGS $TEMPLATE | awk -F: '{print $2}'`
-SRCH_INC=`grep SRCH_INC $TEMPLATE | awk -F: '{print $2}'`
-SRCH_LIB=`grep SRCH_LIB $TEMPLATE | awk -F: '{print $2}'`
-USE_LOCALE=`grep USE_LOCALE $TEMPLATE | awk -F: '{print $2}'`
-DLSUFFIX=`grep DLSUFFIX $TEMPLATE | awk -F: '{print $2}'`
-DL_LIB=`grep DL_LIB $TEMPLATE | awk -F: '{print $2}'`
-YACC=`grep YACC $TEMPLATE | awk -F: '{print $2}'`
-YFLAGS=`grep YFLAGS $TEMPLATE | awk -F: '{print $2}'`
+AROPT=`grep '^AROPT:' $TEMPLATE | awk -F: '{print $2}'`
+SHARED_LIB=`grep '^SHARED_LIB:' $TEMPLATE | awk -F: '{print $2}'`
+CFLAGS=`grep '^CFLAGS:' $TEMPLATE | awk -F: '{print $2}'`
+SRCH_INC=`grep '^SRCH_INC:' $TEMPLATE | awk -F: '{print $2}'`
+SRCH_LIB=`grep '^SRCH_LIB:' $TEMPLATE | awk -F: '{print $2}'`
+USE_LOCALE=`grep '^USE_LOCALE:' $TEMPLATE | awk -F: '{print $2}'`
+DLSUFFIX=`grep '^DLSUFFIX:' $TEMPLATE | awk -F: '{print $2}'`
+DL_LIB=`grep '^DL_LIB:' $TEMPLATE | awk -F: '{print $2}'`
+YACC=`grep '^YACC:' $TEMPLATE | awk -F: '{print $2}'`
+YFLAGS=`grep '^YFLAGS:' $TEMPLATE | awk -F: '{print $2}'`
+CC=`grep '^CC:' $TEMPLATE | awk -F: '{print $2}'`
echo "**************************************************************"
diff --git a/src/configure.in b/src/configure.in
index bf89b8d9516..f62b6982679 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -25,13 +25,13 @@ nextstep*) os=nextstep;;
hpux*) os=hpux;;
osf*) os=alpha;;
sco*) os=sco;;
- sysv4*) os=svr4;;
machten*) os=machten;;
sysv4.2*)
case "$host_vendor" in
univel) os=univel;;
*) os=unknown;;
esac ;;
+ sysv4*) os=svr4;;
*) echo ""
echo "*************************************************************"
echo "configure does not currently recognize your operating system,"
@@ -120,16 +120,17 @@ fi
export TEMPLATE
echo ""
-AROPT=`grep AROPT $TEMPLATE | awk -F: '{print $2}'`
-SHARED_LIB=`grep SHARED_LIB $TEMPLATE | awk -F: '{print $2}'`
-CFLAGS=`grep CFLAGS $TEMPLATE | awk -F: '{print $2}'`
-SRCH_INC=`grep SRCH_INC $TEMPLATE | awk -F: '{print $2}'`
-SRCH_LIB=`grep SRCH_LIB $TEMPLATE | awk -F: '{print $2}'`
-USE_LOCALE=`grep USE_LOCALE $TEMPLATE | awk -F: '{print $2}'`
-DLSUFFIX=`grep DLSUFFIX $TEMPLATE | awk -F: '{print $2}'`
-DL_LIB=`grep DL_LIB $TEMPLATE | awk -F: '{print $2}'`
-YACC=`grep YACC $TEMPLATE | awk -F: '{print $2}'`
-YFLAGS=`grep YFLAGS $TEMPLATE | awk -F: '{print $2}'`
+AROPT=`grep '^AROPT:' $TEMPLATE | awk -F: '{print $2}'`
+SHARED_LIB=`grep '^SHARED_LIB:' $TEMPLATE | awk -F: '{print $2}'`
+CFLAGS=`grep '^CFLAGS:' $TEMPLATE | awk -F: '{print $2}'`
+SRCH_INC=`grep '^SRCH_INC:' $TEMPLATE | awk -F: '{print $2}'`
+SRCH_LIB=`grep '^SRCH_LIB:' $TEMPLATE | awk -F: '{print $2}'`
+USE_LOCALE=`grep '^USE_LOCALE:' $TEMPLATE | awk -F: '{print $2}'`
+DLSUFFIX=`grep '^DLSUFFIX:' $TEMPLATE | awk -F: '{print $2}'`
+DL_LIB=`grep '^DL_LIB:' $TEMPLATE | awk -F: '{print $2}'`
+YACC=`grep '^YACC:' $TEMPLATE | awk -F: '{print $2}'`
+YFLAGS=`grep '^YFLAGS:' $TEMPLATE | awk -F: '{print $2}'`
+CC=`grep '^CC:' $TEMPLATE | awk -F: '{print $2}'`
dnl We now need to check for additional directories (include
diff --git a/src/include/port/univel.h b/src/include/port/univel.h
index 4acd2b1a752..3be6179f766 100644
--- a/src/include/port/univel.h
+++ b/src/include/port/univel.h
@@ -3,17 +3,14 @@
#define USE_POSIX_SIGNALS
#define SYSV_DIRENT
-#if 0
#define HAS_TEST_AND_SET
+#define NEED_I386_TAS_ASM
+#define USE_UNIVEL_CC_ASM /***************************************\
+ | Define this if you are compiling with |
+ | the native UNIXWARE C compiler. |
+ \***************************************/
typedef unsigned char slock_t;
-#endif
-
-extern long random(void);
-extern void srandom(int seed);
-extern int strcasecmp(char *s1, char *s2);
-extern int gethostname(char *name, int namelen);
-
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index e3efbc22950..6ad51713a37 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.16 1998/01/13 19:28:39 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.17 1998/01/17 23:33:14 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -294,14 +294,31 @@ tas_dummy()
#if defined(NEED_I386_TAS_ASM)
+#if defined(USE_UNIVEL_CC_ASM)
+asm void S_LOCK(char *lval)
+{
+% lab again;
+/* Upon entry, %eax will contain the pointer to the lock byte */
+ pushl %ebx
+ xchgl %eax,%ebx
+ movb $-1,%al
+again:
+ lock
+ xchgb %al,(%ebx)
+ cmpb $0,%al
+ jne again
+ popl %ebx
+}
+#else
#define S_LOCK(lock) do \
{ \
slock_t _res; \
do \
{ \
- __asm__("xchgb %0,%1": "=q"(_res), "=m"(*lock):"0"(0x1)); \
+ __asm__("lock xchgb %0,%1": "=q"(_res), "=m"(*lock):"0"(0x1)); \
} while (_res != 0); \
} while (0)
+#endif
#define S_UNLOCK(lock) (*(lock) = 0)
diff --git a/src/interfaces/libpgtcl/Makefile.in b/src/interfaces/libpgtcl/Makefile.in
index 3b0141def03..0552736518b 100644
--- a/src/interfaces/libpgtcl/Makefile.in
+++ b/src/interfaces/libpgtcl/Makefile.in
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.1 1998/01/13 04:18:04 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.2 1998/01/17 23:33:32 scrappy Exp $
#
#-------------------------------------------------------------------------
@@ -51,7 +51,14 @@ endif
ifeq ($(PORTNAME), i386_solaris)
install-shlib-dep := install-shlib
shlib := libpgtcl.so.1
- LDFLAGS_SL = -G -z text
+ LDFLAGS_SL = -G -z text -L $(SRCDIR)/interfaces/libpq -lpq
+ CFLAGS += $(CFLAGS_SL)
+endif
+
+ifeq ($(PORTNAME), univel)
+ install-shlib-dep := install-shlib
+ shlib := libpgtcl.so.1
+ LDFLAGS_SL = -G -z text -L $(SRCDIR)/interfaces/libpq -lpq
CFLAGS += $(CFLAGS_SL)
endif
diff --git a/src/interfaces/libpq/Makefile.in b/src/interfaces/libpq/Makefile.in
index 2cddba4eeb8..44eb0bf6aed 100644
--- a/src/interfaces/libpq/Makefile.in
+++ b/src/interfaces/libpq/Makefile.in
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.2 1998/01/13 04:20:51 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.3 1998/01/17 23:33:39 scrappy Exp $
#
#-------------------------------------------------------------------------
@@ -51,6 +51,12 @@ ifeq ($(PORTNAME), i386_solaris)
LDFLAGS_SL = -G -z text
CFLAGS += $(CFLAGS_SL)
endif
+ifeq ($(PORTNAME), univel)
+ install-shlib-dep := install-shlib
+ shlib := libpq.so.1
+ LDFLAGS_SL = -G -z text
+ CFLAGS += $(CFLAGS_SL)
+endif
all: libpq.a $(shlib) c.h
diff --git a/src/makefiles/Makefile.univel b/src/makefiles/Makefile.univel
index 3bfc5c0799e..4048f3977b5 100644
--- a/src/makefiles/Makefile.univel
+++ b/src/makefiles/Makefile.univel
@@ -1,9 +1,4 @@
-#
-# The univel port is almost guaranteed NOT to work yet.
-#
-# MAKE_EXPORTS is required for svr4 loaders that want a file of
-# symbol names to tell them what to export/import.
-#MAKE_EXPORTS= true
+LDFLAGS+= -lc89 -Wl,-Bexport
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
diff --git a/src/template/univel b/src/template/univel
index a8a52860992..23770576e2e 100644
--- a/src/template/univel
+++ b/src/template/univel
@@ -1,10 +1,10 @@
AROPT:crs
-CFLAGS:-I$(SRCDIR)/backend/port/univel
-SHARED_LIB:-fPIC
-ALL:-DHAVE_RUSAGE -m486 -Dsvr4
+CFLAGS:-I$(SRCDIR)/backend/port/univel -Xa -v -DHAVE_RUSAGE -O -K i486,host,inline,loop_unroll -Dsvr4
+SHARED_LIB:-K PIC
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so
YFLAGS:-d
-YACC:bison -y
+YACC:yacc
+CC:cc