------------------------------------------------------------------- README.CONFIGURE - MapServer "configure" script compilation options ------------------------------------------------------------------- For Unix users, Mapserver comes with a GNU autoconf "configure" script that should take care of (hopefully!) all compilation issues for you. The configure script won't work on Windows NT. See the file README.WIN32 for details on compiling on Windows systems. The default configure behavior is to try to locate on your system the most common optional libraries that MapServer can use and include them in the Makefiles. It also takes care of setting the proper compilation flags to handle issues like the version of GD that you are using, etc. For the impatient: ------------------ To build the "mapserv" CGI program with the default options, go to the directory where you extracted the MapServer source code package and... :: $ cd mapserver-5.0.x $ ./configure $ make Unless something went wrong, you should have executables in the current directory for the "mapserv" CGI program and the other utility programs. You can copy the "mapserv" program to your HTTP server's CGI directory and start using it. See the MapServer web site at http://mapserver.gis.umn.edu/ for usage instructions. "configure" options: -------------------- Here is the list of available options as returned by "./configure --help": Optional Features: :: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-ignore-missing-data Ignore missing data file errors at runtime --disable-ignore-missing-data Report all missing data files (enabled by default). --enable-point-z-m Use point Z and M parameters (disabled by default). --disable-point-z-m Disable support for point Z and M parameters. --disable-fast-nint Use safe MS_NINT with reliable rounding --enable-debug Include "-g" in CFLAGS for debugging. --disable-debug Do not include "-g" in CFLAGS (the default). --enable-gcov Enable source code coverage testing using gcov --enable-perlv-ld-detect (applies to --with-php only) Use perl -V output to figure the command to use to link php_mapscript.so. Try this only if the default internal macro didn't work. --enable-runpath Include runtime library path flags (-Wl,-R) in link. Required on *BSD systems. --disable-runpath Do not link with runtime lib path (the default). Optional Packages: :: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pkg-config[=PATH] Include pkg-config support (PATH is path to pkg-config) --with-freetype=DIR GD: Specify where FreeType 2.x is installed (DIR is path to freetype-config program or install dir). --with-zlib=DIR GD,SVG: Specify where zlib is installed (DIR is path to zlib install dir). --with-png=DIR GD: Specify where PNG is installed (DIR is path to PNG install dir). --with-jpeg[=DIR] Include JPEG support (DIR is LibJPEG's install dir). --with-xpm=DIR GD: Specify where libXpm is installed (DIR it the libXpm install prefix). --with-libiconv=DIR Specify where libiconv is installed (DIR is path to libiconv install dir (prefix)). --with-gd[=[static,]DIR] Specify which version of GD to use (DIR is GD's install dir). --without-pdf Disable PDF support. --with-pdf[=DIR] Include PDF support (DIR is PDFlib's install dir). --with-agg[=DIR] Include AGG support (DIR is AGG's install dir). --with-cairo Include Cairo support (PDF and SVG support) --without-eppl Disable EPPL7 support. --with-eppl Include EPPL7 support. --with-proj[=DIR] Include PROJ.4 support (DIR is PROJ.4's install dir). --with-threads[=linkopt]Include thread safe support --with-sde[=DIR] Include ESRI SDE support (DIR is SDE's install dir). --with-sde-version[=VERSION NUMBER] Set ESRI SDE version number (Default is 91). --with-geos[=PATH] Include GEOS support (PATH is path to geos-config) --with-ogr[=PATH] Include OGR support (PATH is path to gdal-config). --with-gdal[=PATH] Include GDAL support (PATH is path to gdal-config) --without-tiff Disable TIFF support. --with-tiff[=DIR] Include TIFF support (DIR is LibTIFF's install dir). --with-postgis[=ARG] Include PostGIS Support (ARG=yes/path to pg_config) --with-mygis[=ARG] Include MyGIS Support (ARG=yes/path to my_config) --with-oraclespatial[=ARG] Include OracleSpatial Support (ARG=yes/path to Oracle home) --with-ming[=DIR] Include MING/Flash Support (DIR=path to Ming directory) --without-wms Disable OGC WMS Compatibility (enabled by default). --with-wfs Enable OGC WFS Server Support (OGR+PROJ4 required). --with-wcs Enable OGC WCS Server Support (GDAL+PROJ4 required). --with-wmsclient Enable OGC WMS Client Connections (PROJ4 and libcurl required). --with-wfsclient Enable OGC WFS Client Connections (PROJ4, libcurl and OGR required). --with-sos Enable OGC SOS Server Support (libxml2 and PROJ4 and OGR required). --with-curl-config=PATH Specify path to curl-config. --with-xml2-config=PATH Specify path to xml2-config. --with-fribidi-config[=ARG] Include FriBidi Support (ARG=yes/path to fribidi-config or fribidi.pc) --with-fastcgi=path Enable FastCGI, point to installed tree. --with-httpd Specify path to 'httpd' executable. --with-warnings[=flags] Enable strict warnings (or user defined warnings) --with-php=DIR Specify directory where PHP4's include files are installed (or a pointer to the full source tree) Required in order to compile the PHP/MapScript module. --without-ld-shared Disable shared library support --with-apxs[=FILE] (CURRENTLY DISABLED) Use this option only if building the PHP MapScript on a system where PHP was built as a shared Apache module. FILE is the optional pathname to the Apache apxs tool; defaults to apxs. --with-apache=DIR (CURRENTLY DISABLED) Use this option only if building the PHP MapScript on a system where PHP was built as an Apache module statically linked into the httpd executable. DIR is the path to the apache include files. --with-java-include-os-name=dirname (AUTODETECTED) Use this option only if building of Java Mapscript fails because os-dependent headers are not found. dirname is the name of subdirectory of the Java installation where os-dependent include files are found (for instance linux or solaris). Only used by Java mapscript. The most common options are described in more details below. GD and Support Libraries: ------------------------- :: --with-gd[=DIR] Specify which version of GD to use (DIR is GD's install dir). - The GD library is the only component that is not optional. Version 2.0.16 or more recent is required, and GD 2.0.35 or higher is strongly recommended (see http://www.boutell.com/gd/ . - Version 2.0.29 or more recent is required for the LABEL FOLLOW option to work (curved labels, added in 4.10). - There is a bug in GD with versions below 2.0.35 with 1 pixel antialiased lines that requires a patch for GD. See bug 1612: http://trac.osgeo.org/mapserver/ticket/1612 - By default, configure tries to locate GD on your system and uses the system copy if found. - You can use the --with-gd=DIR option to use a copy of GD installed in directory "DIR". Make sure that this copy of GD is compiled before using this option. - GD has dependencies on a few external libraries and it may be necessary to explicitly specify the path where those libraries are found using the following configure options: :: --with-freetype=DIR GD: Specify where FreeType 2.x is installed (DIR is path to freetype-config program or install dir). --with-zlib=DIR GD,SVG: Specify where zlib is installed (DIR is path to zlib install dir). --with-png=DIR GD: Specify where PNG is installed (DIR is path to PNG install dir). --with-jpeg[=DIR] Include JPEG support (DIR is LibJPEG's install dir). --with-xpm=DIR GD: Specify where libXpm is installed (DIR is the libXpm install prefix). --with-libiconv=DIR Specify where libiconv is installed (DIR is path to libiconv install dir (prefix)). - In each case you specify the install dir of the support library, e.g. ./configure .... --with-gd=/usr/local --with=jpeg=/usr/local \ --with-png=/usr/local --with-zlib=/usr/local Note: If libraries required by GD are not found, it may cause configure to not accurately detect which image formats are supported by GD, and may cause configure and building to fail. TIFF Support: ------------- :: --without-tiff Disable TIFF support. --with-tiff[=DIR] Include TIFF support (DIR is LibTIFF's install dir). - Tiff support is optional, but it will be included by default if configure finds libtiff on your system. If you use --with-gdal then Tiff support is disabled by default since GDAL includes Tiff support. - Use --without-tiff to explicitly disable Tiff support. - Use the --with-tiff=DIR option to use a copy of LibTiff installed in directory "DIR". Make sure that this copy of LibTiff is compiled before using this option. - Do not use --with-tiff together with --with-gdal. If you are also using --with-gdal then you should *not* use --with-tiff. GDAL provides better Tiff support than this option, and that will save potential problems at runtime. Note: Your version of libtiff may have been compiled with JPEG or ZLIB support. If so, you may need to specify --with-jpeg=DIR or --with-zlib=DIR to resolve these libraries for linking. Failure to resolve dependent libraries may cause linking to fail. EPPL7 Support: -------------- :: --without-eppl Disable EPPL7 support. --with-eppl Include EPPL7 support. - EPPL7 support is optional and does not require linking with any external library. - It will be included by default, and can be disabled with --without-eppl. PROJ.4 Support: --------------- :: --with-proj[=DIR] Include PROJ.4 support (DIR is PROJ.4's install dir). - PROJ.4 support is optional, and is not included by default. - You have to use the --with-proj=DIR option to enable PROJ.4 support and specify where PROJ.4 installed. Make sure that this copy of PROJ.4 is compiled before using this option. - Starting with MapServer v3.5, PROJ.4.4.2 (or more recent) is required. - You may also have to install the NADCON data files in order to enable datum shift support if you installed a source distribution. Look for proj-nadus-1.0.tar.gz at http://www.remotesensing.org/proj/. ESRI SDE Support: ----------------- :: --with-sde[=DIR] Include ESRI SDE support (DIR is SDE's install dir). --with-sde-version[=VERSION NUMBER] Set ESRI SDE version number (Default is 91). - ESRI SDE support is optional, and is not included by default. - You have to use the --with-sde=DIR option to enable ESRI SDE support and specify where ESRI SDE is installed. GEOS Support: ------------- :: --with-geos=PATH Include GEOS support (PATH is path to geos-config) - GEOS support is optional, and is not included by default. MapServer requires GEOS version 2.2.3 or more recent. - The GEOS library can be found at http://geos.refractions.net/ OGR Support: ------------ :: --with-ogr[=PATH] Include OGR support (PATH is path to gdal-config). - OGR support is optional, and is not included by default. - The OGR library (http://www.gdal.org/ogr/) allows MapServer to access data in a variety of vector formats, see the URL above for the complete list. - You have to use the --with-ogr[=PATH] option to enable OGR support and specify where the 'gdal-config' script for your installation is located. e.g. ./configure ... --with-ogr=/usr/local/bin/gdal-config - OGR is usually installed as part of a GDAL shared library. To get the full GDAL and OGR source kit visit http://www.gdal.org/ . When configuring GDAL ensure that --with-ogr is selected. Then when you configure MapServer, include the --with-ogr switch with no argument since the location of the GDAL lib also defines the OGR location in this case. See the GDAL section below for more details on using --with-gdal and --with-ogr together. GDAL Support: ------------- :: --with-gdal[=path] Include GDAL support (path is to gdal-config script). - GDAL support is optional, and it is not included by default. - The GDAL library ( http://www.gdal.org/) allows MapServer to access data in a variety of raster formats, including GeoTIFF, Erdas Imagine, ESRI BIL, and CEOS. - If GDAL is installed (ie. in /usr/local) then it should be sufficient to say --with-gdal, but if the gdal-config script cannot be found, please use --with-gdal=/usr/local/bin/gdal-config, or whatever path is is required to get the gdal-config script. Note that it is possible to compile GDAL/OGR independently or not in MapServer: 1) GDAL only using libgdal.so installed in system lib dirs, this assumes you have previously run 'make install' as root in your GDAL source tree: ./configure --with-gdal or ./configure --with-gdal=/usr/local/bin/gdal-config (or whatever the path to the installed gdal-config script is.) 2) OGR only, using libgdal.so installed in system lib dirs, once again this assumes you have previously run 'make install' as root in your GDAL source tree: ./configure --with-ogr or ./configure --with-ogr=/usr/local/bin/gdal-config (or whatever the path to the installed gdal-config script is.) 3) GDAL and OGR using libgdal.so, assuming that GDAL was configured with --with-ogr. Same as #1 above, but add --with-ogr with no argument to the MapServer configure command: ./configure --with-gdal --with-ogr or ./configure --with-gdal=/usr/local/bin/gdal-config --with-ogr PostGIS Support: ---------------- :: --with-postgis[=ARG] Include PostGIS Support (ARG=yes/path to pg_config) - PostGIS support is optional, and it is not included by default. - PostGIS support (http://postgis.refractions.net) allows Mapserver to access geographic data stored in a PostgreSQL (http://www.postgresql.org) database using the PostGIS server extensions. PostGIS is only supported on PostgreSQL version 7.1.2 or better. PostGIS supports vector (point, line, polygon) data only. - To access a PostGIS/PostgreSQL data-source, the machine on which Mapserver is running must have the PostgreSQL client libraries (libpq) installed. To compile Mapserver with PostGIS/PostgreSQL support the PostgreSQL header files must also be present. The 'pg_config' program is included with the PostgreSQL distribution. If it is not already in your path ('which pg_config'), then specify exactly where it can be found. MyGIS (MySQL v3.xx SFSQL) Support: ---------------------------------- :: --with-mygis[=ARG] Include MyGIS Support (ARG=yes/path to my_config) - MyGIS provides OGC SFSQL support using MySQl v3.xx. This option is disabled by default and can be enabled using the --with-mygis option. Oracle Spatial Support: ----------------------- :: --with-oraclespatial[=ARG] Include OracleSpatial Support (ARG=yes/path to Oracle home) - Oracle Spatial support is optional and is not included by default. - For more details see the MapServer Wiki at: http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?OracleSpatial Flash/SWF/Ming Output Support: ------------------------------ :: --with-ming[=DIR] Include MING/Flash Support (DIR=path to Ming directory) - Support for generating Flash output is enabled only if requested. Use the --with-ming switch to request it if the ming libraries have been installed in the default path. To use a local ming build also provide the path to the ming build directory. - The IMAGETYPE for Flash output is SWF. More information on the MING library should be available at http://www.opaque.net/ming/ PDF output support: ------------------- :: --without-pdf Disable PDF support. --with-pdf[=DIR] Include PDF support (DIR is PDFlib's install dir). - Support for PDF output using PDFLib (http://www.pdflib.com/) is disabled by default and can be enabled using the --with-pdf option. - If PDFLib is installed in the default system directories then using --with-pdf with no argument should be enough. If not then pass the full path to the PDFLib installation directory. e.g. ./configure ..... --with-pdf=/usr/local IMPORTANT NOTE: PDFLib comes bundled with and is built by default using its own internal copy of libpng and zlib. The PDFLib internal copy of those libpng and zlib are very likely of different versions from the ones used by the GD library. Loading both versions could lead to crashes or instability of your MapServer or MapScript installation. For this reason you should make sure that your PDFLib is configured using '--with-pnglib --with-zlib' which will force PDFLib to use the system verison of libpng and zlib. CAIRO Support: -------------- :: --without-cairo Disable Cairo support (default) --with-cairo[=/path/to/cairo.pc] Enable Cairo Support - Cairo support is required for PDF or SVG output - pkg-config is used to obtain the compilation options for cairo. If your libs and headers are installed in a non-standard location, you can pass the full path to the cairo.pc configuration package OGC WMS Server Compatibility: ----------------------------- :: --without-wms Disable OGC WMS Compatibility (enabled by default). - OGC WMS Compatibility is enabled by default if PROJ.4 is included. - WMS Compatibility allows MapServer (actually the mapserv CGI) to advertize its capabilities and serve maps and feature_info requests following the OpenGIS Web Mapping Service (WMS) Interface Specification. - See the MapServer WMS Server HOWTO at http://mapserver.gis.umn.edu/docs/howto/wms_server OGC WMS Client Support: ----------------------- :: --with-wmsclient Enable OGC WMS Client Connections (PROJ4 and libcurl required). - This option enables MapServer's 'CONNECTIONTYPE WMS' to include layers from remote WMS servers in MapServer applications. It requires PROJ4, libcurl (see --with-curl-config option below) and OGR. GDAL is optional but highly recommended in order to support reprojection of layers obtained from remote WMS servers. - See the MapServer WMS Client HOWTO for more details at http://mapserver.gis.umn.edu/docs/howto/wms_client OGC WFS Server Compatibility: ----------------------------- :: --with-wfs Enable OGC WFS Server Support (OGR+PROJ4 required). - This option is used to enable the OGC WFS server extension. It requires the OGR and PROJ4 options as well. - See the MapServer WFS Server HOWTO at http://mapserver.gis.umn.edu/docs/howto/wfs_server OGC WMS Client Support: ----------------------- :: --with-wfsclient Enable OGC WFS Client Connections (PROJ4, libcurl and OGR required). - This option enables MapServer's 'CONNECTIONTYPE WFS' to include layers from remote WFS servers in MapServer applications. WFS client support in MapServer requires PROJ4, libcurl and an installation of OGR compiled with the Xerces library (for GML support via OGR). - See the MapServer WMS Client HOWTO for more details at http://mapserver.gis.umn.edu/docs/howto/wfs_client OGC SOS Server Support: ----------------------- :: --with-sos Enable OGC SOS Server Support (libxml2 and PROJ4 and OGR required). - OGC Sensor Observation Service (SOS) is disabled by default and can be enabled using --with-sos. PROJ4 and libxml2 are required. - See the MapServer SOS Server HOWTO for more details at http://mapserver.gis.umn.edu/docs/howto/sos_server Curl Support: ------------- :: --with-curl-config=PATH Specify path to curl-config. - The Curl library (http://curl.haxx.se/libcurl/) is used by the WMS Client and WFS client options to connect to remote servers via HTTP. - LibCurl 7.10.1 or more recent is required with the current version of MapServer. It is strongly recommended that you use libcurl 7.10.7 or more recent which contains some important bug fixes. - If libcurl is installed in the default system directories then it should automatically be detected by configure. Otherwise use the --with-curl-config option to specify the path where the curl-config script is located. e.g. ./configure .... --with-curl-config=/usr/local/bin/curl-config Libxml2 Support: ---------------- :: --with-xml2-config=PATH Specify path to xml2-config. - The libxml2 library (http://xmlsoft.org/) is used by the optional OGC SOS Server module to handle XML generation and parsing. - If libxml2 is installed in the default system directories then it should automatically be detected by configure. Otherwise use the --with-xml2-config option to specify the path where the xml2-config script is located. e.g. :: ./configure .... --with-xml2-config=/usr/local/bin/xml2-config FriBidi Support: ---------------- :: --with-fribidi-config[=ARG] Include FriBidi Support (ARG=yes/path to fribidi-config or fribidi.pc) - The FriBidi library (http://fribidi.freedesktop.org/wiki/) is used by MapServer to support labels flowing from right to left, such as Arabic or Hebrew. - Support for the FriBidi library is optional and is not included by default. - The arg to --with-fribidi-config can be one of: - yes: Autoconf will check if the system has fribidi-config. If not, it will check if the pkg-config has fribidi in it's packages list. - path to fribidi-config for fribidi (v0.10.9 and older) - path to fribidi.pc for fribidi2 (v0.19.1 and more recent) - This option may be used in combination with the --with-pkg-config[=PATH] option to specify the path to the pkg-config script Miscellaneous flags: -------------------- :: --with-threads[=linkopt]Include thread safe support :: --enable-ignore-missing-data Ignore missing data file errors at runtime --disable-ignore-missing-data Report all missing data files (enabled by default). :: --enable-point-z-m Use point Z and M parameters (disabled by default). --disable-point-z-m Disable support for point Z and M parameters. :: --disable-fast-nint Use safe MS_NINT with reliable rounding :: --enable-debug Include "-g" in CFLAGS for debugging. --disable-debug Do not include "-g" in CFLAGS (the default). :: --enable-gcov Enable source code coverage testing using gcov :: --enable-runpath Include runtime library path flags (-Wl,-R) in link. Required on *BSD systems. --disable-runpath Do not link with runtime lib path (the default). NOTE FOR BSD USERS ABOUT --enable-runpath: ------------------------------------------- For some reason, the --enable-runpath switch is required in order to successfully link on BSD systems. For most other operating systems you don't need the --enable-runpath switch unless you link MapServer with some shared libraries located outside of the system's runtime library path. And even then, it is probably preferable to use "setenv LD_LIBRARY_PATH ..." in Apache's httpd.conf to set the mapserv CGI or MapScript runtime library path. PHP/MapScript module: ---------------------- :: --with-php=DIR Specify directory where PHP4's include files are installed (or a pointer to the full source tree) Required in order to compile the PHP/MapScript module. --enable-perlv-ld-detect (applies to --with-php only) Use perl -V output to figure the command to use to link php_mapscript.so. Try this only if the default internal macro didn't work. - The --with-php option will trigger the compilation of the PHP MapScript module in the ./mapscript/php3/ directory. - DIR should be the location of the PHP4 or PHP5 distribution (source or dev package). The module may work with older versions of PHP (4.1.x or 4.2.x), but PHP 4.3.x is strongly recommended. The configure script should automatically detect which version of PHP you are attempting to build with and take the necessary actions. e.g. $ ./configure --with-php=../php-4.3.11 - The PHP module has to be built as a shared library that will then be loaded as a Dynamic Module by the PHP interpreter using the dl() PHP command. See the Wiki for detailed build instructions for various platforms: http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScript See also the file ./mapscript/php3/README for more details on the MapScript classes and functions. - Some libraries are used by both PHP and MapServer, and using different versions of these libs will lead to potential crashes at runtime. In most cases it is safe to have both PHP and MapServer compiled with the same libraries (e.g. GD, regex, etc.) as long as they are of the same versions. Perl MapScript Module: ---------------------- - The Perl MapScript module is not yet handled by the configure script. - See the file ./mapscript/perl/README for compilation instructions. Python MapScript Module: ------------------------ - The Python MapScript module is not yet handled by the configure script. - See the file ./mapscript/python/README for brief compilation instructions. Tcl MapScript Module: --------------------- - The Tcl MapScript module is not yet handled by the configure script. - See the file ./mapscript/tcl/README for compilation instructions. - Mapserver must first be configured and build before building Tcl MapScript. Java Mapscript Module: ---------------------- - Building of Java Mapscript is described in the mapscript/java/README file. - Relevant configure options are: :: --with-threads : absolutely necessary due to the highly threaded nature of Java programs. --with-java-include-os-name=dirname : use only if compilation of Java mapscript fails because of missing headers. dirname is the directory where the os-dependent headers used by the Java Native Interface are found. Example: $JAVA_HOME/include/linux ^^^^^ this is the directory name On linux the directory is called linux and on Solaris solaris. The configure script will try to autodetect it if not specified. In case autodetection fails you might want to add a comment to bug: http://trac.osgeo.org/mapserver/tickets/1209 ---------------- $Id$ ----------------