From 35f5932946d67a943146411a336afac34a78fb90 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Fri, 1 Nov 2013 18:33:32 +0100 Subject: [PATCH] Build cifs plugin depending on the existence of cifsidmap.h To allow the "configure; make; make install" scheme on systems where cifsidmap.h is not available the cifs-utils plugin is only build if the include file is available and not build if it is not available. If the configure option --enable-cifs-idmap-plugin is used, configure will fail if cifsidmap.h is not available. Fixes https://fedorahosted.org/sssd/ticket/2125 --- src/external/cifsidmap.m4 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/external/cifsidmap.m4 b/src/external/cifsidmap.m4 index 53cb8b7..fbcbe65 100644 --- a/src/external/cifsidmap.m4 +++ b/src/external/cifsidmap.m4 @@ -2,15 +2,18 @@ AC_ARG_ENABLE([cifs-idmap-plugin], [AS_HELP_STRING([--disable-cifs-idmap-plugin], [do not build CIFS idmap plugin])], [build_cifs_idmap_plugin=$enableval], - [build_cifs_idmap_plugin=yes]) + [build_cifs_idmap_plugin=auto]) -AS_IF([test x$build_cifs_idmap_plugin = xyes], - [AC_CHECK_HEADER([cifsidmap.h], [], - [AC_MSG_ERROR([you must have the cifsidmap header installed to build the idmap plugin])]) - ]) +AC_CHECK_HEADER([cifsidmap.h], + [], + [AS_IF([test x$build_cifs_idmap_plugin = xyes], + [AC_MSG_ERROR([you must have the cifsidmap header installed to build the idmap plugin])], + [AC_MSG_NOTICE([cifsidmap.h not available CIFS idmap plugin will not be build])])]) AM_CONDITIONAL([BUILD_CIFS_IDMAP_PLUGIN], - [test x$build_cifs_idmap_plugin = xyes]) + [test x$ac_cv_header_cifsidmap_h = xyes -a \( x$build_cifs_idmap_plugin = xyes -o x$build_cifs_idmap_plugin = xauto \) ]) AM_COND_IF([BUILD_CIFS_IDMAP_PLUGIN], - [AC_DEFINE_UNQUOTED(HAVE_CIFS_IDMAP_PLUGIN, 1, [Build with cifs idmap plugin])]) + [AC_DEFINE_UNQUOTED(HAVE_CIFS_IDMAP_PLUGIN, 1, [Build with cifs idmap plugin]) + AC_MSG_NOTICE([Build with cifs idmap plugin])], + [AC_MSG_NOTICE([Build without cifs idmap plugin])]) -- 1.8.3.1