wiki:BuildWithMingw

MinGW

Find and install MinGW and MSYS. Start from http://www.mingw.org/

Install g++ but do not install MinGW make.

I suggest creating a dev.bat, where changes to PATH are collected:

PATH=c:\mingw\bin;%PATH%

Perl

Perl is the base of all higher level tools in Geoinformatica. The following assumes Perl 5.10.0

The makefile.mk in win32/ is the build configuration. I'm adding -mms-bitfields to line 525. see this discussion

BUILDOPT	+= -fno-strict-aliasing -DPERL_MSVCRT_READFIX -mms-bitfields

Also, I change INST_TOP to $(INST_DRV)\Geoinformatica

The build is easy, in dos command prompt:

dmake
dmake install

Perl modules are always built in shell using dmake, which is available at CPAN as Perl itself.

lib/ExtUtils/Liblist/Kid.pm needs to be patched with Kid.pm.diff (works for EU::MM 6.52) to make it find import libraries that end with .dll.a

Save Kid.pm.diff to a file called diff, and issue command

patch -p0 Kid.pm <diff

in msys shell.

GTK+

GTK+

I'm not building these myself. We'll need both

ftp://ftp.gtk.org/pub/gtk/v2.10/win32/ and

http://gladewin32.sourceforge.net

since we need Gtk2::GladeWin

Glib, Cairo, Pango, Gtk2, and Gtk2-GladeXML modules

All these modules can be found from http://search.cpan.org/~tsch/

ExtUtils::Depends and ExtUtils::PkgConfig are prerequisites to these and also available at the above page. Currently the Depends.pm needs to be patched with a patch attached to this bug report

Also pango.exports needs (1.220)

gtk2perl_pango_attribute_register_custom_type
gtk2perl_pango_attribute_get_type
gtk2perl_pango_attr_iterator_get_type
gtk2perl_pango_script_iter_get_type

and newSVPangoRectangle and SvPangoRectangle need to be removed from Gtk2.exports (1.220).

Data access and geo libraries

These are built in MSYS. Most are used by GDAL.

  • pq to access data in PostgreSQL and PostGIS
    • it's possible to use the libpq from the Windows ports of these
  • expat, needed for curl
    • there's a good Windows port with devel support available in it's home page
  • curl, needed for WMS, WCS, WFS
  • GEOS for simple features methods
  • Proj4 for cartographic projections
    • the DLL needs to be made manually:
cd src
gcc -shared -o libproj.dll -Wl,--out-implib=libproj.dll.a \
-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive \
.libs/libproj.a -Wl,--no-whole-archive /c/mingw/lib/libmingw32.a

See also this

  • GDAL
    • GTK+ may cause problems because it contains libtiff, I move libtiff includes away and use the internal libtiff
    • $(GDAL_ROOT)/ needs to be removed from GNUmakefile
    • I've made a gdal.pc, which is used by Geo::Raster and Geo::Vector
      prefix=/usr/local
      exec_prefix=${prefix}
      libdir=${exec_prefix}/lib
      includedir=${prefix}/include
      
      Name: GDAL
      Description: Geospatial Data Abstraction Library
      Version: 1.7.0
      Requires: libcurl xerces-c
      Libs:  -L${exec_prefix}/lib -lgdal.dll -lgeos.dll -lgeos_c.dll -lexpat -lpq -ljpeg -lpng12 -lz
      Cflags:  -I${prefix}/include
      
  • libral
    • there's a MinGW specific Makefile, use it The DLL's may be bloated because of debug code, use strip --strip-debug x.dll to remove it.

Perl interface to GDAL

In CPAN there is Geo::GDAL, whose latest version is for the latest version of GDAL. It is in practice the same as the one distributed with the GDAL source code. I recommend that you always build the Geo::GDAL module separately from GDAL itself, after you have built and installed GDAL. In the GDAL source directory, while in MSYS, say (this requires swig):

cd swig/perl
rm *wrap*
make generate

Then in dos command prompt

perl Makefile.PL
make
make test
make install

Geo::Raster and Geo::Vector

These two modules are interdependent, so dmake install both before running dmake test in either (this is a bug that should be corrected).

Gtk2::Ex::Geo

In a case the image-base in Makefile had to be changed to the actual base, shown by the depends -tool.

Last modified 15 years ago Last modified on 06/15/09 06:55:38
Note: See TracWiki for help on using the wiki.