-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I discovered when trying to build RPMs on EPEL5 (which does not have a
compatible version of check) that the build failed trying to link the
common.c test utilities.

- -- 
Stephen Gallagher
RHCE 804006346421761

Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkuXwF4ACgkQeiVVYja6o6NCUgCdGbpsKZEDI0emBFgOhS3yqg+Z
Vz4AoKnyHL9/BhzvlfByotjJDBcYn/YO
=oWLF
-----END PGP SIGNATURE-----
From b2740987510b82d3f09e224a14d0385869ea922a Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Wed, 10 Mar 2010 10:47:26 -0500
Subject: [PATCH] Fix build when check-devel is not installed

tests/common.c is now required by all tests (check-based and not),
so we need to properly ifdef it
---
 src/Makefile.am    |    6 ++++--
 src/tests/common.c |    6 +++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 9da383b..8c3d9d0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -453,14 +453,16 @@ sss_groupshow_LDADD = \
 #################
 # Feature Tests #
 #################
-if HAVE_CHECK
 noinst_LTLIBRARIES += \
     libsss_test_common.la
 
 libsss_test_common_la_SOURCES = \
     tests/common.c
 libsss_test_common_la_LIBADD = \
-    $(SSSD_LIBS) \
+    $(SSSD_LIBS)
+
+if HAVE_CHECK
+libsss_test_common_la_LIBADD += \
     $(CHECK_LIBS)
 
 sysdb_tests_DEPENDENCIES = \
diff --git a/src/tests/common.c b/src/tests/common.c
index 4ae1f49..a494982 100644
--- a/src/tests/common.c
+++ b/src/tests/common.c
@@ -22,7 +22,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <check.h>
 #include <stdio.h>
 
 #include "tests/common.h"
@@ -31,6 +30,9 @@
 TALLOC_CTX *global_talloc_context = NULL;
 #include "util/util.h"
 
+#ifdef HAVE_CHECK
+#include <check.h>
+
 struct size_snapshot {
     struct size_snapshot *prev;
     struct size_snapshot *next;
@@ -108,6 +110,8 @@ leak_check_teardown(void)
     check_leaks(global_talloc_context, 0);
 }
 
+#endif
+
 void
 tests_set_cwd(void)
 {
-- 
1.6.6.1

Attachment: 0001-Fix-build-when-check-devel-is-not-installed.patch.sig
Description: PGP signature

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to