From patchwork Fri Oct 6 18: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: 115114 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2126657qgn; Fri, 6 Oct 2017 12:02:51 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAG4Mhh4DBS2RY4sKBxgjL3k6uJ59olaYSvmBS6zhv2reWXxsqXiCIRBqFAW1GW8zPjQI9m X-Received: by 10.107.22.65 with SMTP id 62mr3821067iow.269.1507316570989; Fri, 06 Oct 2017 12:02:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507316570; cv=none; d=google.com; s=arc-20160816; b=Oeb59+/thsidgY1y0TfCQ9ePc+YDu34WBOs7W/S43uzksYhTAodfPljYFVPiniDvGR KfpH8vnMzO+Uk2BeEvkRjGTJUdwWgV0g2wL8dZv32T+ARB7mQhq5K6nbGXjgDYoB6KaW 9HBnOwvWvHNHIVGbj1+cB2vp7pM0qvMj9pfxtL8r79v3dRR8hI3Sl9V5F3gkjGacyS9H 3Lo4szSFyfBCSb+xbym6uci0+dePkqvNNgfSEi4XWXCeU3KoxLTxfQtKDpS/uyN+NHkI 0dj+66B80QajtPeLpER9snEumfVVjkw4C27DhcEmFJNO7Wlq/TBIOwTa47GRRpS5A8St J+iA== 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=Ff5etRWqPl8r4dMC/tzacpJJQaOfpk+iNKgCqf4sZYU=; b=mK04sHUzkTsUGjodgIDV4y/Tgd4q96OLBvS3fC0gcPrsRwNl/0susEc6JZNHOrkGAF +0M5Ywc0DwD2sQTRGiYxubPkE1tG8UMt0XFyVYHksT5rHwBfjEM3ru77K8lv6/15THS6 pFPGnZzG9g4Uh7mkrctlVWuvgk2uWU60Bp2t7PMzFkjTCuTkIbM6XsIhSGL8yYHDAaDy Jqy5V+/uV3GqZVSANKxVv0KmWb5WtSIiX9FWsRlxWNQosOxMeovG03ivls3jxWAL/YX+ GIRmGRDraRzhMmfrOjZm5LfAtbcCQJ8VLg15GIjZfUToWodeQcgAmu2eVe0JMOJQYobk opVA== 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 z1si1709768itg.207.2017.10.06.12.02.50; Fri, 06 Oct 2017 12:02:50 -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 3C9DA65C01; Fri, 6 Oct 2017 19:02:50 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 6E69165BE3; Fri, 6 Oct 2017 19:01:30 +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 8DDD665BD3; Fri, 6 Oct 2017 19:01:25 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 3D45A644E1 for ; Fri, 6 Oct 2017 19:00:29 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward100p.mail.yandex.net (Yandex) with ESMTP id E4A595103211 for ; Fri, 6 Oct 2017 22:00:27 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id DvSUGJ5t9M-0RZCpTlu; Fri, 06 Oct 2017 22:00:27 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id d2nf8B3eVo-0QtGRRHD; Fri, 06 Oct 2017 22:00:26 +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: Fri, 6 Oct 2017 21:59:57 +0300 Message-Id: <1507316415-2144-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507316415-2144-1-git-send-email-odpbot@yandex.ru> References: <1507316415-2144-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 213 Subject: [lng-odp] [PATCH v4 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: a63f25ff2994b2df78c24f1f8b63d0e06628eb68 ** Merge commit sha: d50e2e291ff11c1319e66c699d2f82260d59c383 **/ 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