summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2013-10-04 18:23:40 +0000
committerjoerg <joerg@pkgsrc.org>2013-10-04 18:23:40 +0000
commit1510cd23608bf8a3fca655d359c5500c8ddb560a (patch)
treea65039e91e1be69a421dc22851b5324ef849c64c
parent2e88f31b2aed4e5070ec3136185cfc1f9e03fa6c (diff)
downloadpkgsrc-1510cd23608bf8a3fca655d359c5500c8ddb560a.tar.gz
Fix build of postgresql93-client for Cygwin, including correct
generation of DLLs.
-rw-r--r--databases/postgresql93-client/Makefile8
-rw-r--r--databases/postgresql93-client/PLIST.Cygwin5
-rw-r--r--databases/postgresql93/distinfo9
-rw-r--r--databases/postgresql93/patches/patch-src_Makefile.global.in16
-rw-r--r--databases/postgresql93/patches/patch-src_Makefile.shlib55
-rw-r--r--databases/postgresql93/patches/patch-src_backend_Makefile25
-rw-r--r--databases/postgresql93/patches/patch-src_interfaces_libpq_Makefile13
-rw-r--r--databases/postgresql93/patches/patch-src_makefiles_Makefile.cygwin20
8 files changed, 143 insertions, 8 deletions
diff --git a/databases/postgresql93-client/Makefile b/databases/postgresql93-client/Makefile
index 04ea906dcdb..fd672dcd25d 100644
--- a/databases/postgresql93-client/Makefile
+++ b/databases/postgresql93-client/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2013/09/10 15:32:32 adam Exp $
+# $NetBSD: Makefile,v 1.2 2013/10/04 18:23:40 joerg Exp $
PKGNAME= ${DISTNAME:C/-/93-client-/}
COMMENT= PostgreSQL database client programs
@@ -10,6 +10,10 @@ CONFIGURE_ARGS+= --with-openssl
CONFIGURE_ARGS+= --with-readline
CONFIGURE_ARGS+= --with-zlib
+.if ${OPSYS} == "Cygwin"
+INSTALLATION_DIRS+= bin
+.endif
+
# 1. The thread-safety test in ${WRSRC}/src/tools/thread does not pass on
# NetBSD earler than 4.0 or DragonFly.
# 2. configure with --enable-thread-safety fails on OpenBSD.
@@ -28,9 +32,9 @@ CONFIGURE_ARGS+= --enable-thread-safety
.endif
INSTALL_DIRS= src/include
+INSTALL_DIRS+= src/common
INSTALL_DIRS+= src/interfaces
INSTALL_DIRS+= src/bin
-INSTALL_DIRS+= src/common
INSTALL_DIRS+= src/port
BUILD_DIRS= ${INSTALL_DIRS}
# Without this, the Darwin build fails (related to -bundle_loader).
diff --git a/databases/postgresql93-client/PLIST.Cygwin b/databases/postgresql93-client/PLIST.Cygwin
new file mode 100644
index 00000000000..2db2dfb4b40
--- /dev/null
+++ b/databases/postgresql93-client/PLIST.Cygwin
@@ -0,0 +1,5 @@
+@comment
+bin/cygecpg_compat-3.dll
+bin/cygecpg-6.dll
+bin/cygpgtypes-3.dll
+bin/cygpq-5.dll
diff --git a/databases/postgresql93/distinfo b/databases/postgresql93/distinfo
index 985ebccf68a..9b0cfc4d52e 100644
--- a/databases/postgresql93/distinfo
+++ b/databases/postgresql93/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1 2013/09/10 15:32:32 adam Exp $
+$NetBSD: distinfo,v 1.2 2013/10/04 18:23:40 joerg Exp $
SHA1 (postgresql-9.3.0.tar.bz2) = 63a7b8788cd18247d7af5fd4a320abebb0535a44
RMD160 (postgresql-9.3.0.tar.bz2) = 7600730f7a1e2f547db231c2699131b5a2148cfa
@@ -8,8 +8,11 @@ SHA1 (patch-config_perl.m4) = e035132b1c281a75752d570ac5e29a11176c25c5
SHA1 (patch-configure) = cc93f6db4cd6c34708804b4ae3550525af46bdef
SHA1 (patch-contrib_dblink_Makefile) = 11620938ce93109311df90df675b1ad6f0c15212
SHA1 (patch-contrib_dblink_dblink.c) = a6f87ab9f2c28a72608d70267b71bd77437b0921
-SHA1 (patch-src_Makefile.shlib) = 2a17824c56b7c24da2756dc462571a93050ea9f7
-SHA1 (patch-src_backend_Makefile) = d52b102b993bfef3abb0d0c27a7ee0fa1e656f8c
+SHA1 (patch-src_Makefile.global.in) = 53e29e000d7fb71e2625aacd32324e9d7001b5b2
+SHA1 (patch-src_Makefile.shlib) = 6e6ec0ce0d61d047b1ecfcf21929ac96cfe8b064
+SHA1 (patch-src_backend_Makefile) = deba6bc07ba2e4b8ef8f04f20efb2bdd54cb917e
+SHA1 (patch-src_interfaces_libpq_Makefile) = 0066301bc8b31b9e26c79153427537bc3865ef4d
+SHA1 (patch-src_makefiles_Makefile.cygwin) = df75c763a4e478b10d9faa6cbf271e37059701a9
SHA1 (patch-src_makefiles_Makefile.solaris) = 0168f5bc105ffc89d5db40907a08966d8465f5a0
SHA1 (patch-src_pl_plperl_GNUmakefile) = 6ee3e431f46ce5c2a94df499504b2b8bd458bbef
SHA1 (patch-src_pl_plperl_plperl.h) = bd663fa80a47f7b82ce689060750fa6e631fbc61
diff --git a/databases/postgresql93/patches/patch-src_Makefile.global.in b/databases/postgresql93/patches/patch-src_Makefile.global.in
new file mode 100644
index 00000000000..0d9a392858a
--- /dev/null
+++ b/databases/postgresql93/patches/patch-src_Makefile.global.in
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_Makefile.global.in,v 1.1 2013/10/04 18:23:40 joerg Exp $
+
+--- src/Makefile.global.in.orig 2013-09-02 20:53:17.000000000 +0000
++++ src/Makefile.global.in
+@@ -508,6 +508,11 @@ ifeq ($(PORTNAME),win32)
+ LIBS += -lws2_32 -lshfolder
+ endif
+
++# missing for link on cygwin ?
++ifeq ($(PORTNAME),cygwin)
++LIBS += $(LDAP_LIBS_BE)
++endif
++
+ # Not really standard libc functions, used by the backend.
+ TAS = @TAS@
+
diff --git a/databases/postgresql93/patches/patch-src_Makefile.shlib b/databases/postgresql93/patches/patch-src_Makefile.shlib
index 57209445d92..a7b5982acb1 100644
--- a/databases/postgresql93/patches/patch-src_Makefile.shlib
+++ b/databases/postgresql93/patches/patch-src_Makefile.shlib
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_Makefile.shlib,v 1.1 2013/09/10 15:32:32 adam Exp $
+$NetBSD: patch-src_Makefile.shlib,v 1.2 2013/10/04 18:23:40 joerg Exp $
--- src/Makefile.shlib.orig 2013-09-02 20:53:17.000000000 +0000
+++ src/Makefile.shlib
@@ -38,3 +38,56 @@ $NetBSD: patch-src_Makefile.shlib,v 1.1 2013/09/10 15:32:32 adam Exp $
ifeq ($(PORTNAME), hpux)
ifdef SO_MAJOR_VERSION
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+@@ -281,8 +286,9 @@ ifeq ($(PORTNAME), unixware)
+ endif
+
+ ifeq ($(PORTNAME), cygwin)
++ LINK.shared = $(CC) -shared
+ ifdef SO_MAJOR_VERSION
+- shlib = cyg$(NAME)$(DLSUFFIX)
++ shlib = cyg$(NAME)-$(SO_MAJOR_VERSION)$(DLSUFFIX)
+ endif
+ haslibarule = yes
+ endif
+@@ -371,6 +377,12 @@ else # PORTNAME == cygwin || PORTNAME ==
+
+ # If SHLIB_EXPORTS is set, the rules below will build a .def file from
+ # that. Else we build a temporary one here.
++ifeq ($(PORTNAME), cygwin)
++$(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
++ $(CC) $(CFLAGS) -shared -o $(shlib) -Wl,--out-implib=$(stlib) $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
++
++
++else
+ ifeq (,$(SHLIB_EXPORTS))
+ DLL_DEFFILE = lib$(NAME)dll.def
+ exports_file = $(DLL_DEFFILE)
+@@ -387,6 +399,7 @@ $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHL
+ $(stlib): $(shlib) $(DLL_DEFFILE) | $(SHLIB_PREREQS)
+ $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@
+
++endif # PORTNAME == cygwin
+ endif # PORTNAME == cygwin || PORTNAME == win32
+
+
+@@ -467,8 +480,10 @@ ifdef soname
+ # we don't install $(shlib) on AIX
+ # (see http://archives.postgresql.org/message-id/52EF20B2E3209443BC37736D00C3C1380A6E79FE@EXADV1.host.magwien.gv.at)
+ ifneq ($(PORTNAME), aix)
++ifeq ($(PORTNAME), cygwin)
++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)'
++else
+ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/$(shlib)'
+-ifneq ($(PORTNAME), cygwin)
+ ifneq ($(PORTNAME), win32)
+ ifneq ($(shlib), $(shlib_major))
+ cd '$(DESTDIR)$(libdir)' && \
+@@ -481,7 +496,7 @@ ifneq ($(shlib), $(shlib_bare))
+ $(LN_S) $(shlib) $(shlib_bare)
+ endif
+ endif # not win32
+-endif # not cygwin
++endif # cygwin
+ endif # not aix
+ else # no soname
+ $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)'
diff --git a/databases/postgresql93/patches/patch-src_backend_Makefile b/databases/postgresql93/patches/patch-src_backend_Makefile
index 0e5e3f395e9..a38eeeccc13 100644
--- a/databases/postgresql93/patches/patch-src_backend_Makefile
+++ b/databases/postgresql93/patches/patch-src_backend_Makefile
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_backend_Makefile,v 1.1 2013/09/10 15:32:32 adam Exp $
+$NetBSD: patch-src_backend_Makefile,v 1.2 2013/10/04 18:23:40 joerg Exp $
--- src/backend/Makefile.orig 2013-09-02 20:53:17.000000000 +0000
+++ src/backend/Makefile
@@ -13,7 +13,28 @@ $NetBSD: patch-src_backend_Makefile,v 1.1 2013/09/10 15:32:32 adam Exp $
SUBDIRS = access bootstrap catalog parser commands executor foreign lib libpq \
main nodes optimizer port postmaster regex replication rewrite \
storage tcop tsearch utils $(top_builddir)/src/timezone
-@@ -131,6 +135,8 @@ catalog/schemapg.h: | submake-schemapg
+@@ -62,18 +66,8 @@ endif
+
+ ifeq ($(PORTNAME), cygwin)
+
+-postgres: $(OBJS) postgres.def libpostgres.a
+- $(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
+- $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(call expand_subsys,$(OBJS)) $(LIBS)
+- $(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
+- $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) -Wl,--stack,$(WIN32_STACK_RLIMIT) -o $@$(X) $@.exp $(call expand_subsys,$(OBJS)) $(LIBS)
+- rm -f $@.exp $@.base
+-
+-postgres.def: $(OBJS)
+- $(DLLTOOL) --export-all --output-def $@ $(call expand_subsys,$^)
+-
+-libpostgres.a: postgres.def
+- $(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
++postgres libpostgres.a: $(OBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(call expand_subsys,$^) $(LIBS) -o $@ -Wl,--stack,$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.a
+
+ endif # cygwin
+
+@@ -131,6 +125,8 @@ catalog/schemapg.h: | submake-schemapg
$(top_builddir)/src/port/libpgport_srv.a: | submake-libpgport
diff --git a/databases/postgresql93/patches/patch-src_interfaces_libpq_Makefile b/databases/postgresql93/patches/patch-src_interfaces_libpq_Makefile
new file mode 100644
index 00000000000..3425fd970fb
--- /dev/null
+++ b/databases/postgresql93/patches/patch-src_interfaces_libpq_Makefile
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_interfaces_libpq_Makefile,v 1.1 2013/10/04 18:23:40 joerg Exp $
+
+--- src/interfaces/libpq/Makefile.orig 2013-09-02 20:53:17.000000000 +0000
++++ src/interfaces/libpq/Makefile
+@@ -45,7 +45,7 @@ OBJS += ip.o md5.o
+ OBJS += encnames.o wchar.o
+
+ ifeq ($(PORTNAME), cygwin)
+-override shlib = cyg$(NAME)$(DLSUFFIX)
++override shlib = cyg$(NAME)-$(SO_MAJOR_VERSION)$(DLSUFFIX)
+ endif
+
+ ifeq ($(PORTNAME), win32)
diff --git a/databases/postgresql93/patches/patch-src_makefiles_Makefile.cygwin b/databases/postgresql93/patches/patch-src_makefiles_Makefile.cygwin
new file mode 100644
index 00000000000..9504ab2c49c
--- /dev/null
+++ b/databases/postgresql93/patches/patch-src_makefiles_Makefile.cygwin
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_makefiles_Makefile.cygwin,v 1.1 2013/10/04 18:23:40 joerg Exp $
+
+--- src/makefiles/Makefile.cygwin.orig 2013-09-02 20:53:17.000000000 +0000
++++ src/makefiles/Makefile.cygwin
+@@ -1,6 +1,5 @@
+-# src/makefiles/Makefile.cygwin
+ DLLTOOL= dlltool
+-DLLWRAP= dllwrap
++# src/makefiles/Makefile.cygwin
+ ifdef PGXS
+ BE_DLLLIBS= -L$(libdir) -lpostgres
+ else
+@@ -44,6 +43,4 @@ endif
+
+ # Rule for building a shared library from a single .o file
+ %.dll: %.o
+- $(DLLTOOL) --export-all --output-def $*.def $<
+- $(DLLWRAP) -o $@ --def $*.def $< $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)
+- rm -f $*.def
++ $(CC) $(CFLAGS) -shared -o $@ $< $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)