Subject: Bug#196: Make tests optional

From: Jan Engelhardt <[email-masked]>
Date: Tue, 30 Apr 2013 10:38:28 +0200 (CEST)

Package: libpam-x2go
Version: 0.0.1.0

From 427b8eeaa4f43547cea31aacfccc197388e51d30 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <[email-masked]>
Date: Sun, 11 Nov 2012 16:03:23 +0100
Subject: [PATCH] build: make building tests optional

---
 Makefile.am  |    8 +++++---
 configure.ac |    3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9477c1c..7d71690 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,9 @@
 
-SUBDIRS = \
-	src \
-	tests
+SUBDIRS = src
+
+if HAVE_GTEST
+SUBDIRS += tests
+endif
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall
 
diff --git a/configure.ac b/configure.ac
index 4cbd43d..67f9f7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,8 +55,9 @@ AC_SUBST(PAMMODULEDIR)
 m4_include([m4/gtest.m4])
 CHECK_GTEST
 if test "x$have_gtest" != "xyes"; then
-   AC_MSG_ERROR([tests were requested but gtest is not installed.])
+   AC_MSG_WARN([tests were requested but gtest is not installed.])
 fi
+AM_CONDITIONAL([HAVE_GTEST], [test "$have_gtest" != "no"])
 
 ###########################
 # gcov coverage reporting
-- 
1.7.10.4