From 8fe1adb999bdc66440bec5c92043a6178bc41839 Mon Sep 17 00:00:00 2001 From: Mark Stemm Date: Thu, 7 Mar 2019 20:19:35 -0800 Subject: [PATCH] Use tbb, libcurl on osx, disable libidn2 We need it now that tbb is a core part of the inspector and that the curl part of the docker container engine isn't #ifdefd with HAS_CAPTURE. Both are already downloaded/built as dependencies of sysdig so it's just a matter of CMakeLists.txt config. Also, disable libidn2 explicitly when building libcurl. On OSX builds this gets picked up from an autodetected library, while it does not get picked up on linux. We already disable libidn1, so also disable libidn2. --- CMakeLists.txt | 4 ++-- userspace/libsinsp/CMakeLists.txt | 13 +++++++++---- userspace/sysdig/CMakeLists.txt | 4 +--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec99f19269..e45b9a0fe4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,7 +241,7 @@ endif() # # Intel tbb # -if(NOT WIN32 AND NOT APPLE) +if(NOT WIN32) option(USE_BUNDLED_TBB "Enable building of the bundled tbb" ${USE_BUNDLED_DEPS}) if(NOT USE_BUNDLED_TBB) find_path(TBB_INCLUDE_DIR tbb.h PATH_SUFFIXES tbb) @@ -411,7 +411,7 @@ if(NOT WIN32) DEPENDS openssl URL "http://download.draios.com/dependencies/curl-7.61.0.tar.bz2" URL_MD5 "31d0a9f48dc796a7db351898a1e5058a" - CONFIGURE_COMMAND ./configure ${CURL_SSL_OPTION} --disable-threaded-resolver --disable-shared --enable-optimize --disable-curldebug --disable-rt --enable-http --disable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-sspi --disable-ntlm-wb --disable-tls-srp --without-winssl --without-darwinssl --without-polarssl --without-cyassl --without-nss --without-axtls --without-ca-path --without-ca-bundle --without-libmetalink --without-librtmp --without-winidn --without-libidn --without-nghttp2 --without-libssh2 + CONFIGURE_COMMAND ./configure ${CURL_SSL_OPTION} --disable-threaded-resolver --disable-shared --enable-optimize --disable-curldebug --disable-rt --enable-http --disable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-sspi --disable-ntlm-wb --disable-tls-srp --without-winssl --without-darwinssl --without-polarssl --without-cyassl --without-nss --without-axtls --without-ca-path --without-ca-bundle --without-libmetalink --without-librtmp --without-winidn --without-libidn --without-libidn2 --without-nghttp2 --without-libssh2 BUILD_COMMAND ${CMD_MAKE} BUILD_IN_SOURCE 1 BUILD_BYPRODUCTS ${CURL_LIBRARIES} diff --git a/userspace/libsinsp/CMakeLists.txt b/userspace/libsinsp/CMakeLists.txt index a9cb0c5d40..bc0811f873 100644 --- a/userspace/libsinsp/CMakeLists.txt +++ b/userspace/libsinsp/CMakeLists.txt @@ -21,19 +21,22 @@ include_directories(../libscap) include_directories(../async) include_directories("${JSONCPP_INCLUDE}") include_directories("${LUAJIT_INCLUDE}") +include_directories("${TBB_INCLUDE_DIR}") if(NOT WIN32 AND NOT APPLE) include_directories("${B64_INCLUDE}") - include_directories("${CURL_INCLUDE_DIR}") include_directories("${CURSES_INCLUDE_DIR}") include_directories("${GRPC_INCLUDE}") include_directories("${JQ_INCLUDE}") include_directories("${OPENSSL_INCLUDE_DIR}") include_directories("${PROTOBUF_INCLUDE}") - include_directories("${TBB_INCLUDE_DIR}") include_directories("${CMAKE_CURRENT_BINARY_DIR}") endif() +if(NOT WIN32) + include_directories("${CURL_INCLUDE_DIR}") +endif() + set(SINSP_SOURCES chisel.cpp chisel_api.cpp @@ -150,9 +153,13 @@ if(NOT WIN32) endif() if(USE_BUNDLED_CURL) add_dependencies(sinsp curl) + target_link_libraries(sinsp + "${CURL_LIBRARIES}") endif() if(USE_BUNDLED_TBB) add_dependencies(sinsp tbb) + target_link_libraries(sinsp + "${TBB_LIB}") endif() if(NOT APPLE) @@ -174,8 +181,6 @@ if(NOT WIN32) "${CARES_LIB}" "${JQ_LIB}" "${B64_LIB}" - "${CURL_LIBRARIES}" - "${TBB_LIB}" rt anl) endif() diff --git a/userspace/sysdig/CMakeLists.txt b/userspace/sysdig/CMakeLists.txt index a71435215f..648ff3cbd8 100644 --- a/userspace/sysdig/CMakeLists.txt +++ b/userspace/sysdig/CMakeLists.txt @@ -16,12 +16,10 @@ # limitations under the License. # include_directories("${JSONCPP_INCLUDE}") +include_directories("${TBB_INCLUDE_DIR}") if(NOT WIN32) - if(NOT APPLE) include_directories("${CURL_INCLUDE_DIR}") - include_directories("${TBB_INCLUDE_DIR}") - endif() include_directories("${CURSES_INCLUDE_DIR}") endif()