linux-headers: bump 4.{4, 9}.x series
[buildroot-gz.git] / package / kbd / 0001-add-configure-flag-to-disable-tests.patch
blob28983e97a064363d4e38c5081d18209373791152
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>
13 ---
14 Makefile.am | 5 ++++-
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
20 --- a/Makefile.am
21 +++ b/Makefile.am
22 @@ -8,7 +8,10 @@ EXTRA_DIST = \
23 CREDITS \
24 contrib docs rc
26 -SUBDIRS = src data po tests docs
27 +SUBDIRS = src data po docs
28 +if BUILD_TESTS
29 +SUBDIRS += tests
30 +endif
32 kbd-$(VERSION).tar.xz:
33 make distcheck
34 diff --git a/configure.ac b/configure.ac
35 index d0b462b..f659758 100644
36 --- a/configure.ac
37 +++ b/configure.ac
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])
44 +PKG_PROG_PKG_CONFIG
46 +AC_ARG_ENABLE(tests,
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])
54 + fi
55 + build_tests="no"
56 + ])
57 +fi
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])
62 --
63 2.6.4