From patchwork Thu Oct 5 09:00:00 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: 114853 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp6745edb; Thu, 5 Oct 2017 02:07:10 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCk0CgEoRG+HAtxosTz+oLYZ02WqQZJmXgCsgeYjpWGjkLOHd2/ms12wn7d/GK9Lq6ZJWko X-Received: by 10.237.56.102 with SMTP id j93mr16706277qte.57.1507194430383; Thu, 05 Oct 2017 02:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507194430; cv=none; d=google.com; s=arc-20160816; b=grIt6uVxxOyQcdrot6YKS2ooMgxZjTj0wej6a41CaokHLuFuDyBkUw/qU9J8NmCPyp 8l54b98Dor0m6gNC7BVa/1GOuAvFHNowKUyRDPNWITZzNlYOZeijwB9HkMiW3SLuHt8l sPZlhtSkOIl87xTvYr82gZL+ih/HLvuZ9hi/Q/HsUuSwEur0J6nBU2fzlVGZCeT0r+Qi mmccnVKO0CHsyFmEhW2DD4hTzKn7prllNPzRn/LDF2THbaFKty3sUx5H/XCD0DKDGwYv ZIzww+3yQR7t9WcwDRo4oC+atkTqsMEAqcoJ8/HG+UrPNJQZGZ/xsMTjxD4KfbMLfxCk d3cA== 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=gOHcvy1bdZiyowVnAFMLRqlNMva7HTNDT/kY6jVReUY=; b=vlH/2djGlp1NdGnXKIvLixLRD0giNz4owlsryk63NFN/Hl0Dy9QeMzlXv6rfAD9to2 Uo+hJVDqCRzuujW7vNSEZ/OYp4N1wMdTknzgIcmGZpz9zatakDP8DRT0iePeqiLpkuEv SQ83fh0D6VUAmVdzpSTvgOm+hdf4OqL3FJdi3Jiym919QqsGzfTA6maGG+IEoET2VVDQ 4uNIRPXn6aKt2q1DKCeLQAiY0KKC+BoCzkD2NcZDjEuyKZ7df/WoGIl4KHkJsdC5fXaI dSBf/9V1ivr8Ze8JSnQRsATzFAnKxUn7L2jl/H8i9NyZJM4Xk9w9sQ6qdmB6hVpgtVTT FSuA== 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 p11si4386808qtb.373.2017.10.05.02.07.10; Thu, 05 Oct 2017 02:07:10 -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 02E5B644B8; Thu, 5 Oct 2017 09:07:10 +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 0823A62C5C; Thu, 5 Oct 2017 09:01:39 +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 936AC644BB; Thu, 5 Oct 2017 09:01:30 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 7F95162C5C for ; Thu, 5 Oct 2017 09:00:28 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 402B84302465 for ; Thu, 5 Oct 2017 12:00:24 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id BVqEWJD0ox-0OMuGjdJ; Thu, 05 Oct 2017 12:00:24 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id crpg26GhCG-0NaSBGTF; Thu, 05 Oct 2017 12:00:23 +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 12:00:00 +0300 Message-Id: <1507194018-5453-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507194018-5453-1-git-send-email-odpbot@yandex.ru> References: <1507194018-5453-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 213 Subject: [lng-odp] [PATCH v1 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: 62f1037bdb0ffd5482e47209bfdbf7d820204116 **/ 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