1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-06 09:01:14 +03:00

Add a global ENABLE_MODULES setting to make it easy

to build and/or activate all possible modules.

A few modules that are not currently buildable needed a
prereq to be defined so that they will be skipped over
appropriately for reasonable values of ENABLE_MODULES.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1520937 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jeff Trawick
2013-09-08 22:13:41 +00:00
parent 90daf71806
commit 550b738e89
2 changed files with 64 additions and 0 deletions

View File

@@ -66,6 +66,7 @@ SET(LIBXML2_ICONV_LIBRARIES "" CACHE STRING "iconv lib
# end support library configuration
# Misc. options
SET(ENABLE_MODULES "O" CACHE STRING "Minimum module enablement (e.g., \"i\" to build all but those without prerequisites)")
SET(WITH_MODULES "" CACHE STRING "comma-separated paths to single-file modules to statically link into the server")
SET(EXTRA_INCLUDE_DIRS "" CACHE STRING "extra include directories")
@@ -78,6 +79,24 @@ FOREACH(onelib ${APR_LIBRARIES})
ENDIF()
ENDFOREACH()
MACRO(GET_MOD_ENABLE_RANK macro_modname macro_mod_enable_val macro_output_rank)
IF(${macro_mod_enable_val} STREQUAL "O")
SET(${macro_output_rank} 0)
ELSEIF(${macro_mod_enable_val} STREQUAL "i")
SET(${macro_output_rank} 1)
ELSEIF(${macro_mod_enable_val} STREQUAL "I")
SET(${macro_output_rank} 2)
ELSEIF(${macro_mod_enable_val} STREQUAL "a")
SET(${macro_output_rank} 3)
ELSEIF(${macro_mod_enable_val} STREQUAL "A")
SET(${macro_output_rank} 4)
ELSE()
MESSAGE(FATAL_ERROR "Unexpected enablement value \"${macro_mod_enable_val}\" for ${macro_modname}")
ENDIF()
ENDMACRO()
GET_MOD_ENABLE_RANK("ENABLE_MODULES setting" ${ENABLE_MODULES} enable_modules_rank)
# Figure out what APR/APU features are available
#
# CHECK_APR_FEATURE checks for features defined to 1 or 0 in apr.h or apu.h
@@ -329,6 +348,7 @@ IF(ZLIB_FOUND)
SET(mod_deflate_extra_includes ${ZLIB_INCLUDE_DIR})
SET(mod_deflate_extra_libs ${ZLIB_LIBRARIES})
ENDIF()
SET(mod_firehose_requires SOMEONE_TO_MAKE_IT_COMPILE_ON_WINDOWS)
SET(mod_heartbeat_extra_libs mod_watchdog)
SET(mod_ldap_extra_defines LDAP_DECLARE_EXPORT)
SET(mod_ldap_extra_libs wldap32)
@@ -372,11 +392,13 @@ SET(mod_sed_extra_sources
modules/filters/regexp.c modules/filters/sed0.c
modules/filters/sed1.c
)
SET(mod_serf_requires AN_UNIMPLEMENTED_SUPPORT_LIBRARY_REQUIREMENT)
SET(mod_session_extra_defines SESSION_DECLARE_EXPORT)
SET(mod_session_cookie_extra_libs mod_session)
SET(mod_session_crypto_requires APU_HAVE_CRYPTO)
SET(mod_session_crypto_extra_libs mod_session)
SET(mod_session_dbd_extra_libs mod_session)
SET(mod_socache_dc_requires AN_UNIMPLEMENTED_SUPPORT_LIBRARY_REQUIREMENT)
SET(mod_ssl_requires OPENSSL_FOUND)
IF(OPENSSL_FOUND)
SET(mod_ssl_extra_includes ${OPENSSL_INCLUDE_DIR})
@@ -610,6 +632,13 @@ FOREACH (mod ${MODULE_PATHS})
STRING(TOUPPER "ENABLE_${mod_shortname}" enable_mod)
SET(enable_mod_val ${${enable_mod}})
# Is ENABLE_MODULES set to a higher value?
GET_MOD_ENABLE_RANK(${mod_name} ${enable_mod_val} this_mod_rank)
IF(this_mod_rank LESS enable_modules_rank)
# Use the value from ENABLE_MODULES
SET(enable_mod_val ${ENABLE_MODULES})
ENDIF()
IF(NOT ${enable_mod_val} STREQUAL "O") # build of module is desired
SET(mod_requires "${mod_name}_requires")
STRING(TOUPPER ${enable_mod_val} enable_mod_val_upper)

View File

@@ -73,6 +73,7 @@ How to build
3. cmake -G "some backend, like 'NMake Makefiles'"
-DCMAKE_INSTALL_PREFIX=d:/path/to/httpdinst
-DENABLE_foo=A|I|O|a|i
-DENABLE_MODULES=A|I|O|a|i
d:/path/to/httpdsource
Alternately, you can use the cmake-gui and update settings in the GUI.
@@ -136,6 +137,40 @@ How to build
Examples: -DENABLE_ACCESS_COMPAT=O
-DENABLE_PROXY_HTML=i
ENABLE_MODULES:
This changes the *minimum* enablement of all modules to the specified
value (one of A, a, I, i, O, as described under ENABLE_foo above).
The ranking of enablement from lowest to highest is O, i, I, a, A.
If a specific module has a higher rank enablement setting, either from
a built-in default or from -DENABLE_foo, ENABLE_MODULES won't affect
that module. However, if a specific module has a lower-rank enablement
setting, presumably from a built-in default, the value of ENABLE_MODULES
will be used for that module.
Explanations for possible values:
-DENABLE_MODULES=a build and activate all possible modules,
ignoring any with missing prereqs
(doesn't affect modules with A for ENABLE_foo)
-DENABLE_MODULES=i build but leave inactive all possible
modules, ignoring any with missing
prereqs
(doesn't affect modules with A, a, or I for
ENABLE_foo)
-DENABLE_MODULES=O no impact, since all modules are either
already disabled or have a higher setting
-DENABLE_MODULES=A build and activate all possible modules,
failing the build if any module is missing
a prereq
-DENABLE_MODULES=I similar to -DENABLE_MODULES=I
(doesn't affect modules with A or a for
ENABLE_foo)
WITH_MODULES:
Comma-separated paths to single file modules to statically link into
the server, like the --with-module=modpath:/path/to/mod_foo.c with