From patchwork Sat Jul 1 06:00:16 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: 106784 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp3153574qge; Fri, 30 Jun 2017 23:01:41 -0700 (PDT) X-Received: by 10.55.20.156 with SMTP id 28mr28070282qku.191.1498888901610; Fri, 30 Jun 2017 23:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498888901; cv=none; d=google.com; s=arc-20160816; b=PH43hQleOA9JpejWHJD3b5gByFolDz9YGVrGS9Mkf46dYl3HoJPp9xUos0fkmygUvJ BKgpZmVcQcelds2eBuJ7Mlj7qdweg/5Ssn8NFHCeREbgNjhbK3HwkVV3KBXAKuc4jW6p CZn7iO6xA5cjIbZm10wvWfAo0MppQhwB4uZMK/KR0PQz/TBiablmNnOfxLL58Sv2q+C6 VRNNQ38aBf4V/susmm5ArOjuz+wTOmVsHVAFlV8lFc0gtd8gdTF+NgnfTqWsTAVTUKkW mlbl2Ob7il0Q+f098Jpx4uVRZoNrIj0Oyej2MY9V7qHFNqkEDfD3DjRQ2KzIz9vRHw+k qZMA== 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=Lu2i0+klA4SIegf8NBxZDPJpVxKEGjAHf9z/RH4L9NQ=; b=mnDwyeHKX6v5ouqhMCX+ERcd+jEMeGWtGClP+YW4i8HInCM2pueCfoLSt1Xo1Jr0fA QF1ZYg2+a7z9U2LBajmc4U+oMI8jXBrUJn/Z5Wfq3gRyhsAcS/1BvT/v0NNFSQfbwoY5 ShrAms+Fh6/KuhZ0ImKAGlcKUfv7LsAdCgg0/TCZXlAIIajkV7BPwnicWlE5raxEASNz WBaBIBwa4kDgWNqXEv0Vtj/lUr8BHt0UmaqwVHeyQk8u5n59o3lGHV9ciDBsXoCxX7o3 2sYWr6t9Fcrlr05ZvWO4N2HPCg/wfNtrg0+8/qk7urCCovMGJK0tZ5rWQQ8oJ1azeRV+ JV1w== 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 g16si9607921qtc.5.2017.06.30.23.01.41; Fri, 30 Jun 2017 23:01:41 -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 422B962D32; Sat, 1 Jul 2017 06:01:41 +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, 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 0775962875; Sat, 1 Jul 2017 06:00:40 +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 06D3E6071D; Sat, 1 Jul 2017 06:00:32 +0000 (UTC) Received: from forward4m.cmail.yandex.net (forward4m.cmail.yandex.net [5.255.216.22]) by lists.linaro.org (Postfix) with ESMTPS id 0BF8060669 for ; Sat, 1 Jul 2017 06:00:30 +0000 (UTC) Received: from smtp3m.mail.yandex.net (smtp3m.mail.yandex.net [IPv6:2a02:6b8:0:2519::125]) by forward4m.cmail.yandex.net (Yandex) with ESMTP id A282520F7F for ; Sat, 1 Jul 2017 09:00:28 +0300 (MSK) Received: from smtp3m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3m.mail.yandex.net (Yandex) with ESMTP id 84B1C2840CED for ; Sat, 1 Jul 2017 09:00:28 +0300 (MSK) Received: by smtp3m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id uZqkAfj1Oz-0RDqBAGl; Sat, 01 Jul 2017 09:00:27 +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 09:00:16 +0300 Message-Id: <1498888823-4065-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1498888823-4065-1-git-send-email-odpbot@yandex.ru> References: <1498888823-4065-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 45 Subject: [lng-odp] [PATCH v4 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: eee6b6add9a03184bf2f3198f07e983bb88c0e0a **/ 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