@@ -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])
+])
@@ -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], , [
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 <jlayton@samba.org> --- aclocal/idmap.m4 | 15 +++++++++++++++ configure.ac | 3 +++ 2 files changed, 18 insertions(+)