forked from MapServer/MapServer
-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.WIN32
241 lines (183 loc) · 10.9 KB
/
README.WIN32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
--------------------------------------------------------------------
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://www.mapserver.org/download.html#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!
--------------------------------------------------------------------
The easyest way to build Mapserver on Windows on your own is to use the
build-system from http://gisinternals.com/.
GISInternals provide a complete set of sources and dependencies and even
makefiles for the full version of Visual Studio (not Express oder Community).
You don't have to download and compile them all by your own.
If you are not using full version of Visual Studio you can not use the makefiles
from GISInternals but you can still use the downloads to make your life easier.
Building with the full version of Visual Studio is easy.
Download the SDK for you version and follow the readme inside the packages.
This Readme will cover the compilation with Visual Studio 2012 Express on
Windows with CMake and the GISInternals-Packages for the following reasons:
- not everybody wants to buy Visual Studio and there is no reason to force
you to buy it just tu build Mapserver on Windows
- CMake is the configuration-system for Linux. Why should you use something
else which needs to be maintainerd?
- as of today, PHP-Mapscript is not suppored for PHP-7. PHP-5.6 is build
with VC11. To make PHP-Mapscript compatible with the downloadable
PHP-Version you need to build with VC11 wich is Visual Studio 2012.
- GISInternals Downloads contain most dependencies. it's way easier
If you want to compile Mapserver with any other version of Visual Studio you
can for sure use this documentation as help but maybe, some things here won't
work for you.
--------------------------------------------------------------------
Prerequisites
--------------------------------------------------------------------
To build Mapserver on Windows with Visual Studio 2012 Express you need
Visual Studio 2012 Express installed.
Install CMake (https://cmake.org/) and add CMake bin-directory to your PATH
environment variable. You can even to this after opening VS2012 x86 Native
Tools Command Prompt by entering:
set PATH=%PATH%;"C:\Program Files\CMake\bin"
... if CMake is installed to "C:\Program Files\CMake" ;)
--------------------------------------------------------------------
Downloading dependencies
--------------------------------------------------------------------
For our first build, we will use stable releases to build mapserver.
Download MSVC 2012 win32 Packages for GDAL-2.1.2 and Mapserver-7.0.2 from http://gisinternals.com/release.php.
We need "Compiled binaries in a single .zip package", "GDAL and MapServer sources" and "Compiled libraries and headers".
Download the MSVC 2012 win32 Developement Kit from http://gisinternals.com/sdk.php.
Extract everything to C:\dev\work\release-1700-gdal-2-1-2-mapserver-7-0-2.
There should be the directories inside now: bin, doc, gdal, include, lib, regex-0.12, relase-1700, ...
After you got this done, feel free to use other packages which fit your needs better.
--------------------------------------------------------------------
Mapserver-sources
--------------------------------------------------------------------
Download at least Mapserver-7.0.3 or current 7.0-Branch from github
and extract or clone from github to C:\dev\work\mapserver.
--------------------------------------------------------------------
Building Mapserver
--------------------------------------------------------------------
After downloading and extracting everything, to build Mapserver, follow this steps:
1. Open VS2012 x86 Native Tools Command Prompt (i'm german, hope it is translated
correctly).
2. Add CMake-bin to your PATH:
set PATH=%PATH%;"C:\Program Files\CMake\bin"
3. Create build-Directory:
mkdir C:\dev\work\mapserver\build
cd C:\dev\work\mapserver\build
4. Configure:
cmake .. -G "NMake Makefiles" -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=Release -Wno-dev
cmake .. -DCMAKE_PREFIX_PATH=C:\dev\work\release-1700-gdal-2-1-2-mapserver-7-0-2;C:\dev\work\release-1700-gdal-2-1-2-mapserver-7-0-2\bin;C:\dev\work\release-1700-gdal-2-1-2-mapserver-7-0-2\lib;C:\dev\work\release-1700-gdal-2-1-2-mapserver-7-0-2\include
cmake .. -DREGEX_DIR=C:\dev\work\release-1700-gdal-2-1-2-mapserver-7-0-2\regex-0.12
cmake .. -DWITH_POSTGIS=0 -DWITH_SOS=1 -DWITH_KML=1
cmake .. -DWITH_CLIENT_WMS=1 -DWITH_CLIENT_WFS=1
cmake .. -DWITH_THREAD_SAFETY=1 -DWITH_FCGI=1
cmake .. -DWITH_CAIRO=1 -DCAIRO_LIBRARY=C:\dev\work\release-1700-gdal-2-1-2-mapserver-7-0-2\lib\cairo.lib
cmake .. -DWITH_SVGCAIRO=1 -DSVGCAIRO_LIBRARY=C:\dev\work\release-1700-gdal-2-1-2-mapserver-7-0-2\lib\libsvg-cairo.lib
cmake .. -DSVG_LIBRARY=1 -DSVG_LIBRARY=C:\dev\work\release-1700-gdal-2-1-2-mapserver-7-0-2\lib\libsvg.lib
5. build
nmake
Thats it.
You can use all CMake parameters and options as you are used from CMake to fit mapserver to your needs from here.
Enjoy!
--------------------------------------------------------------------
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/php or mapscript/python directory for specific
instructions.
--------------------------------------------------------------------
Dependencies Part 2
--------------------------------------------------------------------
The following sections descripe how to get mapserver dependencies when not
downloading GISInternals packages.
--------------------------------------------------------------------
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.
$Id$