From 6bbe78390804f5fa6247df62df4cc45b5a790822 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 26 Feb 2020 19:13:28 +0100 Subject: [PATCH] Revert "Remove pkcs11-helper option" This reverts commit d832f187f756079552601867348d924582bf65de. Conflicts: * CMakeLists.txt: * USE_PKCS11_HELPER_LIBRARY: there has been a change immediately before where it was removed. Just re-add what was removed. * tests/CMakeLists.txt: * USE_PKCS11_HELPER_LIBRARY: there has been a change immediately before where it was removed. Just re-add what was removed. --- CMakeLists.txt | 1 + library/CMakeLists.txt | 4 ++++ programs/Makefile | 1 + programs/test/CMakeLists.txt | 4 ++++ tests/CMakeLists.txt | 4 ++++ tests/Makefile | 1 + 6 files changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d40eea6a..9c6fb5cd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ endif() # Set the project root directory. set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF) option(ENABLE_ZLIB_SUPPORT "Build mbed TLS with zlib library." OFF) option(ENABLE_PROGRAMS "Build mbed TLS programs." ON) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index a602a6bfd..0053f09b0 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -148,6 +148,10 @@ if(HAIKU) set(libs ${libs} network) endif(HAIKU) +if(USE_PKCS11_HELPER_LIBRARY) + set(libs ${libs} pkcs11-helper) +endif(USE_PKCS11_HELPER_LIBRARY) + if(ENABLE_ZLIB_SUPPORT) set(libs ${libs} ${ZLIB_LIBRARIES}) endif(ENABLE_ZLIB_SUPPORT) diff --git a/programs/Makefile b/programs/Makefile index 65a31b1b8..feec28841 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -1,5 +1,6 @@ # To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS +# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS CFLAGS ?= -O2 WARNING_CFLAGS ?= -Wall -Wextra diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 0d2b9460a..64ed379e7 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -2,6 +2,10 @@ set(libs mbedtls ) +if(USE_PKCS11_HELPER_LIBRARY) + set(libs ${libs} pkcs11-helper) +endif(USE_PKCS11_HELPER_LIBRARY) + if(ENABLE_ZLIB_SUPPORT) set(libs ${libs} ${ZLIB_LIBRARIES}) endif(ENABLE_ZLIB_SUPPORT) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ecc33eec0..5cc7a0ac2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,6 +9,10 @@ if(NOT DEFINED MBEDTLS_DIR) set(MBEDTLS_DIR ${CMAKE_SOURCE_DIR}) endif() +if(USE_PKCS11_HELPER_LIBRARY) + set(libs ${libs} pkcs11-helper) +endif(USE_PKCS11_HELPER_LIBRARY) + if(ENABLE_ZLIB_SUPPORT) set(libs ${libs} ${ZLIB_LIBRARIES}) endif(ENABLE_ZLIB_SUPPORT) diff --git a/tests/Makefile b/tests/Makefile index cca7c1cf0..ae9ba85ff 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,5 +1,6 @@ # To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS +# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS CFLAGS ?= -O2 WARNING_CFLAGS ?= -Wall -Wextra