--- origsrc/postgresql-9.2.3/src/Makefile.shlib 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/Makefile.shlib 2013-03-04 11:56:36.238271500 +0100 @@ -284,6 +284,7 @@ endif ifeq ($(PORTNAME), cygwin) + LINK.shared = $(CC) -shared ifdef SO_MAJOR_VERSION shlib = cyg$(NAME)$(DLSUFFIX) endif @@ -374,6 +375,16 @@ # 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): $(OBJS) | $(SHLIB_PREREQS) + $(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE) + +$(stlib): $(OBJS) | $(SHLIB_PREREQS) + $(LINK.static) $@ $^ + $(RANLIB) $@ + + +else ifeq (,$(SHLIB_EXPORTS)) DLL_DEFFILE = lib$(NAME)dll.def exports_file = $(DLL_DEFFILE) @@ -390,6 +401,7 @@ $(stlib): $(shlib) $(DLL_DEFFILE) | $(SHLIB_PREREQS) $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@ +endif # PORTNAME == cygwin endif # PORTNAME == cygwin || PORTNAME == win32 endif # enable_shared --- origsrc/postgresql-9.2.3/src/backend/Makefile 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/backend/Makefile 2013-03-04 11:18:03.048271500 +0100 @@ -47,7 +47,6 @@ all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP) -ifneq ($(PORTNAME), cygwin) ifneq ($(PORTNAME), win32) ifneq ($(PORTNAME), aix) @@ -56,24 +55,6 @@ endif endif -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 $@ - -endif # cygwin ifeq ($(PORTNAME), win32) LIBS += -lsecur32 @@ -210,7 +191,7 @@ install: all installdirs install-bin ifeq ($(PORTNAME), cygwin) ifeq ($(MAKE_DLL), true) - $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' +# $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' endif endif ifeq ($(PORTNAME), win32) --- origsrc/postgresql-9.2.3/src/bin/pg_basebackup/Makefile 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/bin/pg_basebackup/Makefile 2013-03-04 11:12:39.523271500 +0100 @@ -16,6 +16,8 @@ top_builddir = ../../.. include $(top_builddir)/src/Makefile.global +LIBS += $(LIBS) $(LDAP_LIBS_BE) + override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) OBJS=receivelog.o streamutil.o $(WIN32RES) --- origsrc/postgresql-9.2.3/src/bin/pg_ctl/Makefile 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/bin/pg_ctl/Makefile 2013-03-04 11:04:16.268271500 +0100 @@ -23,7 +23,7 @@ all: pg_ctl pg_ctl: $(OBJS) | submake-libpq submake-libpgport - $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) + $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(LDAP_LIBS_BE) install: all installdirs $(INSTALL_PROGRAM) pg_ctl$(X) '$(DESTDIR)$(bindir)/pg_ctl$(X)' --- origsrc/postgresql-9.2.3/src/bin/pg_dump/Makefile 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/bin/pg_dump/Makefile 2013-03-04 11:10:40.034271500 +0100 @@ -12,10 +12,13 @@ PGFILEDESC = "pg_dump/pg_restore/pg_dumpall - backup and restore PostgreSQL databases" PGAPPICON=win32 + subdir = src/bin/pg_dump top_builddir = ../../.. include $(top_builddir)/src/Makefile.global +LIBS += $(LIBS) $(LDAP_LIBS_BE) + override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \ @@ -30,7 +33,7 @@ all: pg_dump pg_restore pg_dumpall pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(KEYWRDOBJS) | submake-libpq submake-libpgport - $(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) + $(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) pg_restore: pg_restore.o $(OBJS) $(KEYWRDOBJS) | submake-libpq submake-libpgport $(CC) $(CFLAGS) pg_restore.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) --- origsrc/postgresql-9.2.3/src/bin/psql/Makefile 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/bin/psql/Makefile 2013-03-04 11:11:05.859271500 +0100 @@ -16,6 +16,8 @@ top_builddir = ../../.. include $(top_builddir)/src/Makefile.global +LIBS += $(LIBS) $(LDAP_LIBS_BE) + REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_dump $(CPPFLAGS) --- origsrc/postgresql-9.2.3/src/bin/scripts/Makefile 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/bin/scripts/Makefile 2013-03-04 11:11:44.367271500 +0100 @@ -16,6 +16,8 @@ top_builddir = ../../.. include $(top_builddir)/src/Makefile.global +LIBS += $(LIBS) $(LDAP_LIBS_BE) + PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vacuumdb reindexdb override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS) --- origsrc/postgresql-9.2.3/src/interfaces/libpq/Makefile 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/interfaces/libpq/Makefile 2013-03-04 11:03:01.935271500 +0100 @@ -27,7 +27,7 @@ # Need to recompile any external C files because we need # all object files to use the same compile flags as libpq; some # platforms require special flags. -LIBS := $(LIBS:-lpgport=) +LIBS := $(LIBS:-lpgport=) $(LDAP_LIBS_BE) # We can't use Makefile variables here because the MSVC build system scrapes # OBJS from this file. --- origsrc/postgresql-9.2.3/src/makefiles/Makefile.cygwin 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/makefiles/Makefile.cygwin 2013-02-08 06:49:00.645766200 +0100 @@ -1,6 +1,4 @@ # src/makefiles/Makefile.cygwin -DLLTOOL= dlltool -DLLWRAP= dllwrap ifdef PGXS BE_DLLLIBS= -L$(libdir) -lpostgres else @@ -40,6 +38,4 @@ # 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) --- origsrc/postgresql-9.2.3/src/makefiles/pgxs.mk 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/makefiles/pgxs.mk 2013-03-03 22:40:26.148157400 +0100 @@ -296,5 +296,5 @@ ifdef PROGRAM $(PROGRAM): $(OBJS) - $(CC) $(CFLAGS) $(OBJS) $(PG_LIBS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) + $(CC) $(CFLAGS) $(OBJS) $(PG_LIBS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) $(LDAP_LIBS_BE) -o $@$(X) endif --- origsrc/postgresql-9.2.3/src/port/Makefile 2013-02-04 22:28:13.000000000 +0100 +++ src/postgresql-9.2.3/src/port/Makefile 2013-03-04 10:59:59.686271500 +0100 @@ -28,7 +28,7 @@ include $(top_builddir)/src/Makefile.global override CPPFLAGS := -I$(top_builddir)/src/port -DFRONTEND $(CPPFLAGS) -LIBS += $(PTHREAD_LIBS) +LIBS += $(PTHREAD_LIBS) $(LDAP_LIBS_BE) OBJS = $(LIBOBJS) chklocale.o dirmod.o erand48.o exec.o fls.o inet_net_ntop.o \ noblock.o path.o pgcheckdir.o pg_crc.o pgmkdirp.o pgsleep.o \