]> granicus.if.org Git - apache/blob - README.cmake
specify base addresses for libhttpd.dll and modules; mention an issue about Perl...
[apache] / README.cmake
1 Experimental cmake-based build support for Apache httpd on Microsoft Windows
2
3 Status
4 ------
5
6 This build support is currently intended only for Microsoft Windows.
7
8 This build support is experimental.  Specifically,
9
10 * It does not support all features of Apache httpd.
11 * Some components may not be built correctly and/or in a manner
12   compatible with the previous Windows build support.
13 * Build interfaces, such as the mechanisms which are used to enable
14   optional functionality or specify prerequisites, may change from
15   release to release as feedback is received from users and bugs and
16   limitations are resolved.
17
18 This can be used with Apache httpd 2.4.x by copying the following files from
19 httpd trunk (in Subversion) into the 2.4.x source tree:
20
21 * CMakeLists.txt
22 * build/cpR_noreplace.pl
23
24 Important: Refer to the "Known Bugs and Limitations" section for further
25            information.
26
27            It is beyond the scope of this document to document or explain
28            how to utilize the various cmake features, such as different
29            build backends or provisions for finding support libraries.
30
31            Please refer to the cmake documentation for additional information
32            that applies to building any project with cmake.
33
34 Prerequisites
35 -------------
36
37 The following tools must be in PATH:
38
39 * cmake, version 2.8 or later
40 * Perl
41 * If the WITH_MODULES feature is used: awk
42 * If using a command-line compiler: compiler and linker and related tools
43   (Refer to the cmake documentation for more information.)
44
45 The following support libraries are mandatory:
46
47 * APR, built with cmake
48   + Either APR 2.0-dev (trunk) or APR 1.4.x and APR-Util 1.5.x.
49   + When building APR (but not APR-Util), specify the build option
50     APR_INSTALL_PRIVATE_H so that non-standard files required for building
51     Apache httpd are installed.
52   + Additional APR settings affect httpd but are not mandatory, such as
53     APR_HAVE_IPV6.
54 * PCRE
55
56 Certain optional features of APR 2.0-dev (trunk) or APR-Util 1.5.x
57 allow some optional features of httpd to be enabled.  For example,
58 APU_HAVE_CRYPTO is required for mod_session_crypto.
59
60 Additional support libraries allow some optional features of httpd to be
61 enabled:
62
63 * libxml2 (e.g., mod_proxy_html)
64 * lua 5.1 (mod_lua)
65 * openssl (mod_ssl and https support for ab)
66 * zlib (mod_deflate)
67
68 How to build
69 ------------
70
71 1. cd to a clean directory for building (i.e., don't build in your
72    source tree)
73
74 2. Make sure cmake and Perl are in PATH.  Additionally, some backends 
75    require compile tools in PATH.  (Hint: "Visual Studio Command Prompt")
76    In the unlikely event that you use -DWITH_MODULES, described below, make
77    sure awk is in PATH.
78
79 3. cmake -G "some backend, like 'NMake Makefiles'"
80      -DCMAKE_INSTALL_PREFIX=d:/path/to/httpdinst
81      -DENABLE_foo=A|I|O|a|i
82      -DENABLE_MODULES=A|I|O|a|i
83      d:/path/to/httpdsource
84
85    Alternately, you can use the cmake-gui and update settings in the GUI.
86
87    PCRE_INCLUDE_DIR, PCRE_LIBRARIES, APR_INCLUDE_DIR, APR_LIBRARIES:
88
89        cmake doesn't bundle FindXXX for these packages, so the crucial
90        information has to be specified in this manner if they aren't found
91        in their default location.
92
93      -DPCRE_INCLUDE_DIR=d:/path/to/pcreinst/include
94      -DPCRE_LIBRARIES=d:/path/to/pcreinst/lib/pcre[d].lib
95
96        These will have to be specified only if PCRE is installed to a different
97        directory than httpd, or if debug *and* release builds of PCRE were
98        installed there and you want to control which is used.  (Currently the
99        build will use pcred.lib (debug) if it is found in the default location
100        and not overridden with -DPCRE_LIBRARIES.)
101
102      -DAPR_INCLUDE_DIR=d:/path/to/aprinst/include
103      -DAPR_LIBRARIES="d:/path/to/aprinst/lib/libapr-1.lib;d:/path/to/aprinst/lib/libaprutil-1.lib"
104
105        These will have to be specified if APR[-Util] was installed to a
106        different directory than httpd.
107
108        When building with APR trunk (future APR 2.x, with integrated APR-Util),
109        specify just the path to libapr-2.lib:
110
111            -DAPR_LIBRARIES=d:/path/to/aprinst/lib/libapr-2.lib
112
113        APR+APR-Util 1.x vs. APR trunk will be detected automatically if they
114        are installed to the same location as httpd.
115
116        APR-Util 1.x has an optional LDAP library.  If APR-Util has LDAP enabled
117        and httpd's mod_ldap and mod_authnz_ldap are being used, include the
118        path to the LDAP library in the APR_LIBRARIES setting.  (If APR and
119        APR-Util are found in the default location, the LDAP library will be
120        included if it is present.
121
122    LIBXML2_ICONV_INCLUDE_DIR, LIBXML2_ICONV_LIBRARIES
123
124       If using a module that requires libxml2 *and* the build of libxml2 requires
125       iconv, set these variables to allow iconv includes and libraries to be
126       used.  For example:
127
128       -DLIBXML2_ICONV_INCLUDE_DIR=c:\iconv-1.9.2.win32\include
129       -DLIBXML2_ICONV_LIBRARIES=c:\iconv-1.9.2.win32\lib\iconv.lib
130
131    CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL
132    CMAKE_BUILD_TYPE
133
134        For NMake Makefiles the choices are at least DEBUG, RELEASE,
135        RELWITHDEBINFO, and MINSIZEREL
136        Other backends make have other selections.
137
138    ENABLE_foo:
139
140        Each module has a default setting which can be overridden with one of
141        the following values:
142            A        build and Activate module
143            a        build and Activate module IFF prereqs are available; if
144                     prereqs are unavailable, don't build it
145            I        build module but leave it Inactive (commented-out
146                     LoadModule directive)
147            i        build module but leave it Inactive IFF prereqs are
148                     available; if prereqs are unavailable, don't build it
149            O        Omit module completely
150
151        Examples: -DENABLE_ACCESS_COMPAT=O
152                  -DENABLE_PROXY_HTML=i
153
154    ENABLE_MODULES:
155
156        This changes the *minimum* enablement of all modules to the specified
157        value (one of A, a, I, i, O, as described under ENABLE_foo above).
158
159        The ranking of enablement from lowest to highest is O, i, I, a, A.
160        If a specific module has a higher rank enablement setting, either from
161        a built-in default or from -DENABLE_foo, ENABLE_MODULES won't affect
162        that module.  However, if a specific module has a lower-rank enablement
163        setting, presumably from a built-in default, the value of ENABLE_MODULES
164        will be used for that module.
165
166        Explanations for possible values:
167
168        -DENABLE_MODULES=a      build and activate all possible modules,
169                                ignoring any with missing prereqs
170                                (doesn't affect modules with A for ENABLE_foo)
171
172        -DENABLE_MODULES=i      build but leave inactive all possible
173                                modules, ignoring any with missing
174                                prereqs
175                                (doesn't affect modules with A, a, or I for 
176                                ENABLE_foo)
177
178        -DENABLE_MODULES=O      no impact, since all modules are either
179                                already disabled or have a higher setting
180
181        -DENABLE_MODULES=A      build and activate all possible modules,
182                                failing the build if any module is missing
183                                a prereq
184
185        -DENABLE_MODULES=I      similar to -DENABLE_MODULES=A
186                                (doesn't affect modules with A or a for
187                                ENABLE_foo)
188
189    WITH_MODULES:
190
191        Comma-separated paths to single file modules to statically linked into
192        the server, like the --with-module=modpath:/path/to/mod_foo.c with
193        the autoconf-based build.  Key differences: The modpath (e.g., 
194        "generators") isn't provided or used, and the copy of the module
195        source being built is automatically updated when it changes.
196        See also EXTRA_INCLUDE_DIRS.
197
198    EXTRA_INCLUDE_DIRS:
199
200        List of additional directories to search for .h files.  This may
201        be necessary when including third-party modules in the httpd build
202        via WITH_MODULES.
203
204    Port and SSLPort:
205
206        Port numbers for substitution into default .conf files.  (The defaults
207        are 80 and 443.)
208
209    INSTALL_PDB:
210
211        If .pdb files are generated for debugging, install them.
212        Default: ON
213
214        The .pdb files are generally needed for debugging low-level code
215        problems.  If they aren't installed, they are still available in the
216        build directory for use by alternate packaging implementations or when
217        debugging on the build machine.
218
219    INSTALL_MANUAL:
220
221        Install the Apache HTTP Server manual.
222        Default: ON
223
224        This could be turned off when developing changes in order to speed up
225        installation time.
226
227 4. Build using the chosen generator (e.g., "nmake install" for cmake's "NMake
228    Makefiles" generator).
229
230 Running the server and support programs
231 ---------------------------------------
232
233 This build system does not copy binaries such as dlls from other projects
234 into the httpd install location.  Without taking some precautions, httpd
235 and support programs can fail to start or modules can fail to load because
236 a support library can't be found in PATH or in the directory of the httpd
237 binary.
238
239 This can be resolved in several different ways:
240
241 * Install httpd and the various support libraries to a common install
242   prefix so that support libraries and httpd programs are installed in
243   the same bin directory and are found without setting PATH.
244
245 * Update PATH to include the bin directories of all necessary support
246   libraries.
247
248   Depending on where PATH is set, it may not affect starting httpd as
249   a service.
250
251 * Maintain a script which combines required binaries into a common 
252   location, such as the httpd installion bin directory, and use that
253   script after building or otherwise installing or updating support
254   libraries.
255
256 * AVOID THE USE of any unrepeatable process of copying dll files around
257   from different install locations until something starts working.  The
258   result is that when you later update a support library to pick up a
259   security fix, httpd will likely continue to use the old, vulnerable
260   library file.
261
262 Known Bugs and Limitations
263 --------------------------
264
265 * no standard script or makefile is provided to tie together the builds
266   of httpd and support libraries in a manner suitable for typical users
267 * no logic to find support libraries or otherwise build these modules:
268   + mod_socache_dc (requires distcache), mod_serf (requires serf)
269   + additionally, mod_lbmethod_rr and mod_firehose don't compile on Windows
270     anyway
271 * buildmark.c isn't necessarily rebuilt when httpd.exe is regenerated
272 * ApacheMonitor has a build error and is disabled
273 * CGI examples aren't installed
274 * dbmmanage.pl and wintty aren't built/installed
275 * mod_dav.lib and any similar libraries aren't installed, nor are any .exp
276   files (though I'm not sure that is a problem)
277 * module enablement defaults are not in sync with the autoconf-based build
278 * no support for static support library builds; unclear if that is a
279   requirement; if so: taking PCRE as an example, we'd need to detect that it
280   is static and then turn on PCRE_STATIC for the libhttpd build
281 * program attributes like descriptive name and version aren't set for most
282   binaries
283 * build/cpR_noreplace.pl doesn't declare what version of Perl is required
284   and doesn't work with File::Path that is missing make_path
285
286 Generally:
287
288 * Many httpd features have not been tested with this build.
289 * Developers need to examine the existing Windows build in great detail and see
290   what is missing from the cmake-based build, whether a feature or some build
291   nuance.
292 * Any feedback you can provide on your experiences with this build will be
293   helpful.