From patchwork Tue Jun 13 22:00:03 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: 105435 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp11819qgd; Tue, 13 Jun 2017 15:04:20 -0700 (PDT) X-Received: by 10.55.102.138 with SMTP id a132mr2791462qkc.66.1497391460671; Tue, 13 Jun 2017 15:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497391460; cv=none; d=google.com; s=arc-20160816; b=gYI0rlSgELxp8GzlQhfs2M+wYUAE5dkX4aekCzGrYHeNRVrTvlbgM2WQkjguL7mwsW Lu1l0MK6TyMP8k8QE5hQBVcU76AjmhB2fgU8wY81fpeTbd9S6Z4SPYfA7+l8Lgq5R0Wo B4fyRWDe61dhG+7H4ijIJQu7DmGtRd2Ug1b5uIX8Bj0aIthYr7es0EFxjIZ/8OvML76X /qZMAiNsrHw3eZKTxhlU+j62sXrDD9nHEx2pKhD69PmCqSVxGqPRl6xPxX8uH4QcK5c6 ZjBTgLkglItijaHt2DY29voCMxG8KogQpZAGCFU9/xkiLv+UXVkBNFY2PzbdTW8HnHH5 92/g== 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=ujYKd3fvCScSE4T/BCYoQnuKZMptNfD6AHjb/kTFglc=; b=ZXfjhg+3XypHEWkjUQSFg7/V3QqheFpPXSjCPNyBn2dRkjsdL6DOPGfzmAjFTL6PT0 hgr/00H1WQi+bTdLjVmrZMtagkCJfFrNsXZfv0Y3f29NKv1OpRuAAwgKzbDEx5Y3pxpE CVlzaqxXwFoBLalyDFI47qwdS/ze8AHUqV7440KSWf7gKFs1CyR0/HW/tXgKdrxHBA+H 0XCpLy//eBZ/QCwWjZQ6NE7tEG9vzihm8L9+nuPhtl1dyXA6vx1FwQ5eABTsILkY62FI iVPrYf6vhu/AaVeXlRtQBoEJMZ9vFiouv1J5J34Z3BTmUq5SigUQXTXs343xEWWv/UqE D8Ig== 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 p37si1369159qtp.101.2017.06.13.15.04.17; Tue, 13 Jun 2017 15:04:20 -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 AB57A60A4D; Tue, 13 Jun 2017 22:04:17 +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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, 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 A3D2E60BFB; Tue, 13 Jun 2017 22:00:47 +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 ED8DD60BF7; Tue, 13 Jun 2017 22:00:22 +0000 (UTC) Received: from forward3o.cmail.yandex.net (forward3o.cmail.yandex.net [37.9.109.247]) by lists.linaro.org (Postfix) with ESMTPS id 5E8FD60A44 for ; Tue, 13 Jun 2017 22:00:17 +0000 (UTC) Received: from smtp3m.mail.yandex.net (smtp3m.mail.yandex.net [77.88.61.130]) by forward3o.cmail.yandex.net (Yandex) with ESMTP id DF5E620CCD for ; Wed, 14 Jun 2017 01:00:15 +0300 (MSK) Received: from smtp3m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3m.mail.yandex.net (Yandex) with ESMTP id B6CFA2840F4B for ; Wed, 14 Jun 2017 01:00:15 +0300 (MSK) Received: by smtp3m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id bQG4KXwTEl-0ECCHYjD; Wed, 14 Jun 2017 01:00:14 +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: Wed, 14 Jun 2017 01:00:03 +0300 Message-Id: <1497391207-13288-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497391207-13288-1-git-send-email-odpbot@yandex.ru> References: <1497391207-13288-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 45 Subject: [lng-odp] [PATCH v2 5/9] linux-gen: stop poisoning CPPFLAGS/LDFLAGS with CUnit 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 CUnit flags, use fine-grained controls for compiling/linking with CUnit. 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: 7cf390d11e69f6b677e6fbfd6414944737406fc3 ** Merge commit sha: 3808f2b5af9d034f6157eb2c7eec543ee8055fbf **/ test/common_plat/common/Makefile.am | 1 + test/common_plat/m4/validation.m4 | 19 +++++++++++-------- test/common_plat/validation/api/Makefile.inc | 2 ++ test/linux-generic/Makefile.inc | 2 ++ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/test/common_plat/common/Makefile.am b/test/common_plat/common/Makefile.am index fd41fb42..7d88d2ea 100644 --- a/test/common_plat/common/Makefile.am +++ b/test/common_plat/common/Makefile.am @@ -4,6 +4,7 @@ include $(top_srcdir)/test/Makefile.inc noinst_LTLIBRARIES = libcunit_common.la libcpumask_common.la libthrmask_common.la libcunit_common_la_SOURCES = odp_cunit_common.c +libcunit_common_la_LIBADD = $(CUNIT_LIBS) libcpumask_common_la_SOURCES = mask_common.c diff --git a/test/common_plat/m4/validation.m4 b/test/common_plat/m4/validation.m4 index d32f675a..67edac7a 100644 --- a/test/common_plat/m4/validation.m4 +++ b/test/common_plat/m4/validation.m4 @@ -26,24 +26,24 @@ AC_ARG_WITH([cunit-path], AC_HELP_STRING([--with-cunit-path=DIR path to CUnit libs and headers], [(or in the default path if not specified).]), [CUNIT_PATH=$withval - AM_CPPFLAGS="$AM_CPPFLAGS -I$CUNIT_PATH/include" - AM_LDFLAGS="$AM_LDFLAGS -L$CUNIT_PATH/lib" - cunit_support=yes],[]) + CUNIT_CPPFLAGS="-I$CUNIT_PATH/include" + CUNIT_LIBS="-L$CUNIT_PATH/lib" + cunit_support=yes],[]) ########################################################################## # Save and set temporary compilation flags ########################################################################## -OLD_LDFLAGS=$LDFLAGS +OLD_LIBS=$LIBS OLD_CPPFLAGS=$CPPFLAGS -LDFLAGS="$AM_LDFLAGS $LDFLAGS" -CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS" +LIBS="$CUNIT_LIBS $LIBS" +CPPFLAGS="$CUNIT_CPPFLAGS $CPPFLAGS" ########################################################################## # Check for CUnit availability ########################################################################## if test x$cunit_support = xyes then - AC_CHECK_LIB([cunit],[CU_get_error], [], + AC_CHECK_LIB([cunit],[CU_get_error], [CUNIT_LIBS="$CUNIT_LIBS -lcunit"], [AC_MSG_ERROR([CUnit libraries required])]) AC_CHECK_HEADERS([CUnit/Basic.h], [], [AC_MSG_FAILURE(["can't find cunit headers"])]) @@ -51,8 +51,11 @@ else cunit_support=no fi +AC_SUBST([CUNIT_CPPFLAGS]) +AC_SUBST([CUNIT_LIBS]) + ########################################################################## # Restore old saved variables ########################################################################## -LDFLAGS=$OLD_LDFLAGS +LIBS=$OLD_LIBS CPPFLAGS=$OLD_CPPFLAGS diff --git a/test/common_plat/validation/api/Makefile.inc b/test/common_plat/validation/api/Makefile.inc index 6069ee6b..177d2ac3 100644 --- a/test/common_plat/validation/api/Makefile.inc +++ b/test/common_plat/validation/api/Makefile.inc @@ -11,6 +11,8 @@ AM_CFLAGS += -I$(top_srcdir)/test/common_plat/common AM_LDFLAGS += -static AM_LDFLAGS += $(DPDK_PMDS) +AM_CPPFLAGS += $(CUNIT_CPPFLAGS) + LIBCUNIT_COMMON = $(COMMON_DIR)/libcunit_common.la LIBCPUMASK_COMMON = $(COMMON_DIR)/libcpumask_common.la LIBTHRMASK_COMMON = $(COMMON_DIR)/libthrmask_common.la diff --git a/test/linux-generic/Makefile.inc b/test/linux-generic/Makefile.inc index 6e165d8d..30b56e26 100644 --- a/test/linux-generic/Makefile.inc +++ b/test/linux-generic/Makefile.inc @@ -4,6 +4,8 @@ AM_LDFLAGS += -static +AM_CPPFLAGS += $(CUNIT_CPPFLAGS) + LIBCUNIT_COMMON = $(top_builddir)/test/common_plat/common/libcunit_common.la LIB = $(top_builddir)/lib LIBODP = $(LIB)/libodphelper.la $(LIB)/libodp-linux.la $(DPDK_PMDS)