summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac3
-rw-r--r--src/external/cwrap.m431
2 files changed, 34 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 2852c2f8e..1edf4cb19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,6 +171,7 @@ m4_include([src/external/samba.m4])
m4_include([src/external/sasl.m4])
m4_include([src/external/configlib.m4])
m4_include([src/external/libnfsidmap.m4])
+m4_include([src/external/cwrap.m4])
if test x$build_config_lib = xyes; then
m4_include([src/external/libaugeas.m4])
@@ -323,6 +324,8 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test x$DOXYGEN != xfalse ])
AM_CONDITIONAL([HAVE_CHECK], [test x$have_check != x])
AM_CHECK_CMOCKA
+AM_CHECK_UID_WRAPPER
+AM_CHECK_NSS_WRAPPER
AM_CONDITIONAL([HAVE_DEVSHM], [test -d /dev/shm])
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)
+])