From: "Alexander V. Tikhonov" <avtikhon@tarantool.org> To: Oleg Piskunov <o.piskunov@tarantool.org>, Sergey Bronnikov <sergeyb@tarantool.org>, Alexander Turenko <alexander.turenko@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: [Tarantool-patches] [PATCH v1 1/4] build: port autoconf to cmake in curl build Date: Fri, 22 May 2020 15:49:48 +0300 [thread overview] Message-ID: <7062d46554d7a5da59f1eb80a2b9daa7d1dcd1e0.1590151460.git.avtikhon@tarantool.org> (raw) In-Reply-To: <cover.1590151460.git.avtikhon@tarantool.org> In-Reply-To: <cover.1590151460.git.avtikhon@tarantool.org> Changed autoconf tools in Curl build to cmake use for builds where cmake major starts from 3. It was made so because cmake in curl build works only with 3.0 version and above, the following issue found on: CentOS 6,7 Ubuntu 14.04 Issue with curl cmake based build with cmake before 3.0 version: CMake Error at CMakeLists.txt:41 (cmake_minimum_required): CMake 3.0 or higher is required. You are running version 2.8.12.2 For curl cmake buld all autoconf options were ported to cmake configuration call. Also found that CURL cmake configuration file: third_party/curl/lib/CMakeLists.txt has installation part for built libcurl.a library: install(TARGETS ${LIB_NAME} EXPORT ${TARGETS_EXPORT_NAME} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} where it changes CMAKE_INSTALL_LIBDIR to appropriate name with suffix of the architecture, like: lib lib64 x86_64 Found that find_library routine from the file: cmake/FindLibCURL.cmake returns only 'lib' value and it breaks the building of the depends binaries. To avoid of it the CMAKE_INSTALL_LIBDIR option was set to cmake call: -DCMAKE_INSTALL_LIBDIR=lib Closes #4968 --- cmake/BuildLibCURL.cmake | 240 ++++++++++++++++++++++----------------- 1 file changed, 138 insertions(+), 102 deletions(-) diff --git a/cmake/BuildLibCURL.cmake b/cmake/BuildLibCURL.cmake index 5f8b15a63..39566145e 100644 --- a/cmake/BuildLibCURL.cmake +++ b/cmake/BuildLibCURL.cmake @@ -25,10 +25,14 @@ macro(curl_build) set(ASYN_DNS_USED "ares") set(ASYN_DNS_UNUSED "threaded-resolver") set(ASYN_DNS_PATH "=${ARES_INSTALL_DIR}") + set(ENABLE_ARES "ON") + set(CMAKE_FIND_ROOT_PATH "${ARES_INSTALL_DIR}") else() set(ASYN_DNS_USED "threaded-resolver") set(ASYN_DNS_UNUSED "ares") set(ASYN_DNS_PATH "") + set(ENABLE_ARES "OFF") + set(CMAKE_FIND_ROOT_PATH "") endif() set(ENABLED_DNS_OPT "--enable-${ASYN_DNS_USED}${ASYN_DNS_PATH}") @@ -49,108 +53,140 @@ macro(curl_build) endif() include(ExternalProject) - ExternalProject_Add( - bundled-libcurl-project - SOURCE_DIR ${LIBCURL_SOURCE_DIR} - PREFIX ${LIBCURL_INSTALL_DIR} - DOWNLOAD_DIR ${LIBCURL_BINARY_DIR} - TMP_DIR ${LIBCURL_BINARY_DIR}/tmp - STAMP_DIR ${LIBCURL_BINARY_DIR}/stamp - BINARY_DIR ${LIBCURL_BINARY_DIR} - CONFIGURE_COMMAND - cd <SOURCE_DIR> && ./buildconf && - cd <BINARY_DIR> && <SOURCE_DIR>/configure - # Pass the same toolchain as is used to build - # tarantool itself, because they can be - # incompatible. - CC=${CMAKE_C_COMPILER} - LD=${CMAKE_LINKER} - AR=${CMAKE_AR} - RANLIB=${CMAKE_RANLIB} - NM=${CMAKE_NM} - STRIP=${CMAKE_STRIP} - - # Pass -isysroot=<SDK_PATH> option on Mac OS, see - # above. - # Note: Passing of CPPFLAGS / CFLAGS explicitly - # discards using of corresponsing environment - # variables. - CPPFLAGS=${LIBCURL_CPPFLAGS} - CFLAGS=${LIBCURL_CFLAGS} - - # Pass empty LDFLAGS to discard using of - # corresponding environment variable. - # It is possible that a linker flag assumes that - # some compilation flag is set. We don't pass - # CFLAGS from environment, so we should not do it - # for LDFLAGS too. - LDFLAGS= - - --prefix <INSTALL_DIR> - --enable-static - --enable-shared - - --with-zlib - ${LIBCURL_OPENSSL_OPT} - --with-ca-fallback - - --without-brotli - --without-gnutls - --without-mbedtls - --without-cyassl - --without-wolfssl - --without-mesalink - --without-nss - --without-ca-bundle - --without-ca-path - --without-libpsl - --without-libmetalink - --without-librtmp - --without-winidn - --without-libidn2 - --without-nghttp2 - --without-ngtcp2 - --without-nghttp3 - --without-quiche - --without-zsh-functions-dir - --without-fish-functions-dir - - ${ENABLED_DNS_OPT} - --enable-http - --enable-proxy - --enable-ipv6 - --enable-unix-sockets - --enable-cookies - --enable-http-auth - --enable-mime - --enable-dateparse - - ${DISABLED_DNS_OPT} - --disable-ftp - --disable-file - --disable-ldap - --disable-ldaps - --disable-rtsp - --disable-dict - --disable-telnet - --disable-tftp - --disable-pop3 - --disable-imap - --disable-smb - --disable-smtp - --disable-gopher - --disable-manual - --disable-sspi - --disable-crypto-auth - --disable-ntlm-wb - --disable-tls-srp - --disable-doh - --disable-netrc - --disable-progress-meter - --disable-dnsshuffle - --disable-alt-svc - BUILD_COMMAND cd <BINARY_DIR> && $(MAKE) - INSTALL_COMMAND cd <BINARY_DIR> && $(MAKE) install) + if(${CMAKE_MAJOR_VERSION} VERSION_LESS "3") + ExternalProject_Add( + bundled-libcurl-project + SOURCE_DIR ${LIBCURL_SOURCE_DIR} + PREFIX ${LIBCURL_INSTALL_DIR} + DOWNLOAD_DIR ${LIBCURL_BINARY_DIR} + TMP_DIR ${LIBCURL_BINARY_DIR}/tmp + STAMP_DIR ${LIBCURL_BINARY_DIR}/stamp + BINARY_DIR ${LIBCURL_BINARY_DIR} + CONFIGURE_COMMAND + cd <SOURCE_DIR> && ./buildconf && + cd <BINARY_DIR> && <SOURCE_DIR>/configure + # Pass the same toolchain as is used to build + # tarantool itself, because they can be + # incompatible. + CC=${CMAKE_C_COMPILER} + LD=${CMAKE_LINKER} + AR=${CMAKE_AR} + RANLIB=${CMAKE_RANLIB} + NM=${CMAKE_NM} + STRIP=${CMAKE_STRIP} + + # Pass -isysroot=<SDK_PATH> option on Mac OS, see + # above. + # Note: Passing of CPPFLAGS / CFLAGS explicitly + # discards using of corresponsing environment + # variables. + CPPFLAGS=${LIBCURL_CPPFLAGS} + CFLAGS=${LIBCURL_CFLAGS} + + # Pass empty LDFLAGS to discard using of + # corresponding environment variable. + # It is possible that a linker flag assumes that + # some compilation flag is set. We don't pass + # CFLAGS from environment, so we should not do it + # for LDFLAGS too. + LDFLAGS= + + --prefix <INSTALL_DIR> + --enable-static + --enable-shared + + --with-zlib + ${LIBCURL_OPENSSL_OPT} + --with-ca-fallback + + --without-brotli + --without-gnutls + --without-mbedtls + --without-cyassl + --without-wolfssl + --without-mesalink + --without-nss + --without-ca-bundle + --without-ca-path + --without-libpsl + --without-libmetalink + --without-librtmp + --without-winidn + --without-libidn2 + --without-nghttp2 + --without-ngtcp2 + --without-nghttp3 + --without-quiche + --without-zsh-functions-dir + --without-fish-functions-dir + + ${ENABLED_DNS_OPT} + --enable-http + --enable-proxy + --enable-ipv6 + --enable-unix-sockets + --enable-cookies + --enable-http-auth + --enable-mime + --enable-dateparse + + ${DISABLED_DNS_OPT} + --disable-ftp + --disable-file + --disable-ldap + --disable-ldaps + --disable-rtsp + --disable-dict + --disable-telnet + --disable-tftp + --disable-pop3 + --disable-imap + --disable-smb + --disable-smtp + --disable-gopher + --disable-manual + --disable-sspi + --disable-crypto-auth + --disable-ntlm-wb + --disable-tls-srp + --disable-doh + --disable-netrc + --disable-progress-meter + --disable-dnsshuffle + --disable-alt-svc + BUILD_COMMAND cd <BINARY_DIR> && $(MAKE) + INSTALL_COMMAND cd <BINARY_DIR> && $(MAKE) install) + else() + ExternalProject_Add( + bundled-libcurl-project + SOURCE_DIR ${LIBCURL_SOURCE_DIR} + PREFIX ${LIBCURL_INSTALL_DIR} + DOWNLOAD_DIR ${LIBCURL_BINARY_DIR} + TMP_DIR ${LIBCURL_BINARY_DIR}/tmp + STAMP_DIR ${LIBCURL_BINARY_DIR}/stamp + BINARY_DIR ${LIBCURL_BINARY_DIR}/curl + CONFIGURE_COMMAND + cd <BINARY_DIR> && cmake <SOURCE_DIR> + -DCPPFLAGS=${LIBCURL_CPPFLAGS} + -DCFLAGS=${LIBCURL_CFLAGS} + -DLDFLAGS= + -DCMAKE_INSTALL_LIBDIR=lib + -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> + -DBUILD_TESTING=OFF + -DCURL_STATICLIB=ON + -DBUILD_SHARED_LIBS=OFF + -DCMAKE_USE_OPENSSL=ON + -DOPENSSL_ROOT_DIR=${FOUND_OPENSSL_ROOT_DIR} + -DCURL_CA_FALLBACK=ON + -DCMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH} + -DENABLE_ARES=${ENABLE_ARES} + -DHTTP_ONLY=ON + -DCURL_DISABLE_SMB=ON + -DCURL_DISABLE_GOPHER=ON + -DCURL_DISABLE_CRYPTO_AUTH=ON + BUILD_COMMAND cd <BINARY_DIR> && $(MAKE) -j + INSTALL_COMMAND cd <BINARY_DIR> && $(MAKE) install) + endif() add_library(bundled-libcurl STATIC IMPORTED GLOBAL) set_target_properties(bundled-libcurl PROPERTIES IMPORTED_LOCATION -- 2.17.1
next prev parent reply other threads:[~2020-05-22 12:49 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-22 12:49 [Tarantool-patches] [PATCH v1 0/4] implement OOS build Alexander V. Tikhonov 2020-05-22 12:49 ` Alexander V. Tikhonov [this message] 2020-05-22 12:49 ` [Tarantool-patches] [PATCH v1 2/4] Fix curl repository for out-of-source build Alexander V. Tikhonov 2020-05-22 12:49 ` [Tarantool-patches] [PATCH v1 3/4] Skip failing test from " Alexander V. Tikhonov 2020-05-22 12:49 ` [Tarantool-patches] [PATCH v1 4/4] gitlab-ci: add " Alexander V. Tikhonov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=7062d46554d7a5da59f1eb80a2b9daa7d1dcd1e0.1590151460.git.avtikhon@tarantool.org \ --to=avtikhon@tarantool.org \ --cc=alexander.turenko@tarantool.org \ --cc=o.piskunov@tarantool.org \ --cc=sergeyb@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v1 1/4] build: port autoconf to cmake in curl build' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox