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.
This commit is contained in:
Marc G. Fournier 1998-01-17 23:33:58 +00:00
parent 98c7cb11de
commit 36c1c94bca
9 changed files with 70 additions and 46 deletions

View 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

23
src/configure vendored
View File

@ -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 "**************************************************************"

View 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

View 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

View 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)

View 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

View 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

View 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 $@ $<

View 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