last updated: 2013-05-08
Back to the Gaia-SINS home page

Index of contents


Setting up the MinGW 64 environment

MinGW 64 is an open source C/C++ compiler based on the popular gcc; basically, it is intended to generate executables for Windows 64 bit.

We'll suppose that you already have a basic familiarity with standard MinGW 32 + MSYS: MinGW 64 is more or less the same, but acting (more or less) as a cross-compiler.
This practically means that you can build 64 bit executables on any Win32 platform: but obviously any 64 bit program requires some Windows 64 platform to be executed.

The standard build tool-chain [originally developed for Linux] natively supports cross-compilers: and this works under Windows as well, e.g. using MinGW 64.
As you surely already know, the standard build procedure is the following one:

./configure
make
make install

Using the MinGW 64 cross-compiler is the same of using standard MinGW32: but in this case you are required to always specify the following ./configure argument:

./configure --host=x86_64-w64-mingw32
make
make install

The above --host directive is enough for ./configure to intend that a cross-compilation is required: and that the intended target is Windows 64 bit.
There are many different ways to deploy MinGW 64 (this including cross-compiling on Linux or Cygwin).
After some careful preliminary testing, I choosed the following one because it appairs the most straightforward: mingw disk layout
Once I decided the most appropriate disk layout, I duly started installing MinGW 64 on Windows 7 Pro 64 bit:
Important notice: the most recent versions of the compiler (gcc 4.7.x) seem to be completely unable to create a working GEOS library (both 32 or 64 bit). The build process is apparently succesful, but you'll soon discover that the resulting binary code is absolutely unstable and affected by many sudden crashes.
On the other side the good old gcc 4.6.x produces rock solid and absolutely safe binaries. You are warned: using this old version seems to be an absolute requirement.

I strongly reccommend using rubenv gcc 4.6.3 64 bit which works in the nicest way.
It's not a cross compiler, and doesn't requires any --host directive at all.

In order to check the actual version you are using, you simply have to execute the following command: gcc --version


PostInstallation tasks

Step #1: carefully check the C:\msys64\etc\fstab file; it must contain the following row: (this will automatically mount C:\MinGW64 as /mingw)
C:/MinGW64/mingw64 /mingw

Step #2: a dangerous issue exists: the MinGW 64 own MSYS is someway broken (as I painfully discoverd by trial and error ...): the C:\msys64\bin\find.exe executable is badly missing.
Unhappily enough, Windows has its own FIND.EXE (and it's a completely different thing from the Linux find): this may cause several builds to misteriously fail ... but now you are well aware of this dangerous pitfall. You simply have to manually pick find.exe from the standard MinGW 32 / MSYS installation, then copying this executable file into C:\msys64\bin.

Preparing to use PKG-CONFIG:

You simply have to follow the same identical procedure already explained for standard MinGW 32 + MSYS

Learming to identify 32 bit and 64 bit exacutables

32 bit binaries file iconv.exe
PE32 executable for MS Windows (console) Intel 80386 32-bit

file libiconv-2.dll
PE32 executable for MS Windows (DLL) (console) Intel 80386 32-bit

64 bit binaries file iconv.exe
PE32+ executable for MS Windows (console) Mono/.Net assembly

file libiconv-2.dll
PE32+ executable for MS Windows (DLL) (console) Mono/.Net assembly

Setting up Windows own (SYSTEM) libraries

Some apps (and libraries) require to be actually linked against MS Windows system libraries. And this is a really puzzling task using MinGW 64.

Very shortly explained: the standard GCC tool-chain has the ability to link both .DLL dynamic libraries and .a static libraries.
When Windows own system libraries are required, this isn't at all an issue for MinGW 32: But when using MinGW 64 a catastrophical issue arises:

How to circumvent this dangerous pitfall

Once we have identified the reasons causing the above link failure, caring any nursing isn't too much difficult.
All right: we are now ready to start creating our Windows 64 bit software. Let's go !

Be warned: building on MinGW 64 is more or less the same as building on MinGW 32: anyway here and there some further patch is absolutely required.

Please, carefully read and verbatim follow any given instruction.


Step 1) building libiconv

libiconv is the standard GNU library supporting locale charsets.
Required by: libspatialite, spatialite-tools

Building under Windows is not too much difficult. cd libiconv-1.14
./configure
make
make install-strip

Anyway, this will simply build and install the DLL: a further step is required in order to get the static library as well.

make distclean
./configure --disable-shared
make
make install-strip

Now you've built and installed both the static library and the DLL.
However the above process has installed badly misconfigured libcharset.la and libiconv.la files
(which are required to build other libraries in the following steps).
So in order to get a properly configured libiconv you have to accomplish a further operation:

Step 2) building libz

libz is a popular library implementing Deflate, i.e. the compression algorithm used by gzip and Zip.
Depends on: nothing
Required by: libpng, libtiff, ...

Building under Windows is quite easy, but requires to pay some attenction. cd zlib-1.2.8
make -f win32/Makefile.gcc

Now you simply have to manually copy the following files:

cp zlib1.dll /usr/local/bin
cp zconf.h zlib.h /usr/local/include
cp libz.a /usr/local/lib
cp libz.dll.a /usr/local/lib

All this will build and install both the static library and the DLL as well.
Anyway this process will not generate the libz.la file (which is required to build libtiff in one of the following steps.
So in order to get a fully installed libz you have to accomplish a further operation:

Step 3) building libjpeg

libjpeg is a popular library supporting the JPEG image compression.
Depends on: nothing
Required by: libtiff, libgaiagraphics

Important notice: you can now choose between two alternative implementations: Building the one or the other under Windows is absolutely a plain and easy task.

How-to-build libjpeg-turbo

Please note: the NASM assembler is absolutely required: if you don't have it already installed on your system, you can download and install now. Important notice: applying a small patch is absolutely required when building on MinGW64 (rubenv).
Edit the ./configure file as follows:
near line 4417:
  host=$ac_cv_host
  host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'
  host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'
  host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'

+ host_cpu='x86_64'

  echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
  echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
Save and exit; now you are ready to build.

cd libjpeg-turbo-1.2.1
./configure --prefix=/usr/local
make
make install-strip

This will build and install both the static library and the DLL as well.

How-to-build libjpeg

cd jpeg-8b
./configure
make
make install-strip

This will build and install both the static library and the DLL as well.

Step 4) building libpng

libpng is a popular library supporting the PNG image compression.
Depends on: libz
Required by: libgaiagraphics

Building under Windows is absolutely a plain and easy task. cd libpng-1.6.2
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure
make
make install-strip

Important notice: you have to properly set the shell environment in order to retrieve the already installed libz; this is the duty of the two above export directives.
This will build and install both the static library and the DLL as well.

Very important notice the ./configure script supporting the most recent version of libpng seems unable to correctly locate the zlib.h header file; you'll probably get a fatal error about missing zlib.h during the very first steps of make.
So you have to manually apply the following patch to circumvent this issue. Edit the Makefile file as follows:

175c175
< DEFAULT_INCLUDES = -I.
---
> DEFAULT_INCLUDES = -I. -I/usr/local/include

Save and exit; now you are finally ready to build.


Step 5) building XZ (liblzma)

liblzma is a popular library supporting the LZMA advanced compression (it's a component of the XZ package).
Depends on: nothing
Required by: libtiff

Building under Windows is absolutely a plain and easy task. cd xz-5.0.4
./configure --build=x86_64-w64-mingw32
make
make install-strip

This will build and install both the static library and the DLL as well.

Step 6) building libtiff

libtiff is a popular library supporting the TIFF image format.
Depends on: libz, libjpeg
Required by: libgaiagraphics

Building under Windows is absolutely a plain and easy task. cd tiff-4.0.3
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure
make
make install-strip

Important notice: you have to properly set the shell environment in order to retrieve the already installed libz; this is the duty of the two above export directives.

This will build and install both the static library and the DLL as well.

Step 7) building libproj

libproj is a library supporting coordinate's transformation between different Reference Systems [PROJ.4]
Depends on: nothing
Required by: libgeotiff, libspatialite, spatialite-tools

Building under Windows is an easy task. cd proj-4.8.0
./configure
make
make install-strip

This will build and install both the static library and the DLL as well.

Step 8) building libgeotiff

libgeotiff is a library supporting the GeoTIFF raster format
Depends on: libtiff, libproj
Required by: libgaiagraphics

Building under Windows is an easy task. Important notice: there is a bug in the standard build scripts forbidding to create a Windows DLL using MinGW + MSYS.
So you have to manually apply the following patch to circumvent this issue.
(many thanks to Alexey Pavlov for suggesting this patch)
Edit the Makefile.in file as follows:

451c451
< libgeotiff_la_LDFLAGS = -version-info 3:0:1
---
> libgeotiff_la_LDFLAGS = -version-info 3:0:1 -no-undefined

Save and exit; now you are ready to build.

cd libgeotiff-1.4.0
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure --with-proj --with-libz --with-jpeg --enable-incode-epsg
make
make install-strip

This will build and install both the static library and the DLL as well.

Step 9) building libgeos

libgeos is a library representing a C++ porting of JTS [Java Topology Suite].
Depends on: nothing
Required by: libspatialite, spatialite-tools

This library really is an huge and complex piece of software; building on Windows is an incredibly time consuming task.

Very important notice:
You can alternatively choose to build the still experimental (but reasonably stable) GEOS develompment version in order to activate several further advanced options (e.g. the Delaunay Triangulation). In this case you should skip this step and directly jump to the following Step 8.a) cd geos-3.3.8
./configure
make
make install-strip

This will build and install both the static library and the DLL as well.


Step 9.a) building libgeos-trunk

Alternative Step: Important notice: there is a bug in the Nightly Snapshot forbidding to build on MinGW + MSYS.
You'll probably get the following error immediatly after excuting make
$ make
sh ./tools/svn_repo_revision.sh
sh: ./tools/svn_repo_revision.sh: No such file or directory
make: *** [geos_svn_revision.h] Error 127
So you have to manually apply the following patch to circumvent this issue.
Use any text editor of your choice and create a -/tools/svn_repo_revision.sh file just containg this line:
echo "hello world"
Save and exit; now you are ready to build.

cd geos-yyyymmdd
./configure
make
make install-strip

This will build and install both the static library and the DLL as well.


Step 10) building libexpat

libexpat is a well known standard library supporting XML parsing.
Depends on: nothing
Required by: libfontconfig, spatialite-tools, ...

Building under Windows really is a piece-of-cake. cd expat-2.1.0
./configure
make
make install

This will build and install both the static library and the DLL as well.


Step 11) building FreeXL

FreeXL is an utility library implementing read-access for Excel (.xls) spreadsheets
Depends on: libiconv
Required by: spatialite-tools, libspatialite, spatialite-gui

Building under Windows is an easy task. cd freexl-1.0.0e
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure
make
make install-strip

This will build and install both the static library and the DLL as well.

Please note: if you wish, you can now execute the complete test coverage in order to verify if your build was fully succesful.
This further step is optional and requires a small extra time, but it's strongly suggested anyway.

make distclean
./configure --enable-gcov=yes
make
make check


Step 12 building ReadOSM

ReadOSM is an utility library supporting OSM datasets parsing
Depends on: libz, libexpat
Required by: spatialite-tools

Building under Windows is an easy task. cd readosm-1.0.0b
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure
make
make install-strip

This will build and install both the static library and the DLL as well.

Please note: if you wish, you can now execute the complete test coverage in order to verify if your build was fully succesful.
This further step is optional and requires a small extra time, but it's strongly suggested anyway.

make distclean
./configure --enable-gcov=yes
make
make check


Step 13) building libsqlite

libsqlite is the library iimplementing the SQLite DBMS engine
Depends on: nothing
Required by: libspatialite, librasterlite

Building under Windows is an easy task. cd sqlite-autoconf-3071602
export "CFLAGS=-DSQLITE_ENABLE_STAT3=1 -DSQLITE_ENABLE_TREE_EXPLAIN=1 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1"
./configure
Warning: you are absolutely required to apply few manual patches into the libtool file immediately after executing ./configure:
  • replace any occurence of pei*-i386 with pe-x86-64
  • then you can continue as usual
make
make install-strip

This will build and install both the static library and the DLL as well.


Step 14) building OpenSSL

Important notice: if you are not interested in building liblwgeom you can directly jump to libspatialite

OpenSSL is a well known standard library supporting SSL, i.e. the encrypted HTTPS web protocol.
Depends on: nothing
Required by: libcurl

Building under Windows is a little bit difficult, and requires to pay close attention.
The configure script isn't at all a standard one: please read carefully the following instructions.
tar zxvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./Configure mingw64 --prefix=/usr/local shared
make
make install

This will build and install both the static libraries and the DLLs as well.


Step 15) building PostgreSQL

PostgreSQL is a well known enterprise DBMS; building PostgreSQL seems to be a really odd dependency for SpatiaLite (and really is).
Anyway it's strictly required by liblwgeom; if you aren't interested in supporting liblwgeom you can directy jump to libspatialite

Depends on: libz, OpenSSL
Required by: liblwgeom
Building under Windows is an easy task. cd postgresql-9.2.1
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure --prefix=/usr/local --with-libraries=/usr/local/lib
make
make install-strip

This will build and install both the static library and the DLL as well.


Step 16) building libxml2

libxml2 is the well known XML parser of Gnome. it's strictly required by liblwgeom; and is an optional dependency for libspatialite.
If you aren't interested in supporting liblwgeom you can directy jump to libspatialite

Depends on: libz, libiconv
Required by: liblwgeom
Building under Windows is an easy task. cd libxml2-2.9.1
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure --without-python
make
make install-strip

This will build and install both the static library and the DLL as well.


Step 17) building liblwgeom

liblwgeom is a library implementing several usefull geometry functions; it was initially intended to support PostGIS, but it's now a self-standing library.
i.e. PostGIS depends on liblwgeom, but liblwgeom doesn't depends on PostGIS.
Anyway a historical legacy still exists; in order to install liblwgeom you are nessarily forced to build PostGIS, because a standalone build system doesn't exists.

Depends on: libproj, libgeos, libxml2, PostgreSQL
Required by: libspatialite (optional dependency)
Building under Windows is an easy task. cd postgis-2.0.3
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure --without-raster
make
make install

Important notice: you'll probably get a fatal error at some time during the compilation: to resolve this issues you should manually edit the /usr/local/include/postgresql/server/utils/elog.h header file:
line 118:
------------
< extern int errcode(int sqlerrcode);
---
> extern int pg_errcode(int sqlerrcode);
then save and exit.

This will build and install the static library alone; building the corresponding DLL seems to be an unsupported option.

That's not all: you are now required to manually edit the /usr/local/lib/liblwgeom.la file, applying this patch:
11c11
< library_names=''
---
> library_names='liblwgeom.a'

All right; you are now ready to use liblwgeom.


Step 18) building libspatialite

libspatialite is the main core of SpatiaLite
Depends on: libiconv, libproj, libgeos, FreeXL
Required by: spatialite-tools, librasterlite, spatialite-gui, spatialite-gis, LibreAtlas

Building under Windows is an easy task. cd libspatialite-4.1.0-beta
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

./configure --target=mingw32 --enable-lwgeom=yes \
    --enable-geostrunk=yes --enable-libxml2=yes

make
make install-strip

Please note: the above example assumes that both liblwgeom and GEOS-trunk are available; if this is not your case you should obviously omit to specify the corresponding build options.

This will build and install both the static library and the DLL as well.

Please note: if you wish, you can now execute the complete test coverage in order to verify if your build was fully succesful.
This further step is optional and requires a small extra time, but it's strongly suggested anyway.

make distclean
./configure --target=mingw32 --enable-gcov=yes
make
make check


Step 19) building spatialite-tools

spatialite-tools the SpatiaLite command-line management tools
Depends on: libiconv, libproj, libgeos, FreeXL, ReadOSM, libspatialite, libexpat
Building under Windows is an easy task. First of all, you must check if you've already installed pkg-config.exe
If not, please read the above instructions

And now you must set the PKG_CONFIG_PATH as appropriate:

export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

After this you are now ready to build as usual:

cd spatialite-tools-4.1.0-RC1
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure --target=mingw32
make
make install-strip

Please note: following the above method you'll get dynamically linked tools [i.e. depending on DLLs].
If you wish instead to build statically linked tools [i.e. self contained, not depending on DLLs], now type:

mkdir static_bin
make -f Makefile-static-MinGW
cp static_bin/* /usr/local/bin


Step 20) building wxWidgets MSW

wxWidgets is a popular widgets library, supporting GUI in a cross-platform fashion; MSW is the specific porting supporting Windows.
Depends on: nothing
Required by: spatialite-gui, spatialite-gis

This library really is an huge and complex piece of software; building on Windows is an incredibly time consuming task, but is quite plain and easy. cd wxMSW-2.8.12
mkdir msw_build
cd msw_build
export "CFLAGS=-I/usr/local/include"
export "CXXFLAGS=-fpermissive -I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
../configure --disable-shared --disable-debug \
    --disable-threads --enable-monolithic --enable-unicode \
    --without-expat --without-regex --enable-graphics_ctx


Please note: the wxMSW ./configure is highly configurable: you must apply exactly the above settings.
Anyway, when ./configure stops, it's a good practice to check if the final report looks exactly like this:

Configured wxWidgets 2.8.12 for `i686-pc-mingw32'

  Which GUI toolkit should wxWidgets use?                 msw
  Should wxWidgets be compiled into single library?       yes
  Should wxWidgets be compiled in debug mode?             no
  Should wxWidgets be linked as a shared library?         no
  Should wxWidgets be compiled in Unicode mode?           yes
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.4      no
                                       wxWidgets 2.6      yes
  Which libraries should wxWidgets use?
                                       jpeg               sys
                                       png                sys
                                       regex              no
                                       tiff               sys
                                       zlib               sys
                                       odbc               no
                                       expat              no
                                       libmspack          no
                                       sdl                no

now, when ./configure stops, you have to continue as usual:

make
make install-strip

Important notice: wxWidgets is now configured for any further usage: but unhappily it assumes being on Win32, and this is obviously wrong.
So you must manually adjust the wx-config script (/usr/local/bin/wx-config) as follows:

Step 21) building libfreetype

libfreetype is a standard library supporting TrueType fonts.
Depends on: nothing
Required by: libcairo, ...

Building under Windows is an easy task. cd freetype-2.4.11
./configure
make
make install

This will build and install both the static library and the DLL as well.


Step 22) building libfontconfig

libfontconfig is a standard library supporting font customization and configuration.
Depends on: libexpat, libfreetype, libiconv
Required by: libcairo, ...

Building under Windows is an easy task. cd fontconfig-2.10.92
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

./configure --disable-docs
make
make install-strip

This will build and install both the static library and the DLL as well.


Step 23) building libpixman

libpixman is the standard library implementing pixel manipulation for Cairo.
Depends on: nothing
Required by: libcairo, ...

Building under Windows is an easy task.
First of all, you must check if you've already installed pkg-config.exe
If not, please read the above instructions

And now you must set the PKG_CONFIG_PATH as appropriate:

export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

All right, your system configuration is ready to build pixman, so you can now: cd pixman-0.28.2
./configure
make
make install-strip

This will build and install both the static library and the DLL as well.


Step 24) building libcairo

libcairo is a very popular graphics library.
Depends on: libpixman, libfreetype, libfontconfig, libpng
Required by: libgaiagraphics, ...

Building under Windows is a little bit harder than usual.
First of all, you must check if you've already installed pkg-config.exe
If not, please read the above instructions

And now you must set the PKG_CONFIG_PATH as appropriate:

export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

All right, your system configuration is ready to build libcairo, so you can now: cd cairo-1.12.14
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure
make
make install-strip

This will build and install both the static library and the DLL as well.


Step 25) building libgaiagraphics

libgaiagraphics is a common utility library supporting graphics rendendering
Depends on: libjpeg, libpng, libtiff, libgeotiff, libcairo

Required by: spatialite-gui [next-to-come releases of librasterlite and spatialite-gis]

Building under Windows is an easy task.
First of all, you must check if you've already installed pkg-config.exe
If not, please read the above instructions

And now you must set the PKG_CONFIG_PATH as appropriate:

export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

All right, your system configuration is ready to build libgaiagraphics, so you can now: cd libgaiagraphics-0.5
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure --target=mingw32
make
make install-strip

This will build and install both the static library and the DLL as well.


Step 26) building spatialite_gui

spatialite_gui the SpatiaLite GUI user-friendly tool
Depends on: libspatialite, wxWidgets, libgaiagraphics
Building under Windows is an easy task. First of all, you must check if you've already installed pkg-config.exe
If not, please read the above instructions

And now you must set the PKG_CONFIG_PATH as appropriate:

export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

After this you are now ready to build as usual:

cd spatialite_gui-1.6.1-beta
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure
make
make install-strip

Please note: following the above method you'll get a dynamically linked GUI tool [i.e. depending on DLLs].
If you wish instead to build a statically linked GUI tool [i.e. self contained, not depending on DLLs], now type:

mkdir static_bin
make -f Makefile-static-MinGW
cp static_bin/* /usr/local/bin


Step 27) building RasterLite

librasterlite is a library allowing to store huge raster coverages within a SpatiaLite DB
Depends on: libjpeg, libpng, libtiff, libgeotiff, libspatialite

Required by: spatialite-gis, LibreAtlas

Building under Windows is an easy task.
First of all, you must check if you've already installed pkg-config.exe
If not, please read the above instructions

And now you must set the PKG_CONFIG_PATH as appropriate:

export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

All right, your system configuration is ready to build librasterlite, so you can now: cd librasterlite-1.1g
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure
make
make install-strip

This will build and install both the static library, the DLL and the supporting tools as well.

Please note: following the above method you'll get dynamically linked tools [i.e. depending on DLLs].
If you wish instead to build statically linked tools [i.e. self contained, not depending on DLLs], now type:

mkdir static_bin
make -f Makefile-static-MinGW
cp static_bin/* /usr/local/bin


Step 28) building libharu

libharu [aka libhpdf] is a library supporting output to PDF documents
Depends on: libpng

Required by: spatialite-gis

Building under Windows is an easy task: cd libharu-2.2.1
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure
make
make install-strip

This will build and install both the static library and the DLL as well.

Important notice: libharu 2.2.1 isn't fully compatible with recent libpng versions;
you are required to manually edit the -/src/hpdf_image_png.c source as follows:

replace any occurrence of: info_ptr->height as: getHeight(info_ptr)
replace any occurrence of: info_ptr->width as: getWidth(info_ptr)
replace any occurrence of: info_ptr->bit_depth as: getBitDepth(info_ptr)
replace any occurrence of: info_ptr->color_type as: getColorType(info_ptr)

Step 29) building spatialite_gis

spatialite_gis a minimalistic GIS built on the top of SpatiaLite and RasterLite
Depends on: libspatialite, wxWidgets, librasterlite
Building under Windows is an easy task. First of all, you must check if you've already installed pkg-config.exe
If not, please read the above instructions

And now you must set the PKG_CONFIG_PATH as appropriate:

export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

After this you are now ready to build as usual:

cd spatialite_gis-1.0.0c
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure --target=mingw32
make
make install-strip

Please note: following the above method you'll get a dynamically linked GUI tool [i.e. depending on DLLs].
If you wish instead to build a statically linked GUI tool [i.e. self contained, not depending on DLLs], now type:

mkdir static_bin
make -f Makefile-static-MinGW
cp static_bin/* /usr/local/bin


Step 30) building giflib

giflib is a popular library supporting the GIF image compression.
Depends on: nothing
Required by: ?

Building under Windows is absolutely a plain and easy task. cd giflib-5.0.4
./configure
make
make install-strip

Important notice: you'll probably get a fatal error at some time during the compilation (missing mkstemp link symbol).
To resolve this issues you should manually edit the giflib-5-0-4/util/gifinto.c source:
near line 108:
------------
< FD = mkstemp(FoutTmpName); /* returns filedescriptor */
---
> FD = -1; /* mkstemp(FoutTmpName); */ /* returns filedescriptor */
Save and exit.

This will build and install both the static library and the DLL as well.


Step 31) building libwebp

libwebp is an innovative library supporting the recently introduced WebP image compression.
Depends on: libjpeg, libpng, libtiff
Required by: ?

Building under Windows is absolutely a plain and easy task. cd libwebp-0.3.0
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure
make
make install-strip

Important notice: you have to properly set the shell environment in order to retrieve the already installed libz; this is the duty of the two above export directives.
This will build and install both the static library and the DLL as well.


Step 31) building LibreAtlas

LibreAtlas is an open source Geography Education application built on the top of SpatiaLite and RasterLite. It uses LibteAtlas databases which are a digital alternative to a paper atlas
Depends on: libspatialite, wxWidgets, librasterlite
Building under Windows is an easy task. First of all, you must check if you've already installed pkg-config.exe
If not, please read the above instructions

And now you must set the PKG_CONFIG_PATH as appropriate:

export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

After this you are now ready to build as usual:

cd libreatlas-1.0.0a
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure --target=mingw32
make
make install-strip

Please note: following the above method you'll get a dynamically linked GUI tool [i.e. depending on DLLs].
If you wish instead to build a statically linked GUI tool [i.e. self contained, not depending on DLLs], now type:

mkdir static_bin
make -f Makefile-static-MinGW
cp static_bin/* /usr/local/bin


Step 32) building libcurl [not strictly required by the current SpatiaLite version !!!]

libcurl is a well known library supporting URLs (networking, web protocols)
Depends on: libz, OpenSSL
Required by: ?

Building under Windows is an easy task. First of all, you must check if you've already installed pkg-config.exe
If not, please read the above instructions

And now you must set the PKG_CONFIG_PATH as appropriate:

export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"

After this you are now ready to build as usual:

cd curl-7.30.0
export "CPPFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
./configure
make
make install-strip

This will build and install both the static library and the DLL as well.


Back to the Gaia-SINS home page
last updated: 2013-03-01