[HACKERS] Cross-compile of 3rd-party extensions fails
Hi, I am trying to cross-compile PostgreSQL 9.0.4 and a few 3rd-party external modules using Mingw32-w64 on Fedora 15 for 64-bit Windows. 64-bit Wine can be used to run the 64-bit pg_config.exe under Linux, so the USE_PGXS=1 machinery works. However, mingw64-make fails with the following error: [zozo@localhost postgis-1.5.3]$ mingw64-make make -C liblwgeom make[1]: Entering directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/liblwgeom' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/liblwgeom' make -C postgis make[1]: Entering directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/postgis' /home/zozo/.wine/dosdevices/z:/usr/x86_64-w64-mingw32/sys-root/mingw/lib/postgresql/pgxs/src/makefiles/../../src/Makefile.port:63: *** target pattern contains no `%'. Stop. make[1]: Leaving directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/postgis' make: *** [postgis] Error 2 Line 63 in Makefile.port (src/makefiles/Makefile.win32 in this case) is this: 63: win32ver.rc: $(top_srcdir)/src/port/win32ver.rc 64: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*//'`';' $ $@ 65: 66: win32ver.o: win32ver.rc 67: $(WINDRES) -i $ -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir) Do we actually need win32ver.rc for the external MODULES/MODULE_big/PROGRAM? win32ver.rc is not actually installed from the PostgreSQL source tree. Commenting out the above lines in the installed Makefile.port allows make to continue without errors. Best regards, Zoltán Böszörményi -- -- Zoltán Böszörményi Cybertec Schönig Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de http://www.postgresql.at/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] Cross-compile of 3rd-party extensions fails
On mån, 2011-09-19 at 10:16 +0200, Boszormenyi Zoltan wrote: [zozo@localhost postgis-1.5.3]$ mingw64-make make -C liblwgeom make[1]: Entering directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/liblwgeom' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/liblwgeom' make -C postgis make[1]: Entering directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/postgis' /home/zozo/.wine/dosdevices/z:/usr/x86_64-w64-mingw32/sys-root/mingw/lib/postgresql/pgxs/src/makefiles/../../src/Makefile.port:63: *** target pattern contains no `%'. Stop. make[1]: Leaving directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/postgis' make: *** [postgis] Error 2 Having a colon in a file name is not going to work with make. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] Cross-compile of 3rd-party extensions fails
On Mon, Sep 19, 2011 at 11:27 AM, Peter Eisentraut pete...@gmx.net wrote: On mån, 2011-09-19 at 10:16 +0200, Boszormenyi Zoltan wrote: [zozo@localhost postgis-1.5.3]$ mingw64-make make -C liblwgeom make[1]: Entering directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/liblwgeom' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/liblwgeom' make -C postgis make[1]: Entering directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/postgis' /home/zozo/.wine/dosdevices/z:/usr/x86_64-w64-mingw32/sys-root/mingw/lib/postgresql/pgxs/src/makefiles/../../src/Makefile.port:63: *** target pattern contains no `%'. Stop. make[1]: Leaving directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/postgis' make: *** [postgis] Error 2 Having a colon in a file name is not going to work with make. I guess there is 'make' instead of '$(MAKE)' in Makefile somewhere? -- marko -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] Cross-compile of 3rd-party extensions fails
2011-09-19 10:27 keltezéssel, Peter Eisentraut írta: On mån, 2011-09-19 at 10:16 +0200, Boszormenyi Zoltan wrote: [zozo@localhost postgis-1.5.3]$ mingw64-make make -C liblwgeom make[1]: Entering directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/liblwgeom' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/liblwgeom' make -C postgis make[1]: Entering directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/postgis' /home/zozo/.wine/dosdevices/z:/usr/x86_64-w64-mingw32/sys-root/mingw/lib/postgresql/pgxs/src/makefiles/../../src/Makefile.port:63: *** target pattern contains no `%'. Stop. make[1]: Leaving directory `/home/zozo/Schönig-számlák/w64/nsis/9.0/postgis-1.5.3/postgis' make: *** [postgis] Error 2 Having a colon in a file name is not going to work with make. Actually, it does work nicely. make has problems with a colon in the body of a target name (IIRC, it's invalid, anyway but may be accepted if escaped), but it doesn't complain if the filesystem give it filenames with colons in them. What it really complains about it the win32ver.rc: target in the Makefile.port. For cross-compiling postGIS, turns out that I only need the attached patches applied in /usr/x86_64-w64-mingw32/sys-root/mingw/lib/postgresql/pgxs/src on the PostgreSQL side along with similar OPTION = $(winepath -u `$PG_CONFIG --option` | dos2unix) treatments in the configure.ac where needed. Best regards, Zoltán Böszörményi -- -- Zoltán Böszörményi Cybertec Schönig Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de http://www.postgresql.at/ --- Makefile.global.old 2011-09-15 10:27:20.0 +0200 +++ Makefile.global 2011-09-19 10:39:53.723918117 +0200 @@ -125,16 +125,16 @@ PG_CONFIG = pg_config endif -bindir := $(shell $(PG_CONFIG) --bindir) -datadir := $(shell $(PG_CONFIG) --sharedir) -sysconfdir := $(shell $(PG_CONFIG) --sysconfdir) -libdir := $(shell $(PG_CONFIG) --libdir) -pkglibdir := $(shell $(PG_CONFIG) --pkglibdir) -includedir := $(shell $(PG_CONFIG) --includedir) -pkgincludedir := $(shell $(PG_CONFIG) --pkgincludedir) -mandir := $(shell $(PG_CONFIG) --mandir) -docdir := $(shell $(PG_CONFIG) --docdir) -localedir := $(shell $(PG_CONFIG) --localedir) +bindir := $(shell winepath -u `$(PG_CONFIG) --bindir` | dos2unix) +datadir := $(shell winepath -u `$(PG_CONFIG) --sharedir` | dos2unix) +sysconfdir := $(shell winepath -u `$(PG_CONFIG) --sysconfdir` | dos2unix) +libdir := $(shell winepath -u `$(PG_CONFIG) --libdir` | dos2unix) +pkglibdir := $(shell winepath -u `$(PG_CONFIG) --pkglibdir` | dos2unix) +includedir := $(shell winepath -u `$(PG_CONFIG) --includedir` | dos2unix) +pkgincludedir := $(shell winepath -u `$(PG_CONFIG) --pkgincludedir` | dos2unix) +mandir := $(shell winepath -u `$(PG_CONFIG) --mandir` | dos2unix) +docdir := $(shell winepath -u `$(PG_CONFIG) --docdir` | dos2unix) +localedir := $(shell winepath -u `$(PG_CONFIG) --localedir` | dos2unix) endif # PGXS --- Makefile.port.old 2011-09-15 10:27:20.0 +0200 +++ Makefile.port 2011-09-19 10:12:32.247300770 +0200 @@ -60,11 +60,11 @@ PGICOSTR = $(subst /,\/,IDI_ICON ICON \$(top_builddir)/src/port/$(PGAPPICON).ico\) endif -win32ver.rc: $(top_srcdir)/src/port/win32ver.rc - 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) +#win32ver.rc: $(top_srcdir)/src/port/win32ver.rc +# 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) # Rule for building a shared library from a single .o file %.dll: %.o -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers