1 From baeb5aa827d956bd06492775dc5bd9f89d394149 Mon Sep 17 00:00:00 2001
2 From: Mike Frysinger <vapier@gentoo.org>
3 Date: Mon, 13 Jul 2015 23:38:41 -0400
4 Subject: [PATCH] add configure flag to disable tests
6 The tests require the check package to be installed. There is a configure
7 test for this package (which is good), but it's unconditional (which is
8 bad) as it means you can't even build & install kbd w/out the check
9 package being installed.
11 URL: https://bugs.gentoo.org/485116
12 Reported-by: Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
15 configure.ac | 17 +++++++++++++++--
16 2 files changed, 19 insertions(+), 3 deletions(-)
18 diff --git a/Makefile.am b/Makefile.am
19 index 89c7e83..f855110 100644
22 @@ -8,7 +8,10 @@ EXTRA_DIST = \
26 -SUBDIRS = src data po tests docs
27 +SUBDIRS = src data po docs
32 kbd-$(VERSION).tar.xz:
34 diff --git a/configure.ac b/configure.ac
35 index d0b462b..f659758 100644
38 @@ -10,8 +10,21 @@ AC_CONFIG_MACRO_DIR([m4])
39 AM_INIT_AUTOMAKE([1.9 -Wall color-tests dist-xz])
40 AC_CONFIG_SRCDIR([src/loadkeys.c])
41 AC_CONFIG_HEADERS(config.h)
43 -PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
47 + [AS_HELP_STRING([--disable-tests], [do not build tests])],
48 + [build_tests=$enableval], [build_tests=auto])
49 +if test "$build_tests" != "no"; then
50 + PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],
51 + [build_tests="yes"], [
52 + if test "$build_tests" = "yes"; then
53 + AC_MSG_ERROR([tests requested, but check package is missing])
58 +AM_CONDITIONAL(BUILD_TESTS, test "$build_tests" != "no")
60 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
61 AM_SILENT_RULES([yes])