MapServer compilation for Debian
Required libaries
ensure that some required libraries are installed from apt sources:
Download packages list for: Debian 4.0
Import list and update system with apt
dpkg --set-selections < ...-packages.txt apt-get dselect-upgrade
Download MapServer specific libraries
wget ...
http://www.libgd.org/releases/gd-2.0.35.tar.gz http://download.osgeo.org/proj/proj-4.6.1.tar.gz http://download.osgeo.org/geos/geos-3.0.3.tar.bz2 http://ftp.de.postgresql.org/packages/databases/PostgreSQL/v8.3.5/postgresql-8.3.5.tar.gz http://postgis.refractions.net/download/postgis-1.3.3.tar.gz http://download.osgeo.org/gdal/gdal-1.6.0.tar.gz http://de.php.net/get/php-5.2.6.tar.gz/from/de.php.net/mirror http://download.osgeo.org/mapserver/mapserver-5.2.1.tar.gz http://www.antigrain.com/agg-2.4.tar.gz
For ECW support download SDK from ER Mapper site
Compilation
Unpack the files
tar zxf *.tar.gz tar jxf *.tar.bz2 unzip *.zip
then cd to directory and run
for GD, PROJ4, GEOS, ECW SDK
./configure make make install
PostgreSQL 8.2
LDFLAGS=-lstdc++ ./configure --with-openssl --with-krb5 make make install
PostGIS
./configure --with-geos --with-proj --with-pgsql=/usr/local/pgsql/bin/pg_config make make install
PHP 5.2 as Apache2 module
./configure --with-gd=/usr/local --with-jpeg-dir=/usr/lib \
--with-png-dir=/usr/lib --with-tiff-dir=/usr/lib --with-zlib-dir=/usr/lib \
--with-freetype-dir=/usr/local/freetype2 --with-mysql --with-regex=php \
--enable-dbase --with-pgsql=/usr/local/pgsql/bin/pg_config --with-db4 \
--enable-soap --with-openssl --with-curl --with-xmlrpc --with-xsl \
--with-apxs2=/usr/bin/apxs2 --enable-zip
make
make install
GDAL with ecw 3.3
./configure --with-pg=/usr/local/pgsql/bin/pg_config --with-geos=yes --with-xerces \
--with-xerces-lib="-L/usr/lib -lxerces-c -lpthread" --with-xerces-inc=/usr/include/xercesc \
--with-mysql=no --with-ecw=/usr/local --with-python
make
make install
If you do not need ECW support drop the --with-ecw=/usr/local
AGG
if you get errors for MS compilation: in 'Makefile.in.Linux' add '-fPIC' to 'AGGCXXFLAGS = ...', like AGGCXXFLAGS = -fPIC -O3 -I/usr/X11R6/include -L/usr/X11R6/lib make
MapServer 5.2
./configure --with-gd=/usr/local/ --with-zlib --with-png --with-freetype=/usr/bin \
--with-proj --with-gdal=/usr/local/bin/gdal-config --with-ogr --with-wfs --with-wfsclient \
--with-wcs --with-wmsclient --without-pdf --without-tiff --without-eppl --with-threads \
--with-geos=/usr/local/bin/geos-config --with-postgis=/usr/local/pgsql/bin/pg_config \
--with-php=/usr/local/include/php --with-httpd=/usr/sbin/apache2 \
--with-agg=/home/install/mapserver/agg-2.4
make
make install
