diff options
author | Viktor Szakats <commit@vsz.me> | 2023-11-05 08:56:09 +0000 |
---|---|---|
committer | Viktor Szakats <commit@vsz.me> | 2023-11-05 08:56:09 +0000 |
commit | 89fcb1a3e50ac224d68891a6014b74639a5f551a (patch) | |
tree | 7bf8f656d79ca40228203e4938cbfc9a0bdfdc52 | |
parent | e6ae33d57216cfe0e88fdbdfb4f0bbf41fa76878 (diff) | |
download | portable-89fcb1a3e50ac224d68891a6014b74639a5f551a.tar.gz portable-89fcb1a3e50ac224d68891a6014b74639a5f551a.tar.bz2 portable-89fcb1a3e50ac224d68891a6014b74639a5f551a.zip |
also fix ocspcheck and nc, dedupe build logic
-rw-r--r-- | CMakeLists.txt | 18 | ||||
-rw-r--r-- | apps/nc/CMakeLists.txt | 6 | ||||
-rw-r--r-- | apps/ocspcheck/CMakeLists.txt | 6 | ||||
-rw-r--r-- | crypto/CMakeLists.txt | 10 | ||||
-rw-r--r-- | tls/CMakeLists.txt | 10 |
5 files changed, 16 insertions, 34 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f0dfa0..ca7f565 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -414,6 +414,18 @@ else() | |||
414 | set(LIBTLS_TEST_LIBS tls ${PLATFORM_LIBS}) | 414 | set(LIBTLS_TEST_LIBS tls ${PLATFORM_LIBS}) |
415 | endif() | 415 | endif() |
416 | 416 | ||
417 | if(OPENSSLDIR STREQUAL "") | ||
418 | if(WIN32) | ||
419 | set(OPENSSLDIR "C:/Windows/libressl/ssl") | ||
420 | else() | ||
421 | set(OPENSSLDIR "${CMAKE_INSTALL_PREFIX}/etc/ssl") | ||
422 | endif() | ||
423 | |||
424 | set(CONF_DIR "${CMAKE_INSTALL_PREFIX}/etc/ssl") | ||
425 | else() | ||
426 | set(CONF_DIR "${OPENSSLDIR}") | ||
427 | endif() | ||
428 | |||
417 | add_subdirectory(include) | 429 | add_subdirectory(include) |
418 | add_subdirectory(crypto) | 430 | add_subdirectory(crypto) |
419 | add_subdirectory(ssl) | 431 | add_subdirectory(ssl) |
@@ -495,12 +507,6 @@ if(ENABLE_LIBRESSL_INSTALL) | |||
495 | endif() | 507 | endif() |
496 | endif(ENABLE_LIBRESSL_INSTALL) | 508 | endif(ENABLE_LIBRESSL_INSTALL) |
497 | 509 | ||
498 | if(NOT "${OPENSSLDIR}" STREQUAL "") | ||
499 | set(CONF_DIR "${OPENSSLDIR}") | ||
500 | else() | ||
501 | set(CONF_DIR "${CMAKE_INSTALL_PREFIX}/etc/ssl") | ||
502 | endif() | ||
503 | |||
504 | if(ENABLE_LIBRESSL_INSTALL) | 510 | if(ENABLE_LIBRESSL_INSTALL) |
505 | install(FILES cert.pem openssl.cnf x509v3.cnf DESTINATION ${CONF_DIR}) | 511 | install(FILES cert.pem openssl.cnf x509v3.cnf DESTINATION ${CONF_DIR}) |
506 | install(DIRECTORY DESTINATION ${CONF_DIR}/certs) | 512 | install(DIRECTORY DESTINATION ${CONF_DIR}/certs) |
diff --git a/apps/nc/CMakeLists.txt b/apps/nc/CMakeLists.txt index ffd68e5..868b797 100644 --- a/apps/nc/CMakeLists.txt +++ b/apps/nc/CMakeLists.txt | |||
@@ -29,11 +29,7 @@ else() | |||
29 | set(NC_SRC ${NC_SRC} compat/readpassphrase.c) | 29 | set(NC_SRC ${NC_SRC} compat/readpassphrase.c) |
30 | endif() | 30 | endif() |
31 | 31 | ||
32 | if(NOT "${OPENSSLDIR}" STREQUAL "") | 32 | add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") |
33 | add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") | ||
34 | else() | ||
35 | add_definitions(-DDEFAULT_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\") | ||
36 | endif() | ||
37 | 33 | ||
38 | add_executable(nc ${NC_SRC}) | 34 | add_executable(nc ${NC_SRC}) |
39 | target_include_directories(nc | 35 | target_include_directories(nc |
diff --git a/apps/ocspcheck/CMakeLists.txt b/apps/ocspcheck/CMakeLists.txt index 9cf7a8b..41c7845 100644 --- a/apps/ocspcheck/CMakeLists.txt +++ b/apps/ocspcheck/CMakeLists.txt | |||
@@ -11,11 +11,7 @@ else() | |||
11 | set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c) | 11 | set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c) |
12 | endif() | 12 | endif() |
13 | 13 | ||
14 | if(NOT "${OPENSSLDIR}" STREQUAL "") | 14 | add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") |
15 | add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") | ||
16 | else() | ||
17 | add_definitions(-DDEFAULT_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\") | ||
18 | endif() | ||
19 | 15 | ||
20 | add_executable(ocspcheck ${OCSPCHECK_SRC}) | 16 | add_executable(ocspcheck ${OCSPCHECK_SRC}) |
21 | target_include_directories(ocspcheck | 17 | target_include_directories(ocspcheck |
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 7efb143..6056471 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt | |||
@@ -912,15 +912,7 @@ else() | |||
912 | endif() | 912 | endif() |
913 | endif() | 913 | endif() |
914 | 914 | ||
915 | if(NOT "${OPENSSLDIR}" STREQUAL "") | 915 | add_definitions(-DOPENSSLDIR=\"${OPENSSLDIR}\") |
916 | add_definitions(-DOPENSSLDIR=\"${OPENSSLDIR}\") | ||
917 | else() | ||
918 | if(WIN32) | ||
919 | add_definitions(-DOPENSSLDIR=\"C:/Windows/libressl/ssl\") | ||
920 | else() | ||
921 | add_definitions(-DOPENSSLDIR=\"${CMAKE_INSTALL_PREFIX}/etc/ssl\") | ||
922 | endif() | ||
923 | endif() | ||
924 | 916 | ||
925 | file(READ ${CMAKE_CURRENT_SOURCE_DIR}/crypto.sym SYMS) | 917 | file(READ ${CMAKE_CURRENT_SOURCE_DIR}/crypto.sym SYMS) |
926 | foreach(SYM IN LISTS CRYPTO_UNEXPORT) | 918 | foreach(SYM IN LISTS CRYPTO_UNEXPORT) |
diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt index 6a19a4b..031a9be 100644 --- a/tls/CMakeLists.txt +++ b/tls/CMakeLists.txt | |||
@@ -26,15 +26,7 @@ if(WIN32) | |||
26 | set(LIBTLS_EXTRA_EXPORT ${LIBTLS_EXTRA_EXPORT} ftruncate) | 26 | set(LIBTLS_EXTRA_EXPORT ${LIBTLS_EXTRA_EXPORT} ftruncate) |
27 | endif() | 27 | endif() |
28 | 28 | ||
29 | if(NOT "${OPENSSLDIR}" STREQUAL "") | 29 | add_definitions(-DTLS_DEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") |
30 | add_definitions(-DTLS_DEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") | ||
31 | else() | ||
32 | if(WIN32) | ||
33 | add_definitions(-DTLS_DEFAULT_CA_FILE=\"C:/Windows/libressl/ssl/cert.pem\") | ||
34 | else() | ||
35 | add_definitions(-DTLS_DEFAULT_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\") | ||
36 | endif() | ||
37 | endif() | ||
38 | 30 | ||
39 | file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/tls.sym DESTINATION | 31 | file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/tls.sym DESTINATION |
40 | ${CMAKE_CURRENT_BINARY_DIR}) | 32 | ${CMAKE_CURRENT_BINARY_DIR}) |