aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2017-07-09 05:06:06 -0500
committerBrent Cook <bcook@openbsd.org>2017-07-09 05:06:06 -0500
commit0dbae37735a395e3c378ac944842e359f8087d41 (patch)
tree18aaf9fa1665455886fc171edbb8857ef5c35a21
parentc18852f650a3cb258e10222695a31ed5c929ab23 (diff)
parent0e82f22d16dc4c45bd45f9a994a30fc7435d430b (diff)
downloadportable-0dbae37735a395e3c378ac944842e359f8087d41.tar.gz
portable-0dbae37735a395e3c378ac944842e359f8087d41.tar.bz2
portable-0dbae37735a395e3c378ac944842e359f8087d41.zip
Land #324, Add option LIBRESSL_SKIP_INSTALL
-rw-r--r--CMakeLists.txt6
-rw-r--r--README.md12
-rw-r--r--apps/nc/CMakeLists.txt6
-rw-r--r--apps/ocspcheck/CMakeLists.txt7
-rw-r--r--apps/openssl/CMakeLists.txt12
-rw-r--r--crypto/CMakeLists.txt8
-rw-r--r--include/CMakeLists.txt12
-rw-r--r--man/CMakeLists.txt18
-rw-r--r--ssl/CMakeLists.txt8
-rw-r--r--tls/CMakeLists.txt8
10 files changed, 70 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dfb3d53..959edb7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,12 +27,18 @@ string(STRIP ${TLS_VERSION} TLS_VERSION)
27string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) 27string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION})
28string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) 28string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION})
29 29
30option(LIBRESSL_SKIP_INSTALL "Skip installation" ${LIBRESSL_SKIP_INSTALL})
30option(ENABLE_ASM "Enable assembly" ON) 31option(ENABLE_ASM "Enable assembly" ON)
31option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF) 32option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF)
32option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF) 33option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF)
33option(ENABLE_VSTEST "Enable test on Visual Studio" OFF) 34option(ENABLE_VSTEST "Enable test on Visual Studio" OFF)
34set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE) 35set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE)
35 36
37if(NOT LIBRESSL_SKIP_INSTALL)
38 set( ENABLE_LIBRESSL_INSTALL ON )
39endif(NOT LIBRESSL_SKIP_INSTALL)
40
41
36set(BUILD_NC true) 42set(BUILD_NC true)
37 43
38if(CMAKE_SYSTEM_NAME MATCHES "Darwin") 44if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
diff --git a/README.md b/README.md
index 9b3c540..33e68f4 100644
--- a/README.md
+++ b/README.md
@@ -131,3 +131,15 @@ install CMake, enter the LibreSSL source directory and run:
131 131
132This will generate a LibreSSL.sln file that you can incorporate into other 132This will generate a LibreSSL.sln file that you can incorporate into other
133projects or build by itself. 133projects or build by itself.
134
135#### Cmake - Additional Options ####
136
137| Option Name | Default | Description
138| ------------ | -----: | ------
139| LIBRESSL_SKIP_INSTALL | OFF | allows skipping install() rules. Can be specified from command line using <br>```-DLIBRESSL_SKIP_INSTALL=ON``` |
140| ENABLE_ASM | ON | builds assembly optimized rules. |
141| ENABLE_EXTRATESTS | OFF | Enable extra tests that may be unreliable on some platforms |
142| ENABLE_NC | OFF | Enable installing TLS-enabled nc(1) |
143| ENABLE_VSTEST | OFF | Enable test on Visual Studio |
144| OPENSSLDIR | Blank | Set the default openssl directory. Can be specified from command line using <br>```-DOPENSSLDIR=<dirname>``` |
145
diff --git a/apps/nc/CMakeLists.txt b/apps/nc/CMakeLists.txt
index be38146..64d14fa 100644
--- a/apps/nc/CMakeLists.txt
+++ b/apps/nc/CMakeLists.txt
@@ -53,8 +53,10 @@ add_executable(nc ${NC_SRC})
53target_link_libraries(nc tls ${OPENSSL_LIBS}) 53target_link_libraries(nc tls ${OPENSSL_LIBS})
54 54
55if(ENABLE_NC) 55if(ENABLE_NC)
56 install(TARGETS nc DESTINATION ${CMAKE_INSTALL_BINDIR}) 56 if(ENABLE_LIBRESSL_INSTALL)
57 install(FILES nc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 57 install(TARGETS nc DESTINATION ${CMAKE_INSTALL_BINDIR})
58 install(FILES nc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
59 endif(ENABLE_LIBRESSL_INSTALL)
58endif() 60endif()
59 61
60endif() 62endif()
diff --git a/apps/ocspcheck/CMakeLists.txt b/apps/ocspcheck/CMakeLists.txt
index 478f232..af245f4 100644
--- a/apps/ocspcheck/CMakeLists.txt
+++ b/apps/ocspcheck/CMakeLists.txt
@@ -36,7 +36,10 @@ endif()
36add_executable(ocspcheck ${OCSPCHECK_SRC}) 36add_executable(ocspcheck ${OCSPCHECK_SRC})
37target_link_libraries(ocspcheck tls ${OPENSSL_LIBS}) 37target_link_libraries(ocspcheck tls ${OPENSSL_LIBS})
38 38
39install(TARGETS ocspcheck DESTINATION ${CMAKE_INSTALL_BINDIR}) 39if(ENABLE_LIBRESSL_INSTALL)
40install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8) 40 install(TARGETS ocspcheck DESTINATION ${CMAKE_INSTALL_BINDIR})
41 install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
42
43endif(ENABLE_LIBRESSL_INSTALL)
41 44
42endif() 45endif()
diff --git a/apps/openssl/CMakeLists.txt b/apps/openssl/CMakeLists.txt
index 2e47840..71fbd63 100644
--- a/apps/openssl/CMakeLists.txt
+++ b/apps/openssl/CMakeLists.txt
@@ -76,13 +76,17 @@ endif()
76add_executable(openssl ${OPENSSL_SRC}) 76add_executable(openssl ${OPENSSL_SRC})
77target_link_libraries(openssl ${OPENSSL_LIBS}) 77target_link_libraries(openssl ${OPENSSL_LIBS})
78 78
79install(TARGETS openssl DESTINATION ${CMAKE_INSTALL_BINDIR}) 79if(ENABLE_LIBRESSL_INSTALL)
80install(FILES openssl.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 80 install(TARGETS openssl DESTINATION ${CMAKE_INSTALL_BINDIR})
81 install(FILES openssl.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
82endif(ENABLE_LIBRESSL_INSTALL)
81 83
82if(NOT "${OPENSSLDIR}" STREQUAL "") 84if(NOT "${OPENSSLDIR}" STREQUAL "")
83 set(CONF_DIR "${OPENSSLDIR}") 85 set(CONF_DIR "${OPENSSLDIR}")
84else() 86else()
85 set(CONF_DIR "${CMAKE_INSTALL_PREFIX}/etc/ssl") 87 set(CONF_DIR "${CMAKE_INSTALL_PREFIX}/etc/ssl")
86endif() 88endif()
87install(FILES cert.pem openssl.cnf x509v3.cnf DESTINATION ${CONF_DIR}) 89if(ENABLE_LIBRESSL_INSTALL)
88install(DIRECTORY DESTINATION ${CONF_DIR}/cert) 90 install(FILES cert.pem openssl.cnf x509v3.cnf DESTINATION ${CONF_DIR})
91 install(DIRECTORY DESTINATION ${CONF_DIR}/cert)
92endif(ENABLE_LIBRESSL_INSTALL)
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index eca9d1c..aa289aa 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -829,9 +829,13 @@ if (BUILD_SHARED)
829 ARCHIVE_OUTPUT_NAME crypto${CRYPTO_POSTFIX}) 829 ARCHIVE_OUTPUT_NAME crypto${CRYPTO_POSTFIX})
830 set_target_properties(crypto-shared PROPERTIES VERSION 830 set_target_properties(crypto-shared PROPERTIES VERSION
831 ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION}) 831 ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION})
832 install(TARGETS crypto crypto-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) 832 if(ENABLE_LIBRESSL_INSTALL)
833 install(TARGETS crypto crypto-shared DESTINATION ${CMAKE_INSTALL_LIBDIR})
834 endif(ENABLE_LIBRESSL_INSTALL)
833else() 835else()
834 add_library(crypto STATIC ${CRYPTO_SRC}) 836 add_library(crypto STATIC ${CRYPTO_SRC})
835 install(TARGETS crypto DESTINATION ${CMAKE_INSTALL_LIBDIR}) 837 if(ENABLE_LIBRESSL_INSTALL)
838 install(TARGETS crypto DESTINATION ${CMAKE_INSTALL_LIBDIR})
839 endif(ENABLE_LIBRESSL_INSTALL)
836endif() 840endif()
837 841
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index ccb6589..b730954 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,5 +1,7 @@
1install(DIRECTORY . 1if(ENABLE_LIBRESSL_INSTALL)
2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 2 install(DIRECTORY .
3 PATTERN "CMakeLists.txt" EXCLUDE 3 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
4 PATTERN "compat" EXCLUDE 4 PATTERN "CMakeLists.txt" EXCLUDE
5 PATTERN "Makefile*" EXCLUDE) 5 PATTERN "compat" EXCLUDE
6 PATTERN "Makefile*" EXCLUDE)
7endif(ENABLE_LIBRESSL_INSTALL)
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index 454b1ee..639b9ed 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -1,9 +1,11 @@
1install(DIRECTORY . 1if(ENABLE_LIBRESSL_INSTALL)
2 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 2 install(DIRECTORY .
3 FILES_MATCHING PATTERN "*.3" 3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
4 ) 4 FILES_MATCHING PATTERN "*.3"
5 )
5 6
6install(DIRECTORY . 7 install(DIRECTORY .
7 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
8 FILES_MATCHING PATTERN "*.1" 9 FILES_MATCHING PATTERN "*.1"
9 ) 10 )
11endif(ENABLE_LIBRESSL_INSTALL)
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt
index 5403942..bad7276 100644
--- a/ssl/CMakeLists.txt
+++ b/ssl/CMakeLists.txt
@@ -60,8 +60,12 @@ if (BUILD_SHARED)
60 ARCHIVE_OUTPUT_NAME ssl${SSL_POSTFIX}) 60 ARCHIVE_OUTPUT_NAME ssl${SSL_POSTFIX})
61 set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION} 61 set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION}
62 SOVERSION ${SSL_MAJOR_VERSION}) 62 SOVERSION ${SSL_MAJOR_VERSION})
63 install(TARGETS ssl ssl-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) 63 if(ENABLE_LIBRESSL_INSTALL)
64 install(TARGETS ssl ssl-shared DESTINATION ${CMAKE_INSTALL_LIBDIR})
65 endif(ENABLE_LIBRESSL_INSTALL)
64else() 66else()
65 add_library(ssl STATIC ${SSL_SRC}) 67 add_library(ssl STATIC ${SSL_SRC})
66 install(TARGETS ssl DESTINATION ${CMAKE_INSTALL_LIBDIR}) 68 if(ENABLE_LIBRESSL_INSTALL)
69 install(TARGETS ssl DESTINATION ${CMAKE_INSTALL_LIBDIR})
70 endif(ENABLE_LIBRESSL_INSTALL)
67endif() 71endif()
diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt
index c3e6336..c8de04c 100644
--- a/tls/CMakeLists.txt
+++ b/tls/CMakeLists.txt
@@ -39,9 +39,13 @@ if (BUILD_SHARED)
39 ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX}) 39 ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX})
40 set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION} 40 set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION}
41 SOVERSION ${TLS_MAJOR_VERSION}) 41 SOVERSION ${TLS_MAJOR_VERSION})
42 install(TARGETS tls tls-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) 42 if(ENABLE_LIBRESSL_INSTALL)
43 install(TARGETS tls tls-shared DESTINATION ${CMAKE_INSTALL_LIBDIR})
44 endif(ENABLE_LIBRESSL_INSTALL)
43else() 45else()
44 add_library(tls STATIC ${TLS_SRC}) 46 add_library(tls STATIC ${TLS_SRC})
45 install(TARGETS tls DESTINATION ${CMAKE_INSTALL_LIBDIR}) 47 if(ENABLE_LIBRESSL_INSTALL)
48 install(TARGETS tls DESTINATION ${CMAKE_INSTALL_LIBDIR})
49 endif(ENABLE_LIBRESSL_INSTALL)
46endif() 50endif()
47 51