]> granicus.if.org Git - apache/blobdiff - CMakeLists.txt
Set an error note for requests rejected due to SSLStrictSNIVHostCheck.
[apache] / CMakeLists.txt
index 3965939785b4012234d10eb010242b72c6259a77..ba6f1d0c2b69584afbe293a564142461e15cf8ac 100644 (file)
@@ -27,11 +27,6 @@ FIND_PACKAGE(Lua51)
 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;
@@ -84,6 +79,16 @@ FOREACH(onelib ${APR_LIBRARIES})
   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)
@@ -153,6 +158,18 @@ ELSE()
   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 "")
@@ -188,6 +205,7 @@ 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"
@@ -198,6 +216,7 @@ SET(MODULE_LIST
   "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"
@@ -206,6 +225,7 @@ SET(MODULE_LIST
   "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"
@@ -225,6 +245,7 @@ SET(MODULE_LIST
   "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"
@@ -291,6 +312,7 @@ SET(MODULE_LIST
   "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"
@@ -298,26 +320,15 @@ SET(MODULE_LIST
   "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)
 
@@ -411,6 +422,7 @@ 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_extra_defines            SSL_DECLARE_EXPORT)
 SET(mod_ssl_requires                 OPENSSL_FOUND)
 IF(OPENSSL_FOUND)
   SET(mod_ssl_extra_includes           ${OPENSSL_INCLUDE_DIR})
@@ -426,6 +438,16 @@ SET(mod_ssl_extra_sources
   modules/ssl/ssl_util.c             modules/ssl/ssl_util_ocsp.c
   modules/ssl/ssl_util_ssl.c         modules/ssl/ssl_util_stapling.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)
@@ -515,6 +537,17 @@ SET(HTTPD_MAIN_SOURCES
 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
@@ -545,7 +578,6 @@ SET(LIBHTTPD_SOURCES
   server/provider.c
   server/request.c
   server/scoreboard.c
-  server/skiplist.c
   server/util.c
   server/util_cfgtree.c
   server/util_cookies.c
@@ -564,24 +596,6 @@ SET(LIBHTTPD_SOURCES
   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)
 
@@ -624,6 +638,7 @@ SET(other_installed_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
 
@@ -715,7 +730,8 @@ FOREACH (mod ${MODULE_PATHS})
       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")
@@ -726,7 +742,7 @@ FOREACH (mod ${MODULE_PATHS})
     # Extra includes?
     SET(mod_extra_includes "${mod_name}_extra_includes")
     IF(NOT "${${mod_extra_includes}}" STREQUAL "")
-      SET(tmp_includes ${${mod_extra_includes}} ${HTTPD_INCLUDE_DIRECTORIES})
+      SET(tmp_includes ${HTTPD_INCLUDE_DIRECTORIES} ${${mod_extra_includes}})
       SET_TARGET_PROPERTIES(${mod_name} PROPERTIES INCLUDE_DIRECTORIES "${tmp_includes}")
       GET_PROPERTY(tmp_includes TARGET ${mod_name} PROPERTY INCLUDE_DIRECTORIES)
     ENDIF()
@@ -742,19 +758,16 @@ SET_TARGET_PROPERTIES(libhttpd PROPERTIES
 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
@@ -776,7 +789,8 @@ FOREACH(pgm ${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()
 
@@ -787,7 +801,8 @@ IF(OPENSSL_FOUND)
   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)
@@ -797,7 +812,7 @@ 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 ###########
@@ -853,6 +868,7 @@ INSTALL(DIRECTORY include/ DESTINATION include
 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)
@@ -890,6 +906,8 @@ MESSAGE(STATUS "  Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
 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}")