summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Henderson1996-11-27 08:16:44 +0000
committerBryan Henderson1996-11-27 08:16:44 +0000
commit9c0afeabb7820fa0a3bc469b38a7748450b50a32 (patch)
tree7cef911cec9d8ba5243385d477e0d36e49094793
parenta38365e0ebca0297d4909cb25cccff52cfa735ec (diff)
More stuff to make it compile on various ports.
-rw-r--r--src/Makefile.global4
-rw-r--r--src/backend/libpq/hba.c3
-rw-r--r--src/backend/port/sparc_solaris/port-protos.h11
-rw-r--r--src/backend/port/sparc_solaris/port.c5
-rw-r--r--src/backend/port/ultrix4/port-protos.h9
-rw-r--r--src/backend/postmaster/postmaster.c3
-rw-r--r--src/backend/storage/ipc/shmem.c4
-rw-r--r--src/backend/utils/adt/numutils.c3
-rw-r--r--src/backend/utils/cache/relcache.c3
-rw-r--r--src/backend/utils/fmgr/dfmgr.c3
-rw-r--r--src/bin/initdb/initdb.sh12
-rw-r--r--src/include/config.h102
-rw-r--r--src/include/storage/ipc.h3
-rw-r--r--src/include/strdup.h8
-rw-r--r--src/include/utils/exc.h10
15 files changed, 112 insertions, 71 deletions
diff --git a/src/Makefile.global b/src/Makefile.global
index 35883f63481..828673fe2e8 100644
--- a/src/Makefile.global
+++ b/src/Makefile.global
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.74 1996/11/23 09:50:34 bryanh Exp $
+# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.75 1996/11/27 08:13:44 bryanh Exp $
#
# NOTES
# Essentially all Postgres make files include this file and use the
@@ -606,7 +606,7 @@ ifeq ($(PORTNAME), sparc_solaris)
# cc won't work!
CC= gcc
-LDADD_BE= -ll -ldl
+LDADD_BE= -lsocket -lnsl -ll -ldl
# RANLIB is not used on solaris
RANLIB= touch
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c
index 43e983d2877..76a3ca63fe4 100644
--- a/src/backend/libpq/hba.c
+++ b/src/backend/libpq/hba.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.12 1996/11/16 08:09:16 bryanh Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.13 1996/11/27 08:15:16 bryanh Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,6 +27,7 @@
#include <libpq/libpq.h>
#include <libpq/pqcomm.h>
#include <libpq/hba.h>
+#include <port-protos.h> /* For inet_aton() */
#define CONF_FILE "pg_hba.conf"
diff --git a/src/backend/port/sparc_solaris/port-protos.h b/src/backend/port/sparc_solaris/port-protos.h
index 777e66310f4..9804c48ac95 100644
--- a/src/backend/port/sparc_solaris/port-protos.h
+++ b/src/backend/port/sparc_solaris/port-protos.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: port-protos.h,v 1.1.1.1 1996/07/09 06:21:45 scrappy Exp $
+ * $Id: port-protos.h,v 1.2 1996/11/27 08:15:23 bryanh Exp $
*
*-------------------------------------------------------------------------
*/
@@ -14,6 +14,8 @@
#define PORT_PROTOS_H
#include <dlfcn.h>
+
+#include "config.h" /* For MAXPATHLEN */
#include "fmgr.h" /* for func_ptr */
#include "utils/dynamic_loader.h"
@@ -35,4 +37,11 @@
extern long random(void);
extern void srandom(int seed);
+/* inet_aton.c in backend/port directory */
+extern int inet_aton(const char *cp, struct in_addr *addr);
+
+/* In system library, but can't find prototype in system library .h files */
+extern int gethostname(char *name, int namelen);
+
+
#endif /* PORT_PROTOS_H */
diff --git a/src/backend/port/sparc_solaris/port.c b/src/backend/port/sparc_solaris/port.c
index 2fa72e7d682..eab445a49df 100644
--- a/src/backend/port/sparc_solaris/port.c
+++ b/src/backend/port/sparc_solaris/port.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/port/sparc_solaris/Attic/port.c,v 1.2 1996/11/06 06:48:35 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/port/sparc_solaris/Attic/port.c,v 1.3 1996/11/27 08:15:25 bryanh Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,6 +15,9 @@
#include <stdlib.h>
#include <errno.h>
+
+#include "postgres.h"
+#include "port-protos.h"
#include "rusagestub.h"
long
diff --git a/src/backend/port/ultrix4/port-protos.h b/src/backend/port/ultrix4/port-protos.h
index ea313040d96..c821601fbd0 100644
--- a/src/backend/port/ultrix4/port-protos.h
+++ b/src/backend/port/ultrix4/port-protos.h
@@ -6,13 +6,20 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: port-protos.h,v 1.2 1996/11/26 03:18:58 bryanh Exp $
+ * $Id: port-protos.h,v 1.3 1996/11/27 08:15:30 bryanh Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PORT_PORTOS_H
#define PORT_PORTOS_H
+/*
+ * Externals in libc that need prototypes (or at least declarations)
+ */
+
+extern char *ecvt(double, int, int*, int*);
+extern char *fcvt(double, int, int*, int*);
+
/* dynloader.c */
/*
* New dynamic loader.
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index f654feb7c65..f5864cc5936 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.26 1996/11/24 04:07:00 bryanh Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.27 1996/11/27 08:15:36 bryanh Exp $
*
* NOTES
*
@@ -80,6 +80,7 @@
#include "utils/mcxt.h"
#include "storage/proc.h"
#include "utils/elog.h"
+#include "port-protos.h" /* For gethostname() */
#if defined(DBX_VERSION)
# define FORK() (0)
diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c
index 4badedd32fe..fc04a9088fd 100644
--- a/src/backend/storage/ipc/shmem.c
+++ b/src/backend/storage/ipc/shmem.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.7 1996/11/27 07:20:07 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.8 1996/11/27 08:15:44 bryanh Exp $
*
*-------------------------------------------------------------------------
*/
@@ -59,7 +59,7 @@
*/
#include <stdio.h>
#include <string.h>
-#include <sys/ipc.h>
+
#include "postgres.h"
#include "storage/ipc.h"
#include "storage/shmem.h"
diff --git a/src/backend/utils/adt/numutils.c b/src/backend/utils/adt/numutils.c
index fafcc69273a..db253172b2f 100644
--- a/src/backend/utils/adt/numutils.c
+++ b/src/backend/utils/adt/numutils.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.6 1996/11/06 10:30:58 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.7 1996/11/27 08:15:54 bryanh Exp $
*
*-------------------------------------------------------------------------
*/
@@ -24,6 +24,7 @@
#else
# include <string.h>
#endif
+#include <port-protos.h> /* ecvt(), fcvt() */
int32
pg_atoi(char *s, int size, int c)
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 6918cada212..146135d5967 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.5 1996/11/10 03:03:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.6 1996/11/27 08:16:01 bryanh Exp $
*
*-------------------------------------------------------------------------
*/
@@ -32,6 +32,7 @@
#include <stdio.h> /* for sprintf() */
#include <errno.h>
#include <sys/file.h>
+#include <fcntl.h>
#include <string.h>
#include "postgres.h"
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index 5386afd6a81..131df203c9e 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.3 1996/11/24 04:44:14 bryanh Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.4 1996/11/27 08:16:07 bryanh Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,6 +18,7 @@
#include "postgres.h"
+#include "config.h" /* for MAXPATHLEN */
#include "fmgr.h" /* generated by Gen_fmgrtab.sh */
#include "utils/dynamic_loader.h"
#include "utils/elog.h"
diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh
index 80d80ec47d9..e8d418d8d69 100644
--- a/src/bin/initdb/initdb.sh
+++ b/src/bin/initdb/initdb.sh
@@ -26,7 +26,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.17 1996/11/26 08:12:39 bryanh Exp $
+# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.18 1996/11/27 08:16:16 bryanh Exp $
#
#-------------------------------------------------------------------------
@@ -51,9 +51,11 @@ CMDNAME=`basename $0`
# The 2>/dev/null is to swallow the "postconfig: not found" message if there
# is no postconfig.
-postconfig_result="$(sh -c postconfig 2>/dev/null)"
+postconfig_result=`sh -c postconfig 2>/dev/null`
if [ ! -z $postconfig_result ]; then
- export $postconfig_result
+ set -a # Make the following variable assignment exported to environment
+ eval $postconfig_result
+ set +a # back to normal
fi
# Set defaults:
@@ -131,8 +133,8 @@ if [ -z $PGLIB ]; then
echo "Postgres (the PGLIB directory). You must identify the PGLIB "
echo "directory either with a --pglib invocation option, or by "
echo "setting the PGLIB environment variable, or by having a program "
- echo "called 'postconfig' in your search path that sets the PGLIB "
- echo "environment variable."
+ echo "called 'postconfig' in your search path that outputs an asignment "
+ echo "for PGLIB."
exit 20
fi
diff --git a/src/include/config.h b/src/include/config.h
index ba3e7a953af..5c417f49346 100644
--- a/src/include/config.h
+++ b/src/include/config.h
@@ -17,8 +17,14 @@
#define HAVE_MEMMOVE
-#if defined(sequent)
+#if defined(aix)
+# define CLASS_CONFLICT
+# define DISABLE_XOPEN_NLS
+# define NEED_ISINF
# define NEED_UNION_SEMUN
+# define NEED_SYS_SELECT_H
+# define HAVE_TZSET
+# define HAVE_ANSI_CPP
#endif
#if defined(alpha)
@@ -30,6 +36,19 @@
# define NEED_UNION_SEMUN
#endif
+#if defined(BSD44_derived) || \
+ defined(bsdi)
+# if defined(bsdi)
+# define SIGJMP_BUF
+# endif
+# define USE_LIMITS_H
+# define USE_POSIX_TIME
+# define NEED_CBRT
+# if defined(PRE_BSDI_2_1)
+# define NEED_UNION_SEMUN
+# endif
+#endif
+
#if defined(dgux)
# define LINUX_ELF
# define NEED_UNION_SEMUN
@@ -37,11 +56,34 @@
# define -DUSE_POSIX_SIGNALS
#endif
-#if defined(ultrix4)
-# define NEED_ISINF
+#if defined(hpux)
+# define SIGJMP_BUF
# define USE_POSIX_TIME
+# define HAVE_TZSET
+# define NEED_CBRT
+# define NEED_RINT
# define NEED_UNION_SEMUN
-# define NEED_STRDUP
+#endif
+
+#if defined(i386_solaris)
+# define USE_POSIX_TIME
+# define USE_POSIX_SIGNALS
+# define NEED_ISINF
+# define NEED_RUSAGE
+# define NO_EMPTY_STMTS
+# define HAVE_TZSET
+# define NEED_UNION_SEMUN
+# define SYSV_DIRENT
+#endif
+
+#if defined(irix5)
+# define USE_POSIX_TIME
+# define USE_POSIX_SIGNALS
+# define NEED_ISINF
+# define NO_EMPTY_STMTS
+# define NO_VFORK
+# define HAVE_TZSET
+# define SYSV_DIRENT
#endif
#if defined(linux)
@@ -51,28 +93,19 @@
__USE_BSD is set by bsd/signal.h, and __USE_BSD_SIGNAL appears not to
be used.
*/
+# define SIGJMP_BUF
# define USE_POSIX_TIME
# define HAVE_TZSET
# define NEED_CBRT
#endif
-#if defined(hpux)
-# define USE_POSIX_TIME
-# define HAVE_TZSET
-# define NEED_CBRT
-# define NEED_RINT
-# define NEED_UNION_SEMUN
+#if defined(next)
+# define SIGJMP_BUF
+# define NEED_SIG_JMP
#endif
-#if defined(i386_solaris)
-# define USE_POSIX_TIME
-# define USE_POSIX_SIGNALS
-# define NEED_ISINF
-# define NEED_RUSAGE
-# define NO_EMPTY_STMTS
-# define HAVE_TZSET
+#if defined(sequent)
# define NEED_UNION_SEMUN
-# define SYSV_DIRENT
#endif
#if defined(sparc) && !defined(sparc_solaris)
@@ -103,11 +136,8 @@
# define SYSV_DIRENT
#endif
-#if defined(next)
-# define NEED_SIG_JMP
-#endif
-
#if defined(win32)
+# define SIGJMP_BUF
# define NEED_SIG_JMP
# define NO_UNISTD_H
# define USES_WINSOCK
@@ -118,35 +148,13 @@
# define NEED_ISINF
#endif /* WIN32 */
-#if defined(BSD44_derived) || \
- defined(bsdi)
-# define USE_LIMITS_H
+#if defined(ultrix4)
+# define NEED_ISINF
# define USE_POSIX_TIME
-# define NEED_CBRT
-# ifdef PRE_BSDI_2_1
-# define NEED_UNION_SEMUN
-# endif
-#endif
-
-#if defined(aix)
-# define CLASS_CONFLICT
-# define DISABLE_XOPEN_NLS
-# define NEED_ISINF
# define NEED_UNION_SEMUN
-# define NEED_SYS_SELECT_H
-# define HAVE_TZSET
-# define HAVE_ANSI_CPP
+# define NEED_STRDUP
#endif
-#if defined(irix5)
-# define USE_POSIX_TIME
-# define USE_POSIX_SIGNALS
-# define NEED_ISINF
-# define NO_EMPTY_STMTS
-# define NO_VFORK
-# define HAVE_TZSET
-# define SYSV_DIRENT
-#endif
/*
* The following is used as the arg list for signal handlers. Any ports
diff --git a/src/include/storage/ipc.h b/src/include/storage/ipc.h
index 4af4972e498..1fc38b81b82 100644
--- a/src/include/storage/ipc.h
+++ b/src/include/storage/ipc.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: ipc.h,v 1.9 1996/11/04 04:00:28 momjian Exp $
+ * $Id: ipc.h,v 1.10 1996/11/27 08:16:38 bryanh Exp $
*
* NOTES
* This file is very architecture-specific. This stuff should actually
@@ -22,6 +22,7 @@
#endif
#include <sys/types.h>
+#include <sys/ipc.h> /* For IPC_PRIVATE */
/*
* Many architectures have support for user-level spinlocks (i.e., an
diff --git a/src/include/strdup.h b/src/include/strdup.h
new file mode 100644
index 00000000000..9e07a0f18b8
--- /dev/null
+++ b/src/include/strdup.h
@@ -0,0 +1,8 @@
+/* This is the prototype for the strdup() function which is distributed
+ with Postgres. That strdup() is only needed on those systems that
+ don't already have strdup() in their system libraries.
+
+ The Postgres strdup() is in src/utils/strdup.c.
+*/
+
+extern char* strdup(char const*);
diff --git a/src/include/utils/exc.h b/src/include/utils/exc.h
index f263118c4b5..69fa3591097 100644
--- a/src/include/utils/exc.h
+++ b/src/include/utils/exc.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: exc.h,v 1.4 1996/11/10 03:06:26 momjian Exp $
+ * $Id: exc.h,v 1.5 1996/11/27 08:16:44 bryanh Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,17 +15,15 @@
#include <setjmp.h>
+#include "config.h"
+
extern char *ExcFileName;
extern Index ExcLineNumber;
/*
* ExcMessage and Exception are now defined in c.h
*/
-
-#if defined(hpux) || \
- defined(linux) || \
- defined(next) || \
- defined(WIN32)
+#if !defined(SIGJMP_BUF)
typedef jmp_buf ExcContext;
#else
typedef sigjmp_buf ExcContext;