From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DNS_FROM_AHBL_RHSBL, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_PASS,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.0 From: Mike Frysinger To: kbd@lists.altlinux.org Date: Mon, 13 Jul 2015 23:38:41 -0400 Message-Id: <1436845121-19437-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 2.4.4 Subject: [kbd] [PATCH] add configure flag to disable tests X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2015 03:38:52 -0000 Archived-At: List-Archive: The tests require the check package to be installed. There is a configure test for this package (which is good), but it's unconditional (which is bad) as it means you can't even build & install kbd w/out the check package being installed. URL: https://bugs.gentoo.org/485116 Reported-by: Arfrever Frehtes Taifersar Arahesis --- Makefile.am | 5 ++++- configure.ac | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 89c7e83..f855110 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,10 @@ EXTRA_DIST = \ CREDITS \ contrib docs rc -SUBDIRS = src data po tests docs +SUBDIRS = src data po docs +if BUILD_TESTS +SUBDIRS += tests +endif kbd-$(VERSION).tar.xz: make distcheck diff --git a/configure.ac b/configure.ac index d0b462b..f659758 100644 --- a/configure.ac +++ b/configure.ac @@ -10,8 +10,21 @@ AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([1.9 -Wall color-tests dist-xz]) AC_CONFIG_SRCDIR([src/loadkeys.c]) AC_CONFIG_HEADERS(config.h) - -PKG_CHECK_MODULES([CHECK], [check >= 0.9.4]) +PKG_PROG_PKG_CONFIG + +AC_ARG_ENABLE(tests, + [AS_HELP_STRING([--disable-tests], [do not build tests])], + [build_tests=$enableval], [build_tests=auto]) +if test "$build_tests" != "no"; then + PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], + [build_tests="yes"], [ + if test "$build_tests" = "yes"; then + AC_MSG_ERROR([tests requested, but check package is missing]) + fi + build_tests="no" + ]) +fi +AM_CONDITIONAL(BUILD_TESTS, test "$build_tests" != "no") m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])]) AM_SILENT_RULES([yes]) -- 2.4.4