FIND_PACKAGE(OpenSSL)
FIND_PACKAGE(ZLIB)
-# See what version we're building. Just look at AP_SERVER_MINORVERSION_NUMBER
-SET(minorversion_regex "^#define AP_SERVER_MINORVERSION_NUMBER ([0-9]+)$")
-FILE(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/include/ap_release.h minorversion REGEX ${minorversion_regex})
-STRING(REGEX REPLACE ${minorversion_regex} "\\1" minorversion ${minorversion})
-
# Options for support libraries not supported by cmake-bundled FindFOO
# Default to using APR trunk (libapr-2.lib) if it exists in PREFIX/lib;
ENDIF()
ENDFOREACH()
+MACRO(DEFINE_WITH_BLANKS output_definition input_symbol input_value)
+ IF(MSVC_IDE)
+ SET(${output_definition} "-D${input_symbol}=\"${input_value}\"")
+ ELSE()
+ # assume command-line tool, where extra quotes must be added and escaped to
+ # survive
+ SET(${output_definition} "-D${input_symbol}=\"\\\"${input_value}\\\"\"")
+ ENDIF()
+ENDMACRO()
+
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)
SET(APR_HAS_LDAP FALSE)
ENDIF()
+# See if we have OpenSSL 1.0.2
+SET(HAVE_OPENSSL_102 FALSE)
+IF(OPENSSL_FOUND)
+ STRING(REGEX REPLACE "^1\\.([0-9]+)\\.[0-9]+" "\\1" minor_ver ${OPENSSL_VERSION})
+ STRING(REGEX REPLACE "^1\\.[0-9]+\\.([0-9]+)" "\\1" patch_ver ${OPENSSL_VERSION})
+ IF(${minor_ver} GREATER "0")
+ SET(HAVE_OPENSSL_102 TRUE)
+ ELSEIF(${patch_ver} GREATER "1")
+ SET(HAVE_OPENSSL_102 TRUE)
+ ENDIF()
+ENDIF()
+
MESSAGE(STATUS "")
MESSAGE(STATUS "Summary of feature detection:")
MESSAGE(STATUS "")
#
SET(MODULE_LIST
"modules/aaa/mod_access_compat+A+mod_access compatibility"
+ "modules/aaa/mod_allowhandlers+I+restrict allowed handlers"
"modules/aaa/mod_allowmethods+I+restrict allowed HTTP methods"
"modules/aaa/mod_auth_basic+A+basic authentication"
"modules/aaa/mod_auth_digest+I+RFC2617 Digest authentication"
"modules/aaa/mod_authn_dbm+I+DBM-based authentication control"
"modules/aaa/mod_authn_file+A+file-based authentication control"
"modules/aaa/mod_authn_socache+I+Cached authentication control"
+ "modules/aaa/mod_authnz_fcgi+I+FastCGI authorizer-based authentication and authorization"
"modules/aaa/mod_authnz_ldap+i+LDAP based authentication"
"modules/aaa/mod_authz_core+A+core authorization provider vector module"
"modules/aaa/mod_authz_dbd+I+SQL based authorization and Login/Session support"
"modules/aaa/mod_authz_host+A+host-based authorization control"
"modules/aaa/mod_authz_owner+I+'require file-owner' authorization control"
"modules/aaa/mod_authz_user+A+'require user' authorization control"
+ "modules/apreq/mod_apreq+i+Apache Request Filter"
"modules/arch/win32/mod_isapi+I+isapi extension support"
"modules/cache/mod_cache+I+dynamic file caching. At least one storage management module (e.g. mod_cache_disk) is also necessary."
"modules/cache/mod_cache_disk+I+disk caching module"
"modules/dav/main/mod_dav+I+WebDAV protocol handling."
"modules/debugging/mod_bucketeer+O+buckets manipulation filter. Useful only for developers and testing purposes."
"modules/debugging/mod_dumpio+I+I/O dump filter"
+ "modules/debugging/mod_firehose+O+Firehose dump filter"
"modules/echo/mod_echo+O+ECHO server"
"modules/examples/mod_case_filter+O+Example uppercase conversion filter"
"modules/examples/mod_case_filter_in+O+Example uppercase conversion input filter"
"modules/proxy/mod_proxy_http+I+Apache proxy HTTP module. Requires and is enabled by --enable-proxy."
"modules/proxy/mod_proxy_scgi+I+Apache proxy SCGI module. Requires and is enabled by --enable-proxy."
"modules/proxy/mod_proxy_wstunnel+I+Apache proxy Websocket Tunnel module. Requires and is enabled by --enable-proxy."
+ "modules/proxy/mod_serf+O+Reverse proxy module using Serf"
"modules/session/mod_session+I+session module"
"modules/session/mod_session_cookie+I+session cookie module"
"modules/session/mod_session_crypto+i+session crypto module"
"modules/slotmem/mod_slotmem_plain+I+slotmem provider that uses plain memory"
"modules/slotmem/mod_slotmem_shm+I+slotmem provider that uses shared memory"
"modules/ssl/mod_ssl+i+SSL/TLS support"
+ "modules/ssl/mod_ssl_ct+O+Certificate Transparency support (requires OpenSSL >= 1.0.2)"
"modules/test/mod_dialup+O+rate limits static files to dialup modem speeds"
"modules/test/mod_optional_fn_export+O+example optional function exporter"
"modules/test/mod_optional_fn_import+O+example optional function importer"
"modules/test/mod_optional_hook_export+O+example optional hook exporter"
"modules/test/mod_optional_hook_import+O+example optional hook importer"
+ "modules/test/mod_policy+I+HTTP protocol compliance filters"
)
-IF(NOT ${minorversion} STREQUAL "4")
- # more modules in trunk
- SET(MODULE_LIST
- ${MODULE_LIST}
- "modules/aaa/mod_allowhandlers+I+restrict allowed handlers"
- "modules/aaa/mod_authnz_fcgi+I+FastCGI authorizer-based authentication and authorization"
- "modules/apreq/mod_apreq+i+Apache Request Filter"
- "modules/debugging/mod_firehose+O+Firehose dump filter"
- "modules/proxy/mod_serf+O+Reverse proxy module using Serf"
- "modules/test/mod_policy+I+HTTP protocol compliance filters"
- )
-ENDIF()
-
# Track which modules actually built have APIs to link against.
SET(installed_mod_libs_exps)
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_extra_defines SSL_DECLARE_EXPORT)
SET(mod_ssl_requires OPENSSL_FOUND)
IF(OPENSSL_FOUND)
SET(mod_ssl_extra_includes ${OPENSSL_INCLUDE_DIR})
modules/ssl/ssl_util.c modules/ssl/ssl_util_ocsp.c
modules/ssl/ssl_util_ssl.c modules/ssl/ssl_util_stapling.c
)
-IF(${minorversion} STREQUAL "4")
- SET(mod_ssl_extra_sources
- ${mod_ssl_extra_sources} modules/ssl/ssl_engine_dh.c
- )
+SET(mod_ssl_ct_requires HAVE_OPENSSL_102)
+IF(OPENSSL_FOUND)
+ SET(mod_ssl_ct_extra_includes ${OPENSSL_INCLUDE_DIR})
+ SET(mod_ssl_ct_extra_libs ${OPENSSL_LIBRARIES})
ENDIF()
+SET(mod_ssl_ct_extra_sources
+ modules/ssl/ssl_ct_log_config.c
+ modules/ssl/ssl_ct_sct.c
+ modules/ssl/ssl_ct_util.c
+)
SET(mod_status_extra_defines STATUS_DECLARE_EXPORT)
SET(mod_watchdog_install_lib 1)
SET(mod_xml2enc_requires LIBXML2_FOUND)
SET(LIBHTTPD_SOURCES
${extra_builtin_modules}
${PROJECT_BINARY_DIR}/modules.c
+ server/apreq_cookie.c
+ server/apreq_error.c
+ server/apreq_module.c
+ server/apreq_module_cgi.c
+ server/apreq_module_custom.c
+ server/apreq_param.c
+ server/apreq_parser.c
+ server/apreq_parser_header.c
+ server/apreq_parser_multipart.c
+ server/apreq_parser_urlencoded.c
+ server/apreq_util.c
modules/arch/win32/mod_win32.c
modules/core/mod_so.c
modules/http/byterange_filter.c
server/vhost.c
)
-IF(NOT ${minorversion} STREQUAL "4")
- # more libhttpd sources in trunk
- SET(LIBHTTPD_SOURCES
- ${LIBHTTPD_SOURCES}
- server/apreq_cookie.c
- server/apreq_error.c
- server/apreq_module.c
- server/apreq_module_cgi.c
- server/apreq_module_custom.c
- server/apreq_param.c
- server/apreq_parser.c
- server/apreq_parser_header.c
- server/apreq_parser_multipart.c
- server/apreq_parser_urlencoded.c
- server/apreq_util.c
- )
-ENDIF()
-
CONFIGURE_FILE(os/win32/win32_config_layout.h
${PROJECT_BINARY_DIR}/ap_config_layout.h)
${CMAKE_CURRENT_SOURCE_DIR}/modules/proxy/mod_proxy.h
${CMAKE_CURRENT_SOURCE_DIR}/modules/session/mod_session.h
${CMAKE_CURRENT_SOURCE_DIR}/modules/ssl/mod_ssl.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/modules/ssl/mod_ssl_openssl.h
)
# When mod_serf is buildable, don't forget to copy modules/proxy/mod_serf.h
LINK_FLAGS /base:@${PROJECT_BINARY_DIR}/BaseAddr.ref,${mod_name}.so
)
TARGET_LINK_LIBRARIES(${mod_name} ${${mod_extra_libs}} libhttpd ${EXTRA_LIBS} ${APR_LIBRARIES} ${HTTPD_SYSTEM_LIBS})
- SET_TARGET_PROPERTIES(${mod_name} PROPERTIES COMPILE_FLAGS "-DLONG_NAME=\"\\\"${mod_name} for Apache HTTP Server\\\"\" -DBIN_NAME=${mod_name}.so ${EXTRA_COMPILE_FLAGS}")
+ DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "${mod_name} for Apache HTTP Server")
+ SET_TARGET_PROPERTIES(${mod_name} PROPERTIES COMPILE_FLAGS "${define_long_name} -DBIN_NAME=${mod_name}.so ${EXTRA_COMPILE_FLAGS}")
# Extra defines?
SET(mod_extra_defines "${mod_name}_extra_defines")
SET(install_targets ${install_targets} libhttpd)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libhttpd.pdb)
TARGET_LINK_LIBRARIES(libhttpd ${EXTRA_LIBS} ${APR_LIBRARIES} ${PCRE_LIBRARIES} ${HTTPD_SYSTEM_LIBS})
-SET(apreqdefs)
-IF(NOT ${minorversion} STREQUAL "4")
- # trunk needs apreq symbols exported
- SET(apreqdefs -DAPREQ_DECLARE_EXPORT)
-ENDIF()
-SET_TARGET_PROPERTIES(libhttpd PROPERTIES COMPILE_FLAGS "-DAP_DECLARE_EXPORT ${apreqdefs} -DLONG_NAME=\"\\\"Apache HTTP Server Core\\\"\" -DBIN_NAME=libhttpd.dll ${EXTRA_COMPILE_FLAGS}")
+DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server Core")
+SET_TARGET_PROPERTIES(libhttpd PROPERTIES COMPILE_FLAGS "-DAP_DECLARE_EXPORT -DAPREQ_DECLARE_EXPORT ${define_long_name} -DBIN_NAME=libhttpd.dll ${EXTRA_COMPILE_FLAGS}")
ADD_DEPENDENCIES(libhttpd test_char_header)
########### HTTPD EXECUTABLES ##########
ADD_EXECUTABLE(httpd server/main.c build/win32/httpd.rc)
SET(install_targets ${install_targets} httpd)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/httpd.pdb)
-SET_TARGET_PROPERTIES(httpd PROPERTIES COMPILE_FLAGS "-DAPP_FILE -DLONG_NAME=\"\\\"Apache HTTP Server\\\"\" -DBIN_NAME=httpd.exe -DICON_FILE=${CMAKE_SOURCE_DIR}/build/win32/apache.ico ${EXTRA_COMPILE_FLAGS}")
+DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server")
+SET_TARGET_PROPERTIES(httpd PROPERTIES COMPILE_FLAGS "-DAPP_FILE ${define_long_name} -DBIN_NAME=httpd.exe -DICON_FILE=${CMAKE_SOURCE_DIR}/build/win32/apache.ico ${EXTRA_COMPILE_FLAGS}")
TARGET_LINK_LIBRARIES(httpd libhttpd ${EXTRA_LIBS})
SET(standard_support
ADD_EXECUTABLE(${pgm} support/${pgm}.c ${${extra_sources}} build/win32/httpd.rc)
SET(install_targets ${install_targets} ${pgm})
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/${pgm}.pdb)
- SET_TARGET_PROPERTIES(${pgm} PROPERTIES COMPILE_FLAGS "-DAPP_FILE -DLONG_NAME=\"\\\"Apache HTTP Server ${pgm} program\\\"\" -DBIN_NAME=${pgm}.exe ${EXTRA_COMPILE_FLAGS}")
+ DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server ${pgm} program")
+ SET_TARGET_PROPERTIES(${pgm} PROPERTIES COMPILE_FLAGS "-DAPP_FILE ${define_long_name} -DBIN_NAME=${pgm}.exe ${EXTRA_COMPILE_FLAGS}")
TARGET_LINK_LIBRARIES(${pgm} ${EXTRA_LIBS} ${APR_LIBRARIES})
ENDFOREACH()
SET_TARGET_PROPERTIES(abs PROPERTIES COMPILE_DEFINITIONS HAVE_OPENSSL)
SET(tmp_includes ${HTTPD_INCLUDE_DIRECTORIES} ${OPENSSL_INCLUDE_DIR})
SET_TARGET_PROPERTIES(abs PROPERTIES INCLUDE_DIRECTORIES "${tmp_includes}")
- SET_TARGET_PROPERTIES(${pgm} PROPERTIES COMPILE_FLAGS "-DAPP_FILE -DLONG_NAME=\"\\\"Apache HTTP Server ab/SSL program\\\"\" -DBIN_NAME=abs.exe ${EXTRA_COMPILE_FLAGS}")
+ DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server ab/SSL program")
+ SET_TARGET_PROPERTIES(abs PROPERTIES COMPILE_FLAGS "-DAPP_FILE ${define_long_name} -DBIN_NAME=abs.exe ${EXTRA_COMPILE_FLAGS}")
TARGET_LINK_LIBRARIES(abs ${EXTRA_LIBS} ${APR_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF()
GET_PROPERTY(tmp_includes TARGET ab PROPERTY INCLUDE_DIRECTORIES)
# SET(install_targets ${install_targets} ApacheMonitor)
# SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/ApacheMonitor.pdb)
# SET_TARGET_PROPERTIES(ApacheMonitor PROPERTIES WIN32_EXECUTABLE TRUE)
-# SET_TARGET_PROPERTIES(ApacheMonitor PROPERTIES COMPILE_FLAGS "-DAPP_FILE -DLONG_NAME=\"\\\"ApacheMonitor\\\"\" -DBIN_NAME=ApacheMonitor.exe ${EXTRA_COMPILE_FLAGS}")
+# SET_TARGET_PROPERTIES(ApacheMonitor PROPERTIES COMPILE_FLAGS "-DAPP_FILE -DLONG_NAME=ApacheMonitor -DBIN_NAME=ApacheMonitor.exe ${EXTRA_COMPILE_FLAGS}")
# TARGET_LINK_LIBRARIES(ApacheMonitor ${EXTRA_LIBS} ${HTTPD_SYSTEM_LIBS} comctl32 wtsapi32)
########### CONFIGURATION FILES ###########
INSTALL(FILES ${other_installed_h} DESTINATION include)
INSTALL(FILES ${installed_mod_libs_exps} DESTINATION lib)
INSTALL(FILES "${CMAKE_BINARY_DIR}/libhttpd.exp" DESTINATION LIB)
+INSTALL(FILES support/ctlogconfig DESTINATION bin)
IF(INSTALL_MANUAL) # Silly? This takes a while, and a dev doesn't need it.
INSTALL(DIRECTORY docs/manual/ DESTINATION manual)
MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}")
MESSAGE(STATUS " APR include directory ........... : ${APR_INCLUDE_DIR}")
MESSAGE(STATUS " APR libraries ................... : ${APR_LIBRARIES}")
+MESSAGE(STATUS " OpenSSL include directory ....... : ${OPENSSL_INCLUDE_DIR}")
+MESSAGE(STATUS " OpenSSL libraries ............... : ${OPENSSL_LIBRARIES}")
MESSAGE(STATUS " PCRE include directory .......... : ${PCRE_INCLUDE_DIR}")
MESSAGE(STATUS " PCRE libraries .................. : ${PCRE_LIBRARIES}")
MESSAGE(STATUS " libxml2 iconv prereq include dir. : ${LIBXML2_ICONV_INCLUDE_DIR}")