@ -18,6 +18,7 @@ option(WITH_MYSQL "with mysql-support for mod_vhostdb_mysql [default: off]")
option ( WITH_PGSQL "with postgres-support for mod_vhostdb_pgsql [default: off]" )
option ( WITH_DBI "with dbi-support for mod_vhostdb_dbi [default: off]" )
option ( WITH_OPENSSL "with openssl-support [default: off]" )
option ( WITH_WOLFSSL "with wolfSSL-support [default: off]" )
option ( WITH_PCRE "with regex support [default: on]" ON )
option ( WITH_WEBDAV_PROPS "with property-support for mod_webdav [default: off]" )
option ( WITH_WEBDAV_LOCKS "locks in webdav [default: off]" )
@ -280,6 +281,8 @@ else()
unset ( HAVE_DBI )
endif ( )
set ( CRYPTO_LIBRARY "" )
if ( WITH_OPENSSL )
if ( APPLE )
set ( CMAKE_REQUIRED_INCLUDES /opt/local/include )
@ -291,15 +294,72 @@ if(WITH_OPENSSL)
if ( HAVE_OPENSSL_SSL_H )
check_library_exists ( crypto BIO_f_base64 "" HAVE_LIBCRYPTO )
if ( HAVE_LIBCRYPTO )
set ( CRYPTO_LIBRARY crypto )
check_library_exists ( ssl SSL_new "" HAVE_LIBSSL )
endif ( )
endif ( )
else ( )
unset ( HAVE_OPENSSL_SSL_H )
unset ( HAVE_LIBCRYPTO )
unset ( HAVE_LIBSSL )
endif ( )
if ( WITH_WOLFSSL )
if ( NOT ${ WITH_WOLFSSL } EQUAL "" )
find_path ( WOLFSSL_INCLUDE_DIR wolfssl/ssl.h ${ WITH_WOLFSSL } /include )
elseif ( APPLE )
find_path ( WOLFSSL_INCLUDE_DIR wolfssl/ssl.h /opt/local/include )
else ( )
find_path ( WOLFSSL_INCLUDE_DIR wolfssl/ssl.h /usr/local/include )
endif ( )
if ( NOT ${ WITH_WOLFSSL } EQUAL "" )
find_library ( WOLFSSL_LIBRARY
N A M E S w o l f s s l
P A T H S $ { W I T H _ W O L F S S L } / l i b
)
else ( )
find_library ( WOLFSSL_LIBRARY
N A M E S w o l f s s l
P A T H S / u s r / l o c a l / l i b / o p t / l o c a l / l i b / u s r / l i b
)
endif ( )
if ( WOLFSSL_INCLUDE_DIR AND WOLFSSL_LIBRARY )
set ( CMAKE_REQUIRED_INCLUDES ${ WOLFSSL_INCLUDE_DIR } )
check_include_files ( wolfssl/ssl.h HAVE_WOLFSSL_SSL_H )
check_c_source_compiles ( "
# i n c l u d e < w o l f s s l / o p t i o n s . h >
# i f ! defined ( HAVE_LIGHTY ) & & ! defined ( OPENSSL_ALL )
# e r r o r H A V E _ L I G H T Y m a c r o n o t d e f i n e d
# e n d i f
i n t main ( ) { r e t u r n 0 ; }
" C H E C K _ H A V E _ L I G H T Y )
if ( NOT CHECK_HAVE_LIGHTY )
message ( FATAL_ERROR "wolfssl must be built with ./configure --enable-lighty" )
endif ( )
unset ( CHECK_HAVE_LIGHTY )
set ( CMAKE_REQUIRED_LIBRARIES ${ WOLFSSL_LIBRARY } )
check_library_exists ( ${ WOLFSSL_LIBRARY } wolfSSL_Init "" HAVE_LIBCRYPTO )
if ( HAVE_LIBCRYPTO )
set ( CRYPTO_LIBRARY ${ WOLFSSL_LIBRARY } )
add_definitions ( -DHAVE_WOLFSSL_SSL_H )
endif ( )
set ( CMAKE_REQUIRED_INCLUDES )
set ( CMAKE_REQUIRED_LIBRARIES )
include_directories ( ${ WOLFSSL_INCLUDE_DIR } ${ WOLFSSL_INCLUDE_DIR } /wolfssl )
endif ( )
unset ( WOLFSSL_LIBRARY )
unset ( WOLFSSL_INCLUDE_DIR )
else ( )
unset ( HAVE_WOLFSSL_SSL_H )
endif ( )
if ( WITH_OPENSSL AND WITH_WOLFSSL )
message ( FATAL_ERROR "lighttpd should not be built with both --with-openssl and --with-wolfssl" )
endif ( )
if ( WITH_PCRE )
# # i f w e h a v e p c r e - c o n f i g , u s e i t
xconfig ( pcre-config PCRE_INCDIR PCRE_LIBDIR PCRE_LDFLAGS PCRE_CFLAGS )
@ -886,16 +946,21 @@ if(NOT BUILD_STATIC)
endif ( )
endif ( )
if ( HAVE_LIBSSL AND HAVE_LIBCRYPTO )
target_link_libraries ( lighttpd ssl )
target_link_libraries ( lighttpd crypto )
if ( NOT ${ CRYPTO_LIBRARY } EQUAL "" )
if ( NOT WITH_WOLFSSL )
target_link_libraries ( lighttpd ssl )
endif ( )
target_link_libraries ( lighttpd ${ CRYPTO_LIBRARY } )
add_and_install_library ( mod_openssl "mod_openssl.c" )
set ( L_MOD_OPENSSL ${ L_MOD_OPENSSL } ssl crypto )
if ( NOT WITH_WOLFSSL )
set ( L_MOD_OPENSSL ${ L_MOD_OPENSSL } ssl )
endif ( )
set ( L_MOD_OPENSSL ${ L_MOD_OPENSSL } ${ CRYPTO_LIBRARY } )
target_link_libraries ( mod_openssl ${ L_MOD_OPENSSL } )
set ( L_MOD_AUTHN_FILE ${ L_MOD_AUTHN_FILE } crypto )
set ( L_MOD_AUTHN_FILE ${ L_MOD_AUTHN_FILE } ${ CRYPTO_LIBRARY } )
target_link_libraries ( mod_authn_file ${ L_MOD_AUTHN_FILE } )
target_link_libraries ( mod_secdownload crypto )
target_link_libraries ( mod_wstunnel crypto )
target_link_libraries ( mod_secdownload ${ CRYPTO_LIBRARY } )
target_link_libraries ( mod_wstunnel ${ CRYPTO_LIBRARY } )
endif ( )
if ( WITH_LIBEV )