Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id AFC3B1337B5A for ; Tue, 12 Oct 2010 12:48:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 84033-02 for ; Tue, 12 Oct 2010 15:48:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id E73BA1337B59 for ; Tue, 12 Oct 2010 12:48:43 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id o9CFmjCi038536 for ; Tue, 12 Oct 2010 15:48:45 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id o9CFmjPa038535; Tue, 12 Oct 2010 15:48:45 GMT (envelope-from www) Date: Tue, 12 Oct 2010 15:48:45 GMT Message-Id: <201010121548.o9CFmjPa038535@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #5707: Cross compilation for windows is broken From: "Richard Evans" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201010/107 X-Sequence-Number: 28397 The following bug has been logged online: Bug reference: 5707 Logged by: Richard Evans Email address: richard.evans@datanomic.com PostgreSQL version: 9.0.1 Operating system: Linux (Fedora 12) Description: Cross compilation for windows is broken Details: When cross compiling for Windows using a separate build area, libpq.dll does not build because the .def file cannot be found. This appears to be caused by these lines in Makefile.shlib: # If SHLIB_EXPORTS is set, the rules below will build a .def file from # that. Else we build a temporary one here. ifeq (,$(SHLIB_EXPORTS)) DLL_DEFFILE = lib$(NAME)dll.def exports_file = $(DLL_DEFFILE) $(exports_file): $(OBJS) $(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $@ $^ else DLL_DEFFILE = lib$(NAME)dll.def endif In Makefile.shlib from 8.4.5, the lines read: # If SHLIB_EXPORTS is set, the rules below will build a .def file from # that. Else we build a temporary one here. ifeq (,$(SHLIB_EXPORTS)) DLL_DEFFILE = lib$(NAME)dll.def exports_file = $(DLL_DEFFILE) $(exports_file): $(OBJS) $(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $@ $^ else DLL_DEFFILE = $(srcdir)/lib$(NAME)dll.def endif Note the reference fo ${srcdir). If Makefile.shlib in 9.0.1 is updated to match this, the build succeeds. The configure command was somethinglike: ~/misc/postgresql-9.0.1/configure --host=mingw32 --prefix=/tmp/pg9 --without-zlib