From patchwork Thu Oct 5 17:59:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 114967 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp867383qgn; Thu, 5 Oct 2017 11:05:00 -0700 (PDT) X-Google-Smtp-Source: AOwi7QD0lUS/6O8aLOnC04SRTY8EkY+6s6pFqC4zP0brgJCWd7Z7jrMeF4p19XV6XcAiKdwwOIrn X-Received: by 10.107.212.24 with SMTP id l24mr3527535iog.59.1507226700502; Thu, 05 Oct 2017 11:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507226700; cv=none; d=google.com; s=arc-20160816; b=YzC2QmthTX7fwbmHmNhZ9G2AT1jOgi7cKv1pwwapES4wVDtyZNdJyelXZS3roNLJee HE7f2A1ZmCsRueiSucx/utQSIrs8bXmbfg/6h7W0w+0clIMjL+iCBx/+fx6gjvX8esd5 QhI/nqx/qADjxOxDSKhWMCo9cPZgKLLC2eGHUMnVg1y82FMcqy/DkqiS18cWZpgtEpE7 uizTBOQXB/4hudzvgnWtD8s8rt/tWpoZyzH6nIcn8J3Ik2Vz9lDYd74zMHLQ9cNgaqyZ QTUbwQ0tI+nsbcHY3eZdbu110aWCGBByre7amvuNvrgC+uDqSzoE+5bAO0brDcnp2vaN hiCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=aV0F76XsIJSERBNHk0GlPGUMr3RiElSaZKMYgnfoLw4=; b=aKp7hHgE9hG2pWVemFPo/XfJkGpOszaXKelB540UH4ZYoPT69HJ5u9b2fNpSca7nx3 dZY9IhmxcT66ffkMohcNe0zo0r9Eu3P/lN4d16gJAxtFUa1TI4ZVK0VECDLLMmE9AriC w7QVvMh4MhDfWeDXBadWVYWqqKpjRFMpkEm2zLbFBcnTZxp7edu7d7738rCYrKi1KZP/ TdA4qRP00tX/wdLbFYVVzF+frCgbcv9oCZeT42FABN95Oj56eMKnt5kvcND8VzVi1PUl n2ApfHHOPeVgwUhDywqSJAOmUAUB70nC/7XsmWaksN+xWkWZLtJ86ikz4zQSErcjrHSZ Vw9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w66si15183180iow.100.2017.10.05.11.05.00; Thu, 05 Oct 2017 11:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id CEBA965BCA; Thu, 5 Oct 2017 18:04:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 0996A644B6; Thu, 5 Oct 2017 18:02:14 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 82476644A8; Thu, 5 Oct 2017 18:02:03 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id 45F09644A8 for ; Thu, 5 Oct 2017 18:00:25 +0000 (UTC) Received: from mxback10j.mail.yandex.net (mxback10j.mail.yandex.net [IPv6:2a02:6b8:0:1619::113]) by forward104j.mail.yandex.net (Yandex) with ESMTP id BCA4C416C0 for ; Thu, 5 Oct 2017 21:00:21 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback10j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id bXGJFw4gOP-0LiKKYXD; Thu, 05 Oct 2017 21:00:21 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AZHOFl0KbL-0LWCFdYW; Thu, 05 Oct 2017 21:00:21 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 5 Oct 2017 20:59:57 +0300 Message-Id: <1507226415-26756-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507226415-26756-1-git-send-email-odpbot@yandex.ru> References: <1507226415-26756-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 213 Subject: [lng-odp] [PATCH v3 2/20] m4: move openssl check to common place X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 213 (lumag:plat-def) ** https://github.com/Linaro/odp/pull/213 ** Patch: https://github.com/Linaro/odp/pull/213.patch ** Base sha: 52cfe7ba6d2541cf5ee464e46e91b2da5efe1497 ** Merge commit sha: 4157d06d3a16265d7d6152d7ae4918ec5623c10c **/ m4/odp_openssl.m4 | 60 ++++++++++++++++++++++++++++++++ platform/linux-generic/m4/configure.m4 | 2 +- platform/linux-generic/m4/odp_openssl.m4 | 37 -------------------- 3 files changed, 61 insertions(+), 38 deletions(-) create mode 100644 m4/odp_openssl.m4 delete mode 100644 platform/linux-generic/m4/odp_openssl.m4 diff --git a/m4/odp_openssl.m4 b/m4/odp_openssl.m4 new file mode 100644 index 000000000..72568a8ae --- /dev/null +++ b/m4/odp_openssl.m4 @@ -0,0 +1,60 @@ +# ODP_OPENSSL([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ----------------------------------------------------- +AC_DEFUN([ODP_OPENSSL], +[dnl +AC_ARG_VAR([OPENSSL_CPPFLAGS], [C preprocessor flags for OpenSSL]) +AC_ARG_VAR([OPENSSL_LIBS], [linker flags for OpenSSL crypto library]) +AC_ARG_VAR([OPENSSL_STATIC_LIBS], [static linker flags for OpenSSL crypto library]) + +########################################################################## +# Set optional OpenSSL path +########################################################################## +AC_ARG_WITH([openssl-path], +[AC_HELP_STRING([--with-openssl-path=DIR], + [path to openssl libs and headers (use system path if not provided)])], +[OPENSSL_CPPFLAGS="-I$withval/include" +OPENSSL_LIBS="-L$withval/lib -lcrypto"], +[if test "x$ac_cv_env_OPENSSL_LIBS_set" != "xset" ; then + OPENSSL_LIBS="-lcrypto" +fi]) +if test "x$ac_cv_env_OPENSSL_STATIC_LIBS_set" != "xset" ; then + OPENSSL_STATIC_LIBS="$OPENSSL_LIBS -ldl" +fi + +########################################################################## +# Save and set temporary compilation flags +########################################################################## +OLD_CPPFLAGS=$CPPFLAGS +OLD_LIBS=$LIBS +CPPFLAGS="$OPENSSL_CPPFLAGS $CPPFLAGS" +LIBS="$OPENSSL_LIBS $LIBS" + +########################################################################## +# Check for OpenSSL availability +########################################################################## +odp_openssl_ok=yes +AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [], + [odp_openssl_ok=no]) +AC_CACHE_CHECK([for EVP_EncryptInit in -lcrypto], [odp_cv_openssl_crypto], +[AC_LINK_IFELSE([AC_LANG_CALL([], [EVP_EncryptInit])], + [odp_cv_openssl_crypto=yes], + [odp_cv_openssl_crypto=no])]) +if test "x$odp_cv_openssl_crypto" != "xyes" ; then + odp_openssl_ok=no +fi + +if test "x$odp_openssl_ok" = "xyes" ; then + m4_default([$1], [:]) +else + OPENSSL_CPPFLAGS="" + OPENSSL_LIBS="" + OPENSSL_STATIC_LIBS="" + m4_default([$2], [AC_MSG_FAILURE([OpenSSL not found])]) +fi + +########################################################################## +# Restore old saved variables +########################################################################## +LIBS=$OLD_LIBS +CPPFLAGS=$OLD_CPPFLAGS +]) # ODP_OPENSSL diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 index 8e008de44..63540c7eb 100644 --- a/platform/linux-generic/m4/configure.m4 +++ b/platform/linux-generic/m4/configure.m4 @@ -76,7 +76,7 @@ AC_SUBST([ATOMIC_LIBS]) m4_include([platform/linux-generic/m4/odp_pthread.m4]) m4_include([platform/linux-generic/m4/odp_timer.m4]) -m4_include([platform/linux-generic/m4/odp_openssl.m4]) +ODP_OPENSSL m4_include([platform/linux-generic/m4/odp_pcap.m4]) m4_include([platform/linux-generic/m4/odp_netmap.m4]) m4_include([platform/linux-generic/m4/odp_dpdk.m4]) diff --git a/platform/linux-generic/m4/odp_openssl.m4 b/platform/linux-generic/m4/odp_openssl.m4 deleted file mode 100644 index 1d520077c..000000000 --- a/platform/linux-generic/m4/odp_openssl.m4 +++ /dev/null @@ -1,37 +0,0 @@ -########################################################################## -# Set optional OpenSSL path -########################################################################## -AC_ARG_WITH([openssl-path], -AC_HELP_STRING([--with-openssl-path=DIR path to openssl libs and headers], - [(or in the default path if not specified).]), - [OPENSSL_PATH=$withval - OPENSSL_CPPFLAGS="-I$OPENSSL_PATH/include" - OPENSSL_LIBS="-L$OPENSSL_PATH/lib" - ],[]) - -########################################################################## -# Save and set temporary compilation flags -########################################################################## -OLD_LDFLAGS=$LDFLAGS -OLD_CPPFLAGS=$CPPFLAGS -LIBS="$OPENSSL_LIBS $LIBS" -CPPFLAGS="$OPENSSL_CPPFLAGS $CPPFLAGS" - -########################################################################## -# Check for OpenSSL availability -########################################################################## -AC_CHECK_LIB([crypto], [EVP_EncryptInit], [OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto" - OPENSSL_STATIC_LIBS="$OPENSSL_LIBS -ldl"], - [AC_MSG_FAILURE([OpenSSL libraries required])]) -AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [], - [AC_MSG_ERROR([OpenSSL headers required])]) - -AC_SUBST([OPENSSL_CPPFLAGS]) -AC_SUBST([OPENSSL_LIBS]) -AC_SUBST([OPENSSL_STATIC_LIBS]) - -########################################################################## -# Restore old saved variables -########################################################################## -LIBS=$OLD_LIBS -CPPFLAGS=$OLD_CPPFLAGS