@@ -32,6 +32,8 @@
endif ()
option(MBED "BUILD with mbed" OFF)
+set(MBED_INCLUDE_PATH "" CACHE STRING "Path to mbed TLS include directory")
+set(MBED_LIBRARY_PATH "" CACHE STRING "Path to mbed library directory")
option(WOLFSSL "BUILD with wolfSSL" OFF)
option(ENABLE_LZ4 "BUILD with lz4" ON)
option(ENABLE_LZO "BUILD with lzo" ON)
@@ -219,6 +221,13 @@
check_type_size("struct msghdr" MSGHDR)
set(CMAKE_EXTRA_INCLUDE_FILES)
+if (${MBED})
+ check_symbol_exists(mbedtls_ctr_drbg_update_ret mbedtls/ctr_drbg.h HAVE_CTR_DRBG_UPDATE_RET)
+ check_symbol_exists(mbedtls_ssl_conf_export_keys_ext_cb mbedtls/ssl.h HAVE_EXPORT_KEYING_MATERIAL)
+else ()
+ set (HAVE_EXPORT_KEYING_MATERIAL TRUE)
+endif ()
+
find_program(IFCONFIG_PATH ifconfig)
find_program(IPROUTE_PATH ip)
find_program(ROUTE_PATH route)
@@ -237,7 +246,14 @@
function(add_library_deps target)
if (${MBED})
- target_link_libraries(${target} -lmbedtls -lmbedx509 -lmbedcrypto)
+ if (NOT (MBED_INCLUDE_PATH STREQUAL "") )
+ target_include_directories(${target} PRIVATE ${MBED_INCLUDE_PATH})
+ endif ()
+ if(NOT (MBED_LIBRARY_PATH STREQUAL ""))
+ target_link_directories(${target} PRIVATE ${MBED_LIBRARY_PATH})
+ endif ()
+
+ target_link_libraries(${target} PRIVATE -lmbedtls -lmbedx509 -lmbedcrypto)
elseif (${WOLFSSL})
pkg_search_module(wolfssl wolfssl REQUIRED)
target_link_libraries(${target} PUBLIC ${wolfssl_LINK_LIBRARIES})
@@ -118,7 +118,7 @@
#cmakedefine HAVE_ERR_H
/* Crypto library supports keying material exporter */
-#define HAVE_EXPORT_KEYING_MATERIAL 1
+#cmakedefine HAVE_EXPORT_KEYING_MATERIAL 1
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H
@@ -387,7 +387,7 @@
#undef HAVE_VSNPRINTF
/* we always assume a recent mbed TLS version */
-#define HAVE_CTR_DRBG_UPDATE_RET 1
+#cmakedefine HAVE_CTR_DRBG_UPDATE_RET
/* Path to ifconfig tool */
#define IFCONFIG_PATH "@IFCONFIG_PATH@"