summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2001-06-18 21:38:02 +0000
committerBruce Momjian2001-06-18 21:38:02 +0000
commit7263ceeb8ccfe12721dcd3957c1a446984e2f5dc (patch)
tree752443f6809f29ce0621be7f2cf80e8434dee20c
parent29fd03fdaae19477ae634d61ba485a5848db5bc6 (diff)
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 </tmp/contrib.patch Jason
-rw-r--r--contrib/array/Makefile1
-rw-r--r--contrib/cube/Makefile1
-rw-r--r--contrib/dblink/Makefile1
-rw-r--r--contrib/earthdistance/Makefile1
-rw-r--r--contrib/fulltextindex/Makefile1
-rw-r--r--contrib/intarray/Makefile1
-rw-r--r--contrib/isbn_issn/Makefile1
-rw-r--r--contrib/lo/Makefile1
-rw-r--r--contrib/miscutil/Makefile1
-rw-r--r--contrib/noupdate/Makefile1
-rw-r--r--contrib/oid2name/oid2name.c1
-rw-r--r--contrib/pgcrypto/Makefile1
-rw-r--r--contrib/rserv/Makefile1
-rw-r--r--contrib/seg/Makefile1
-rw-r--r--contrib/seg/segparse.y4
-rw-r--r--contrib/soundex/Makefile1
-rw-r--r--contrib/string/Makefile1
-rw-r--r--contrib/userlock/Makefile1
-rw-r--r--src/include/miscadmin.h4
-rw-r--r--src/include/storage/shmem.h2
-rw-r--r--src/include/utils/tqual.h2
21 files changed, 25 insertions, 4 deletions
diff --git a/contrib/array/Makefile b/contrib/array/Makefile
index b12894282b..062a913714 100644
--- a/contrib/array/Makefile
+++ b/contrib/array/Makefile
@@ -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/cube/Makefile b/contrib/cube/Makefile
index 38ee704061..81ce84b83c 100644
--- a/contrib/cube/Makefile
+++ b/contrib/cube/Makefile
@@ -15,6 +15,7 @@ SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 0
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
+override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
OBJS= cube.o cubeparse.o cubescan.o buffer.o
diff --git a/contrib/dblink/Makefile b/contrib/dblink/Makefile
index 6bb4bfe113..71e34b8c33 100644
--- a/contrib/dblink/Makefile
+++ b/contrib/dblink/Makefile
@@ -12,6 +12,7 @@ override CFLAGS += -I$(srcdir)
override CFLAGS += -I$(include_srcdir)
override CFLAGS += -I$(libpq_srcdir)
override CFLAGS += $(CFLAGS_SL)
+override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
OBJS = $(NAME).o
diff --git a/contrib/earthdistance/Makefile b/contrib/earthdistance/Makefile
index ab96b9a6dc..f69dcf571f 100644
--- a/contrib/earthdistance/Makefile
+++ b/contrib/earthdistance/Makefile
@@ -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/fulltextindex/Makefile b/contrib/fulltextindex/Makefile
index f54ec2c224..fc88524fc8 100644
--- a/contrib/fulltextindex/Makefile
+++ b/contrib/fulltextindex/Makefile
@@ -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/intarray/Makefile b/contrib/intarray/Makefile
index 05e42a0b33..9a5331be35 100644
--- a/contrib/intarray/Makefile
+++ b/contrib/intarray/Makefile
@@ -13,6 +13,7 @@ SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 0
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
+override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
OBJS= _int.o
diff --git a/contrib/isbn_issn/Makefile b/contrib/isbn_issn/Makefile
index a5dc7baa85..bfa0377a49 100644
--- a/contrib/isbn_issn/Makefile
+++ b/contrib/isbn_issn/Makefile
@@ -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/lo/Makefile b/contrib/lo/Makefile
index 684dae0237..f593e7d2cf 100644
--- a/contrib/lo/Makefile
+++ b/contrib/lo/Makefile
@@ -14,6 +14,7 @@ MODS = $(NAME)$(DLSUFFIX)
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
override CFLAGS += $(CFLAGS_SL)
+override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
ifdef REFINT_VERBOSE
override CPPFLAGS+= -DREFINT_VERBOSE
diff --git a/contrib/miscutil/Makefile b/contrib/miscutil/Makefile
index c84b8422ea..46ba47724e 100644
--- a/contrib/miscutil/Makefile
+++ b/contrib/miscutil/Makefile
@@ -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/noupdate/Makefile b/contrib/noupdate/Makefile
index c402ca9604..412c160f81 100644
--- a/contrib/noupdate/Makefile
+++ b/contrib/noupdate/Makefile
@@ -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/oid2name/oid2name.c b/contrib/oid2name/oid2name.c
index a823c5f50b..2bfb0a2a52 100644
--- a/contrib/oid2name/oid2name.c
+++ b/contrib/oid2name/oid2name.c
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
+#include <getopt.h>
#include "libpq-fe.h"
diff --git a/contrib/pgcrypto/Makefile b/contrib/pgcrypto/Makefile
index af787424cc..753e38aed8 100644
--- a/contrib/pgcrypto/Makefile
+++ b/contrib/pgcrypto/Makefile
@@ -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 8b4d8977be..ae0cab4a85 100644
--- a/contrib/seg/Makefile
+++ b/contrib/seg/Makefile
@@ -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 c076a89edc..4ee0c0b5db 100644
--- a/contrib/soundex/Makefile
+++ b/contrib/soundex/Makefile
@@ -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 7bb28c68d3..7f3f3835e8 100644
--- a/contrib/string/Makefile
+++ b/contrib/string/Makefile
@@ -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 83076664a6..0d391450c5 100644
--- a/contrib/userlock/Makefile
+++ b/contrib/userlock/Makefile
@@ -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 96630a6c7e..3f52bd886e 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -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 a803770517..b51e57062c 100644
--- a/src/include/storage/shmem.h
+++ b/src/include/storage/shmem.h
@@ -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 263bf26eeb..29fd845c7c 100644
--- a/src/include/utils/tqual.h
+++ b/src/include/utils/tqual.h
@@ -36,7 +36,7 @@ typedef SnapshotData *Snapshot;
extern Snapshot SnapshotDirty;
extern Snapshot QuerySnapshot;
-extern Snapshot SerializableSnapshot;
+extern DLLIMPORT Snapshot SerializableSnapshot;
extern bool ReferentialIntegritySnapshotOverride;