From 7318d457e9e1bc3cce0086326ba2d60527c32408 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 21 Mar 2017 15:34:21 -0400 Subject: [PATCH] LP 1669868: Fix make check for all distros. Chris Sharp found that make check was failing on Ubuntu 14.04 and 16.04. I borrowed a few lines from the OpenSRF configure.ac and modified the Open-ILS/src/c-apps/tests/Makefile.am to use a more autoconf-oriented approach that won't lead to unnecessary checks in the install scripts. Signed-off-by: Jason Stephenson Signed-off-by: Ben Shum Signed-off-by: Galen Charlton --- Open-ILS/src/c-apps/tests/Makefile.am | 8 ++++---- configure.ac | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/c-apps/tests/Makefile.am b/Open-ILS/src/c-apps/tests/Makefile.am index 67b258d6b3..a782624279 100644 --- a/Open-ILS/src/c-apps/tests/Makefile.am +++ b/Open-ILS/src/c-apps/tests/Makefile.am @@ -10,12 +10,12 @@ TESTS = check_util check_idl check_PROGRAMS = check_util check_idl check_util_SOURCES = $(COMMON) check_util.c -check_util_CFLAGS = $(AM_CFLAGS) -check_util_LDFLAGS = $(AM_LDFLAGS) -loils_idl -loils_utils -lcheck +check_util_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS) +check_util_LDFLAGS = $(AM_LDFLAGS) $(CHECK_LIBS) -loils_idl -loils_utils check_util_DEPENDENCIES = ../liboils_idl.la ../liboils_utils.la check_idl_SOURCES = $(COMMON) check_idl.c -check_idl_CFLAGS = $(AM_CFLAGS) -check_idl_LDFLAGS = $(AM_LDFLAGS) -loils_idl -loils_utils -lcheck +check_idl_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS) +check_idl_LDFLAGS = $(AM_LDFLAGS) $(CHECK_LIBS) -loils_idl -loils_utils check_idl_DEPENDENCIES = ../liboils_idl.la ../liboils_utils.la diff --git a/configure.ac b/configure.ac index d49a437472..a7685ad38d 100644 --- a/configure.ac +++ b/configure.ac @@ -344,6 +344,16 @@ if test "x$openils_core" = "xtrue"; then AC_FUNC_STRTOD AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp]) + #--------------------------------- + # Check for unit test framework. + #--------------------------------- + PKG_CHECK_MODULES([CHECK], [check >= 0.9.0], [enable_tests=yes], + [enable_tests=no]) + AM_CONDITIONAL(CHECK_TESTS, test x$enable_tests = xyes) + if test "x$enable_tests" = "xno"; then + AC_MSG_WARN(Check unit testing framework not found.) + fi + #---------------------------- # Create Makefiles/Output #---------------------------- -- 2.43.2