summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-07-26 14:58:58 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-10-10 13:56:06 +0200
commit40b2be4f4312470044cdef460b02b66003f5c85f (patch)
treed20501c5ac37deee83a681d47b8af769a151d10a /src
parent9df7cddb68c61ef4e0397c196604999c68f4be0d (diff)
downloadsssd-40b2be4f4312470044cdef460b02b66003f5c85f.tar.gz
sssd-40b2be4f4312470044cdef460b02b66003f5c85f.tar.xz
sssd-40b2be4f4312470044cdef460b02b66003f5c85f.zip
BUILD: Detect nss_wrapper and uid_wrapper during configure
Unit testing the utilities to become another user requires the use of the cwrap libraries. This patch augments our build system with macros to detect the nss_wrapper and and uid_wrapper libraries. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/external/cwrap.m431
1 files changed, 31 insertions, 0 deletions
diff --git a/src/external/cwrap.m4 b/src/external/cwrap.m4
new file mode 100644
index 000000000..0bd0bc9c9
--- /dev/null
+++ b/src/external/cwrap.m4
@@ -0,0 +1,31 @@
+dnl A macro to check presence of a cwrap wrapper on the system
+dnl Usage:
+dnl AM_CHECK_WRAPPER(name, conditional)
+dnl If the cwrap library is found, sets the HAVE_$name conditional
+AC_DEFUN([AM_CHECK_WRAPPER],
+[
+ FOUND_WRAPPER=0
+
+ AC_MSG_CHECKING([for $1])
+ PKG_CHECK_EXISTS([$1],
+ [
+ AC_MSG_RESULT([yes])
+ FOUND_WRAPPER=1
+ ],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([cwrap library $1 not found, some tests will not run])
+ ])
+
+ AM_CONDITIONAL($2, [ test x$FOUND_WRAPPER = x1])
+])
+
+AC_DEFUN([AM_CHECK_UID_WRAPPER],
+[
+ AM_CHECK_WRAPPER(uid_wrapper, HAVE_UID_WRAPPER)
+])
+
+AC_DEFUN([AM_CHECK_NSS_WRAPPER],
+[
+ AM_CHECK_WRAPPER(nss_wrapper, HAVE_NSS_WRAPPER)
+])