From: Bruce Momjian Date: Mon, 18 Jun 2001 21:38:02 +0000 (+0000) Subject: The attached patch enables the contrib subtree to build cleanly under X-Git-Tag: REL7_2_BETA1~1013 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=558fae16e3d09afeb75a8a048ab750d559ff5848;p=postgresql The attached patch enables the contrib subtree to build cleanly under Cygwin with the possible exception of mSQL-interface. Since I don't have mSQL installed, I skipped this tool. Except for dealing with a missing getopt.h (oid2name) and HUGE (seg), the bulk of the patch uses the standard PostgreSQL approach to deal with Windows DLL issues. I tested the build aspect of this patch under Cygwin and Linux without any ill affects. Note that I did not actually attempt to test the code for functionality. The procedure to apply the patch is as follows: $ # save the attachment as /tmp/contrib.patch $ # change directory to the top of the PostgreSQL source tree $ patch -p0 #include #include +#include #include "libpq-fe.h" diff --git a/contrib/pgcrypto/Makefile b/contrib/pgcrypto/Makefile index 85a11c029a..408e1c85f6 100644 --- a/contrib/pgcrypto/Makefile +++ b/contrib/pgcrypto/Makefile @@ -1,5 +1,5 @@ # -# $Header: /cvsroot/pgsql/contrib/pgcrypto/Makefile,v 1.3 2001/02/20 15:34:14 momjian Exp $ +# $Header: /cvsroot/pgsql/contrib/pgcrypto/Makefile,v 1.4 2001/06/18 21:38:02 momjian Exp $ # subdir = contrib/pgcrypto @@ -43,6 +43,7 @@ SO_MAJOR_VERSION = 0 SO_MINOR_VERSION = 1 override CPPFLAGS += $(CRYPTO_CFLAGS) -I$(srcdir) +override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) all: all-lib $(NAME).sql diff --git a/contrib/rserv/Makefile b/contrib/rserv/Makefile index bd2b4f1557..25dfeeacb1 100644 --- a/contrib/rserv/Makefile +++ b/contrib/rserv/Makefile @@ -16,6 +16,7 @@ SCRIPTS = InitRservTest override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) override CFLAGS += $(CFLAGS_SL) +override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) all: $(SQLS) $(TCLS) $(PERLS) $(SCRIPTS) $(SONAME) diff --git a/contrib/seg/Makefile b/contrib/seg/Makefile index 0df4644cf5..4efff4f408 100644 --- a/contrib/seg/Makefile +++ b/contrib/seg/Makefile @@ -1,5 +1,5 @@ # -# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.3 2001/02/20 19:20:28 petere Exp $ +# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.4 2001/06/18 21:38:02 momjian Exp $ # subdir = contrib/seg @@ -15,6 +15,7 @@ SO_MAJOR_VERSION= 1 SO_MINOR_VERSION= 0 override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) +override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) OBJS= seg.o segparse.o segscan.o buffer.o diff --git a/contrib/seg/segparse.y b/contrib/seg/segparse.y index adce19c517..3c2d6c28c0 100644 --- a/contrib/seg/segparse.y +++ b/contrib/seg/segparse.y @@ -11,6 +11,10 @@ #include "postgres.h" #include "utils/elog.h" +#ifdef __CYGWIN__ +#define HUGE HUGE_VAL +#endif /* __CYGWIN__ */ + #undef yylex /* falure to redefine yylex will result in calling the */ #define yylex seg_yylex /* wrong scanner when running inside postgres backend */ diff --git a/contrib/soundex/Makefile b/contrib/soundex/Makefile index 54b4fa0b44..76538e052b 100644 --- a/contrib/soundex/Makefile +++ b/contrib/soundex/Makefile @@ -1,5 +1,5 @@ # -# $Header: /cvsroot/pgsql/contrib/soundex/Attic/Makefile,v 1.9 2000/10/20 21:03:28 petere Exp $ +# $Header: /cvsroot/pgsql/contrib/soundex/Attic/Makefile,v 1.10 2001/06/18 21:38:02 momjian Exp $ # subdir = contrib/soundex @@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX) override CPPFLAGS += -I$(srcdir) override CFLAGS += $(CFLAGS_SL) +override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) all: $(SONAME) $(NAME).sql diff --git a/contrib/string/Makefile b/contrib/string/Makefile index 086b03a6a0..b8eaa85acf 100644 --- a/contrib/string/Makefile +++ b/contrib/string/Makefile @@ -1,5 +1,5 @@ # -# $Header: /cvsroot/pgsql/contrib/string/Attic/Makefile,v 1.14 2001/02/20 19:20:28 petere Exp $ +# $Header: /cvsroot/pgsql/contrib/string/Attic/Makefile,v 1.15 2001/06/18 21:38:02 momjian Exp $ # subdir = contrib/string @@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX) override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) override CFLAGS += $(CFLAGS_SL) +override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) all: $(SONAME) $(NAME).sql diff --git a/contrib/userlock/Makefile b/contrib/userlock/Makefile index ca13469bd6..9ad5170b89 100644 --- a/contrib/userlock/Makefile +++ b/contrib/userlock/Makefile @@ -1,5 +1,5 @@ # -# $Header: /cvsroot/pgsql/contrib/userlock/Attic/Makefile,v 1.14 2001/02/20 19:20:28 petere Exp $ +# $Header: /cvsroot/pgsql/contrib/userlock/Attic/Makefile,v 1.15 2001/06/18 21:38:02 momjian Exp $ # subdir = contrib/userlock @@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX) override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) override CFLAGS += $(CFLAGS_SL) +override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) all: $(SONAME) $(NAME).sql diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 588c2f99de..ce4255cb7d 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: miscadmin.h,v 1.86 2001/06/13 21:44:41 tgl Exp $ + * $Id: miscadmin.h,v 1.87 2001/06/18 21:38:02 momjian Exp $ * * NOTES * some of the information in this file should be moved to @@ -115,7 +115,7 @@ extern int PostmasterMain(int argc, char *argv[]); extern bool Noversion; extern char *DataDir; -extern int MyProcPid; +extern DLLIMPORT int MyProcPid; extern struct Port *MyProcPort; extern long MyCancelKey; @@ -126,7 +126,7 @@ extern char OutputFileName[]; * * extern BackendId MyBackendId; */ -extern Oid MyDatabaseId; +extern DLLIMPORT Oid MyDatabaseId; extern bool IsUnderPostmaster; diff --git a/src/include/storage/shmem.h b/src/include/storage/shmem.h index 04c8bbaf41..2768a772d6 100644 --- a/src/include/storage/shmem.h +++ b/src/include/storage/shmem.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: shmem.h,v 1.28 2001/03/22 04:01:09 momjian Exp $ + * $Id: shmem.h,v 1.29 2001/06/18 21:38:02 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -36,7 +36,7 @@ typedef unsigned long SHMEM_OFFSET; * The macros in this header file can only cope with offsets into this * shared memory region! */ -extern SHMEM_OFFSET ShmemBase; +extern DLLIMPORT SHMEM_OFFSET ShmemBase; /* coerce an offset into a pointer in this process's address space */ diff --git a/src/include/utils/tqual.h b/src/include/utils/tqual.h index a2bcddf862..7c3dece02f 100644 --- a/src/include/utils/tqual.h +++ b/src/include/utils/tqual.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: tqual.h,v 1.30 2001/01/24 19:43:29 momjian Exp $ + * $Id: tqual.h,v 1.31 2001/06/18 21:38:02 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -36,7 +36,7 @@ typedef SnapshotData *Snapshot; extern Snapshot SnapshotDirty; extern Snapshot QuerySnapshot; -extern Snapshot SerializableSnapshot; +extern DLLIMPORT Snapshot SerializableSnapshot; extern bool ReferentialIntegritySnapshotOverride;