pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0118-Add-configure-check-for-cwrap-libraries.patch

0201d8
From d6ea80f9c0a5b7d6bd44e32297af3718c1e782ff Mon Sep 17 00:00:00 2001
0201d8
From: Sumit Bose <sbose@redhat.com>
0201d8
Date: Tue, 24 Feb 2015 15:29:00 +0100
0201d8
Subject: [PATCH] Add configure check for cwrap libraries
0201d8
0201d8
Currently only nss-wrapper is checked, checks for other crwap libraries
0201d8
can be added e.g. as
0201d8
0201d8
AM_CHECK_WRAPPER(uid_wrapper, HAVE_UID_WRAPPER)
0201d8
0201d8
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
0201d8
---
0201d8
 daemons/configure.ac | 24 ++++++++++++++++++++++++
0201d8
 1 file changed, 24 insertions(+)
0201d8
0201d8
diff --git a/daemons/configure.ac b/daemons/configure.ac
0201d8
index e81aa60e381e035aff73bf27475fc0f101a5fbf9..932a8f7fd5230c90071cf26cc83f6aee5173457d 100644
0201d8
--- a/daemons/configure.ac
0201d8
+++ b/daemons/configure.ac
0201d8
@@ -224,6 +224,30 @@ PKG_CHECK_EXISTS(cmocka,
0201d8
 )
0201d8
 AM_CONDITIONAL([HAVE_CMOCKA], [test x$have_cmocka = xyes])
0201d8
 
0201d8
+dnl A macro to check presence of a cwrap (http://cwrap.org) wrapper on the system
0201d8
+dnl Usage:
0201d8
+dnl     AM_CHECK_WRAPPER(name, conditional)
0201d8
+dnl If the cwrap library is found, sets the HAVE_$name conditional
0201d8
+AC_DEFUN([AM_CHECK_WRAPPER],
0201d8
+[
0201d8
+    FOUND_WRAPPER=0
0201d8
+
0201d8
+    AC_MSG_CHECKING([for $1])
0201d8
+    PKG_CHECK_EXISTS([$1],
0201d8
+                     [
0201d8
+                        AC_MSG_RESULT([yes])
0201d8
+                        FOUND_WRAPPER=1
0201d8
+                     ],
0201d8
+                     [
0201d8
+                        AC_MSG_RESULT([no])
0201d8
+                        AC_MSG_WARN([cwrap library $1 not found, some tests will not run])
0201d8
+                     ])
0201d8
+
0201d8
+    AM_CONDITIONAL($2, [ test x$FOUND_WRAPPER = x1])
0201d8
+])
0201d8
+
0201d8
+AM_CHECK_WRAPPER(nss_wrapper, HAVE_NSS_WRAPPER)
0201d8
+
0201d8
 dnl -- dirsrv is needed for the extdom unit tests --
0201d8
 PKG_CHECK_MODULES([DIRSRV], [dirsrv  >= 1.3.0])
0201d8
 dnl -- sss_idmap is needed by the extdom exop --
0201d8
-- 
0201d8
2.1.0
0201d8