WBC_ID_TYPE_BOTH is a new addition (in Samba 4.0 only). Add a test for
its presence. Because it's an enum, we have to jump through some extra
hoops here...

Signed-off-by: Jeff Layton <[email protected]>
---
 aclocal/idmap.m4 | 15 +++++++++++++++
 configure.ac     |  3 +++
 2 files changed, 18 insertions(+)

diff --git a/aclocal/idmap.m4 b/aclocal/idmap.m4
index 70a0649..939a901 100644
--- a/aclocal/idmap.m4
+++ b/aclocal/idmap.m4
@@ -1,5 +1,6 @@
 dnl Check for wbclient package
 dnl
+
 AC_DEFUN([AC_TEST_WBCHL],[
 if test $enable_cifsidmap != "no" -o $enable_cifsacl != "no"; then
        PKG_CHECK_MODULES(WBCLIENT, wbclient, , [
@@ -29,3 +30,17 @@ if test $enable_cifsacl != "no"; then
                        ], [ ])
 fi
 ])
+
+AC_DEFUN([AC_TEST_WBC_IDMAP_BOTH],[
+       AC_MSG_CHECKING([whether WBC_ID_TYPE_BOTH enum value is defined])
+       AC_LANG_PUSH([C])
+       ac_wbc_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $WBCLIENT_CFLAGS"
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdint.h>
+#include <stdbool.h>
+#include <wbclient.h>], [enum wbcIdType id = WBC_ID_TYPE_BOTH;])],
+                         AC_DEFINE(HAVE_WBC_ID_TYPE_BOTH, 1, [Does wbclient.h 
have a WBC_ID_TYPE_BOTH enum?])
+                         AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]))
+       CFLAGS=$ac_wbc_save_CFLAGS
+       AC_LANG_POP([C])
+])
diff --git a/configure.ac b/configure.ac
index 9652ad2..209bff2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,6 +197,9 @@ fi
 # checks for wbclient.h and libwbclient.so library
 AC_TEST_WBCHL
 
+# test for presence of WBC_ID_TYPE_BOTH enum value
+AC_TEST_WBC_IDMAP_BOTH
+
 if test $enable_cifscreds != "no"; then
        AC_CHECK_HEADERS([keyutils.h], , [
 
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to