From patchwork Fri Jun 2 14: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: 101266 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp411593qge; Fri, 2 Jun 2017 07:02:22 -0700 (PDT) X-Received: by 10.237.34.58 with SMTP id n55mr8456047qtc.117.1496412142317; Fri, 02 Jun 2017 07:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496412142; cv=none; d=google.com; s=arc-20160816; b=C24fe77iEI2uGm4VGTo0t/2+fJPuvpYv5601LXJfAcin9ty5c/c7mxWguMZ1kPzcrV rDuHKI297RRERHXkmaLuI8phjOyVa8gd3RLic8Im6fy3O1QaDhCmvWmCllEpyPGmImIj BVlq8bP/1RJJHIGISlj0hdnVefMu77QcJud0QXYa+ZrVG3ZtOFyO2o0fKtFm0pTXc09C a3G3v3mKTyrn28UYlrsBcB9flgBN3aBd9vzM4X2TQzhUU7W91KGD2tQHFLP60W9kZCxH zu7VjQc+kvvw3Rpfv9MifKnWq6A6rb94iBiz/b5v1LhxQCC3kgaMyrJKAOgpRIcjKgnq QfOw== 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=+Nv6EZAw8Xms+f1Ab0I8cb5054AAv/crOH2wao5yIl4=; b=jpTbvxBA0BqPcl9rxJFVRalIzRPqCR/d5Jf5YJDeTP/TU1Q9TYBk1M+ZHqYWXO9j34 jk8ml0LxbY1xDAaDm8xAWM9AvvLgWIfDFTyxG0tfMADn7kEUUJFYwa8OPiW5tmGhQRqh aYEeWViGIP+GT9I9wci/Ini3c+uWuRFCmnNTpotGteE0g9w3K384MWNOU5oTS5tuLOo2 IopMKHQCTFmucoHdqfkSyP14L3EZevdJpUprOZ6euuCJ0ayq6CK0Q+27J14H3hseds+m Jf65fc+7f39kUrukzIbwkYG6U+2+EByJO34rrMQATwwGnyb3UwBnqBVOuWllmXQ0Pyda 4wdw== 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 g20si1780342qta.45.2017.06.02.07.02.22; Fri, 02 Jun 2017 07:02:22 -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 078D860F0A; Fri, 2 Jun 2017 14:02:22 +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 BA2D360889; Fri, 2 Jun 2017 14:01:13 +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 C4C2F60682; Fri, 2 Jun 2017 14:01:01 +0000 (UTC) Received: from forward3h.cmail.yandex.net (forward3h.cmail.yandex.net [87.250.230.18]) by lists.linaro.org (Postfix) with ESMTPS id 71E0B60E2C for ; Fri, 2 Jun 2017 14:00:15 +0000 (UTC) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::26]) by forward3h.cmail.yandex.net (Yandex) with ESMTP id DB53220F93 for ; Fri, 2 Jun 2017 17:00:13 +0300 (MSK) Received: from smtp2o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2o.mail.yandex.net (Yandex) with ESMTP id 250615080F5D for ; Fri, 2 Jun 2017 17:00:12 +0300 (MSK) Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id cZMbbMEits-0Boe2BSH; Fri, 02 Jun 2017 17:00:11 +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: Fri, 2 Jun 2017 17:00:00 +0300 Message-Id: <1496412007-23455-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496412007-23455-1-git-send-email-odpbot@yandex.ru> References: <1496412007-23455-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 45 Subject: [lng-odp] [PATCH v1 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: e6be64e01589f1aa335ea178e8314bf35ad34847 ** Merge commit sha: 6f335855aeda94f83296fb7e0d08b293ea4121db **/ pkgconfig/libodp-linux.pc.in | 2 +- platform/linux-generic/Makefile.am | 4 ++++ platform/linux-generic/m4/odp_openssl.m4 | 17 +++++++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/pkgconfig/libodp-linux.pc.in b/pkgconfig/libodp-linux.pc.in index bf339fe8..ba36bafa 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 +Libs.private: @OPENSSL_STATIC_LIBS@ -lpcap @PTHREAD_LIBS@ -lrt -lpthread Cflags: -I${includedir} diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 69fdf8b9..0eb31c04 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 @@ -219,6 +221,8 @@ __LIB__libodp_linux_la_SOURCES = \ arch/@ARCH_DIR@/odp_cpu_arch.c \ arch/@ARCH_DIR@/odp_sysinfo_parse.c +__LIB__libodp_linux_la_LIBADD = $(OPENSSL_LIBS) + if HAVE_PCAP __LIB__libodp_linux_la_SOURCES += pktio/pcap.c endif 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