uringmachine 0.15 → 0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +3 -0
- data/.gitmodules +4 -0
- data/CHANGELOG.md +12 -0
- data/TODO.md +12 -3
- data/examples/bm_send.rb +86 -0
- data/ext/um/um.c +28 -1
- data/ext/um/um.h +3 -0
- data/ext/um/um_class.c +17 -0
- data/ext/um/um_stream_class.c +0 -1
- data/ext/um/um_utils.c +38 -15
- data/lib/uringmachine/version.rb +1 -1
- data/lib/uringmachine.rb +4 -3
- data/test/test_um.rb +76 -0
- data/vendor/libressl/.github/scripts/changelog.sh +74 -0
- data/vendor/libressl/.github/workflows/android.yml +35 -0
- data/vendor/libressl/.github/workflows/cifuzz.yml +33 -0
- data/vendor/libressl/.github/workflows/cmake-config.yml +98 -0
- data/vendor/libressl/.github/workflows/coverity.yml +69 -0
- data/vendor/libressl/.github/workflows/emscripten.yml +71 -0
- data/vendor/libressl/.github/workflows/fedora-rawhide.yml +39 -0
- data/vendor/libressl/.github/workflows/freebsd.yml +71 -0
- data/vendor/libressl/.github/workflows/linux.yml +71 -0
- data/vendor/libressl/.github/workflows/macos.yml +37 -0
- data/vendor/libressl/.github/workflows/release.yml +81 -0
- data/vendor/libressl/.github/workflows/rust-openssl.yml +47 -0
- data/vendor/libressl/.github/workflows/solaris.yml +37 -0
- data/vendor/libressl/.github/workflows/windows.yml +70 -0
- data/vendor/libressl/.gitignore +333 -0
- data/vendor/libressl/CMakeLists.txt +581 -0
- data/vendor/libressl/COPYING +133 -0
- data/vendor/libressl/ChangeLog +3280 -0
- data/vendor/libressl/FindLibreSSL.cmake +232 -0
- data/vendor/libressl/LibreSSLConfig.cmake.in +36 -0
- data/vendor/libressl/Makefile.am +60 -0
- data/vendor/libressl/Makefile.am.common +20 -0
- data/vendor/libressl/OPENBSD_BRANCH +1 -0
- data/vendor/libressl/README.md +238 -0
- data/vendor/libressl/README.mingw.md +43 -0
- data/vendor/libressl/apps/CMakeLists.txt +18 -0
- data/vendor/libressl/apps/Makefile.am +5 -0
- data/vendor/libressl/apps/nc/CMakeLists.txt +67 -0
- data/vendor/libressl/apps/nc/Makefile.am +64 -0
- data/vendor/libressl/apps/nc/compat/accept4.c +17 -0
- data/vendor/libressl/apps/nc/compat/readpassphrase.c +205 -0
- data/vendor/libressl/apps/nc/compat/socket.c +29 -0
- data/vendor/libressl/apps/nc/compat/sys/socket.h +30 -0
- data/vendor/libressl/apps/ocspcheck/CMakeLists.txt +44 -0
- data/vendor/libressl/apps/ocspcheck/Makefile.am +45 -0
- data/vendor/libressl/apps/ocspcheck/compat/.gitignore +0 -0
- data/vendor/libressl/apps/openssl/CMakeLists.txt +97 -0
- data/vendor/libressl/apps/openssl/Makefile.am +108 -0
- data/vendor/libressl/apps/openssl/apps_win.c +138 -0
- data/vendor/libressl/apps/openssl/certhash_win.c +13 -0
- data/vendor/libressl/apps/openssl/compat/clock_gettime_osx.c +26 -0
- data/vendor/libressl/apps/openssl/compat/poll_win.c +329 -0
- data/vendor/libressl/appveyor.yml +53 -0
- data/vendor/libressl/autogen.sh +15 -0
- data/vendor/libressl/check-release.sh +86 -0
- data/vendor/libressl/cmake_export_symbol.cmake +71 -0
- data/vendor/libressl/cmake_uninstall.cmake.in +36 -0
- data/vendor/libressl/config +17 -0
- data/vendor/libressl/configure.ac +165 -0
- data/vendor/libressl/crypto/CMakeLists.txt +863 -0
- data/vendor/libressl/crypto/Makefile.am +962 -0
- data/vendor/libressl/crypto/Makefile.am.arc4random +46 -0
- data/vendor/libressl/crypto/Makefile.am.elf-mips +14 -0
- data/vendor/libressl/crypto/Makefile.am.elf-mips64 +14 -0
- data/vendor/libressl/crypto/Makefile.am.elf-x86_64 +35 -0
- data/vendor/libressl/crypto/Makefile.am.macosx-x86_64 +35 -0
- data/vendor/libressl/crypto/Makefile.am.masm-x86_64 +22 -0
- data/vendor/libressl/crypto/Makefile.am.mingw64-x86_64 +23 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_darwin.c +60 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_linux.c +62 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_none.c +26 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_windows.c +36 -0
- data/vendor/libressl/crypto/arch/loongarch64/crypto_arch.h +21 -0
- data/vendor/libressl/crypto/arch/mips/crypto_arch.h +21 -0
- data/vendor/libressl/crypto/bn/arch/loongarch64/bn_arch.h +23 -0
- data/vendor/libressl/crypto/bn/arch/mips/bn_arch.h +24 -0
- data/vendor/libressl/crypto/compat/.gitignore +31 -0
- data/vendor/libressl/crypto/compat/arc4random.h +41 -0
- data/vendor/libressl/crypto/compat/b_win.c +55 -0
- data/vendor/libressl/crypto/compat/bsd-asprintf.c +96 -0
- data/vendor/libressl/crypto/compat/crypto_lock_win.c +56 -0
- data/vendor/libressl/crypto/compat/explicit_bzero_win.c +13 -0
- data/vendor/libressl/crypto/compat/freezero.c +32 -0
- data/vendor/libressl/crypto/compat/getdelim.c +78 -0
- data/vendor/libressl/crypto/compat/getline.c +40 -0
- data/vendor/libressl/crypto/compat/getopt_long.c +528 -0
- data/vendor/libressl/crypto/compat/getpagesize.c +18 -0
- data/vendor/libressl/crypto/compat/getprogname_linux.c +23 -0
- data/vendor/libressl/crypto/compat/getprogname_unimpl.c +7 -0
- data/vendor/libressl/crypto/compat/getprogname_windows.c +13 -0
- data/vendor/libressl/crypto/compat/posix_win.c +296 -0
- data/vendor/libressl/crypto/compat/syslog_r.c +19 -0
- data/vendor/libressl/crypto/compat/ui_openssl_win.c +334 -0
- data/vendor/libressl/dist.sh +22 -0
- data/vendor/libressl/gen-coverage-report.sh +58 -0
- data/vendor/libressl/gen-openbsd-tags.sh +20 -0
- data/vendor/libressl/include/CMakeLists.txt +61 -0
- data/vendor/libressl/include/Makefile.am +79 -0
- data/vendor/libressl/include/arch/loongarch64/opensslconf.h +150 -0
- data/vendor/libressl/include/arch/mips/opensslconf.h +150 -0
- data/vendor/libressl/include/compat/arpa/inet.h +15 -0
- data/vendor/libressl/include/compat/arpa/nameser.h +25 -0
- data/vendor/libressl/include/compat/cet.h +19 -0
- data/vendor/libressl/include/compat/dirent.h +17 -0
- data/vendor/libressl/include/compat/dirent_msvc.h +611 -0
- data/vendor/libressl/include/compat/endian.h +161 -0
- data/vendor/libressl/include/compat/err.h +95 -0
- data/vendor/libressl/include/compat/fcntl.h +32 -0
- data/vendor/libressl/include/compat/getopt.h +50 -0
- data/vendor/libressl/include/compat/limits.h +25 -0
- data/vendor/libressl/include/compat/netdb.h +10 -0
- data/vendor/libressl/include/compat/netinet/in.h +19 -0
- data/vendor/libressl/include/compat/netinet/ip.h +49 -0
- data/vendor/libressl/include/compat/netinet/tcp.h +10 -0
- data/vendor/libressl/include/compat/poll.h +63 -0
- data/vendor/libressl/include/compat/pthread.h +122 -0
- data/vendor/libressl/include/compat/readpassphrase.h +44 -0
- data/vendor/libressl/include/compat/resolv.h +24 -0
- data/vendor/libressl/include/compat/stdint.h +31 -0
- data/vendor/libressl/include/compat/stdio.h +65 -0
- data/vendor/libressl/include/compat/stdlib.h +57 -0
- data/vendor/libressl/include/compat/string.h +98 -0
- data/vendor/libressl/include/compat/sys/_null.h +18 -0
- data/vendor/libressl/include/compat/sys/ioctl.h +11 -0
- data/vendor/libressl/include/compat/sys/mman.h +19 -0
- data/vendor/libressl/include/compat/sys/param.h +15 -0
- data/vendor/libressl/include/compat/sys/queue.h +536 -0
- data/vendor/libressl/include/compat/sys/select.h +10 -0
- data/vendor/libressl/include/compat/sys/socket.h +18 -0
- data/vendor/libressl/include/compat/sys/stat.h +129 -0
- data/vendor/libressl/include/compat/sys/time.h +37 -0
- data/vendor/libressl/include/compat/sys/tree.h +1006 -0
- data/vendor/libressl/include/compat/sys/types.h +69 -0
- data/vendor/libressl/include/compat/sys/uio.h +17 -0
- data/vendor/libressl/include/compat/syslog.h +38 -0
- data/vendor/libressl/include/compat/time.h +59 -0
- data/vendor/libressl/include/compat/unistd.h +83 -0
- data/vendor/libressl/include/compat/win32netcompat.h +57 -0
- data/vendor/libressl/include/openssl/Makefile.am.tpl +45 -0
- data/vendor/libressl/libcrypto.pc.in +28 -0
- data/vendor/libressl/libressl.pub +2 -0
- data/vendor/libressl/libssl.pc.in +28 -0
- data/vendor/libressl/libtls.pc.in +28 -0
- data/vendor/libressl/m4/ax_add_fortify_source.m4 +80 -0
- data/vendor/libressl/m4/ax_check_compile_flag.m4 +53 -0
- data/vendor/libressl/m4/check-hardening-options.m4 +110 -0
- data/vendor/libressl/m4/check-libc.m4 +189 -0
- data/vendor/libressl/m4/check-os-options.m4 +181 -0
- data/vendor/libressl/m4/disable-compiler-warnings.m4 +44 -0
- data/vendor/libressl/man/CMakeLists.txt +26 -0
- data/vendor/libressl/man/links +2780 -0
- data/vendor/libressl/man/update_links.sh +25 -0
- data/vendor/libressl/openssl.pc.in +11 -0
- data/vendor/libressl/patches/bn_shift.patch +34 -0
- data/vendor/libressl/patches/crypto_arch.h.patch +34 -0
- data/vendor/libressl/patches/crypto_namespace.h.patch +22 -0
- data/vendor/libressl/patches/netcat.c.patch +178 -0
- data/vendor/libressl/patches/openssl.c.patch +12 -0
- data/vendor/libressl/patches/opensslfeatures.h.patch +49 -0
- data/vendor/libressl/patches/patch-amd64-crypto-cpu-caps.c.patch +20 -0
- data/vendor/libressl/patches/patch-i386-crypto-cpu-caps.c.patch +20 -0
- data/vendor/libressl/patches/speed.c.patch +114 -0
- data/vendor/libressl/patches/ssl_namespace.h.patch +21 -0
- data/vendor/libressl/patches/tls.h.patch +16 -0
- data/vendor/libressl/patches/tls_config.c.patch +15 -0
- data/vendor/libressl/patches/win32_amd64_bn_arch.h.patch +28 -0
- data/vendor/libressl/patches/windows_headers.patch +80 -0
- data/vendor/libressl/scripts/config.guess +1774 -0
- data/vendor/libressl/scripts/config.sub +1907 -0
- data/vendor/libressl/scripts/i686-w64-mingw32.cmake +9 -0
- data/vendor/libressl/scripts/test +210 -0
- data/vendor/libressl/scripts/wrap-compiler-for-flag-check +31 -0
- data/vendor/libressl/scripts/x86_64-w64-mingw32.cmake +9 -0
- data/vendor/libressl/ssl/CMakeLists.txt +183 -0
- data/vendor/libressl/ssl/Makefile.am +187 -0
- data/vendor/libressl/tests/CMakeLists.txt +970 -0
- data/vendor/libressl/tests/Makefile.am +944 -0
- data/vendor/libressl/tests/aeadtest.sh +30 -0
- data/vendor/libressl/tests/arc4randomforktest.sh +21 -0
- data/vendor/libressl/tests/asn1time_small.test +10 -0
- data/vendor/libressl/tests/cmake/CMakeLists.txt +52 -0
- data/vendor/libressl/tests/cmake/crypto.c +7 -0
- data/vendor/libressl/tests/cmake/ssl.c +6 -0
- data/vendor/libressl/tests/cmake/tls.c +6 -0
- data/vendor/libressl/tests/compat/pipe2.c +186 -0
- data/vendor/libressl/tests/dtlstest.sh +28 -0
- data/vendor/libressl/tests/evptest.sh +22 -0
- data/vendor/libressl/tests/keypairtest.sh +27 -0
- data/vendor/libressl/tests/mlkem_tests.sh +39 -0
- data/vendor/libressl/tests/ocsptest.bat +25 -0
- data/vendor/libressl/tests/ocsptest.sh +23 -0
- data/vendor/libressl/tests/openssl.cnf +29 -0
- data/vendor/libressl/tests/optionstest.c +381 -0
- data/vendor/libressl/tests/pidwraptest.c +85 -0
- data/vendor/libressl/tests/pidwraptest.sh +26 -0
- data/vendor/libressl/tests/quictest.bat +27 -0
- data/vendor/libressl/tests/quictest.sh +30 -0
- data/vendor/libressl/tests/renegotiation_test.bat +27 -0
- data/vendor/libressl/tests/renegotiation_test.sh +30 -0
- data/vendor/libressl/tests/rfc5280time_small.test +10 -0
- data/vendor/libressl/tests/servertest.bat +27 -0
- data/vendor/libressl/tests/servertest.sh +30 -0
- data/vendor/libressl/tests/shutdowntest.bat +27 -0
- data/vendor/libressl/tests/shutdowntest.sh +30 -0
- data/vendor/libressl/tests/ssltest.bat +32 -0
- data/vendor/libressl/tests/ssltest.sh +48 -0
- data/vendor/libressl/tests/testdsa.bat +47 -0
- data/vendor/libressl/tests/testdsa.sh +57 -0
- data/vendor/libressl/tests/testenc.bat +85 -0
- data/vendor/libressl/tests/testenc.sh +93 -0
- data/vendor/libressl/tests/testrsa.bat +47 -0
- data/vendor/libressl/tests/testrsa.sh +57 -0
- data/vendor/libressl/tests/testssl.bat +171 -0
- data/vendor/libressl/tests/tlstest.bat +27 -0
- data/vendor/libressl/tests/tlstest.sh +28 -0
- data/vendor/libressl/tls/CMakeLists.txt +125 -0
- data/vendor/libressl/tls/Makefile.am +76 -0
- data/vendor/libressl/tls/compat/ftruncate.c +17 -0
- data/vendor/libressl/tls/compat/pread.c +29 -0
- data/vendor/libressl/tls/compat/pwrite.c +29 -0
- data/vendor/libressl/update.sh +460 -0
- data/vendor/liburing/.github/workflows/ci.yml +8 -0
- data/vendor/liburing/configure +23 -2
- data/vendor/liburing/examples/helpers.c +1 -1
- data/vendor/liburing/examples/helpers.h +1 -1
- data/vendor/liburing/examples/reg-wait.c +3 -3
- data/vendor/liburing/examples/zcrx.c +5 -5
- data/vendor/liburing/liburing.spec +1 -1
- data/vendor/liburing/src/include/liburing/io_uring.h +16 -0
- data/vendor/liburing/src/include/liburing.h +20 -4
- data/vendor/liburing/src/lib.h +2 -4
- data/vendor/liburing/src/liburing-ffi.map +7 -0
- data/vendor/liburing/src/liburing.map +7 -0
- data/vendor/liburing/src/register.c +5 -0
- data/vendor/liburing/src/sanitize.c +5 -4
- data/vendor/liburing/src/setup.c +43 -28
- data/vendor/liburing/test/Makefile +7 -0
- data/vendor/liburing/test/cmd-discard.c +2 -2
- data/vendor/liburing/test/evfd-short-read.c +84 -0
- data/vendor/liburing/test/fdinfo-sqpoll.c +117 -0
- data/vendor/liburing/test/fdinfo.c +1 -1
- data/vendor/liburing/test/fixed-buf-merge.c +2 -2
- data/vendor/liburing/test/futex-kill.c +135 -0
- data/vendor/liburing/test/helpers.c +1 -1
- data/vendor/liburing/test/helpers.h +1 -1
- data/vendor/liburing/test/init-mem.c +50 -12
- data/vendor/liburing/test/io_uring_passthrough.c +25 -6
- data/vendor/liburing/test/msg-ring.c +123 -9
- data/vendor/liburing/test/recv-bundle-short-ooo.c +16 -1
- data/vendor/liburing/test/recv-inc-ooo.c +411 -0
- data/vendor/liburing/test/recv-mshot-fair.c +513 -0
- data/vendor/liburing/test/reg-wait.c +14 -14
- data/vendor/liburing/test/send-zerocopy.c +4 -4
- data/vendor/liburing/test/timerfd-short-read.c +81 -0
- data/vendor/liburing/test/timestamp.c +382 -0
- data/vendor/liburing/test/zcrx.c +22 -22
- metadata +222 -2
@@ -0,0 +1,581 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2014 Brent Cook
|
3
|
+
#
|
4
|
+
# Permission to use, copy, modify, and distribute this software for any
|
5
|
+
# purpose with or without fee is hereby granted, provided that the above
|
6
|
+
# copyright notice and this permission notice appear in all copies.
|
7
|
+
#
|
8
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
9
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
10
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
11
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
12
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
13
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
14
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
15
|
+
|
16
|
+
cmake_minimum_required (VERSION 3.16.4)
|
17
|
+
|
18
|
+
if(MSVC)
|
19
|
+
cmake_policy(SET CMP0091 NEW)
|
20
|
+
endif()
|
21
|
+
|
22
|
+
project(LibreSSL LANGUAGES C ASM)
|
23
|
+
|
24
|
+
include(CheckFunctionExists)
|
25
|
+
include(CheckSymbolExists)
|
26
|
+
include(CheckLibraryExists)
|
27
|
+
include(CheckIncludeFiles)
|
28
|
+
include(CheckTypeSize)
|
29
|
+
|
30
|
+
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH})
|
31
|
+
include(cmake_export_symbol)
|
32
|
+
include(GNUInstallDirs)
|
33
|
+
|
34
|
+
enable_testing()
|
35
|
+
|
36
|
+
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/ssl/VERSION SSL_VERSION)
|
37
|
+
string(STRIP ${SSL_VERSION} SSL_VERSION)
|
38
|
+
string(REPLACE ":" "." SSL_VERSION ${SSL_VERSION})
|
39
|
+
string(REGEX REPLACE "\\..*" "" SSL_MAJOR_VERSION ${SSL_VERSION})
|
40
|
+
|
41
|
+
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/crypto/VERSION CRYPTO_VERSION)
|
42
|
+
string(STRIP ${CRYPTO_VERSION} CRYPTO_VERSION)
|
43
|
+
string(REPLACE ":" "." CRYPTO_VERSION ${CRYPTO_VERSION})
|
44
|
+
string(REGEX REPLACE "\\..*" "" CRYPTO_MAJOR_VERSION ${CRYPTO_VERSION})
|
45
|
+
|
46
|
+
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/tls/VERSION TLS_VERSION)
|
47
|
+
string(STRIP ${TLS_VERSION} TLS_VERSION)
|
48
|
+
string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION})
|
49
|
+
string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION})
|
50
|
+
|
51
|
+
option(LIBRESSL_SKIP_INSTALL "Skip installation" ${LIBRESSL_SKIP_INSTALL})
|
52
|
+
option(LIBRESSL_APPS "Build apps" ON)
|
53
|
+
option(LIBRESSL_TESTS "Build tests" ON)
|
54
|
+
option(ENABLE_ASM "Enable assembly" ON)
|
55
|
+
option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF)
|
56
|
+
option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF)
|
57
|
+
set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE)
|
58
|
+
set(LIBRESSL_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/LibreSSL" CACHE STRING "Installation directory for the CMake targets")
|
59
|
+
|
60
|
+
option(USE_STATIC_MSVC_RUNTIMES "Use /MT instead of /MD in MSVC" OFF)
|
61
|
+
if(USE_STATIC_MSVC_RUNTIMES)
|
62
|
+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
63
|
+
endif()
|
64
|
+
|
65
|
+
if(NOT LIBRESSL_SKIP_INSTALL)
|
66
|
+
set( ENABLE_LIBRESSL_INSTALL ON )
|
67
|
+
endif(NOT LIBRESSL_SKIP_INSTALL)
|
68
|
+
|
69
|
+
# Set a default build type if none was specified
|
70
|
+
set(default_build_type "Release")
|
71
|
+
|
72
|
+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
73
|
+
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
74
|
+
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
|
75
|
+
STRING "Choose the type of build." FORCE)
|
76
|
+
# Set the possible values of build type for cmake-gui
|
77
|
+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
78
|
+
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
79
|
+
endif()
|
80
|
+
|
81
|
+
# Do not disable assertions based on CMAKE_BUILD_TYPE
|
82
|
+
foreach(_build_type "Release" "MinSizeRel" "RelWithDebInfo")
|
83
|
+
foreach(_lang C CXX)
|
84
|
+
string(TOUPPER "CMAKE_${_lang}_FLAGS_${_build_type}" _var)
|
85
|
+
string(REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " " ${_var} "${${_var}}")
|
86
|
+
endforeach()
|
87
|
+
endforeach()
|
88
|
+
|
89
|
+
set(BUILD_NC true)
|
90
|
+
|
91
|
+
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
92
|
+
add_definitions(-DHAVE_ATTRIBUTE__BOUNDED__)
|
93
|
+
add_definitions(-DHAVE_ATTRIBUTE__DEAD__)
|
94
|
+
endif()
|
95
|
+
|
96
|
+
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
97
|
+
add_definitions(-D_DEFAULT_SOURCE)
|
98
|
+
add_definitions(-D_BSD_SOURCE)
|
99
|
+
add_definitions(-D_POSIX_SOURCE)
|
100
|
+
add_definitions(-D_GNU_SOURCE)
|
101
|
+
set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread)
|
102
|
+
endif()
|
103
|
+
|
104
|
+
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
105
|
+
set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread)
|
106
|
+
endif()
|
107
|
+
|
108
|
+
if(WIN32)
|
109
|
+
set(BUILD_NC false)
|
110
|
+
if(MINGW)
|
111
|
+
add_definitions(-D_GNU_SOURCE)
|
112
|
+
add_definitions(-D_POSIX)
|
113
|
+
add_definitions(-D_POSIX_SOURCE)
|
114
|
+
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
115
|
+
endif()
|
116
|
+
endif()
|
117
|
+
|
118
|
+
if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
|
119
|
+
if(CMAKE_C_COMPILER MATCHES "gcc")
|
120
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fno-strict-aliasing")
|
121
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlp64")
|
122
|
+
else()
|
123
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} +DD64 +Otype_safety=off")
|
124
|
+
endif()
|
125
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT")
|
126
|
+
set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread)
|
127
|
+
endif()
|
128
|
+
|
129
|
+
if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
130
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fno-strict-aliasing")
|
131
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
|
132
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600")
|
133
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBSD_COMP")
|
134
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic")
|
135
|
+
set(PLATFORM_LIBS ${PLATFORM_LIBS} dl md nsl socket)
|
136
|
+
endif()
|
137
|
+
|
138
|
+
add_definitions(-DLIBRESSL_INTERNAL)
|
139
|
+
add_definitions(-DOPENSSL_NO_HW_PADLOCK)
|
140
|
+
add_definitions(-D__BEGIN_HIDDEN_DECLS=)
|
141
|
+
add_definitions(-D__END_HIDDEN_DECLS=)
|
142
|
+
|
143
|
+
set(CMAKE_POSITION_INDEPENDENT_CODE true)
|
144
|
+
|
145
|
+
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
146
|
+
add_compile_options(-Wno-pointer-sign)
|
147
|
+
endif()
|
148
|
+
|
149
|
+
if(WIN32)
|
150
|
+
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
151
|
+
add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS)
|
152
|
+
add_definitions(-D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS)
|
153
|
+
add_definitions(-DNO_SYSLOG)
|
154
|
+
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
155
|
+
if(NOT CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
|
156
|
+
add_definitions(-D_WIN32_WINNT=0x0600)
|
157
|
+
endif()
|
158
|
+
set(PLATFORM_LIBS ${PLATFORM_LIBS} ws2_32 ntdll bcrypt)
|
159
|
+
endif()
|
160
|
+
|
161
|
+
if(MSVC)
|
162
|
+
add_definitions(-Dinline=__inline)
|
163
|
+
message(STATUS "Using [${CMAKE_C_COMPILER_ID}] compiler")
|
164
|
+
|
165
|
+
include(TestBigEndian)
|
166
|
+
TEST_BIG_ENDIAN(HAVE_BIG_ENDIAN)
|
167
|
+
if(HAVE_BIG_ENDIAN)
|
168
|
+
add_definitions(-DHAVE_BIG_ENDIAN)
|
169
|
+
else()
|
170
|
+
add_definitions(-DHAVE_LITTLE_ENDIAN)
|
171
|
+
endif()
|
172
|
+
|
173
|
+
if(CMAKE_C_COMPILER_ID MATCHES "MSVC" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
174
|
+
set(MSVC_DISABLED_WARNINGS_LIST
|
175
|
+
"C4018" # 'expression' : signed/unsigned mismatch
|
176
|
+
"C4057" # 'operator' : 'identifier1' indirection to
|
177
|
+
# slightly different base types from 'identifier2'
|
178
|
+
"C4100" # 'identifier' : unreferenced formal parameter
|
179
|
+
"C4127" # conditional expression is constant
|
180
|
+
"C4132" # 'object' : const object should be initialized
|
181
|
+
"C4146" # unary minus operator applied to unsigned type,
|
182
|
+
# result still unsigned
|
183
|
+
"C4206" # nonstandard extension used : translation unit is empty
|
184
|
+
"C4244" # 'argument' : conversion from 'type1' to 'type2',
|
185
|
+
# possible loss of data
|
186
|
+
"C4245" # 'conversion' : conversion from 'type1' to 'type2',
|
187
|
+
# signed/unsigned mismatch
|
188
|
+
"C4267" # 'var' : conversion from 'size_t' to 'type',
|
189
|
+
# possible loss of data
|
190
|
+
"C4295" # 'array' : array is too small to include a terminating
|
191
|
+
# null character
|
192
|
+
"C4389" # 'operator' : signed/unsigned mismatch
|
193
|
+
"C4706" # assignment within conditional expression
|
194
|
+
"C4996" # The POSIX name for this item is deprecated.
|
195
|
+
# Instead, use the ISO C and C++ conformant name
|
196
|
+
)
|
197
|
+
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
198
|
+
add_definitions(-D_CRT_SUPPRESS_RESTRICT)
|
199
|
+
set(MSVC_DISABLED_WARNINGS_LIST
|
200
|
+
"C111" # Unreachable statement
|
201
|
+
"C128" # Unreachable loop
|
202
|
+
"C167" # Unexplict casting unsigned to signed
|
203
|
+
"C186" # Pointless comparison of unsigned int with zero
|
204
|
+
"C188" # Enumerated type mixed with another type
|
205
|
+
"C344" # Redeclared type
|
206
|
+
"C556" # Unexplict casting signed to unsigned
|
207
|
+
"C869" # Unreferenced parameters
|
208
|
+
"C1786" # Deprecated functions
|
209
|
+
"C2545" # Empty else statement
|
210
|
+
"C2557" # Comparing signed to unsigned
|
211
|
+
"C2722" # List init syntax is c++11 feature
|
212
|
+
"C3280" # Declaration hides variable
|
213
|
+
)
|
214
|
+
endif()
|
215
|
+
string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR
|
216
|
+
${MSVC_DISABLED_WARNINGS_LIST})
|
217
|
+
string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
218
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MP -W4 ${MSVC_DISABLED_WARNINGS_STR}")
|
219
|
+
else()
|
220
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
221
|
+
endif()
|
222
|
+
|
223
|
+
# XXX - needs _GNU_SOURCE on linux
|
224
|
+
check_function_exists(asprintf HAVE_ASPRINTF)
|
225
|
+
if(HAVE_ASPRINTF)
|
226
|
+
add_definitions(-DHAVE_ASPRINTF)
|
227
|
+
endif()
|
228
|
+
|
229
|
+
check_symbol_exists(getdelim "stdio.h" HAVE_GETDELIM)
|
230
|
+
if(HAVE_GETDELIM)
|
231
|
+
add_definitions(-DHAVE_GETDELIM)
|
232
|
+
endif()
|
233
|
+
|
234
|
+
check_symbol_exists(getline "stdio.h" HAVE_GETLINE)
|
235
|
+
if(HAVE_GETLINE)
|
236
|
+
add_definitions(-DHAVE_GETLINE)
|
237
|
+
endif()
|
238
|
+
|
239
|
+
check_symbol_exists(getopt "unistd.h" HAVE_GETOPT)
|
240
|
+
if(HAVE_GETOPT)
|
241
|
+
add_definitions(-DHAVE_GETOPT)
|
242
|
+
endif()
|
243
|
+
|
244
|
+
check_symbol_exists(reallocarray "stdlib.h" HAVE_REALLOCARRAY)
|
245
|
+
if(HAVE_REALLOCARRAY)
|
246
|
+
add_definitions(-DHAVE_REALLOCARRAY)
|
247
|
+
endif()
|
248
|
+
|
249
|
+
# XXX strcasecmp() is in strings.h which isn't available everywhere
|
250
|
+
check_function_exists(strcasecmp HAVE_STRCASECMP)
|
251
|
+
if(HAVE_STRCASECMP)
|
252
|
+
add_definitions(-DHAVE_STRCASECMP)
|
253
|
+
endif()
|
254
|
+
|
255
|
+
# Emscripten's strlcat and strlcpy triggers ASAN errors
|
256
|
+
if(NOT EMSCRIPTEN)
|
257
|
+
check_symbol_exists(strlcat "string.h" HAVE_STRLCAT)
|
258
|
+
if(HAVE_STRLCAT)
|
259
|
+
add_definitions(-DHAVE_STRLCAT)
|
260
|
+
endif()
|
261
|
+
|
262
|
+
check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
|
263
|
+
if(HAVE_STRLCPY)
|
264
|
+
add_definitions(-DHAVE_STRLCPY)
|
265
|
+
endif()
|
266
|
+
endif()
|
267
|
+
|
268
|
+
check_symbol_exists(strndup "string.h" HAVE_STRNDUP)
|
269
|
+
if(HAVE_STRNDUP)
|
270
|
+
add_definitions(-DHAVE_STRNDUP)
|
271
|
+
endif()
|
272
|
+
|
273
|
+
if(WIN32)
|
274
|
+
set(HAVE_STRNLEN true)
|
275
|
+
add_definitions(-DHAVE_STRNLEN)
|
276
|
+
else()
|
277
|
+
check_symbol_exists(strnlen "string.h" HAVE_STRNLEN)
|
278
|
+
if(HAVE_STRNLEN)
|
279
|
+
add_definitions(-DHAVE_STRNLEN)
|
280
|
+
endif()
|
281
|
+
endif()
|
282
|
+
|
283
|
+
check_symbol_exists(strsep "string.h" HAVE_STRSEP)
|
284
|
+
if(HAVE_STRSEP)
|
285
|
+
add_definitions(-DHAVE_STRSEP)
|
286
|
+
endif()
|
287
|
+
|
288
|
+
check_symbol_exists(strtonum "stdlib.h" HAVE_STRTONUM)
|
289
|
+
if(HAVE_STRTONUM)
|
290
|
+
add_definitions(-DHAVE_STRTONUM)
|
291
|
+
endif()
|
292
|
+
|
293
|
+
check_symbol_exists(arc4random_buf "stdlib.h" HAVE_ARC4RANDOM_BUF)
|
294
|
+
if(HAVE_ARC4RANDOM_BUF)
|
295
|
+
add_definitions(-DHAVE_ARC4RANDOM_BUF)
|
296
|
+
endif()
|
297
|
+
|
298
|
+
check_symbol_exists(arc4random_uniform "stdlib.h" HAVE_ARC4RANDOM_UNIFORM)
|
299
|
+
if(HAVE_ARC4RANDOM_UNIFORM)
|
300
|
+
add_definitions(-DHAVE_ARC4RANDOM_UNIFORM)
|
301
|
+
endif()
|
302
|
+
|
303
|
+
check_symbol_exists(explicit_bzero "string.h" HAVE_EXPLICIT_BZERO)
|
304
|
+
if(HAVE_EXPLICIT_BZERO)
|
305
|
+
add_definitions(-DHAVE_EXPLICIT_BZERO)
|
306
|
+
endif()
|
307
|
+
|
308
|
+
check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL)
|
309
|
+
if(HAVE_GETAUXVAL)
|
310
|
+
add_definitions(-DHAVE_GETAUXVAL)
|
311
|
+
endif()
|
312
|
+
|
313
|
+
# XXX macos fails to find getentropy with check_symbol_exists()
|
314
|
+
check_function_exists(getentropy HAVE_GETENTROPY)
|
315
|
+
if(HAVE_GETENTROPY)
|
316
|
+
add_definitions(-DHAVE_GETENTROPY)
|
317
|
+
endif()
|
318
|
+
|
319
|
+
check_symbol_exists(getpagesize "unistd.h" HAVE_GETPAGESIZE)
|
320
|
+
if(HAVE_GETPAGESIZE)
|
321
|
+
add_definitions(-DHAVE_GETPAGESIZE)
|
322
|
+
endif()
|
323
|
+
|
324
|
+
check_symbol_exists(getprogname "stdlib.h" HAVE_GETPROGNAME)
|
325
|
+
if(HAVE_GETPROGNAME)
|
326
|
+
add_definitions(-DHAVE_GETPROGNAME)
|
327
|
+
endif()
|
328
|
+
|
329
|
+
check_symbol_exists(syslog_r "syslog.h;stdarg.h" HAVE_SYSLOG_R)
|
330
|
+
if(HAVE_SYSLOG_R)
|
331
|
+
add_definitions(-DHAVE_SYSLOG_R)
|
332
|
+
endif()
|
333
|
+
|
334
|
+
# XXX - needs _GNU_SOURCE on linux
|
335
|
+
check_function_exists(syslog HAVE_SYSLOG)
|
336
|
+
if(HAVE_SYSLOG)
|
337
|
+
add_definitions(-DHAVE_SYSLOG)
|
338
|
+
endif()
|
339
|
+
|
340
|
+
check_symbol_exists(timespecsub sys/time.h HAVE_TIMESPECSUB)
|
341
|
+
if(HAVE_TIMESPECSUB)
|
342
|
+
add_definitions(-DHAVE_TIMESPECSUB)
|
343
|
+
endif()
|
344
|
+
|
345
|
+
check_symbol_exists(timingsafe_bcmp "string.h" HAVE_TIMINGSAFE_BCMP)
|
346
|
+
if(HAVE_TIMINGSAFE_BCMP)
|
347
|
+
add_definitions(-DHAVE_TIMINGSAFE_BCMP)
|
348
|
+
endif()
|
349
|
+
|
350
|
+
check_symbol_exists(timingsafe_memcmp "string.h" HAVE_TIMINGSAFE_MEMCMP)
|
351
|
+
if(HAVE_TIMINGSAFE_MEMCMP)
|
352
|
+
add_definitions(-DHAVE_TIMINGSAFE_MEMCMP)
|
353
|
+
endif()
|
354
|
+
|
355
|
+
# XXX - needs _GNU_SOURCE on linux
|
356
|
+
check_function_exists(memmem HAVE_MEMMEM)
|
357
|
+
if(HAVE_MEMMEM)
|
358
|
+
add_definitions(-DHAVE_MEMMEM)
|
359
|
+
endif()
|
360
|
+
|
361
|
+
check_include_files(endian.h HAVE_ENDIAN_H)
|
362
|
+
if(HAVE_ENDIAN_H)
|
363
|
+
add_definitions(-DHAVE_ENDIAN_H)
|
364
|
+
endif()
|
365
|
+
|
366
|
+
check_include_files(machine/endian.h HAVE_MACHINE_ENDIAN_H)
|
367
|
+
if(HAVE_MACHINE_ENDIAN_H)
|
368
|
+
add_definitions(-DHAVE_MACHINE_ENDIAN_H)
|
369
|
+
endif()
|
370
|
+
|
371
|
+
check_include_files(err.h HAVE_ERR_H)
|
372
|
+
if(HAVE_ERR_H)
|
373
|
+
add_definitions(-DHAVE_ERR_H)
|
374
|
+
endif()
|
375
|
+
|
376
|
+
check_include_files("sys/types.h;arpa/inet.h;netinet/ip.h" HAVE_NETINET_IP_H)
|
377
|
+
if(HAVE_NETINET_IP_H)
|
378
|
+
add_definitions(-DHAVE_NETINET_IP_H)
|
379
|
+
endif()
|
380
|
+
|
381
|
+
# This isn't ready for universal binaries yet, since we do conditional
|
382
|
+
# compilation based on the architecture, but this makes cross compiling for a
|
383
|
+
# single architecture work on macOS at least.
|
384
|
+
#
|
385
|
+
# Don't set CMAKE_OSX_ARCHITECTURES to more than a single value for now.
|
386
|
+
if(APPLE AND (NOT CMAKE_OSX_ARCHITECTURES STREQUAL ""))
|
387
|
+
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}")
|
388
|
+
endif()
|
389
|
+
|
390
|
+
# CMAKE_SYSTEM_PROCESSOR is not consistently set to the target architecture.
|
391
|
+
# https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_PROCESSOR.html
|
392
|
+
if (WIN32 AND (NOT CMAKE_GENERATOR_PLATFORM STREQUAL ""))
|
393
|
+
message("CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
|
394
|
+
message("CMAKE_GENERATOR_PLATFORM: ${CMAKE_GENERATOR_PLATFORM}")
|
395
|
+
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_GENERATOR_PLATFORM}")
|
396
|
+
endif()
|
397
|
+
|
398
|
+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64|arm64|ARM64)")
|
399
|
+
set(HOST_AARCH64 true)
|
400
|
+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
|
401
|
+
set(HOST_ARM true)
|
402
|
+
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
|
403
|
+
set(HOST_X86_64 true)
|
404
|
+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|x64|amd64|AMD64)")
|
405
|
+
set(HOST_X86_64 true)
|
406
|
+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|[xX]86|Win32)")
|
407
|
+
set(ENABLE_ASM false)
|
408
|
+
set(HOST_I386 true)
|
409
|
+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64")
|
410
|
+
set(HOST_LOONGARCH64 true)
|
411
|
+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "mips64")
|
412
|
+
set(HOST_MIPS64 true)
|
413
|
+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "mips")
|
414
|
+
set(HOST_MIPS true)
|
415
|
+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
|
416
|
+
set(HOST_POWERPC true)
|
417
|
+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
|
418
|
+
set(HOST_POWERPC64 true)
|
419
|
+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64")
|
420
|
+
set(HOST_RISCV64 true)
|
421
|
+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "sparc64")
|
422
|
+
set(HOST_SPARC64 true)
|
423
|
+
else()
|
424
|
+
set(ENABLE_ASM false)
|
425
|
+
endif()
|
426
|
+
|
427
|
+
if(ENABLE_ASM)
|
428
|
+
if(CMAKE_C_COMPILER_ABI STREQUAL "ELF")
|
429
|
+
if(HOST_X86_64)
|
430
|
+
set(HOST_ASM_ELF_X86_64 true)
|
431
|
+
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND HOST_I386)
|
432
|
+
set(HOST_ASM_ELF_X86_64 true)
|
433
|
+
endif()
|
434
|
+
add_definitions(-DHAVE_GNU_STACK)
|
435
|
+
elseif(APPLE AND HOST_X86_64)
|
436
|
+
set(HOST_ASM_MACOSX_X86_64 true)
|
437
|
+
elseif(MSVC AND (CMAKE_GENERATOR MATCHES "Win64" OR CMAKE_GENERATOR_PLATFORM STREQUAL "x64"))
|
438
|
+
set(HOST_ASM_MASM_X86_64 true)
|
439
|
+
ENABLE_LANGUAGE(ASM_MASM)
|
440
|
+
elseif(MINGW AND HOST_X86_64)
|
441
|
+
set(HOST_ASM_MINGW64_X86_64 true)
|
442
|
+
endif()
|
443
|
+
endif()
|
444
|
+
|
445
|
+
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
446
|
+
# Check if we need -lrt to get clock_gettime on Linux
|
447
|
+
check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
|
448
|
+
if (HAVE_CLOCK_GETTIME)
|
449
|
+
set(PLATFORM_LIBS ${PLATFORM_LIBS} rt)
|
450
|
+
endif()
|
451
|
+
else()
|
452
|
+
# Otherwise, simply check if it exists
|
453
|
+
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
|
454
|
+
endif()
|
455
|
+
if(HAVE_CLOCK_GETTIME)
|
456
|
+
add_definitions(-DHAVE_CLOCK_GETTIME)
|
457
|
+
endif()
|
458
|
+
|
459
|
+
check_type_size(time_t SIZEOF_TIME_T)
|
460
|
+
if(SIZEOF_TIME_T STREQUAL "4")
|
461
|
+
set(SMALL_TIME_T true)
|
462
|
+
add_definitions(-DSMALL_TIME_T)
|
463
|
+
message(WARNING " ** Warning, this system is unable to represent times past 2038\n"
|
464
|
+
" ** It will behave incorrectly when handling valid RFC5280 dates")
|
465
|
+
endif()
|
466
|
+
|
467
|
+
set(OPENSSL_LIBS ssl crypto ${PLATFORM_LIBS})
|
468
|
+
set(LIBTLS_LIBS tls ${PLATFORM_LIBS})
|
469
|
+
|
470
|
+
# libraries for regression test
|
471
|
+
if(BUILD_SHARED_LIBS)
|
472
|
+
set(OPENSSL_TEST_LIBS ssl-static crypto-static ${PLATFORM_LIBS} compat_obj)
|
473
|
+
set(LIBTLS_TEST_LIBS tls-static ${OPENSSL_TEST_LIBS} tls_compat_obj)
|
474
|
+
else()
|
475
|
+
set(OPENSSL_TEST_LIBS ssl crypto ${PLATFORM_LIBS} compat_obj)
|
476
|
+
set(LIBTLS_TEST_LIBS tls ${PLATFORM_LIBS} compat_obj tls_compat_obj)
|
477
|
+
endif()
|
478
|
+
|
479
|
+
if(OPENSSLDIR STREQUAL "")
|
480
|
+
if(WIN32)
|
481
|
+
set(OPENSSLDIR "C:/Windows/libressl/ssl")
|
482
|
+
else()
|
483
|
+
set(OPENSSLDIR "${CMAKE_INSTALL_SYSCONFDIR}/ssl")
|
484
|
+
endif()
|
485
|
+
|
486
|
+
set(CONF_DIR "${CMAKE_INSTALL_SYSCONFDIR}/ssl")
|
487
|
+
else()
|
488
|
+
set(CONF_DIR "${OPENSSLDIR}")
|
489
|
+
endif()
|
490
|
+
|
491
|
+
add_subdirectory(include)
|
492
|
+
add_subdirectory(crypto)
|
493
|
+
add_subdirectory(ssl)
|
494
|
+
if(LIBRESSL_APPS)
|
495
|
+
add_subdirectory(apps)
|
496
|
+
endif()
|
497
|
+
add_subdirectory(tls)
|
498
|
+
if(NOT MSVC)
|
499
|
+
add_subdirectory(man)
|
500
|
+
endif()
|
501
|
+
# Tests require the openssl executable and are unavailable when building shared libraries
|
502
|
+
if(LIBRESSL_APPS AND LIBRESSL_TESTS)
|
503
|
+
add_subdirectory(tests)
|
504
|
+
endif()
|
505
|
+
|
506
|
+
if (BUILD_APPLE_XCFRAMEWORK)
|
507
|
+
# Create the super library from object libraries
|
508
|
+
add_library(LibreSSL_xcframework
|
509
|
+
$<TARGET_OBJECTS:crypto_obj> $<TARGET_OBJECTS:tls_obj> $<TARGET_OBJECTS:ssl_obj>)
|
510
|
+
set_target_properties(LibreSSL_xcframework PROPERTIES
|
511
|
+
OUTPUT_NAME ressl)
|
512
|
+
|
513
|
+
if(ENABLE_LIBRESSL_INSTALL)
|
514
|
+
install(TARGETS LibreSSL_xcframework
|
515
|
+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
516
|
+
endif(ENABLE_LIBRESSL_INSTALL)
|
517
|
+
endif(BUILD_APPLE_XCFRAMEWORK)
|
518
|
+
|
519
|
+
file(STRINGS "VERSION" VERSION LIMIT_COUNT 1)
|
520
|
+
include(CMakePackageConfigHelpers)
|
521
|
+
write_basic_package_version_file(
|
522
|
+
"LibreSSLConfigVersion.cmake"
|
523
|
+
VERSION "${VERSION}"
|
524
|
+
COMPATIBILITY SameMajorVersion
|
525
|
+
)
|
526
|
+
|
527
|
+
set(INCLUDE_DIRECTORY "${CMAKE_BINARY_DIR}/include")
|
528
|
+
configure_package_config_file(
|
529
|
+
"${CMAKE_CURRENT_LIST_DIR}/LibreSSLConfig.cmake.in"
|
530
|
+
"${CMAKE_CURRENT_BINARY_DIR}/LibreSSLConfig.cmake"
|
531
|
+
PATH_VARS INCLUDE_DIRECTORY
|
532
|
+
INSTALL_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
|
533
|
+
INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
|
534
|
+
)
|
535
|
+
|
536
|
+
if(ENABLE_LIBRESSL_INSTALL)
|
537
|
+
set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}")
|
538
|
+
configure_package_config_file(
|
539
|
+
"${CMAKE_CURRENT_LIST_DIR}/LibreSSLConfig.cmake.in"
|
540
|
+
"${CMAKE_CURRENT_BINARY_DIR}/install-config/LibreSSLConfig.cmake"
|
541
|
+
PATH_VARS INCLUDE_DIRECTORY
|
542
|
+
INSTALL_DESTINATION "${LIBRESSL_INSTALL_CMAKEDIR}"
|
543
|
+
)
|
544
|
+
install(FILES
|
545
|
+
"${CMAKE_CURRENT_BINARY_DIR}/install-config/LibreSSLConfig.cmake"
|
546
|
+
"${CMAKE_CURRENT_BINARY_DIR}/LibreSSLConfigVersion.cmake"
|
547
|
+
DESTINATION "${LIBRESSL_INSTALL_CMAKEDIR}"
|
548
|
+
)
|
549
|
+
|
550
|
+
if(NOT MSVC)
|
551
|
+
# Create pkgconfig files.
|
552
|
+
set(prefix ${CMAKE_INSTALL_PREFIX})
|
553
|
+
set(exec_prefix \${prefix})
|
554
|
+
set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
|
555
|
+
set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
|
556
|
+
if(PLATFORM_LIBS)
|
557
|
+
string(REGEX REPLACE ";" " -l" PLATFORM_LDADD ";${PLATFORM_LIBS}")
|
558
|
+
endif()
|
559
|
+
file(GLOB OPENSSL_PKGCONFIGS "*.pc.in")
|
560
|
+
foreach(file ${OPENSSL_PKGCONFIGS})
|
561
|
+
get_filename_component(filename ${file} NAME)
|
562
|
+
string(REPLACE ".in" "" new_file "${filename}")
|
563
|
+
configure_file(${filename} pkgconfig/${new_file} @ONLY)
|
564
|
+
endforeach()
|
565
|
+
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig
|
566
|
+
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
567
|
+
endif()
|
568
|
+
|
569
|
+
install(FILES cert.pem openssl.cnf x509v3.cnf DESTINATION ${CONF_DIR})
|
570
|
+
install(DIRECTORY DESTINATION ${CONF_DIR}/certs)
|
571
|
+
|
572
|
+
if(NOT TARGET uninstall)
|
573
|
+
configure_file(
|
574
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
575
|
+
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
576
|
+
IMMEDIATE @ONLY)
|
577
|
+
|
578
|
+
add_custom_target(uninstall
|
579
|
+
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
580
|
+
endif()
|
581
|
+
endif()
|