I've taken a look at the current development snapshot ane made a new patch. This is against the snapshot source dated 2008-12-30.

I have omitted the workround for the bug in binutils 2.18 since 2.19 is now available and fixes the problem.

I tested the cross compilation for mingw32 using gcc 4.3.2 and binutils 2.19, with the latest mingw runtime and w32api from mingw.org.

I verified that the build works on a Windows 2000 system.

If the patch goes in, I can provide some notes on the cross compilation process.

Richard
On Sunday 07 December 2008 01:02:05 Bruce Momjian wrote:
Where are we on this?

Some of this has been fixed. But a lot of the code has been moved around between 8.3 and 8.4, so we can't just take take the patches as is. If Richard is still interested, I suggest he try out 8.4 and then submit any remaining desired changes.

diff -c -r -x '*~' -x configure postgresql-snapshot/configure.in 
pg2/configure.in
*** postgresql-snapshot/configure.in    2008-12-11 07:34:07.000000000 +0000
--- pg2/configure.in    2008-12-29 14:06:23.000000000 +0000
***************
*** 766,771 ****
--- 766,789 ----
  AC_SUBST(with_system_tzdata)
  
  #
+ # zic if cross-compiling
+ #
+ if test "$build_os" != "$host_os" -a -z "$with_system_tzdata"; then
+   PGAC_ARG_REQ(with, zic, [ZIC], [set location of zic tool],
+              [ZIC=$withval],
+              [ZIC=:])
+ 
+   if test "$ZIC" = ":"; then
+     AC_PATH_TOOL(ZIC, zic, :)
+   fi
+ 
+   if test "$ZIC" = ":"; then
+     AC_MSG_ERROR([zic is required for cross-compilation.
+ Use --with-zic to set the location.])
+   fi
+ fi 
+ 
+ #
  # Zlib
  #
  PGAC_ARG_BOOL(with, zlib, yes,
diff -c -r -x '*~' -x configure postgresql-snapshot/src/bin/pgevent/Makefile 
pg2/src/bin/pgevent/Makefile
*** postgresql-snapshot/src/bin/pgevent/Makefile        2008-12-07 
08:36:22.000000000 +0000
--- pg2/src/bin/pgevent/Makefile        2008-12-29 14:06:23.000000000 +0000
***************
*** 21,31 ****
  
  install: all install-lib
  
! pgevent.dll: $(OBJS) pgevent.def
!       $(DLLWRAP) --def pgevent.def -o $(NAME) $(OBJS)
  
  pgmsgevent.o: pgmsgevent.rc win32ver.rc
!       $(WINDRES) pgmsgevent.rc -o pgmsgevent.o 
--include-dir=$(top_builddir)/src/include
  
  all-lib: $(NAME)
  
--- 21,31 ----
  
  install: all install-lib
  
! pgevent.dll: $(OBJS) $(srcdir)/pgevent.def
!       $(DLLWRAP) --def $(srcdir)/pgevent.def -o $(NAME) $(OBJS)
  
  pgmsgevent.o: pgmsgevent.rc win32ver.rc
!       $(WINDRES) $(srcdir)/pgmsgevent.rc -o pgmsgevent.o  
--include-dir=$(top_srcdir)/src/include 
--include-dir=$(top_builddir)/src/include --include-dir=$(srcdir) 
--include-dir=$(top_builddir)/$(subdir)
  
  all-lib: $(NAME)
  
diff -c -r -x '*~' -x configure 
postgresql-snapshot/src/interfaces/ecpg/test/Makefile 
pg2/src/interfaces/ecpg/test/Makefile
*** postgresql-snapshot/src/interfaces/ecpg/test/Makefile       2008-12-01 
11:37:37.000000000 +0000
--- pg2/src/interfaces/ecpg/test/Makefile       2008-12-29 14:06:23.000000000 
+0000
***************
*** 16,22 ****
  NOLOCALE += --no-locale
  endif
  
! ifneq ($(PORTNAME),win32)
  abs_builddir := $(shell pwd)
  else
  abs_builddir := $(shell pwd -W)
--- 16,22 ----
  NOLOCALE += --no-locale
  endif
  
! ifneq ($(BUILDOS),mingw32)
  abs_builddir := $(shell pwd)
  else
  abs_builddir := $(shell pwd -W)
diff -c -r -x '*~' -x configure 
postgresql-snapshot/src/interfaces/libpq/Makefile 
pg2/src/interfaces/libpq/Makefile
*** postgresql-snapshot/src/interfaces/libpq/Makefile   2008-12-07 
08:36:22.000000000 +0000
--- pg2/src/interfaces/libpq/Makefile   2008-12-29 14:06:23.000000000 +0000
***************
*** 19,25 ****
  SO_MAJOR_VERSION= 5
  SO_MINOR_VERSION= 2
  
! override CPPFLAGS :=  -DFRONTEND -DUNSAFE_STAT_OK -I$(srcdir) $(CPPFLAGS) 
-I$(top_builddir)/src/port
  ifneq ($(PORTNAME), win32)
  override CFLAGS += $(PTHREAD_CFLAGS)
  endif
--- 19,25 ----
  SO_MAJOR_VERSION= 5
  SO_MINOR_VERSION= 2
  
! override CPPFLAGS :=  -DFRONTEND -DUNSAFE_STAT_OK -I$(srcdir) $(CPPFLAGS) 
-I$(top_srcdir)/src/port -I$(top_builddir)/src/port
  ifneq ($(PORTNAME), win32)
  override CFLAGS += $(PTHREAD_CFLAGS)
  endif
diff -c -r -x '*~' -x configure postgresql-snapshot/src/Makefile.global.in 
pg2/src/Makefile.global.in
*** postgresql-snapshot/src/Makefile.global.in  2008-12-11 07:34:07.000000000 
+0000
--- pg2/src/Makefile.global.in  2008-12-29 14:06:23.000000000 +0000
***************
*** 270,275 ****
--- 270,277 ----
  PL_TESTDB = pl_regression
  CONTRIB_TESTDB = contrib_regression
  
+ ZIC = @ZIC@
+ 
  # Installation.
  
  INSTALL       = $(SHELL) $(top_srcdir)/config/install-sh -c
***************
*** 319,324 ****
--- 321,328 ----
  # Additional platform-specific settings
  #
  
+ BUILDOS = @build_os@
+ 
  # Name of the "template"
  PORTNAME= @PORTNAME@
  
diff -c -r -x '*~' -x configure 
postgresql-snapshot/src/makefiles/Makefile.win32 
pg2/src/makefiles/Makefile.win32
*** postgresql-snapshot/src/makefiles/Makefile.win32    2008-12-07 
08:36:22.000000000 +0000
--- pg2/src/makefiles/Makefile.win32    2008-12-29 14:06:23.000000000 +0000
***************
*** 67,70 ****
        sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 
's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 
's/^0*//'`';' $< >$@
  
  win32ver.o: win32ver.rc
!       $(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include
--- 67,70 ----
        sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 
's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 
's/^0*//'`';' $< >$@
  
  win32ver.o: win32ver.rc
!       $(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include 
--include-dir=$(srcdir)
diff -c -r -x '*~' -x configure postgresql-snapshot/src/Makefile.shlib 
pg2/src/Makefile.shlib
*** postgresql-snapshot/src/Makefile.shlib      2008-12-11 07:34:07.000000000 
+0000
--- pg2/src/Makefile.shlib      2008-12-29 16:14:41.000000000 +0000
***************
*** 406,420 ****
  
  # Cygwin or Win32 case
  
- DLL_DEFFILE = lib$(NAME)dll.def
- 
  # 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))
  exports_file = $(DLL_DEFFILE)
  
  $(exports_file): $(OBJS)
        $(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $@ $^
  endif
  
  $(shlib): $(OBJS) $(DLL_DEFFILE)
--- 406,421 ----
  
  # Cygwin or Win32 case
  
  # 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
  
  $(shlib): $(OBJS) $(DLL_DEFFILE)
diff -c -r -x '*~' -x configure postgresql-snapshot/src/timezone/Makefile 
pg2/src/timezone/Makefile
*** postgresql-snapshot/src/timezone/Makefile   2008-02-19 15:29:58.000000000 
+0000
--- pg2/src/timezone/Makefile   2008-12-29 14:06:23.000000000 +0000
***************
*** 27,32 ****
--- 27,38 ----
  # for POSIX-style timezone specs
  POSIXRULES = US/Eastern
  
+ # ZIC is set when cross compiling
+ 
+ ifeq (,$(ZIC))
+ ZIC=./zic
+ endif
+ 
  # use system timezone data?
  ifneq (,$(with_system_tzdata))
  override CPPFLAGS += '-DSYSTEMTZDIR="$(with_system_tzdata)"'
***************
*** 43,49 ****
  
  install: all installdirs
  ifeq (,$(with_system_tzdata))
!       ./zic -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' 
$(TZDATAFILES)
  endif
        $(MAKE) -C tznames $@
  
--- 49,55 ----
  
  install: all installdirs
  ifeq (,$(with_system_tzdata))
!       $(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' 
$(TZDATAFILES)
  endif
        $(MAKE) -C tznames $@
  
-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to