]> granicus.if.org Git - postgresql/commitdiff
From: "Billy G. Allie" <Bill.Allie@mug.org>
authorMarc G. Fournier <scrappy@hub.org>
Sat, 17 Jan 1998 23:33:58 +0000 (23:33 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Sat, 17 Jan 1998 23:33:58 +0000 (23:33 +0000)
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.

src/backend/port/univel/port-protos.h
src/configure
src/configure.in
src/include/port/univel.h
src/include/storage/s_lock.h
src/interfaces/libpgtcl/Makefile.in
src/interfaces/libpq/Makefile.in
src/makefiles/Makefile.univel
src/template/univel

index 97d23fe6ac8397409ba394fbbb9d9d4a12ba13e1..9cafdd84e1d2b3f8b69e8f5310fde4f5c7f83da7 100644 (file)
@@ -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
index fbf182efd78f2744e1f7eb98512218abf58e389f..f00af0078877122b63896a2dafa4986dcaccf63e 100755 (executable)
@@ -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 "**************************************************************"
index bf89b8d9516e6a1918ee2f09fcbcf0b4bf27df60..f62b6982679c3c4de974afb800387e32e0e7d720 100644 (file)
@@ -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
index 4acd2b1a7527df003a42fd2ea547beda9ef3b7cd..3be6179f7668b4d1aea9c7a50668cd82ada9776e 100644 (file)
@@ -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
index e3efbc22950e9b3ce10b06814ebee3fb187e25c3..6ad51713a37bf377a10cc1f4ba8a928d7a40f1b1 100644 (file)
@@ -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)
 
index 3b0141def037f057bded73f5c9aa639516b2122e..0552736518bc6579540a98d27daf70929f85fe58 100644 (file)
@@ -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
 
index 2cddba4eeb86d96aeb061a8944cc52c1ab076d50..44eb0bf6aedd28197c19e1726ae56893847dae28 100644 (file)
@@ -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
 
index 3bfc5c0799e8fe0b60890d92a0482e0ec3de0e13..4048f3977b516dd5b6b3cf545a5ed402598907cf 100644 (file)
@@ -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 $@ $<
index a8a5286099249a4c2a7ef4ec29fea3d2ccb8c61f..23770576e2e41d2d42dc86acfc5692ab0746d640 100644 (file)
@@ -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