--------------------------------------------------------------------
README.WIN32 - Microsoft Visual C++ Build instructions for MapServer
--------------------------------------------------------------------

IMPORTANT - READ THIS FIRST:
----------------------------

  The Win32 build process is not very friendly for unexperienced users.
  So it is strongly recommended that you use one of the precompiled 
  binaries available on the MapServer site:
 
    http://mapserver.gis.umn.edu/download/current/windows

  There are precompiled Win32 binaries available for the last stable
  release and the latest nightly build and they include the most common
  options... so you shouldn't have to compile your own executables.

  If for some reason you still decide to compile Win32 binaries yourself,
  then don't do it unless you really know what you're doing... and
  hopefully the rest of this file contains some hints that may help 
  you.  Good Luck!

--------------------------------------------------------------------

For the developers using MSVC++, a NMAKE makefile (Makefile.vc + nmake.opt)
to build the MapServer library and executable programs is included with
the distribution. 

To build the package using the Makefile.vc and NMAKE:

 - Edit nmake.opt to select (or deselect) optional components of 
   the MapServer.  Please read the notes below about each component
   before you move ahead with the compilation.

 - Open a DOS prompt window

 - Run the VCVARS32.BAT script to initialize the VC++ environment
   variables.  VCVARS32.BAT is automatically generated by the MSVC++
   install procedure and should be located in the BIN sub-directory of
   your MSVC++ installation.

 - Then start the build with: 
     nmake /f Makefile.vc 

This will create "mapserv.exe" (the main MapServer CGI program), the
other command-line utilities, "mapserver.lib" and "libmap.dll" that is 
used by theMapScript modules.


--------------------------------------------------------------------
      MapScript
-------------------------------------------------------------------- 

To compile the various versions of MapScript (Perl, PHP, etc) first compile
the main mapserver directory and then see the README files in the 
mapscript/perl, mapscript/php3 or mapscript/python directory for specific 
instructions.


--------------------------------------------------------------------
      GD library
-------------------------------------------------------------------- 

- MapServer uses the GD library from http://boutell.com/ and the Win32
  makefiles are set by default to work with the pre-built GD version 2.0.33 
  provided by Boutell.com.  These predefine "gdwin32" binaries include
  freetype2, libpng, libjpeg, libz, and libgif built-in.  This is very
  convenient to get a mapserver build going quickly.

  If you are building GD and it's supporting libraries (libpng, libjpeg, 
  libgif, and freetype) from source then it is very important to make sure 
  that you update the -DUSE_GD_* flags and various subcomponent paths in the 
  nmake.opt.  You will also have to take great care to build the various
  components in a way that is compatible with MapServer.  For instance, if
  the various components are statically linked into MapServer you will need
  to use the same build options (ie. /MT or /MT) for all components.

  Here are some useful pointers:
   - The original GD library: http://boutell.com/gd/
   - libpng:    http://www.libpng.org/pub/png/libpng.html
   - zlib:      http://www.info-zip.org/pub/infozip/zlib/
   - libjpeg:   ftp://ftp.uu.net/graphics/jpeg/
   - Freetype:  http://www.freetype.org/download.html

--------------------------------------------------------------------
      REGEX library
-------------------------------------------------------------------- 

- MapServer uses the REGEX library which is standard on all the Unix
  systems that I know of, but does not come with VC++.
  If the MapServer distribution did not include a copy of the REGEX
  library, then you can get a copy from:

      ftp://ftp.gnu.org/pub/gnu/regex/regex-0.12.tar.gz

  The default in the nmake.opt is set to compile with GNU 
  regex-0.12 located in the "regex-0.12" directory.

- If you are planning to compile the PHP3_MAPSCRIPT.DLL module, then it
  is important to make sure that the main Makefile.vc creates MAPSERVER.LIB
  with the same version of REGEX that PHP uses.
  See the notes in the main Makefile.vc about that.

--------------------------------------------------------------------
      Notes on Freetype build.
-------------------------------------------------------------------- 

 - You can use the Visual Workspace in freetype/lib/arch/win32 to build
   the library.


--------------------------------------------------------------------
      Notes on the proj module
-------------------------------------------------------------------- 

  - The Proj.4 (cartographic projection routines) is located at 
        http://www.remotesensing.org/proj/

  Note on the epsg files location and the nad directory :

   * there is an environnemnt variable PROJ_LIB_DIR that can be set to locate 
     the directory where the epsg file is located
   * if you build this module, at the top of the makefile (./src/makefile.vc), you
     can set the PROJ_LIB variable and this setting will be used to 
     locate the proj support files.  

  
----------------------------------------------------------------------
  Notes on libcurl
----------------------------------------------------------------------

  Notes libcurl : used to support WMS client connection
  Mapserver 5.x is using libcurl instead of libwww for WMS client
  support.

  - the library is located at http://curl.haxx.se/download.html

  Quick notes on how to build the library using MSVC++:

  - Download and extract the library (at this time it is known to work 
    with version 7.10.2 or more recent)
  - Open the workspace curlib.dsw located under curl-XXX/lib
  - Build libcurl.dll. Note that the default active configuraion of the project
     is  Win32 Debug. You can modify the configuarion to Release version 
     (Build/Set Active Configuration)          

  
  Notes on mapserver's nmake.opt modifications :

  - uncomment the flag WMSCLIENT= -DUSE_WMS_LYR
  - uncomment and modify according to your installation the flags 
    related to libcurl :

    * CURL_INC = -I../curl-7.10.2/include
    * CURL_LIB = ../curl-7.10.2/lib/Relase/libcurl.lib
    * WINSOCK_LIB = "C:\Program Files\Microsoft Visual Studio\VC98\Lib\WSOCK32.LIB"

  You also need to install the libcurl.dll in your system directory. (The dll will
  be located in libc-XXX/lib/Relase abfter your build of the library)
    


------------------------------------------------------------
        Notes on GDAL
------------------------------------------------------------

-  If you are compiling the GDAL library (http://www.gdal.org/)
   with the PNG support, make sure that the libpng that you use in mapserver 
   is the same as the one used in GDAL.

------------------------------------------------------------
        Notes on PDF suuport
------------------------------------------------------------

The PDF support allows the output of a map file as a PDF file.

To be able to build mapserver with the PDF support, you need to download
and build a PDF library from www.pdflib.com (http://www.pdflib.com/pdflib/download/index.html).
The best option is to download the zip file containing the source code and build it. Please refer to the docs inside the zip for informations on how to build the library.  Here are some quick notes that can help in building mapserver with PDF :

 1) Build the PDF lib

  - open the project PDFLib.dsw
  - build the project pdflib_dll
  - after a sucessful build, you should have a pdflib.lib and pdblib.dll under the
    pdflib directory
  - copy the pdflib.dll under your system directory (ex : c:/winnt/system32)
 
 2) Build mapserver with PDF

  - uncomment in the nmake.opt the flags related to PDF


$Id$
