From: Bruce Momjian Date: Fri, 5 Jul 1996 08:51:02 -0400 (EDT) Subject: [PG95]: patch for BSD/OS(BSDI) 2.1 ============================================================================ POSTGRES95 BUG REPORT TEMPLATE ============================================================================ Your name : Bruce Momjian Your email address : root@candle.pha.pa.us System Configuration - --------------------- Architecture (example: Intel Pentium) : Intel 486 Operating System (example: Linux 1.3.42 ELF) : BSD/OS(BSDI) 2.1 Postgres95 version (example: Postgres95-1.01) : Postgres95-1.01 Compiler used (example: gcc 2.7.0) : 2.7.2 Please enter a FULL description of your problem: - ------------------------------------------------ BSD/OS(BSDI) 2.1 has some changes from 2.0 and 2.0.1. This causes 2.1 compiles to fail. Attached is a context diff file that adds a bsdi_2_1 port that will compile cleanly under BSD/OS(BSDI) 2.1. It would have been more logical to change the bsdi port to bsdi_2_0 too, but the diff's would have been too complicated. Here are a summary of the changes: BSD/OS 2.1 includes a semaphore header called /usr/include/sem.h which defines semun. BSD/OS 2.1 includes a dynamic link library included with the OS. Also, the native lex understands the lexical syntax, so flex is not necessary. slock.c did not have a bsdi port defined. - --------------------------------------------------------------------------- diff -Prc src.orig/Makefile.global src/Makefile.global *** src.orig/Makefile.global Mon Feb 26 14:26:32 1996 - --- src/Makefile.global Thu Jul 4 23:02:04 1996 *************** *** 43,48 **** - --- 43,49 ---- # "LINUX_ELF=1" in src/mk/port/postgres.mk.linux) # BSD44_derived - OSs derived from 4.4-lite BSD (NetBSD, FreeBSD) # bsdi - BSD/OS 2.0 and 2.01 + # bsdi_2_1 - BSD/OS 2.1 # aix - IBM on AIX 3.2.5 # irix5 - SGI MIPS on IRIX 5.3 # Some hooks are provided for *************** *** 56,62 **** # until after this file is processed! # make sure that you have no whitespaces after the PORTNAME setting # or the makefiles can get confused ! PORTNAME= alpha # POSTGRESLOGIN is the login name of the user who gets special # privileges within the database. By default it is "postgres", but - --- 57,63 ---- # until after this file is processed! # make sure that you have no whitespaces after the PORTNAME setting # or the makefiles can get confused ! PORTNAME= bsdi_2_1 # POSTGRESLOGIN is the login name of the user who gets special # privileges within the database. By default it is "postgres", but *************** *** 131,137 **** # Comment out CDEBUG to turn off debugging and sanity-checking. # # XXX on MIPS, use -g3 if you want to compile with -O ! CDEBUG= -g # turn this on if you prefer European style dates instead of American # style dates - --- 132,138 ---- # Comment out CDEBUG to turn off debugging and sanity-checking. # # XXX on MIPS, use -g3 if you want to compile with -O ! CDEBUG= -O # turn this on if you prefer European style dates instead of American # style dates diff -Prc src.orig/backend/bootstrap/bootstrap.c src/backend/bootstrap/bootstrap.c *** src.orig/backend/bootstrap/bootstrap.c Fri Feb 23 19:03:17 1996 - --- src/backend/bootstrap/bootstrap.c Thu Jul 4 22:55:31 1996 *************** *** 184,190 **** * error handling / abort routines * ---------------- */ ! #if !defined(PORTNAME_bsdi) void err() { Warnings++; - --- 184,190 ---- * error handling / abort routines * ---------------- */ ! #if !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1) void err() { Warnings++; diff -Prc src.orig/backend/optimizer/path/costsize.c src/backend/optimizer/path/costsize.c *** src.orig/backend/optimizer/path/costsize.c Fri Feb 23 19:31:18 1996 - --- src/backend/optimizer/path/costsize.c Thu Jul 4 22:55:57 1996 *************** *** 17,23 **** #include #define MAXINT INT_MAX #else ! # if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) # include # define MAXINT INT_MAX # else - --- 17,23 ---- #include #define MAXINT INT_MAX #else ! # if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1) # include # define MAXINT INT_MAX # else diff -Prc src.orig/backend/port/bsdi_2_1/Makefile.inc src/backend/port/bsdi_2_1/Makefile.inc *** src.orig/backend/port/bsdi_2_1/Makefile.inc Wed Dec 31 19:00:00 1969 - --- src/backend/port/bsdi_2_1/Makefile.inc Thu Jul 4 22:55:57 1996 *************** *** 0 **** - --- 1,14 ---- + #------------------------------------------------------------------------- + # + # Makefile.inc-- + # Makefile for port/bsdi_2_1 + # + # NOTES + # The BSD/OS port is included here by courtesy of Kurt Lidl. + # + # (5) 1994, Kurt Lidl, lidl@pix.com + # + #------------------------------------------------------------------------- + + CFLAGS+=-DUSE_POSIX_TIME -DNEED_CBRT + LDADD+= -ldl -lipc diff -Prc src.orig/backend/port/bsdi_2_1/machine.h src/backend/port/bsdi_2_1/machine.h *** src.orig/backend/port/bsdi_2_1/machine.h Wed Dec 31 19:00:00 1969 - --- src/backend/port/bsdi_2_1/machine.h Thu Jul 4 22:38:08 1996 *************** *** 0 **** - --- 1,18 ---- + /*------------------------------------------------------------------------- + * + * machine.h-- + * + * + * + * Copyright (c) 1994, Regents of the University of California + * + * machine.h,v 1.1.1.1 1994/11/07 05:19:37 andrew Exp + * + *------------------------------------------------------------------------- + */ + #ifndef MACHINE_H + #define MACHINE_H + + #define BLCKSZ 8192 + + #endif diff -Prc src.orig/backend/port/bsdi_2_1/port-protos.h src/backend/port/bsdi_2_1/port-protos.h *** src.orig/backend/port/bsdi_2_1/port-protos.h Wed Dec 31 19:00:00 1969 - --- src/backend/port/bsdi_2_1/port-protos.h Thu Jul 4 22:42:15 1996 *************** *** 0 **** - --- 1,28 ---- + /*------------------------------------------------------------------------- + * + * port-protos.h-- + * port-specific prototypes for SunOS 4 + * + * + * Copyright (c) 1994, Regents of the University of California + * + * port-protos.h,v 1.2 1995/05/25 22:51:03 andrew Exp + * + *------------------------------------------------------------------------- + */ + #ifndef PORT_PROTOS_H + #define PORT_PROTOS_H + + #include "fmgr.h" /* for func_ptr */ + #include "utils/dynamic_loader.h" + + /* dynloader.c */ + + #define pg_dlopen(f) dlopen(f, 1) + #define pg_dlsym dlsym + #define pg_dlclose dlclose + #define pg_dlerror dlerror + + /* port.c */ + + #endif /* PORT_PROTOS_H */ diff -Prc src.orig/backend/port/bsdi_2_1/port.c src/backend/port/bsdi_2_1/port.c *** src.orig/backend/port/bsdi_2_1/port.c Wed Dec 31 19:00:00 1969 - --- src/backend/port/bsdi_2_1/port.c Thu Jul 4 22:38:08 1996 *************** *** 0 **** - --- 1,13 ---- + /*------------------------------------------------------------------------- + * + * port.c-- + * Linux-specific routines + * + * Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * /usr/local/devel/pglite/cvs/src/backend/port/linux/port.c,v 1.1.1.1 1994/11/07 05:19:38 andrew Exp + * + *------------------------------------------------------------------------- + */ diff -Prc src.orig/backend/postmaster/postmaster.c src/backend/postmaster/postmaster.c *** src.orig/backend/postmaster/postmaster.c Fri Feb 23 19:38:30 1996 - --- src/backend/postmaster/postmaster.c Thu Jul 4 22:55:57 1996 *************** *** 49,55 **** #define MAXINT INT_MAX #else #include /* for MAXHOSTNAMELEN on some */ ! # if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) # include # define MAXINT INT_MAX # else - --- 49,55 ---- #define MAXINT INT_MAX #else #include /* for MAXHOSTNAMELEN on some */ ! # if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1) # include # define MAXINT INT_MAX # else diff -Prc src.orig/backend/storage/ipc/s_lock.c src/backend/storage/ipc/s_lock.c *** src.orig/backend/storage/ipc/s_lock.c Mon Feb 26 14:24:03 1996 - --- src/backend/storage/ipc/s_lock.c Thu Jul 4 22:47:50 1996 *************** *** 381,387 **** * Linux and friends */ ! #if defined(PORTNAME_linux) || defined(PORTNAME_BSD44_derived) int tas(slock_t *m) - --- 381,387 ---- * Linux and friends */ ! #if defined(PORTNAME_linux) || defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1) int tas(slock_t *m) *************** *** 410,416 **** S_UNLOCK(lock); } ! #endif /* PORTNAME_linux || PORTNAME_BSD44_derived */ #endif /* HAS_TEST_AND_SET */ - --- 410,416 ---- S_UNLOCK(lock); } ! #endif /* PORTNAME_linux || PORTNAME_BSD44_derived || PORTNAME_bsdi || PORTNAME_bsdi_2_1 */ #endif /* HAS_TEST_AND_SET */ diff -Prc src.orig/backend/utils/Gen_fmgrtab.sh src/backend/utils/Gen_fmgrtab.sh *** src.orig/backend/utils/Gen_fmgrtab.sh Fri Feb 23 21:19:04 1996 - --- src/backend/utils/Gen_fmgrtab.sh Thu Jul 4 22:55:57 1996 *************** *** 195,206 **** #ifdef WIN32 #include #else ! # if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) # include # define MAXINT INT_MAX # else # include /* for MAXINT */ ! # endif /* PORTNAME_BSD44_derived || PORTNAME_bsdi */ #endif /* WIN32 */ #include "utils/fmgrtab.h" - --- 195,206 ---- #ifdef WIN32 #include #else ! # if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1) # include # define MAXINT INT_MAX # else # include /* for MAXINT */ ! # endif /* PORTNAME_BSD44_derived || PORTNAME_bsdi || PORTNAME_bsdi_2_1 */ #endif /* WIN32 */ #include "utils/fmgrtab.h" diff -Prc src.orig/backend/utils/adt/misc.c src/backend/utils/adt/misc.c *** src.orig/backend/utils/adt/misc.c Fri Feb 23 20:03:14 1996 - --- src/backend/utils/adt/misc.c Thu Jul 4 22:55:57 1996 *************** *** 18,24 **** #include "utils/builtins.h" #if !defined(PORTNAME_linux) && !defined(PORTNAME_BSD44_derived) && \ ! !defined(PORTNAME_irix5) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_aix) extern int random(); extern int srandom(unsigned); #endif - --- 18,24 ---- #include "utils/builtins.h" #if !defined(PORTNAME_linux) && !defined(PORTNAME_BSD44_derived) && \ ! !defined(PORTNAME_irix5) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1) && !defined(PORTNAME_aix) extern int random(); extern int srandom(unsigned); #endif diff -Prc src.orig/backend/utils/adt/numutils.c src/backend/utils/adt/numutils.c *** src.orig/backend/utils/adt/numutils.c Fri Feb 23 20:03:15 1996 - --- src/backend/utils/adt/numutils.c Thu Jul 4 22:55:57 1996 *************** *** 132,138 **** int ftoa(double value, char *ascii, int width, int prec1, char format) { ! #if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) char out[256]; char fmt[256]; int ret; - --- 132,138 ---- int ftoa(double value, char *ascii, int width, int prec1, char format) { ! #if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1) char out[256]; char fmt[256]; int ret; diff -Prc src.orig/backend/utils/error/elog.c src/backend/utils/error/elog.c *** src.orig/backend/utils/error/elog.c Fri Feb 23 20:03:53 1996 - --- src/backend/utils/error/elog.c Thu Jul 4 22:55:57 1996 *************** *** 48,54 **** char buf[ELOG_MAXLEN], line[ELOG_MAXLEN]; register char *bp, *cp; extern int errno, sys_nerr; ! #if !defined(PORTNAME_BSD44_derived) && !defined(PORTNAME_bsdi) extern char *sys_errlist[]; #endif /* !PORTNAME_BSD44_derived */ #ifndef PG_STANDALONE - --- 48,54 ---- char buf[ELOG_MAXLEN], line[ELOG_MAXLEN]; register char *bp, *cp; extern int errno, sys_nerr; ! #if !defined(PORTNAME_BSD44_derived) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1) extern char *sys_errlist[]; #endif /* !PORTNAME_BSD44_derived */ #ifndef PG_STANDALONE diff -Prc src.orig/backend/utils/error/exc.c src/backend/utils/error/exc.c *** src.orig/backend/utils/error/exc.c Fri Feb 23 20:03:54 1996 - --- src/backend/utils/error/exc.c Thu Jul 4 22:55:57 1996 *************** *** 90,96 **** { extern int errno; extern int sys_nerr; ! #if !defined(PORTNAME_BSD44_derived) && !defined(PORTNAME_bsdi) extern char *sys_errlist[]; #endif /* !PORTNAME_BSD44_derived */ - --- 90,96 ---- { extern int errno; extern int sys_nerr; ! #if !defined(PORTNAME_BSD44_derived) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1) extern char *sys_errlist[]; #endif /* !PORTNAME_BSD44_derived */ diff -Prc src.orig/mk/port/postgres.mk.bsdi_2_1 src/mk/port/postgres.mk.bsdi_2_1 *** src.orig/mk/port/postgres.mk.bsdi_2_1 Wed Dec 31 19:00:00 1969 - --- src/mk/port/postgres.mk.bsdi_2_1 Thu Jul 4 22:55:57 1996 *************** *** 0 **** - --- 1,40 ---- + #------------------------------------------------------------------------- + # + # postgres.mk.bsdi-- + # Intel x86/BSDi v2.0 specific rules and variables + # + # for questions about the BSD/OS port, contact Kurt Lidl (lidl@pix.com) + # + # Copyright (c) 1994-5, Regents of the University of California + # + # NOTE + # you may remove lines that start with ## which are general comments + #------------------------------------------------------------------------- + ifndef MK_PORT + MK_PORT= bsdi_2_1 + + # cc is gcc v1.42 + # gcc is gcc v2.6.3 + CC= gcc + + RANLIB= ranlib + INSTALL= install + LEX= lex + AROPT= cq + + # use the regex library + USE_REGEX = 1 + + LDADD_BE= -ldl -lcompat + + # + # for postgres.user.mk + # + SLSUFF= .o + + # + # for postgres.mk + # + CFLAGS_OPT= -O -DUSE_POSIX_SIGNALS # -O2 + + endif - -- Bruce Momjian | 830 Blythe Avenue root@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026 + If your life is a hard drive, | (610) 353-9879(w) + Christ can be your backup. | (610) 853-3000(h)