Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 558fae1

Browse files
committed
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
1 parent 22dc12b commit 558fae1

File tree

21 files changed

+42
-21
lines changed

21 files changed

+42
-21
lines changed

contrib/array/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/array/Attic/Makefile,v 1.14 2001/02/20 19:20:26 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/array/Attic/Makefile,v 1.15 2001/06/18 21:38:01 momjian Exp $
33
#
44

55
subdir = contrib/array
@@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX)
1111

1212
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1313
override CFLAGS += $(CFLAGS_SL)
14+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1415

1516
all: $(SONAME) $(NAME).sql
1617

contrib/cube/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.3 2001/02/20 19:20:27 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.4 2001/06/18 21:38:01 momjian Exp $
33
#
44

55
subdir = contrib/cube
@@ -15,6 +15,7 @@ SO_MAJOR_VERSION= 1
1515
SO_MINOR_VERSION= 0
1616

1717
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
18+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1819

1920
OBJS= cube.o cubeparse.o cubescan.o buffer.o
2021

contrib/dblink/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ override CFLAGS += -I$(srcdir)
1212
override CFLAGS += -I$(include_srcdir)
1313
override CFLAGS += -I$(libpq_srcdir)
1414
override CFLAGS += $(CFLAGS_SL)
15+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1516

1617
OBJS = $(NAME).o
1718

contrib/earthdistance/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/earthdistance/Makefile,v 1.9 2001/05/30 12:58:45 momjian Exp $
2+
# $Header: /cvsroot/pgsql/contrib/earthdistance/Makefile,v 1.10 2001/06/18 21:38:01 momjian Exp $
33
#
44

55
subdir = contrib/earthdistance
@@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX)
1111

1212
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1313
override CFLAGS += $(CFLAGS_SL)
14+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1415

1516
all: $(SONAME) $(NAME).sql
1617

contrib/fulltextindex/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/fulltextindex/Attic/Makefile,v 1.9 2001/02/20 19:20:27 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/fulltextindex/Attic/Makefile,v 1.10 2001/06/18 21:38:01 momjian Exp $
33
#
44

55
subdir = contrib/fulltextindex
@@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX)
1111

1212
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1313
override CFLAGS += $(CFLAGS_SL)
14+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1415

1516
all: $(SONAME) $(NAME).sql
1617

contrib/intarray/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/contrib/intarray/Makefile,v 1.6 2001/05/31 19:25:27 tgl Exp $
1+
# $Header: /cvsroot/pgsql/contrib/intarray/Makefile,v 1.7 2001/06/18 21:38:01 momjian Exp $
22

33
subdir = contrib/intarray
44
top_builddir = ../..
@@ -13,6 +13,7 @@ SO_MAJOR_VERSION= 1
1313
SO_MINOR_VERSION= 0
1414

1515
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
16+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1617

1718
OBJS= _int.o
1819

contrib/isbn_issn/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/isbn_issn/Attic/Makefile,v 1.9 2001/02/20 19:20:27 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/isbn_issn/Attic/Makefile,v 1.10 2001/06/18 21:38:01 momjian Exp $
33
#
44

55
subdir = contrib/isbn_issn
@@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX)
1111

1212
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1313
override CFLAGS += $(CFLAGS_SL)
14+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1415

1516
all: $(SONAME) $(NAME).sql
1617

contrib/lo/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/lo/Makefile,v 1.9 2001/02/20 19:20:27 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/lo/Makefile,v 1.10 2001/06/18 21:38:01 momjian Exp $
33
#
44

55
subdir = contrib/lo
@@ -14,6 +14,7 @@ MODS = $(NAME)$(DLSUFFIX)
1414

1515
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1616
override CFLAGS += $(CFLAGS_SL)
17+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1718

1819
ifdef REFINT_VERBOSE
1920
override CPPFLAGS+= -DREFINT_VERBOSE

contrib/miscutil/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/miscutil/Attic/Makefile,v 1.14 2001/02/20 19:20:27 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/miscutil/Attic/Makefile,v 1.15 2001/06/18 21:38:01 momjian Exp $
33
#
44

55
subdir = contrib/miscutil
@@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX)
1111

1212
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1313
override CFLAGS += $(CFLAGS_SL)
14+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1415

1516
all: $(SONAME) $(NAME).sql
1617

contrib/noupdate/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/noupdate/Attic/Makefile,v 1.7 2001/02/20 19:20:27 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/noupdate/Attic/Makefile,v 1.8 2001/06/18 21:38:02 momjian Exp $
33
#
44

55
subdir = contrib/noupdate
@@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX)
1111

1212
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1313
override CFLAGS += $(CFLAGS_SL)
14+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1415

1516
all: $(SONAME) $(NAME).sql
1617

contrib/oid2name/oid2name.c

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <stdlib.h>
1010
#include <unistd.h>
1111
#include <string.h>
12+
#include <getopt.h>
1213

1314
#include "libpq-fe.h"
1415

contrib/pgcrypto/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/pgcrypto/Makefile,v 1.3 2001/02/20 15:34:14 momjian Exp $
2+
# $Header: /cvsroot/pgsql/contrib/pgcrypto/Makefile,v 1.4 2001/06/18 21:38:02 momjian Exp $
33
#
44

55
subdir = contrib/pgcrypto
@@ -43,6 +43,7 @@ SO_MAJOR_VERSION = 0
4343
SO_MINOR_VERSION = 1
4444

4545
override CPPFLAGS += $(CRYPTO_CFLAGS) -I$(srcdir)
46+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
4647

4748
all: all-lib $(NAME).sql
4849

contrib/rserv/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ SCRIPTS = InitRservTest
1616

1717
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1818
override CFLAGS += $(CFLAGS_SL)
19+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1920

2021

2122
all: $(SQLS) $(TCLS) $(PERLS) $(SCRIPTS) $(SONAME)

contrib/seg/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.3 2001/02/20 19:20:28 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.4 2001/06/18 21:38:02 momjian Exp $
33
#
44

55
subdir = contrib/seg
@@ -15,6 +15,7 @@ SO_MAJOR_VERSION= 1
1515
SO_MINOR_VERSION= 0
1616

1717
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
18+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1819

1920
OBJS= seg.o segparse.o segscan.o buffer.o
2021

contrib/seg/segparse.y

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
#include "postgres.h"
1212
#include "utils/elog.h"
1313

14+
#ifdef __CYGWIN__
15+
#define HUGE HUGE_VAL
16+
#endif /* __CYGWIN__ */
17+
1418
#undef yylex /* falure to redefine yylex will result in calling the */
1519
#define yylex seg_yylex /* wrong scanner when running inside postgres backend */
1620

contrib/soundex/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/soundex/Attic/Makefile,v 1.9 2000/10/20 21:03:28 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/soundex/Attic/Makefile,v 1.10 2001/06/18 21:38:02 momjian Exp $
33
#
44

55
subdir = contrib/soundex
@@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX)
1111

1212
override CPPFLAGS += -I$(srcdir)
1313
override CFLAGS += $(CFLAGS_SL)
14+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1415

1516
all: $(SONAME) $(NAME).sql
1617

contrib/string/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/string/Attic/Makefile,v 1.14 2001/02/20 19:20:28 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/string/Attic/Makefile,v 1.15 2001/06/18 21:38:02 momjian Exp $
33
#
44

55
subdir = contrib/string
@@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX)
1111

1212
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1313
override CFLAGS += $(CFLAGS_SL)
14+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1415

1516
all: $(SONAME) $(NAME).sql
1617

contrib/userlock/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Header: /cvsroot/pgsql/contrib/userlock/Attic/Makefile,v 1.14 2001/02/20 19:20:28 petere Exp $
2+
# $Header: /cvsroot/pgsql/contrib/userlock/Attic/Makefile,v 1.15 2001/06/18 21:38:02 momjian Exp $
33
#
44

55
subdir = contrib/userlock
@@ -11,6 +11,7 @@ SONAME := $(NAME)$(DLSUFFIX)
1111

1212
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1313
override CFLAGS += $(CFLAGS_SL)
14+
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
1415

1516
all: $(SONAME) $(NAME).sql
1617

src/include/miscadmin.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: miscadmin.h,v 1.86 2001/06/13 21:44:41 tgl Exp $
15+
* $Id: miscadmin.h,v 1.87 2001/06/18 21:38:02 momjian Exp $
1616
*
1717
* NOTES
1818
* some of the information in this file should be moved to
@@ -115,7 +115,7 @@ extern int PostmasterMain(int argc, char *argv[]);
115115
extern bool Noversion;
116116
extern char *DataDir;
117117

118-
extern int MyProcPid;
118+
extern DLLIMPORT int MyProcPid;
119119
extern struct Port *MyProcPort;
120120
extern long MyCancelKey;
121121

@@ -126,7 +126,7 @@ extern char OutputFileName[];
126126
*
127127
* extern BackendId MyBackendId;
128128
*/
129-
extern Oid MyDatabaseId;
129+
extern DLLIMPORT Oid MyDatabaseId;
130130

131131
extern bool IsUnderPostmaster;
132132

src/include/storage/shmem.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: shmem.h,v 1.28 2001/03/22 04:01:09 momjian Exp $
10+
* $Id: shmem.h,v 1.29 2001/06/18 21:38:02 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -36,7 +36,7 @@ typedef unsigned long SHMEM_OFFSET;
3636
* The macros in this header file can only cope with offsets into this
3737
* shared memory region!
3838
*/
39-
extern SHMEM_OFFSET ShmemBase;
39+
extern DLLIMPORT SHMEM_OFFSET ShmemBase;
4040

4141

4242
/* coerce an offset into a pointer in this process's address space */

src/include/utils/tqual.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: tqual.h,v 1.30 2001/01/24 19:43:29 momjian Exp $
11+
* $Id: tqual.h,v 1.31 2001/06/18 21:38:02 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -36,7 +36,7 @@ typedef SnapshotData *Snapshot;
3636

3737
extern Snapshot SnapshotDirty;
3838
extern Snapshot QuerySnapshot;
39-
extern Snapshot SerializableSnapshot;
39+
extern DLLIMPORT Snapshot SerializableSnapshot;
4040

4141
extern bool ReferentialIntegritySnapshotOverride;
4242

0 commit comments

Comments
 (0)