Make explicit flag for enabling/disabling libcheck usage.

Automagic detection is frowned upon:
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies
This commit is contained in:
Dave Davenport 2017-04-30 20:03:31 +02:00
parent 8be234121a
commit 5d41d228f0
2 changed files with 15 additions and 6 deletions

View File

@ -227,7 +227,7 @@ check_PROGRAMS=\
box_test\
scrollbar_test
if HAVE_CHECK
if USE_CHECK
check_PROGRAMS+=mode_test theme_parser_test
endif
@ -366,7 +366,7 @@ textbox_test_SOURCES=\
include/helper-theme.h\
test/textbox-test.c
if HAVE_CHECK
if USE_CHECK
theme_parser_test_CFLAGS=${helper_test_CFLAGS} $(check_CFLAGS)
theme_parser_test_LDADD=${helper_test_LDADD} $(check_LIBS)
theme_parser_test_SOURCES=\
@ -457,7 +457,7 @@ helper_config_cmdline_parser_SOURCES=\
test/helper-config-cmdline-parser.c
if HAVE_CHECK
if USE_CHECK
mode_test_CFLAGS=$(textbox_test_CFLAGS) $(check_CFLAGS)
mode_test_LDADD=$(textbox_test_LDADD) $(check_LIBS)
mode_test_SOURCES=\
@ -484,7 +484,7 @@ TESTS=\
box_test\
scrollbar_test
if HAVE_CHECK
if USE_CHECK
TESTS+=theme_parser_test\
mode_test
endif

View File

@ -119,8 +119,12 @@ GW_CHECK_XCB([xcb-aux xcb-xkb xkbcommon >= 0.5.0 xkbcommon-x11 xcb-ewmh xcb-iccc
PKG_CHECK_MODULES([pango], [pango pangocairo])
PKG_CHECK_MODULES([cairo], [cairo cairo-xcb])
PKG_CHECK_MODULES([libsn], [libstartup-notification-1.0 ])
PKG_CHECK_MODULES([check], [check >= 0.11.0], [HAVE_CHECK=1], [HAVE_CHECK=0])
AM_CONDITIONAL([HAVE_CHECK], [test "$HAVE_CHECK" -eq 1])
AC_ARG_ENABLE([check], AS_HELP_STRING([--disable-check], [Build with checks using check library (default: enabled)]))
AS_IF([test "x${enable_check}" != "xno"], [ PKG_CHECK_MODULES([check],[check >= 0.11.0], [HAVE_CHECK=1]) ])
AM_CONDITIONAL([USE_CHECK], [test "x${enable_check}" != "xno" && test "$HAVE_CHECK" -eq 1])
dnl ---------------------------------------------------------------------
@ -158,6 +162,11 @@ echo "Code Coverage Enabled"
else
echo "Code Coverage Disabled"
fi
if test "x${enable_check}" != "xno" && test "$HAVE_CHECK" -eq 1; then
echo "Check based tests Enabled"
else
echo "Check based tests Disabled"
fi
echo "-------------------------------------"
echo "Now type 'make' to build"
echo ""