diff --git a/contrib/array/Makefile b/contrib/array/Makefile
index 260b56e60fda9874a7445b252c86ce9294450444..c247f74fbf84770432d7c3f8c2d5509b02972712 100644
--- a/contrib/array/Makefile
+++ b/contrib/array/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/array/Attic/Makefile,v 1.14 2001/02/20 19:20:26 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/array/Attic/Makefile,v 1.15 2001/06/18 21:38:01 momjian Exp $
 #
 
 subdir = contrib/array
@@ -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 014fafa1fe2cb81798c74b503ff105c052206c51..dd851355c402f264d83a28773b698e2e713ea2b6 100644
--- a/contrib/cube/Makefile
+++ b/contrib/cube/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.3 2001/02/20 19:20:27 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.4 2001/06/18 21:38:01 momjian Exp $
 #
 
 subdir = contrib/cube
@@ -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 6bb4bfe113eda8d6a69b13928abd5660124d53f5..71e34b8c33744a8a93c1a7d45125f033b091a378 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 729a42cbb71dce0a6eec16735397a92a19a03bdb..40eb136b0306e186d15b22cf092ba92fbd803081 100644
--- a/contrib/earthdistance/Makefile
+++ b/contrib/earthdistance/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/earthdistance/Makefile,v 1.9 2001/05/30 12:58:45 momjian Exp $
+# $Header: /cvsroot/pgsql/contrib/earthdistance/Makefile,v 1.10 2001/06/18 21:38:01 momjian Exp $
 #
 
 subdir = contrib/earthdistance
@@ -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 3a60a6cf0959aa2a63968a1dc53b787367da97c7..cd89e0388ff75ad59ab393879256463a4f3a53da 100644
--- a/contrib/fulltextindex/Makefile
+++ b/contrib/fulltextindex/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/fulltextindex/Attic/Makefile,v 1.9 2001/02/20 19:20:27 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/fulltextindex/Attic/Makefile,v 1.10 2001/06/18 21:38:01 momjian Exp $
 #
 
 subdir = contrib/fulltextindex
@@ -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 df0a01bce7083dc983a46fa9647bb9f269dee1ee..fe36156756502b68c18ac8a40d8b5afafc058de6 100644
--- a/contrib/intarray/Makefile
+++ b/contrib/intarray/Makefile
@@ -1,4 +1,4 @@
-# $Header: /cvsroot/pgsql/contrib/intarray/Makefile,v 1.6 2001/05/31 19:25:27 tgl Exp $
+# $Header: /cvsroot/pgsql/contrib/intarray/Makefile,v 1.7 2001/06/18 21:38:01 momjian Exp $
 
 subdir = contrib/intarray
 top_builddir = ../..
@@ -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 9f73cc0085e5a8af01641b1ceb7a2bd10b9e8087..a884ad483f3cab6ce12398e187e3f9ce1c9e2216 100644
--- a/contrib/isbn_issn/Makefile
+++ b/contrib/isbn_issn/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/isbn_issn/Attic/Makefile,v 1.9 2001/02/20 19:20:27 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/isbn_issn/Attic/Makefile,v 1.10 2001/06/18 21:38:01 momjian Exp $
 #
 
 subdir = contrib/isbn_issn
@@ -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 913ad507ff4d48daef2afc157c7f2fe9f21184b2..78ccb25f7c84b3cb4c8ae117e7d42fd1811d3b3e 100644
--- a/contrib/lo/Makefile
+++ b/contrib/lo/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/lo/Makefile,v 1.9 2001/02/20 19:20:27 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/lo/Makefile,v 1.10 2001/06/18 21:38:01 momjian Exp $
 #
 
 subdir = contrib/lo
@@ -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 a745d7f610dc3640bfc46bf5eea152b45a250c5b..4207a83eb9ff94c88ca2ab7ce134cf0e1ccda058 100644
--- a/contrib/miscutil/Makefile
+++ b/contrib/miscutil/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/miscutil/Attic/Makefile,v 1.14 2001/02/20 19:20:27 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/miscutil/Attic/Makefile,v 1.15 2001/06/18 21:38:01 momjian Exp $
 #
 
 subdir = contrib/miscutil
@@ -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 fbfe66fde33f810ba0800323dad474581132100d..f31c3c06084402b8cda16bf42085c2a5bc2d088c 100644
--- a/contrib/noupdate/Makefile
+++ b/contrib/noupdate/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/noupdate/Attic/Makefile,v 1.7 2001/02/20 19:20:27 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/noupdate/Attic/Makefile,v 1.8 2001/06/18 21:38:02 momjian Exp $
 #
 
 subdir = contrib/noupdate
@@ -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 a823c5f50b3992b9d3c40f0046b8c9b24d050c14..2bfb0a2a52038ae603c9dfba0f43c54d170bb5e7 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 85a11c029a6ed3881b0659c59e0bfa0141baad15..408e1c85f60c28e1534794415dc0182fa60323a2 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 bd2b4f15571a132af71d4b241b6e4aa3d337dd65..25dfeeacb174808a155f894f23406227ea6f797b 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 0df4644cf5a164b7600f319fd8363fb76682c7df..4efff4f408365d3bf204a5b4323ae86bf86f17db 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 adce19c517874b61de0d9dc5b3922d91ca99462b..3c2d6c28c0b9d9b42b1f94db61ededdd4478223b 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 54b4fa0b4461a254c0c48aff38313a8d0fbfa10d..76538e052b08fd920c4ac448acb2ffa60e21be2b 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 086b03a6a03a5e6f61693eb5a0310d085bbc471b..b8eaa85acfdc7a03bfdd7483bb68022c4d4bfdc4 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 ca13469bd6a2585079cf775e98631195eabc63ad..9ad5170b8963860963e57fc4a58cd9d33e99988c 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 588c2f99dea2990d690a7a3f6024feff183ef6cc..ce4255cb7d5dc941b04f1b10b78979690a65bea3 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 04c8bbaf418a521ec541dcf9d950a798a6b6c5aa..2768a772d663cc97e907efab461c09952633fcf3 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 a2bcddf862f1c56d5b79b0d8fea829f34c568a0b..7c3dece02fe47268544fc3427f2b230abf563c16 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;