From patchwork Fri Jun 30 23:00:07 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: 106773 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2879958qge; Fri, 30 Jun 2017 16:01:32 -0700 (PDT) X-Received: by 10.55.104.195 with SMTP id d186mr26997576qkc.176.1498863692652; Fri, 30 Jun 2017 16:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498863692; cv=none; d=google.com; s=arc-20160816; b=At2TbqAEC1I5hGsl8baxBkfGi8+zyjuct4N2QQjPm8MbKCXUVKnmbw/Vve0UAJtUQm euo9RVW3J/dDiqZKkx0/u74uziPECMgnMfGEL4bv9MA79jso/XdQ7QzP+OtMmR2TS41l LMiEfBa8LF8MTC1+L7Sa3D+h0Wh4p6eV0bQ5g3I07XIGnMdgQF1C4ZewjdbCPTpJRTi9 J6ks7x0H669KzREwgsRKRrKaGv5k4HwlQJmnM0shGxIPLA8i1Zq3PGyd+oL2IMzwXKCs Eu622s1JRQvXiTSpXqwRVg+//7gwys4TFZ0RY27T22zf6DHPVC4aEoGkPaD+fA3dDGi7 MFPQ== 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=iHu29hPnOGcqwaQALzfOZbYQ4HbkX7i+mbgMtE6a0ME=; b=t/AKJSQLKO/ae4taIFE3Vu0CpbhL5UTqfzHCrwAhCxpFTm+lmgpuSshOfAqHBa3eJR kXCPtRJsORTHL98fST0nZxXndyKv9yGQDnyxf/R9Nk2PGxC+4Xw9abNyNhuw6CfcNJ1s NwBghS1TFIe7X8AwUqbTSYhYg+R7ueQ2635+1f6W+UArqsWXsaE5E9BAfLTX1cUGj5Qx rGLqWn0GmE8r/hyUSym5H8bRnjunIK3EDQN2towdmNpfnaQ+nmSdG99wOhMZkhcejytp eYKQCYRw1fwlizSDSYgFyGa9ZctpvjGF8w2CvzVfpORmAN/UsVpKNSD/G4OiEQgEQ1dy zVGQ== 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 d51si8679722qtb.292.2017.06.30.16.01.32; Fri, 30 Jun 2017 16:01:32 -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 4DB1760C6A; Fri, 30 Jun 2017 23:01:32 +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=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED, URIBL_SBL, URIBL_SBL_A 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 9D96062AE7; Fri, 30 Jun 2017 23:00:28 +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 5B8DA60A06; Fri, 30 Jun 2017 23:00:22 +0000 (UTC) Received: from forward1j.cmail.yandex.net (forward1j.cmail.yandex.net [5.255.227.19]) by lists.linaro.org (Postfix) with ESMTPS id BE819609FF for ; Fri, 30 Jun 2017 23:00:20 +0000 (UTC) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::28]) by forward1j.cmail.yandex.net (Yandex) with ESMTP id 1436D20745 for ; Sat, 1 Jul 2017 02:00:19 +0300 (MSK) Received: from smtp4o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4o.mail.yandex.net (Yandex) with ESMTP id DFAF36C0110F for ; Sat, 1 Jul 2017 02:00:18 +0300 (MSK) Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id jomLhvwstF-0H7OuZ8E; Sat, 01 Jul 2017 02:00:18 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Sat, 1 Jul 2017 02:00:07 +0300 Message-Id: <1498863614-26294-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1498863614-26294-1-git-send-email-odpbot@yandex.ru> References: <1498863614-26294-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 45 Subject: [lng-odp] [PATCH v3 2/9] linux-gen: stop poisoning CPPFLAGS/LDFLAGS with OpenSSL flags 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 Instead of poisoning global AM_CPPFLAGS/AM_LDFLAGS with OpenSSL flags, use fine-grained controls for compiling/linking with OpenSSL. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 45 (lumag:m4) ** https://github.com/Linaro/odp/pull/45 ** Patch: https://github.com/Linaro/odp/pull/45.patch ** Base sha: ceeab69f3af67701adb524c7b9757d19cefb1110 ** Merge commit sha: bc5ee5a9b895a630b180cd264a55c8e4817de750 **/ pkgconfig/libodp-linux.pc.in | 2 +- platform/linux-generic/Makefile.am | 3 +++ platform/linux-generic/m4/odp_openssl.m4 | 17 +++++++++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgconfig/libodp-linux.pc.in b/pkgconfig/libodp-linux.pc.in index 1a8d489f..0c5883b6 100644 --- a/pkgconfig/libodp-linux.pc.in +++ b/pkgconfig/libodp-linux.pc.in @@ -7,5 +7,5 @@ Name: libodp-linux Description: The ODP packet processing engine Version: @PKGCONFIG_VERSION@ Libs: -L${libdir} -lodp-linux -Libs.private: -lcrypto -ldl -lpcap @PTHREAD_LIBS@ -lrt -lpthread @ATOMIC_LIBS@ +Libs.private: @OPENSSL_STATIC_LIBS@ -lpcap @PTHREAD_LIBS@ -lrt -lpthread @ATOMIC_LIBS@ Cflags: -I${includedir} diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 989a65b6..eb7b0422 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -11,6 +11,8 @@ AM_CFLAGS += -I$(top_builddir)/include AM_CFLAGS += -Iinclude AM_CFLAGS += -D_ODP_PKTIO_IPC +AM_CPPFLAGS += $(OPENSSL_CPPFLAGS) + include_HEADERS = \ $(top_srcdir)/include/odp.h \ $(top_srcdir)/include/odp_api.h @@ -254,6 +256,7 @@ __LIB__libodp_linux_la_SOURCES += pktio/pcap.c endif __LIB__libodp_linux_la_LIBADD = $(ATOMIC_LIBS) +__LIB__libodp_linux_la_LIBADD += $(OPENSSL_LIBS) # Create symlink for ABI header files. Application does not need to use the arch # specific include path for installed files. diff --git a/platform/linux-generic/m4/odp_openssl.m4 b/platform/linux-generic/m4/odp_openssl.m4 index 2344914b..1d520077 100644 --- a/platform/linux-generic/m4/odp_openssl.m4 +++ b/platform/linux-generic/m4/odp_openssl.m4 @@ -5,8 +5,8 @@ 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 - AM_CPPFLAGS="$AM_CPPFLAGS -I$OPENSSL_PATH/include" - AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib" + OPENSSL_CPPFLAGS="-I$OPENSSL_PATH/include" + OPENSSL_LIBS="-L$OPENSSL_PATH/lib" ],[]) ########################################################################## @@ -14,19 +14,24 @@ AC_HELP_STRING([--with-openssl-path=DIR path to openssl libs and headers], ########################################################################## OLD_LDFLAGS=$LDFLAGS OLD_CPPFLAGS=$CPPFLAGS -LDFLAGS="$AM_LDFLAGS $LDFLAGS" -CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS" +LIBS="$OPENSSL_LIBS $LIBS" +CPPFLAGS="$OPENSSL_CPPFLAGS $CPPFLAGS" ########################################################################## # Check for OpenSSL availability ########################################################################## -AC_CHECK_LIB([crypto], [EVP_EncryptInit], [], +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 ########################################################################## -LDFLAGS=$OLD_LDFLAGS +LIBS=$OLD_LIBS CPPFLAGS=$OLD_CPPFLAGS