s3-rpc_client: support AES encryption in netr_ServerPasswordSet2 client.
[kai/samba.git] / source3 / configure.in
index b5fd8c253eb018c80205c088c0645376dbbff4a0..bd3bffe3909ecf5c3a59685f090c225e845501c0 100644 (file)
@@ -202,29 +202,21 @@ AC_ARG_WITH(profiling-data,
   AC_MSG_RESULT(no)
 )
 
-dnl Checks for programs.
-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
 # Check for GNU make
 m4_include(../m4/check_make.m4)
 AC_SAMBA_GNU_MAKE([true], [true])
 
+selftest_possible="yes"
+
 # Check for perl
 m4_include(../m4/check_perl.m4)
-AC_SAMBA_PERL([true], [smbtorture4_possible=no])
+AC_SAMBA_PERL([true], [selftest_possible=no])
 
 # Check for python
 m4_include(../m4/check_python.m4)
-AC_SAMBA_PYTHON_DEVEL([true], [smbtorture4_possible=no])
+AC_SAMBA_PYTHON_DEVEL([true], [selftest_possible=no])
 
 AC_CHECK_TOOL(AR, ar)
 
@@ -466,6 +458,7 @@ default_shared_modules="$default_shared_modules vfs_scannedonly"
 default_shared_modules="$default_shared_modules vfs_crossrename"
 default_shared_modules="$default_shared_modules vfs_linux_xfs_sgid"
 default_shared_modules="$default_shared_modules vfs_time_audit"
+default_shared_modules="$default_shared_modules vfs_media_harmony"
 default_shared_modules="$default_shared_modules idmap_autorid"
 default_shared_modules="$default_shared_modules idmap_tdb2"
 default_shared_modules="$default_shared_modules idmap_rid"
@@ -475,6 +468,9 @@ if test "x$developer" = xyes; then
    default_shared_modules="$default_shared_modules perfcount_test"
 fi
 
+if test x"$selftest" = x"yes" -o "x$developer" = xyes; then
+   default_shared_modules="$default_shared_modules vfs_fake_acls"
+fi
 
 #
 # Config CPPFLAG settings for strange OS's that must be set
@@ -495,13 +491,6 @@ case "$host_os" in
       esac
       ;;
 
-#
-# CRAY Unicos has broken const handling
-       *unicos*)
-         AC_MSG_RESULT([disabling const])
-         CPPFLAGS="$CPPFLAGS -Dconst="
-         ;;
-       
 #
 # AIX4.x doesn't even admit to having large
 # files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
@@ -613,18 +602,45 @@ AC_CHECK_HEADERS(netgroup.h)
 AC_CHECK_HEADERS(linux/falloc.h)
 AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h)
 
+dnl check for OS implementation of md5 conformant to rfc1321
+samba_cv_md5lib=none
+
+AC_CHECK_LIB(c, MD5Update, [samba_cv_md5lib=""])
+
+if test x"$samba_cv_md5lib" = x"none" ; then
+       AC_CHECK_LIB(md, MD5Update, [samba_cv_md5lib=md])
+fi
+
+if test 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
+
+CRYPTO_MD5_OBJ="../lib/crypto/md5.o"
+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}"
+               AC_DEFINE(HAVE_LIBMD5, 1,
+                                 [Whether libmd5 conformant to rfc1321 is available.])
+       fi
+       CRYPTO_MD5_OBJ=
+fi
+
+if test "x$ac_cv_header_CommonCrypto_CommonDigest_h" == "xyes"; then
+       CRYPTO_MD5_OBJ=
+fi
+
+AC_SUBST(CRYPTO_MD5_OBJ)
+
 AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
 #if HAVE_RPC_RPC_H
 #include <rpc/rpc.h>
 #endif
 ]])
-CRYPTO_MD5_OBJ=
-if test "x$ac_cv_header_CommonCrypto_CommonDigest_h" != "xyes"
-then
-       CRYPTO_MD5_OBJ="../lib/crypto/md5.o"
-fi
-AC_SUBST(CRYPTO_MD5_OBJ)
-
 ## These fail to compile on IRIX so just check for their presence
 AC_CHECK_HEADERS(sys/mode.h,,,)
 
@@ -999,7 +1015,6 @@ 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
 
 # Note that all the libunwind symbols in the API are defined to internal
@@ -1223,6 +1238,7 @@ fi
 AC_CHECK_LIB(resolv, dn_expand)
 AC_CHECK_LIB(resolv, _dn_expand)
 AC_CHECK_LIB(resolv, __dn_expand)
+AC_CHECK_LIB(inet, dn_expand)
 
 #
 # Check for the functions putprpwnam, set_auth_parameters,
@@ -1366,7 +1382,6 @@ DSO_EXPORTS=""
                                SONAMEFLAG="-Wl,-h,"
                        fi
                        AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
-                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
                        ;;
                *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4])
                        BLDSHARED="true"
@@ -1374,7 +1389,6 @@ DSO_EXPORTS=""
                        SONAMEFLAG="-Wl,-h,"
                        PICFLAG="-KPIC"   # Is this correct for SunOS
                        AC_DEFINE(STAT_ST_BLOCKSIZE,512)
-                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
                        ;;
                *netbsd* | *freebsd* | *dragonfly* )
                        BLDSHARED="true"
@@ -1383,7 +1397,6 @@ DSO_EXPORTS=""
                        SONAMEFLAG="-Wl,-soname,"
                        PICFLAG="-fPIC -DPIC"
                        AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
-                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
                        ;;
                *openbsd*)  BLDSHARED="true"
                        LDSHFLAGS="-shared"
@@ -1391,14 +1404,8 @@ DSO_EXPORTS=""
                        SONAMEFLAG="-Wl,-soname,"
                        PICFLAG="-fPIC"
                        AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
-                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
                        ;;
-               *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
-                       case "$host_os" in
-                       *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6])
-                       ;;
-                       esac
-                       BLDSHARED="true"
+               *irix*) BLDSHARED="true"
                        LDSHFLAGS="-Wl,-set_version,sgi1.0 -shared"
                        SONAMEFLAG="-Wl,-soname,"
                        if test "${GCC}" = "yes"; then
@@ -1477,7 +1484,6 @@ DSO_EXPORTS=""
                                PICFLAG="-fPIC"
                        fi
                        AC_DEFINE(STAT_ST_BLOCKSIZE,512)
-                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
                        for flags in "-expect_unresolved '*'" "-Wl,-expect_unresolved,'*'" ; do
                                saved_ldflags="$LDFLAGS"
                                AC_MSG_CHECKING([if $flags works])
@@ -1490,11 +1496,9 @@ DSO_EXPORTS=""
                                test x"$LDSHFLAGS_Z_NODEFS" != x && break
                        done
                        ;;
-               *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix])
-                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
+               *sco*) AC_DEFINE(STAT_ST_BLOCKSIZE,512)
                        ;;
-               *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware])
-                       BLDSHARED="true"
+               *unixware*) BLDSHARED="true"
                        LDSHFLAGS="-shared"
                        SONAMEFLAG="-Wl,-soname,"
                        PICFLAG="-KPIC"
@@ -1725,7 +1729,7 @@ if test x"$BLDSHARED" != x"true"; then
        SHLD="shared-libraries-disabled"
        PICFLAG="${PIE_CFLAGS}"
        SHLIBEXT="shared_libraries_disabled"
-       smbtorture4_possible=no
+       smbtorture_possible=no
 fi
 
 AC_MSG_CHECKING([used PICFLAG])
@@ -2233,25 +2237,6 @@ if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
     AC_DEFINE(HAVE_UT_UT_EXIT,1,[Whether the utmp struct has a property ut_exit])
 fi
 
-dnl Look for the IPv6 varient by preference. Many systems have both.
-AC_CACHE_CHECK([for ut_addr_v6 in utmp],samba_cv_HAVE_UT_UT_ADDR_V6,[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <utmp.h>],
-[struct utmp ut;  ut.ut_addr_v6[0] = 0;],
-samba_cv_HAVE_UT_UT_ADDR_V6=yes,samba_cv_HAVE_UT_UT_ADDR_V6=no,samba_cv_HAVE_UT_UT_ADDR_V6=cross)])
-if test x"$samba_cv_HAVE_UT_UT_ADDR_V6" = x"yes"; then
-    AC_DEFINE(HAVE_UT_UT_ADDR_V6,1,[Whether the utmp struct has a property ut_addr_v6])
-fi
-
-AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <utmp.h>],
-[struct utmp ut;  ut.ut_addr = 0;],
-samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
-if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
-    AC_DEFINE(HAVE_UT_UT_ADDR,1,[Whether the utmp struct has a property ut_addr])
-fi
-
 if test x$ac_cv_func_pututline = xyes ; then
   AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
   AC_TRY_COMPILE([#include <sys/types.h>
@@ -2272,6 +2257,19 @@ if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
     AC_DEFINE(HAVE_UX_UT_SYSLEN,1,[Whether the utmpx struct has a property ut_syslen])
 fi
 
+AC_CACHE_CHECK([whether sizeof ut_line in utmp is ok],samba_cv_HAVE_UX_UT_LINE,[
+AC_TRY_RUN([#include <stdio.h>
+#include <sys/types.h>
+#include <utmp.h>
+int main(void) {
+ if (sizeof(((struct utmp *)NULL)->ut_line) < 15) {
+     return 1;
+ }
+ return 0;
+}
+],
+samba_cv_HAVE_UX_UT_LINE=yes,samba_cv_HAVE_UX_UT_LINE=no,samba_cv_HAVE_UX_UT_LINE=cross)])
+
 fi
 # end utmp details
 
@@ -2511,7 +2509,7 @@ fi
 
 AC_CHECK_HEADER(sys/inotify.h)
 
-if test x"ac_cv_header_sys_inotify_h" = x"yes"; then
+if test x"$ac_cv_header_sys_inotify_h" = x"yes"; then
     AC_DEFINE(HAVE_INOTIFY,1,[For inotify support])
 fi
 
@@ -4520,10 +4518,6 @@ AC_ARG_WITH(syslog-facility,
 # check for experimental disk-quotas support
 
 samba_cv_WITH_QUOTAS=auto
-samba_cv_TRY_QUOTAS=no
-samba_cv_RUN_QUOTA_TESTS=auto
-samba_cv_WITH_SYS_QUOTAS=auto
-samba_cv_TRY_SYS_QUOTAS=auto
 samba_cv_SYSQUOTA_FOUND=no
 
 AC_MSG_CHECKING(whether to try disk-quotas support)
@@ -4533,90 +4527,34 @@ AC_ARG_WITH(quotas,
   yes)
     AC_MSG_RESULT(yes)
     samba_cv_WITH_QUOTAS=yes
-    samba_cv_TRY_QUOTAS=yes
-    samba_cv_RUN_QUOTA_TESTS=yes
-    #set sys quotas to auto in this case
-    samba_cv_TRY_SYS_QUOTAS=auto
     ;;
   auto)
     AC_MSG_RESULT(auto)
     samba_cv_WITH_QUOTAS=auto
-    samba_cv_TRY_QUOTAS=auto
-    samba_cv_RUN_QUOTA_TESTS=auto
-    #set sys quotas to auto in this case
-    samba_cv_TRY_SYS_QUOTAS=auto
     ;;
   no)
     AC_MSG_RESULT(no)
     samba_cv_WITH_QUOTAS=no
-    samba_cv_TRY_QUOTAS=no
-    samba_cv_RUN_QUOTA_TESTS=no
-    ;;
-  *)
-    AC_MSG_RESULT(${samba_cv_TRY_QUOTAS})
-    ;;
-  esac ],
-  AC_MSG_RESULT(${samba_cv_TRY_QUOTAS})
-)
-
-AC_MSG_CHECKING(whether to try the new lib/sysquotas.c interface)
-AC_ARG_WITH(sys-quotas,
-[AS_HELP_STRING([--with-sys-quotas], [Include lib/sysquotas.c support (default=auto)])],
-[ case "$withval" in
-  yes)
-    AC_MSG_RESULT(yes)
-    samba_cv_WITH_SYS_QUOTAS=yes
-    samba_cv_TRY_SYS_QUOTAS=yes
-    samba_cv_RUN_QUOTA_TESTS=yes
-    ;;
-  auto)
-    AC_MSG_RESULT(auto)
-    samba_cv_WITH_SYS_QUOTAS=auto
-    samba_cv_TRY_SYS_QUOTAS=auto
-    samba_cv_RUN_QUOTA_TESTS=auto
-    ;;
-  no)
-    AC_MSG_RESULT(no)
-    samba_cv_WITH_SYS_QUOTAS=no
-    samba_cv_TRY_SYS_QUOTAS=no
     ;;
   *)
-    AC_MSG_RESULT(${samba_cv_TRY_SYS_QUOTAS})
+    AC_MSG_RESULT(${samba_cv_WITH_QUOTAS})
     ;;
   esac ],
-  AC_MSG_RESULT(${samba_cv_TRY_SYS_QUOTAS})
+  AC_MSG_RESULT(${samba_cv_WITH_QUOTAS})
 )
 
-if test x"$samba_cv_TRY_SYS_QUOTAS" = x"auto"; then
-AC_MSG_CHECKING(whether to try the lib/sysquotas.c interface on ${host_os})
-  case "$host_os" in
-       *linux*)
-           AC_MSG_RESULT(yes)
-            samba_cv_TRY_SYS_QUOTAS=yes
-            samba_cv_RUN_QUOTA_TESTS=yes
-           ;;
-       *)
-           AC_MSG_RESULT(no)
-            samba_cv_TRY_SYS_QUOTAS=no
-           ;;
-  esac
-fi
-
 #############################################
 # only check for quota stuff if --with-quotas
-if test x"$samba_cv_RUN_QUOTA_TESTS" != x"no"; then
+if test x"$samba_cv_WITH_QUOTAS" != x"no"; then
 
 case "$host_os" in
        # on linux we didn't need to test we have builtin support
        *linux*)
            samba_cv_SYSQUOTA_FOUND=yes
            AC_DEFINE(HAVE_QUOTACTL_LINUX,1,[Whether Linux quota support is available])
-           samba_cv_sysquotas_file="lib/sysquotas_linux.c"
            AC_MSG_CHECKING(whether to use the lib/sysquotas_linux.c builtin support)
            AC_MSG_RESULT(yes)
 
-           AC_DEFINE(HAVE_LINUX_XFS_QUOTAS,1,[Whether Linux xfs quota support is available])
-           samba_cv_found_xfs_header=yes
            AC_MSG_CHECKING(whether to use the lib/sysquotas_xfs.c builtin support)
            AC_MSG_RESULT(yes)
            ;;
@@ -4637,13 +4575,19 @@ AC_CHECK_HEADER(asm/types.h,[
 # For quotas on Veritas VxFS filesystems
 AC_CHECK_HEADERS(sys/fs/vx_quota.h)
 
-# For quotas on Linux XFS filesystems
-AC_CHECK_HEADERS(linux/dqblk_xfs.h)
+# For quotas on XFS filesystems, Linux style
+AC_CHECK_HEADERS(xfs/xqm.h,[
+           AC_DEFINE(HAVE_XFS_QUOTAS,1,[Whether xfs quota support is available])
+       ])
 
 # For sys/quota.h and linux/quota.h
 AC_CHECK_HEADERS(sys/quota.h)
 
-if test x"$samba_cv_found_xfs_header" != x"yes"; then
+# For quotas on BSD systems
+AC_CHECK_HEADERS(ufs/ufs/quota.h)
+
+
+if test x"$ac_cv_header_xfs_xqm_h" != x"yes"; then
 # if we have xfs quota support <sys/quota.h> (IRIX) we should use it
 AC_CACHE_CHECK([for XFS QUOTA in <sys/quota.h>],samba_cv_HAVE_SYS_QUOTA_XFS, [
 AC_TRY_COMPILE([
@@ -4658,7 +4602,7 @@ AC_TRY_COMPILE([
 ],[int i = Q_XGETQUOTA;],
 samba_cv_HAVE_SYS_QUOTA_XFS=yes,samba_cv_HAVE_SYS_QUOTA_XFS=no)])
 if test "$samba_cv_HAVE_SYS_QUOTA_XFS"x = "yes"x; then
-       samba_cv_found_xfs_header=yes
+       AC_DEFINE(HAVE_XFS_QUOTAS,1,[Whether xfs quota support is available])
 fi
 fi
 
@@ -4686,12 +4630,11 @@ AC_TRY_RUN_STRICT([
 #define HAVE_QUOTACTL_4A 1
 #define AUTOCONF_TEST 1
 #include "confdefs.h"
-#include "${srcdir-.}/../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
+#include "${srcdir-.}/../../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
            samba_cv_HAVE_QUOTACTL_4A=yes,samba_cv_HAVE_QUOTACTL_4A=no,samba_cv_HAVE_QUOTACTL_4A=cross)])
 if test x"$samba_cv_HAVE_QUOTACTL_4A" = x"yes"; then
     samba_cv_SYSQUOTA_FOUND=yes;
     AC_DEFINE(HAVE_QUOTACTL_4A,1,[Whether long quotactl(int cmd, char *special, qid_t id, caddr_t addr) is available])
-    samba_cv_sysquotas_file="lib/sysquotas_4A.c"
 fi
 fi
 
@@ -4701,30 +4644,36 @@ AC_TRY_RUN_STRICT([
 #define HAVE_QUOTACTL_4B 1
 #define AUTOCONF_TEST 1
 #include "confdefs.h"
-#include "${srcdir-.}/../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
+#include "${srcdir-.}/../../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
            samba_cv_HAVE_QUOTACTL_4B=yes,samba_cv_HAVE_QUOTACTL_4B=no,samba_cv_HAVE_QUOTACTL_4B=cross)])
 if test x"$samba_cv_HAVE_QUOTACTL_4B" = x"yes"; then
-    echo "int quotactl(const char *path, int cmd, int id, char *addr) is not reworked for the new sys_quota api"
     samba_cv_SYSQUOTA_FOUND=yes;
     AC_DEFINE(HAVE_QUOTACTL_4B,1,[Whether int quotactl(const char *path, int cmd, int id, char *addr) is available])
-    samba_cv_sysquotas_file="lib/sysquotas_4B.c"
+    AC_CHECK_MEMBERS([struct dqblk.dqb_curbytes], # Darwin bytecount style
+       [ AC_DEFINE([HAVE_STRUCT_DQBLK_DQB_CURBYTES],[1],[darwin style quota bytecount])],,
+       [#include <sys/types.h>
+       #include <sys/quota.h>])
+
 fi
 fi
 
-if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
-AC_CACHE_CHECK([for CRAY int quotactl (char *spec, int request, char *arg)],samba_cv_HAVE_QUOTACTL_3,[
-AC_TRY_RUN_STRICT([
-#define HAVE_QUOTACTL_3 1
-#define AUTOCONF_TEST 1
-#include "confdefs.h"
-#include "${srcdir-.}/../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
-           samba_cv_HAVE_QUOTACTL_3=yes,samba_cv_HAVE_QUOTACTL_3=no,samba_cv_HAVE_QUOTACTL_3=cross)])
-if test x"$samba_cv_HAVE_QUOTACTL_3" = x"yes"; then
-    echo "CRAY int quotactl (char *spec, int request, char *arg) is NOT reworked for the sys_quota api"
-    samba_cv_SYSQUOTA_FOUND=yes;
-    AC_DEFINE(HAVE_QUOTACTL_3,1,[Whether CRAY int quotactl (char *spec, int request, char *arg); is available])
-    samba_cv_sysquotas_file="lib/sysquotas_3.c"
-fi
+AC_CACHE_CHECK([for NFS QUOTAS],samba_cv_HAVE_NFS_QUOTAS,[
+AC_TRY_COMPILE([
+#include <rpc/rpc.h>
+#include <rpc/types.h>
+#include <rpcsvc/rquota.h>
+#ifdef HAVE_RPC_NETTYPE_H
+#include <rpc/nettype.h>
+#endif
+#include <rpc/xdr.h>
+],[clnt_create("", RQUOTAPROG, RQUOTAVERS, "udp");],
+                  samba_cv_HAVE_NFS_QUOTAS=yes, samba_cv_HAVE_NFS_QUOTAS=no)])
+
+if test x"$samba_cv_HAVE_NFS_QUOTAS" = x"yes"; then
+    AC_DEFINE(HAVE_NFS_QUOTAS,1,[NFS quota support is available])
+    AC_CHECK_MEMBER(struct getquota_rslt.getquota_rslt_u,
+               AC_DEFINE(HAVE_GETQUOTA_RSLT_GETQUOTA_RSLT_U, 1, [Defined if struct getquota_rslt has getquota_rslt_u]),,
+               [#include <rpcsvc/rquota.h>])
 fi
 
 #################################################
@@ -4741,117 +4690,24 @@ AC_CHECK_HEADERS(devnm.h)
 # check for devnm
 AC_CHECK_FUNCS(devnm)
 
-if test x"$samba_cv_WITH_SYS_QUOTAS" = x"yes"; then
-    if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
-       # if --with-sys-quotas=yes then build it
-       # you have can use the get/set quota command smb.conf
-       # options then
-       samba_cv_SYSQUOTA_FOUND=auto
-    fi
-    if test x"$samba_cv_TRY_SYS_QUOTAS" != x"yes"; then
-       # if --with-sys-quotas=yes then build it
-       # you have can use the get/set quota command smb.conf
-       # options then
-       samba_cv_TRY_SYS_QUOTAS=auto
-    fi
-fi
-
-if test x"$samba_cv_SYSQUOTA_FOUND" != x"no"; then
-AC_CACHE_CHECK([whether the sys_quota interface works],samba_cv_SYSQUOTA_WORKS,[
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
-AC_TRY_COMPILE([
-#include "confdefs.h"
-#define NO_PROTO_H 1
-#define NO_CONFIG_H 1
-#define HAVE_SYS_QUOTAS 1
-#include "${srcdir-.}/${samba_cv_sysquotas_file}"
-#include "${srcdir-.}/lib/sysquotas.c"
-],[],samba_cv_SYSQUOTA_WORKS=yes,samba_cv_SYSQUOTA_WORKS=no)
-CPPFLAGS="$SAVE_CPPFLAGS"
-])
-if test x"$samba_cv_SYSQUOTA_WORKS" = x"yes"; then
 AC_MSG_CHECKING(whether to use the new lib/sysquotas.c interface)
-    if test x"$samba_cv_TRY_SYS_QUOTAS" != x"no"; then
+if test x"$samba_cv_SYSQUOTA_FOUND" = x"yes"; then
+       AC_MSG_RESULT(yes)
        AC_DEFINE(WITH_QUOTAS,1,[Whether to use disk quota support])
        AC_DEFINE(HAVE_SYS_QUOTAS,1,[Whether the new lib/sysquotas.c interface can be used])
-       samba_cv_WE_USE_SYS_QUOTAS=yes
+else
+    AC_MSG_RESULT(no)
+    AC_MSG_CHECKING(whether to use the old quota support)
+    if test x"$samba_cv_WITH_QUOTAS" = x"yes"; then
+        AC_DEFINE(WITH_QUOTAS,1,[Whether to use old quota support])
        AC_MSG_RESULT(yes)
     else
-        AC_MSG_RESULT(no)
-    fi
-fi
-fi
-
-if test x"$samba_cv_SYSQUOTA_FOUND" != x"no"; then
-AC_CACHE_CHECK([whether the sys_quota interface works with NFS],samba_cv_SYSQUOTA_WORKS_NFS,[
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
-AC_TRY_COMPILE([
-#include "confdefs.h"
-#define NO_PROTO_H 1
-#define NO_CONFIG_H 1
-#define HAVE_SYS_QUOTAS 1
-#define HAVE_NFS_QUOTAS 1
-#include "${srcdir-.}/lib/sysquotas_nfs.c"
-],[],samba_cv_SYSQUOTA_WORKS_NFS=yes,samba_cv_SYSQUOTA_WORKS_NFS=no)
-CPPFLAGS="$SAVE_CPPFLAGS"
-])
-if test x"$samba_cv_SYSQUOTA_WORKS_NFS" = x"yes"; then
-    if test x"$samba_cv_WE_USE_SYS_QUOTAS" = x"yes"; then
-       AC_DEFINE(HAVE_NFS_QUOTAS,1,[Whether nfs quota support is available])
-    fi
-fi
-fi
-
-if test x"$samba_cv_SYSQUOTA_FOUND" != x"no" -a x"$samba_cv_found_xfs_header" = x"yes"; then
-AC_CACHE_CHECK([whether the sys_quota interface works with XFS],samba_cv_SYSQUOTA_WORKS_XFS,[
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
-AC_TRY_COMPILE([
-#include "confdefs.h"
-#define NO_PROTO_H 1
-#define NO_CONFIG_H 1
-#define HAVE_SYS_QUOTAS 1
-#define HAVE_XFS_QUOTAS 1
-#include "${srcdir-.}/lib/sysquotas_xfs.c"
-],[],samba_cv_SYSQUOTA_WORKS_XFS=yes,samba_cv_SYSQUOTA_WORKS_XFS=no)
-CPPFLAGS="$SAVE_CPPFLAGS"
-])
-if test x"$samba_cv_SYSQUOTA_WORKS_XFS" = x"yes"; then
-    if test x"$samba_cv_WE_USE_SYS_QUOTAS" = x"yes"; then
-       AC_DEFINE(HAVE_XFS_QUOTAS,1,[Whether xfs quota support is available])
-    fi
-fi
-fi
-
-AC_CACHE_CHECK([whether the old quota support works],samba_cv_QUOTA_WORKS,[
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
-AC_TRY_COMPILE([
-#include "confdefs.h"
-#define NO_PROTO_H 1
-#define NO_CONFIG_H 1
-#include "${srcdir-.}/smbd/quotas.c"
-],[],samba_cv_QUOTA_WORKS=yes,samba_cv_QUOTA_WORKS=no)
-CPPFLAGS="$SAVE_CPPFLAGS"
-])
-if test x"$samba_cv_QUOTA_WORKS" = x"yes"; then
-AC_MSG_CHECKING(whether to use the old quota support)
-    if test x"$samba_cv_WE_USE_SYS_QUOTAS" != x"yes"; then
-      if test x"$samba_cv_TRY_QUOTAS" != x"no"; then
-        AC_DEFINE(WITH_QUOTAS,1,[Whether to use disk quota support])
-       AC_MSG_RESULT(yes)
-      else
        AC_MSG_RESULT(no)
-      fi
-    else
-      AC_MSG_RESULT(no)
     fi
 fi
 
 ####################
-# End of quota check samba_cv_RUN_QUOTA_TESTS
+# End of quota check samba_cv_WITH_QUOTAS
 fi
 
 #################################################
@@ -4879,6 +4735,11 @@ if test x"$WITH_UTMP" = x"yes" -a x"$ac_cv_header_utmp_h" = x"no"; then
        WITH_UTMP=no
 fi
 
+if test x"$WITH_UTMP" = x"yes" -a x"$samba_cv_HAVE_UX_UT_LINE" != x"yes"; then
+       utmp_no_reason=", sizeof ut_line not ok"
+       WITH_UTMP=no
+fi
+
 # Display test results
 
 if test x"$WITH_UTMP" = x"yes"; then
@@ -5127,7 +4988,7 @@ ctdb_broken="no"
 SAVED_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS} $CTDB_CPPFLAGS"
 
-AC_CHECK_HEADERS(ctdb.h ctdb_private.h,,,[
+AC_CHECK_HEADERS(ctdb.h ctdb_private.h ctdb_protocol.h ,,,[
 #include "confdefs.h"
 #define NO_CONFIG_H
 #include "replace.h"
@@ -5147,7 +5008,7 @@ then
 fi
 
 if test "x$have_cluster_support" = "xyes" -a \
-       "x$ac_cv_header_ctdb_h" != "xyes"
+       "x$ac_cv_header_ctdb_private_h" != "xyes"
 then
        have_cluster_support=no
        ctdb_broken="ctdb_private.h is required for cluster support"
@@ -5354,7 +5215,6 @@ AC_MSG_RESULT($with_acl_support)
 
 if test x"$with_acl_support" = x"no"; then
        AC_MSG_RESULT(Disabling ACL support)
-       AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
 else
        AC_MSG_NOTICE(checking whether ACL support is available:)
        case "$host_os" in
@@ -5374,11 +5234,6 @@ else
                AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
                default_static_modules="$default_static_modules vfs_hpuxacl"
                ;;
-       *irix*)
-               AC_MSG_NOTICE(Using IRIX ACLs)
-               AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
-               default_static_modules="$default_static_modules vfs_irixacl"
-               ;;
        *aix*)
                AC_MSG_NOTICE(Using AIX ACLs)
                AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
@@ -5392,7 +5247,6 @@ else
                ;;
        *darwin*)
                AC_MSG_NOTICE(ACLs on Darwin currently not supported)
-               AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
                ;;
        *)
                AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
@@ -5441,7 +5295,6 @@ else
                        default_static_modules="$default_static_modules vfs_posixacl"
                else
                        AC_MSG_NOTICE(ACL support is not avaliable)
-                       AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
                fi
                ;;
         esac
@@ -5542,20 +5395,19 @@ int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }])],
                fi
 fi
 
-if test x"$samba_cv_HAVE_AIO" = x"yes"; then
-       if test x"$samba_cv_msghdr_msg_control" = x"yes" -o \
-               x"$samba_cv_msghdr_msg_acctright" = x"yes"; then
-               default_shared_modules="$default_shared_modules vfs_aio_fork"
-       fi
+if test x"$samba_cv_msghdr_msg_control" = x"yes" -o \
+       x"$samba_cv_msghdr_msg_acctright" = x"yes"; then
+       default_shared_modules="$default_shared_modules vfs_aio_fork"
+fi
 
 # Check for Linux kernel aio support.
-       case "$host_os" in
-       *linux*)
-           AC_CHECK_LIB(aio,io_submit,[AIO_LIBS="$LIBS -laio"])
-           AC_CACHE_CHECK([for Linux kernel asynchronous io support],samba_cv_HAVE_LINUX_KERNEL_AIO,[
-           aio_LIBS=$LIBS
-           LIBS=$AIO_LIBS
-           AC_TRY_LINK([#include <unistd.h>
+case "$host_os" in
+*linux*)
+    AC_CHECK_LIB(aio,io_submit,[AIO_LIBS="$LIBS -laio"])
+    AC_CACHE_CHECK([for Linux kernel asynchronous io support],samba_cv_HAVE_LINUX_KERNEL_AIO,[
+    aio_LIBS=$LIBS
+    LIBS=$AIO_LIBS
+    AC_TRY_LINK([#include <unistd.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #include <fcntl.h>
@@ -5577,13 +5429,11 @@ io_submit(ctx, 1, &ioc);
 io_getevents(ctx, 1, 1, &ioev, &ts);],
 samba_cv_HAVE_LINUX_KERNEL_AIO=yes,samba_cv_HAVE_LINUX_KERNEL_AIO=no)
                LIBS=$aio_LIBS])
-           if test x"$samba_cv_HAVE_LINUX_KERNEL_AIO" = x"yes"; then
-               AC_DEFINE(HAVE_AIO, 1, [Using asynchronous io])
-               default_shared_modules="$default_shared_modules vfs_aio_linux"
-           fi
-            ;;
-        esac
-fi
+    if test x"$samba_cv_HAVE_LINUX_KERNEL_AIO" = x"yes"; then
+       default_shared_modules="$default_shared_modules vfs_aio_linux"
+    fi
+    ;;
+esac
 
 if test x"$samba_cv_HAVE_AIO" = x"yes"; then
   default_shared_modules="$default_shared_modules vfs_aio_posix"
@@ -5592,16 +5442,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 sendfile support],samba_cv_HAVE_SENDFILE,[
                AC_TRY_LINK([#include <sys/sendfile.h>],
@@ -5652,7 +5509,39 @@ samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
                AC_MSG_RESULT(no);
        fi
        ;;
+       *darwin*)
+               AC_CACHE_CHECK([for Darwin sendfile support],
+                       samba_cv_HAVE_SENDFILE,
+                       [
+                       AC_TRY_LINK([
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+                       ],
+                       [
+       int fromfd, tofd, ret;
+       off_t offset, nwritten;
+       struct sf_hdtr hdr;
+       struct iovec hdtrl;
+       hdr.headers = &hdtrl;
+       hdr.hdr_cnt = 1;
+       hdr.trailers = (void *)0;
+       hdr.trl_cnt = 0;
+       hdtrl.iov_base = (void *)0;
+       hdtrl.iov_len = 0;
+       ret = sendfile(fromfd, tofd, offset, &nwritten, &hdr, 0);
+                       ],
+                       samba_cv_HAVE_SENDFILE=yes,
+                       samba_cv_HAVE_SENDFILE=no)])
 
+       if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
+               AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() support is available])
+               AC_DEFINE(DARWIN_SENDFILE_API,1,[Whether the Darwin sendfile() API is available])
+               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
+       else
+               AC_MSG_RESULT(no);
+       fi
+       ;;
        *hpux*|*osf*)
                AC_CACHE_CHECK([for osf/hpux sendfile support],samba_cv_HAVE_SENDFILE,[
                AC_TRY_LINK([\
@@ -5746,14 +5635,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.
@@ -6261,19 +6148,17 @@ fi
 # Check if user wants pthreadpool support
 
 AC_ARG_ENABLE(pthreadpool,
-[AS_HELP_STRING([--enable-pthreadpool], [Enable pthreads pool helper support (default=no)])])
+[AS_HELP_STRING([--enable-pthreadpool], [Enable pthreads pool helper support (default=yes)])])
 
 if test x"$enable_pthreadpool" = xyes -a x"$samba_cv_HAVE_PTHREAD" != x"yes"; then
        AC_MSG_ERROR([pthreadpool support cannot be enabled when pthread support was not found])
 fi
 
-if test x"$enable_pthreadpool" = x"yes" -a x"$samba_cv_HAVE_PTHREAD" = x"yes"; then
+if test x"$enable_pthreadpool" != x"no" -a x"$samba_cv_HAVE_PTHREAD" = x"yes"; then
     LIBS="$LIBS $PTHREAD_LDFLAGS"
     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
     AC_SUBST(PTHREADPOOL_OBJ, "lib/pthreadpool/pthreadpool.o")
-    if test x"$samba_cv_HAVE_AIO" = x"yes"; then
-        default_shared_modules="$default_shared_modules vfs_aio_pthread"
-    fi
+    default_shared_modules="$default_shared_modules vfs_aio_pthread"
 else
     AC_SUBST(PTHREADPOOL_OBJ, "lib/pthreadpool/pthreadpool_sync.o")
 fi
@@ -6506,6 +6391,7 @@ SMB_MODULE(vfs_extd_audit, \$(VFS_EXTD_AUDIT_OBJ), "bin/extd_audit.$SHLIBEXT", V
 SMB_MODULE(vfs_full_audit, \$(VFS_FULL_AUDIT_OBJ), "bin/full_audit.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_netatalk, \$(VFS_NETATALK_OBJ), "bin/netatalk.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_fake_perms, \$(VFS_FAKE_PERMS_OBJ), "bin/fake_perms.$SHLIBEXT", VFS)
+SMB_MODULE(vfs_fake_acls, \$(VFS_FAKE_ACLS_OBJ), "bin/fake_acls.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_default_quota, \$(VFS_DEFAULT_QUOTA_OBJ), "bin/default_quota.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_readonly, \$(VFS_READONLY_OBJ), "bin/readonly.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_cap, \$(VFS_CAP_OBJ), "bin/cap.$SHLIBEXT", VFS)
@@ -6518,7 +6404,6 @@ SMB_MODULE(vfs_posixacl, \$(VFS_POSIXACL_OBJ), "bin/posixacl.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_aixacl, \$(VFS_AIXACL_OBJ), "bin/aixacl.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_aixacl2, \$(VFS_AIXACL2_OBJ), "bin/aixacl2.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_solarisacl, \$(VFS_SOLARISACL_OBJ), "bin/solarisacl.$SHLIBEXT", VFS)
-SMB_MODULE(vfs_irixacl, \$(VFS_IRIXACL_OBJ), "bin/irixacl.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_hpuxacl, \$(VFS_HPUXACL_OBJ), "bin/hpuxacl.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_tru64acl, \$(VFS_TRU64ACL_OBJ), "bin/tru64acl.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_catia, \$(VFS_CATIA_OBJ), "bin/catia.$SHLIBEXT", VFS)
@@ -6528,7 +6413,6 @@ 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)
@@ -6548,6 +6432,7 @@ SMB_MODULE(vfs_scannedonly, \$(VFS_SCANNEDONLY_OBJ), "bin/scannedonly.$SHLIBEXT"
 SMB_MODULE(vfs_crossrename, \$(VFS_CROSSRENAME_OBJ), "bin/crossrename.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_linux_xfs_sgid, \$(VFS_LINUX_XFS_SGID_OBJ), "bin/linux_xfs_sgid.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_time_audit, \$(VFS_TIME_AUDIT_OBJ), "bin/time_audit.$SHLIBEXT", VFS)
+SMB_MODULE(vfs_media_harmony, \$(VFS_MEDIA_HARMONY_OBJ), "bin/media_harmony.$SHLIBEXT", VFS)
 
 SMB_SUBSYSTEM(VFS,smbd/vfs.o)
 
@@ -6571,10 +6456,13 @@ fi
 #################################################
 # If run from the build farm, enable NASTY hacks
 #################################################
-AC_MSG_CHECKING(whether to enable build farm hacks)
-if test x"$RUN_FROM_BUILD_FARM" = x"yes"; then
+AC_MSG_CHECKING(whether to enable features for selftest)
+if test x"$selftest" = x"yes"; then
        AC_MSG_RESULT(yes)
-       AC_DEFINE(ENABLE_BUILD_FARM_HACKS, 1, [Defined if running in the build farm])
+       AC_DEFINE(ENABLE_SELFTEST, 1, [Support features needed for selftest])
+       if test x"$selftest_possible" != xyes; then
+               AC_MSG_ERROR(selftest support only possible with python, including development headers, and perl installed)
+       fi
 else
        AC_MSG_RESULT(no)
 fi
@@ -6653,11 +6541,6 @@ fi
 
 m4_include(../lib/zlib/zlib.m4)
 
-if test x$smbtorture4_possible = xyes; then
-       SMBTORTURE4="bin/smbtorture4"
-       AC_SUBST(SMBTORTURE4)
-fi
-
 AC_SUBST(ZLIB_LIBS)
 AC_SUBST(ZLIB_OBJS)
 AC_ZLIB([ZLIB_OBJS=""], [