aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>2017-05-31 14:09:27 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-07-11 19:50:49 +0300
commit51dc8377db6b67090224cab32a6663d7168c4e05 (patch)
treef07daa6f241c0825c4fef8afa650bfa6618c2319
parent780073842dd6d2d52a52e9d59def2f13ae7d8427 (diff)
linux-gen: stop poisoning CPPFLAGS/LDFLAGS with CUnit flags
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 <dmitry.ereminsolenikov@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--test/common_plat/common/Makefile.am1
-rw-r--r--test/common_plat/m4/validation.m419
-rw-r--r--test/common_plat/validation/api/Makefile.inc2
-rw-r--r--test/linux-generic/Makefile.inc2
4 files changed, 16 insertions, 8 deletions
diff --git a/test/common_plat/common/Makefile.am b/test/common_plat/common/Makefile.am
index fd41fb428..7d88d2ea5 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 d32f675ae..67edac7ae 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 6069ee6bb..177d2ac38 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 6e165d8dd..30b56e263 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)