TODO: s3:configure.in: fix rfc1321 md5 detection
[metze/samba/wip.git] / source3 / configure.in
index 6033b0b13be7ed70569dfb65dc19baf444c371cc..244a2dc7bd61a7386e2797469fb896d505693d1f 100644 (file)
@@ -69,10 +69,13 @@ AC_SUBST(UNINSTALLLIBCMD_A)
 AC_SUBST(INSTALL_LIBWBCLIENT)
 AC_SUBST(UNINSTALL_LIBWBCLIENT)
 AC_SUBST(LIBWBCLIENT_SHARED_TARGET)
+AC_SUBST(LIBWBCLIENT_SHARED_TARGET_SOVER)
+AC_SUBST(LIBWBCLIENT_SHARED_TARGET_FULLVER)
 AC_SUBST(LIBWBCLIENT_SHARED)
 AC_SUBST(LIBWBCLIENT_STATIC_TARGET)
 AC_SUBST(LIBWBCLIENT_STATIC)
 AC_SUBST(LIBWBCLIENT_SOVER)
+AC_SUBST(LIBWBCLIENT_FULLVER)
 AC_SUBST(LIBWBCLIENT)
 AC_SUBST(LIBWBCLIENT_LIBS)
 
@@ -196,7 +199,14 @@ AC_ARG_WITH(profiling-data,
 )
 
 dnl Checks for programs.
-smbtorture4_possible=yes
+AC_ARG_ENABLE(smbtorture4,
+       [AS_HELP_STRING([--enable-smbtorture4], [Enable building smbtorture4 (default=auto)])])
+
+if test x$enable_smbtorture4 != xno; then
+       smbtorture4_possible=yes
+else
+       smbtorture4_possible=no
+fi
 
 AC_PROG_INSTALL
 AC_PROG_AWK
@@ -518,6 +528,8 @@ case "$host_os" in
                                AC_MSG_RESULT([no large file support])
                                ;;
                        5.*)
+                       LDFLAGS="$LDFLAGS -lthread"
+                       CPPFLAGS="$CPPFLAGS -D_REENTRANT"
                        AC_MSG_RESULT([enabling large file support])
                        if test "$ac_cv_prog_gcc" = yes; then
                                ${CC-cc} -v >conftest.c 2>&1
@@ -525,20 +537,17 @@ case "$host_os" in
                                rm -fr conftest.c
                                case "$ac_cv_gcc_compiler_version_number" in
                                        *"gcc version 2.6"*|*"gcc version 2.7"*)
-                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE -D_REENTRANT"
-                                               LDFLAGS="$LDFLAGS -lthread"
+                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
                                                AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
                                                ;;
                                        *)
-                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64"
-                                               LDFLAGS="$LDFLAGS -lthread"
+                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
                                                AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
                                                AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
                                                ;;
                                esac
                        else
-                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64"
-                               LDFLAGS="$LDFLAGS -lthread"
+                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
                                AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
                                AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
                        fi
@@ -742,6 +751,40 @@ AC_CHECK_HEADERS(xfs/libxfs.h)
 AC_CHECK_HEADERS(netgroup.h)
 AC_CHECK_HEADERS(linux/falloc.h)
 
+dnl check for OS implementation of md5 conformant to rfc1321
+samba_cv_md5lib=none
+
+if x"$samba_cv_md5lib" = x"none" ; then
+       AC_CHECK_LIB(c, MD5Update, [samba_cv_md5lib=""])
+fi
+
+if x"$samba_cv_md5lib" = x"none" ; then
+       AC_CHECK_LIB(md, MD5Update, [samba_cv_md5lib=md])
+fi
+
+if x"$samba_cv_md5lib" = x"none" ; then
+       AC_CHECK_LIB(md5, MD5Update, [samba_cv_md5lib=md5])
+fi
+
+if test x"$samba_cv_md5lib" != x"none" ; then
+       AC_CHECK_HEADERS(md5.h)
+fi
+
+if test x"$ac_cv_header_md5_h" = x"yes" -a \
+        x"$samba_cv_md5lib" = x"none" ; then
+       if test x"$samba_cv_md5lib" != x ; then
+               LIBS="${LIBS} -l${samba_cv_md5lib}"
+       fi
+       CRYPTO_MD5_OBJ=
+       AC_DEFINE(HAVE_LIBMD5, 1,
+           [Whether libmd5 conformant to rfc1321 is available.])
+else
+       CRYPTO_MD5_OBJ="../lib/crypto/md5.o"
+fi
+
+AC_SUBST(CRYPTO_MD5_OBJ)
+
+
 AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
 #if HAVE_RPC_RPC_H
 #include <rpc/rpc.h>
@@ -1074,7 +1117,7 @@ AC_CHECK_FUNCS(getgrset)
 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf stat64 fstat64)
 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt lseek64 ftruncate64 posix_fallocate posix_fallocate64)
 AC_CHECK_FUNCS(fallocate fallocate64)
-AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
+AC_CHECK_FUNCS(fseeko fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
 AC_CHECK_FUNCS(opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64)
 AC_CHECK_FUNCS(fdopendir fdopendir64)
 AC_CHECK_FUNCS(getpwent_r)
@@ -1118,6 +1161,7 @@ AC_CHECK_HEADERS(gpfs_gpl.h)
 if test x"$ac_cv_header_gpfs_gpl_h" = x"yes"; then
     AC_DEFINE(HAVE_GPFS,1,[Whether GPFS GPL headers are available])
     default_shared_modules="$default_shared_modules vfs_gpfs"
+    default_shared_modules="$default_shared_modules vfs_gpfs_hsm_notify"
 fi
 
 #############################################
@@ -2072,8 +2116,11 @@ LINK_LIBSMBCLIENT=STATIC
 #  TODO: for talloc and tdb (at least), these should
 #  be extracted from their respective source directories
 #
-AC_ARG_ENABLE(external_libtalloc, [AS_HELP_STRING([--enable-external-libtalloc], [Enable external talloc [default=auto]])],
-[ enable_external_libtalloc=$enableval ], [ enable_external_libtalloc=auto ])
+AC_ARG_ENABLE(external_libtalloc,
+       [AS_HELP_STRING([--enable-external-libtalloc],
+               [Enable external talloc [default=auto]])],
+       [ enable_external_libtalloc=$enableval ],
+       [ enable_external_libtalloc=auto ])
 
 if test "x$enable_external_libtalloc" != xno
 then
@@ -2090,8 +2137,11 @@ fi
 if test "x$enable_external_libtalloc" = xno
 then
        m4_include(../lib/talloc/libtalloc.m4)
-       LINK_LIBTALLOC=STATIC
-       SMB_LIBRARY(talloc, 2)
+       if test x"$USESHARED" = x"no" ; then
+               LINK_LIBTALLOC=STATIC
+       fi
+       LIBTALLOCVERSION=`grep ^VERSION ${tallocdir}/wscript | sed -e "s/'//g" -e 's/.* //'`
+       SMB_LIBRARY(talloc, 2, ${LIBTALLOCVERSION})
        LIBTALLOC_OBJ0=""
        for obj in ${TALLOC_OBJ}; do
                LIBTALLOC_OBJ0="${LIBTALLOC_OBJ0} ${tallocdir}/${obj}"
@@ -2108,8 +2158,8 @@ fi
 AC_ARG_ENABLE(external_libtdb,
        [AS_HELP_STRING([--enable-external-libtdb],
                [Enable external tdb [default=auto]])],
-               [ enable_external_libtalloc=$enableval ],
-               [ enable_external_libtalloc=auto ])
+               [ enable_external_libtdb=$enableval ],
+               [ enable_external_libtdb=auto ])
 
 if test "x$enable_external_libtdb" != xno
 then
@@ -2128,8 +2178,11 @@ AC_SUBST(LIBTDB_OBJ0)
 if test "x$enable_external_libtdb" = xno
 then
        m4_include(../lib/tdb/libtdb.m4)
-       LINK_LIBTDB=STATIC
-       SMB_LIBRARY(tdb, 1)
+       if test x"$USESHARED" = x"no" ; then
+               LINK_LIBTDB=STATIC
+       fi
+       LIBTDBVERSION=`grep ^VERSION ${tdbdir}/wscript | sed -e "s/'//g" -e 's/.* //'`
+       SMB_LIBRARY(tdb, 1, ${LIBTDBVERSION})
        LIBTDB_OBJ0=""
        LIBTDB_LIBS="$LIBTDB_LIBS $TDB_DEPS"
        for obj in ${TDB_OBJ}; do
@@ -2151,7 +2204,7 @@ then
        AC_SUBST(TDBTORTURE)
        ac_cv_have_tdb_err_nesting=yes
 else
-       AC_TRY_COMPILE([#include "tdb.h"],
+       AC_TRY_COMPILE([#include <tdb.h>],
                       [enum TDB_ERROR err = TDB_ERR_NESTING],
                       ac_cv_have_tdb_err_nesting=yes,
                       ac_cv_have_tdb_err_nesting=no)
@@ -2164,7 +2217,7 @@ fi
 SMB_LIBRARY(netapi, 0)
 SMB_LIBRARY(smbclient, 0)
 SMB_LIBRARY(smbsharemodes, 0)
-SMB_LIBRARY(addns, 0, no, [undefined API])
+SMB_LIBRARY(addns, 0, [], no, [undefined API])
 
 
 
@@ -2809,8 +2862,10 @@ samba_cv_HAVE_INOTIFY=yes,
 samba_cv_HAVE_INOTIFY=no,
 samba_cv_HAVE_INOTIFY=cross)
 
-if test x"$ac_cv_func_inotify_init" = x"yes" -a x"$ac_cv_header_linux_inotify_h" = x"yes"; then
-    AC_DEFINE(HAVE_INOTIFY,1,[Whether kernel has inotify support])
+if test x"$ac_cv_func_inotify_init" = x"yes"; then
+    if test  x"$ac_cv_header_sys_inotify_h" = x"yes" -o x"$ac_cv_header_linux_inotify_h" = x"yes"; then
+        AC_DEFINE(HAVE_INOTIFY,1,[Whether kernel or sys has inotify support])
+    fi
 fi
 
 #################################################
@@ -3822,7 +3877,6 @@ if test x"$with_ads_support" != x"no"; then
   AC_CHECK_FUNC_EXT(krb5_string_to_key_salt, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_auth_con_setkey, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_auth_con_setuseruserkey, $KRB5_LIBS)
-  AC_CHECK_FUNC_EXT(krb5_locate_kdc, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_get_permitted_enctypes, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_get_default_in_tkt_etypes, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_free_data_contents, $KRB5_LIBS)
@@ -3860,6 +3914,7 @@ if test x"$with_ads_support" != x"no"; then
   AC_CHECK_FUNC_EXT(krb5_get_credentials_for_user, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_get_host_realm, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_free_host_realm, $KRB5_LIBS)
+  AC_CHECK_FUNC_EXT(gss_get_name_attribute, $KRB5_LIBS)
 
   # MIT krb5 1.8 does not expose this call (yet)
   AC_CHECK_DECLS(krb5_get_credentials_for_user, [], [], [#include <krb5.h>])
@@ -4100,6 +4155,27 @@ if test x"$with_ads_support" != x"no"; then
     found_arcfour_hmac=yes
   fi
 
+  AC_CACHE_CHECK([for ENCTYPE_AES128_CTS_HMAC_SHA1_96],
+                 samba_cv_HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96,[
+    AC_TRY_COMPILE([#include <krb5.h>],
+      [krb5_enctype enctype; enctype = ENCTYPE_AES128_CTS_HMAC_SHA1_96;],
+      samba_cv_HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96=yes,
+      samba_cv_HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96=no)])
+  if test x"$samba_cv_HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96" = x"yes"; then
+    AC_DEFINE(HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96,1,
+              [Whether the ENCTYPE_AES128_CTS_HMAC_SHA1_96 key type definition is available])
+  fi
+  AC_CACHE_CHECK([for ENCTYPE_AES256_CTS_HMAC_SHA1_96],
+                 samba_cv_HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96,[
+    AC_TRY_COMPILE([#include <krb5.h>],
+      [krb5_enctype enctype; enctype = ENCTYPE_AES256_CTS_HMAC_SHA1_96;],
+      samba_cv_HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96=yes,
+      samba_cv_HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96=no)])
+  if test x"$samba_cv_HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96" = x"yes"; then
+    AC_DEFINE(HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96,1,
+              [Whether the ENCTYPE_AES256_CTS_HMAC_SHA1_96 key type definition is available])
+  fi
+
   AC_CACHE_CHECK([for AP_OPTS_USE_SUBKEY],
                  samba_cv_HAVE_AP_OPTS_USE_SUBKEY,[
     AC_TRY_COMPILE([#include <krb5.h>],
@@ -5399,11 +5475,20 @@ if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
 fi
 AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
 
+
 #################################################
 # check for cluster extensions
 
-CTDB_CFLAGS=""
-AC_SUBST(CTDB_CFLAGS)
+AC_MSG_CHECKING(cluster support)
+AC_ARG_WITH(cluster-support,
+[AS_HELP_STRING([--with-cluster-support], [Enable cluster extensions (default=auto)])])
+
+if test x"$with_cluster_support" = x ; then
+       with_cluster_support="auto"
+fi
+
+AC_MSG_RESULT($with_cluster_support)
+
 AC_ARG_WITH(ctdb,
 [AS_HELP_STRING([--with-ctdb=DIR], [Where to find ctdb sources])],
 [ case "$withval" in
@@ -5415,9 +5500,21 @@ AC_ARG_WITH(ctdb,
     ;;
   esac])
 
+AC_ARG_ENABLE(old-ctdb,
+       [AS_HELP_STRING([--enable-old-ctdb],
+               [Enable build against (too) old ctdb version (default=no)])],,
+               [enable_old_ctdb=no])
+
+
+if test "$with_cluster_support" != "no" ; then
+
+AC_MSG_NOTICE(checking whether cluster support is available)
+
+have_cluster_support="yes"
+ctdb_broken="no"
+
 SAVED_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS} $CTDB_CPPFLAGS"
-ctdb_broken="missing or broken headers"
 
 AC_CHECK_HEADERS(ctdb.h ctdb_private.h,,,[
 #include "confdefs.h"
@@ -5431,99 +5528,141 @@ AC_CHECK_HEADERS(ctdb.h ctdb_private.h,,,[
 #include <ctdb.h>
 ])
 
-AC_HAVE_DECL(CTDB_CONTROL_TRANS3_COMMIT,[
-#include "confdefs.h"
-#define NO_CONFIG_H
-#include "replace.h"
-#include "system/wait.h"
-#include "system/network.h"
-#include <talloc.h>
-#include <tdb.h>
-#include <ctdb.h>
-#include <ctdb_private.h>
-])
-if test x"$ac_cv_have_CTDB_CONTROL_TRANS3_COMMIT_decl" = x"yes"; then
-       ctdb_broken=no
-else
-       ctdb_broken="ctdb transaction support missing or too old"
+if test "x$have_cluster_support" = "xyes" -a \
+       "x$ac_cv_header_ctdb_h" != "xyes"
+then
+       have_cluster_support=no
+       ctdb_broken="ctdb.h is required for cluster support"
 fi
 
-# in ctdb 1.0.57 ctdb_control_tcp was temparary renamed to ctdb_tcp_client
-AC_CHECK_TYPE(struct ctdb_tcp_client,[
-       AC_DEFINE([ctdb_control_tcp],[ctdb_tcp_client],[ctdb ipv4 support])
-],,[
-#include "confdefs.h"
-#define NO_CONFIG_H
-#include "replace.h"
-#include "system/wait.h"
-#include "system/network.h"
-#include <talloc.h>
-#include <tdb.h>
-#include <ctdb.h>
-#include <ctdb_private.h>
-])
-
-AC_CHECK_TYPE(struct ctdb_control_tcp,[
-       AC_DEFINE([HAVE_STRUCT_CTDB_CONTROL_TCP],[1],[ctdb ipv4 support])
-],[
-       ctdb_broken="missing struct ctdb_control_tcp"
-],[
-#include "confdefs.h"
-#define NO_CONFIG_H
-#include "replace.h"
-#include "system/wait.h"
-#include "system/network.h"
-#include <talloc.h>
-#include <tdb.h>
-#include <ctdb.h>
-#include <ctdb_private.h>
-])
+if test "x$have_cluster_support" = "xyes" -a \
+       "x$ac_cv_header_ctdb_h" != "xyes"
+then
+       have_cluster_support=no
+       ctdb_broken="ctdb_private.h is required for cluster support"
+fi
+
+
+if test "x$have_cluster_support" = "xyes" ; then
+       AC_HAVE_DECL(CTDB_CONTROL_TRANS3_COMMIT,[
+       #include "confdefs.h"
+       #define NO_CONFIG_H
+       #include "replace.h"
+       #include "system/wait.h"
+       #include "system/network.h"
+       #include <talloc.h>
+       #include <tdb.h>
+       #include <ctdb.h>
+       #include <ctdb_private.h>
+       ])
+       if test x"$ac_cv_have_CTDB_CONTROL_TRANS3_COMMIT_decl" != x"yes"; then
+               ctdb_broken="ctdb transaction support missing or too old"
+               have_cluster_support=no
+       fi
+fi
 
-AC_CHECK_TYPE(struct ctdb_control_tcp_addr,[
-       AC_DEFINE([HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR],[1],[ctdb ipv6 support])
-],,[
-#include "confdefs.h"
-#define NO_CONFIG_H
-#include "replace.h"
-#include "system/wait.h"
-#include "system/network.h"
-#include <talloc.h>
-#include <tdb.h>
-#include <ctdb.h>
-#include <ctdb_private.h>
-])
-CPPFLAGS="$SAVED_CPPFLAGS"
+if test "x$have_cluster_support" = "xyes" ; then
+       AC_HAVE_DECL(CTDB_CONTROL_SCHEDULE_FOR_DELETION,[
+       #include "confdefs.h"
+       #define NO_CONFIG_H
+       #include "replace.h"
+       #include "system/wait.h"
+       #include "system/network.h"
+       #include <talloc.h>
+       #include <tdb.h>
+       #include <ctdb.h>
+       #include <ctdb_private.h>
+       ])
+       if test x"$ac_cv_have_CTDB_CONTROL_SCHEDULE_FOR_DELETION_decl" != x"yes"
+       then
+               if test "x$enable_old_ctdb" = "xyes" ; then
+                       AC_MSG_WARN([ignoring missing SCHEDULE_FOR_DELETION (--enable-old-ctdb)])
+               else
+                       ctdb_broken="support for SCHEDULE_FOR_DELETION control missing"
+                       have_cluster_support=no
+               fi
+       fi
+fi
 
-AC_MSG_CHECKING(cluster support)
-AC_ARG_WITH(cluster-support,
-[AS_HELP_STRING([--with-cluster-support], [Enable cluster extensions (default=auto)])])
+if test "x$have_cluster_support" = "xyes" ; then
+       # In ctdb 1.0.57, ctdb_control_tcp was temporarily renamed
+       # to ctdb_tcp_client.
+       AC_CHECK_TYPE(struct ctdb_tcp_client,[
+               AC_DEFINE([ctdb_control_tcp],[ctdb_tcp_client],[ctdb ipv4 support])
+       ],,[
+       #include "confdefs.h"
+       #define NO_CONFIG_H
+       #include "replace.h"
+       #include "system/wait.h"
+       #include "system/network.h"
+       #include <talloc.h>
+       #include <tdb.h>
+       #include <ctdb.h>
+       #include <ctdb_private.h>
+       ])
+fi
 
-if test x"$with_cluster_support" = x ; then
-       with_cluster_support="auto"
+if test "x$have_cluster_support" = "xyes" ; then
+       AC_CHECK_TYPE(struct ctdb_control_tcp,[
+               AC_DEFINE([HAVE_STRUCT_CTDB_CONTROL_TCP],[1],[ctdb ipv4 support])
+       ],[
+               ctdb_broken="missing struct ctdb_control_tcp"
+               have_cluster_support=no
+       ],[
+       #include "confdefs.h"
+       #define NO_CONFIG_H
+       #include "replace.h"
+       #include "system/wait.h"
+       #include "system/network.h"
+       #include <talloc.h>
+       #include <tdb.h>
+       #include <ctdb.h>
+       #include <ctdb_private.h>
+       ])
 fi
 
-if test x"$ac_cv_header_ctdb_private_h" != x"yes"; then
-       if test "x$with_cluster_support" = "xyes"; then
-               AC_MSG_ERROR("ctdb_private.h is required for cluster support")
-       fi
-       with_cluster_support=no
+# test for optional ipv6 support in ctdb:
+if test "x$have_cluster_support" = "xyes" ; then
+       AC_CHECK_TYPE(struct ctdb_control_tcp_addr,[
+               AC_DEFINE([HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR],[1],[ctdb ipv6 support])
+       ],,[
+       #include "confdefs.h"
+       #define NO_CONFIG_H
+       #include "replace.h"
+       #include "system/wait.h"
+       #include "system/network.h"
+       #include <talloc.h>
+       #include <tdb.h>
+       #include <ctdb.h>
+       #include <ctdb_private.h>
+       ])
 fi
 
-if test x"$ctdb_broken" != x"no"; then
-       if test "x$with_cluster_support" = "xyes"; then
-               AC_MSG_ERROR(["cluster support: $ctdb_broken"])
-       fi
+CPPFLAGS="$SAVED_CPPFLAGS"
+
+fi # (if test "$with_cluster_support" != "no")
+
+if test x"$have_cluster_support" = "xno" ; then
+       case "$with_cluster_support" in
+       yes)
+               AC_MSG_ERROR(["cluster support not available: $ctdb_broken"])
+               ;;
+       auto)
+               AC_MSG_WARN(["cluster support not available: $ctdb_broken"])
+               ;;
+       esac
        with_cluster_support=no
 fi
 
 if test "x$with_cluster_support" != "xno"; then
     AC_DEFINE(CLUSTER_SUPPORT,1,[Whether to enable cluster extensions])
     SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${CTDB_CPPFLAGS}"
-    AC_MSG_RESULT(yes)
+    AC_MSG_NOTICE(Building with cluster support)
 else
-    AC_MSG_RESULT(no)
+    AC_MSG_NOTICE(Building without cluster support)
 fi
 
+
 #################################################
 # check for rtnetlink
 
@@ -5811,16 +5950,23 @@ fi
 #################################################
 # check for sendfile support
 
-with_sendfile_support=yes
-AC_MSG_CHECKING(whether to check to support sendfile)
+AC_MSG_CHECKING(whether sendfile support should be built in)
 AC_ARG_WITH(sendfile-support,
-[AS_HELP_STRING([--with-sendfile-support], [Check for sendfile support (default=yes)])],
+[AS_HELP_STRING([--with-sendfile-support], [Whether sendfile support should be built in (default=auto)])],
 [ case "$withval" in
-  yes)
-
-       AC_MSG_RESULT(yes);
+  yes|no)
+       AC_MSG_RESULT($withval);
+       with_sendfile_support=$withval
+       ;;
+  *)
+       AC_MSG_RESULT(yes)
+       with_sendfile_support=auto
+       ;;
+  esac ],
+)
 
-       case "$host_os" in
+if test x$with_sendfile_support != xno ; then
+    case "$host_os" in
        *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
                AC_CACHE_CHECK([for linux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
                AC_TRY_LINK([#include <sys/sendfile.h>],
@@ -6056,14 +6202,12 @@ samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
        ;;
        *)
        ;;
-        esac
-        ;;
-  *)
-    AC_MSG_RESULT(no)
-    ;;
-  esac ],
-  AC_MSG_RESULT(yes)
-)
+    esac
+fi
+
+if test x$with_sendfile_support = xyes -a x"$samba_cv_HAVE_SENDFILE" != xyes ; then
+       AC_MSG_ERROR(sendfile support requested but sendfile not available )
+fi
 
 ############################################
 # See if we have the Linux readahead syscall.
@@ -6300,6 +6444,9 @@ else
        LIBWBCLIENT_SHARED_TARGET=bin/libwbclient.$SHLIBEXT
        LIBWBCLIENT_STATIC_TARGET=bin/libwbclient.a
        LIBWBCLIENT_SOVER=0
+       LIBWBCLIENT_FULLVER=0
+       LIBWBCLIENT_SHARED_TARGET_SOVER=$LIBWBCLIENT_SHARED_TARGET.$LIBWBCLIENT_SOVER
+       LIBWBCLIENT_SHARED_TARGET_FULLVER=$LIBWBCLIENT_SHARED_TARGET.$LIBWBCLIENT_FULLVER
        if test $BLDSHARED = true -a x"$HAVE_WINBIND" = x"yes" -a x"$BUILD_LIBWBCLIENT_SHARED" = x"yes"; then
                NSS_MODULES="${WINBIND_NSS} ${WINBIND_WINS_NSS}"
                ## Only worry about libwbclient if we have shared
@@ -6583,7 +6730,12 @@ if test x"$enable_pthreadpool" = x"yes" -a x"$samba_cv_HAVE_PTHREAD" = x"yes"; t
     LIBS="$LIBS $PTHREAD_LDFLAGS"
     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
     AC_DEFINE(WITH_PTHREADPOOL, 1, [Whether to include pthreadpool helpers])
-    AC_SUBST(PTHREADPOOL_OBJ, "lib/pthreadpool.o")
+    AC_SUBST(PTHREADPOOL_OBJ, "lib/pthreadpool/pthreadpool.o")
+    PTHREADPOOLTEST="bin/pthreadpooltest\$(EXEEXT)"
+    AC_SUBST(PTHREADPOOLTEST)
+    if test x"$samba_cv_HAVE_AIO" = x"yes"; then
+        default_shared_modules="$default_shared_modules vfs_aio_pthread"
+    fi
 fi
 
 #################################################
@@ -6624,7 +6776,7 @@ AC_SUBST(FLAGS1)
 ###################################################
 # Check for different/missing (set|get|end)netgrent prototypes
 CFLAGS_SAVE=$CFLAGS
-if test x"$samba_cv_HAVE_Wdeclaration_after_statement" = x"yes"; then
+if test x"$samba_cv_HAVE_Werror_implicit_function_declaration" = x"yes"; then
        CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
 fi
 AC_CACHE_CHECK([for setnetgrent prototype],samba_cv_setnetgrent_prototype, [
@@ -6806,10 +6958,12 @@ SMB_MODULE(vfs_cacheprime, \$(VFS_CACHEPRIME_OBJ), "bin/cacheprime.$SHLIBEXT", V
 SMB_MODULE(vfs_prealloc, \$(VFS_PREALLOC_OBJ), "bin/prealloc.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_commit, \$(VFS_COMMIT_OBJ), "bin/commit.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_gpfs, \$(VFS_GPFS_OBJ), "bin/gpfs.$SHLIBEXT", VFS)
+SMB_MODULE(vfs_gpfs_hsm_notify, \$(VFS_GPFS_PREFETCH_OBJ), "bin/gpfs_hsm_notify.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_readahead, \$(VFS_READAHEAD_OBJ), "bin/readahead.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_tsmsm, \$(VFS_TSMSM_OBJ), "bin/tsmsm.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_fileid, \$(VFS_FILEID_OBJ), "bin/fileid.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_aio_fork, \$(VFS_AIO_FORK_OBJ), "bin/aio_fork.$SHLIBEXT", VFS)
+SMB_MODULE(vfs_aio_pthread, \$(VFS_AIO_PTHREAD_OBJ), "bin/aio_pthread.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_preopen, \$(VFS_PREOPEN_OBJ), "bin/preopen.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_syncops, \$(VFS_SYNCOPS_OBJ), "bin/syncops.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_zfsacl, \$(VFS_ZFSACL_OBJ), "bin/zfsacl.$SHLIBEXT", VFS)