2015-08-22 16:01:02 +00:00
|
|
|
include(CheckCSourceCompiles)
|
|
|
|
include(CheckIncludeFiles)
|
|
|
|
include(CheckFunctionExists)
|
2016-07-19 08:03:14 +00:00
|
|
|
include(CheckSymbolExists)
|
2015-08-22 16:01:02 +00:00
|
|
|
include(CheckVariableExists)
|
|
|
|
include(CheckTypeSize)
|
|
|
|
include(CheckLibraryExists)
|
|
|
|
include(CMakeDetermineCCompiler)
|
|
|
|
include(FindThreads)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
|
|
|
|
include(LighttpdMacros)
|
|
|
|
|
|
|
|
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES)
|
|
|
|
|
2019-08-23 11:33:17 +00:00
|
|
|
# default to ON
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Default value for ``POSITION_INDEPENDENT_CODE`` of targets.")
|
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
option(WITH_XATTR "with xattr-support for the stat-cache [default: off]")
|
2017-01-18 05:36:49 +00:00
|
|
|
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]")
|
2020-05-14 06:03:14 +00:00
|
|
|
option(WITH_GNUTLS "with GnuTLS-support [default: off]")
|
2020-03-19 03:21:19 +00:00
|
|
|
option(WITH_MBEDTLS "with mbedTLS-support [default: off]")
|
2020-06-29 03:43:16 +00:00
|
|
|
option(WITH_NSS "with NSS-crypto-support [default: off]")
|
2015-08-22 16:01:02 +00:00
|
|
|
option(WITH_OPENSSL "with openssl-support [default: off]")
|
2018-10-08 03:02:25 +00:00
|
|
|
option(WITH_WOLFSSL "with wolfSSL-support [default: off]")
|
2020-02-25 05:39:23 +00:00
|
|
|
option(WITH_NETTLE "with Nettle-support [default: off]")
|
2015-08-22 16:01:02 +00:00
|
|
|
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]")
|
2020-07-19 07:07:47 +00:00
|
|
|
option(WITH_BROTLI "with brotli-support for mod_deflate [default: off]")
|
2020-07-20 08:09:20 +00:00
|
|
|
option(WITH_BZIP "with bzip2-support for mod_deflate [default: off]")
|
|
|
|
option(WITH_ZLIB "with deflate-support for mod_deflate [default: on]" ON)
|
2017-01-18 05:36:49 +00:00
|
|
|
option(WITH_KRB5 "with Kerberos5-support for mod_auth [default: off]")
|
|
|
|
option(WITH_LDAP "with LDAP-support for mod_auth mod_vhostdb_ldap [default: off]")
|
2018-09-18 05:51:45 +00:00
|
|
|
option(WITH_PAM "with PAM-support for mod_auth [default: off]")
|
2015-08-22 16:01:02 +00:00
|
|
|
option(WITH_LUA "with lua 5.1 for mod_magnet [default: off]")
|
|
|
|
# option(WITH_VALGRIND "with internal support for valgrind [default: off]")
|
|
|
|
option(WITH_FAM "fam/gamin for reducing number of stat() calls [default: off]")
|
|
|
|
option(WITH_GDBM "gdbm storage for mod_trigger_b4_dl [default: off]")
|
2016-01-03 14:48:11 +00:00
|
|
|
option(WITH_MEMCACHED "memcached storage for mod_trigger_b4_dl [default: off]")
|
2015-08-22 16:01:02 +00:00
|
|
|
option(WITH_LIBEV "libev support for fdevent handlers [default: off]")
|
|
|
|
option(WITH_LIBUNWIND "with libunwind to print backtraces in asserts [default: off]")
|
2016-10-17 16:14:55 +00:00
|
|
|
option(WITH_GEOIP "with GeoIP-support mod_geoip [default: off]")
|
2019-05-20 04:53:20 +00:00
|
|
|
option(WITH_MAXMINDDB "with MaxMind GeoIP2-support mod_maxminddb [default: off]")
|
2017-11-05 23:52:09 +00:00
|
|
|
option(WITH_SASL "with SASL-support for mod_authn_sasl [default: off]")
|
2015-08-22 16:01:02 +00:00
|
|
|
|
2016-07-30 12:21:35 +00:00
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
2015-08-22 16:01:02 +00:00
|
|
|
option(BUILD_EXTRA_WARNINGS "extra warnings")
|
|
|
|
|
|
|
|
if(BUILD_EXTRA_WARNINGS)
|
2019-03-10 04:20:21 +00:00
|
|
|
set(WARN_CFLAGS "-g -g2 -Wall -Wmissing-declarations -Wcast-align -Wsign-compare -Wnested-externs -Wpointer-arith -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security")
|
2015-08-23 08:07:47 +00:00
|
|
|
set(WARN_LDFLAGS "-Wl,--as-needed")
|
2009-03-07 21:05:37 +00:00
|
|
|
# -Werror -Wbad-function-cast -Wmissing-prototypes
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(BUILD_STATIC "build a static lighttpd with all modules added")
|
|
|
|
|
|
|
|
if(BUILD_STATIC)
|
|
|
|
set(LIGHTTPD_STATIC 1)
|
2016-05-21 06:51:37 +00:00
|
|
|
elseif(APPLE)
|
|
|
|
set(CMAKE_SHARED_MODULE_PREFIX "")
|
2015-08-22 16:01:02 +00:00
|
|
|
else()
|
|
|
|
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_LIBEV)
|
|
|
|
find_package(LibEV REQUIRED)
|
2015-08-22 16:01:05 +00:00
|
|
|
set(HAVE_LIBEV 1)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_LIBUNWIND)
|
|
|
|
pkg_check_modules(LIBUNWIND REQUIRED libunwind)
|
2015-08-22 16:01:05 +00:00
|
|
|
set(HAVE_LIBUNWIND 1)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_WEBDAV_PROPS)
|
|
|
|
set(WITH_XML 1)
|
|
|
|
set(WITH_SQLITE3 1)
|
2017-10-21 14:01:37 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_WEBDAV_LOCKS)
|
2015-08-22 16:01:02 +00:00
|
|
|
set(WITH_UUID 1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
check_include_files(sys/devpoll.h HAVE_SYS_DEVPOLL_H)
|
|
|
|
check_include_files(sys/epoll.h HAVE_SYS_EPOLL_H)
|
2019-05-05 06:52:31 +00:00
|
|
|
set(CMAKE_REQUIRED_FLAGS "-include sys/types.h")
|
2015-08-22 16:01:02 +00:00
|
|
|
check_include_files(sys/event.h HAVE_SYS_EVENT_H)
|
2019-05-05 06:52:31 +00:00
|
|
|
set(CMAKE_REQUIRED_FLAGS)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
|
2019-11-13 20:20:10 +00:00
|
|
|
check_include_files(sys/loadavg.h HAVE_SYS_LOADAVG_H)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_include_files(sys/poll.h HAVE_SYS_POLL_H)
|
|
|
|
check_include_files(sys/port.h HAVE_SYS_PORT_H)
|
|
|
|
check_include_files(sys/prctl.h HAVE_SYS_PRCTL_H)
|
|
|
|
check_include_files(sys/resource.h HAVE_SYS_RESOURCE_H)
|
|
|
|
check_include_files(sys/sendfile.h HAVE_SYS_SENDFILE_H)
|
|
|
|
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
|
|
|
|
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
|
|
|
|
check_include_files(sys/uio.h HAVE_SYS_UIO_H)
|
|
|
|
check_include_files(sys/un.h HAVE_SYS_UN_H)
|
|
|
|
check_include_files(sys/wait.h HAVE_SYS_WAIT_H)
|
|
|
|
check_include_files(sys/time.h HAVE_SYS_TIME_H)
|
|
|
|
check_include_files(unistd.h HAVE_UNISTD_H)
|
|
|
|
check_include_files(pthread.h HAVE_PTHREAD_H)
|
|
|
|
check_include_files(getopt.h HAVE_GETOPT_H)
|
|
|
|
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
|
|
|
check_include_files(poll.h HAVE_POLL_H)
|
|
|
|
check_include_files(pwd.h HAVE_PWD_H)
|
|
|
|
check_include_files(stddef.h HAVE_STDDEF_H)
|
|
|
|
check_include_files(stdint.h HAVE_STDINT_H)
|
2017-04-24 14:13:41 +00:00
|
|
|
check_include_files(strings.h HAVE_STRINGS_H)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_include_files(syslog.h HAVE_SYSLOG_H)
|
2008-12-05 22:30:32 +00:00
|
|
|
|
2008-12-07 15:22:52 +00:00
|
|
|
# check for fastcgi lib, for the tests only
|
2015-08-22 16:01:02 +00:00
|
|
|
check_include_files(fastcgi.h HAVE_FASTCGI_H)
|
|
|
|
check_include_files(fastcgi/fastcgi.h HAVE_FASTCGI_FASTCGI_H)
|
2008-12-07 15:22:52 +00:00
|
|
|
|
2015-02-12 06:39:39 +00:00
|
|
|
# will be needed for auth
|
2015-08-22 16:01:02 +00:00
|
|
|
check_include_files(crypt.h HAVE_CRYPT_H)
|
2015-02-12 06:39:39 +00:00
|
|
|
# check if we need libcrypt for crypt_r()
|
2015-08-22 16:01:02 +00:00
|
|
|
check_library_exists(crypt crypt_r "" HAVE_LIBCRYPT_CRYPT_R)
|
|
|
|
if(HAVE_LIBCRYPT_CRYPT_R)
|
2015-08-22 16:01:05 +00:00
|
|
|
set(HAVE_CRYPT_R 1)
|
|
|
|
set(HAVE_LIBCRYPT 1)
|
2015-08-22 16:01:02 +00:00
|
|
|
else()
|
|
|
|
check_library_exists(crypt crypt "" HAVE_LIBCRYPT)
|
|
|
|
endif()
|
|
|
|
check_function_exists(crypt_r HAVE_CRYPT_R)
|
2015-09-26 10:11:24 +00:00
|
|
|
check_function_exists(crypt HAVE_CRYPT)
|
2015-08-22 16:01:02 +00:00
|
|
|
|
|
|
|
check_include_files(sys/inotify.h HAVE_SYS_INOTIFY_H)
|
|
|
|
if(HAVE_SYS_INOTIFY_H)
|
|
|
|
check_function_exists(inotify_init HAVE_INOTIFY_INIT)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
|
|
|
|
check_type_size(socklen_t HAVE_SOCKLEN_T)
|
|
|
|
set(CMAKE_EXTRA_INCLUDE_FILES)
|
|
|
|
|
2017-06-10 17:22:48 +00:00
|
|
|
check_include_files(sys/random.h HAVE_SYS_RANDOM_H)
|
|
|
|
set(CMAKE_EXTRA_INCLUDE_FILES sys/random.h)
|
|
|
|
check_function_exists(getentropy HAVE_GETENTROPY)
|
|
|
|
set(CMAKE_EXTRA_INCLUDE_FILES)
|
|
|
|
|
2016-10-13 07:10:10 +00:00
|
|
|
check_include_files(linux/random.h HAVE_LINUX_RANDOM_H)
|
|
|
|
set(CMAKE_EXTRA_INCLUDE_FILES linux/random.h)
|
|
|
|
check_function_exists(getrandom HAVE_GETRANDOM)
|
|
|
|
set(CMAKE_EXTRA_INCLUDE_FILES)
|
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
check_type_size(long SIZEOF_LONG)
|
|
|
|
check_type_size(off_t SIZEOF_OFF_T)
|
|
|
|
|
2016-11-28 17:37:36 +00:00
|
|
|
check_function_exists(arc4random_buf HAVE_ARC4RANDOM_BUF)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_function_exists(chroot HAVE_CHROOT)
|
2019-12-29 20:10:59 +00:00
|
|
|
check_function_exists(copy_file_range HAVE_COPY_FILE_RANGE)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_function_exists(epoll_ctl HAVE_EPOLL_CTL)
|
|
|
|
check_function_exists(fork HAVE_FORK)
|
2016-10-19 20:09:29 +00:00
|
|
|
check_function_exists(getloadavg HAVE_GETLOADAVG)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_function_exists(getrlimit HAVE_GETRLIMIT)
|
|
|
|
check_function_exists(getuid HAVE_GETUID)
|
|
|
|
check_function_exists(gmtime_r HAVE_GMTIME_R)
|
|
|
|
check_function_exists(inet_ntop HAVE_INET_NTOP)
|
2016-10-13 07:10:10 +00:00
|
|
|
check_function_exists(jrand48 HAVE_JRAND48)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_function_exists(kqueue HAVE_KQUEUE)
|
|
|
|
check_function_exists(localtime_r HAVE_LOCALTIME_R)
|
|
|
|
check_function_exists(lstat HAVE_LSTAT)
|
|
|
|
check_function_exists(madvise HAVE_MADVISE)
|
|
|
|
check_function_exists(memcpy HAVE_MEMCPY)
|
|
|
|
check_function_exists(memset HAVE_MEMSET)
|
|
|
|
check_function_exists(mmap HAVE_MMAP)
|
|
|
|
check_function_exists(pathconf HAVE_PATHCONF)
|
2016-12-17 22:58:34 +00:00
|
|
|
check_function_exists(pipe2 HAVE_PIPE2)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_function_exists(poll HAVE_POLL)
|
|
|
|
check_function_exists(port_create HAVE_PORT_CREATE)
|
|
|
|
check_function_exists(prctl HAVE_PRCTL)
|
|
|
|
check_function_exists(pread HAVE_PREAD)
|
|
|
|
check_function_exists(posix_fadvise HAVE_POSIX_FADVISE)
|
|
|
|
check_function_exists(select HAVE_SELECT)
|
|
|
|
check_function_exists(sendfile HAVE_SENDFILE)
|
|
|
|
check_function_exists(send_file HAVE_SEND_FILE)
|
|
|
|
check_function_exists(sendfile64 HAVE_SENDFILE64)
|
|
|
|
check_function_exists(sendfilev HAVE_SENDFILEV)
|
|
|
|
check_function_exists(sigaction HAVE_SIGACTION)
|
|
|
|
check_function_exists(signal HAVE_SIGNAL)
|
|
|
|
check_function_exists(sigtimedwait HAVE_SIGTIMEDWAIT)
|
2016-10-16 09:01:42 +00:00
|
|
|
check_function_exists(srandom HAVE_SRANDOM)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_function_exists(strptime HAVE_STRPTIME)
|
|
|
|
check_function_exists(syslog HAVE_SYSLOG)
|
|
|
|
check_function_exists(writev HAVE_WRITEV)
|
|
|
|
check_function_exists(inet_aton HAVE_INET_ATON)
|
2015-09-26 10:11:24 +00:00
|
|
|
check_function_exists(issetugid HAVE_ISSETUGID)
|
|
|
|
check_function_exists(inet_pton HAVE_INET_PTON)
|
|
|
|
check_function_exists(memset_s HAVE_MEMSET_S)
|
|
|
|
check_function_exists(explicit_bzero HAVE_EXPLICIT_BZERO)
|
2019-08-22 11:13:24 +00:00
|
|
|
check_function_exists(explicit_memset HAVE_EXPLICIT_MEMSET)
|
2016-07-19 08:03:14 +00:00
|
|
|
check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
|
|
|
|
if (NOT HAVE_CLOCK_GETTIME)
|
|
|
|
check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
|
|
|
|
endif()
|
2019-05-05 18:34:25 +00:00
|
|
|
check_library_exists(elftc elftc_copyfile "libelftc.h" HAVE_ELFTC_COPYFILE)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_c_source_compiles("
|
2008-12-05 23:39:51 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
2015-08-22 16:01:02 +00:00
|
|
|
|
2008-12-05 23:39:51 +00:00
|
|
|
int main() {
|
|
|
|
struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;
|
|
|
|
return 0;
|
|
|
|
}" HAVE_IPV6)
|
2015-09-26 10:11:24 +00:00
|
|
|
check_c_source_compiles("
|
|
|
|
__attribute__((weak)) void __dummy(void *x) { }
|
|
|
|
int main() {
|
|
|
|
void *x;
|
|
|
|
__dummy(x);
|
|
|
|
}
|
|
|
|
" HAVE_WEAK_SYMBOLS)
|
2016-07-06 17:57:24 +00:00
|
|
|
check_c_source_compiles("
|
|
|
|
#include <time.h>
|
|
|
|
int main(void) {
|
|
|
|
struct tm t;
|
|
|
|
t.tm_gmtoff = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
" HAVE_STRUCT_TM_GMTOFF)
|
2008-12-05 22:30:32 +00:00
|
|
|
|
|
|
|
## refactor me
|
2015-08-22 16:01:02 +00:00
|
|
|
macro(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
|
2008-12-05 22:30:32 +00:00
|
|
|
# reset the variables at the beginning
|
2015-08-22 16:01:02 +00:00
|
|
|
set(${_include_DIR})
|
|
|
|
set(${_link_DIR})
|
|
|
|
set(${_link_FLAGS})
|
|
|
|
set(${_cflags})
|
|
|
|
|
|
|
|
find_program(${_package}CONFIG_EXECUTABLE NAMES ${_package} PATHS /usr/local/bin )
|
|
|
|
|
|
|
|
# if pkg-config has been found
|
|
|
|
if(${_package}CONFIG_EXECUTABLE)
|
|
|
|
set(XCONFIG_EXECUTABLE "${${_package}CONFIG_EXECUTABLE}")
|
|
|
|
message(STATUS "found ${_package}: ${XCONFIG_EXECUTABLE}")
|
|
|
|
|
|
|
|
exec_program(${XCONFIG_EXECUTABLE} ARGS --libs OUTPUT_VARIABLE __link_FLAGS)
|
|
|
|
string(REPLACE "\n" "" ${_link_FLAGS} ${__link_FLAGS})
|
|
|
|
exec_program(${XCONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE __cflags)
|
|
|
|
string(REPLACE "\n" "" ${_cflags} ${__cflags})
|
|
|
|
else()
|
|
|
|
message(STATUS "found ${_package}: no")
|
|
|
|
endif()
|
|
|
|
endmacro(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
|
|
|
|
|
|
|
|
if(WITH_XATTR)
|
2020-03-23 02:51:30 +00:00
|
|
|
check_include_files("sys/types.h;sys/xattr.h" HAVE_SYS_XATTR_H)
|
|
|
|
check_function_exists(getxattr HAVE_XATTR)
|
2017-10-21 14:02:06 +00:00
|
|
|
check_include_files("sys/types.h;attr/attributes.h" HAVE_ATTR_ATTRIBUTES_H)
|
2015-08-22 16:01:02 +00:00
|
|
|
if(HAVE_ATTR_ATTRIBUTES_H)
|
|
|
|
check_library_exists(attr attr_get "" HAVE_XATTR)
|
|
|
|
endif()
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_ATTR_ATTRIBUTES_H)
|
|
|
|
unset(HAVE_XATTR)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_MYSQL)
|
|
|
|
xconfig(mysql_config MYSQL_INCDIR MYSQL_LIBDIR MYSQL_LDFLAGS MYSQL_CFLAGS)
|
|
|
|
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES /usr/include/mysql)
|
|
|
|
check_include_files(mysql.h HAVE_MYSQL_H)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES)
|
|
|
|
if(HAVE_MYSQL_H)
|
|
|
|
check_library_exists(mysqlclient mysql_real_connect "" HAVE_MYSQL)
|
|
|
|
endif()
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_MYSQL_H)
|
|
|
|
unset(HAVE_MYSQL)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
2017-01-18 05:36:49 +00:00
|
|
|
if(WITH_PGSQL)
|
|
|
|
xconfig(pg_config PGSQL_INCDIR PGSQL_LIBDIR PGSQL_LDFLAGS PGSQL_CFLAGS)
|
|
|
|
|
|
|
|
check_include_files(libpq-fe.h HAVE_PGSQL_H)
|
|
|
|
if(HAVE_PGSQL_H)
|
|
|
|
check_library_exists(pq PQsetdbLogin "" HAVE_PGSQL)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
unset(HAVE_PGSQL_H)
|
|
|
|
unset(HAVE_PGSQL)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_DBI)
|
|
|
|
check_include_files(dbi/dbi.h HAVE_DBI_H)
|
|
|
|
if(HAVE_DBI_H)
|
|
|
|
check_library_exists(dbi dbi_conn_connect "" HAVE_DBI)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
unset(HAVE_DBI_H)
|
|
|
|
unset(HAVE_DBI)
|
|
|
|
endif()
|
|
|
|
|
2018-10-08 03:02:25 +00:00
|
|
|
set(CRYPTO_LIBRARY "")
|
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
if(WITH_OPENSSL)
|
2016-05-21 06:51:37 +00:00
|
|
|
if(APPLE)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES /opt/local/include)
|
|
|
|
endif()
|
2015-08-22 16:01:02 +00:00
|
|
|
check_include_files(openssl/ssl.h HAVE_OPENSSL_SSL_H)
|
2016-05-21 06:51:37 +00:00
|
|
|
if(APPLE)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES)
|
|
|
|
endif()
|
2015-08-22 16:01:02 +00:00
|
|
|
if(HAVE_OPENSSL_SSL_H)
|
|
|
|
check_library_exists(crypto BIO_f_base64 "" HAVE_LIBCRYPTO)
|
|
|
|
if(HAVE_LIBCRYPTO)
|
2018-10-08 03:02:25 +00:00
|
|
|
set(CRYPTO_LIBRARY crypto)
|
2015-08-22 16:01:02 +00:00
|
|
|
check_library_exists(ssl SSL_new "" HAVE_LIBSSL)
|
2020-09-09 06:52:34 +00:00
|
|
|
set(HAVE_OPENSSL 1)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_OPENSSL_SSL_H)
|
|
|
|
unset(HAVE_LIBSSL)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
2018-10-08 03:02:25 +00:00
|
|
|
if(WITH_WOLFSSL)
|
2020-10-27 17:01:01 +00:00
|
|
|
pkg_check_modules(WOLFSSL QUIET wolfssl)
|
2018-10-08 03:02:25 +00:00
|
|
|
if(NOT ${WITH_WOLFSSL} EQUAL "")
|
|
|
|
find_path(WOLFSSL_INCLUDE_DIR wolfssl/ssl.h ${WITH_WOLFSSL}/include)
|
2020-10-27 17:01:01 +00:00
|
|
|
elseif(WOLFSSL_FOUND)
|
|
|
|
set(WOLFSSL_INCLUDE_DIR ${WOLFSSL_INCLUDE_DIRS})
|
2018-10-08 03:02:25 +00:00
|
|
|
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
|
|
|
|
NAMES wolfssl
|
|
|
|
PATHS ${WITH_WOLFSSL}/lib
|
|
|
|
)
|
2020-10-27 17:01:01 +00:00
|
|
|
elseif(WOLFSSL_FOUND)
|
|
|
|
set(WOLFSSL_LIBRARY ${WOLFSSL_LIBRARY_DIRS})
|
2018-10-08 03:02:25 +00:00
|
|
|
else()
|
|
|
|
find_library(WOLFSSL_LIBRARY
|
|
|
|
NAMES wolfssl
|
|
|
|
PATHS /usr/local/lib /opt/local/lib /usr/lib
|
|
|
|
)
|
|
|
|
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("
|
|
|
|
#include <wolfssl/options.h>
|
2020-10-27 01:14:09 +00:00
|
|
|
#if !defined(HAVE_LIGHTY) && !defined(OPENSSL_EXTRA)
|
2018-10-08 03:02:25 +00:00
|
|
|
#error HAVE_LIGHTY macro not defined
|
|
|
|
#endif
|
|
|
|
int main() { return 0; }
|
|
|
|
" CHECK_HAVE_LIGHTY)
|
|
|
|
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)
|
2020-09-09 06:52:34 +00:00
|
|
|
set(HAVE_WOLFSSL 1)
|
2018-10-08 03:02:25 +00:00
|
|
|
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()
|
|
|
|
|
2020-03-19 03:21:19 +00:00
|
|
|
if(WITH_MBEDTLS)
|
|
|
|
check_include_files(mbedtls/ssl.h HAVE_MBEDTLS_SSL_H)
|
|
|
|
if(HAVE_MBEDTLS_SSL_H)
|
|
|
|
check_library_exists(mbedcrypto mbedtls_base64_encode "" HAVE_LIBMBEDCRYPTO)
|
|
|
|
if(HAVE_LIBMEDTLSCRYPTO)
|
|
|
|
check_library_exists(mbedtls mbedtls_cipher_info_from_type "" HAVE_LIBMBEDTLS)
|
|
|
|
if(HAVE_LIBMBEDTLS)
|
|
|
|
check_library_exists(mbedx509 mbedtls_x509_get_name "" HAVE_LIBMBEDX509)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
unset(HAVE_MBEDTLS_SSL_H)
|
|
|
|
unset(HAVE_LIBMBEDCRYPTO)
|
|
|
|
unset(HAVE_LIBMBEDTLS)
|
|
|
|
unset(HAVE_LIBMEDX509)
|
|
|
|
endif()
|
|
|
|
|
2020-06-29 03:43:16 +00:00
|
|
|
if(WITH_NSS)
|
2020-10-27 20:40:08 +00:00
|
|
|
check_include_files(nss/nss.h HAVE_NSS_NSS_H)
|
2020-06-29 03:43:16 +00:00
|
|
|
check_include_files(nss3/nss.h HAVE_NSS3_NSS_H)
|
2020-10-27 20:40:08 +00:00
|
|
|
if(HAVE_NSS3_NSS_H OR HAVE_NSS_NSS_H)
|
2020-06-29 03:43:16 +00:00
|
|
|
check_library_exists(ssl3 NSSSSL_GetVersion "" HAVE_LIBSSL3)
|
|
|
|
if(HAVE_LIBSSL3)
|
|
|
|
check_library_exists(smime3 NSSSMIME_GetVersion "" HAVE_LIBSMIME3)
|
|
|
|
if(HAVE_LIBSMIME3)
|
|
|
|
check_library_exists(nss3 NSS_GetVersion "" HAVE_LIBNSS3)
|
|
|
|
if(HAVE_LIBNSS3)
|
|
|
|
check_library_exists(nssutil3 NSSUTIL_GetVersion "" HAVE_LIBNSSUTIL3)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
else()
|
2020-10-27 20:40:08 +00:00
|
|
|
unset(HAVE_NSS_NSS_H)
|
2020-06-29 03:43:16 +00:00
|
|
|
unset(HAVE_NSS3_NSS_H)
|
|
|
|
unset(HAVE_LIBSSL3)
|
|
|
|
unset(HAVE_LIBSMIME3)
|
|
|
|
unset(HAVE_LIBNSS3)
|
|
|
|
unset(HAVE_LIBNSSUTIL3)
|
|
|
|
endif()
|
|
|
|
|
2020-02-25 05:39:23 +00:00
|
|
|
if(WITH_NETTLE)
|
|
|
|
if(APPLE)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES /opt/local/include)
|
|
|
|
endif()
|
|
|
|
check_include_files(nettle/nettle-types.h HAVE_NETTLE_NETTLE_TYPES_H)
|
|
|
|
if(APPLE)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES)
|
|
|
|
endif()
|
|
|
|
if(HAVE_NETTLE_NETTLE_TYPES_H)
|
|
|
|
check_library_exists(nettle nettle_md5_init "" HAVE_LIBCRYPTO)
|
|
|
|
if(HAVE_LIBCRYPTO)
|
|
|
|
set(CRYPTO_LIBRARY nettle)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
unset(HAVE_NETTLE_NETTLE_TYPES_H)
|
|
|
|
endif()
|
|
|
|
|
2020-05-14 06:03:14 +00:00
|
|
|
if(WITH_GNUTLS)
|
|
|
|
pkg_check_modules(LIBGNUTLS REQUIRED gnutls)
|
|
|
|
set(HAVE_LIBGNUTLS 1)
|
|
|
|
add_definitions(-DHAVE_GNUTLS_CRYPTO_H)
|
|
|
|
if(NOT WITH_OPENSSL AND NOT WITH_WOLFSSL AND NOT WITH_MBEDTLS AND NOT WITH_NETTLE)
|
|
|
|
set(CRYPTO_LIBRARY gnutls)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
if(WITH_PCRE)
|
|
|
|
## if we have pcre-config, use it
|
|
|
|
xconfig(pcre-config PCRE_INCDIR PCRE_LIBDIR PCRE_LDFLAGS PCRE_CFLAGS)
|
|
|
|
if(PCRE_LDFLAGS OR PCRE_CFLAGS)
|
|
|
|
message(STATUS "found pcre at: LDFLAGS: ${PCRE_LDFLAGS} CFLAGS: ${PCRE_CFLAGS}")
|
|
|
|
|
|
|
|
if(NOT PCRE_CFLAGS STREQUAL "\n")
|
|
|
|
## if it is empty we'll get newline returned
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PCRE_CFLAGS}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(HAVE_PCRE_H 1)
|
|
|
|
set(HAVE_LIBPCRE 1)
|
|
|
|
else()
|
|
|
|
if(NOT WIN32)
|
|
|
|
check_include_files(pcre.h HAVE_PCRE_H)
|
|
|
|
check_library_exists(pcre pcre_exec "" HAVE_LIBPCRE)
|
|
|
|
set(PCRE_LDFLAGS -lpcre)
|
|
|
|
else()
|
|
|
|
find_path(PCRE_INCLUDE_DIR pcre.h
|
|
|
|
/usr/local/include
|
|
|
|
/usr/include
|
|
|
|
)
|
|
|
|
|
|
|
|
set(PCRE_NAMES pcre)
|
|
|
|
find_library(PCRE_LIBRARY
|
|
|
|
NAMES ${PCRE_NAMES}
|
|
|
|
PATHS /usr/lib /usr/local/lib
|
|
|
|
)
|
|
|
|
|
|
|
|
if(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${PCRE_INCLUDE_DIR})
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${PCRE_LIBRARY})
|
|
|
|
check_include_files(pcre.h HAVE_PCRE_H)
|
|
|
|
check_library_exists(pcre pcre_exec "" HAVE_LIBPCRE)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES)
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES)
|
|
|
|
include_directories(${PCRE_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT HAVE_PCRE_H)
|
|
|
|
message(FATAL_ERROR "pcre.h couldn't be found")
|
|
|
|
endif()
|
|
|
|
if(NOT HAVE_LIBPCRE)
|
|
|
|
message(FATAL_ERROR "libpcre couldn't be found")
|
|
|
|
endif()
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_PCRE_H)
|
|
|
|
unset(HAVE_LIBPCRE)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
2017-11-05 23:52:09 +00:00
|
|
|
if(WITH_SASL)
|
|
|
|
check_include_files(sasl/sasl.h HAVE_SASL_SASL_H)
|
|
|
|
if(HAVE_SASL_SASL_H)
|
|
|
|
check_library_exists(sasl2 sasl_server_init "" HAVE_SASL)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
unset(HAVE_SASL_SASL_H)
|
|
|
|
unset(HAVE_SASL)
|
|
|
|
endif()
|
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
|
|
|
|
if(WITH_XML)
|
|
|
|
xconfig(xml2-config XML2_INCDIR XML2_LIBDIR XML2_LDFLAGS XML2_CFLAGS)
|
|
|
|
if(XML2_LDFLAGS OR XML2_CFLAGS)
|
|
|
|
message(STATUS "found xml2 at: LDFLAGS: ${XML2_LDFLAGS} CFLAGS: ${XML2_CFLAGS}")
|
|
|
|
|
|
|
|
## if it is empty we'll get newline returned
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XML2_CFLAGS}")
|
|
|
|
|
|
|
|
check_include_files(libxml/tree.h HAVE_LIBXML_H)
|
|
|
|
|
|
|
|
set(CMAKE_REQUIRED_FLAGS ${XML2_LDFLAGS})
|
|
|
|
check_library_exists(xml2 xmlParseChunk "" HAVE_LIBXML)
|
|
|
|
set(CMAKE_REQUIRED_FLAGS)
|
|
|
|
else()
|
|
|
|
check_include_files(libxml.h HAVE_LIBXML_H)
|
|
|
|
check_library_exists(xml2 xmlParseChunk "" HAVE_LIBXML)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT HAVE_LIBXML_H)
|
|
|
|
message(FATAL_ERROR "libxml/tree.h couldn't be found")
|
|
|
|
endif()
|
|
|
|
if(NOT HAVE_LIBXML)
|
|
|
|
message(FATAL_ERROR "libxml2 couldn't be found")
|
|
|
|
endif()
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_LIBXML_H)
|
|
|
|
unset(HAVE_LIBXML)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_SQLITE3)
|
|
|
|
check_include_files(sqlite3.h HAVE_SQLITE3_H)
|
|
|
|
check_library_exists(sqlite3 sqlite3_reset "" HAVE_SQLITE3)
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_SQLITE3_H)
|
|
|
|
unset(HAVE_SQLITE3)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_UUID)
|
|
|
|
check_include_files(uuid/uuid.h HAVE_UUID_UUID_H)
|
|
|
|
check_library_exists(uuid uuid_generate "" NEED_LIBUUID)
|
|
|
|
if(NOT NEED_LIBUUID)
|
|
|
|
check_function_exists(uuid_generate HAVE_LIBUUID)
|
|
|
|
else()
|
|
|
|
set(HAVE_LIBUUID 1)
|
|
|
|
endif()
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_UUID_UUID_H)
|
|
|
|
unset(NEED_LIBUUID)
|
|
|
|
unset(HAVE_LIBUUID)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_ZLIB)
|
|
|
|
if(NOT WIN32)
|
|
|
|
check_include_files(zlib.h HAVE_ZLIB_H)
|
|
|
|
check_library_exists(z deflate "" HAVE_LIBZ)
|
|
|
|
set(ZLIB_LIBRARY z)
|
|
|
|
else()
|
|
|
|
find_path(ZLIB_INCLUDE_DIR zlib.h
|
2015-08-22 16:01:05 +00:00
|
|
|
/usr/local/include
|
|
|
|
/usr/include
|
2015-08-22 16:01:02 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(ZLIB_NAMES z zlib zdll)
|
2015-08-22 16:01:05 +00:00
|
|
|
find_library(ZLIB_LIBRARY
|
|
|
|
NAMES ${ZLIB_NAMES}
|
|
|
|
PATHS /usr/lib /usr/local/lib
|
2015-08-22 16:01:02 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if(ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIR})
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY})
|
|
|
|
get_filename_component(ZLIB_NAME ${ZLIB_LIBRARY} NAME)
|
|
|
|
check_include_files(zlib.h HAVE_ZLIB_H)
|
|
|
|
check_library_exists(${ZLIB_NAME} deflate "" HAVE_LIBZ)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES)
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES)
|
|
|
|
include_directories(${ZLIB_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
endif()
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_ZLIB_H)
|
|
|
|
unset(HAVE_LIBZ)
|
|
|
|
unset(ZLIB_INCLUDE_DIR)
|
|
|
|
unset(ZLIB_LIBRARY)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_BZIP)
|
|
|
|
check_include_files(bzlib.h HAVE_BZLIB_H)
|
|
|
|
check_library_exists(bz2 BZ2_bzCompress "" HAVE_LIBBZ2)
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_BZLIB_H)
|
|
|
|
unset(HAVE_LIBBZ2)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
2020-07-19 07:07:47 +00:00
|
|
|
if(WITH_BROTLI)
|
|
|
|
pkg_check_modules(LIBBROTLI REQUIRED libbrotlienc)
|
|
|
|
set(HAVE_BROTLI 1)
|
|
|
|
add_definitions(-DHAVE_BROTLI_ENCODE_H -DHAVE_BROTLI)
|
|
|
|
else()
|
|
|
|
unset(HAVE_BROTLI)
|
|
|
|
endif()
|
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
if(WITH_LDAP)
|
|
|
|
check_include_files(ldap.h HAVE_LDAP_H)
|
|
|
|
check_library_exists(ldap ldap_bind "" HAVE_LIBLDAP)
|
|
|
|
check_include_files(lber.h HAVE_LBER_H)
|
|
|
|
check_library_exists(lber ber_printf "" HAVE_LIBLBER)
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_LDAP_H)
|
|
|
|
unset(HAVE_LIBLDAP)
|
|
|
|
unset(HAVE_LBER_H)
|
|
|
|
unset(HAVE_LIBLBER)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
2018-09-18 05:51:45 +00:00
|
|
|
if(WITH_PAM)
|
|
|
|
check_include_files(security/pam_appl.h HAVE_SECURITY_PAM_APPL_H)
|
|
|
|
check_library_exists(pam pam_start "" HAVE_PAM)
|
|
|
|
else()
|
|
|
|
unset(HAVE_SECURITY_PAM_APPL_H)
|
|
|
|
unset(HAVE_PAM)
|
|
|
|
endif()
|
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
if(WITH_LUA)
|
2016-01-03 14:48:09 +00:00
|
|
|
pkg_search_module(LUA REQUIRED lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1 lua)
|
2015-08-22 16:01:02 +00:00
|
|
|
message(STATUS "found lua at: INCDIR: ${LUA_INCLUDE_DIRS} LIBDIR: ${LUA_LIBRARY_DIRS} LDFLAGS: ${LUA_LDFLAGS} CFLAGS: ${LUA_CFLAGS}")
|
|
|
|
set(HAVE_LIBLUA 1 "Have liblua")
|
|
|
|
set(HAVE_LUA_H 1 "Have liblua header")
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_LIBLUA)
|
|
|
|
unset(HAVE_LUA_H)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_FAM)
|
|
|
|
check_include_files(fam.h HAVE_FAM_H)
|
|
|
|
check_library_exists(fam FAMOpen2 "" HAVE_LIBFAM)
|
|
|
|
if(HAVE_LIBFAM)
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES fam)
|
|
|
|
check_function_exists(FAMNoExists HAVE_FAMNOEXISTS)
|
|
|
|
endif()
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_FAM_H)
|
|
|
|
unset(HAVE_LIBFAM)
|
|
|
|
unset(HAVE_FAMNOEXISTS)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_GDBM)
|
|
|
|
check_include_files(gdbm.h HAVE_GDBM_H)
|
|
|
|
check_library_exists(gdbm gdbm_open "" HAVE_GDBM)
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_GDBM_H)
|
|
|
|
unset(HAVE_GDBM)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
2016-01-03 14:48:11 +00:00
|
|
|
if(WITH_MEMCACHED)
|
|
|
|
check_include_files(libmemcached/memcached.h HAVE_LIBMEMCACHED_MEMCACHED_H)
|
|
|
|
check_library_exists(memcached memcached "" HAVE_LIBMEMCACHED)
|
|
|
|
if(HAVE_LIBMEMCACHED_MEMCACHED_H AND HAVE_LIBMEMCACHED)
|
|
|
|
set(USE_MEMCACHED 1)
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "didn't find libmemcached")
|
|
|
|
endif()
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
2016-10-17 16:14:55 +00:00
|
|
|
if(WITH_GEOIP)
|
|
|
|
check_library_exists(geoip GeoIP_country_name_by_addr "" HAVE_GEOIP)
|
|
|
|
endif()
|
|
|
|
|
2019-05-20 04:53:20 +00:00
|
|
|
if(WITH_MAXMINDDB)
|
|
|
|
check_library_exists(maxminddb MMDB_open "" HAVE_MAXMINDDB)
|
|
|
|
endif()
|
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
if(NOT BUILD_STATIC)
|
|
|
|
check_include_files(dlfcn.h HAVE_DLFCN_H)
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_DLFCN_H)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_DLFCN_H)
|
|
|
|
check_library_exists(dl dlopen "" HAVE_LIBDL)
|
2015-08-22 16:01:05 +00:00
|
|
|
else()
|
2015-08-22 17:39:04 +00:00
|
|
|
unset(HAVE_LIBDL)
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(LIGHTTPD_VERSION_ID 10400)
|
|
|
|
set(PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
|
|
|
|
set(PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
|
|
|
|
|
|
|
|
if(NOT SBINDIR)
|
2015-08-22 16:01:05 +00:00
|
|
|
set(SBINDIR "sbin")
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT LIGHTTPD_MODULES_DIR)
|
2015-08-22 16:01:05 +00:00
|
|
|
set(LIGHTTPD_MODULES_DIR "lib${LIB_SUFFIX}/lighttpd")
|
2015-08-22 16:01:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
set(LIGHTTPD_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/${LIGHTTPD_MODULES_DIR}")
|
|
|
|
else()
|
2009-02-05 11:45:01 +00:00
|
|
|
## We use relative path in windows
|
2015-08-22 16:01:02 +00:00
|
|
|
set(LIGHTTPD_LIBRARY_DIR "lib")
|
|
|
|
endif()
|
2008-12-05 22:30:32 +00:00
|
|
|
|
|
|
|
## Write out config.h
|
2015-08-22 16:01:02 +00:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
2008-12-05 22:30:32 +00:00
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
add_definitions(-DHAVE_CONFIG_H)
|
2008-12-05 22:30:32 +00:00
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
2008-12-05 22:30:32 +00:00
|
|
|
|
2015-08-22 16:01:02 +00:00
|
|
|
set(COMMON_SRC
|
2018-05-01 04:20:26 +00:00
|
|
|
base64.c buffer.c burl.c log.c
|
2018-09-09 05:50:33 +00:00
|
|
|
http_header.c http_kv.c keyvalue.c chunk.c
|
[core] shared code for socket backends
common codebase for socket backends, based off mod_fastcgi with
some features added for mod_proxy
(mostly intended to reduce code duplication and enhance code isolation)
mod_fastcgi and mod_scgi can now use fastcgi.balance and scgi.balance
for similar behavior as proxy.balance, but the balancing is per-host
and not per-proc. proxy.balance is also per-host and not per-proc.
mod_proxy and mod_scgi can now use proxy.map-extensions and
scgi.map-extensions, similar to fastcgi.map-extensions.
mod_fastcgi behavior change (affects only mod_status):
- statistics tags have been renamed from "fastcgi.*" to "gw.*"
"fastcgi.backend.*" -> "gw.backend.*"
"fastcgi.active-requests" -> "gw.active-requests"
("fastcgi.requests" remains "fastcgi.requests")
("proxy.requests" is new)
("scgi.requests" is new)
mod_scgi behavior change (likely minor):
- removed scgi_proclist_sort_down() and scgi_proclist_sort_up().
procs now chosen based on load as measured by num socket connnections
Note:
modules using gw_backend.[ch] are currently still independent modules.
If it had been written as a single module with fastcgi, scgi, proxy
implementations, then there would have been a chance of breaking some
existing user configurations where module ordering made a difference
for which module handled a given request, though for most people, this
would have made no difference.
Details about mod_fastcgi code transformations:
unsigned int debug -> int debug
fastcgi_env member removed from plugin_config
renamed "fcgi" and "fastcgi" to "gw", and "FCGI" to "GW"
reorganize routines for high-level and lower-level interfaces
some lower-level internal interfaces changed to use host,proc,debug
args rather than knowing about higher-level (app) hctx and plugin_data
tabs->spaces and reformatting
2017-07-14 05:29:18 +00:00
|
|
|
http_chunk.c stream.c fdevent.c gw_backend.c
|
2019-10-04 06:10:02 +00:00
|
|
|
stat_cache.c plugin.c etag.c array.c
|
2016-09-15 05:50:29 +00:00
|
|
|
data_string.c data_array.c
|
2020-09-05 01:53:39 +00:00
|
|
|
data_integer.c
|
2020-09-05 03:47:19 +00:00
|
|
|
algo_md5.c algo_sha1.c algo_splaytree.c
|
2010-08-07 10:46:34 +00:00
|
|
|
fdevent_select.c fdevent_libev.c
|
2008-12-05 22:30:32 +00:00
|
|
|
fdevent_poll.c fdevent_linux_sysepoll.c
|
2011-07-30 09:16:03 +00:00
|
|
|
fdevent_solaris_devpoll.c fdevent_solaris_port.c
|
|
|
|
fdevent_freebsd_kqueue.c
|
2008-12-05 22:30:32 +00:00
|
|
|
connections-glue.c
|
|
|
|
configfile-glue.c
|
|
|
|
http-header-glue.c
|
2016-08-18 17:54:53 +00:00
|
|
|
http_auth.c
|
|