diff options
author | Brent Cook <bcook@openbsd.org> | 2017-07-09 05:06:06 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2017-07-09 05:06:06 -0500 |
commit | 0dbae37735a395e3c378ac944842e359f8087d41 (patch) | |
tree | 18aaf9fa1665455886fc171edbb8857ef5c35a21 | |
parent | c18852f650a3cb258e10222695a31ed5c929ab23 (diff) | |
parent | 0e82f22d16dc4c45bd45f9a994a30fc7435d430b (diff) | |
download | portable-0dbae37735a395e3c378ac944842e359f8087d41.tar.gz portable-0dbae37735a395e3c378ac944842e359f8087d41.tar.bz2 portable-0dbae37735a395e3c378ac944842e359f8087d41.zip |
Land #324, Add option LIBRESSL_SKIP_INSTALL
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | apps/nc/CMakeLists.txt | 6 | ||||
-rw-r--r-- | apps/ocspcheck/CMakeLists.txt | 7 | ||||
-rw-r--r-- | apps/openssl/CMakeLists.txt | 12 | ||||
-rw-r--r-- | crypto/CMakeLists.txt | 8 | ||||
-rw-r--r-- | include/CMakeLists.txt | 12 | ||||
-rw-r--r-- | man/CMakeLists.txt | 18 | ||||
-rw-r--r-- | ssl/CMakeLists.txt | 8 | ||||
-rw-r--r-- | tls/CMakeLists.txt | 8 |
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) | |||
27 | string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) | 27 | string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) |
28 | string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) | 28 | string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) |
29 | 29 | ||
30 | option(LIBRESSL_SKIP_INSTALL "Skip installation" ${LIBRESSL_SKIP_INSTALL}) | ||
30 | option(ENABLE_ASM "Enable assembly" ON) | 31 | option(ENABLE_ASM "Enable assembly" ON) |
31 | option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF) | 32 | option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF) |
32 | option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF) | 33 | option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF) |
33 | option(ENABLE_VSTEST "Enable test on Visual Studio" OFF) | 34 | option(ENABLE_VSTEST "Enable test on Visual Studio" OFF) |
34 | set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE) | 35 | set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE) |
35 | 36 | ||
37 | if(NOT LIBRESSL_SKIP_INSTALL) | ||
38 | set( ENABLE_LIBRESSL_INSTALL ON ) | ||
39 | endif(NOT LIBRESSL_SKIP_INSTALL) | ||
40 | |||
41 | |||
36 | set(BUILD_NC true) | 42 | set(BUILD_NC true) |
37 | 43 | ||
38 | if(CMAKE_SYSTEM_NAME MATCHES "Darwin") | 44 | if(CMAKE_SYSTEM_NAME MATCHES "Darwin") |
@@ -131,3 +131,15 @@ install CMake, enter the LibreSSL source directory and run: | |||
131 | 131 | ||
132 | This will generate a LibreSSL.sln file that you can incorporate into other | 132 | This will generate a LibreSSL.sln file that you can incorporate into other |
133 | projects or build by itself. | 133 | projects 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}) | |||
53 | target_link_libraries(nc tls ${OPENSSL_LIBS}) | 53 | target_link_libraries(nc tls ${OPENSSL_LIBS}) |
54 | 54 | ||
55 | if(ENABLE_NC) | 55 | if(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) | ||
58 | endif() | 60 | endif() |
59 | 61 | ||
60 | endif() | 62 | endif() |
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() | |||
36 | add_executable(ocspcheck ${OCSPCHECK_SRC}) | 36 | add_executable(ocspcheck ${OCSPCHECK_SRC}) |
37 | target_link_libraries(ocspcheck tls ${OPENSSL_LIBS}) | 37 | target_link_libraries(ocspcheck tls ${OPENSSL_LIBS}) |
38 | 38 | ||
39 | install(TARGETS ocspcheck DESTINATION ${CMAKE_INSTALL_BINDIR}) | 39 | if(ENABLE_LIBRESSL_INSTALL) |
40 | install(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 | |||
43 | endif(ENABLE_LIBRESSL_INSTALL) | ||
41 | 44 | ||
42 | endif() | 45 | endif() |
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() | |||
76 | add_executable(openssl ${OPENSSL_SRC}) | 76 | add_executable(openssl ${OPENSSL_SRC}) |
77 | target_link_libraries(openssl ${OPENSSL_LIBS}) | 77 | target_link_libraries(openssl ${OPENSSL_LIBS}) |
78 | 78 | ||
79 | install(TARGETS openssl DESTINATION ${CMAKE_INSTALL_BINDIR}) | 79 | if(ENABLE_LIBRESSL_INSTALL) |
80 | install(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) | ||
82 | endif(ENABLE_LIBRESSL_INSTALL) | ||
81 | 83 | ||
82 | if(NOT "${OPENSSLDIR}" STREQUAL "") | 84 | if(NOT "${OPENSSLDIR}" STREQUAL "") |
83 | set(CONF_DIR "${OPENSSLDIR}") | 85 | set(CONF_DIR "${OPENSSLDIR}") |
84 | else() | 86 | else() |
85 | set(CONF_DIR "${CMAKE_INSTALL_PREFIX}/etc/ssl") | 87 | set(CONF_DIR "${CMAKE_INSTALL_PREFIX}/etc/ssl") |
86 | endif() | 88 | endif() |
87 | install(FILES cert.pem openssl.cnf x509v3.cnf DESTINATION ${CONF_DIR}) | 89 | if(ENABLE_LIBRESSL_INSTALL) |
88 | install(DIRECTORY DESTINATION ${CONF_DIR}/cert) | 90 | install(FILES cert.pem openssl.cnf x509v3.cnf DESTINATION ${CONF_DIR}) |
91 | install(DIRECTORY DESTINATION ${CONF_DIR}/cert) | ||
92 | endif(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) | ||
833 | else() | 835 | else() |
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) | ||
836 | endif() | 840 | endif() |
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 @@ | |||
1 | install(DIRECTORY . | 1 | if(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) | ||
7 | endif(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 @@ | |||
1 | install(DIRECTORY . | 1 | if(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 | ||
6 | install(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 | ) |
11 | endif(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) | ||
64 | else() | 66 | else() |
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) | ||
67 | endif() | 71 | endif() |
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) | ||
43 | else() | 45 | else() |
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) | ||
46 | endif() | 50 | endif() |
47 | 51 | ||