back
Index of contents
The default destination path prefix for installed files is /usr/local.
Results from the installation script will be placed into subdirectories
include and lib.
If this default path prefix is proper, then execute:
./configure
If another path prefix is required, then execute:
./configure --prefix=/my/path
In either case, the directory of the prefix path must exist and be
writable by the installer.
After executing configure, execute:
make
make install
Or even better, you can strip any executable binary, in order
to eliminate any debugging symbol, and thus widely reducing their size:
make install-strip
The main external dependencies needed in order to build libspatialite
are the PROJ.4 and GEOS devel-packages.
You can build libspatialite without including GEOS; GEOS is
a quite heavy-weighted library, and you may well prefer
to build a light-weighted version of 'libspatialite' [loosing
some advanced features, by the way, but saving lots of memory];
if you want to do such a thing:
# ./configure --enable-geos=no
[disabling GEOS saves some 1.200 KB]
You can even decide not to include PROJ.4:
# ./configure --enable-proj=no
[disabling PROJ.4 saves some 170 KB]
If you wish to build an extra-light-weighted version of
libspatialite you can obviously omit both PROJ.4 and GEOS:
# ./configure --enable-geos=no --enable-proj=no
IMPORTANT NOTICE
avoiding to enable GEOS and/or PROJ is useful only
if you are planning to use libspatialite in order to support some
process requiring only limited access to SQLite/SpatiaLite DBs.
But if you intend to use 'libspatialite' for any serious GIS app,
you absolutely MUST support both PROJ and GEOS.
PROJ
libspatialite is built using PROJ v.4.6.1 [and I suppose any
previous version may be used as well]
Many Linux distros support PROJ as a standard package; and you can
get some standard PROJ package on MacOsX as well.
Anyway, you can easily build PROJ by yourself starting from sources
[this is true on Windows as well, using both MinGW or Visual Studio].
You can get the latest PROJ sources from:
http://trac.osgeo.org/proj/
The standard ./configure [no args] will apply the followings setting
to locate the PROJ objects:
header files: /usr/local/include
libraries: /usr/local/lib
You are anyway allowed to search them on any other different location,
simply using the following options:
./configure --with-proj-include=some_dir --with-proj-lib=some_other_dir
GEOS
libspatialite is built using GEOS v.3.1.1 [you can use any v.3.0.x
as well; using the oldest v.2.x.x is not supported]
Many Linux distros support GEOS as a standard package; and you can
get some standard GEOS package on MacOsX as well.
Building GEOS by yourself starting from sources is a quite lengthy
but plain task on Linux and/or MacOsX.
On Windows [using both MinGW or Visual Studio] building GEOS is
quite a nightmare, but not an impossible task.
You can get the latest GEOS sources from:
http://trac.osgeo.org/geos/
The standard ./configure [no args] will apply the followings setting
to locate the GEOS objects:
header files: /usr/local/include
libraries: /usr/local/lib
You are anyway allowed to search them on any other different location,
simply using the following options:
./configure --with-geos-include=some_dir --with-geos-lib=some_other_dir
ICONV [Windows only]
If building on Windows, then a further dependency has to be satisfied,
the ICONV one.
PLEASE NOTE: this one is not an issue when building on Linux or MacOsX,
because these systems offers a native ICONV support (this latter being
a standard system component).
For Windows the preferred solution is to download and install the pre-built
ICONV binaries and related files from:
http://gnuwin32.sourceforge.net/packages/libiconv.htm
Building on Linux
Building libspatialite on Linux does not require any special
setting; we'll suppose you have unpacked the sources as
./libspatialite-amalgamation-2.3.1
# cd libspatialite-amalgamation-2.3.1
# ./configure
# make
# sudo make install
# or (in order to save some disk space)
# sudo make install-strip
Building libspatialite on MacOsX is the same as for Linux.
We'll suppose you have unpacked the sources as
./libspatialite-amalgamation-2.3.1
# cd libspatialite-amalgamation-2.3.1
# ./configure --target=macosx
# make
# sudo make install
# or (in order to save some disk space)
# sudo make install-strip
IMPORTANT NOTICE: this will build an executable for your
specific platform. i.e. when building on a PPC Mac,
resulting binary will be targeted to run on PPC anyway.
And when building on Intel Mac, resulting binary will
run on Intel target.
On Windows systems you can choose using two different compilers:
- MinGW / MSYS
this represents a smart porting of a minimalistic Linux-like
devel-toolkit
- Microsoft Visual Studio .NET
this one is the standard platform devel-toolkit
We suppose you have already installed the MinGW compiler and the MSYS shell.
Building libspatialite under Windows is then more or less like building
on any other UNIX-like system.
We'll suppose you have unpacked the sources as
C:\libspatialite-amalgamation-2.3.1
$ cd c:/libspatialite-amalgamation-2.3.1
$ export "CFLAGS=-I/usr/local/include"
$ export "LDFLAGS=-L/usr/local/lib"
$ ./configure --target=mingw32
$ make
$ make install
$ or (in order to save some disk space)
$ make install-strip
We suppose you have already installed Visual Studio enabling the command
line tools [you are expected to use the command prompt shell].
We'll suppose you have unpacked the sources as
C:\libspatialite-amalgamation-2.3.1
> cd c:\libspatialite-amalgamation-2.3.1
> nmake /f makefile.vc
> nmake /f makefile.vc install
Please note: standard definitions in makefile.vc assumes:
- enabling PROJ
- disabling GEOS
If you want to alter this basic behaviour you have then to
adapt makefile.vc.
The libspatialite-geos.def file contains any external symbol
to be exported from the DLL when you build including GEOS.
back