From patchwork Wed Aug 30 17:00:06 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: 111329 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp1245660qge; Wed, 30 Aug 2017 10:07:26 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5Gna/tK2PUljLMBhqbEbeF4z+05FQ+4yCpzd+uep6sKBhXbd6RjJUDXtp1LQzJfIgdw56K X-Received: by 10.200.52.143 with SMTP id w15mr3426316qtb.52.1504112846322; Wed, 30 Aug 2017 10:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504112846; cv=none; d=google.com; s=arc-20160816; b=Z0fGF2/hDM4mjbbRlV6wV3Wr8AQogCwSNK6hUOwkA3ZhHeDNGvJZTMRgj9c9FGRA50 AFO0Ci9g0czRO6wK80V55i4hh1fD0JUCc7ww9/Z8cjGjyBh48nsjdvzd/VQP4vasIa2T GZQbmYqnPDYzq4H7szgmERxnM/4vvL5U+i7ur7SKfCt79EYPZPoHpjYoebxxSK+awze1 6ZkQb98ix1TqN72JN3pbcmrF7vTSMhGAzh5UlTqnPjK20I4RVw1NI8Nt5FLk536yH2fv rRENM4kUj3AmBBnD4gJuT2UvtaLSfZbDYuGyXL9vR4t5tl6WWcZ3EnzeLWMl+N5+48ck /vDw== 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=AzfOwJTSSzKrFs7f27dsDppOoDr0bUyafeBNoAFKJDs=; b=dqugoQmcBMWccVwbIBXamC6pq5hMqPF0qZmKHw7ZSrW02FYRGThWIUbiFf1FAkeqMl U0kF+sUcVVvI/NKS4Y7vicbGPEYED3KVn6FPAPCv++bPz684A+CkV5gxqrVbOGHu5LrH zBb76TWnCeq0G/idUP1ZhP+txeIlIlSN/Z3/xSVWU30Mo0N06ZbZupVK1QHhYIBESHdH W1ygX1rlbOXSbg2u2Nyx3yjXAb5mVdWJlHZ5fmGm9Err5s0v1tAe3FPqVG57Uh86uJ5e FsoV/S+7Tte51CRspFBoRfLRATNt9tqXi3r9W/pViY0vEgGhF47dRvjvwUiVRqHO9wue C6IQ== 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 o35si5830091qte.365.2017.08.30.10.07.25; Wed, 30 Aug 2017 10:07:26 -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 D4A6962D05; Wed, 30 Aug 2017 17:07:25 +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,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 E78A262AE6; Wed, 30 Aug 2017 17:01:23 +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 1A1526081E; Wed, 30 Aug 2017 17:01:19 +0000 (UTC) Received: from forward4o.cmail.yandex.net (forward4o.cmail.yandex.net [37.9.109.248]) by lists.linaro.org (Postfix) with ESMTPS id E2D4D62C60 for ; Wed, 30 Aug 2017 17:00:27 +0000 (UTC) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [5.45.198.129]) by forward4o.cmail.yandex.net (Yandex) with ESMTP id DB3E5214D4 for ; Wed, 30 Aug 2017 20:00:26 +0300 (MSK) Received: from smtp4j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4j.mail.yandex.net (Yandex) with ESMTP id B1B643240D40 for ; Wed, 30 Aug 2017 20:00:26 +0300 (MSK) Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id vVX7TjUjPU-0PLOtL8t; Wed, 30 Aug 2017 20:00:25 +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, 30 Aug 2017 20:00:06 +0300 Message-Id: <1504112406-3108-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504112406-3108-1-git-send-email-odpbot@yandex.ru> References: <1504112406-3108-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 155 Subject: [lng-odp] [PATCH v4 9/9] configure, travis: switch to pkg-config to locate CUnit 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 155 (lumag:improve-build-2) ** https://github.com/Linaro/odp/pull/155 ** Patch: https://github.com/Linaro/odp/pull/155.patch ** Base sha: 7508c5ac906bb7cb1d339b4c5e924f3a18e504ca ** Merge commit sha: 82cd6ec8e88e93808778f00e24852395a62ae20b **/ .travis.yml | 17 ++++-------- test/Makefile.inc | 2 +- test/common_plat/m4/validation.m4 | 40 +++------------------------- test/common_plat/validation/api/Makefile.inc | 2 +- test/linux-generic/Makefile.inc | 2 +- 5 files changed, 12 insertions(+), 51 deletions(-) diff --git a/.travis.yml b/.travis.yml index 45ffa396..a14974c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -108,6 +108,7 @@ before_install: sudo make install popd fi + - export PKG_CONFIG_PATH="$HOME/cunit-install/$CROSS_ARCH/lib/pkgconfig:${PKG_CONFIG_PATH}" - find $HOME/cunit-install install: @@ -154,7 +155,7 @@ script: --enable-user-guides --with-dpdk-path=`pwd`/dpdk/${TARGET} --with-netmap-path=`pwd`/netmap - --with-cunit-path=$HOME/cunit-install/$CROSS_ARCH $CONF + $CONF --enable-debug=full --enable-helper-linux - make -j $(nproc) @@ -165,10 +166,10 @@ script: - echo "Checking linking and run from install..." - pushd $HOME - echo "Dynamic link.." - - ${CC} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig pkg-config --cflags --libs libodp-linux` + - ${CC} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux` - LD_LIBRARY_PATH="${HOME}/odp-install/lib:$LD_LIBRARY_PATH" ./odp_hello_inst - echo "Static link.." - - ${CC} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig pkg-config --cflags --libs libodp-linux --static` -static + - ${CC} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux --static` -static - ./odp_hello_inst - ccache -s @@ -184,7 +185,6 @@ jobs: --enable-debug=full --disable-test-cpp --enable-helper-linux - --with-cunit-path=$HOME/cunit-install/$CROSS_ARCH - make -j $(nproc) - stage: test compiler: "\"clang-3.8 --target=aarch64-linux-gnu\"" @@ -196,7 +196,6 @@ jobs: --enable-debug=full --disable-test-cpp --enable-helper-linux - --with-cunit-path=$HOME/cunit-install/$CROSS_ARCH - make -j $(nproc) - stage: test compiler: arm-linux-gnueabihf-gcc @@ -208,7 +207,6 @@ jobs: --enable-debug=full --disable-test-cpp --enable-helper-linux - --with-cunit-path=$HOME/cunit-install/$CROSS_ARCH - make -j $(nproc) - stage: test compiler: "\"clang-3.8 --target=arm-linux-gnueabihf\"" @@ -220,7 +218,6 @@ jobs: --enable-debug=full --disable-test-cpp --enable-helper-linux - --with-cunit-path=$HOME/cunit-install/$CROSS_ARCH - make -j $(nproc) - stage: test compiler: powerpc-linux-gnu-gcc @@ -232,7 +229,6 @@ jobs: --enable-debug=full --disable-test-cpp --enable-helper-linux - --with-cunit-path=$HOME/cunit-install/$CROSS_ARCH - make -j $(nproc) - stage: test compiler: "\"clang-3.8 --target=powerpc-linux-gnu\"" @@ -244,7 +240,6 @@ jobs: --enable-debug=full --disable-test-cpp --enable-helper-linux - --with-cunit-path=$HOME/cunit-install/$CROSS_ARCH - make -j $(nproc) - stage: test env: TEST=coverage @@ -256,7 +251,6 @@ jobs: --with-dpdk-path=`pwd`/dpdk/${TARGET} --with-netmap-path=`pwd`/netmap CFLAGS="-O0 -coverage" - --with-cunit-path=$HOME/cunit-install/$CROSS_ARCH CXXFLAGS="-O0 -coverage" LDFLAGS="--coverage" --enable-debug=full --enable-helper-linux @@ -269,8 +263,7 @@ jobs: - ./bootstrap - ./configure --prefix=$HOME/odp-install --enable-user-guides - --with-cunit-path=$HOME/cunit-install/$CROSS_ARCH - - sudo PATH="$PATH" LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make distcheck DISTCHECK_CONFIGURE_FLAGS="--with-cunit-path=$HOME/cunit-install/$CROSS_ARCH" + - sudo PATH="$PATH" LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make distcheck - stage: test env: TEST=doxygen compiler: gcc diff --git a/test/Makefile.inc b/test/Makefile.inc index 0fbc3c42..728868df 100644 --- a/test/Makefile.inc +++ b/test/Makefile.inc @@ -16,7 +16,7 @@ INCFLAGS = \ -I$(top_builddir)/include AM_CFLAGS += $(INCFLAGS) -AM_CPPFLAGS += $(CUNIT_CPPFLAGS) +AM_CFLAGS += $(CUNIT_CFLAGS) AM_CXXFLAGS = $(INCFLAGS) AM_LDFLAGS += -L$(LIB) diff --git a/test/common_plat/m4/validation.m4 b/test/common_plat/m4/validation.m4 index b2a2f75d..e303f8f2 100644 --- a/test/common_plat/m4/validation.m4 +++ b/test/common_plat/m4/validation.m4 @@ -8,43 +8,11 @@ AC_ARG_ENABLE([test_vald], AM_CONDITIONAL([test_vald], [test x$test_vald = xyes ]) ########################################################################## -# Set optional CUnit path -########################################################################## -cunit_support=$test_vald -AC_ARG_WITH([cunit-path], -AC_HELP_STRING([--with-cunit-path=DIR], - [path to CUnit libs and headers (if not present at default path)]), - [CUNIT_PATH=$withval - CUNIT_CPPFLAGS="-I$CUNIT_PATH/include" - CUNIT_LIBS="-L$CUNIT_PATH/lib" - cunit_support=yes],[]) - -########################################################################## -# Save and set temporary compilation flags -########################################################################## -OLD_LIBS=$LIBS -OLD_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], [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"])]) -else - cunit_support=no -fi +cunit_support=$test_vald +AS_IF([test "x$cunit_support" = "xyes"], + [PKG_CHECK_MODULES([CUNIT], [cunit])]) -AC_SUBST([CUNIT_CPPFLAGS]) +AC_SUBST([CUNIT_CFLAGS]) AC_SUBST([CUNIT_LIBS]) - -########################################################################## -# Restore old saved variables -########################################################################## -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 767526ed..a9448b17 100644 --- a/test/common_plat/validation/api/Makefile.inc +++ b/test/common_plat/validation/api/Makefile.inc @@ -6,7 +6,7 @@ AM_CFLAGS += -I$(top_srcdir)/test/common_plat/common AM_LDFLAGS += -static AM_LDFLAGS += $(DPDK_PMDS) -AM_CPPFLAGS += $(CUNIT_CPPFLAGS) +AM_CFLAGS += $(CUNIT_PFLAGS) LIBCUNIT_COMMON = $(COMMON_DIR)/libcunit_common.la LIBCPUMASK_COMMON = $(COMMON_DIR)/libcpumask_common.la diff --git a/test/linux-generic/Makefile.inc b/test/linux-generic/Makefile.inc index 30b56e26..ff99fbc9 100644 --- a/test/linux-generic/Makefile.inc +++ b/test/linux-generic/Makefile.inc @@ -4,7 +4,7 @@ AM_LDFLAGS += -static -AM_CPPFLAGS += $(CUNIT_CPPFLAGS) +AM_CFLAGS += $(CUNIT_CFLAGS) LIBCUNIT_COMMON = $(top_builddir)/test/common_plat/common/libcunit_common.la LIB = $(top_builddir)/lib