Imported Upstream version 4.0.0+dfsg1
[abartlet/samba-debian.git] / source3 / configure
index bffc9c774c62fad3682814a2371ae87265322909..737ddc29513a91a644d1d46b83c513fee399aa49 100755 (executable)
@@ -1,11 +1,13 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for Samba 3.
+# Generated by GNU Autoconf 2.68 for Samba 3.
 #
 # Report bugs to <samba-technical@samba.org>.
 #
 #
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -134,31 +136,6 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-# Use a proper internal environment variable to ensure we don't fall
-  # into an infinite loop, continuously re-executing ourselves.
-  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
-    _as_can_reexec=no; export _as_can_reexec;
-    # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
-  fi
-  # We don't want this to propagate to other subprocesses.
-          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -192,8 +169,7 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
+test x\$exitcode = x0 || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -238,25 +214,21 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  export CONFIG_SHELL
-             # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       # Preserve -v and -x to the replacement shell.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       case $- in # ((((
+         *v*x* | *x*v* ) as_opts=-vx ;;
+         *v* ) as_opts=-v ;;
+         *x* ) as_opts=-x ;;
+         * ) as_opts= ;;
+       esac
+       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
 fi
 
     if test x$as_have_required = xno; then :
@@ -359,14 +331,6 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -488,10 +452,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
-  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
-  # already done that, so ensure we don't try to do so again and fall
-  # in an infinite loop.  This has already happened in practice.
-  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -526,16 +486,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
+    # In both cases, we have to default to `cp -p'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
+      as_ln_s='cp -p'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -pR'
+    as_ln_s='cp -p'
   fi
 else
-  as_ln_s='cp -pR'
+  as_ln_s='cp -p'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -547,8 +507,28 @@ else
   as_mkdir_p=false
 fi
 
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -628,7 +608,6 @@ SMBD_LIBS
 DEVELOPER_CFLAGS
 ZLIB_OBJS
 ZLIB_LIBS
-SMBTORTURE4
 GPEXT_MODULES
 GPEXT_STATIC
 PERFCOUNT_MODULES
@@ -637,8 +616,6 @@ VFS_MODULES
 VFS_STATIC
 AUTH_MODULES
 AUTH_STATIC
-CHARSET_MODULES
-CHARSET_STATIC
 NSS_INFO_MODULES
 NSS_INFO_STATIC
 IDMAP_MODULES
@@ -669,22 +646,9 @@ WBCLIENT_LDFLAGS
 WBCLIENT_INCLUDES
 ZFSACL_LIBS
 KRB5CONFIG
-SMBLDAPUTIL
 SMBLDAP
 FAKE_KASERVER_OBJ
 SMB_FAM_LIBS
-LIBADDNS_SHARED_TARGET_FULLVER
-LIBADDNS_SHARED_TARGET_SOVER
-LIBADDNS_FULLVER
-LIBADDNS_SOVER
-UNINSTALL_LIBADDNS
-INSTALL_LIBADDNS
-LIBADDNS_TARGET
-LIBADDNS_LIBS
-LIBADDNS_STATIC
-LIBADDNS_SHARED
-LIBADDNS_STATIC_TARGET
-LIBADDNS_SHARED_TARGET
 LIBSMBSHAREMODES_SHARED_TARGET_FULLVER
 LIBSMBSHAREMODES_SHARED_TARGET_SOVER
 LIBSMBSHAREMODES_FULLVER
@@ -721,6 +685,30 @@ LIBNETAPI_STATIC
 LIBNETAPI_SHARED
 LIBNETAPI_STATIC_TARGET
 LIBNETAPI_SHARED_TARGET
+NTDBTORTURE
+NTDBTOOL
+NTDBRESTORE
+NTDBDUMP
+NTDBBACKUP
+LIBNTDB_SHARED_TARGET_FULLVER
+LIBNTDB_SHARED_TARGET_SOVER
+LIBNTDB_FULLVER
+LIBNTDB_SOVER
+UNINSTALL_LIBNTDB
+INSTALL_LIBNTDB
+LIBNTDB_TARGET
+LIBNTDB_STATIC
+LIBNTDB_SHARED
+LIBNTDB_STATIC_TARGET
+LIBNTDB_SHARED_TARGET
+NTDB_CFLAGS
+NTDB_DEPS
+NTDB_LIBS
+NTDB_OBJ
+ntdbdir
+LIBNTDB_OBJ0
+LIBNTDB_LIBS
+LIBNTDB_CFLAGS
 TDBTORTURE
 TDBTOOL
 TDBRESTORE
@@ -769,7 +757,6 @@ USESHARED
 ROFF
 SYMSEXT
 LIBUNWIND_PTRACE
-ONEFS_LIBS
 TERMLDFLAGS
 TERMLIBS
 CUPS_CONFIG
@@ -792,6 +779,8 @@ MAKE
 AWK
 SWAT_INSTALL_TARGETS
 SWAT_SBIN_TARGETS
+UID_WRAPPER_OBJS
+HAVE_UID_WRAPPER
 NSS_WRAPPER_OBJS
 HAVE_NSS_WRAPPER
 SOCKET_WRAPPER_OBJS
@@ -817,7 +806,6 @@ INSTALL_PAM_MODULES
 PAM_MODULES
 GPEXT_LIBS
 LDAP_LIBS
-UUID_LIBS
 KRB5_LIBS
 IDMAP_LIBS
 PASSDB_LIBS
@@ -854,6 +842,9 @@ SONAMEFLAG
 LDSHFLAGS
 SAMBA_CPPFLAGS
 LIBTEVENT_OBJ0
+CCAN_CFLAGS
+CCAN_OBJ
+ccandir
 EXPORTSFILE
 TEVENT_LIBS
 TEVENT_CFLAGS
@@ -874,26 +865,41 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
+selftest
 developer
-selftest_custom_conf
-smbtorture4_option
-smbtorture4_path
-selftest_shrdir
 selftest_prefix
-modulesdir
-pammodulesdir
-rootsbindir
-cachedir
-statedir
-codepagedir
-swatdir
-privatedir
-logfilebase
-ncalrpcdir
-nmbdsocketdir
-piddir
-lockdir
-configdir
+SMB_PASSWD_FILE
+LMHOSTSFILE
+CONFIGFILE
+NCALRPCDIR
+NTP_SIGND_SOCKET_DIR
+NMBDSOCKETDIR
+WINBINDD_PRIVILEGED_SOCKET_DIR
+WINBINDD_SOCKET_DIR
+PRIVILEGED_SOCKET_DIR
+SOCKET_DIR
+LOGFILEBASE
+CACHEDIR
+STATEDIR
+PIDDIR
+LOCKDIR
+PRIVATE_DIR
+CONFIGDIR
+PAMMODULESDIR
+CODEPAGEDIR
+SWATDIR
+PKGCONFIGDIR
+SETUPDIR
+INCLUDEDIR
+MODULESDIR
+SCRIPTSBINDIR
+LOCALEDIR
+DATADIR
+MANDIR
+LIBEXECDIR
+LIBDIR
+SBINDIR
+BINDIR
 target_os
 target_vendor
 target_cpu
@@ -950,38 +956,33 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-with_fhs
+enable_fhs
+with_modulesdir
+with_pammodulesdir
+with_configdir
 with_privatedir
-with_rootsbindir
 with_lockdir
+with_piddir
 with_statedir
 with_cachedir
-with_piddir
-with_ncalrpcdir
-with_nmbdsocketdir
-with_swatdir
-with_configdir
 with_logfilebase
-with_modulesdir
-with_pammodulesdir
-with_mandir
-with_localedir
-with_codepagedir
+with_sockets_dir
+with_privileged_socket_dir
+with_winbind_socket_dir
+with_winbind_privileged_socket_dir
 with_selftest_prefix
-with_selftest_shrdir
-with_smbtorture4_path
-with_selftest_custom_conf
 enable_debug
 enable_developer
+enable_selftest
 enable_krb5developer
 enable_picky_developer
 with_cfenc
 enable_largefile
 enable_socket_wrapper
 enable_nss_wrapper
+enable_uid_wrapper
 enable_swat
 with_profiling_data
-enable_smbtorture4
 enable_cups
 enable_iprint
 with_readline
@@ -996,10 +997,11 @@ enable_external_libtalloc
 with_libtalloc
 enable_external_libtdb
 with_libtdb
+enable_external_libntdb
+with_libntdb
 with_libnetapi
 with_libsmbclient
 with_libsmbsharemodes
-with_libaddns
 with_libiconv
 enable_fam
 with_dmapi
@@ -1018,11 +1020,11 @@ with_nisplus_home
 with_syslog
 with_syslog_facility
 with_quotas
-with_sys_quotas
 with_utmp
 with_cluster_support
 with_ctdb
 enable_old_ctdb
+enable_ctdb_readonly_records
 with_acl_support
 with_aio_support
 with_sendfile_support
@@ -1033,6 +1035,7 @@ enable_dnssd
 enable_avahi
 enable_pthreadpool
 with_included_iniparser
+enable_fault_handler
 with_static_modules
 with_shared_modules
 enable_dmalloc
@@ -1051,7 +1054,9 @@ PKG_CONFIG
 LIBTALLOC_CFLAGS
 LIBTALLOC_LIBS
 LIBTDB_CFLAGS
-LIBTDB_LIBS'
+LIBTDB_LIBS
+LIBNTDB_CFLAGS
+LIBNTDB_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1507,6 +1512,8 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
+    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1666,9 +1673,11 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-fhs            Turn on FHS support (default=no)
   --enable-debug          Turn on compiler debugging information (default=no)
   --enable-developer      Turn on developer warnings and debugging
                           (default=no)
+  --enable-selftest       Turn on selftest capability (default=no)
   --enable-krb5developer  Turn on developer warnings and debugging, except
                           -Wstrict-prototypes (default=no)
   --enable-picky-developer
@@ -1676,8 +1685,8 @@ Optional Features:
   --disable-largefile     omit support for large files
   --enable-socket-wrapper Turn on socket wrapper library (default=no)
   --enable-nss-wrapper    Turn on nss wrapper library (default=no)
+  --enable-uid-wrapper    Turn on uid wrapper library (default=no)
   --enable-swat           Build the SWAT tool (default=yes)
-  --enable-smbtorture4    Enable building smbtorture4 (default=auto)
   --enable-cups           Turn on CUPS support (default=auto)
   --enable-iprint         Turn on iPrint support (default=yes if cups is yes)
   --enable-static=PKGS    build static libraries default=no
@@ -1691,57 +1700,50 @@ Optional Features:
                           Enable external talloc [default=auto]
   --enable-external-libtdb
                           Enable external tdb [default=auto]
+  --enable-external-libntdb
+                          Enable external ntdb [default=auto]
   --enable-fam            Turn on FAM support (default=auto)
   --enable-old-ctdb       Enable build against (too) old ctdb version
                           (default=no)
+  --enable-ctdb-readonly-records
+                          Turn on CTDB readonly records support (default=yes)
   --enable-dnssd          Enable DNS service discovery support (default=no)
   --enable-avahi          Enable Avahi support (default=auto)
-  --enable-pthreadpool    Enable pthreads pool helper support (default=no)
+  --enable-pthreadpool    Enable pthreads pool helper support (default=yes)
+  --disable-fault-handler Disable the default handler
   --enable-dmalloc        Enable heap debugging [default=no]
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-fhs              Use FHS-compliant paths (default=no)
-  --with-privatedir=DIR   Where to put smbpasswd ($ac_default_prefix/private)
-  --with-rootsbindir=DIR  Which directory to use for root sbin
-                          ($ac_default_prefix/sbin)
-  --with-lockdir=DIR      Where to put lock files
-                          ($ac_default_prefix/var/locks)
-  --with-statedir=DIR     Where to put persistent state files
-                          ($ac_default_prefix/var/locks)
-  --with-cachedir=DIR     Where to put temporary cache files
-                          ($ac_default_prefix/var/locks)
-  --with-piddir=DIR       Where to put pid files
-                          ($ac_default_prefix/var/locks)
-  --with-ncalrpcdir=DIR   Where to put ncalrpc sockets
-                          ($ac_default_prefix/var/ncalrpc)
-  --with-nmbdsocketdir=DIR
-                          Where to put the nmbd socket directory
-                          ($ac_default_prefix/var/nmbd)
-  --with-swatdir=DIR      Where to put SWAT files ($ac_default_prefix/swat)
-  --with-configdir=DIR    Where to put configuration files ($libdir)
-  --with-logfilebase=DIR  Where to put log files ($VARDIR)
-  --with-modulesdir=DIR   Where to put shared modules ($libdir)
+  --with-modulesdir=DIR   Which directory to use for modules
+                          ($exec_prefix/modules)
   --with-pammodulesdir=DIR
                           Which directory to use for PAM modules
-                          ($ac_default_prefix/$libdir/security)
-  --with-mandir=DIR       Where to put man pages ($mandir)
-  --with-localedir=DIR    Where to put po files
-                          ($ac_default_prefix/share/locale)
-  --with-codepagedir=DIR  Where to put codepages
-                          ($ac_default_prefix/lib/samba)
+                          ($libdir/security)
+  --with-configdir=DIR    Where to put configuration files ($sysconfdir)
+  --with-privatedir=DIR   Where to put passdb.tdb and other private files
+                          ($prefix/private)
+  --with-lockdir=DIR      Where to put short term disposable state files
+                          ($localstatedir/lock)
+  --with-piddir=DIR       Where to put pid files ($localstatedir/run)
+  --with-statedir=DIR     Where to put persistent state files
+                          ($localstatedir/locks)
+  --with-cachedir=DIR     Where to put temporary cache files
+                          ($localstatedir/cache)
+  --with-logfilebase=DIR  Where to put log files ($localstatedir)
+  --with-sockets-dir=DIR  socket directory ($localstatedir/run)
+  --with-privileged-socket-dir=DIR
+                          privileged socket directory ($localstatedir/lib)
+  --with-winbind-socket-dir=DIR
+                          winbnd socket directory
+                          ($localstatedir/run/winbindd)
+  --with-winbind-privileged-socket-dir=DIR
+                          winbind privileged socket directory
+                          ($localstatedir/lib/winbindd)
   --with-selftest-prefix=DIR
                           The prefix where make test will be run
                           ($selftest_prefix)
-  --with-selftest-shrdir=DIR
-                          The share directory that make test will be run
-                          against ($selftest_shrdir)
-  --with-smbtorture4-path=PATH
-                          The path to a samba4 smbtorture for make test (none)
-  --with-selftest-custom-conf=PATH
-                          An optional custom smb.conf that is included in the
-                          server smb.conf during make test(none)
   --with-cfenc=HEADERDIR  Use internal CoreFoundation encoding API for
                           optimization (Mac OS X/Darwin only)
   --with-profiling-data   Include gathering source code profile information
@@ -1754,14 +1756,14 @@ Optional Packages:
                           shared libs supported)
   --with-libtdb           Build the libtdb shared library (default=yes if
                           shared libs supported)
+  --with-libntdb          Build the libntdb shared library (default=yes if
+                          shared libs supported)
   --with-libnetapi        Build the libnetapi shared library (default=yes if
                           shared libs supported)
   --with-libsmbclient     Build the libsmbclient shared library (default=yes if
                           shared libs supported)
   --with-libsmbsharemodes Build the libsmbsharemodes shared library (default=yes if
                           shared libs supported)
-  --with-libaddns         Build the libaddns shared library (default=no
-                          (undefined API))
   --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include
                           (default=auto)
   --with-dmapi            Include DMAPI/XDSM support (default=auto)
@@ -1781,13 +1783,12 @@ Optional Packages:
   --with-syslog           Include experimental SYSLOG support (default=no)
   --with-syslog-facility  Use a custom syslog facility (default=none)
   --with-quotas           Include disk-quota support (default=no)
-  --with-sys-quotas       Include lib/sysquotas.c support (default=auto)
   --with-utmp             Include utmp accounting (default, if supported by
                           OS)
   --with-cluster-support  Enable cluster extensions (default=auto)
   --with-ctdb=DIR         Where to find ctdb sources
   --with-acl-support      Include ACL support (default=auto)
-  --with-aio-support      Include asynchronous io support (default=no)
+  --with-aio-support      Include asynchronous io support (default=auto)
   --with-sendfile-support Whether sendfile support should be built in
                           (default=auto)
   --with-wbclient         Use external wbclient (optional)
@@ -1822,6 +1823,10 @@ Some influential environment variables:
   LIBTDB_CFLAGS
               C compiler flags for LIBTDB, overriding pkg-config
   LIBTDB_LIBS linker flags for LIBTDB, overriding pkg-config
+  LIBNTDB_CFLAGS
+              C compiler flags for LIBNTDB, overriding pkg-config
+  LIBNTDB_LIBS
+              linker flags for LIBNTDB, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1890,9 +1895,9 @@ test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 Samba configure 3
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.68
 
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -2169,7 +2174,7 @@ $as_echo "$ac_try_echo"; } >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
         test "$cross_compiling" = yes ||
-        test -x conftest$ac_exeext
+        $as_test_x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -2259,8 +2264,7 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0;
-return test_array [0];
+test_array [0] = 0
 
   ;
   return 0;
@@ -2276,8 +2280,7 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
+test_array [0] = 0
 
   ;
   return 0;
@@ -2303,8 +2306,7 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0;
-return test_array [0];
+test_array [0] = 0
 
   ;
   return 0;
@@ -2320,8 +2322,7 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
+test_array [0] = 0
 
   ;
   return 0;
@@ -2355,8 +2356,7 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
+test_array [0] = 0
 
   ;
   return 0;
@@ -2599,7 +2599,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by Samba $as_me 3, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
 
@@ -2948,7 +2948,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_headers="$ac_config_headers include/config.h"
+ac_config_headers="$ac_config_headers include/autoconf/config.h"
 
 
 $as_echo "#define CONFIG_H_IS_FROM_SAMBA 1" >>confdefs.h
@@ -2965,18 +2965,18 @@ builddir=`pwd`
 
 
 
-SMB_VERSION_STRING=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_OFFICIAL_STRING' | cut -d '"' -f2`
+SMB_VERSION_STRING=`cat $srcdir/include/autoconf/version.h | grep '#define SAMBA_VERSION_OFFICIAL_STRING' | cut -d '"' -f2`
 echo "SAMBA VERSION: ${SMB_VERSION_STRING}"
 
-SAMBA_VERSION_GIT_COMMIT_FULLREV=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_GIT_COMMIT_FULLREV' | cut -d ' ' -f3- | cut -d '"' -f2`
+SAMBA_VERSION_GIT_COMMIT_FULLREV=`cat $srcdir/include/autoconf/version.h | grep 'SAMBA_VERSION_GIT_COMMIT_FULLREV' | cut -d ' ' -f3- | cut -d '"' -f2`
 if test -n "${SAMBA_VERSION_GIT_COMMIT_FULLREV}";then
        echo "BUILD COMMIT REVISION: ${SAMBA_VERSION_GIT_COMMIT_FULLREV}"
 fi
-SAMBA_VERSION_COMMIT_DATE=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_COMMIT_DATE' | cut -d ' ' -f3-`
+SAMBA_VERSION_COMMIT_DATE=`cat $srcdir/include/autoconf/version.h | grep 'SAMBA_VERSION_COMMIT_DATE' | cut -d ' ' -f3-`
 if test -n "${SAMBA_VERSION_COMMIT_DATE}";then
        echo "BUILD COMMIT DATE: ${SAMBA_VERSION_COMMIT_DATE}"
 fi
-SAMBA_VERSION_COMMIT_TIME=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_COMMIT_TIME' | cut -d ' ' -f3-`
+SAMBA_VERSION_COMMIT_TIME=`cat $srcdir/include/autoconf/version.h | grep 'SAMBA_VERSION_COMMIT_TIME' | cut -d ' ' -f3-`
 if test -n "${SAMBA_VERSION_COMMIT_TIME}";then
        echo "BUILD COMMIT TIME: ${SAMBA_VERSION_COMMIT_TIME}"
 
@@ -3156,152 +3156,158 @@ echo "LIBREPLACE_LOCATION_CHECKS: END"
 # ones...
 
 
-rootsbindir="\${SBINDIR}"
-lockdir="\${VARDIR}/locks"
-piddir="\${VARDIR}/locks"
-ncalrpcdir="\${VARDIR}/ncalrpc"
-nmbdsocketdir="\${VARDIR}/nmbd"
-test "${mandir}" || mandir="\${prefix}/man"
-logfilebase="\${VARDIR}"
-privatedir="\${prefix}/private"
-test "${libdir}" || libdir="\${prefix}/lib"
-modulesdir="${libdir}"
-pammodulesdir="${libdir}/security"
-configdir="${libdir}"
-swatdir="\${prefix}/swat"
-codepagedir="\${MODULESDIR}"
-statedir="\${LOCKDIR}"
-cachedir="\${LOCKDIR}"
-localedir="\${prefix}/share/locale"
-
-
-# Check whether --with-fhs was given.
-if test "${with_fhs+set}" = set; then :
-  withval=$with_fhs;  case "$withval" in
-  yes)
-    lockdir="\${VARDIR}/lib/samba"
-    piddir="\${VARDIR}/run"
-    mandir="\${prefix}/share/man"
-    logfilebase="\${VARDIR}/log/samba"
-    privatedir="\${CONFIGDIR}/private"
-    test "${libdir}" || libdir="\${prefix}/lib"
-    modulesdir="${libdir}/samba"
-    configdir="\${sysconfdir}/samba"
-    swatdir="\${DATADIR}/samba/swat"
-    codepagedir="\${MODULESDIR}"
-    statedir="\${VARDIR}/lib/samba"
-    cachedir="\${VARDIR}/lib/samba"
-    ncalrpcdir="\${VARDIR}/ncalrpc"
+BINDIR="${bindir}"
+SBINDIR="${sbindir}"
+LIBDIR="${libdir}"
+LIBEXECDIR="${libexecdir}"
+MANDIR="${mandir}"
+DATADIR="${datadir}"
+LOCALEDIR="${localedir}"
+SCRIPTSBINDIR="${sbindir}"
+#PYTHONDIR
+#PYTHONARCHDIR
+
+# Check whether --enable-fhs was given.
+if test "${enable_fhs+set}" = set; then :
+  enableval=$enable_fhs;
+fi
+
+
+if test x$enable_fhs != xyes; then
+       if test x"$prefix" = x"/usr" -o x"$prefix" = x"/usr/local"; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't install directly under /usr or /usr/local without using the FHS option (--enable-fhs)" >&5
+$as_echo "$as_me: WARNING: Don't install directly under /usr or /usr/local without using the FHS option (--enable-fhs)" >&2;}
+               as_fn_error $? "invalid --prefix=$prefix" "$LINENO" 5
+       fi
+       MODULESDIR="${libdir}"
+       INCLUDEDIR="${includedir}"
+       SETUPDIR="${datadir}/setup"
+       PKGCONFIGDIR="${libdir}/pkgconfig"
+       SWATDIR="${datadir}/swat"
+       CODEPAGEDIR="${datadir}/codepages"
+       PAMMODULESDIR="${libdir}/security"
+       CONFIGDIR="\${sysconfdir}"
+       PRIVATE_DIR="\${prefix}/private"
+       LOCKDIR="\${localstatedir}/lock"
+       PIDDIR="\${localstatedir}/run"
+       STATEDIR="\${localstatedir}/locks"
+       CACHEDIR="\${localstatedir}/cache"
+       LOGFILEBASE="\${localstatedir}"
+       SOCKET_DIR="\${localstatedir}/run"
+       PRIVILEGED_SOCKET_DIR="\${localstatedir}/lib"
+else
 
 $as_echo "#define FHS_COMPATIBLE 1" >>confdefs.h
 
-    ;;
-  esac
-fi
 
+       MODULESDIR="${libdir}/samba"
+       INCLUDEDIR="${includedir}/samba-4.0"
+       SETUPDIR="${datadir}/samba/setup"
+       PKGCONFIGDIR="${libdir}/pkgconfig"
+       SWATDIR="${datadir}/samba/swat"
+       CODEPAGEDIR="${datadir}/samba/codepages"
+       PAMMODULESDIR="${libdir}/security"
+       CONFIGDIR="\${sysconfdir}/samba"
+       PRIVATE_DIR="\${localstatedir}/lib/samba/private"
+       LOCKDIR="\${localstatedir}/lock/samba"
+       PIDDIR="\${localstatedir}/run/samba"
+       STATEDIR="\${localstatedir}/lib/samba"
+       CACHEDIR="\${localstatedir}/cache/samba"
+       LOGFILEBASE="\${localstatedir}/log/samba"
+       SOCKET_DIR="\${localstatedir}/run/samba"
+       PRIVILEGED_SOCKET_DIR="\${localstatedir}/lib/samba"
+fi
 
-#################################################
-# set private directory location
 
-# Check whether --with-privatedir was given.
-if test "${with_privatedir+set}" = set; then :
-  withval=$with_privatedir;  case "$withval" in
+# Check whether --with-modulesdir was given.
+if test "${with_modulesdir+set}" = set; then :
+  withval=$with_modulesdir;  case "$withval" in
   yes|no)
   #
   # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-privatedir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-privatedir called without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-modulesdir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-modulesdir called without argument - will use default" >&2;}
   ;;
   * )
-    privatedir="$withval"
-    ;;
+    MODULESDIR="$withval"
+  ;;
   esac
 fi
 
 
-#################################################
-# set root sbin directory location
 
-# Check whether --with-rootsbindir was given.
-if test "${with_rootsbindir+set}" = set; then :
-  withval=$with_rootsbindir;  case "$withval" in
+# Check whether --with-pammodulesdir was given.
+if test "${with_pammodulesdir+set}" = set; then :
+  withval=$with_pammodulesdir;  case "$withval" in
   yes|no)
   #
   # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-rootsbindir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-rootsbindir called without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-pammodulesdir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-pammodulesdir called without argument - will use default" >&2;}
   ;;
   * )
-    rootsbindir="$withval"
-    ;;
+    PAMMODULESDIR="$withval"
+  ;;
   esac
 fi
 
 
-#################################################
-# set lock directory location
 
-# Check whether --with-lockdir was given.
-if test "${with_lockdir+set}" = set; then :
-  withval=$with_lockdir;  case "$withval" in
+# Check whether --with-configdir was given.
+if test "${with_configdir+set}" = set; then :
+  withval=$with_configdir;  case "$withval" in
   yes|no)
   #
   # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-lockdir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-lockdir called without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-configdir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-configdir called without argument - will use default" >&2;}
   ;;
   * )
-    lockdir="$withval"
-    ;;
+    CONFIGDIR="$withval"
+  ;;
   esac
 fi
 
 
-#################################################
-# set state directory location
 
-# Check whether --with-statedir was given.
-if test "${with_statedir+set}" = set; then :
-  withval=$with_statedir;  case "$withval" in
+# Check whether --with-privatedir was given.
+if test "${with_privatedir+set}" = set; then :
+  withval=$with_privatedir;  case "$withval" in
   yes|no)
   #
   # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-statedir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-statedir called without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-privatedir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-privatedir called without argument - will use default" >&2;}
   ;;
   * )
-    statedir="$withval"
-    ;;
+    PRIVATE_DIR="$withval"
+  ;;
   esac
 fi
 
 
-#################################################
-# set cache directory location
 
-# Check whether --with-cachedir was given.
-if test "${with_cachedir+set}" = set; then :
-  withval=$with_cachedir;  case "$withval" in
+# Check whether --with-lockdir was given.
+if test "${with_lockdir+set}" = set; then :
+  withval=$with_lockdir;  case "$withval" in
   yes|no)
   #
   # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-cachedir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-cachedir called without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-lockdir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-lockdir called without argument - will use default" >&2;}
   ;;
   * )
-    cachedir="$withval"
-    ;;
+    LOCKDIR="$withval"
+  ;;
   esac
 fi
 
 
-#################################################
-# set pid directory location
 
 # Check whether --with-piddir was given.
 if test "${with_piddir+set}" = set; then :
@@ -3314,213 +3320,148 @@ if test "${with_piddir+set}" = set; then :
 $as_echo "$as_me: WARNING: --with-piddir called without argument - will use default" >&2;}
   ;;
   * )
-    piddir="$withval"
-    ;;
-  esac
-fi
-
-
-#################################################
-# set ncalrpc directory location
-
-# Check whether --with-ncalrpcdir was given.
-if test "${with_ncalrpcdir+set}" = set; then :
-  withval=$with_ncalrpcdir;  case "$withval" in
-  yes|no)
-  #
-  # Just in case anybody calls it without argument
-  #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-ncalrpcdir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-ncalrpcdir called without argument - will use default" >&2;}
+    PIDDIR="$withval"
   ;;
-  * )
-    ncalrpcdir="$withval"
-    ;;
   esac
 fi
 
 
-#################################################
-# set nmbd socket directory location
 
-# Check whether --with-nmbdsocketdir was given.
-if test "${with_nmbdsocketdir+set}" = set; then :
-  withval=$with_nmbdsocketdir;  case "$withval" in
+# Check whether --with-statedir was given.
+if test "${with_statedir+set}" = set; then :
+  withval=$with_statedir;  case "$withval" in
   yes|no)
   #
   # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-nmbdsocketdir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-nmbdsocketdir called without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-statedir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-statedir called without argument - will use default" >&2;}
   ;;
   * )
-    nmbdsocketdir="$withval"
-    ;;
-  esac
-fi
-
-
-#################################################
-# set SWAT directory location
-
-# Check whether --with-swatdir was given.
-if test "${with_swatdir+set}" = set; then :
-  withval=$with_swatdir;  case "$withval" in
-  yes|no)
-  #
-  # Just in case anybody does it
-  #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-swatdir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-swatdir called without argument - will use default" >&2;}
+    STATEDIR="$withval"
   ;;
-  * )
-    swatdir="$withval"
-    ;;
   esac
 fi
 
 
-#################################################
-# set configuration directory location
 
-# Check whether --with-configdir was given.
-if test "${with_configdir+set}" = set; then :
-  withval=$with_configdir;  case "$withval" in
+# Check whether --with-cachedir was given.
+if test "${with_cachedir+set}" = set; then :
+  withval=$with_cachedir;  case "$withval" in
   yes|no)
   #
-  # Just in case anybody does it
+  # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-configdir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-configdir called without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-cachedir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-cachedir called without argument - will use default" >&2;}
   ;;
   * )
-    configdir="$withval"
-    ;;
+    CACHEDIR="$withval"
+  ;;
   esac
 fi
 
 
-#################################################
-# set log directory location
 
 # Check whether --with-logfilebase was given.
 if test "${with_logfilebase+set}" = set; then :
   withval=$with_logfilebase;  case "$withval" in
   yes|no)
   #
-  # Just in case anybody does it
+  # Just in case anybody calls it without argument
   #
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-logfilebase called without argument - will use default" >&5
 $as_echo "$as_me: WARNING: --with-logfilebase called without argument - will use default" >&2;}
   ;;
   * )
-    logfilebase="$withval"
-    ;;
+    LOGFILEBASE="$withval"
+  ;;
   esac
 fi
 
 
 
-#################################################
-# set shared modules (internal lib) directory location
-
-# Check whether --with-modulesdir was given.
-if test "${with_modulesdir+set}" = set; then :
-  withval=$with_modulesdir;  case "$withval" in
+# Check whether --with-sockets-dir was given.
+if test "${with_sockets_dir+set}" = set; then :
+  withval=$with_sockets_dir;  case "$withval" in
   yes|no)
   #
-  # Just in case anybody does it
+  # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-modulesdir without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-modulesdir without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-sockets-dir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-sockets-dir called without argument - will use default" >&2;}
   ;;
   * )
-    modulesdir="$withval"
-    ;;
+    SOCKET_DIR="$withval"
+  ;;
   esac
 fi
 
 
-#################################################
-# set PAM modules directory location
 
-# Check whether --with-pammodulesdir was given.
-if test "${with_pammodulesdir+set}" = set; then :
-  withval=$with_pammodulesdir;  case "$withval" in
+# Check whether --with-privileged-socket-dir was given.
+if test "${with_privileged_socket_dir+set}" = set; then :
+  withval=$with_privileged_socket_dir;  case "$withval" in
   yes|no)
   #
   # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-pammodulesdir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-pammodulesdir called without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-sockets-dir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-sockets-dir called without argument - will use default" >&2;}
   ;;
   * )
-    pammodulesdir="$withval"
-    ;;
+    PRIVILEGED_SOCKET_DIR="$withval"
+  ;;
   esac
 fi
 
 
-#################################################
-# set man directory location
+WINBINDD_SOCKET_DIR="${SOCKET_DIR}/winbindd"
+WINBINDD_PRIVILEGED_SOCKET_DIR="${PRIVILEGED_SOCKET_DIR}/winbindd_privileged"
+
 
-# Check whether --with-mandir was given.
-if test "${with_mandir+set}" = set; then :
-  withval=$with_mandir;  case "$withval" in
+# Check whether --with-winbind-socket-dir was given.
+if test "${with_winbind_socket_dir+set}" = set; then :
+  withval=$with_winbind_socket_dir;  case "$withval" in
   yes|no)
   #
-  # Just in case anybody does it
+  # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-mandir without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-mandir without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-winbind-socket-dir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-winbind-socket-dir called without argument - will use default" >&2;}
   ;;
   * )
-    mandir="$withval"
-    ;;
-  esac
-fi
-
-
-################################################
-# set locale directory location
-
-# Check whether --with-localedir was given.
-if test "${with_localedir+set}" = set; then :
-  withval=$with_localedir;  case "$withval" in
-  yes|no)
-    #
-    # Just in case anybody does it
-    #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-localedir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-localedir called without argument - will use default" >&2;}
-  ;;
-  *)
-  localedir="$withval"
+    WINBINDD_SOCKET_DIR="$withval"
   ;;
   esac
 fi
 
 
-#################################################
-# set codepage directory location
 
-# Check whether --with-codepagedir was given.
-if test "${with_codepagedir+set}" = set; then :
-  withval=$with_codepagedir;  case "$withval" in
+# Check whether --with-winbind-privileged-socket-dir was given.
+if test "${with_winbind_privileged_socket_dir+set}" = set; then :
+  withval=$with_winbind_privileged_socket_dir;  case "$withval" in
   yes|no)
   #
   # Just in case anybody calls it without argument
   #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-codepagedir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-codepagedir called without argument - will use default" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-winbind-privileged-socket-dir called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-winbind-privileged-socket-dir called without argument - will use default" >&2;}
   ;;
   * )
-    codepagedir="$withval"
-    ;;
+    WINBINDD_PRIVILEGED_SOCKET_DIR="$withval"
+  ;;
   esac
 fi
 
 
+NMBDSOCKETDIR="${SOCKET_DIR}/nmbd"
+NTP_SIGND_SOCKET_DIR="${SOCKET_DIR}/ntp_signd"
+NCALRPCDIR="${SOCKET_DIR}/ncalrpc"
+CONFIGFILE="${CONFIGDIR}/smb.conf"
+LMHOSTSFILE="${CONFIGDIR}/lmhosts"
+SMB_PASSWD_FILE="${PRIVATE_DIR}/smbpasswd"
+
 
 
 
@@ -3540,90 +3481,38 @@ fi
 
 
 
-#################################################
-# set prefix for 'make test'
-selftest_prefix="./st"
 
 
-# Check whether --with-selftest-prefix was given.
-if test "${with_selftest_prefix+set}" = set; then :
-  withval=$with_selftest_prefix;  case "$withval" in
-  yes|no)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-selftest-prefix called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-selftest-prefix called without argument - will use default" >&2;}
-  ;;
-  * )
-    selftest_prefix="$withval"
-    ;;
-  esac
 
-fi
 
 
-#################################################
-# set shrdir for 'make test'
-selftest_shrdir=""
 
 
-# Check whether --with-selftest-shrdir was given.
-if test "${with_selftest_shrdir+set}" = set; then :
-  withval=$with_selftest_shrdir;  case "$withval" in
-  yes|no)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-selftest-shrdir called without argument - will use default" >&5
-$as_echo "$as_me: WARNING: --with-selftest-shrdir called without argument - will use default" >&2;}
-  ;;
-  * )
-    selftest_shrdir="-s $withval"
-    ;;
-  esac
 
-fi
 
 
-#################################################
-# set path of samba4's smbtorture
-smbtorture4_path=""
 
-smbtorture4_option=""
 
 
-# Check whether --with-smbtorture4_path was given.
-if test "${with_smbtorture4_path+set}" = set; then :
-  withval=$with_smbtorture4_path;  case "$withval" in
-  yes|no)
-    as_fn_error $? "--with-smbtorture4-path should take a path" "$LINENO" 5
-  ;;
-  * )
-    smbtorture4_path="$withval"
-    if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
-       as_fn_error $? "'$smbtorture_path' does not  exist!" "$LINENO" 5
-    fi
-    smbtorture4_option="-t $withval"
-  ;;
- esac
 
-fi
 
 
 #################################################
-# set custom conf for make test
-selftest_custom_conf=""
+# set prefix for 'make test'
+selftest_prefix="./st"
 
 
-# Check whether --with-selftest_custom_conf was given.
-if test "${with_selftest_custom_conf+set}" = set; then :
-  withval=$with_selftest_custom_conf;  case "$withval" in
+# Check whether --with-selftest-prefix was given.
+if test "${with_selftest_prefix+set}" = set; then :
+  withval=$with_selftest_prefix;  case "$withval" in
   yes|no)
-    as_fn_error $? "--with-selftest-custom-conf should take a path" "$LINENO" 5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-selftest-prefix called without argument - will use default" >&5
+$as_echo "$as_me: WARNING: --with-selftest-prefix called without argument - will use default" >&2;}
   ;;
   * )
-    selftest_custom_conf="$withval"
-    if test -z "$selftest_custom_conf" -a ! -f $selftest_custom_conf; then
-       as_fn_error $? "'$selftest_custom_conf' does not  exist!" "$LINENO" 5
-    fi
-    selftest_custom_conf="-c $withval"
-  ;;
- esac
+    selftest_prefix="$withval"
+    ;;
+  esac
 
 fi
 
@@ -3646,6 +3535,18 @@ if test "${enable_developer+set}" = set; then :
   enableval=$enable_developer; if eval "test x$enable_developer = xyes"; then
         debug=yes
         developer=yes
+        selftest=yes
+    fi
+fi
+
+
+
+selftest=no
+# Check whether --enable-selftest was given.
+if test "${enable_selftest+set}" = set; then :
+  enableval=$enable_selftest; if eval "test x$enable_selftest = xyes"; then
+        debug=yes
+        selftest=yes
     fi
 fi
 
@@ -3785,7 +3686,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3825,7 +3726,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3878,7 +3779,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3919,7 +3820,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -3977,7 +3878,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4021,7 +3922,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4467,7 +4368,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-struct stat;
+#include <sys/types.h>
+#include <sys/stat.h>
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4701,7 +4603,7 @@ main ()
   return 0;
 }
 _ACEOF
-for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
 do
   CC="$ac_save_CC $ac_arg"
   if ac_fn_c_try_compile "$LINENO"; then :
@@ -4896,7 +4798,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_GREP" || continue
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -4962,7 +4864,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_EGREP" || continue
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -5169,8 +5071,8 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#         define __EXTENSIONS__ 1
-          $ac_includes_default
+#        define __EXTENSIONS__ 1
+         $ac_includes_default
 int
 main ()
 {
@@ -5657,7 +5559,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
          if test $ac_prog = install &&
            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # AIX install.  It has an incompatible calling convention.
@@ -5780,6 +5682,16 @@ fi
 EOF
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking checking getconf LFS_CFLAGS for large file support flags" >&5
+$as_echo_n "checking checking getconf LFS_CFLAGS for large file support flags... " >&6; }
+LFS_CFLAGS=`(getconf LFS_CFLAGS) 2>/dev/null` || LFS_CFLAGS=""
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${LFS_CFLAGS}" >&5
+$as_echo "${LFS_CFLAGS}" >&6; }
+if test "x$LFS_CFLAGS" != 'x-1' || test "x$LFS_CFLAGS" != "xundefined"; then
+   CFLAGS="$CFLAGS $LFS_CFLAGS"
+fi
+
 # Check whether --enable-largefile was given.
 if test "${enable_largefile+set}" = set; then :
   enableval=$enable_largefile;
@@ -5976,8 +5888,6 @@ _ACEOF
 esac
 rm -rf conftest*
   fi
-
-
 fi
 
 
@@ -5986,6 +5896,24 @@ case "$host_os" in
 #include <standards.h>
 EOF
 
+
+
+
+ cat >>confdefs.h <<\EOF
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
+#endif
+EOF
+
+
+
+
+ cat >>confdefs.h <<\EOF
+#ifndef _BSD_TYPES
+#define _BSD_TYPES 1
+#endif
+EOF
+
                ;;
        *hpux*)
                # mmap on HPUX is completely broken...
@@ -6061,9 +5989,15 @@ $as_echo "#define _SYSV 1" >>confdefs.h
                ;;
 esac
 
+# Do not check for standards.h on darwin, we get nasty warnings on
+# OS/X Lion. Probably a positive-list of OS'es like IRIX and AIX
+# would be the better choice, but this seems to work fine
 
-
-for ac_header in standards.h
+case "$host_os" in
+     *darwin*)
+       ;;
+     *)
+        for ac_header in standards.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "standards.h" "ac_cv_header_standards_h" "$ac_includes_default"
 if test "x$ac_cv_header_standards_h" = xyes; then :
@@ -6075,6 +6009,8 @@ fi
 
 done
 
+       ;;
+esac
 
 # Solaris needs HAVE_LONG_LONG defined
 ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"
@@ -6686,230 +6622,947 @@ if test x"$VERSIONSCRIPT" != "x"; then
 fi
 
 
+ccandir="../lib/ccan"
+for d in $ccanpaths; do
+       if test -f "$srcdir/$d/str/str.c"; then
+               ccandir="$d"
 
-LIBTEVENT_OBJ0=""
-for obj in ${TEVENT_OBJ}; do
-       LIBTEVENT_OBJ0="${LIBTEVENT_OBJ0} ${teventdir}/${obj}"
+               break
+       fi
 done
-
-LIBS="${LIBS} ${TEVENT_LIBS}"
-
-SAMBA_CPPFLAGS="-Iinclude -I${srcdir-.}/include  -I. -I${srcdir-.}"
-SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/replace"
-SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TEVENT_CFLAGS}"
-SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/librpc"
-SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/.."
-
-SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/popt"
-
-## cleanup the $(srcdir) in the Makefile if we are outside of the tree
-if test "x${srcdir-.}" != "x."; then
-       SAMBA_CPPFLAGS=`echo ${SAMBA_CPPFLAGS} | sed -e "s;${srcdir};\$\(srcdir\);g"`
+if test -f "$ccandir/str/str.c"; then :; else
+   as_fn_error $? "cannot find ccan source in $ccandir" "$LINENO" 5
 fi
+CCAN_OBJ="$ccandir/hash/hash.o $ccandir/htable/htable.o $ccandir/ilog/ilog.o $ccandir/likely/likely.o $ccandir/str/debug.o $ccandir/str/str.o $ccandir/tally/tally.o"
 
 
 
+# Preferred method for including ccan modules is #include <ccan/module/...>.
+CCAN_CFLAGS="-I$ccandir/.."
 
 
+# All the configuration checks.  Regrettably, the __attribute__ checks will
+# give false positives on old GCCs, since they just cause warnings.  But that's
+# fairly harmless.
+for ac_header in err.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "err.h" "ac_cv_header_err_h" "$ac_includes_default"
+if test "x$ac_cv_header_err_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ERR_H 1
+_ACEOF
 
+fi
 
+done
 
 
+for ac_header in byteswap.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default"
+if test "x$ac_cv_header_byteswap_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_BYTESWAP_H 1
+_ACEOF
 
+fi
 
+done
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile with __attribute__((cold))" >&5
+$as_echo_n "checking whether we can compile with __attribute__((cold))... " >&6; }
+if ${samba_cv_attribute_cold+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+                               static void __attribute__((cold))
+                               cleanup(void) { }
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_attribute_cold=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_attribute_cold" >&5
+$as_echo "$samba_cv_attribute_cold" >&6; }
 
+if test x"$samba_cv_attribute_cold" = xyes ; then
 
+$as_echo "#define HAVE_ATTRIBUTE_COLD 1" >>confdefs.h
 
+fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile with __attribute__((const))" >&5
+$as_echo_n "checking whether we can compile with __attribute__((const))... " >&6; }
+if ${samba_cv_attribute_const+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+                               static void __attribute__((const))
+                               cleanup(void) { }
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_attribute_const=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_attribute_const" >&5
+$as_echo "$samba_cv_attribute_const" >&6; }
 
+if test x"$samba_cv_attribute_const" = xyes ; then
 
+$as_echo "#define HAVE_ATTRIBUTE_CONST 1" >>confdefs.h
 
+fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile with __attribute__((noreturn))" >&5
+$as_echo_n "checking whether we can compile with __attribute__((noreturn))... " >&6; }
+if ${samba_cv_attribute_noreturn+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+                               static void __attribute__((noreturn))
+                               cleanup(void) { exit(1); }
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_attribute_noreturn=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_attribute_noreturn" >&5
+$as_echo "$samba_cv_attribute_noreturn" >&6; }
 
+if test x"$samba_cv_attribute_noreturn" = xyes ; then
 
+$as_echo "#define HAVE_ATTRIBUTE_NORETURN 1" >>confdefs.h
 
+fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile with __attribute__((printf))" >&5
+$as_echo_n "checking whether we can compile with __attribute__((printf))... " >&6; }
+if ${samba_cv_attribute_printf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+                               static void __attribute__((format(__printf__, 1, 2)))
+                               cleanup(const char *fmt, ...) { }
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_attribute_printf=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_attribute_printf" >&5
+$as_echo "$samba_cv_attribute_printf" >&6; }
 
+if test x"$samba_cv_attribute_printf" = xyes ; then
 
+$as_echo "#define HAVE_ATTRIBUTE_PRINTF 1" >>confdefs.h
 
+fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile with __attribute__((unused))" >&5
+$as_echo_n "checking whether we can compile with __attribute__((unused))... " >&6; }
+if ${samba_cv_attribute_unused+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+                               static void __attribute__((unused))
+                               cleanup(void) { }
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_attribute_unused=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_attribute_unused" >&5
+$as_echo "$samba_cv_attribute_unused" >&6; }
 
+if test x"$samba_cv_attribute_unused" = xyes ; then
 
+$as_echo "#define HAVE_ATTRIBUTE_UNUSED 1" >>confdefs.h
 
+fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile with __attribute__((used))" >&5
+$as_echo_n "checking whether we can compile with __attribute__((used))... " >&6; }
+if ${samba_cv_attribute_used+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+                               static void __attribute__((used))
+                               cleanup(void) { }
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_attribute_used=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_attribute_used" >&5
+$as_echo "$samba_cv_attribute_used" >&6; }
 
+if test x"$samba_cv_attribute_used" = xyes ; then
 
+$as_echo "#define HAVE_ATTRIBUTE_USED 1" >>confdefs.h
 
+fi
 
+# FIXME: We could use endian.h or sys/endian.h here, and __BYTE_ORDER for
+# cross-compiling.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are big endian" >&5
+$as_echo_n "checking whether we are big endian... " >&6; }
+if ${samba_cv_big_endian+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
-# compile with optimization and without debugging by default, but
-# allow people to set their own preference.
-# do this here since AC_CACHE_CHECK apparently sets the CFLAGS to "-g -O2"
-# if it has no value.  This prevent *very* large debug binaries from occurring
-# by default.
-if test "x$debug" = "xyes" ; then
-       CFLAGS="${CFLAGS} -g"
+if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+union { int i; char c[sizeof(int)]; } u;
+         u.i = 0x01020304;
+         return u.c[0] == 0x01 && u.c[1] == 0x02 && u.c[2] == 0x03 && u.c[3] == 0x04 ? 0 : 1;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  samba_cv_big_endian=yes
+else
+  samba_cv_big_endian=no
 fi
-if test "x$CFLAGS" = x; then
-  CFLAGS="-O"
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-# Check whether --enable-socket-wrapper was given.
-if test "${enable_socket_wrapper+set}" = set; then :
-  enableval=$enable_socket_wrapper;
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_big_endian" >&5
+$as_echo "$samba_cv_big_endian" >&6; }
+if test x"$samba_cv_big_endian" = xyes ; then
 
+$as_echo "#define HAVE_BIG_ENDIAN 1" >>confdefs.h
 
-DEFAULT_TEST_OPTIONS=
-HAVE_SOCKET_WRAPPER=no
-
-if eval "test x$developer = xyes"; then
-       enable_socket_wrapper=yes
 fi
 
-if eval "test x$enable_socket_wrapper = xyes"; then
-
-$as_echo "#define SOCKET_WRAPPER 1" >>confdefs.h
-
-       DEFAULT_TEST_OPTIONS=--socket-wrapper
-       HAVE_SOCKET_WRAPPER=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have __builtin_clz" >&5
+$as_echo_n "checking whether we have __builtin_clz... " >&6; }
+if ${samba_cv_builtin_clz+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
-       # this is only used for samba3
-       SOCKET_WRAPPER_OBJS="../lib/socket_wrapper/socket_wrapper.o"
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+                               return __builtin_clz(1) == (sizeof(int)*8 - 1) ? 0 : 1;
+                       }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  samba_cv_builtin_clz=yes
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_builtin_clz" >&5
+$as_echo "$samba_cv_builtin_clz" >&6; }
 
+if test x"$samba_cv_builtin_clz" = xyes ; then
 
+$as_echo "#define HAVE_BUILTIN_CLZ 1" >>confdefs.h
 
-
-# Check whether --enable-nss-wrapper was given.
-if test "${enable_nss_wrapper+set}" = set; then :
-  enableval=$enable_nss_wrapper;
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have __builtin_clzl" >&5
+$as_echo_n "checking whether we have __builtin_clzl... " >&6; }
+if ${samba_cv_builtin_clzl+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
-HAVE_NSS_WRAPPER=no
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+                               return __builtin_clzl(1) == (sizeof(int)*8 - 1) ? 0 : 1;
+                       }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  samba_cv_builtin_clzl=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-if eval "test x$developer = xyes"; then
-       enable_nss_wrapper=yes
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_builtin_clzl" >&5
+$as_echo "$samba_cv_builtin_clzl" >&6; }
 
-if eval "test x$enable_nss_wrapper = xyes"; then
+if test x"$samba_cv_builtin_clzl" = xyes ; then
 
-$as_echo "#define NSS_WRAPPER 1" >>confdefs.h
+$as_echo "#define HAVE_BUILTIN_CLZL 1" >>confdefs.h
 
-       HAVE_NSS_WRAPPER=yes
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have __builtin_clzll" >&5
+$as_echo_n "checking whether we have __builtin_clzll... " >&6; }
+if ${samba_cv_builtin_clzll+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
-       # this is only used for samba3
-       NSS_WRAPPER_OBJS="../lib/nss_wrapper/nss_wrapper.o"
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+                               return __builtin_clzll(1) == (sizeof(int)*8 - 1) ? 0 : 1;
+                       }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  samba_cv_builtin_clzll=yes
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_builtin_clzll" >&5
+$as_echo "$samba_cv_builtin_clzll" >&6; }
 
+if test x"$samba_cv_builtin_clzll" = xyes ; then
 
+$as_echo "#define HAVE_BUILTIN_CLZLL 1" >>confdefs.h
 
+fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have __builtin_constant_p" >&5
+$as_echo_n "checking whether we have __builtin_constant_p... " >&6; }
+if ${samba_cv_builtin_constant_p+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+                               return __builtin_constant_p(1) ? 0 : 1;
+                       }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  samba_cv_builtin_constant_p=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-SWAT_SBIN_TARGETS='bin/swat$(EXEEXT)'
-SWAT_INSTALL_TARGETS=installswat
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_builtin_constant_p" >&5
+$as_echo "$samba_cv_builtin_constant_p" >&6; }
 
-# Check whether --enable-swat was given.
-if test "${enable_swat+set}" = set; then :
-  enableval=$enable_swat;
-    case "$enable_swat" in
-       no)
-           SWAT_SBIN_TARGETS=''
-           SWAT_INSTALL_TARGETS=''
-           ;;
-    esac
+if test x"$samba_cv_builtin_constant_p" = xyes ; then
 
-fi
+$as_echo "#define HAVE_BUILTIN_CONSTANT_P 1" >>confdefs.h
 
+fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have __builtin_expect" >&5
+$as_echo_n "checking whether we have __builtin_expect... " >&6; }
+if ${samba_cv_builtin_expect+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+                               return __builtin_expect(main != 0, 1) ? 0 : 1;
+                       }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  samba_cv_builtin_expect=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_builtin_expect" >&5
+$as_echo "$samba_cv_builtin_expect" >&6; }
 
+if test x"$samba_cv_builtin_expect" = xyes ; then
 
+$as_echo "#define HAVE_BUILTIN_EXPECT 1" >>confdefs.h
 
-DEVELOPER_CFLAGS="-DDEBUG_PASSWORD -DDEVELOPER"
+fi
 
-# Probe the gcc version for extra CFLAGS. We always stash these in
-# DEVELOPER_CFLAGS, so that you can turn them on and off with a simple
-# Makefile edit, avoiding the need to re-run configure.
-if test x"$ac_cv_c_compiler_gnu" = x"yes" ; then
-       DEVELOPER_CFLAGS="${DEVELOPER_CFLAGS} -g -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings"
-       # Add -Wdeclaration-after-statement if compiler supports it
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking that the C compiler understands -Wdeclaration-after-statement" >&5
-$as_echo_n "checking that the C compiler understands -Wdeclaration-after-statement... " >&6; }
-if ${samba_cv_HAVE_Wdeclaration_after_statement+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have __builtin_popcountl" >&5
+$as_echo_n "checking whether we have __builtin_popcountl... " >&6; }
+if ${samba_cv_builtin_popcountl+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-
-       old_CFLAGS="$CFLAGS";
-       CFLAGS="$CFLAGS -Wdeclaration-after-statement";
-       export CFLAGS;
-       old_CPPFLAGS="$CPPFLAGS";
-       CPPFLAGS="$CPPFLAGS";
-       export CPPFLAGS;
-       old_LDFLAGS="$LDFLAGS";
-       LDFLAGS="$LDFLAGS";
-       export LDFLAGS;
-       if test "$cross_compiling" = yes; then :
-  samba_cv_HAVE_Wdeclaration_after_statement=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-           int main(void)
-           {
-               return 0;
-           }
+int main(void) {
+                               return __builtin_popcountl(255L) == 8 ? 0 : 1;
+                       }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  samba_cv_HAVE_Wdeclaration_after_statement=yes
-else
-  samba_cv_HAVE_Wdeclaration_after_statement=no
+if ac_fn_c_try_link "$LINENO"; then :
+  samba_cv_builtin_popcountl=yes
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_builtin_popcountl" >&5
+$as_echo "$samba_cv_builtin_popcountl" >&6; }
 
-       CFLAGS="$old_CFLAGS";
-       old_CFLAGS="";
-       export CFLAGS;
-       CPPFLAGS="$old_CPPFLAGS";
-       old_CPPFLAGS="";
-       export CPPFLAGS;
-       LDFLAGS="$old_LDFLAGS";
-       old_LDFLAGS="";
-       export LDFLAGS;
+if test x"$samba_cv_builtin_popcountl" = xyes ; then
+
+$as_echo "#define HAVE_BUILTIN_POPCOUNTL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have __builtin_types_compatible_p" >&5
+$as_echo_n "checking whether we have __builtin_types_compatible_p... " >&6; }
+if ${samba_cv_builtin_types_compatible_p+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+                               return __builtin_types_compatible_p(char *, int) ? 1 : 0;
+                       }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  samba_cv_builtin_types_compatible_p=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_builtin_types_compatible_p" >&5
+$as_echo "$samba_cv_builtin_types_compatible_p" >&6; }
+
+if test x"$samba_cv_builtin_types_compatible_p" = xyes ; then
+
+$as_echo "#define HAVE_BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have __builtin_choose_expr" >&5
+$as_echo_n "checking whether we have __builtin_choose_expr... " >&6; }
+if ${samba_cv_builtin_choose_expr+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+                               return __builtin_choose_expr(1, 0, "garbage");
+                       }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  samba_cv_builtin_choose_expr=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_builtin_choose_expr" >&5
+$as_echo "$samba_cv_builtin_choose_expr" >&6; }
+
+if test x"$samba_cv_builtin_choose_expr" = xyes ; then
+
+$as_echo "#define HAVE_BUILTIN_CHOOSE_EXPR 1" >>confdefs.h
+
+fi
+
+# We use [ and ] here for embedded [ and ].
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have compound literals" >&5
+$as_echo_n "checking whether we have compound literals... " >&6; }
+if ${samba_cv_compound_literals+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+                               int *foo = (int[]) { 1, 2, 3, 4 };
+                               return foo[0] == 1 ? 0 : 1;
+                       }
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_compound_literals=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_compound_literals" >&5
+$as_echo "$samba_cv_compound_literals" >&6; }
+
+if test x"$samba_cv_compound_literals" = xyes ; then
+
+$as_echo "#define HAVE_COMPOUND_LITERALS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have flexible array members" >&5
+$as_echo_n "checking whether we have flexible array members... " >&6; }
+if ${samba_cv_have_flex_arr_member+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+struct foo { unsigned int x; int arr[]; };
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_have_flex_arr_member=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_have_flex_arr_member" >&5
+$as_echo "$samba_cv_have_flex_arr_member" >&6; }
+
+if test x"$samba_cv_have_flex_arr_member" = xyes ; then
+
+$as_echo "#define HAVE_FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have isblank" >&5
+$as_echo_n "checking whether we have isblank... " >&6; }
+if ${samba_cv_have_isblank+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+                        int main(void) { return isblank(' ') ? 0 : 1; }
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  samba_cv_have_isblank=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_have_isblank" >&5
+$as_echo "$samba_cv_have_isblank" >&6; }
+
+if test x"$samba_cv_have_isblank" = xyes ; then
+
+$as_echo "#define HAVE_ISBLANK 1" >>confdefs.h
+
+fi
+
+# FIXME: We could use endian.h or sys/endian.h here, and __BYTE_ORDER for
+# cross-compiling.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are little endian" >&5
+$as_echo_n "checking whether we are little endian... " >&6; }
+if ${samba_cv_little_endian+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+union { int i; char c[sizeof(int)]; } u;
+         u.i = 0x01020304;
+         return u.c[0] == 0x04 && u.c[1] == 0x03 && u.c[2] == 0x02 && u.c[3] == 0x01 ? 0 : 1;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  samba_cv_little_endian=yes
+else
+  samba_cv_little_endian=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_little_endian" >&5
+$as_echo "$samba_cv_little_endian" >&6; }
+if test x"$samba_cv_little_endian" = xyes ; then
+
+$as_echo "#define HAVE_LITTLE_ENDIAN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have __typeof__" >&5
+$as_echo_n "checking whether we have __typeof__... " >&6; }
+if ${samba_cv_typeof+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) {
+                               int x = 1;
+                               __typeof__(x) i;
+                               i = x;
+                               return i == x ? 0 : 1;
+                       }
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_typeof=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_typeof" >&5
+$as_echo "$samba_cv_typeof" >&6; }
+
+if test x"$samba_cv_typeof" = xyes ; then
+
+$as_echo "#define HAVE_TYPEOF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have __attribute__((warn_unused_result))" >&5
+$as_echo_n "checking whether we have __attribute__((warn_unused_result))... " >&6; }
+if ${samba_cv_warn_unused_result+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int __attribute__((warn_unused_result)) func(int x)
+                           { return x; }
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_warn_unused_result=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_warn_unused_result" >&5
+$as_echo "$samba_cv_warn_unused_result" >&6; }
+
+if test x"$samba_cv_warn_unused_result" = xyes ; then
+
+$as_echo "#define HAVE_WARN_UNUSED_RESULT 1" >>confdefs.h
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bswap_64 declaration" >&5
+$as_echo_n "checking for bswap_64 declaration... " >&6; }
+if ${ac_cv_have_bswap_64_decl+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <byteswap.h>
+int
+main ()
+{
+int i = (int)bswap_64
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_have_bswap_64_decl=yes
+else
+  ac_cv_have_bswap_64_decl=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_bswap_64_decl" >&5
+$as_echo "$ac_cv_have_bswap_64_decl" >&6; }
+ if test x"$ac_cv_have_bswap_64_decl" = x"yes"; then
+
+$as_echo "#define HAVE_BSWAP_64_DECL 1" >>confdefs.h
+
+ fi
+
+
+
+LIBTEVENT_OBJ0=""
+for obj in ${TEVENT_OBJ}; do
+       LIBTEVENT_OBJ0="${LIBTEVENT_OBJ0} ${teventdir}/${obj}"
+done
+
+LIBS="${LIBS} ${TEVENT_LIBS}"
+
+SAMBA_CPPFLAGS="-Iinclude/autoconf -Iautoconf -Iautoconf/source3"
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -Iinclude -I${srcdir-.}/include  -I. -I${srcdir-.}"
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/replace"
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TEVENT_CFLAGS}"
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${CCAN_CFLAGS}"
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/librpc"
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/.."
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/tdb_compat"
+
+SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/popt"
+
+## cleanup the $(srcdir) in the Makefile if we are outside of the tree
+if test "x${srcdir-.}" != "x."; then
+       SAMBA_CPPFLAGS=`echo ${SAMBA_CPPFLAGS} | sed -e "s;${srcdir};\$\(srcdir\);g"`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# compile with optimization and without debugging by default, but
+# allow people to set their own preference.
+# do this here since AC_CACHE_CHECK apparently sets the CFLAGS to "-g -O2"
+# if it has no value.  This prevent *very* large debug binaries from occurring
+# by default.
+if test "x$debug" = "xyes" ; then
+       CFLAGS="${CFLAGS} -g"
+fi
+if test "x$CFLAGS" = x; then
+  CFLAGS="-O"
+fi
+
+# Check whether --enable-socket-wrapper was given.
+if test "${enable_socket_wrapper+set}" = set; then :
+  enableval=$enable_socket_wrapper;
+fi
+
+
+DEFAULT_TEST_OPTIONS=
+HAVE_SOCKET_WRAPPER=no
+
+if eval "test x$developer = xyes -o x$selftest = xyes"; then
+       enable_socket_wrapper=yes
+fi
+
+if eval "test x$enable_socket_wrapper = xyes"; then
+
+$as_echo "#define SOCKET_WRAPPER 1" >>confdefs.h
+
+       DEFAULT_TEST_OPTIONS=--socket-wrapper
+       HAVE_SOCKET_WRAPPER=yes
+
+       # this is only used for samba3
+       SOCKET_WRAPPER_OBJS="../lib/socket_wrapper/socket_wrapper.o"
+fi
+
+
+
+
+
+# Check whether --enable-nss-wrapper was given.
+if test "${enable_nss_wrapper+set}" = set; then :
+  enableval=$enable_nss_wrapper;
+fi
+
+
+HAVE_NSS_WRAPPER=no
+
+if eval "test x$developer = xyes -o x$selftest = xyes"; then
+       enable_nss_wrapper=yes
+fi
+
+if eval "test x$enable_nss_wrapper = xyes"; then
+
+$as_echo "#define NSS_WRAPPER 1" >>confdefs.h
+
+       HAVE_NSS_WRAPPER=yes
+
+       # this is only used for samba3
+       NSS_WRAPPER_OBJS="../lib/nss_wrapper/nss_wrapper.o"
+fi
+
+
+
+
+# Check whether --enable-uid-wrapper was given.
+if test "${enable_uid_wrapper+set}" = set; then :
+  enableval=$enable_uid_wrapper;
+fi
+
+
+HAVE_UID_WRAPPER=no
+
+if eval "test x$developer = xyes -o x$selftest = xyes"; then
+       enable_uid_wrapper=yes
+fi
+
+if eval "test x$enable_uid_wrapper = xyes"; then
+
+$as_echo "#define UID_WRAPPER 1" >>confdefs.h
+
+       HAVE_UID_WRAPPER=yes
+
+       # this is only used for samba3
+       UID_WRAPPER_OBJS="../lib/uid_wrapper/uid_wrapper.o"
+fi
+
+
+
+
+
+
+
+SWAT_SBIN_TARGETS='bin/swat'
+SWAT_INSTALL_TARGETS=installswat
+
+# Check whether --enable-swat was given.
+if test "${enable_swat+set}" = set; then :
+  enableval=$enable_swat;
+    case "$enable_swat" in
+       no)
+           SWAT_SBIN_TARGETS=''
+           SWAT_INSTALL_TARGETS=''
+           ;;
+    esac
+
+fi
+
+
+
+
+
+
+
+DEVELOPER_CFLAGS="-DDEBUG_PASSWORD -DDEVELOPER"
+
+# Probe the gcc version for extra CFLAGS. We always stash these in
+# DEVELOPER_CFLAGS, so that you can turn them on and off with a simple
+# Makefile edit, avoiding the need to re-run configure.
+if test x"$ac_cv_c_compiler_gnu" = x"yes" ; then
+       DEVELOPER_CFLAGS="${DEVELOPER_CFLAGS} -g -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings"
+       # Add -Wdeclaration-after-statement if compiler supports it
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking that the C compiler understands -Wdeclaration-after-statement" >&5
+$as_echo_n "checking that the C compiler understands -Wdeclaration-after-statement... " >&6; }
+if ${samba_cv_HAVE_Wdeclaration_after_statement+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+
+       old_CFLAGS="$CFLAGS";
+       CFLAGS="$CFLAGS -Wdeclaration-after-statement";
+       export CFLAGS;
+       old_CPPFLAGS="$CPPFLAGS";
+       CPPFLAGS="$CPPFLAGS";
+       export CPPFLAGS;
+       old_LDFLAGS="$LDFLAGS";
+       LDFLAGS="$LDFLAGS";
+       export LDFLAGS;
+       if test "$cross_compiling" = yes; then :
+  samba_cv_HAVE_Wdeclaration_after_statement=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+           int main(void)
+           {
+               return 0;
+           }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  samba_cv_HAVE_Wdeclaration_after_statement=yes
+else
+  samba_cv_HAVE_Wdeclaration_after_statement=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+       CFLAGS="$old_CFLAGS";
+       old_CFLAGS="";
+       export CFLAGS;
+       CPPFLAGS="$old_CPPFLAGS";
+       old_CPPFLAGS="";
+       export CPPFLAGS;
+       LDFLAGS="$old_LDFLAGS";
+       old_LDFLAGS="";
+       export LDFLAGS;
 
 
 fi
@@ -7015,18 +7668,6 @@ $as_echo "no" >&6; }
 fi
 
 
-# Check whether --enable-smbtorture4 was given.
-if test "${enable_smbtorture4+set}" = set; then :
-  enableval=$enable_smbtorture4;
-fi
-
-
-if test x$enable_smbtorture4 != xno; then
-       smbtorture4_possible=yes
-else
-       smbtorture4_possible=no
-fi
-
 
 for ac_prog in gawk mawk nawk awk
 do
@@ -7046,7 +7687,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7097,7 +7738,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_MAKE="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7146,6 +7787,8 @@ else
 fi
 
 
+selftest_possible="yes"
+
 # Check for perl
 
 
@@ -7175,7 +7818,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7218,7 +7861,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7246,7 +7889,7 @@ esac
 if test x"$PERL" = x""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No version of perl was found!" >&5
 $as_echo "$as_me: WARNING: No version of perl was found!" >&2;}
-       smbtorture4_possible=no
+       selftest_possible=no
 else
        if test x"$debug" = x"yes";then
                PERL="$PERL -W"
@@ -7287,7 +7930,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7331,7 +7974,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7383,7 +8026,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PYTHON_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7427,7 +8070,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PYTHON_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7679,7 +8322,7 @@ $as_echo "yes" >&6; }
        else
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-               smbtorture4_possible=no
+               selftest_possible=no
        fi
 
 
@@ -7700,7 +8343,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AR="${ac_tool_prefix}ar"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7740,7 +8383,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_AR="ar"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7793,11 +8436,7 @@ $as_echo "$ac_cv_prog_gnu_ld" >&6; }
 
 
 if test "$ac_cv_prog_gnu_ld" = "yes"; then
-       ac_cv_gnu_ld_version=`$CC -Wl,-v /dev/null 2> /dev/null < /dev/null | grep "GNU ld"`
-       # we need to make a 2nd (separate!) check on the output of stderr, see bug #7825:
-       if test -z "$ac_cv_gnu_ld_version" ; then
-         ac_cv_gnu_ld_version=`$CC -Wl,-v /dev/null 2>&1 > /dev/null < /dev/null | grep "GNU ld"`
-       fi
+       ac_cv_gnu_ld_version=`$CC -Wl,-v /dev/null 2>&1 < /dev/null | grep "GNU ld"`
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking GNU ld release date" >&5
 $as_echo_n "checking GNU ld release date... " >&6; }
                ac_cv_gnu_ld_date=`echo $ac_cv_gnu_ld_version | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
@@ -7835,8 +8474,6 @@ $as_echo "${ac_cv_gnu_ld_vernr_minor}" >&6; }
         fi
 fi
 
-
-
 if test "x$CC" != xcc; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
@@ -8446,7 +9083,6 @@ default_static_modules="$default_static_modules auth_sam"
 default_static_modules="$default_static_modules auth_unix"
 default_static_modules="$default_static_modules auth_winbind"
 default_static_modules="$default_static_modules auth_wbc"
-default_static_modules="$default_static_modules auth_server"
 default_static_modules="$default_static_modules auth_domain"
 default_static_modules="$default_static_modules auth_builtin"
 default_static_modules="$default_static_modules vfs_default"
@@ -8465,8 +9101,6 @@ default_shared_modules="$default_shared_modules vfs_cap"
 default_shared_modules="$default_shared_modules vfs_expand_msdfs"
 default_shared_modules="$default_shared_modules vfs_shadow_copy"
 default_shared_modules="$default_shared_modules vfs_shadow_copy2"
-default_shared_modules="$default_shared_modules charset_CP850"
-default_shared_modules="$default_shared_modules charset_CP437"
 default_shared_modules="$default_shared_modules auth_script"
 default_shared_modules="$default_shared_modules vfs_readahead"
 default_shared_modules="$default_shared_modules vfs_xattr_tdb"
@@ -8481,12 +9115,18 @@ 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"
+default_shared_modules="$default_shared_modules idmap_hash"
 
 if test "x$developer" = xyes; then
-   default_static_modules="$default_static_modules rpc_rpcecho pdb_ads"
-   default_static_modules="$default_static_modules auth_netlogond"
-   default_shared_modules="$default_shared_modules charset_weird perfcount_test"
+   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
 
 #
@@ -8510,14 +9150,6 @@ $as_echo "#define USE_BOTH_CRYPT_CALLS 1" >>confdefs.h
       esac
       ;;
 
-#
-# CRAY Unicos has broken const handling
-       *unicos*)
-         { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabling const" >&5
-$as_echo "disabling const" >&6; }
-         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.
@@ -8525,7 +9157,7 @@ $as_echo "disabling const" >&6; }
     *aix4*)
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabling large file support" >&5
 $as_echo "enabling large file support" >&6; }
-      CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
+         CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
 
 $as_echo "#define _LARGE_FILES 1" >>confdefs.h
 
@@ -8533,10 +9165,6 @@ $as_echo "#define _LARGE_FILES 1" >>confdefs.h
 #
 # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
 # to the existance of large files..
-# Note that -D_LARGEFILE64_SOURCE is different from the Sun
-# recommendations on large file support, however it makes the
-# compile work using gcc 2.7 and 2.8, whereas using the Sun
-# recommendation makes the compile fail on gcc2.7. JRA.
 #
 # Solaris uses SYSV printing.  Make sure to set that here.  --jerry
 #
@@ -8544,48 +9172,8 @@ $as_echo "#define _LARGE_FILES 1" >>confdefs.h
 
 $as_echo "#define SYSV 1" >>confdefs.h
 
-               case `uname -r` in
-                       5.0|5.0.*|5.1|5.1.*|5.2|5.2.*|5.3|5.3.*|5.5|5.5.*)
-                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no large file support" >&5
-$as_echo "no large file support" >&6; }
-                               ;;
-                       5.*)
-                       LDFLAGS="$LDFLAGS -lthread"
-                       CPPFLAGS="$CPPFLAGS -D_REENTRANT"
-                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabling large file support" >&5
-$as_echo "enabling large file support" >&6; }
-                       if test "$ac_cv_c_compiler_gnu" = yes; then
-                               ${CC-cc} -v >conftest.c 2>&1
-                               ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
-                               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"
-
-$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
-
-                                               ;;
-                                       *)
-                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-
-$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
-
-
-$as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h
-
-                                               ;;
-                               esac
-                       else
-                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-
-$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
-
-
-$as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h
-
-                       fi
-                       ;;
-               esac
+               LDFLAGS="$LDFLAGS -lthread"
+               CPPFLAGS="$CPPFLAGS -D_REENTRANT"
                ;;
 #
 # IRIX uses SYSV printing.  Make sure to set that here
@@ -8624,143 +9212,13 @@ $as_echo "#define _SYSV 1" >>confdefs.h
 
     esac
     ;;
+# GNU systems
 #
-# Tests needed for SINIX large file support.
-#
-    *sysv4*)
-      if test $host = mips-sni-sysv4 ; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LFS support" >&5
-$as_echo_n "checking for LFS support... " >&6; }
-        old_CPPFLAGS="$CPPFLAGS"
-        CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
-        if test "$cross_compiling" = yes; then :
-  SINIX_LFS_SUPPORT=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <unistd.h>
-main () {
-#if _LFS64_LARGEFILE == 1
-exit(0);
-#else
-exit(1);
-#endif
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  SINIX_LFS_SUPPORT=yes
-else
-  SINIX_LFS_SUPPORT=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-        CPPFLAGS="$old_CPPFLAGS"
-        if test x$SINIX_LFS_SUPPORT = xyes ; then
-          CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
-
-$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
-
-          CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
-          LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
-          LIBS="`getconf LFS64_LIBS` $LIBS"
-        fi
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SINIX_LFS_SUPPORT" >&5
-$as_echo "$SINIX_LFS_SUPPORT" >&6; }
-      fi
-    ;;
-
-# Systems with LFS support.
-#
-    gnu* | k*bsd*-gnu | kopensolaris*-gnu)
-       CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
-
-$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
-
-
-$as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h
-
-
-$as_echo "#define _GNU_SOURCE 1" >>confdefs.h
-
-       ;;
-
-# Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
-#
-    *linux*)
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LFS support" >&5
-$as_echo_n "checking for LFS support... " >&6; }
-        old_CPPFLAGS="$CPPFLAGS"
-        CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
-       if test "$cross_compiling" = yes; then :
-  LINUX_LFS_SUPPORT=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <unistd.h>
-#include <sys/utsname.h>
-#include <string.h>
-#include <stdlib.h>
-main() {
-#if _LFS64_LARGEFILE == 1
-       struct utsname uts;
-       char *release;
-       int major, minor;
-
-       /* Ensure this is glibc 2.2 or higher */
-#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
-       int libc_major = __GLIBC__;
-       int libc_minor = __GLIBC_MINOR__;
-
-       if (libc_major < 2)
-              exit(1);
-       if (libc_minor < 2)
-              exit(1);
-#endif
-
-       /* Ensure this is kernel 2.4 or higher */
-
-       uname(&uts);
-       release = strdup(uts.release);
-       major = atoi(strsep(&release, "."));
-       minor = atoi(strsep(&release, "."));
-
-       if (major > 2 || (major == 2 && minor > 3))
-               exit(0);
-       exit(1);
-#else
-       exit(1);
-#endif
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  LINUX_LFS_SUPPORT=yes
-else
-  LINUX_LFS_SUPPORT=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-       CPPFLAGS="$old_CPPFLAGS"
-       if test x$LINUX_LFS_SUPPORT = xyes ; then
-               CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
-
-$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
-
-
-$as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h
-
+    *linux* | *hurd* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
+       CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
 
 $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
 
-       fi
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINUX_LFS_SUPPORT" >&5
-$as_echo "$LINUX_LFS_SUPPORT" >&6; }
        ;;
 
 #
@@ -8773,56 +9231,10 @@ $as_echo "#define BROKEN_UNICODE_COMPOSE_CHARACTERS 1" >>confdefs.h
 
 
 # Add a system specific charset module.
-       default_shared_modules="$default_shared_modules charset_macosxfs"
+       default_shared_modules="$default_shared_modules"
 
        ;;
-    *hurd*)
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LFS support" >&5
-$as_echo_n "checking for LFS support... " >&6; }
-        old_CPPFLAGS="$CPPFLAGS"
-        CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
-        if test "$cross_compiling" = yes; then :
-  GLIBC_LFS_SUPPORT=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <unistd.h>
-main () {
-#if _LFS64_LARGEFILE == 1
-exit(0);
-#else
-exit(1);
-#endif
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  GLIBC_LFS_SUPPORT=yes
-else
-  GLIBC_LFS_SUPPORT=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-        CPPFLAGS="$old_CPPFLAGS"
-        if test x$GLIBC_LFS_SUPPORT = xyes ; then
-          CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
-
-$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
-
-
-$as_echo "#define _GNU_SOURCE 1" >>confdefs.h
-
-        fi
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIBC_LFS_SUPPORT" >&5
-$as_echo "$GLIBC_LFS_SUPPORT" >&6; }
-    ;;
     *qnx*)
-        CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
-
-$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
-
         ;;
 
 esac
@@ -8849,7 +9261,7 @@ fi
 LIBREPLACEOBJ="$libreplacedir/replace.o"
 
 
-LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/snprintf.o"
+LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/snprintf.o  $libreplacedir/xattr.o"
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
 $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
@@ -8971,6 +9383,28 @@ _ACEOF
 
 fi
 
+ac_fn_c_check_type "$LINENO" "blksize_t" "ac_cv_type_blksize_t" "$ac_includes_default"
+if test "x$ac_cv_type_blksize_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define blksize_t long
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "blkcnt_t" "ac_cv_type_blkcnt_t" "$ac_includes_default"
+if test "x$ac_cv_type_blkcnt_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define blkcnt_t long
+_ACEOF
+
+fi
+
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
 $as_echo_n "checking for working memcmp... " >&6; }
@@ -9061,7 +9495,7 @@ fi
 
 done
 
-for ac_header in setjmp.h utime.h sys/wait.h
+for ac_header in setjmp.h utime.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -9100,6 +9534,10 @@ fi
 
 
 
+
+$as_echo "#define HAVE_LIBREPLACE 1" >>confdefs.h
+
+
 ac_fn_c_check_type "$LINENO" "bool" "ac_cv_type_bool" "
 $ac_includes_default
 #ifdef HAVE_STDBOOL_H
@@ -9172,6 +9610,68 @@ $as_echo "#define HAVE_MMAP 1" >>confdefs.h
 
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mremap" >&5
+$as_echo_n "checking for working mremap... " >&6; }
+if ${libreplace_cv_HAVE_MREMAP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+if test "$cross_compiling" = yes; then :
+  libreplace_cv_HAVE_MREMAP=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "$libreplacedir/test/shared_mremap.c"
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  libreplace_cv_HAVE_MREMAP=yes
+else
+  libreplace_cv_HAVE_MREMAP=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libreplace_cv_HAVE_MREMAP" >&5
+$as_echo "$libreplace_cv_HAVE_MREMAP" >&6; }
+if test x"$libreplace_cv_HAVE_MREMAP" = x"yes"; then
+
+$as_echo "#define HAVE_MREMAP 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for incoherent mmap" >&5
+$as_echo_n "checking for incoherent mmap... " >&6; }
+if ${libreplace_cv_HAVE_INCOHERENT_MMAP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+if test "$cross_compiling" = yes; then :
+  libreplace_cv_HAVE_INCOHERENT_MMAP=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "$libreplacedir/test/incoherent_mmap.c"
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  libreplace_cv_HAVE_INCOHERENT_MMAP=yes
+else
+  libreplace_cv_HAVE_INCOHERENT_MMAP=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libreplace_cv_HAVE_INCOHERENT_MMAP" >&5
+$as_echo "$libreplace_cv_HAVE_INCOHERENT_MMAP" >&6; }
+if test x"$libreplace_cv_HAVE_INCOHERENT_MMAP" = x"yes"; then
+
+$as_echo "#define HAVE_INCOHERENT_MMAP 1" >>confdefs.h
+
+fi
+
 
 for ac_header in sys/syslog.h syslog.h
 do :
@@ -9249,20 +9749,56 @@ fi
 
 done
 
-for ac_header in sys/ucontext.h
+for ac_header in malloc.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default"
+if test "x$ac_cv_header_malloc_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MALLOC_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in syscall.h
 do :
-  ac_fn_c_check_header_mongrel "$LINENO" "sys/ucontext.h" "ac_cv_header_sys_ucontext_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_ucontext_h" = xyes; then :
+  ac_fn_c_check_header_mongrel "$LINENO" "syscall.h" "ac_cv_header_syscall_h" "$ac_includes_default"
+if test "x$ac_cv_header_syscall_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_UCONTEXT_H 1
+#define HAVE_SYSCALL_H 1
 _ACEOF
 
 fi
 
 done
 
+for ac_header in sys/syscall.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/syscall.h" "ac_cv_header_sys_syscall_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_syscall_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SYSCALL_H 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_func in syscall setuid seteuid setreuid setresuid setgid setegid setregid setresgid setgroups
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
 
-for ac_func in seteuid setresuid setegid setresgid chroot bzero strerror strerror_r
+for ac_func in chroot bzero strerror strerror_r memalign posix_memalign getpagesize
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
 fi
 done
 
+
+for ac_header in sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in sys/ea.h sys/proplist.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+LIBREPLACE_FILESYS_LIBS=""
+
+############################################
+# Check for EA implementations
+case "$host_os" in
+  *freebsd4* | *dragonfly* )
+
+$as_echo "#define BROKEN_EXTATTR 1" >>confdefs.h
+
+  ;;
+  *)
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getxattr" >&5
+$as_echo_n "checking for library containing getxattr... " >&6; }
+if ${ac_cv_search_getxattr+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getxattr ();
+int
+main ()
+{
+return getxattr ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' attr; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_getxattr=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_getxattr+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_getxattr+:} false; then :
+
+else
+  ac_cv_search_getxattr=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getxattr" >&5
+$as_echo "$ac_cv_search_getxattr" >&6; }
+ac_res=$ac_cv_search_getxattr
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+       for ac_func in attr_get attr_getf attr_list attr_listf attropen attr_remove
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+       for ac_func in attr_removef attr_set attr_setf extattr_delete_fd extattr_delete_file
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+       for ac_func in extattr_get_fd extattr_get_file extattr_list_fd extattr_list_file
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+       for ac_func in extattr_set_fd extattr_set_file fgetea fgetxattr flistea flistxattr
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+       for ac_func in fremoveea fremovexattr fsetea fsetxattr getea getxattr listea
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+       for ac_func in listxattr removeea removexattr setea setxattr
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+ac_check_lib_ext_save_LIBS=$LIBS
+LIBS="-lattr $LIBREPLACE_FILESYS_LIBS  $LIBS"
+
+
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flistea in -lattr" >&5
+$as_echo_n "checking for flistea in -lattr... " >&6; }
+if ${ac_cv_lib_ext_attr_flistea+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char flistea ();
+int
+main ()
+{
+return flistea ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ext_attr_flistea=yes;
+                 ac_cv_lib_ext_attr=yes
+else
+  ac_cv_lib_ext_attr_flistea=no;
+                 ac_cv_lib_ext_attr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext_attr_flistea" >&5
+$as_echo "$ac_cv_lib_ext_attr_flistea" >&6; }
+    if test $ac_cv_lib_ext_attr_flistea = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_FLISTEA 1
+_ACEOF
+
+fi
+LIBS=$ac_check_lib_ext_save_LIBS
+
+if test $ac_cv_lib_ext_attr = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBATTR 1
+_ACEOF
+
+               case "$LIBREPLACE_FILESYS_LIBS" in
+                   *-lattr*)
+                       ;;
+                   *)
+                       LIBREPLACE_FILESYS_LIBS="-lattr $LIBREPLACE_FILESYS_LIBS"
+                       ;;
+               esac
+
+
+fi
+
+
+ac_check_lib_ext_save_LIBS=$LIBS
+LIBS="-lattr $LIBREPLACE_FILESYS_LIBS  $LIBS"
+
+
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flistxattr in -lattr" >&5
+$as_echo_n "checking for flistxattr in -lattr... " >&6; }
+if ${ac_cv_lib_ext_attr_flistxattr+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char flistxattr ();
+int
+main ()
+{
+return flistxattr ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ext_attr_flistxattr=yes;
+                 ac_cv_lib_ext_attr=yes
+else
+  ac_cv_lib_ext_attr_flistxattr=no;
+                 ac_cv_lib_ext_attr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext_attr_flistxattr" >&5
+$as_echo "$ac_cv_lib_ext_attr_flistxattr" >&6; }
+    if test $ac_cv_lib_ext_attr_flistxattr = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_FLISTXATTR 1
+_ACEOF
+
+fi
+LIBS=$ac_check_lib_ext_save_LIBS
+
+if test $ac_cv_lib_ext_attr = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBATTR 1
+_ACEOF
+
+               case "$LIBREPLACE_FILESYS_LIBS" in
+                   *-lattr*)
+                       ;;
+                   *)
+                       LIBREPLACE_FILESYS_LIBS="-lattr $LIBREPLACE_FILESYS_LIBS"
+                       ;;
+               esac
+
+
+fi
+
+
+ac_check_lib_ext_save_LIBS=$LIBS
+LIBS="-lattr $LIBREPLACE_FILESYS_LIBS  $LIBS"
+
+
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for attr_listf in -lattr" >&5
+$as_echo_n "checking for attr_listf in -lattr... " >&6; }
+if ${ac_cv_lib_ext_attr_attr_listf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char attr_listf ();
+int
+main ()
+{
+return attr_listf ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ext_attr_attr_listf=yes;
+                 ac_cv_lib_ext_attr=yes
+else
+  ac_cv_lib_ext_attr_attr_listf=no;
+                 ac_cv_lib_ext_attr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext_attr_attr_listf" >&5
+$as_echo "$ac_cv_lib_ext_attr_attr_listf" >&6; }
+    if test $ac_cv_lib_ext_attr_attr_listf = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ATTR_LISTF 1
+_ACEOF
+
+fi
+LIBS=$ac_check_lib_ext_save_LIBS
+
+if test $ac_cv_lib_ext_attr = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBATTR 1
+_ACEOF
+
+               case "$LIBREPLACE_FILESYS_LIBS" in
+                   *-lattr*)
+                       ;;
+                   *)
+                       LIBREPLACE_FILESYS_LIBS="-lattr $LIBREPLACE_FILESYS_LIBS"
+                       ;;
+               esac
+
+
+fi
+
+
+ac_check_lib_ext_save_LIBS=$LIBS
+LIBS="-lattr $LIBREPLACE_FILESYS_LIBS  $LIBS"
+
+
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extattr_list_fd in -lattr" >&5
+$as_echo_n "checking for extattr_list_fd in -lattr... " >&6; }
+if ${ac_cv_lib_ext_attr_extattr_list_fd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char extattr_list_fd ();
+int
+main ()
+{
+return extattr_list_fd ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ext_attr_extattr_list_fd=yes;
+                 ac_cv_lib_ext_attr=yes
+else
+  ac_cv_lib_ext_attr_extattr_list_fd=no;
+                 ac_cv_lib_ext_attr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext_attr_extattr_list_fd" >&5
+$as_echo "$ac_cv_lib_ext_attr_extattr_list_fd" >&6; }
+    if test $ac_cv_lib_ext_attr_extattr_list_fd = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_EXTATTR_LIST_FD 1
+_ACEOF
+
+fi
+LIBS=$ac_check_lib_ext_save_LIBS
+
+if test $ac_cv_lib_ext_attr = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBATTR 1
+_ACEOF
+
+               case "$LIBREPLACE_FILESYS_LIBS" in
+                   *-lattr*)
+                       ;;
+                   *)
+                       LIBREPLACE_FILESYS_LIBS="-lattr $LIBREPLACE_FILESYS_LIBS"
+                       ;;
+               esac
+
+
+fi
+
+  ;;
+esac
+
+
+########################################################
+# Do xattr functions take additional options like on Darwin?
+if test x"$ac_cv_func_getxattr" = x"yes" ; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr interface takes additional options" >&5
+$as_echo_n "checking whether xattr interface takes additional options... " >&6; }
+if ${smb_attr_cv_xattr_add_opt+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+               old_LIBS=$LIBS
+               LIBS="$LIBS $LIBREPLACE_FILESYS_LIBS"
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+                       #include <sys/types.h>
+                       #if HAVE_ATTR_XATTR_H
+                       #include <attr/xattr.h>
+                       #elif HAVE_SYS_XATTR_H
+                       #include <sys/xattr.h>
+                       #endif
+
+int
+main ()
+{
+
+                       getxattr(0, 0, 0, 0, 0, 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  smb_attr_cv_xattr_add_opt=yes
+else
+  smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smb_attr_cv_xattr_add_opt" >&5
+$as_echo "$smb_attr_cv_xattr_add_opt" >&6; }
+       if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
+
+$as_echo "#define XATTR_ADDITIONAL_OPTIONS 1" >>confdefs.h
+
+       fi
+fi
+
 for ac_func in get_current_dir_name
 do :
   ac_fn_c_check_func "$LINENO" "get_current_dir_name" "ac_cv_func_get_current_dir_name"
@@ -9600,11 +10621,26 @@ else
 main() {
   struct stat st;
   char tpl[20]="/tmp/test.XXXXXX";
+  char tpl2[20]="/tmp/test.XXXXXX";
   int fd = mkstemp(tpl);
-  if (fd == -1) exit(1);
+  int fd2 = mkstemp(tpl2);
+  if (fd == -1) {
+        if (fd2 != -1) {
+                unlink(tpl2);
+        }
+        exit(1);
+  }
+  if (fd2 == -1) exit(1);
   unlink(tpl);
+  unlink(tpl2);
   if (fstat(fd, &st) != 0) exit(1);
   if ((st.st_mode & 0777) != 0600) exit(1);
+  if (strcmp(tpl, "/tmp/test.XXXXXX") == 0) {
+        exit(1);
+  }
+  if (strcmp(tpl, tpl2) == 0) {
+        exit(1);
+  }
   exit(0);
 }
 _ACEOF
@@ -10083,6 +11119,43 @@ $as_echo "#define HAVE_SIG_ATOMIC_T_TYPE 1" >>confdefs.h
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_DIRECT flag to open(2)" >&5
+$as_echo_n "checking for O_DIRECT flag to open(2)... " >&6; }
+if ${libreplace_cv_HAVE_OPEN_O_DIRECT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <unistd.h>
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+int
+main ()
+{
+int fd = open("/dev/null", O_DIRECT);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libreplace_cv_HAVE_OPEN_O_DIRECT=yes
+else
+  libreplace_cv_HAVE_OPEN_O_DIRECT=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libreplace_cv_HAVE_OPEN_O_DIRECT" >&5
+$as_echo "$libreplace_cv_HAVE_OPEN_O_DIRECT" >&6; }
+if test x"$libreplace_cv_HAVE_OPEN_O_DIRECT" = x"yes"; then
+
+$as_echo "#define HAVE_OPEN_O_DIRECT 1" >>confdefs.h
+
+fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that the C compiler understands volatile" >&5
 $as_echo_n "checking that the C compiler understands volatile... " >&6; }
 if ${libreplace_cv_volatile+:} false; then :
@@ -10682,7 +11755,7 @@ fi
 eval ac_res=\$`$as_echo "ac_cv_c_prototype_struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)" | $as_tr_sh`
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test $`$as_echo "ac_cv_c_prototype_struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)" | $as_tr_sh` = yes; then :
+if eval test $`$as_echo "ac_cv_c_prototype_struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)" | $as_tr_sh` = yes; then :
 
 
 $as_echo "#define SOLARIS_GETPWENT_R 1" >>confdefs.h
@@ -10729,7 +11802,7 @@ fi
 eval ac_res=\$`$as_echo "ac_cv_c_prototype_struct passwd *getpwent_r(struct passwd *src, char *buf, size_t buflen)" | $as_tr_sh`
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test $`$as_echo "ac_cv_c_prototype_struct passwd *getpwent_r(struct passwd *src, char *buf, size_t buflen)" | $as_tr_sh` = yes; then :
+if eval test $`$as_echo "ac_cv_c_prototype_struct passwd *getpwent_r(struct passwd *src, char *buf, size_t buflen)" | $as_tr_sh` = yes; then :
 
 
 $as_echo "#define SOLARIS_GETPWENT_R 1" >>confdefs.h
@@ -10824,7 +11897,7 @@ fi
 eval ac_res=\$`$as_echo "ac_cv_c_prototype_struct group *getgrent_r(struct group *src, char *buf, int buflen)" | $as_tr_sh`
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test $`$as_echo "ac_cv_c_prototype_struct group *getgrent_r(struct group *src, char *buf, int buflen)" | $as_tr_sh` = yes; then :
+if eval test $`$as_echo "ac_cv_c_prototype_struct group *getgrent_r(struct group *src, char *buf, int buflen)" | $as_tr_sh` = yes; then :
 
 
 $as_echo "#define SOLARIS_GETGRENT_R 1" >>confdefs.h
@@ -10872,7 +11945,7 @@ fi
 eval ac_res=\$`$as_echo "ac_cv_c_prototype_struct group *getgrent_r(struct group *src, char *buf, size_t buflen)" | $as_tr_sh`
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test $`$as_echo "ac_cv_c_prototype_struct group *getgrent_r(struct group *src, char *buf, size_t buflen)" | $as_tr_sh` = yes; then :
+if eval test $`$as_echo "ac_cv_c_prototype_struct group *getgrent_r(struct group *src, char *buf, size_t buflen)" | $as_tr_sh` = yes; then :
 
 
 $as_echo "#define SOLARIS_GETGRENT_R 1" >>confdefs.h
@@ -10952,42 +12025,6 @@ done
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_DIRECT flag to open(2)" >&5
-$as_echo_n "checking for O_DIRECT flag to open(2)... " >&6; }
-if ${libreplace_cv_HAVE_OPEN_O_DIRECT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <unistd.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-int
-main ()
-{
-int fd = open("/dev/null", O_DIRECT);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libreplace_cv_HAVE_OPEN_O_DIRECT=yes
-else
-  libreplace_cv_HAVE_OPEN_O_DIRECT=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libreplace_cv_HAVE_OPEN_O_DIRECT" >&5
-$as_echo "$libreplace_cv_HAVE_OPEN_O_DIRECT" >&6; }
-if test x"$libreplace_cv_HAVE_OPEN_O_DIRECT" = x"yes"; then
-
-$as_echo "#define HAVE_OPEN_O_DIRECT 1" >>confdefs.h
-
-fi
-
 save_LIBS="$LIBS"
 LIBS=""
 
@@ -11195,7 +12232,7 @@ fi
 eval ac_res=\$`$as_echo "ac_cv_c_prototype_void *dlopen(const char* filename, unsigned int flags)" | $as_tr_sh`
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test $`$as_echo "ac_cv_c_prototype_void *dlopen(const char* filename, unsigned int flags)" | $as_tr_sh` = yes; then :
+if eval test $`$as_echo "ac_cv_c_prototype_void *dlopen(const char* filename, unsigned int flags)" | $as_tr_sh` = yes; then :
 
 
 $as_echo "#define DLOPEN_TAKES_UNSIGNED_FLAGS 1" >>confdefs.h
 
 fi
 
+for ac_func in strptime
+do :
+  ac_fn_c_check_func "$LINENO" "strptime" "ac_cv_func_strptime"
+if test "x$ac_cv_func_strptime" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STRPTIME 1
+_ACEOF
+
+fi
+done
+
+ac_fn_c_check_decl "$LINENO" "strptime" "ac_cv_have_decl_strptime" "#include <time.h>
+"
+if test "x$ac_cv_have_decl_strptime" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRPTIME $ac_have_decl
+_ACEOF
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strptime is available and works" >&5
 $as_echo_n "checking whether strptime is available and works... " >&6; }
 if ${libreplace_cv_STRPTIME_OK+:} false; then :
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libreplace_cv_STRPTIME_OK" >&5
 $as_echo "$libreplace_cv_STRPTIME_OK" >&6; }
 if test x"$libreplace_cv_STRPTIME_OK" != x"yes"; then
+        LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/strptime.o"
+else
 
-$as_echo "#define REPLACE_STRPTIME 1" >>confdefs.h
+$as_echo "#define HAVE_WORKING_STRPTIME 1" >>confdefs.h
 
-        LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/strptime.o"
 fi
 
 for ac_header in direct.h windows.h winsock2.h ws2tcpip.h
@@ -11505,7 +12566,7 @@ fi
 eval ac_res=\$`$as_echo "ac_cv_c_prototype_long telldir(const DIR *dir)" | $as_tr_sh`
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test $`$as_echo "ac_cv_c_prototype_long telldir(const DIR *dir)" | $as_tr_sh` = yes; then :
+if eval test $`$as_echo "ac_cv_c_prototype_long telldir(const DIR *dir)" | $as_tr_sh` = yes; then :
 
 
 $as_echo "#define TELLDIR_TAKES_CONST_DIR 1" >>confdefs.h
@@ -11549,7 +12610,7 @@ fi
 eval ac_res=\$`$as_echo "ac_cv_c_prototype_int seekdir(DIR *dir, long ofs)" | $as_tr_sh`
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test $`$as_echo "ac_cv_c_prototype_int seekdir(DIR *dir, long ofs)" | $as_tr_sh` = yes; then :
+if eval test $`$as_echo "ac_cv_c_prototype_int seekdir(DIR *dir, long ofs)" | $as_tr_sh` = yes; then :
 
 
 $as_echo "#define SEEKDIR_RETURNS_INT 1" >>confdefs.h
@@ -11946,43 +13007,6 @@ $as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ucontext_t type" >&5
-$as_echo_n "checking for ucontext_t type... " >&6; }
-if ${libreplace_cv_ucontext_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <signal.h>
-#if HAVE_SYS_UCONTEXT_H
-#include <sys/ucontext.h>
-# endif
-
-int
-main ()
-{
-ucontext_t uc; sigaddset(&uc.uc_sigmask, SIGUSR1);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libreplace_cv_ucontext_t=yes
-else
-  libreplace_cv_ucontext_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libreplace_cv_ucontext_t" >&5
-$as_echo "$libreplace_cv_ucontext_t" >&6; }
-if test x"$libreplace_cv_ucontext_t" = x"yes"; then
-
-$as_echo "#define HAVE_UCONTEXT_T 1" >>confdefs.h
-
-fi
-
 for ac_func in printf memset memcpy
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 LIBS=$old_LIBS
 CPPFLAGS="$libreplace_SAVE_CPPFLAGS"
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SO_PEERCRED" >&5
+$as_echo_n "checking for SO_PEERCRED... " >&6; }
+if ${libreplace_cv_HAVE_PEERCRED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/socket.h>
+int
+main ()
+{
+struct ucred cred;
+ socklen_t cred_len;
+ int ret = getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libreplace_cv_HAVE_PEERCRED=yes
+else
+  libreplace_cv_HAVE_PEERCRED=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libreplace_cv_HAVE_PEERCRED" >&5
+$as_echo "$libreplace_cv_HAVE_PEERCRED" >&6; }
+if test x"$libreplace_cv_HAVE_PEERCRED" = x"yes"; then
+
+$as_echo "#define HAVE_PEERCRED 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeereid" >&5
+$as_echo_n "checking for getpeereid... " >&6; }
+if ${libreplace_cv_HAVE_GETPEEREID+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <unistd.h>
+int
+main ()
+{
+uid_t uid; gid_t gid; int ret;
+ ret = getpeereid(0, &uid, &gid);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libreplace_cv_HAVE_GETPEEREID=yes
+else
+  libreplace_cv_HAVE_GETPEEREID=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libreplace_cv_HAVE_GETPEEREID" >&5
+$as_echo "$libreplace_cv_HAVE_GETPEEREID" >&6; }
+if test x"$libreplace_cv_HAVE_GETPEEREID" = xyes; then
+
+$as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
+
+fi
+
 LIBREPLACEOBJ="${LIBREPLACEOBJ} ${LIBREPLACE_NETWORK_OBJS}"
 
 echo "LIBREPLACE_NETWORK_CHECKS: END"
@@ -13833,7 +14929,7 @@ LIBREPLACE_DIR=`echo ${libreplacedir} | sed -e "s;${srcdir};;" -e "s;^/;;"`
 LIBREPLACE_OBJS="${LIBREPLACEOBJ}"
 
 
-LIBREPLACE_LIBS="${LIBREPLACE_NETWORK_LIBS}"
+LIBREPLACE_LIBS="${LIBREPLACE_NETWORK_LIBS} ${LIBREPLACE_FILESYS_LIBS}"
 
 
 
 
 done
 
+for ac_header in CommonCrypto/CommonDigest.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "CommonCrypto/CommonDigest.h" "ac_cv_header_CommonCrypto_CommonDigest_h" "$ac_includes_default"
+if test "x$ac_cv_header_CommonCrypto_CommonDigest_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_COMMONCRYPTO_COMMONDIGEST_H 1
+_ACEOF
+
+fi
+
+done
+
 
 samba_cv_md5lib=none
 
@@ -14177,6 +15285,9 @@ $as_echo "#define HAVE_LIBMD5 1" >>confdefs.h
        CRYPTO_MD5_OBJ=
 fi
 
+if test "x$ac_cv_header_CommonCrypto_CommonDigest_h" == "xyes"; then
+       CRYPTO_MD5_OBJ=
+fi
 
 
 
@@ -14197,7 +15308,6 @@ fi
 
 done
 
-
 ## These fail to compile on IRIX so just check for their presence
 for ac_header in sys/mode.h
 do :
@@ -14242,6 +15352,14 @@ done
 
 CPPFLAGS="$old_CPPFLAGS"
 
+# To link lib/util/charset/charset_macosxfs.c, we need to tell the linker
+# about CoreFoundation, at least on os X 10.4..10.7 resp. darwin8..12
+case "$host_os" in
+    *darwin*)
+               LDFLAGS="$LDFLAGS -framework CoreFoundation"
+       ;;
+esac
+
 # In valgrind 1.0.x, it's just valgrind.h.  In 1.9.x+ there's a
 # subdirectory of headers.
 for ac_header in valgrind.h valgrind/valgrind.h valgrind/memcheck.h
 done
 
 
-for ac_header in sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/ea.h sys/proplist.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
 for ac_header in sys/cdefs.h glob.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -14536,11 +15627,11 @@ else
 int
 main ()
 {
-
+/* FIXME: Include the comments suggested by Paul. */
 #ifndef __cplusplus
-  /* Ultrix mips cc rejects this sort of thing.  */
+  /* Ultrix mips cc rejects this.  */
   typedef int charset[2];
-  const charset cs = { 0, 0 };
+  const charset cs;
   /* SunOS 4.1.1 cc rejects this.  */
   char const *const *pcpcc;
   char **ppc;
@@ -14557,9 +15648,8 @@ main ()
   ++pcpcc;
   ppc = (char**) pcpcc;
   pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this sort of thing.  */
-    char tx;
-    char *t = &tx;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
     char const *s = 0 ? (char *) 0 : (char const *) 0;
 
     *t++ = 0;
@@ -14575,10 +15665,10 @@ main ()
     iptr p = 0;
     ++p;
   }
-  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+  { /* AIX XL C 1.02.0.0 rejects this saying
        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; } bx;
-    struct s *b = &bx; b->j = 5;
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
   }
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
     const int foo = 10;
@@ -14884,8 +15974,7 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(((char) -1) < 0)];
-test_array [0] = 0;
-return test_array [0];
+test_array [0] = 0
 
   ;
   return 0;
@@ -15111,7 +16200,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CUPS_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -15540,7 +16629,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <errno.h>
-main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}
+main() { setresuid(1,1,1); setresuid(2,2,2); return(errno==EPERM?0:1);}
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   samba_cv_have_setresuid=yes
@@ -15575,7 +16664,7 @@ else
 /* end confdefs.h.  */
 #include <unistd.h>
 #include <errno.h>
-main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}
+main() { errno = 0; setresgid(1,1,1); return(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   samba_cv_have_setresgid=yes
@@ -16150,7 +17239,7 @@ fi
 done
 
 if test x"$ac_cv_func_execl" = x"no"; then
-    EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun\$(EXEEXT)"
+    EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun"
 fi
 
 for ac_func in getcwd fchown chmod fchmod mknod mknod64
@@ -16325,19 +17414,7 @@ _ACEOF
 fi
 done
 
-for ac_func in setpriv setgidx setuidx setgroups sysconf stat64 fstat64
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-for ac_func in lstat64 fopen64 atexit grantpt posix_openpt lseek64 ftruncate64 posix_fallocate posix_fallocate64
+for ac_func in setpriv setgidx setuidx setgroups syscall sysconf
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -16349,7 +17426,7 @@ _ACEOF
 fi
 done
 
-for ac_func in fallocate fallocate64
+for ac_func in atexit grantpt posix_fallocate
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -16361,19 +17438,18 @@ _ACEOF
 fi
 done
 
-for ac_func in fseeko fseek64 fseeko64 ftell64 ftello64 setluid getpwanam
+for ac_func in fallocate
 do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  ac_fn_c_check_func "$LINENO" "fallocate" "ac_cv_func_fallocate"
+if test "x$ac_cv_func_fallocate" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_FALLOCATE 1
 _ACEOF
 
 fi
 done
 
-for ac_func in opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64
+for ac_func in fseeko setluid getpwanam
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -16385,13 +17461,12 @@ _ACEOF
 fi
 done
 
-for ac_func in fdopendir fdopendir64
+for ac_func in fdopendir
 do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  ac_fn_c_check_func "$LINENO" "fdopendir" "ac_cv_func_fdopendir"
+if test "x$ac_cv_func_fdopendir" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_FDOPENDIR 1
 _ACEOF
 
 fi
@@ -16408,17 +17483,6 @@ _ACEOF
 fi
 done
 
-for ac_func in getdents64
-do :
-  ac_fn_c_check_func "$LINENO" "getdents64" "ac_cv_func_getdents64"
-if test "x$ac_cv_func_getdents64" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETDENTS64 1
-_ACEOF
-
-fi
-done
-
 for ac_func in setenv strcasecmp fcvt fcvtl
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -16443,13 +17507,12 @@ _ACEOF
 fi
 done
 
-for ac_func in setlocale nl_langinfo
+for ac_func in setlocale
 do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale"
+if test "x$ac_cv_func_setlocale" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_SETLOCALE 1
 _ACEOF
 
 fi
@@ -16606,7 +17669,7 @@ _ACEOF
 fi
 done
 
-for ac_func in bindtextdomain textdomain
+for ac_func in bindtextdomain textdomain bind_textdomain_codeset
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -16758,7 +17821,7 @@ _ACEOF
 fi
 
 
-# check for sysctlbyname for BSD systems
+# check for sysctlbyname and sysctl for BSD systems
 for ac_func in sysctlbyname
 do :
   ac_fn_c_check_func "$LINENO" "sysctlbyname" "ac_cv_func_sysctlbyname"
@@ -16770,6 +17833,17 @@ _ACEOF
 fi
 done
 
+for ac_func in sysctl
+do :
+  ac_fn_c_check_func "$LINENO" "sysctl" "ac_cv_func_sysctl"
+if test "x$ac_cv_func_sysctl" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYSCTL 1
+_ACEOF
+
+fi
+done
+
 
 #################################################
 # Check to see if core dump directory is defined in linux
@@ -16816,46 +17890,8 @@ if test x"$ac_cv_header_gpfs_gpl_h" = x"yes"; then
 $as_echo "#define HAVE_GPFS 1" >>confdefs.h
 
     default_shared_modules="$default_shared_modules vfs_gpfs"
-    default_shared_modules="$default_shared_modules vfs_gpfs_hsm_notify"
 fi
 
-#############################################
-# check if building on Isilon OneFS
-printf "%s" "checking for Isilon OneFS... "
-save_LIBS="$LIBS"
-LIBS="$LIBS -lisi_version"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <isi_version/isi_version.h>
-int
-main ()
-{
-get_isilon_copyright()
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  samba_cv_HAVE_ONEFS=yes
-else
-  samba_cv_HAVE_ONEFS=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-echo $samba_cv_HAVE_ONEFS
-if test x"$samba_cv_HAVE_ONEFS" = x"yes"; then
-
-$as_echo "#define HAVE_ONEFS 1" >>confdefs.h
-
-    default_shared_modules="$default_shared_modules vfs_onefs vfs_onefs_shadow_copy perfcount_onefs"
-    default_static_modules="$default_static_modules"
-    ONEFS_LIBS="-lisi_acl -lisi_ecs -lisi_event -lisi_util"
-    # Need to also add general libs for oplocks support
-    save_LIBS="$save_LIBS -lisi_ecs -lisi_event -lisi_util -ldevstat"
-fi
-
-LIBS="$save_LIBS"
-
 # Note that all the libunwind symbols in the API are defined to internal
 # platform-specific version, so we must include libunwind.h before checking
 # any of them.
@@ -17160,31 +18196,7 @@ _ACEOF
 fi
 done
 
-for ac_func in _stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-for ac_func in __sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-for ac_func in pread _pread __pread pread64 _pread64 __pread64
+for ac_func in __sys_llseek llseek _llseek __llseek
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17196,7 +18208,7 @@ _ACEOF
 fi
 done
 
-for ac_func in pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64
+for ac_func in pread _pread __pread
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17208,7 +18220,7 @@ _ACEOF
 fi
 done
 
-for ac_func in open64 _open64 __open64 creat64
+for ac_func in pwrite _pwrite __pwrite
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17280,11 +18292,11 @@ main() {
        int libc_minor = __GLIBC_MINOR__;
 
        if (libc_major < 2)
-              exit(1);
+              return(1);
        if ((libc_major == 2) && (libc_minor <= 3))
-              exit(1);
+              return(1);
 #endif
-       exit(0);
+       return(0);
 }
 
 _ACEOF
@@ -17321,108 +18333,6 @@ done
        ;;
 esac
 
-#
-# stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
-#
-
-if test x$ac_cv_func_stat64 = xno ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stat64 in <sys/stat.h>" >&5
-$as_echo_n "checking for stat64 in <sys/stat.h>... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/stat.h>
-
-int
-main ()
-{
-struct stat64 st64; exit(stat64(".",&st64));
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_stat64=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat64" >&5
-$as_echo "$ac_cv_func_stat64" >&6; }
-  if test x$ac_cv_func_stat64 = xyes ; then
-
-$as_echo "#define HAVE_STAT64 1" >>confdefs.h
-
-  fi
-fi
-
-if test x$ac_cv_func_lstat64 = xno ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lstat64 in <sys/stat.h>" >&5
-$as_echo_n "checking for lstat64 in <sys/stat.h>... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/stat.h>
-
-int
-main ()
-{
-struct stat64 st64; exit(lstat64(".",&st64));
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_lstat64=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat64" >&5
-$as_echo "$ac_cv_func_lstat64" >&6; }
-  if test x$ac_cv_func_lstat64 = xyes ; then
-    $as_echo "#define HAVE_LSTAT64 Whether lstat64() is available" >>confdefs.h
-
-  fi
-fi
-
-if test x$ac_cv_func_fstat64 = xno ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fstat64 in <sys/stat.h>" >&5
-$as_echo_n "checking for fstat64 in <sys/stat.h>... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/stat.h>
-
-int
-main ()
-{
-struct stat64 st64; exit(fstat64(0,&st64));
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_fstat64=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fstat64" >&5
-$as_echo "$ac_cv_func_fstat64" >&6; }
-  if test x$ac_cv_func_fstat64 = xyes ; then
-
-$as_echo "#define HAVE_FSTAT64 1" >>confdefs.h
-
-  fi
-fi
-
 #################################################
 # Check whether struct stat has timestamps with sub-second resolution.
 #
@@ -17728,6 +18638,51 @@ _ACEOF
 
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_expand in -linet" >&5
+$as_echo_n "checking for dn_expand in -linet... " >&6; }
+if ${ac_cv_lib_inet_dn_expand+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-linet  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dn_expand ();
+int
+main ()
+{
+return dn_expand ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_inet_dn_expand=yes
+else
+  ac_cv_lib_inet_dn_expand=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_dn_expand" >&5
+$as_echo "$ac_cv_lib_inet_dn_expand" >&6; }
+if test "x$ac_cv_lib_inet_dn_expand" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBINET 1
+_ACEOF
+
+  LIBS="-linet $LIBS"
+
+fi
+
 
 #
 # Check for the functions putprpwnam, set_auth_parameters,
 done
 
 
-############################################
-# Check for EA implementations
-case "$host_os" in
-  *osf*)
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getproplist" >&5
-$as_echo_n "checking for library containing getproplist... " >&6; }
-if ${ac_cv_search_getproplist+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getproplist ();
-int
-main ()
-{
-return getproplist ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' proplist; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_getproplist=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_getproplist+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_getproplist+:} false; then :
-
-else
-  ac_cv_search_getproplist=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getproplist" >&5
-$as_echo "$ac_cv_search_getproplist" >&6; }
-ac_res=$ac_cv_search_getproplist
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-       for ac_func in getproplist fgetproplist setproplist fsetproplist
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-       for ac_func in delproplist fdelproplist add_proplist_entry get_proplist_entry
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-       for ac_func in sizeof_proplist_entry
-do :
-  ac_fn_c_check_func "$LINENO" "sizeof_proplist_entry" "ac_cv_func_sizeof_proplist_entry"
-if test "x$ac_cv_func_sizeof_proplist_entry" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SIZEOF_PROPLIST_ENTRY 1
-_ACEOF
-
-fi
-done
-
-  ;;
-  *freebsd4* | *dragonfly* )
-
-$as_echo "#define BROKEN_EXTATTR 1" >>confdefs.h
-
-  ;;
-  *solaris*)
-       for ac_func in attropen
-do :
-  ac_fn_c_check_func "$LINENO" "attropen" "ac_cv_func_attropen"
-if test "x$ac_cv_func_attropen" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTROPEN 1
-_ACEOF
-
-fi
-done
-
-  ;;
-  *)
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getxattr" >&5
-$as_echo_n "checking for library containing getxattr... " >&6; }
-if ${ac_cv_search_getxattr+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getxattr ();
-int
-main ()
-{
-return getxattr ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' attr; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_getxattr=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_getxattr+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_getxattr+:} false; then :
-
-else
-  ac_cv_search_getxattr=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getxattr" >&5
-$as_echo "$ac_cv_search_getxattr" >&6; }
-ac_res=$ac_cv_search_getxattr
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-       for ac_func in getxattr
-do :
-  ac_fn_c_check_func "$LINENO" "getxattr" "ac_cv_func_getxattr"
-if test "x$ac_cv_func_getxattr" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETXATTR 1
-_ACEOF
-
-               for ac_func in lgetxattr fgetxattr listxattr llistxattr flistxattr removexattr lremovexattr fremovexattr setxattr lsetxattr fsetxattr
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-fi
-done
-
-       for ac_func in getea
-do :
-  ac_fn_c_check_func "$LINENO" "getea" "ac_cv_func_getea"
-if test "x$ac_cv_func_getea" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETEA 1
-_ACEOF
-
-               for ac_func in fgetea lgetea listea flistea llistea removeea fremoveea lremoveea setea fsetea lsetea
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-fi
-done
-
-       for ac_func in attr_get
-do :
-  ac_fn_c_check_func "$LINENO" "attr_get" "ac_cv_func_attr_get"
-if test "x$ac_cv_func_attr_get" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTR_GET 1
-_ACEOF
-
-               for ac_func in attr_list attr_set attr_remove attr_getf attr_listf attr_setf attr_removef
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-fi
-done
-
-       for ac_func in extattr_delete_file
-do :
-  ac_fn_c_check_func "$LINENO" "extattr_delete_file" "ac_cv_func_extattr_delete_file"
-if test "x$ac_cv_func_extattr_delete_file" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_EXTATTR_DELETE_FILE 1
-_ACEOF
-
-               for ac_func in extattr_delete_fd extattr_delete_link extattr_get_fd extattr_get_file extattr_get_link extattr_list_fd extattr_list_file extattr_list_link extattr_set_fd extattr_set_file extattr_set_link
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-fi
-done
-
-  ;;
-esac
-
-########################################################
-# Do xattr functions take additional options like on Darwin?
-if test x"$ac_cv_func_getxattr" = x"yes" ; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr interface takes additional options" >&5
-$as_echo_n "checking whether xattr interface takes additional options... " >&6; }
-if ${smb_attr_cv_xattr_add_opt+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-               old_LIBS=$LIBS
-               LIBS="$LIBS $ACL_LIBS"
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-                       #include <sys/types.h>
-                       #if HAVE_ATTR_XATTR_H
-                       #include <attr/xattr.h>
-                       #elif HAVE_SYS_XATTR_H
-                       #include <sys/xattr.h>
-                       #endif
-
-int
-main ()
-{
-
-                       getxattr(0, 0, 0, 0, 0, 0);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  smb_attr_cv_xattr_add_opt=yes
-else
-  smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smb_attr_cv_xattr_add_opt" >&5
-$as_echo "$smb_attr_cv_xattr_add_opt" >&6; }
-       if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
-
-$as_echo "#define XATTR_ADD_OPT 1" >>confdefs.h
-
-       fi
-fi
-
 # Check whether --enable-static was given.
 if test "${enable_static+set}" = set; then :
   enableval=$enable_static; p=${PACKAGE-default}
@@ -19278,9 +19915,6 @@ $as_echo "#define SUNOS5 1" >>confdefs.h
 
 $as_echo "#define STAT_ST_BLOCKSIZE 512" >>confdefs.h
 
-
-$as_echo "#define BROKEN_GETGRNAM 1" >>confdefs.h
-
                        ;;
                *sunos*)
 $as_echo "#define SUNOS4 1" >>confdefs.h
@@ -19291,9 +19925,6 @@ $as_echo "#define SUNOS4 1" >>confdefs.h
                        PICFLAG="-KPIC"   # Is this correct for SunOS
                        $as_echo "#define STAT_ST_BLOCKSIZE 512" >>confdefs.h
 
-
-$as_echo "#define BROKEN_GETGRNAM 1" >>confdefs.h
-
                        ;;
                *netbsd* | *freebsd* | *dragonfly* )
                        BLDSHARED="true"
@@ -19304,9 +19935,6 @@ $as_echo "#define BROKEN_GETGRNAM 1" >>confdefs.h
 
 $as_echo "#define STAT_ST_BLOCKSIZE 512" >>confdefs.h
 
-
-$as_echo "#define BROKEN_GETGRNAM 1" >>confdefs.h
-
                        ;;
                *openbsd*)  BLDSHARED="true"
                        LDSHFLAGS="-shared"
@@ -19316,20 +19944,8 @@ $as_echo "#define BROKEN_GETGRNAM 1" >>confdefs.h
 
 $as_echo "#define STAT_ST_BLOCKSIZE 512" >>confdefs.h
 
-
-$as_echo "#define BROKEN_GETGRNAM 1" >>confdefs.h
-
-                       ;;
-               *irix*)
-$as_echo "#define IRIX 1" >>confdefs.h
-
-                       case "$host_os" in
-                       *irix6*)
-$as_echo "#define IRIX6 1" >>confdefs.h
-
                        ;;
-                       esac
-                       BLDSHARED="true"
+               *irix*) BLDSHARED="true"
                        LDSHFLAGS="-Wl,-set_version,sgi1.0 -shared"
                        SONAMEFLAG="-Wl,-soname,"
                        if test "${GCC}" = "yes"; then
@@ -19427,9 +20043,6 @@ $as_echo "#define OSF1 1" >>confdefs.h
                        fi
                        $as_echo "#define STAT_ST_BLOCKSIZE 512" >>confdefs.h
 
-
-$as_echo "#define BROKEN_GETGRNAM 1" >>confdefs.h
-
                        for flags in "-expect_unresolved '*'" "-Wl,-expect_unresolved,'*'" ; do
                                saved_ldflags="$LDFLAGS"
                                { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $flags works" >&5
@@ -19460,16 +20073,10 @@ rm -f core conftest.err conftest.$ac_objext \
                                test x"$LDSHFLAGS_Z_NODEFS" != x && break
                        done
                        ;;
-               *sco*)
-$as_echo "#define SCO 1" >>confdefs.h
-
-                       $as_echo "#define STAT_ST_BLOCKSIZE 512" >>confdefs.h
+               *sco*) $as_echo "#define STAT_ST_BLOCKSIZE 512" >>confdefs.h
 
                        ;;
-               *unixware*)
-$as_echo "#define UNIXWARE 1" >>confdefs.h
-
-                       BLDSHARED="true"
+               *unixware*) BLDSHARED="true"
                        LDSHFLAGS="-shared"
                        SONAMEFLAG="-Wl,-soname,"
                        PICFLAG="-KPIC"
@@ -19498,7 +20105,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ROFF="groff -etpsR -Tascii -man"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -19885,7 +20492,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
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking used PICFLAG" >&5
@@ -20034,7 +20641,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -20077,7 +20684,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -20318,9 +20925,7 @@ if test x"$VERSIONSCRIPT" != "x"; then
 
 fi
 
-       if test x"$USESHARED" = x"no" ; then
-               LINK_LIBTALLOC=STATIC
-       fi
+       LINK_LIBTALLOC=STATIC
        LIBTALLOCVERSION=`grep ^VERSION ${tallocdir}/wscript | sed -e "s/'//g" -e 's/.* //'`
 
 
@@ -20429,7 +21034,7 @@ fi
        SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CONFIGURE_CPPFLAGS} ${TALLOC_CFLAGS}"
 
 
-       TALLOCTORT="bin/talloctort\$(EXEEXT)"
+       TALLOCTORT="bin/talloctort"
 
 fi
 
@@ -20659,9 +21264,7 @@ if test x"$VERSIONSCRIPT" != "x"; then
 
 fi
 
-       if test x"$USESHARED" = x"no" ; then
-               LINK_LIBTDB=STATIC
-       fi
+       LINK_LIBTDB=STATIC
        LIBTDBVERSION=`grep ^VERSION ${tdbdir}/wscript | sed -e "s/'//g" -e 's/.* //'`
 
 
 
 if eval test x"$build_lib" = "xyes" ; then
        # only set the install targets if the user chose the library
-       INSTALL_LIBTDB=installlibtdb
-       UNINSTALL_LIBTDB=uninstalllibtdb
+       INSTALL_LIBTDB=installlibtdb
+       UNINSTALL_LIBTDB=uninstalllibtdb
+       if eval $BLDSHARED = true; then
+               LIBTDB_SHARED=$LIBTDB_SHARED_TARGET
+               LIBTDB_TARGET=$LIBTDB_SHARED_TARGET
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               if test x"$USESHARED" != x"true" -o x"$LINK_LIBTDB" = "xSTATIC" ; then
+                       enable_static=yes
+                       LIBTDB_TARGET=$LIBTDB_STATIC_TARGET
+                       LIBTDB_LIBS=$LIBTDB_STATIC_TARGET
+               else
+                       LIBTDB_LIBS=-ltdb
+               fi
+       else
+               enable_static=yes
+               LIBTDB_TARGET=$LIBTDB_STATIC_TARGET
+               LIBTDB_LIBS=$LIBTDB_STATIC_TARGET
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no shared library support -- will supply static library" >&5
+$as_echo "no shared library support -- will supply static library" >&6; }
+       fi
+else
+       enable_static=yes
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared library not selected" >&5
+$as_echo "shared library not selected" >&6; }
+fi
+if test $enable_static = yes; then
+       LIBTDB_STATIC=$LIBTDB_STATIC_TARGET
+fi
+
+
+
+
+
+
+       LIBTDB_OBJ0=""
+       LIBTDB_LIBS="$LIBTDB_LIBS $TDB_DEPS"
+       for obj in ${TDB_OBJ}; do
+               LIBTDB_OBJ0="${LIBTDB_OBJ0} ${tdbdir}/${obj}"
+       done
+
+       SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TDB_CFLAGS}"
+       SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CONFIGURE_CPPFLAGS} ${TDB_CFLAGS}"
+
+       TDBBACKUP="bin/tdbbackup"
+
+       TDBDUMP="bin/tdbdump"
+
+       TDBRESTORE="bin/tdbrestore"
+
+       TDBTOOL="bin/tdbtool"
+
+       TDBTORTURE="bin/tdbtorture"
+
+fi
+
+# Check whether --enable-external_libntdb was given.
+if test "${enable_external_libntdb+set}" = set; then :
+  enableval=$enable_external_libntdb;  enable_external_libntdb=$enableval
+else
+   enable_external_libntdb=auto
+fi
+
+
+if test "x$enable_external_libntdb" != xno
+then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNTDB" >&5
+$as_echo_n "checking for LIBNTDB... " >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBNTDB_CFLAGS"; then
+        pkg_cv_LIBNTDB_CFLAGS="$LIBNTDB_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ntdb >= 1.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "ntdb >= 1.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBNTDB_CFLAGS=`$PKG_CONFIG --cflags "ntdb >= 1.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBNTDB_LIBS"; then
+        pkg_cv_LIBNTDB_LIBS="$LIBNTDB_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ntdb >= 1.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "ntdb >= 1.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBNTDB_LIBS=`$PKG_CONFIG --libs "ntdb >= 1.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               LIBNTDB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "ntdb >= 1.0"`
+        else
+               LIBNTDB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "ntdb >= 1.0"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$LIBNTDB_PKG_ERRORS" >&5
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               if test x$enable_external_libntdb = xyes; then
+                       as_fn_error $? "Unable to find libntdb" "$LINENO" 5
+               else
+                       enable_external_libntdb=no
+               fi
+
+elif test $pkg_failed = untried; then
+
+               if test x$enable_external_libntdb = xyes; then
+                       as_fn_error $? "Unable to find libntdb" "$LINENO" 5
+               else
+                       enable_external_libntdb=no
+               fi
+
+else
+       LIBNTDB_CFLAGS=$pkg_cv_LIBNTDB_CFLAGS
+       LIBNTDB_LIBS=$pkg_cv_LIBNTDB_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+        enable_external_libntdb=yes
+fi
+fi
+
+
+if test "x$enable_external_libntdb" = xno
+then
+       ntdbdir=""
+ntdbpaths=". lib/ntdb ntdb ../ntdb ../lib/ntdb"
+for d in $ntdbpaths; do
+       if test -f "$srcdir/$d/ntdb.c"; then
+               ntdbdir="$d"
+
+               break;
+       fi
+done
+if test x"$ntdbdir" = "x"; then
+   as_fn_error $? "cannot find ntdb source in $ntdbpaths" "$LINENO" 5
+fi
+NTDB_OBJ="check.o free.o hash.o io.o lock.o ntdb.o open.o pyntdb.o summary.o transaction.o traverse.o"
+
+
+
+
+NTDB_LIBS=""
+
+
+NTDB_DEPS=""
+if test x$libreplace_cv_HAVE_FDATASYNC_IN_LIBRT = xyes ; then
+       NTDB_DEPS="$NTDB_DEPS -lrt"
+fi
+
+
+NTDB_CFLAGS="-I$ntdbdir"
+
+
+for ac_func in mmap pread pwrite getpagesize utime
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_header in getopt.h sys/select.h sys/time.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pread declaration" >&5
+$as_echo_n "checking for pread declaration... " >&6; }
+if ${ac_cv_have_pread_decl+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+int
+main ()
+{
+int i = (int)pread
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_have_pread_decl=yes
+else
+  ac_cv_have_pread_decl=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_pread_decl" >&5
+$as_echo "$ac_cv_have_pread_decl" >&6; }
+ if test x"$ac_cv_have_pread_decl" = x"yes"; then
+
+$as_echo "#define HAVE_PREAD_DECL 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pwrite declaration" >&5
+$as_echo_n "checking for pwrite declaration... " >&6; }
+if ${ac_cv_have_pwrite_decl+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+int
+main ()
+{
+int i = (int)pwrite
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_have_pwrite_decl=yes
+else
+  ac_cv_have_pwrite_decl=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_pwrite_decl" >&5
+$as_echo "$ac_cv_have_pwrite_decl" >&6; }
+ if test x"$ac_cv_have_pwrite_decl" = x"yes"; then
+
+$as_echo "#define HAVE_PWRITE_DECL 1" >>confdefs.h
+
+ fi
+
+
+if test x"$VERSIONSCRIPT" != "x"; then
+    EXPORTSFILE=ntdb.exports
+
+fi
+
+       LINK_LIBNTDB=STATIC
+       LIBNTDBVERSION=`grep ^VERSION ${ntdbdir}/wscript | sed -e "s/'//g" -e 's/.* //'`
+
+
+
+
+
+LIBNTDB_SHARED_TARGET=bin/libntdb.$SHLIBEXT
+LIBNTDB_STATIC_TARGET=bin/libntdb.a
+LIBNTDB_SHARED=
+LIBNTDB_STATIC=
+LIBNTDB_LIBS=-lntdb
+LIBNTDB_TARGET=
+INSTALL_LIBNTDB=
+UNINSTALL_LIBNTDB=
+
+LIBNTDB_SOVER=1
+LIBNTDB_FULLVER=${LIBNTDBVERSION}
+
+LIBNTDB_SHARED_TARGET_SOVER=$LIBNTDB_SHARED_TARGET.$LIBNTDB_SOVER
+LIBNTDB_SHARED_TARGET_FULLVER=$LIBNTDB_SHARED_TARGET.$LIBNTDB_FULLVER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the libntdb shared library" >&5
+$as_echo_n "checking whether to build the libntdb shared library... " >&6; }
+
+
+# Check whether --with-libntdb was given.
+if test "${with_libntdb+set}" = set; then :
+  withval=$with_libntdb;
+case "$withval" in
+       no)
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               build_lib=no
+               ;;
+       *)
+               build_lib=yes
+               ;;
+esac
+
+else
+
+# if unspecified, default is to build it if possible.
+build_lib=yes
+
+
+fi
+
+
+
+if eval test x"$build_lib" = "xyes" ; then
+       # only set the install targets if the user chose the library
+       INSTALL_LIBNTDB=installlibntdb
+       UNINSTALL_LIBNTDB=uninstalllibntdb
        if eval $BLDSHARED = true; then
-               LIBTDB_SHARED=$LIBTDB_SHARED_TARGET
-               LIBTDB_TARGET=$LIBTDB_SHARED_TARGET
+               LIBNTDB_SHARED=$LIBNTDB_SHARED_TARGET
+               LIBNTDB_TARGET=$LIBNTDB_SHARED_TARGET
 
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-               if test x"$USESHARED" != x"true" -o x"$LINK_LIBTDB" = "xSTATIC" ; then
+               if test x"$USESHARED" != x"true" -o x"$LINK_LIBNTDB" = "xSTATIC" ; then
                        enable_static=yes
-                       LIBTDB_TARGET=$LIBTDB_STATIC_TARGET
-                       LIBTDB_LIBS=$LIBTDB_STATIC_TARGET
+                       LIBNTDB_TARGET=$LIBNTDB_STATIC_TARGET
+                       LIBNTDB_LIBS=$LIBNTDB_STATIC_TARGET
                else
-                       LIBTDB_LIBS=-ltdb
+                       LIBNTDB_LIBS=-lntdb
                fi
        else
                enable_static=yes
-               LIBTDB_TARGET=$LIBTDB_STATIC_TARGET
-               LIBTDB_LIBS=$LIBTDB_STATIC_TARGET
+               LIBNTDB_TARGET=$LIBNTDB_STATIC_TARGET
+               LIBNTDB_LIBS=$LIBNTDB_STATIC_TARGET
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no shared library support -- will supply static library" >&5
 $as_echo "no shared library support -- will supply static library" >&6; }
        fi
@@ -20754,7 +21704,7 @@ else
 $as_echo "shared library not selected" >&6; }
 fi
 if test $enable_static = yes; then
-       LIBTDB_STATIC=$LIBTDB_STATIC_TARGET
+       LIBNTDB_STATIC=$LIBNTDB_STATIC_TARGET
 fi
 
 
 
 
 
-       LIBTDB_OBJ0=""
-       LIBTDB_LIBS="$LIBTDB_LIBS $TDB_DEPS"
-       for obj in ${TDB_OBJ}; do
-               LIBTDB_OBJ0="${LIBTDB_OBJ0} ${tdbdir}/${obj}"
+       LIBNTDB_OBJ0=""
+       LIBNTDB_LIBS="$LIBNTDB_LIBS $NTDB_DEPS"
+       for obj in ${NTDB_OBJ}; do
+               LIBNTDB_OBJ0="${LIBNTDB_OBJ0} ${ntdbdir}/${obj}"
        done
 
-       SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TDB_CFLAGS}"
-       SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CONFIGURE_CPPFLAGS} ${TDB_CFLAGS}"
-
-       TDBBACKUP="bin/tdbbackup\$(EXEEXT)"
-
-       TDBDUMP="bin/tdbdump\$(EXEEXT)"
-
-       TDBRESTORE="bin/tdbrestore\$(EXEEXT)"
+       SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${NTDB_CFLAGS}"
+       SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CONFIGURE_CPPFLAGS} ${NTDB_CFLAGS}"
 
-       TDBTOOL="bin/tdbtool\$(EXEEXT)"
+       NTDBBACKUP="bin/ntdbbackup"
 
-       TDBTORTURE="bin/tdbtorture\$(EXEEXT)"
+       NTDBDUMP="bin/ntdbdump"
 
-       ac_cv_have_tdb_err_nesting=yes
-else
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <tdb.h>
-int
-main ()
-{
-enum TDB_ERROR err = TDB_ERR_NESTING
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_have_tdb_err_nesting=yes
-else
-  ac_cv_have_tdb_err_nesting=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+       NTDBRESTORE="bin/ntdbrestore"
 
-if test x"$ac_cv_have_tdb_err_nesting" = xyes; then
+       NTDBTOOL="bin/ntdbtool"
 
-$as_echo "#define HAVE_TDB_ERR_NESTING 1" >>confdefs.h
+       NTDBTORTURE="bin/ntdbtorture"
 
 fi
 
 
 
 
-
-
-
-LIBADDNS_SHARED_TARGET=bin/libaddns.$SHLIBEXT
-LIBADDNS_STATIC_TARGET=bin/libaddns.a
-LIBADDNS_SHARED=
-LIBADDNS_STATIC=
-LIBADDNS_LIBS=-laddns
-LIBADDNS_TARGET=
-INSTALL_LIBADDNS=
-UNINSTALL_LIBADDNS=
-
-LIBADDNS_SOVER=0
-LIBADDNS_FULLVER=$LIBADDNS_SOVER
-
-LIBADDNS_SHARED_TARGET_SOVER=$LIBADDNS_SHARED_TARGET.$LIBADDNS_SOVER
-LIBADDNS_SHARED_TARGET_FULLVER=$LIBADDNS_SHARED_TARGET.$LIBADDNS_FULLVER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the libaddns shared library" >&5
-$as_echo_n "checking whether to build the libaddns shared library... " >&6; }
-
-
-# Check whether --with-libaddns was given.
-if test "${with_libaddns+set}" = set; then :
-  withval=$with_libaddns;
-case "$withval" in
-       yes)
-               build_lib=yes
-               ;;
-       *)
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-               build_lib=no
-               ;;
-esac
-
-else
-
-# if unspecified, default is not to build
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-build_lib=no
-
-
-fi
-
-
-
-if eval test x"$build_lib" = "xyes" ; then
-       # only set the install targets if the user chose the library
-       INSTALL_LIBADDNS=installlibaddns
-       UNINSTALL_LIBADDNS=uninstalllibaddns
-       if eval $BLDSHARED = true; then
-               LIBADDNS_SHARED=$LIBADDNS_SHARED_TARGET
-               LIBADDNS_TARGET=$LIBADDNS_SHARED_TARGET
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-               if test x"$USESHARED" != x"true" -o x"$LINK_LIBADDNS" = "xSTATIC" ; then
-                       enable_static=yes
-                       LIBADDNS_TARGET=$LIBADDNS_STATIC_TARGET
-                       LIBADDNS_LIBS=$LIBADDNS_STATIC_TARGET
-               else
-                       LIBADDNS_LIBS=-laddns
-               fi
-       else
-               enable_static=yes
-               LIBADDNS_TARGET=$LIBADDNS_STATIC_TARGET
-               LIBADDNS_LIBS=$LIBADDNS_STATIC_TARGET
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no shared library support -- will supply static library" >&5
-$as_echo "no shared library support -- will supply static library" >&6; }
-       fi
-else
-       enable_static=yes
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared library not selected" >&5
-$as_echo "shared library not selected" >&6; }
-fi
-if test $enable_static = yes; then
-       LIBADDNS_STATIC=$LIBADDNS_STATIC_TARGET
-fi
-
-
-
-
-
-
-
-
-
 ################
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long" >&5
@@ -21223,7 +22046,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
-main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }
+main() { long long x = 1000000; x *= x; return(((x/1000000) == 1000000)? 0: 1); }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   samba_cv_have_longlong=yes
@@ -21315,7 +22138,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
-main() { exit((sizeof(time_t) == 8) ? 0 : 1); }
+main() { return((sizeof(time_t) == 8) ? 0 : 1); }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   samba_cv_SIZEOF_TIME_T=yes
@@ -21358,11 +22181,11 @@ main() {
                        max_time = 67768036191676799ll;
                        tm = gmtime(&max_time);
                        if (tm) {
-                               exit(0);
+                               return(0);
                        }
                }
        }
-       exit(1);
+       return(1);
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -21384,6 +22207,15 @@ $as_echo "#define TIME_T_MAX 67768036191676799ll" >>confdefs.h
 fi
 
 
+#
+# As a gating factor for large file support, in order to
+# use >4GB files we must have the following minimal support
+# available: a 64 bit off_t
+# If we don't have all of these then fail the build
+#
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if large file support can be enabled" >&5
+$as_echo_n "checking if large file support can be enabled... " >&6; }
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64 bit off_t" >&5
 $as_echo_n "checking for 64 bit off_t... " >&6; }
 if ${samba_cv_SIZEOF_OFF_T+:} false; then :
@@ -21397,7 +22229,7 @@ else
 /* end confdefs.h.  */
 #include <stdio.h>
 #include <sys/stat.h>
-main() { exit((sizeof(off_t) == 8) ? 0 : 1); }
+main() { return((sizeof(off_t) == 8) ? 0 : 1); }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   samba_cv_SIZEOF_OFF_T=yes
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_SIZEOF_OFF_T" >&5
 $as_echo "$samba_cv_SIZEOF_OFF_T" >&6; }
-if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
-
-$as_echo "#define SIZEOF_OFF_T 8" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5
-$as_echo_n "checking for off64_t... " >&6; }
-if ${samba_cv_HAVE_OFF64_T+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-if test "$cross_compiling" = yes; then :
-  samba_cv_HAVE_OFF64_T=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <sys/stat.h>
-main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  samba_cv_HAVE_OFF64_T=yes
-else
-  samba_cv_HAVE_OFF64_T=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_OFF64_T" >&5
-$as_echo "$samba_cv_HAVE_OFF64_T" >&6; }
-if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
-
-$as_echo "#define HAVE_OFF64_T 1" >>confdefs.h
-
+if test x"$samba_cv_SIZEOF_OFF_T" = x"no"; then
+    as_fn_error $? "\"large file support support not available: sizeof(off_t) != 8\"" "$LINENO" 5
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64 bit ino_t" >&5
@@ -21471,7 +22264,7 @@ else
 #endif
 #include <stdio.h>
 #include <sys/stat.h>
-main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }
+main() { return((sizeof(ino_t) == 8) ? 0 : 1); }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   samba_cv_SIZEOF_INO_T=yes
@@ -21491,43 +22284,6 @@ $as_echo "#define SIZEOF_INO_T 8" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ino64_t" >&5
-$as_echo_n "checking for ino64_t... " >&6; }
-if ${samba_cv_HAVE_INO64_T+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-if test "$cross_compiling" = yes; then :
-  samba_cv_HAVE_INO64_T=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <sys/stat.h>
-main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  samba_cv_HAVE_INO64_T=yes
-else
-  samba_cv_HAVE_INO64_T=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_INO64_T" >&5
-$as_echo "$samba_cv_HAVE_INO64_T" >&6; }
-if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
-
-$as_echo "#define HAVE_INO64_T 1" >>confdefs.h
-
-fi
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64 bit dev_t" >&5
 $as_echo_n "checking for 64 bit dev_t... " >&6; }
 if ${samba_cv_SIZEOF_DEV_T+:} false; then :
@@ -21545,7 +22301,7 @@ else
 #endif
 #include <stdio.h>
 #include <sys/stat.h>
-main() { exit((sizeof(dev_t) == 8) ? 0 : 1); }
+main() { return((sizeof(dev_t) == 8) ? 0 : 1); }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   samba_cv_SIZEOF_DEV_T=yes
@@ -21565,117 +22321,6 @@ $as_echo "#define SIZEOF_DEV_T 8" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dev64_t" >&5
-$as_echo_n "checking for dev64_t... " >&6; }
-if ${samba_cv_HAVE_DEV64_T+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-if test "$cross_compiling" = yes; then :
-  samba_cv_HAVE_DEV64_T=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <sys/stat.h>
-main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  samba_cv_HAVE_DEV64_T=yes
-else
-  samba_cv_HAVE_DEV64_T=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_DEV64_T" >&5
-$as_echo "$samba_cv_HAVE_DEV64_T" >&6; }
-if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
-
-$as_echo "#define HAVE_DEV64_T 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5
-$as_echo_n "checking for struct dirent64... " >&6; }
-if ${samba_cv_HAVE_STRUCT_DIR64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-#include <dirent.h>
-int
-main ()
-{
-DIR64 de;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_STRUCT_DIR64=yes
-else
-  samba_cv_HAVE_STRUCT_DIR64=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_STRUCT_DIR64" >&5
-$as_echo "$samba_cv_HAVE_STRUCT_DIR64" >&6; }
-if test x"$samba_cv_HAVE_STRUCT_DIR64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then
-
-$as_echo "#define HAVE_STRUCT_DIR64 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5
-$as_echo_n "checking for struct dirent64... " >&6; }
-if ${samba_cv_HAVE_STRUCT_DIRENT64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-#include <dirent.h>
-int
-main ()
-{
-struct dirent64 de;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_STRUCT_DIRENT64=yes
-else
-  samba_cv_HAVE_STRUCT_DIRENT64=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_STRUCT_DIRENT64" >&5
-$as_echo "$samba_cv_HAVE_STRUCT_DIRENT64" >&6; }
-if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then
-
-$as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h
-
-fi
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for major macro" >&5
 $as_echo_n "checking for major macro... " >&6; }
 if ${samba_cv_HAVE_DEVICE_MAJOR_FN+:} false; then :
@@ -21784,38 +22429,6 @@ $as_echo "#define HAVE_MAKEDEV 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned char" >&5
-$as_echo_n "checking for unsigned char... " >&6; }
-if ${samba_cv_HAVE_UNSIGNED_CHAR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-if test "$cross_compiling" = yes; then :
-  samba_cv_HAVE_UNSIGNED_CHAR=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-main() { char c; c=250; exit((c > 0)?0:1); }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  samba_cv_HAVE_UNSIGNED_CHAR=yes
-else
-  samba_cv_HAVE_UNSIGNED_CHAR=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_UNSIGNED_CHAR" >&5
-$as_echo "$samba_cv_HAVE_UNSIGNED_CHAR" >&6; }
-if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
-
-$as_echo "#define HAVE_UNSIGNED_CHAR 1" >>confdefs.h
-
-fi
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether seekdir returns void" >&5
 $as_echo_n "checking whether seekdir returns void... " >&6; }
 if ${samba_cv_SEEKDIR_RETURNS_VOID+:} false; then :
@@ -21901,7 +22514,7 @@ else
 #include <dirent.h>
 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
-di->d_name[0] == 0) exit(0); exit(1);}
+di->d_name[0] == 0) return(0); return(1);}
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   samba_cv_HAVE_BROKEN_READDIR_NAME=yes
@@ -21934,7 +22547,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 int
 main ()
 {
-struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));
+struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; return(utime("foo.c",&tbuf));
   ;
   return 0;
 }
@@ -22268,72 +22881,6 @@ $as_echo "#define HAVE_UT_UT_EXIT 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_addr_v6 in utmp" >&5
-$as_echo_n "checking for ut_addr_v6 in utmp... " >&6; }
-if ${samba_cv_HAVE_UT_UT_ADDR_V6+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <utmp.h>
-int
-main ()
-{
-struct utmp ut;  ut.ut_addr_v6[0] = 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_UT_UT_ADDR_V6=yes
-else
-  samba_cv_HAVE_UT_UT_ADDR_V6=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_UT_UT_ADDR_V6" >&5
-$as_echo "$samba_cv_HAVE_UT_UT_ADDR_V6" >&6; }
-if test x"$samba_cv_HAVE_UT_UT_ADDR_V6" = x"yes"; then
-
-$as_echo "#define HAVE_UT_UT_ADDR_V6 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_addr in utmp" >&5
-$as_echo_n "checking for ut_addr in utmp... " >&6; }
-if ${samba_cv_HAVE_UT_UT_ADDR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <utmp.h>
-int
-main ()
-{
-struct utmp ut;  ut.ut_addr = 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_UT_UT_ADDR=yes
-else
-  samba_cv_HAVE_UT_UT_ADDR=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_UT_UT_ADDR" >&5
-$as_echo "$samba_cv_HAVE_UT_UT_ADDR" >&6; }
-if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
-
-$as_echo "#define HAVE_UT_UT_ADDR 1" >>confdefs.h
-
-fi
-
 if test x$ac_cv_func_pututline = xyes ; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pututline returns pointer" >&5
 $as_echo_n "checking whether pututline returns pointer... " >&6; }
@@ -22402,6 +22949,41 @@ $as_echo "#define HAVE_UX_UT_SYSLEN 1" >>confdefs.h
 
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sizeof ut_line in utmp is ok" >&5
+$as_echo_n "checking whether sizeof ut_line in utmp is ok... " >&6; }
+if ${samba_cv_HAVE_UX_UT_LINE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+if test "$cross_compiling" = yes; then :
+  samba_cv_HAVE_UX_UT_LINE=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#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;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  samba_cv_HAVE_UX_UT_LINE=yes
+else
+  samba_cv_HAVE_UX_UT_LINE=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_UX_UT_LINE" >&5
+$as_echo "$samba_cv_HAVE_UX_UT_LINE" >&6; }
+
 fi
 # end utmp details
 
@@ -22446,44 +23028,38 @@ $as_echo "#define HAVE_LINUX_FALLOCATE 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linux fallocate64" >&5
-$as_echo_n "checking for linux fallocate64... " >&6; }
-if ${samba_cv_HAVE_LINUX_FALLOCATE64+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd takes NULL" >&5
+$as_echo_n "checking for getcwd takes NULL... " >&6; }
+if ${samba_cv_GETCWD_TAKES_NULL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test "$cross_compiling" = yes; then :
+  samba_cv_GETCWD_TAKES_NULL=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #if defined(HAVE_UNISTD_H)
 #include <unistd.h>
 #endif
-#include <sys/types.h>
-#define _GNU_SOURCE
-#include <fcntl.h>
-#if defined(HAVE_LINUX_FALLOC_H)
-#include <linux/falloc.h>
-#endif
-int
-main ()
-{
-int ret = fallocate64(0, FALLOC_FL_KEEP_SIZE, 0, 10);
-  ;
-  return 0;
-}
+main() { char *s = getcwd(NULL,0); if (s) return(0); return(1); }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_LINUX_FALLOCATE64=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  samba_cv_GETCWD_TAKES_NULL=yes
 else
-  samba_cv_HAVE_LINUX_FALLOCATE64=no
+  samba_cv_GETCWD_TAKES_NULL=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_LINUX_FALLOCATE64" >&5
-$as_echo "$samba_cv_HAVE_LINUX_FALLOCATE64" >&6; }
-if test x"$samba_cv_HAVE_LINUX_FALLOCATE64" = x"yes" && test x"$ac_cv_func_fallocate64" = x"yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_GETCWD_TAKES_NULL" >&5
+$as_echo "$samba_cv_GETCWD_TAKES_NULL" >&6; }
+if test x"$samba_cv_GETCWD_TAKES_NULL" = x"yes"; then
 
-$as_echo "#define HAVE_LINUX_FALLOCATE64 1" >>confdefs.h
+$as_echo "#define GETCWD_TAKES_NULL 1" >>confdefs.h
 
 fi
 
@@ -22739,7 +23315,6 @@ $as_echo "no" >&6; }
         export LDFLAGS LIBS CPPFLAGS
 
        default_dos_charset=no
-       default_display_charset=no
        default_unix_charset=no
 
        # check for default dos charset name
@@ -22781,45 +23356,6 @@ $as_echo "$ICONV_CHARSET" >&6; }
            fi
        done
 
-       # check for default display charset name
-       for j in ASCII 646 ; do
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking can we convert from $j to UCS2-LE?" >&5
-$as_echo_n "checking can we convert from $j to UCS2-LE?... " >&6; }
-  if test "$cross_compiling" = yes; then :
-  ICONV_CHARSET=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <$jm_cv_include>
-main(){
-    iconv_t cd = iconv_open("$j", "UCS-2LE");
-    if (cd == 0 || cd == (iconv_t)-1) {
-       return -1;
-    }
-    return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ICONV_CHARSET=$j
-else
-  ICONV_CHARSET=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICONV_CHARSET" >&5
-$as_echo "$ICONV_CHARSET" >&6; }
-
-           default_display_charset="$ICONV_CHARSET"
-           if test x"$default_display_charset" = x"$j"; then
-               break
-           fi
-       done
-
        # check for default unix charset name
        for j in UTF-8 UTF8 ; do
 
@@ -22861,15 +23397,12 @@ $as_echo "$ICONV_CHARSET" >&6; }
 
        if test "$default_dos_charset" != "no" -a \
                "$default_dos_charset" != "cross" -a \
-               "$default_display_charset" != "no" -a \
-               "$default_display_charset" != "cross" -a \
                "$default_unix_charset" != "no" -a \
                "$default_unix_charset" != "cross"
        then
                samba_cv_HAVE_NATIVE_ICONV=yes
        else
            if test "$default_dos_charset" = "cross" -o \
-                    "$default_display_charset" = "cross" -o \
                     "$default_unix_charset" = "cross"
            then
                    samba_cv_HAVE_NATIVE_ICONV=cross
@@ -22886,13 +23419,12 @@ $as_echo "$ICONV_CHARSET" >&6; }
        # match the results we get at runtime anyway.
        if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"cross" ; then
            default_dos_charset="CP850"
-           default_display_charset="ASCII"
            default_unix_charset="UTF-8"
            samba_cv_HAVE_NATIVE_ICONV=yes
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: assuming the libiconv in $iconv_current_LDFLAGS can convert" >&5
 $as_echo "$as_me: WARNING: assuming the libiconv in $iconv_current_LDFLAGS can convert" >&2;}
-           { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $default_dos_charset, $default_display_charset and $default_unix_charset to UCS-16LE" >&5
-$as_echo "$as_me: WARNING: $default_dos_charset, $default_display_charset and $default_unix_charset to UCS-16LE" >&2;}
+           { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $default_dos_charset and $default_unix_charset to UCS-16LE" >&5
+$as_echo "$as_me: WARNING: $default_dos_charset and $default_unix_charset to UCS-16LE" >&2;}
        fi
 
         if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes" ; then
@@ -22911,7 +23443,6 @@ $as_echo "$as_me: WARNING: $default_dos_charset, $default_display_charset and $d
 
            # Turn the #defines into string literals
            default_dos_charset="\"$default_dos_charset\""
-           default_display_charset="\"$default_display_charset\""
            default_unix_charset="\"$default_unix_charset\""
 
 
@@ -22923,11 +23454,6 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_DISPLAY_CHARSET $default_display_charset
-_ACEOF
-
-
 cat >>confdefs.h <<_ACEOF
 #define DEFAULT_UNIX_CHARSET $default_unix_charset
 _ACEOF
@@ -22959,11 +23485,6 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_DISPLAY_CHARSET "ASCII"
-_ACEOF
-
-
 cat >>confdefs.h <<_ACEOF
 #define DEFAULT_UNIX_CHARSET "UTF8"
 _ACEOF
@@ -23031,7 +23552,7 @@ else
 #define F_NOTIFY 1026
 #endif
 main() {
-               exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ?  1 : 0);
+       return(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ?  1 : 0);
 }
 
 _ACEOF
@@ -23053,80 +23574,17 @@ $as_echo "#define HAVE_KERNEL_CHANGE_NOTIFY 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inotify support" >&5
-$as_echo_n "checking for inotify support... " >&6; }
-if ${samba_cv_HAVE_INOTIFY+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_inotify_h" = xyes; then :
 
-for ac_header in linux/inotify.h asm/unistd.h sys/inotify.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_func in inotify_init
-do :
-  ac_fn_c_check_func "$LINENO" "inotify_init" "ac_cv_func_inotify_init"
-if test "x$ac_cv_func_inotify_init" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_INOTIFY_INIT 1
-_ACEOF
-
-fi
-done
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __NR_inotify_init declaration" >&5
-$as_echo_n "checking for __NR_inotify_init declaration... " >&6; }
-if ${ac_cv_have___NR_inotify_init_decl+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <asm/unistd.h>
-int
-main ()
-{
-int i = (int)__NR_inotify_init
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_have___NR_inotify_init_decl=yes
-else
-  ac_cv_have___NR_inotify_init_decl=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___NR_inotify_init_decl" >&5
-$as_echo "$ac_cv_have___NR_inotify_init_decl" >&6; }
- if test x"$ac_cv_have___NR_inotify_init_decl" = x"yes"; then
-
-$as_echo "#define HAVE___NR_INOTIFY_INIT_DECL 1" >>confdefs.h
 
- fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_INOTIFY" >&5
-$as_echo "$samba_cv_HAVE_INOTIFY" >&6; }
-
-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
+if test x"ac_cv_header_sys_inotify_h" = x"yes"; then
 
 $as_echo "#define HAVE_INOTIFY 1" >>confdefs.h
 
-    fi
 fi
 
 #################################################
@@ -23665,7 +24123,7 @@ else
 #define LOCK_READ      64
 #endif
 main() {
-               exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
+       return(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
 }
 
 _ACEOF
@@ -23847,11 +24305,11 @@ main() {
  cap_t cap;
  cap_value_t vals[1];
  if (!(cap = cap_get_proc()))
-   exit(1);
+   return(1);
  vals[0] = CAP_CHOWN;
  cap_set_flag(cap, CAP_INHERITABLE, 1, vals, CAP_CLEAR);
  cap_set_proc(cap);
exit(0);
return(0);
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -24306,6 +24764,151 @@ done
 # look for a method of setting the effective uid
 seteuid=no;
 
+################################################
+# Start by checking for 32-bit system call definitions on Linux.
+
+case "$host_os" in
+*linux*)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux 32-bit system calls" >&5
+$as_echo_n "checking for Linux 32-bit system calls... " >&6; }
+if ${samba_cv_USE_LINUX_32BIT_SYSCALLS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <errno.h>
+
+#ifdef HAVE_SYS_PRIV_H
+#include <sys/priv.h>
+#endif
+#ifdef HAVE_SYS_ID_H
+#include <sys/id.h>
+#endif
+
+#if defined(HAVE_SYSCALL_H)
+#include <syscall.h>
+#endif
+
+#if defined(HAVE_SYS_SYSCALL_H)
+#include <sys/syscall.h>
+#endif
+
+int
+main ()
+{
+
+syscall(SYS_setresuid32, -1, -1, -1);
+syscall(SYS_setresgid32, -1, -1, -1);
+syscall(SYS_setreuid32, -1, -1);
+syscall(SYS_setregid32, -1, -1);
+syscall(SYS_setuid32, -1);
+syscall(SYS_setgid32, -1);
+syscall(SYS_setgroups32, 0, NULL);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_USE_LINUX_32BIT_SYSCALLS=yes
+else
+  samba_cv_USE_LINUX_32BIT_SYSCALLS=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_USE_LINUX_32BIT_SYSCALLS" >&5
+$as_echo "$samba_cv_USE_LINUX_32BIT_SYSCALLS" >&6; }
+
+if test x"$samba_cv_USE_LINUX_32BIT_SYSCALLS" = x"yes"; then
+
+$as_echo "#define USE_LINUX_32BIT_SYSCALLS 1" >>confdefs.h
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux thread-specific credentials with 32-bit system calls" >&5
+$as_echo_n "checking for Linux thread-specific credentials with 32-bit system calls... " >&6; }
+if ${samba_cv_USE_LINUX_THREAD_CREDENTIALS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test "$cross_compiling" = yes; then :
+  samba_cv_USE_LINUX_THREAD_CREDENTIALS=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define AUTOCONF_TEST 1
+#define USE_LINUX_THREAD_CREDENTIALS 1
+#define USE_LINUX_32BIT_SYSCALLS 1
+#include "${srcdir-.}/../lib/util/setid.c"
+#include "${srcdir-.}/lib/util_sec.c"
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  samba_cv_USE_LINUX_THREAD_CREDENTIALS=yes
+else
+  samba_cv_USE_LINUX_THREAD_CREDENTIALS=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_USE_LINUX_THREAD_CREDENTIALS" >&5
+$as_echo "$samba_cv_USE_LINUX_THREAD_CREDENTIALS" >&6; }
+if test x"$samba_cv_USE_LINUX_THREAD_CREDENTIALS" = x"yes"; then
+    seteuid=yes;
+
+$as_echo "#define USE_LINUX_THREAD_CREDENTIALS 1" >>confdefs.h
+
+fi
+fi
+
+if test $seteuid = no; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux thread-specific credentials" >&5
+$as_echo_n "checking for Linux thread-specific credentials... " >&6; }
+if ${samba_cv_USE_LINUX_THREAD_CREDENTIALS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+if test "$cross_compiling" = yes; then :
+  samba_cv_USE_LINUX_THREAD_CREDENTIALS=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define AUTOCONF_TEST 1
+#define USE_LINUX_THREAD_CREDENTIALS 1
+#include "${srcdir-.}/../lib/util/setid.c"
+#include "${srcdir-.}/lib/util_sec.c"
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  samba_cv_USE_LINUX_THREAD_CREDENTIALS=yes
+else
+  samba_cv_USE_LINUX_THREAD_CREDENTIALS=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_USE_LINUX_THREAD_CREDENTIALS" >&5
+$as_echo "$samba_cv_USE_LINUX_THREAD_CREDENTIALS" >&6; }
+if test x"$samba_cv_USE_LINUX_THREAD_CREDENTIALS" = x"yes"; then
+    seteuid=yes;
+$as_echo "#define USE_LINUX_THREAD_CREDENTIALS 1" >>confdefs.h
+
+fi
+fi
+
+;;
+esac
+
 if test $seteuid = no; then
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setreuid" >&5
 $as_echo_n "checking for setreuid... " >&6; }
@@ -24322,6 +24925,7 @@ else
 #define AUTOCONF_TEST 1
 #define USE_SETREUID 1
 #include "confdefs.h"
+#include "${srcdir-.}/../lib/util/setid.c"
 #include "${srcdir-.}/lib/util_sec.c"
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -24361,6 +24965,7 @@ else
 #define AUTOCONF_TEST 1
 #define USE_SETRESUID 1
 #include "confdefs.h"
+#include "${srcdir-.}/../lib/util/setid.c"
 #include "${srcdir-.}/lib/util_sec.c"
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -24398,6 +25003,7 @@ else
 #define AUTOCONF_TEST 1
 #define USE_SETEUID 1
 #include "confdefs.h"
+#include "${srcdir-.}/../lib/util/setid.c"
 #include "${srcdir-.}/lib/util_sec.c"
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -24435,6 +25041,7 @@ else
 #define AUTOCONF_TEST 1
 #define USE_SETUIDX 1
 #include "confdefs.h"
+#include "${srcdir-.}/../lib/util/setid.c"
 #include "${srcdir-.}/lib/util_sec.c"
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -24524,92 +25131,6 @@ $as_echo "#define HAVE_FCNTL_LOCK 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken (glibc2.1/x86) 64 bit fcntl locking" >&5
-$as_echo_n "checking for broken (glibc2.1/x86) 64 bit fcntl locking... " >&6; }
-if ${samba_cv_HAVE_BROKEN_FCNTL64_LOCKS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-if test "$cross_compiling" = yes; then :
-  samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include "${srcdir-.}/../tests/fcntl_lock64.c"
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes
-else
-  samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" >&5
-$as_echo "$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" >&6; }
-if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
-
-$as_echo "#define HAVE_BROKEN_FCNTL64_LOCKS 1" >>confdefs.h
-
-
-else
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64 bit fcntl locking" >&5
-$as_echo_n "checking for 64 bit fcntl locking... " >&6; }
-if ${samba_cv_HAVE_STRUCT_FLOCK64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  if test "$cross_compiling" = yes; then :
-  samba_cv_HAVE_STRUCT_FLOCK64=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#ifdef HAVE_SYS_FCNTL_H
-#include <sys/fcntl.h>
-#endif
-main() { struct flock64 fl64;
-#if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
-exit(0);
-#else
-exit(1);
-#endif
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  samba_cv_HAVE_STRUCT_FLOCK64=yes
-else
-  samba_cv_HAVE_STRUCT_FLOCK64=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_STRUCT_FLOCK64" >&5
-$as_echo "$samba_cv_HAVE_STRUCT_FLOCK64" >&6; }
-
-  if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
-
-$as_echo "#define HAVE_STRUCT_FLOCK64 1" >>confdefs.h
-
-  fi
-fi
-
 # glibc up to 2.3.6 had dangerously broken posix_fallocate(). DON'T USE IT.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken posix_fallocate" >&5
 $as_echo_n "checking for broken posix_fallocate... " >&6; }
@@ -24623,7 +25144,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   #define _XOPEN_SOURCE 600
   #include <stdlib.h>
   #if defined(__GLIBC__) && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 4))
-    probably broken posix_fallocate
+  #error probably broken posix_fallocate
   #endif
 
 int
@@ -24646,7 +25167,7 @@ fi
 $as_echo "$samba_cv_HAVE_BROKEN_POSIX_FALLOCATE" >&6; }
 if test x"$samba_cv_HAVE_BROKEN_POSIX_FALLOCATE" = xyes; then
 
-$as_echo "#define HAVE_BROKEN_POSIX_FALLOCATE /**/" >>confdefs.h
+$as_echo "#define HAVE_BROKEN_POSIX_FALLOCATE 1" >>confdefs.h
 
 fi
 
@@ -24685,27 +25206,81 @@ $as_echo "#define HAVE_STAT_ST_BLOCKS 1" >>confdefs.h
 
 fi
 
-ac_fn_c_check_type "$LINENO" "blksize_t" "ac_cv_type_blksize_t" "#include <sys/stat.h>
-"
-if test "x$ac_cv_type_blksize_t" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 32 bit blkcnt_t" >&5
+$as_echo_n "checking for 32 bit blkcnt_t... " >&6; }
+if ${samba_cv_SIZEOF_BLKCNT_T_4+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_BLKSIZE_T 1
+if test "$cross_compiling" = yes; then :
+  samba_cv_SIZEOF_BLKCNT_T_4=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+main() { return((sizeof(blkcnt_t) == 4) ? 0 : 1); }
 _ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  samba_cv_SIZEOF_BLKCNT_T_4=yes
+else
+  samba_cv_SIZEOF_BLKCNT_T_4=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_SIZEOF_BLKCNT_T_4" >&5
+$as_echo "$samba_cv_SIZEOF_BLKCNT_T_4" >&6; }
+if test x"$samba_cv_SIZEOF_BLKCNT_T_4" = x"yes"; then
+
+$as_echo "#define SIZEOF_BLKCNT_T_4 1" >>confdefs.h
 
 fi
-ac_fn_c_check_type "$LINENO" "blkcnt_t" "ac_cv_type_blkcnt_t" "#include <sys/stat.h>
-"
-if test "x$ac_cv_type_blkcnt_t" = xyes; then :
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_BLKCNT_T 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64 bit blkcnt_t" >&5
+$as_echo_n "checking for 64 bit blkcnt_t... " >&6; }
+if ${samba_cv_SIZEOF_BLKCNT_T_8+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+if test "$cross_compiling" = yes; then :
+  samba_cv_SIZEOF_BLKCNT_T_8=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+main() { return((sizeof(blkcnt_t) == 8) ? 0 : 1); }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  samba_cv_SIZEOF_BLKCNT_T_8=yes
+else
+  samba_cv_SIZEOF_BLKCNT_T_8=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_SIZEOF_BLKCNT_T_8" >&5
+$as_echo "$samba_cv_SIZEOF_BLKCNT_T_8" >&6; }
+if test x"$samba_cv_SIZEOF_BLKCNT_T_8" = x"yes"; then
+
+$as_echo "#define SIZEOF_BLKCNT_T_8 1" >>confdefs.h
+
+fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_blksize in struct stat" >&5
 $as_echo_n "checking for st_blksize in struct stat... " >&6; }
@@ -24838,7 +25413,7 @@ main() {
        char *newpath;
        signal(SIGSEGV, exit_on_core);
        newpath = realpath("/tmp", NULL);
-       exit((newpath != NULL) ? 0 : 1);
+       return((newpath != NULL) ? 0 : 1);
 }
 
 _ACEOF
@@ -25095,8 +25670,6 @@ $as_echo "$with_ldap_support" >&6; }
 
 SMBLDAP=""
 
-SMBLDAPUTIL=""
-
 
 if test x"$with_ldap_support" != x"no"; then
 
@@ -25626,7 +26199,6 @@ $as_echo "#define HAVE_LDAP 1" >>confdefs.h
     default_static_modules="$default_static_modules pdb_ldap idmap_ldap";
     default_shared_modules="$default_shared_modules";
     SMBLDAP="lib/smbldap.o"
-    SMBLDAPUTIL="lib/smbldap_util.o"
     with_ldap_support=yes
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether LDAP support is used" >&5
 $as_echo_n "checking whether LDAP support is used... " >&6; }
@@ -25686,9 +26258,9 @@ else
     # Check to see whether there is enough LDAP functionality to be able
     # to build AD support.
 
-# HPUX only has ldap_init; ok, we take care of this in smbldap.c
+# HPUX and Solaris only has ldap_init; ok, we take care of this in smbldap.c
 case "$host_os" in
-       *hpux*)
+       *hpux* | *solaris*)
 
 
     ac_check_func_ext_save_LIBS=$LIBS
 
     if test x"$ac_cv_func_ext_ldap_init" != x"yes"; then
        if test x"$with_ads_support" = x"yes"; then
-           as_fn_error $? "Active Directory support on HPUX requires ldap_init" "$LINENO" 5
+           as_fn_error $? "Active Directory support on HPUX or Solaris requires ldap_init" "$LINENO" 5
        elif test x"$with_ads_support" = x"auto"; then
-           { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling Active Directory support (requires ldap_init on HPUX)" >&5
-$as_echo "$as_me: WARNING: Disabling Active Directory support (requires ldap_init on HPUX)" >&2;}
+           { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling Active Directory support (requires ldap_init on HPUX or Solaris)" >&5
+$as_echo "$as_me: WARNING: Disabling Active Directory support (requires ldap_init on HPUX or Solaris)" >&2;}
            with_ads_support=no
        fi
     fi
@@ -25950,7 +26522,6 @@ $as_echo "no krb5-path given" >&6; }
       yes)
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: /usr" >&5
 $as_echo "/usr" >&6; }
-        FOUND_KRB5=yes
         ;;
       *)
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
@@ -25992,7 +26563,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_KRB5CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -26096,6 +26667,24 @@ $as_echo "no" >&6; }
     fi
   fi
 
+  if test x$FOUND_KRB5 = x"no"; then
+    #################################################
+    # see if this box has Solaris MIT kerberos implementation
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris MIT kerberos" >&5
+$as_echo_n "checking for Solaris MIT kerberos... " >&6; }
+    if test -x "$KRB5CONFIG" && $KRB5CONFIG --version | grep -s Solaris | grep -s MIT > /dev/null ; then
+       FOUND_KRB5=yes
+       KRB5_LIBS="-lgss -lkrb5"
+       KRB5_CFLAGS="`$KRB5CONFIG --cflags`"
+       KRB5_CPPFLAGS="`$KRB5CONFIG --cflags`"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+  fi
+
   ac_save_CFLAGS=$CFLAGS
   ac_save_CPPFLAGS=$CPPFLAGS
   ac_save_LDFLAGS=$LDFLAGS
@@ -26119,6 +26708,7 @@ $as_echo "no" >&6; }
     -Wl,-rpath-Wl,/usr/lib/) l="";;
     -Wl,-rpath-Wl,/usr/lib64) l="";;
     -Wl,-rpath-Wl,/usr/lib64/) l="";;
+    -rpath=/usr/lib:*) l="-rpath=${i#-rpath=*:}";;
     *)
        s=" "
         if test x"$ac_new_flags" = x""; then
@@ -26153,6 +26743,7 @@ $as_echo "no" >&6; }
     -Wl,-rpath-Wl,/usr/lib/) l="";;
     -Wl,-rpath-Wl,/usr/lib64) l="";;
     -Wl,-rpath-Wl,/usr/lib64/) l="";;
+    -rpath=/usr/lib:*) l="-rpath=${i#-rpath=*:}";;
     *)
        s=" "
         if test x"$ac_new_flags" = x""; then
@@ -26258,7 +26849,7 @@ if test x"$with_ads_support" != x"no"; then
 
   # now check for gssapi headers.  This is also done here to allow for
   # different kerberos include paths
-  for ac_header in gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h gssapi/gssapi_ext.h com_err.h
+  for ac_header in gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h gssapi/gssapi_ext.h gssapi/gssapi_krb5.h com_err.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -26882,31 +27473,100 @@ _ACEOF
 fi
 
 
-    ac_check_func_ext_save_LIBS=$LIBS
-    LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_wrap_iov" >&5
-$as_echo_n "checking for gss_wrap_iov... " >&6; }
-if ${ac_cv_func_ext_gss_wrap_iov+:} false; then :
+ac_check_lib_ext_save_LIBS=$LIBS
+LIBS="-lgss $KRB5_LIBS  $LIBS"
+
+
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_display_status in -lgss" >&5
+$as_echo_n "checking for gss_display_status in -lgss... " >&6; }
+if ${ac_cv_lib_ext_gss_gss_display_status+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define gss_wrap_iov to an innocuous variant, in case <limits.h> declares gss_wrap_iov.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define gss_wrap_iov innocuous_gss_wrap_iov
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char gss_wrap_iov (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
 #endif
+char gss_display_status ();
+int
+main ()
+{
+return gss_display_status ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ext_gss_gss_display_status=yes;
+                 ac_cv_lib_ext_gss=yes
+else
+  ac_cv_lib_ext_gss_gss_display_status=no;
+                 ac_cv_lib_ext_gss=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-#undef gss_wrap_iov
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext_gss_gss_display_status" >&5
+$as_echo "$ac_cv_lib_ext_gss_gss_display_status" >&6; }
+    if test $ac_cv_lib_ext_gss_gss_display_status = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GSS_DISPLAY_STATUS 1
+_ACEOF
+
+fi
+LIBS=$ac_check_lib_ext_save_LIBS
+
+if test $ac_cv_lib_ext_gss = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGSS 1
+_ACEOF
+
+               case "$KRB5_LIBS" in
+                   *-lgss*)
+                       ;;
+                   *)
+                       KRB5_LIBS="-lgss $KRB5_LIBS"
+                       ;;
+               esac
+               have_gssapi=yes
+
+fi
+  fi
+  ################################################################
+  # test for AD / GSSAPI support being enabled
+  if test x"$have_gssapi" != xyes ; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Samba cannot be supported without GSSAPI" >&5
+$as_echo "$as_me: WARNING: Samba cannot be supported without GSSAPI" >&2;}
+       use_ads=no
+  else
+
+$as_echo "#define HAVE_GSSAPI /**/" >>confdefs.h
+
+  fi
+
+  # This is for FreeBSD (and possibly others). gss_mech_krb5 is a
+  # #define to GSS_KRB5_MECHANISM, which is defined in -lgssapi_krb5
+  # Also, gsskrb5_extract_authz_data_from_sec_context is in -lgssapi_krb5
+
+
+ac_check_lib_ext_save_LIBS=$LIBS
+LIBS="-lgssapi_krb5 $KRB5_LIBS  $LIBS"
+
+
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSS_KRB5_MECHANISM in -lgssapi_krb5" >&5
+$as_echo_n "checking for GSS_KRB5_MECHANISM in -lgssapi_krb5... " >&6; }
+if ${ac_cv_lib_ext_gssapi_krb5_GSS_KRB5_MECHANISM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -26914,40 +27574,41 @@ else
 #ifdef __cplusplus
 extern "C"
 #endif
-char gss_wrap_iov ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_gss_wrap_iov || defined __stub___gss_wrap_iov
-choke me
-#endif
-
+char GSS_KRB5_MECHANISM ();
 int
 main ()
 {
-return gss_wrap_iov ();
+return GSS_KRB5_MECHANISM ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_gss_wrap_iov=yes
+  ac_cv_lib_ext_gssapi_krb5_GSS_KRB5_MECHANISM=yes;
+                 ac_cv_lib_ext_gssapi_krb5=yes
 else
-  ac_cv_func_ext_gss_wrap_iov=no
+  ac_cv_lib_ext_gssapi_krb5_GSS_KRB5_MECHANISM=no;
+                 ac_cv_lib_ext_gssapi_krb5=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_gss_wrap_iov" >&5
-$as_echo "$ac_cv_func_ext_gss_wrap_iov" >&6; }
-    LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_gss_wrap_iov = yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext_gssapi_krb5_GSS_KRB5_MECHANISM" >&5
+$as_echo "$ac_cv_lib_ext_gssapi_krb5_GSS_KRB5_MECHANISM" >&6; }
+    if test $ac_cv_lib_ext_gssapi_krb5_GSS_KRB5_MECHANISM = yes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_GSS_WRAP_IOV 1
+#define HAVE_GSS_KRB5_MECHANISM 1
 _ACEOF
 
 fi
-  fi
+LIBS=$ac_check_lib_ext_save_LIBS
+
+if test $ac_cv_lib_ext_gssapi_krb5 = yes; then :
+  KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"
+
+
+fi
 
 
 
 
     ac_check_func_ext_save_LIBS=$LIBS
     LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_use_enctype" >&5
-$as_echo_n "checking for krb5_use_enctype... " >&6; }
-if ${ac_cv_func_ext_krb5_use_enctype+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define krb5_use_enctype to an innocuous variant, in case <limits.h> declares krb5_use_enctype.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_use_enctype innocuous_krb5_use_enctype
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_use_enctype (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef krb5_use_enctype
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char krb5_use_enctype ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_use_enctype || defined __stub___krb5_use_enctype
-choke me
-#endif
-
-int
-main ()
-{
-return krb5_use_enctype ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_use_enctype=yes
-else
-  ac_cv_func_ext_krb5_use_enctype=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_use_enctype" >&5
-$as_echo "$ac_cv_func_ext_krb5_use_enctype" >&6; }
-    LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_use_enctype = yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_USE_ENCTYPE 1
-_ACEOF
-
-fi
-
-
-    ac_check_func_ext_save_LIBS=$LIBS
-    LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_string_to_key" >&5
-$as_echo_n "checking for krb5_string_to_key... " >&6; }
-if ${ac_cv_func_ext_krb5_string_to_key+:} false; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_c_string_to_key" >&5
+$as_echo_n "checking for krb5_c_string_to_key... " >&6; }
+if ${ac_cv_func_ext_krb5_c_string_to_key+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define krb5_string_to_key to an innocuous variant, in case <limits.h> declares krb5_string_to_key.
+/* Define krb5_c_string_to_key to an innocuous variant, in case <limits.h> declares krb5_c_string_to_key.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_string_to_key innocuous_krb5_string_to_key
+#define krb5_c_string_to_key innocuous_krb5_c_string_to_key
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_string_to_key (); below.
+    which can conflict with char krb5_c_string_to_key (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -27377,7 +27971,7 @@ else
 # include <assert.h>
 #endif
 
-#undef krb5_string_to_key
+#undef krb5_c_string_to_key
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -27385,36 +27979,36 @@ else
 #ifdef __cplusplus
 extern "C"
 #endif
-char krb5_string_to_key ();
+char krb5_c_string_to_key ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_string_to_key || defined __stub___krb5_string_to_key
+#if defined __stub_krb5_c_string_to_key || defined __stub___krb5_c_string_to_key
 choke me
 #endif
 
 int
 main ()
 {
-return krb5_string_to_key ();
+return krb5_c_string_to_key ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_string_to_key=yes
+  ac_cv_func_ext_krb5_c_string_to_key=yes
 else
-  ac_cv_func_ext_krb5_string_to_key=no
+  ac_cv_func_ext_krb5_c_string_to_key=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_string_to_key" >&5
-$as_echo "$ac_cv_func_ext_krb5_string_to_key" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_c_string_to_key" >&5
+$as_echo "$ac_cv_func_ext_krb5_c_string_to_key" >&6; }
     LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_string_to_key = yes; then :
+    if test $ac_cv_func_ext_krb5_c_string_to_key = yes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_STRING_TO_KEY 1
+#define HAVE_KRB5_C_STRING_TO_KEY 1
 _ACEOF
 
 fi
@@ -28288,140 +28882,6 @@ $as_echo "$ac_cv_func_ext_krb5_krbhst_get_addrinfo" >&6; }
 #define HAVE_KRB5_KRBHST_GET_ADDRINFO 1
 _ACEOF
 
-fi
-
-
-    ac_check_func_ext_save_LIBS=$LIBS
-    LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_c_enctype_compare" >&5
-$as_echo_n "checking for krb5_c_enctype_compare... " >&6; }
-if ${ac_cv_func_ext_krb5_c_enctype_compare+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define krb5_c_enctype_compare to an innocuous variant, in case <limits.h> declares krb5_c_enctype_compare.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_c_enctype_compare innocuous_krb5_c_enctype_compare
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_c_enctype_compare (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef krb5_c_enctype_compare
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char krb5_c_enctype_compare ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_c_enctype_compare || defined __stub___krb5_c_enctype_compare
-choke me
-#endif
-
-int
-main ()
-{
-return krb5_c_enctype_compare ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_c_enctype_compare=yes
-else
-  ac_cv_func_ext_krb5_c_enctype_compare=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_c_enctype_compare" >&5
-$as_echo "$ac_cv_func_ext_krb5_c_enctype_compare" >&6; }
-    LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_c_enctype_compare = yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_C_ENCTYPE_COMPARE 1
-_ACEOF
-
-fi
-
-
-    ac_check_func_ext_save_LIBS=$LIBS
-    LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_enctypes_compatible_keys" >&5
-$as_echo_n "checking for krb5_enctypes_compatible_keys... " >&6; }
-if ${ac_cv_func_ext_krb5_enctypes_compatible_keys+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define krb5_enctypes_compatible_keys to an innocuous variant, in case <limits.h> declares krb5_enctypes_compatible_keys.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_enctypes_compatible_keys innocuous_krb5_enctypes_compatible_keys
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_enctypes_compatible_keys (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef krb5_enctypes_compatible_keys
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char krb5_enctypes_compatible_keys ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_enctypes_compatible_keys || defined __stub___krb5_enctypes_compatible_keys
-choke me
-#endif
-
-int
-main ()
-{
-return krb5_enctypes_compatible_keys ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_enctypes_compatible_keys=yes
-else
-  ac_cv_func_ext_krb5_enctypes_compatible_keys=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_enctypes_compatible_keys" >&5
-$as_echo "$ac_cv_func_ext_krb5_enctypes_compatible_keys" >&6; }
-    LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_enctypes_compatible_keys = yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_ENCTYPES_COMPATIBLE_KEYS 1
-_ACEOF
-
 fi
 
 
 
     ac_check_func_ext_save_LIBS=$LIBS
     LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_decode_ap_req" >&5
-$as_echo_n "checking for krb5_decode_ap_req... " >&6; }
-if ${ac_cv_func_ext_krb5_decode_ap_req+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define krb5_decode_ap_req to an innocuous variant, in case <limits.h> declares krb5_decode_ap_req.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_decode_ap_req innocuous_krb5_decode_ap_req
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_decode_ap_req (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef krb5_decode_ap_req
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char krb5_decode_ap_req ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_decode_ap_req || defined __stub___krb5_decode_ap_req
-choke me
-#endif
-
-int
-main ()
-{
-return krb5_decode_ap_req ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_decode_ap_req=yes
-else
-  ac_cv_func_ext_krb5_decode_ap_req=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_decode_ap_req" >&5
-$as_echo "$ac_cv_func_ext_krb5_decode_ap_req" >&6; }
-    LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_decode_ap_req = yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_DECODE_AP_REQ 1
-_ACEOF
-
-fi
-
-
-    ac_check_func_ext_save_LIBS=$LIBS
-    LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for free_AP_REQ" >&5
-$as_echo_n "checking for free_AP_REQ... " >&6; }
-if ${ac_cv_func_ext_free_AP_REQ+:} false; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_c_verify_checksum" >&5
+$as_echo_n "checking for krb5_c_verify_checksum... " >&6; }
+if ${ac_cv_func_ext_krb5_c_verify_checksum+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define free_AP_REQ to an innocuous variant, in case <limits.h> declares free_AP_REQ.
+/* Define krb5_c_verify_checksum to an innocuous variant, in case <limits.h> declares krb5_c_verify_checksum.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define free_AP_REQ innocuous_free_AP_REQ
+#define krb5_c_verify_checksum innocuous_krb5_c_verify_checksum
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char free_AP_REQ (); below.
+    which can conflict with char krb5_c_verify_checksum (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -28650,7 +29043,7 @@ else
 # include <assert.h>
 #endif
 
-#undef free_AP_REQ
+#undef krb5_c_verify_checksum
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -28658,36 +29051,36 @@ else
 #ifdef __cplusplus
 extern "C"
 #endif
-char free_AP_REQ ();
+char krb5_c_verify_checksum ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined __stub_free_AP_REQ || defined __stub___free_AP_REQ
+#if defined __stub_krb5_c_verify_checksum || defined __stub___krb5_c_verify_checksum
 choke me
 #endif
 
 int
 main ()
 {
-return free_AP_REQ ();
+return krb5_c_verify_checksum ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_free_AP_REQ=yes
+  ac_cv_func_ext_krb5_c_verify_checksum=yes
 else
-  ac_cv_func_ext_free_AP_REQ=no
+  ac_cv_func_ext_krb5_c_verify_checksum=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_free_AP_REQ" >&5
-$as_echo "$ac_cv_func_ext_free_AP_REQ" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_c_verify_checksum" >&5
+$as_echo "$ac_cv_func_ext_krb5_c_verify_checksum" >&6; }
     LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_free_AP_REQ = yes; then :
+    if test $ac_cv_func_ext_krb5_c_verify_checksum = yes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_FREE_AP_REQ 1
+#define HAVE_KRB5_C_VERIFY_CHECKSUM 1
 _ACEOF
 
 fi
 
     ac_check_func_ext_save_LIBS=$LIBS
     LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_verify_checksum" >&5
-$as_echo_n "checking for krb5_verify_checksum... " >&6; }
-if ${ac_cv_func_ext_krb5_verify_checksum+:} false; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_principal_compare_any_realm" >&5
+$as_echo_n "checking for krb5_principal_compare_any_realm... " >&6; }
+if ${ac_cv_func_ext_krb5_principal_compare_any_realm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define krb5_verify_checksum to an innocuous variant, in case <limits.h> declares krb5_verify_checksum.
+/* Define krb5_principal_compare_any_realm to an innocuous variant, in case <limits.h> declares krb5_principal_compare_any_realm.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_verify_checksum innocuous_krb5_verify_checksum
+#define krb5_principal_compare_any_realm innocuous_krb5_principal_compare_any_realm
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_verify_checksum (); below.
+    which can conflict with char krb5_principal_compare_any_realm (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -28717,7 +29110,7 @@ else
 # include <assert.h>
 #endif
 
-#undef krb5_verify_checksum
+#undef krb5_principal_compare_any_realm
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -28725,36 +29118,36 @@ else
 #ifdef __cplusplus
 extern "C"
 #endif
-char krb5_verify_checksum ();
+char krb5_principal_compare_any_realm ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_verify_checksum || defined __stub___krb5_verify_checksum
+#if defined __stub_krb5_principal_compare_any_realm || defined __stub___krb5_principal_compare_any_realm
 choke me
 #endif
 
 int
 main ()
 {
-return krb5_verify_checksum ();
+return krb5_principal_compare_any_realm ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_verify_checksum=yes
+  ac_cv_func_ext_krb5_principal_compare_any_realm=yes
 else
-  ac_cv_func_ext_krb5_verify_checksum=no
+  ac_cv_func_ext_krb5_principal_compare_any_realm=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_verify_checksum" >&5
-$as_echo "$ac_cv_func_ext_krb5_verify_checksum" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_principal_compare_any_realm" >&5
+$as_echo "$ac_cv_func_ext_krb5_principal_compare_any_realm" >&6; }
     LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_verify_checksum = yes; then :
+    if test $ac_cv_func_ext_krb5_principal_compare_any_realm = yes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_VERIFY_CHECKSUM 1
+#define HAVE_KRB5_PRINCIPAL_COMPARE_ANY_REALM 1
 _ACEOF
 
 fi
 
     ac_check_func_ext_save_LIBS=$LIBS
     LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_c_verify_checksum" >&5
-$as_echo_n "checking for krb5_c_verify_checksum... " >&6; }
-if ${ac_cv_func_ext_krb5_c_verify_checksum+:} false; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_parse_name_norealm" >&5
+$as_echo_n "checking for krb5_parse_name_norealm... " >&6; }
+if ${ac_cv_func_ext_krb5_parse_name_norealm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define krb5_c_verify_checksum to an innocuous variant, in case <limits.h> declares krb5_c_verify_checksum.
+/* Define krb5_parse_name_norealm to an innocuous variant, in case <limits.h> declares krb5_parse_name_norealm.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_c_verify_checksum innocuous_krb5_c_verify_checksum
+#define krb5_parse_name_norealm innocuous_krb5_parse_name_norealm
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_c_verify_checksum (); below.
+    which can conflict with char krb5_parse_name_norealm (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -28784,7 +29177,7 @@ else
 # include <assert.h>
 #endif
 
-#undef krb5_c_verify_checksum
+#undef krb5_parse_name_norealm
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -28792,36 +29185,36 @@ else
 #ifdef __cplusplus
 extern "C"
 #endif
-char krb5_c_verify_checksum ();
+char krb5_parse_name_norealm ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_c_verify_checksum || defined __stub___krb5_c_verify_checksum
+#if defined __stub_krb5_parse_name_norealm || defined __stub___krb5_parse_name_norealm
 choke me
 #endif
 
 int
 main ()
 {
-return krb5_c_verify_checksum ();
+return krb5_parse_name_norealm ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_c_verify_checksum=yes
+  ac_cv_func_ext_krb5_parse_name_norealm=yes
 else
-  ac_cv_func_ext_krb5_c_verify_checksum=no
+  ac_cv_func_ext_krb5_parse_name_norealm=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_c_verify_checksum" >&5
-$as_echo "$ac_cv_func_ext_krb5_c_verify_checksum" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_parse_name_norealm" >&5
+$as_echo "$ac_cv_func_ext_krb5_parse_name_norealm" >&6; }
     LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_c_verify_checksum = yes; then :
+    if test $ac_cv_func_ext_krb5_parse_name_norealm = yes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_C_VERIFY_CHECKSUM 1
+#define HAVE_KRB5_PARSE_NAME_NOREALM 1
 _ACEOF
 
 fi
 
     ac_check_func_ext_save_LIBS=$LIBS
     LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_principal_compare_any_realm" >&5
-$as_echo_n "checking for krb5_principal_compare_any_realm... " >&6; }
-if ${ac_cv_func_ext_krb5_principal_compare_any_realm+:} false; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_princ_size" >&5
+$as_echo_n "checking for krb5_princ_size... " >&6; }
+if ${ac_cv_func_ext_krb5_princ_size+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define krb5_principal_compare_any_realm to an innocuous variant, in case <limits.h> declares krb5_principal_compare_any_realm.
+/* Define krb5_princ_size to an innocuous variant, in case <limits.h> declares krb5_princ_size.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_principal_compare_any_realm innocuous_krb5_principal_compare_any_realm
+#define krb5_princ_size innocuous_krb5_princ_size
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_principal_compare_any_realm (); below.
+    which can conflict with char krb5_princ_size (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -28851,7 +29244,7 @@ else
 # include <assert.h>
 #endif
 
-#undef krb5_principal_compare_any_realm
+#undef krb5_princ_size
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -28859,36 +29252,36 @@ else
 #ifdef __cplusplus
 extern "C"
 #endif
-char krb5_principal_compare_any_realm ();
+char krb5_princ_size ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_principal_compare_any_realm || defined __stub___krb5_principal_compare_any_realm
+#if defined __stub_krb5_princ_size || defined __stub___krb5_princ_size
 choke me
 #endif
 
 int
 main ()
 {
-return krb5_principal_compare_any_realm ();
+return krb5_princ_size ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_principal_compare_any_realm=yes
+  ac_cv_func_ext_krb5_princ_size=yes
 else
-  ac_cv_func_ext_krb5_principal_compare_any_realm=no
+  ac_cv_func_ext_krb5_princ_size=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_principal_compare_any_realm" >&5
-$as_echo "$ac_cv_func_ext_krb5_principal_compare_any_realm" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_princ_size" >&5
+$as_echo "$ac_cv_func_ext_krb5_princ_size" >&6; }
     LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_principal_compare_any_realm = yes; then :
+    if test $ac_cv_func_ext_krb5_princ_size = yes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_PRINCIPAL_COMPARE_ANY_REALM 1
+#define HAVE_KRB5_PRINC_SIZE 1
 _ACEOF
 
 fi
 
     ac_check_func_ext_save_LIBS=$LIBS
     LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_parse_name_norealm" >&5
-$as_echo_n "checking for krb5_parse_name_norealm... " >&6; }
-if ${ac_cv_func_ext_krb5_parse_name_norealm+:} false; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_make_principal" >&5
+$as_echo_n "checking for krb5_make_principal... " >&6; }
+if ${ac_cv_func_ext_krb5_make_principal+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define krb5_parse_name_norealm to an innocuous variant, in case <limits.h> declares krb5_parse_name_norealm.
+/* Define krb5_make_principal to an innocuous variant, in case <limits.h> declares krb5_make_principal.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_parse_name_norealm innocuous_krb5_parse_name_norealm
+#define krb5_make_principal innocuous_krb5_make_principal
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_parse_name_norealm (); below.
+    which can conflict with char krb5_make_principal (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -28918,7 +29311,7 @@ else
 # include <assert.h>
 #endif
 
-#undef krb5_parse_name_norealm
+#undef krb5_make_principal
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -28926,36 +29319,36 @@ else
 #ifdef __cplusplus
 extern "C"
 #endif
-char krb5_parse_name_norealm ();
+char krb5_make_principal ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_parse_name_norealm || defined __stub___krb5_parse_name_norealm
+#if defined __stub_krb5_make_principal || defined __stub___krb5_make_principal
 choke me
 #endif
 
 int
 main ()
 {
-return krb5_parse_name_norealm ();
+return krb5_make_principal ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_parse_name_norealm=yes
+  ac_cv_func_ext_krb5_make_principal=yes
 else
-  ac_cv_func_ext_krb5_parse_name_norealm=no
+  ac_cv_func_ext_krb5_make_principal=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_parse_name_norealm" >&5
-$as_echo "$ac_cv_func_ext_krb5_parse_name_norealm" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_make_principal" >&5
+$as_echo "$ac_cv_func_ext_krb5_make_principal" >&6; }
     LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_parse_name_norealm = yes; then :
+    if test $ac_cv_func_ext_krb5_make_principal = yes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_PARSE_NAME_NOREALM 1
+#define HAVE_KRB5_MAKE_PRINCIPAL 1
 _ACEOF
 
 fi
 
     ac_check_func_ext_save_LIBS=$LIBS
     LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_princ_size" >&5
-$as_echo_n "checking for krb5_princ_size... " >&6; }
-if ${ac_cv_func_ext_krb5_princ_size+:} false; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_principal_get_num_comp" >&5
+$as_echo_n "checking for krb5_principal_get_num_comp... " >&6; }
+if ${ac_cv_func_ext_krb5_principal_get_num_comp+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define krb5_princ_size to an innocuous variant, in case <limits.h> declares krb5_princ_size.
+/* Define krb5_principal_get_num_comp to an innocuous variant, in case <limits.h> declares krb5_principal_get_num_comp.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_princ_size innocuous_krb5_princ_size
+#define krb5_principal_get_num_comp innocuous_krb5_principal_get_num_comp
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_princ_size (); below.
+    which can conflict with char krb5_principal_get_num_comp (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -28985,7 +29378,7 @@ else
 # include <assert.h>
 #endif
 
-#undef krb5_princ_size
+#undef krb5_principal_get_num_comp
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -28993,36 +29386,36 @@ else
 #ifdef __cplusplus
 extern "C"
 #endif
-char krb5_princ_size ();
+char krb5_principal_get_num_comp ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_princ_size || defined __stub___krb5_princ_size
+#if defined __stub_krb5_principal_get_num_comp || defined __stub___krb5_principal_get_num_comp
 choke me
 #endif
 
 int
 main ()
 {
-return krb5_princ_size ();
+return krb5_principal_get_num_comp ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_princ_size=yes
+  ac_cv_func_ext_krb5_principal_get_num_comp=yes
 else
-  ac_cv_func_ext_krb5_princ_size=no
+  ac_cv_func_ext_krb5_principal_get_num_comp=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_princ_size" >&5
-$as_echo "$ac_cv_func_ext_krb5_princ_size" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_principal_get_num_comp" >&5
+$as_echo "$ac_cv_func_ext_krb5_principal_get_num_comp" >&6; }
     LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_princ_size = yes; then :
+    if test $ac_cv_func_ext_krb5_principal_get_num_comp = yes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_PRINC_SIZE 1
+#define HAVE_KRB5_PRINCIPAL_GET_NUM_COMP 1
 _ACEOF
 
 fi
@@ -29159,73 +29552,6 @@ $as_echo "$ac_cv_func_ext_krb5_get_renewed_creds" >&6; }
 #define HAVE_KRB5_GET_RENEWED_CREDS 1
 _ACEOF
 
-fi
-
-
-    ac_check_func_ext_save_LIBS=$LIBS
-    LIBS="$KRB5_LIBS $LIBS"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_get_kdc_cred" >&5
-$as_echo_n "checking for krb5_get_kdc_cred... " >&6; }
-if ${ac_cv_func_ext_krb5_get_kdc_cred+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define krb5_get_kdc_cred to an innocuous variant, in case <limits.h> declares krb5_get_kdc_cred.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define krb5_get_kdc_cred innocuous_krb5_get_kdc_cred
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char krb5_get_kdc_cred (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef krb5_get_kdc_cred
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char krb5_get_kdc_cred ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_krb5_get_kdc_cred || defined __stub___krb5_get_kdc_cred
-choke me
-#endif
-
-int
-main ()
-{
-return krb5_get_kdc_cred ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_ext_krb5_get_kdc_cred=yes
-else
-  ac_cv_func_ext_krb5_get_kdc_cred=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_get_kdc_cred" >&5
-$as_echo "$ac_cv_func_ext_krb5_get_kdc_cred" >&6; }
-    LIBS=$ac_check_func_ext_save_LIBS
-    if test $ac_cv_func_ext_krb5_get_kdc_cred = yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_GET_KDC_CRED 1
-_ACEOF
-
 fi
 
 
@@ -30164,6 +30490,542 @@ $as_echo "$ac_cv_func_ext_krb5_free_host_realm" >&6; }
 #define HAVE_KRB5_FREE_HOST_REALM 1
 _ACEOF
 
+fi
+
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_get_init_creds_keytab" >&5
+$as_echo_n "checking for krb5_get_init_creds_keytab... " >&6; }
+if ${ac_cv_func_ext_krb5_get_init_creds_keytab+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define krb5_get_init_creds_keytab to an innocuous variant, in case <limits.h> declares krb5_get_init_creds_keytab.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define krb5_get_init_creds_keytab innocuous_krb5_get_init_creds_keytab
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char krb5_get_init_creds_keytab (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef krb5_get_init_creds_keytab
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_get_init_creds_keytab ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_krb5_get_init_creds_keytab || defined __stub___krb5_get_init_creds_keytab
+choke me
+#endif
+
+int
+main ()
+{
+return krb5_get_init_creds_keytab ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_krb5_get_init_creds_keytab=yes
+else
+  ac_cv_func_ext_krb5_get_init_creds_keytab=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_get_init_creds_keytab" >&5
+$as_echo "$ac_cv_func_ext_krb5_get_init_creds_keytab" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_krb5_get_init_creds_keytab = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_KRB5_GET_INIT_CREDS_KEYTAB 1
+_ACEOF
+
+fi
+
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_build_principal_alloc_va" >&5
+$as_echo_n "checking for krb5_build_principal_alloc_va... " >&6; }
+if ${ac_cv_func_ext_krb5_build_principal_alloc_va+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define krb5_build_principal_alloc_va to an innocuous variant, in case <limits.h> declares krb5_build_principal_alloc_va.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define krb5_build_principal_alloc_va innocuous_krb5_build_principal_alloc_va
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char krb5_build_principal_alloc_va (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef krb5_build_principal_alloc_va
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_build_principal_alloc_va ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_krb5_build_principal_alloc_va || defined __stub___krb5_build_principal_alloc_va
+choke me
+#endif
+
+int
+main ()
+{
+return krb5_build_principal_alloc_va ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_krb5_build_principal_alloc_va=yes
+else
+  ac_cv_func_ext_krb5_build_principal_alloc_va=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_build_principal_alloc_va" >&5
+$as_echo "$ac_cv_func_ext_krb5_build_principal_alloc_va" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_krb5_build_principal_alloc_va = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_KRB5_BUILD_PRINCIPAL_ALLOC_VA 1
+_ACEOF
+
+fi
+
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_cc_get_lifetime" >&5
+$as_echo_n "checking for krb5_cc_get_lifetime... " >&6; }
+if ${ac_cv_func_ext_krb5_cc_get_lifetime+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define krb5_cc_get_lifetime to an innocuous variant, in case <limits.h> declares krb5_cc_get_lifetime.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define krb5_cc_get_lifetime innocuous_krb5_cc_get_lifetime
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char krb5_cc_get_lifetime (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef krb5_cc_get_lifetime
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_cc_get_lifetime ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_krb5_cc_get_lifetime || defined __stub___krb5_cc_get_lifetime
+choke me
+#endif
+
+int
+main ()
+{
+return krb5_cc_get_lifetime ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_krb5_cc_get_lifetime=yes
+else
+  ac_cv_func_ext_krb5_cc_get_lifetime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_cc_get_lifetime" >&5
+$as_echo "$ac_cv_func_ext_krb5_cc_get_lifetime" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_krb5_cc_get_lifetime = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_KRB5_CC_GET_LIFETIME 1
+_ACEOF
+
+fi
+
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_cc_retrieve_cred" >&5
+$as_echo_n "checking for krb5_cc_retrieve_cred... " >&6; }
+if ${ac_cv_func_ext_krb5_cc_retrieve_cred+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define krb5_cc_retrieve_cred to an innocuous variant, in case <limits.h> declares krb5_cc_retrieve_cred.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define krb5_cc_retrieve_cred innocuous_krb5_cc_retrieve_cred
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char krb5_cc_retrieve_cred (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef krb5_cc_retrieve_cred
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_cc_retrieve_cred ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_krb5_cc_retrieve_cred || defined __stub___krb5_cc_retrieve_cred
+choke me
+#endif
+
+int
+main ()
+{
+return krb5_cc_retrieve_cred ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_krb5_cc_retrieve_cred=yes
+else
+  ac_cv_func_ext_krb5_cc_retrieve_cred=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_cc_retrieve_cred" >&5
+$as_echo "$ac_cv_func_ext_krb5_cc_retrieve_cred" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_krb5_cc_retrieve_cred = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_KRB5_CC_RETRIEVE_CRED 1
+_ACEOF
+
+fi
+
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_free_checksum_contents" >&5
+$as_echo_n "checking for krb5_free_checksum_contents... " >&6; }
+if ${ac_cv_func_ext_krb5_free_checksum_contents+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define krb5_free_checksum_contents to an innocuous variant, in case <limits.h> declares krb5_free_checksum_contents.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define krb5_free_checksum_contents innocuous_krb5_free_checksum_contents
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char krb5_free_checksum_contents (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef krb5_free_checksum_contents
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_free_checksum_contents ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_krb5_free_checksum_contents || defined __stub___krb5_free_checksum_contents
+choke me
+#endif
+
+int
+main ()
+{
+return krb5_free_checksum_contents ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_krb5_free_checksum_contents=yes
+else
+  ac_cv_func_ext_krb5_free_checksum_contents=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_free_checksum_contents" >&5
+$as_echo "$ac_cv_func_ext_krb5_free_checksum_contents" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_krb5_free_checksum_contents = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_KRB5_FREE_CHECKSUM_CONTENTS 1
+_ACEOF
+
+fi
+
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_create_checksum" >&5
+$as_echo_n "checking for krb5_create_checksum... " >&6; }
+if ${ac_cv_func_ext_krb5_create_checksum+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define krb5_create_checksum to an innocuous variant, in case <limits.h> declares krb5_create_checksum.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define krb5_create_checksum innocuous_krb5_create_checksum
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char krb5_create_checksum (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef krb5_create_checksum
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_create_checksum ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_krb5_create_checksum || defined __stub___krb5_create_checksum
+choke me
+#endif
+
+int
+main ()
+{
+return krb5_create_checksum ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_krb5_create_checksum=yes
+else
+  ac_cv_func_ext_krb5_create_checksum=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_create_checksum" >&5
+$as_echo "$ac_cv_func_ext_krb5_create_checksum" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_krb5_create_checksum = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_KRB5_CREATE_CHECKSUM 1
+_ACEOF
+
+fi
+
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_c_make_checksum" >&5
+$as_echo_n "checking for krb5_c_make_checksum... " >&6; }
+if ${ac_cv_func_ext_krb5_c_make_checksum+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define krb5_c_make_checksum to an innocuous variant, in case <limits.h> declares krb5_c_make_checksum.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define krb5_c_make_checksum innocuous_krb5_c_make_checksum
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char krb5_c_make_checksum (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef krb5_c_make_checksum
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_c_make_checksum ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_krb5_c_make_checksum || defined __stub___krb5_c_make_checksum
+choke me
+#endif
+
+int
+main ()
+{
+return krb5_c_make_checksum ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_krb5_c_make_checksum=yes
+else
+  ac_cv_func_ext_krb5_c_make_checksum=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_krb5_c_make_checksum" >&5
+$as_echo "$ac_cv_func_ext_krb5_c_make_checksum" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_krb5_c_make_checksum = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_KRB5_C_MAKE_CHECKSUM 1
+_ACEOF
+
+fi
+
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_krb5_import_cred" >&5
+$as_echo_n "checking for gss_krb5_import_cred... " >&6; }
+if ${ac_cv_func_ext_gss_krb5_import_cred+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define gss_krb5_import_cred to an innocuous variant, in case <limits.h> declares gss_krb5_import_cred.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gss_krb5_import_cred innocuous_gss_krb5_import_cred
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gss_krb5_import_cred (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gss_krb5_import_cred
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gss_krb5_import_cred ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gss_krb5_import_cred || defined __stub___gss_krb5_import_cred
+choke me
+#endif
+
+int
+main ()
+{
+return gss_krb5_import_cred ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_gss_krb5_import_cred=yes
+else
+  ac_cv_func_ext_gss_krb5_import_cred=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_gss_krb5_import_cred" >&5
+$as_echo "$ac_cv_func_ext_gss_krb5_import_cred" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_gss_krb5_import_cred = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GSS_KRB5_IMPORT_CRED 1
+_ACEOF
+
 fi
 
 
@@ -30233,79 +31095,371 @@ _ACEOF
 
 fi
 
-  # MIT krb5 1.8 does not expose this call (yet)
-  ac_fn_c_check_decl "$LINENO" "krb5_get_credentials_for_user" "ac_cv_have_decl_krb5_get_credentials_for_user" "#include <krb5.h>
-"
-if test "x$ac_cv_have_decl_krb5_get_credentials_for_user" = xyes; then :
-  ac_have_decl=1
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gsskrb5_extract_authz_data_from_sec_context" >&5
+$as_echo_n "checking for gsskrb5_extract_authz_data_from_sec_context... " >&6; }
+if ${ac_cv_func_ext_gsskrb5_extract_authz_data_from_sec_context+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_have_decl=0
-fi
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define gsskrb5_extract_authz_data_from_sec_context to an innocuous variant, in case <limits.h> declares gsskrb5_extract_authz_data_from_sec_context.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gsskrb5_extract_authz_data_from_sec_context innocuous_gsskrb5_extract_authz_data_from_sec_context
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_KRB5_GET_CREDENTIALS_FOR_USER $ac_have_decl
-_ACEOF
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gsskrb5_extract_authz_data_from_sec_context (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
-  # MIT krb5 1.7beta3 (in Ubuntu Karmic) does not have this declaration
-  # but does have the symbol
-  ac_fn_c_check_decl "$LINENO" "krb5_auth_con_set_req_cksumtype" "ac_cv_have_decl_krb5_auth_con_set_req_cksumtype" "#include <krb5.h>
-"
-if test "x$ac_cv_have_decl_krb5_auth_con_set_req_cksumtype" = xyes; then :
-  ac_have_decl=1
+#undef gsskrb5_extract_authz_data_from_sec_context
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gsskrb5_extract_authz_data_from_sec_context ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gsskrb5_extract_authz_data_from_sec_context || defined __stub___gsskrb5_extract_authz_data_from_sec_context
+choke me
+#endif
+
+int
+main ()
+{
+return gsskrb5_extract_authz_data_from_sec_context ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_gsskrb5_extract_authz_data_from_sec_context=yes
 else
-  ac_have_decl=0
+  ac_cv_func_ext_gsskrb5_extract_authz_data_from_sec_context=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_gsskrb5_extract_authz_data_from_sec_context" >&5
+$as_echo "$ac_cv_func_ext_gsskrb5_extract_authz_data_from_sec_context" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_gsskrb5_extract_authz_data_from_sec_context = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GSSKRB5_EXTRACT_AUTHZ_DATA_FROM_SEC_CONTEXT 1
+_ACEOF
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_KRB5_AUTH_CON_SET_REQ_CKSUMTYPE $ac_have_decl
+fi
+
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_mech_krb5" >&5
+$as_echo_n "checking for gss_mech_krb5... " >&6; }
+if ${ac_cv_func_ext_gss_mech_krb5+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define gss_mech_krb5 to an innocuous variant, in case <limits.h> declares gss_mech_krb5.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gss_mech_krb5 innocuous_gss_mech_krb5
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gss_mech_krb5 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gss_mech_krb5
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gss_mech_krb5 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gss_mech_krb5 || defined __stub___gss_mech_krb5
+choke me
+#endif
+
+int
+main ()
+{
+return gss_mech_krb5 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_gss_mech_krb5=yes
+else
+  ac_cv_func_ext_gss_mech_krb5=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_gss_mech_krb5" >&5
+$as_echo "$ac_cv_func_ext_gss_mech_krb5" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_gss_mech_krb5 = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GSS_MECH_KRB5 1
 _ACEOF
 
+fi
 
-  LIBS="$KRB5_LIBS $LIBS"
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether krb5_ticket contains kvno and enctype" >&5
-$as_echo_n "checking whether krb5_ticket contains kvno and enctype... " >&6; }
-if ${smb_krb5_cv_ticket_has_keyinfo+:} false; then :
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_oid_equal" >&5
+$as_echo_n "checking for gss_oid_equal... " >&6; }
+if ${ac_cv_func_ext_gss_oid_equal+:} false; then :
   $as_echo_n "(cached) " >&6
 else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define gss_oid_equal to an innocuous variant, in case <limits.h> declares gss_oid_equal.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gss_oid_equal innocuous_gss_oid_equal
 
-           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gss_oid_equal (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gss_oid_equal
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gss_oid_equal ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gss_oid_equal || defined __stub___gss_oid_equal
+choke me
+#endif
+
+int
+main ()
+{
+return gss_oid_equal ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_gss_oid_equal=yes
+else
+  ac_cv_func_ext_gss_oid_equal=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_gss_oid_equal" >&5
+$as_echo "$ac_cv_func_ext_gss_oid_equal" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_gss_oid_equal = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GSS_OID_EQUAL 1
+_ACEOF
+
+fi
+
+
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_inquire_sec_context_by_oid" >&5
+$as_echo_n "checking for gss_inquire_sec_context_by_oid... " >&6; }
+if ${ac_cv_func_ext_gss_inquire_sec_context_by_oid+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+/* Define gss_inquire_sec_context_by_oid to an innocuous variant, in case <limits.h> declares gss_inquire_sec_context_by_oid.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gss_inquire_sec_context_by_oid innocuous_gss_inquire_sec_context_by_oid
 
-               #include <krb5.h>
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gss_inquire_sec_context_by_oid (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gss_inquire_sec_context_by_oid
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gss_inquire_sec_context_by_oid ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gss_inquire_sec_context_by_oid || defined __stub___gss_inquire_sec_context_by_oid
+choke me
+#endif
 
 int
 main ()
 {
+return gss_inquire_sec_context_by_oid ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_gss_inquire_sec_context_by_oid=yes
+else
+  ac_cv_func_ext_gss_inquire_sec_context_by_oid=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_gss_inquire_sec_context_by_oid" >&5
+$as_echo "$ac_cv_func_ext_gss_inquire_sec_context_by_oid" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_gss_inquire_sec_context_by_oid = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GSS_INQUIRE_SEC_CONTEXT_BY_OID 1
+_ACEOF
 
-               krb5_ticket ticket;
-               krb5_kvno kvno;
-               krb5_enctype enctype;
+fi
 
-               enctype = ticket.enc_part.enctype;
-               kvno = ticket.enc_part.kvno;
 
+    ac_check_func_ext_save_LIBS=$LIBS
+    LIBS="$KRB5_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_wrap_iov" >&5
+$as_echo_n "checking for gss_wrap_iov... " >&6; }
+if ${ac_cv_func_ext_gss_wrap_iov+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define gss_wrap_iov to an innocuous variant, in case <limits.h> declares gss_wrap_iov.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gss_wrap_iov innocuous_gss_wrap_iov
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gss_wrap_iov (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gss_wrap_iov
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gss_wrap_iov ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gss_wrap_iov || defined __stub___gss_wrap_iov
+choke me
+#endif
+
+int
+main ()
+{
+return gss_wrap_iov ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-   smb_krb5_cv_ticket_has_keyinfo=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_ext_gss_wrap_iov=yes
 else
-   smb_krb5_cv_ticket_has_keyinfo=no
+  ac_cv_func_ext_gss_wrap_iov=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_ext_gss_wrap_iov" >&5
+$as_echo "$ac_cv_func_ext_gss_wrap_iov" >&6; }
+    LIBS=$ac_check_func_ext_save_LIBS
+    if test $ac_cv_func_ext_gss_wrap_iov = yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GSS_WRAP_IOV 1
+_ACEOF
+
+fi
+
+  # MIT krb5 1.8 does not expose this call (yet)
+  ac_fn_c_check_decl "$LINENO" "krb5_get_credentials_for_user" "ac_cv_have_decl_krb5_get_credentials_for_user" "#include <krb5.h>
+"
+if test "x$ac_cv_have_decl_krb5_get_credentials_for_user" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_KRB5_GET_CREDENTIALS_FOR_USER $ac_have_decl
+_ACEOF
+
 
+  # MIT krb5 1.7beta3 (in Ubuntu Karmic) does not have this declaration
+  # but does have the symbol
+  ac_fn_c_check_decl "$LINENO" "krb5_auth_con_set_req_cksumtype" "ac_cv_have_decl_krb5_auth_con_set_req_cksumtype" "#include <krb5.h>
+"
+if test "x$ac_cv_have_decl_krb5_auth_con_set_req_cksumtype" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smb_krb5_cv_ticket_has_keyinfo" >&5
-$as_echo "$smb_krb5_cv_ticket_has_keyinfo" >&6; }
 
-  if test x"$smb_krb5_cv_ticket_has_keyinfo" = x"yes" ; then
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_KRB5_AUTH_CON_SET_REQ_CKSUMTYPE $ac_have_decl
+_ACEOF
 
-$as_echo "#define KRB5_TICKET_HAS_KEYINFO 1" >>confdefs.h
 
-  fi
+  LIBS="$KRB5_LIBS $LIBS"
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether krb5_get_init_creds_opt_free takes a context argument" >&5
 $as_echo_n "checking whether krb5_get_init_creds_opt_free takes a context argument... " >&6; }
@@ -30347,40 +31501,6 @@ $as_echo "#define KRB5_CREDS_OPT_FREE_REQUIRES_CONTEXT 1" >>confdefs.h
 
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether krb5_verify_checksum takes 7 arguments" >&5
-$as_echo_n "checking whether krb5_verify_checksum takes 7 arguments... " >&6; }
-if ${smb_krb5_cv_verify_checksum+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-       #include <krb5.h>
-int
-main ()
-{
-krb5_verify_checksum(0, 0, 0, 0, 0, 0, 0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  smb_krb5_cv_verify_checksum=7
-else
-  smb_krb5_cv_verify_checksum=6
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smb_krb5_cv_verify_checksum" >&5
-$as_echo "$smb_krb5_cv_verify_checksum" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define KRB5_VERIFY_CHECKSUM_ARGS $smb_krb5_cv_verify_checksum
-_ACEOF
-
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for checksum in krb5_checksum" >&5
 $as_echo_n "checking for checksum in krb5_checksum... " >&6; }
 if ${samba_cv_HAVE_CHECKSUM_IN_KRB5_CHECKSUM+:} false; then :
@@ -30546,39 +31666,6 @@ $as_echo "#define HAVE_KRB5_CRYPTO 1" >>confdefs.h
 
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_encrypt_block type" >&5
-$as_echo_n "checking for krb5_encrypt_block type... " >&6; }
-if ${samba_cv_HAVE_KRB5_ENCRYPT_BLOCK+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <krb5.h>
-int
-main ()
-{
-krb5_encrypt_block block;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_KRB5_ENCRYPT_BLOCK=yes
-else
-  samba_cv_HAVE_KRB5_ENCRYPT_BLOCK=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_KRB5_ENCRYPT_BLOCK" >&5
-$as_echo "$samba_cv_HAVE_KRB5_ENCRYPT_BLOCK" >&6; }
-
-  if test x"$samba_cv_HAVE_KRB5_ENCRYPT_BLOCK" = x"yes"; then
-
-$as_echo "#define HAVE_KRB5_ENCRYPT_BLOCK 1" >>confdefs.h
-
-  fi
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addrtype in krb5_address" >&5
 $as_echo_n "checking for addrtype in krb5_address... " >&6; }
 if ${samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS+:} false; then :
@@ -30645,104 +31732,6 @@ $as_echo "#define HAVE_ADDR_TYPE_IN_KRB5_ADDRESS 1" >>confdefs.h
 
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for enc_part2 in krb5_ticket" >&5
-$as_echo_n "checking for enc_part2 in krb5_ticket... " >&6; }
-if ${samba_cv_HAVE_KRB5_TKT_ENC_PART2+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <krb5.h>
-int
-main ()
-{
-krb5_ticket tkt; tkt.enc_part2->authorization_data[0]->contents = NULL;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_KRB5_TKT_ENC_PART2=yes
-else
-  samba_cv_HAVE_KRB5_TKT_ENC_PART2=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_KRB5_TKT_ENC_PART2" >&5
-$as_echo "$samba_cv_HAVE_KRB5_TKT_ENC_PART2" >&6; }
-
-  if test x"$samba_cv_HAVE_KRB5_TKT_ENC_PART2" = x"yes"; then
-
-$as_echo "#define HAVE_KRB5_TKT_ENC_PART2 1" >>confdefs.h
-
-  fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for keyblock in krb5_creds" >&5
-$as_echo_n "checking for keyblock in krb5_creds... " >&6; }
-if ${samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <krb5.h>
-int
-main ()
-{
-krb5_creds creds; krb5_keyblock kb; creds.keyblock = kb;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS=yes
-else
-  samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS" >&5
-$as_echo "$samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS" >&6; }
-
-  if test x"$samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS" = x"yes"; then
-
-$as_echo "#define HAVE_KRB5_KEYBLOCK_IN_CREDS 1" >>confdefs.h
-
-  fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for session in krb5_creds" >&5
-$as_echo_n "checking for session in krb5_creds... " >&6; }
-if ${samba_cv_HAVE_KRB5_SESSION_IN_CREDS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <krb5.h>
-int
-main ()
-{
-krb5_creds creds; krb5_keyblock kb; creds.session = kb;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_KRB5_SESSION_IN_CREDS=yes
-else
-  samba_cv_HAVE_KRB5_SESSION_IN_CREDS=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_KRB5_SESSION_IN_CREDS" >&5
-$as_echo "$samba_cv_HAVE_KRB5_SESSION_IN_CREDS" >&6; }
-
-  if test x"$samba_cv_HAVE_KRB5_SESSION_IN_CREDS" = x"yes"; then
-
-$as_echo "#define HAVE_KRB5_SESSION_IN_CREDS 1" >>confdefs.h
-
-  fi
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for keyvalue in krb5_keyblock" >&5
 $as_echo_n "checking for keyvalue in krb5_keyblock... " >&6; }
 if ${samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE+:} false; then :
@@ -31345,40 +32334,6 @@ $as_echo "#define HAVE_KRB5_ADDRESSES 1" >>confdefs.h
 
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether krb5_mk_error takes 3 arguments MIT or 9 Heimdal" >&5
-$as_echo_n "checking whether krb5_mk_error takes 3 arguments MIT or 9 Heimdal... " >&6; }
-if ${samba_cv_HAVE_SHORT_KRB5_MK_ERROR_INTERFACE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <krb5.h>
-int
-main ()
-{
-
-    krb5_mk_error(0,0,0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_SHORT_KRB5_MK_ERROR_INTERFACE=yes
-else
-  samba_cv_HAVE_SHORT_KRB5_MK_ERROR_INTERFACE=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_SHORT_KRB5_MK_ERROR_INTERFACE" >&5
-$as_echo "$samba_cv_HAVE_SHORT_KRB5_MK_ERROR_INTERFACE" >&6; }
-
-  if test x"$samba_cv_HAVE_SHORT_KRB5_MK_ERROR_INTERFACE" = x"yes"; then
-
-$as_echo "#define HAVE_SHORT_KRB5_MK_ERROR_INTERFACE 1" >>confdefs.h
-
-  fi
-
   if test x"$ac_cv_func_ext_krb5_enctype_to_string" = x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_error_code krb5_enctype_to_string(krb5_context context, krb5_enctype enctype, char **str)" >&5
 $as_echo_n "checking for krb5_error_code krb5_enctype_to_string(krb5_context context, krb5_enctype enctype, char **str)... " >&6; }
@@ -31576,6 +32531,72 @@ $as_echo "#define HAVE_KRB5_PRINC_REALM 1" >>confdefs.h
 
   fi
 
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KRB5_PDU_NONE declaration" >&5
+$as_echo_n "checking for KRB5_PDU_NONE declaration... " >&6; }
+if ${ac_cv_have_KRB5_PDU_NONE_decl+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <krb5.h>
+int
+main ()
+{
+int i = (int)KRB5_PDU_NONE
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_have_KRB5_PDU_NONE_decl=yes
+else
+  ac_cv_have_KRB5_PDU_NONE_decl=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_KRB5_PDU_NONE_decl" >&5
+$as_echo "$ac_cv_have_KRB5_PDU_NONE_decl" >&6; }
+ if test x"$ac_cv_have_KRB5_PDU_NONE_decl" = x"yes"; then
+
+$as_echo "#define HAVE_KRB5_PDU_NONE_DECL 1" >>confdefs.h
+
+ fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flags in krb5_creds" >&5
+$as_echo_n "checking for flags in krb5_creds... " >&6; }
+if ${samba_cv_HAVE_FLAGS_IN_KRB5_CREDS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <krb5.h>
+int
+main ()
+{
+krb5_creds creds; creds.flags.b.initial = 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_HAVE_FLAGS_IN_KRB5_CREDS=yes
+else
+  samba_cv_HAVE_FLAGS_IN_KRB5_CREDS=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_FLAGS_IN_KRB5_CREDS" >&5
+$as_echo "$samba_cv_HAVE_FLAGS_IN_KRB5_CREDS" >&6; }
+
+  if test x"$samba_cv_HAVE_FLAGS_IN_KRB5_CREDS" = x"yes"; then
+
+$as_echo "#define HAVE_FLAGS_IN_KRB5_CREDS 1" >>confdefs.h
+
+  fi
   #
   #
   # Now the decisions whether we can support krb5
@@ -31589,20 +32610,79 @@ $as_echo "$as_me: WARNING: arcfour-hmac-md5 encryption type not found in -lkrb5"
     use_ads=no
   fi
 
+  if test x"$ac_cv_func_ext_krb5_set_real_time" != x"yes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5_set_real_time encryption type not found in -lkrb5" >&5
+$as_echo "$as_me: WARNING: krb5_set_real_time encryption type not found in -lkrb5" >&2;}
+    use_ads=no
+  fi
+
   if test x"$ac_cv_lib_ext_krb5_krb5_mk_req_extended" != x"yes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5_mk_req_extended not found in -lkrb5" >&5
 $as_echo "$as_me: WARNING: krb5_mk_req_extended not found in -lkrb5" >&2;}
     use_ads=no
   fi
 
-  if test x"$ac_cv_func_ext_krb5_principal2salt" != x"yes" -a \
-          x"$ac_cv_func_ext_krb5_get_pw_salt" != x"yes"
+  if test x"$ac_cv_func_ext_krb5_get_host_realm" != x"yes"
   then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no CREATE_KEY_FUNCTIONS detected" >&5
-$as_echo "$as_me: WARNING: no CREATE_KEY_FUNCTIONS detected" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5_get_host_realm not found in -lkrb5" >&5
+$as_echo "$as_me: WARNING: krb5_get_host_realm not found in -lkrb5" >&2;}
+    use_ads=no
+  fi
+
+  if test x"$ac_cv_func_ext_krb5_free_host_realm" != x"yes"
+  then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5_free_host_realm not found in -lkrb5" >&5
+$as_echo "$as_me: WARNING: krb5_free_host_realm not found in -lkrb5" >&2;}
     use_ads=no
   fi
 
+  if test x"$ac_cv_func_ext_krb5_fwd_tgt_creds" != x"yes"
+  then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5_fwd_tgt_creds not found in -lkrb5" >&5
+$as_echo "$as_me: WARNING: krb5_fwd_tgt_creds not found in -lkrb5" >&2;}
+    use_ads=no
+  fi
+
+  if test x"$ac_cv_func_ext_krb5_get_init_creds_opt_alloc" != x"yes"
+  then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5_get_init_creds_opt_alloc found in -lkrb5" >&5
+$as_echo "$as_me: WARNING: krb5_get_init_creds_opt_alloc found in -lkrb5" >&2;}
+    use_ads=no
+  fi
+
+  if test x"$smb_krb5_cv_creds_opt_free_context" != x"yes"
+  then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5_get_init_creds_opt_free not found or was too old in -lkrb5" >&5
+$as_echo "$as_me: WARNING: krb5_get_init_creds_opt_free not found or was too old in -lkrb5" >&2;}
+    use_ads=no
+  fi
+
+  if test x"$ac_cv_func_ext_krb5_get_renewed_creds" != x"yes"
+  then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5_get_renewed_creds not found in -lkrb5" >&5
+$as_echo "$as_me: WARNING: krb5_get_renewed_creds not found in -lkrb5" >&2;}
+    use_ads=no
+  fi
+
+  if test x"$ac_cv_func_ext_krb5_principal_compare_any_realm" != x"yes"
+  then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5_principal_compare_any_realm not found in -lkrb5" >&5
+$as_echo "$as_me: WARNING: krb5_principal_compare_any_realm not found in -lkrb5" >&2;}
+    use_ads=no
+  fi
+
+  if test x"$ac_cv_func_ext_krb5_principal2salt" != x"yes" -o \
+         x"$ac_cv_func_ext_krb5_c_string_to_key" != x"yes"
+  then
+       if test x"$ac_cv_func_ext_krb5_get_pw_salt" != x"yes" -o \
+            x"$ac_cv_func_ext_krb5_string_to_key_salt" != x"yes"
+       then
+             { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no CREATE_KEY_FUNCTIONS detected" >&5
+$as_echo "$as_me: WARNING: no CREATE_KEY_FUNCTIONS detected" >&2;}
+             use_ads=no
+       fi
+  fi
+
   if test x"$ac_cv_func_ext_krb5_get_permitted_enctypes" != x"yes" -a \
           x"$ac_cv_func_ext_krb5_get_default_in_tkt_etypes" != x"yes"
   then
@@ -31619,33 +32699,27 @@ $as_echo "$as_me: WARNING: no KT_FREE_FUNCTION detected" >&2;}
     use_ads=no
   fi
 
-  if test x"$ac_cv_func_ext_krb5_c_verify_checksum" != x"yes" -a \
-          x"$ac_cv_func_ext_krb5_verify_checksum" != x"yes"
+  if test x"$ac_cv_func_ext_krb5_c_verify_checksum" != x"yes"
   then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no KRB5_VERIFY_CHECKSUM_FUNCTION detected" >&5
-$as_echo "$as_me: WARNING: no KRB5_VERIFY_CHECKSUM_FUNCTION detected" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5_c_verify_checksum not found in -lkrb5" >&5
+$as_echo "$as_me: WARNING: krb5_c_verify_checksum not found in -lkrb5" >&2;}
     use_ads=no
   fi
 
-  if test x"$smb_krb5_cv_ticket_has_keyinfo" != x"yes" ; then
-
-      # We only need the following functions if we can't get the enctype
-      # and kvno out of the ticket directly (ie. on Heimdal).
-
-      if test x"$ac_cv_func_ext_free_AP_REQ" != x"yes"
-      then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no KRB5_AP_REQ_FREE_FUNCTION detected" >&5
-$as_echo "$as_me: WARNING: no KRB5_AP_REQ_FREE_FUNCTION detected" >&2;}
-       use_ads=no
-      fi
-
-      if test x"$ac_cv_func_ext_krb5_decode_ap_req" != x"yes"
-      then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no KRB5_AP_REQ_DECODING_FUNCTION detected" >&5
-$as_echo "$as_me: WARNING: no KRB5_AP_REQ_DECODING_FUNCTION detected" >&2;}
-       use_ads=no
-      fi
+  if test x"$ac_cv_func_ext_gss_wrap_iov" != x"yes" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gss_wrap_iov not found in -lgssapi" >&5
+$as_echo "$as_me: WARNING: gss_wrap_iov not found in -lgssapi" >&2;}
+    use_ads=no
+  fi
 
+  if test x"$ac_cv_func_ext_gss_get_name_attribute" != x"yes" ; then
+    if test x"$ac_cv_func_ext_gsskrb5_extract_authz_data_from_sec_context" != x"yes" -o \
+            x"$ac_cv_func_ext_gss_inquire_sec_context_by_oid" != x"yes"
+    then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: need either gss_get_name_attribute or gsskrb5_extract_authz_data_from_sec_context and gss_inquire_sec_context_by_oid in -lgssapi for PAC support" >&5
+$as_echo "$as_me: WARNING: need either gss_get_name_attribute or gsskrb5_extract_authz_data_from_sec_context and gss_inquire_sec_context_by_oid in -lgssapi for PAC support" >&2;}
+      use_ads=no
+    fi
   fi
 
   if test x"$use_ads" = x"yes"; then
@@ -31655,11 +32729,6 @@ $as_echo "#define WITH_ADS 1" >>confdefs.h
 
 $as_echo "#define HAVE_KRB5 1" >>confdefs.h
 
-    if test x"$have_gssapi" = x"yes"; then
-
-$as_echo "#define HAVE_GSSAPI 1" >>confdefs.h
-
-    fi
   else
     if test x"$with_ads_support" = x"yes"; then
        as_fn_error $? "krb5 libs don't have all features required for Active Directory support" "$LINENO" 5
@@ -31687,6 +32756,11 @@ grep -v '#define HAVE_GSSAPI_GSSAPI_H ' confdefs.h |grep -v '#define HAVE_GSSAPI
 cat confdefs.h.tmp > confdefs.h
 rm confdefs.h.tmp
 
+
+grep -v '#define HAVE_GSSAPI ' confdefs.h |grep -v '#define HAVE_GSSAPI$'>confdefs.h.tmp
+cat confdefs.h.tmp > confdefs.h
+rm confdefs.h.tmp
+
     KRB5_LIBS=""
     with_ads_support=no
   fi
@@ -31698,10 +32772,6 @@ $as_echo "$use_ads" >&6; }
 LIBS="$ac_save_LIBS"
 fi
 
-if test x"$use_ads" != xyes; then
-       smbtorture4_possible=no
-fi
-
 
 
 ac_check_lib_ext_save_LIBS=$LIBS
@@ -31796,7 +32866,7 @@ if test x"$with_dnsupdate_support" != x"no"; then
 
   ################################################################
   # first test for AD / GSSAPI support being enabled
-       if test x"$have_gssapi" != xyes ; then
+       if test x"$have_gssapi" != xyes -o x"$use_ads" != xyes ; then
                if test x"$with_dnsupdate_support" = x"yes" ; then
                        as_fn_error $? "DNS Updates support only possible with AD and GSSAPI support" "$LINENO" 5
                else
@@ -31805,170 +32875,14 @@ $as_echo "$as_me: DNS Updates support only possible with AD and GSSAPI support"
                        with_dnsupdate_support=no
                fi
        fi
-  ##################################################################
-  # then test for uuid.h (necessary to generate unique DNS keynames
-  # (uuid.h is required for this test)
-       for ac_header in uuid/uuid.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UUID_UUID_H 1
-_ACEOF
-
-fi
-
-done
-
-
-
-       if test x"$ac_cv_header_uuid_uuid_h" != x"yes"; then
-               if test x"$with_dnsupdate_support" = x"yes"; then
-                       as_fn_error $? "uuid.h is needed to enable DNS Updates support" "$LINENO" 5
-               else
-                       { $as_echo "$as_me:${as_lineno-$LINENO}: uuid.h is needed to enable DNS Updates support" >&5
-$as_echo "$as_me: uuid.h is needed to enable DNS Updates support" >&6;}
-               fi
-               with_dnsupdate_support=no
-       fi
 fi
 
 if test x"$with_dnsupdate_support" != x"no"; then
 
-  ########################################################
-  # Now see if we can find the uuid libs in standard paths
-  # On some systems, the uuid API is in libc, so we have to
-  # be careful not to insert a spurious -luuid.
-
-  UUID_LIBS=""
-
-  for ac_func in uuid_generate
-do :
-  ac_fn_c_check_func "$LINENO" "uuid_generate" "ac_cv_func_uuid_generate"
-if test "x$ac_cv_func_uuid_generate" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UUID_GENERATE 1
-_ACEOF
-
-        # uuid_generate was found in libc or existing $LIBS
-
-
-           case " $LIBS " in
-               *\ -luuid\ *)
-               UUID_LIBS="-luuid"
-
-    LIBS=`echo $LIBS | sed '-es/-luuid//g'`
-
-               ;;
-           esac
-
-           with_dnsupdate_support=yes
-
 $as_echo "#define WITH_DNS_UPDATES 1" >>confdefs.h
 
-
-
-
-else
-
-        # uuid_generate was not found, try adding libuuid
-       case " $LIBS " in
-          *\ -luuid\ *)
-
-
-           if test x"$with_dnsupdate_support" = x"yes"; then
-               as_fn_error $? "libuuid is needed to enable DNS Updates support" "$LINENO" 5
-           else
-               { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libuuid is needed to enable DNS Updates support" >&5
-$as_echo "$as_me: WARNING: libuuid is needed to enable DNS Updates support" >&2;}
-           fi
-           with_dnsupdate_support=no
-
-
-           ;;
-          *)
-           # uuid_generate was not found, try adding libuuid
-           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
-$as_echo_n "checking for uuid_generate in -luuid... " >&6; }
-if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-luuid  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char uuid_generate ();
-int
-main ()
-{
-return uuid_generate ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_uuid_uuid_generate=yes
-else
-  ac_cv_lib_uuid_uuid_generate=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
-$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
-
-               LIBS="-luuid $LIBS"
 
-
-           case " $LIBS " in
-               *\ -luuid\ *)
-               UUID_LIBS="-luuid"
-
-    LIBS=`echo $LIBS | sed '-es/-luuid//g'`
-
-               ;;
-           esac
-
-           with_dnsupdate_support=yes
-
-$as_echo "#define WITH_DNS_UPDATES 1" >>confdefs.h
-
-
-
-
-else
-
-
-
-           if test x"$with_dnsupdate_support" = x"yes"; then
-               as_fn_error $? "libuuid is needed to enable DNS Updates support" "$LINENO" 5
-           else
-               { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libuuid is needed to enable DNS Updates support" >&5
-$as_echo "$as_me: WARNING: libuuid is needed to enable DNS Updates support" >&2;}
-           fi
-           with_dnsupdate_support=no
-
-
-
-fi
-
-         ;;
-        esac
-
-fi
-done
-
-
-fi
   # finally print out the result:
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether DNS Updates support is used" >&5
 $as_echo_n "checking whether DNS Updates support is used... " >&6; }
 # 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
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to try disk-quotas support" >&5
@@ -32574,98 +33484,32 @@ if test "${with_quotas+set}" = set; then :
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
     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)
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto" >&5
 $as_echo "auto" >&6; }
     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)
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
     samba_cv_WITH_QUOTAS=no
-    samba_cv_TRY_QUOTAS=no
-    samba_cv_RUN_QUOTA_TESTS=no
-    ;;
-  *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${samba_cv_TRY_QUOTAS}" >&5
-$as_echo "${samba_cv_TRY_QUOTAS}" >&6; }
-    ;;
-  esac
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${samba_cv_TRY_QUOTAS}" >&5
-$as_echo "${samba_cv_TRY_QUOTAS}" >&6; }
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to try the new lib/sysquotas.c interface" >&5
-$as_echo_n "checking whether to try the new lib/sysquotas.c interface... " >&6; }
-
-# Check whether --with-sys-quotas was given.
-if test "${with_sys_quotas+set}" = set; then :
-  withval=$with_sys_quotas;  case "$withval" in
-  yes)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    samba_cv_WITH_SYS_QUOTAS=yes
-    samba_cv_TRY_SYS_QUOTAS=yes
-    samba_cv_RUN_QUOTA_TESTS=yes
-    ;;
-  auto)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto" >&5
-$as_echo "auto" >&6; }
-    samba_cv_WITH_SYS_QUOTAS=auto
-    samba_cv_TRY_SYS_QUOTAS=auto
-    samba_cv_RUN_QUOTA_TESTS=auto
-    ;;
-  no)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    samba_cv_WITH_SYS_QUOTAS=no
-    samba_cv_TRY_SYS_QUOTAS=no
     ;;
   *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${samba_cv_TRY_SYS_QUOTAS}" >&5
-$as_echo "${samba_cv_TRY_SYS_QUOTAS}" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${samba_cv_WITH_QUOTAS}" >&5
+$as_echo "${samba_cv_WITH_QUOTAS}" >&6; }
     ;;
   esac
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${samba_cv_TRY_SYS_QUOTAS}" >&5
-$as_echo "${samba_cv_TRY_SYS_QUOTAS}" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${samba_cv_WITH_QUOTAS}" >&5
+$as_echo "${samba_cv_WITH_QUOTAS}" >&6; }
 
 fi
 
 
-if test x"$samba_cv_TRY_SYS_QUOTAS" = x"auto"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to try the lib/sysquotas.c interface on ${host_os}" >&5
-$as_echo_n "checking whether to try the lib/sysquotas.c interface on ${host_os}... " >&6; }
-  case "$host_os" in
-       *linux*)
-           { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-            samba_cv_TRY_SYS_QUOTAS=yes
-            samba_cv_RUN_QUOTA_TESTS=yes
-           ;;
-       *)
-           { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-            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
@@ -32674,16 +33518,11 @@ case "$host_os" in
 
 $as_echo "#define HAVE_QUOTACTL_LINUX 1" >>confdefs.h
 
-           samba_cv_sysquotas_file="lib/sysquotas_linux.c"
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use the lib/sysquotas_linux.c builtin support" >&5
 $as_echo_n "checking whether to use the lib/sysquotas_linux.c builtin support... " >&6; }
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-
-$as_echo "#define HAVE_LINUX_XFS_QUOTAS 1" >>confdefs.h
-
-           samba_cv_found_xfs_header=yes
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use the lib/sysquotas_xfs.c builtin support" >&5
 $as_echo_n "checking whether to use the lib/sysquotas_xfs.c builtin support... " >&6; }
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 done
 
 
-# For quotas on Linux XFS filesystems
-for ac_header in linux/dqblk_xfs.h
+# For quotas on XFS filesystems, Linux style
+for ac_header in xfs/xqm.h
 do :
-  ac_fn_c_check_header_mongrel "$LINENO" "linux/dqblk_xfs.h" "ac_cv_header_linux_dqblk_xfs_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_dqblk_xfs_h" = xyes; then :
+  ac_fn_c_check_header_mongrel "$LINENO" "xfs/xqm.h" "ac_cv_header_xfs_xqm_h" "$ac_includes_default"
+if test "x$ac_cv_header_xfs_xqm_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LINUX_DQBLK_XFS_H 1
+#define HAVE_XFS_XQM_H 1
 _ACEOF
 
+
+$as_echo "#define HAVE_XFS_QUOTAS 1" >>confdefs.h
+
+
 fi
 
 done
 done
 
 
-if test x"$samba_cv_found_xfs_header" != x"yes"; then
+# For quotas on BSD systems
+for ac_header in ufs/ufs/quota.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "ufs/ufs/quota.h" "ac_cv_header_ufs_ufs_quota_h" "$ac_includes_default"
+if test "x$ac_cv_header_ufs_ufs_quota_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_UFS_UFS_QUOTA_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+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
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XFS QUOTA in <sys/quota.h>" >&5
 $as_echo_n "checking for XFS QUOTA in <sys/quota.h>... " >&6; }
@@ -32793,7 +33651,9 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_SYS_QUOTA_XFS" >&5
 $as_echo "$samba_cv_HAVE_SYS_QUOTA_XFS" >&6; }
 if test "$samba_cv_HAVE_SYS_QUOTA_XFS"x = "yes"x; then
-       samba_cv_found_xfs_header=yes
+
+$as_echo "#define HAVE_XFS_QUOTAS 1" >>confdefs.h
+
 fi
 fi
 
@@ -32866,7 +33726,7 @@ else
 #define HAVE_QUOTACTL_4A 1
 #define AUTOCONF_TEST 1
 #include "confdefs.h"
-#include "${srcdir-.}/../tests/sysquotas.c"
+#include "${srcdir-.}/../../tests/sysquotas.c"
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   samba_cv_HAVE_QUOTACTL_4A=yes
@@ -32895,7 +33755,6 @@ if test x"$samba_cv_HAVE_QUOTACTL_4A" = x"yes"; then
 
 $as_echo "#define HAVE_QUOTACTL_4A 1" >>confdefs.h
 
-    samba_cv_sysquotas_file="lib/sysquotas_4A.c"
 fi
 fi
 
@@ -32925,7 +33784,7 @@ else
 #define HAVE_QUOTACTL_4B 1
 #define AUTOCONF_TEST 1
 #include "confdefs.h"
-#include "${srcdir-.}/../tests/sysquotas.c"
+#include "${srcdir-.}/../../tests/sysquotas.c"
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   samba_cv_HAVE_QUOTACTL_4B=yes
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_QUOTACTL_4B" >&5
 $as_echo "$samba_cv_HAVE_QUOTACTL_4B" >&6; }
 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;
 
 $as_echo "#define HAVE_QUOTACTL_4B 1" >>confdefs.h
 
-    samba_cv_sysquotas_file="lib/sysquotas_4B.c"
+    ac_fn_c_check_member "$LINENO" "struct dqblk" "dqb_curbytes" "ac_cv_member_struct_dqblk_dqb_curbytes" "#include <sys/types.h>
+       #include <sys/quota.h>
+"
+if test "x$ac_cv_member_struct_dqblk_dqb_curbytes" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_DQBLK_DQB_CURBYTES 1
+_ACEOF
+
+# Darwin bytecount style
+
+$as_echo "#define HAVE_STRUCT_DQBLK_DQB_CURBYTES 1" >>confdefs.h
+
+fi
+
+
 fi
 fi
 
-if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRAY int quotactl (char *spec, int request, char *arg)" >&5
-$as_echo_n "checking for CRAY int quotactl (char *spec, int request, char *arg)... " >&6; }
-if ${samba_cv_HAVE_QUOTACTL_3+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NFS QUOTAS" >&5
+$as_echo_n "checking for NFS QUOTAS... " >&6; }
+if ${samba_cv_HAVE_NFS_QUOTAS+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-
-       old_CFLAGS="$CFLAGS";
-       CFLAGS="$CFLAGS $Werror_FLAGS";
-       export CFLAGS;
-       old_CPPFLAGS="$CPPFLAGS";
-       CPPFLAGS="$CPPFLAGS";
-       export CPPFLAGS;
-       old_LDFLAGS="$LDFLAGS";
-       LDFLAGS="$LDFLAGS";
-       export LDFLAGS;
-       if test "$cross_compiling" = yes; then :
-  samba_cv_HAVE_QUOTACTL_3=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#define HAVE_QUOTACTL_3 1
-#define AUTOCONF_TEST 1
-#include "confdefs.h"
-#include "${srcdir-.}/../tests/sysquotas.c"
+#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>
+
+int
+main ()
+{
+clnt_create("", RQUOTAPROG, RQUOTAVERS, "udp");
+  ;
+  return 0;
+}
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  samba_cv_HAVE_QUOTACTL_3=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  samba_cv_HAVE_NFS_QUOTAS=yes
 else
-  samba_cv_HAVE_QUOTACTL_3=no
+  samba_cv_HAVE_NFS_QUOTAS=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_NFS_QUOTAS" >&5
+$as_echo "$samba_cv_HAVE_NFS_QUOTAS" >&6; }
 
-       CFLAGS="$old_CFLAGS";
-       old_CFLAGS="";
-       export CFLAGS;
-       CPPFLAGS="$old_CPPFLAGS";
-       old_CPPFLAGS="";
-       export CPPFLAGS;
-       LDFLAGS="$old_LDFLAGS";
-       old_LDFLAGS="";
-       export LDFLAGS;
+if test x"$samba_cv_HAVE_NFS_QUOTAS" = x"yes"; then
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_QUOTACTL_3" >&5
-$as_echo "$samba_cv_HAVE_QUOTACTL_3" >&6; }
-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;
+$as_echo "#define HAVE_NFS_QUOTAS 1" >>confdefs.h
+
+    ac_fn_c_check_member "$LINENO" "struct getquota_rslt" "getquota_rslt_u" "ac_cv_member_struct_getquota_rslt_getquota_rslt_u" "#include <rpcsvc/rquota.h>
+"
+if test "x$ac_cv_member_struct_getquota_rslt_getquota_rslt_u" = xyes; then :
 
-$as_echo "#define HAVE_QUOTACTL_3 1" >>confdefs.h
+$as_echo "#define HAVE_GETQUOTA_RSLT_GETQUOTA_RSLT_U 1" >>confdefs.h
 
-    samba_cv_sysquotas_file="lib/sysquotas_3.c"
 fi
+
 fi
 
 #################################################
 done
 
 
-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
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the sys_quota interface works" >&5
-$as_echo_n "checking whether the sys_quota interface works... " >&6; }
-if ${samba_cv_SYSQUOTA_WORKS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#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"
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_SYSQUOTA_WORKS=yes
-else
-  samba_cv_SYSQUOTA_WORKS=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CPPFLAGS="$SAVE_CPPFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_SYSQUOTA_WORKS" >&5
-$as_echo "$samba_cv_SYSQUOTA_WORKS" >&6; }
-if test x"$samba_cv_SYSQUOTA_WORKS" = x"yes"; then
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use the new lib/sysquotas.c interface" >&5
 $as_echo_n "checking whether to use the new lib/sysquotas.c interface... " >&6; }
-    if test x"$samba_cv_TRY_SYS_QUOTAS" != x"no"; then
-
-$as_echo "#define WITH_QUOTAS 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_SYS_QUOTAS 1" >>confdefs.h
-
-       samba_cv_WE_USE_SYS_QUOTAS=yes
+if test x"$samba_cv_SYSQUOTA_FOUND" = x"yes"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-    else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    fi
-fi
-fi
-
-if test x"$samba_cv_SYSQUOTA_FOUND" != x"no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the sys_quota interface works with NFS" >&5
-$as_echo_n "checking whether the sys_quota interface works with NFS... " >&6; }
-if ${samba_cv_SYSQUOTA_WORKS_NFS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#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"
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_SYSQUOTA_WORKS_NFS=yes
-else
-  samba_cv_SYSQUOTA_WORKS_NFS=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CPPFLAGS="$SAVE_CPPFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_SYSQUOTA_WORKS_NFS" >&5
-$as_echo "$samba_cv_SYSQUOTA_WORKS_NFS" >&6; }
-if test x"$samba_cv_SYSQUOTA_WORKS_NFS" = x"yes"; then
-    if test x"$samba_cv_WE_USE_SYS_QUOTAS" = x"yes"; then
-
-$as_echo "#define HAVE_NFS_QUOTAS 1" >>confdefs.h
-
-    fi
-fi
-fi
 
-if test x"$samba_cv_SYSQUOTA_FOUND" != x"no" -a x"$samba_cv_found_xfs_header" = x"yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the sys_quota interface works with XFS" >&5
-$as_echo_n "checking whether the sys_quota interface works with XFS... " >&6; }
-if ${samba_cv_SYSQUOTA_WORKS_XFS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#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"
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_SYSQUOTA_WORKS_XFS=yes
-else
-  samba_cv_SYSQUOTA_WORKS_XFS=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CPPFLAGS="$SAVE_CPPFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_SYSQUOTA_WORKS_XFS" >&5
-$as_echo "$samba_cv_SYSQUOTA_WORKS_XFS" >&6; }
-if test x"$samba_cv_SYSQUOTA_WORKS_XFS" = x"yes"; then
-    if test x"$samba_cv_WE_USE_SYS_QUOTAS" = x"yes"; then
-
-$as_echo "#define HAVE_XFS_QUOTAS 1" >>confdefs.h
-
-    fi
-fi
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the old quota support works" >&5
-$as_echo_n "checking whether the old quota support works... " >&6; }
-if ${samba_cv_QUOTA_WORKS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+$as_echo "#define WITH_QUOTAS 1" >>confdefs.h
 
-#include "confdefs.h"
-#define NO_PROTO_H 1
-#define NO_CONFIG_H 1
-#include "${srcdir-.}/smbd/quotas.c"
 
-int
-main ()
-{
+$as_echo "#define HAVE_SYS_QUOTAS 1" >>confdefs.h
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_QUOTA_WORKS=yes
 else
-  samba_cv_QUOTA_WORKS=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CPPFLAGS="$SAVE_CPPFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_QUOTA_WORKS" >&5
-$as_echo "$samba_cv_QUOTA_WORKS" >&6; }
-if test x"$samba_cv_QUOTA_WORKS" = x"yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use the old quota support" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use the old quota support" >&5
 $as_echo_n "checking whether to use the old quota support... " >&6; }
-    if test x"$samba_cv_WE_USE_SYS_QUOTAS" != x"yes"; then
-      if test x"$samba_cv_TRY_QUOTAS" != x"no"; then
+    if test x"$samba_cv_WITH_QUOTAS" = x"yes"; then
 
 $as_echo "#define WITH_QUOTAS 1" >>confdefs.h
 
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      fi
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
     fi
 fi
 
 ####################
-# End of quota check samba_cv_RUN_QUOTA_TESTS
+# End of quota check samba_cv_WITH_QUOTAS
 fi
 
 #################################################
@@ -33330,6 +33998,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
 $as_echo "$as_me: checking how to get filesystem space usage..." >&6;}
 space=no
 
-# Test for statvfs64.
-if test $space = no; then
-  # SVR4
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking statvfs64 function (SVR4)" >&5
-$as_echo_n "checking statvfs64 function (SVR4)... " >&6; }
-if ${fu_cv_sys_stat_statvfs64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  fu_cv_sys_stat_statvfs64=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-#include <sys/statvfs.h>
-  main ()
-  {
-    struct statvfs64 fsd;
-    exit (statvfs64 (".", &fsd));
-  }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  fu_cv_sys_stat_statvfs64=yes
-else
-  fu_cv_sys_stat_statvfs64=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statvfs64" >&5
-$as_echo "$fu_cv_sys_stat_statvfs64" >&6; }
-  if test $fu_cv_sys_stat_statvfs64 = yes; then
-    space=yes
-
-$as_echo "#define STAT_STATVFS64 1" >>confdefs.h
-
-  fi
-fi
-
 # Perform only the link test since it seems there are no variants of the
 # statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
 # because that got a false positive on SCO OSR5.  Adding the declaration
@@ -33596,7 +34224,7 @@ else
   {
     struct statfs fsd;
     fsd.f_fsize = 0;
-    exit (statfs (".", &fsd, sizeof (struct statfs)));
+    return (statfs (".", &fsd, sizeof (struct statfs)));
   }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -33646,7 +34274,7 @@ else
   {
   struct statfs fsd;
   fsd.f_bsize = 0;
-  exit (statfs (".", &fsd));
+  return (statfs (".", &fsd));
   }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -33687,7 +34315,7 @@ else
   main ()
   {
   struct statfs fsd;
-  exit (statfs (".", &fsd, sizeof fsd, 0));
+  return (statfs (".", &fsd, sizeof fsd, 0));
   }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -33734,7 +34362,7 @@ else
   {
   struct statfs fsd;
   fsd.f_fsize = 0;
-  exit (statfs (".", &fsd));
+  return (statfs (".", &fsd));
   }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -33785,7 +34413,7 @@ else
   struct fs_data fsd;
   /* Ultrix's statfs returns 1 for success,
      0 for not mounted, -1 for failure.  */
-  exit (statfs (".", &fsd) != 1);
+  return (statfs (".", &fsd) != 1);
   }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -33809,48 +34437,6 @@ $as_echo "#define STAT_STATFS2_FS_DATA 1" >>confdefs.h
   fi
 fi
 
-#
-# As a gating factor for large file support, in order to
-# use <4GB files we must have the following minimal support
-# available.
-# long long, and a 64 bit off_t or off64_t.
-# If we don't have all of these then disable large
-# file support.
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if large file support can be enabled" >&5
-$as_echo_n "checking if large file support can be enabled... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
-#include <sys/types.h>
-#else
-__COMPILE_ERROR_
-#endif
-
-int
-main ()
-{
-int i
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes
-else
-  samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
-
-$as_echo "#define HAVE_EXPLICIT_LARGEFILE_SUPPORT 1" >>confdefs.h
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" >&5
-$as_echo "$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" >&6; }
-
-
 #################################################
 # check for cluster extensions
 
@@ -33905,7 +34491,7 @@ ctdb_broken="no"
 SAVED_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS} $CTDB_CPPFLAGS"
 
-for ac_header in ctdb.h ctdb_private.h
+for ac_header in ctdb.h ctdb_private.h ctdb_protocol.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
@@ -33938,7 +34524,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"
@@ -34051,6 +34637,125 @@ $as_echo "$as_me: WARNING: ignoring missing SCHEDULE_FOR_DELETION (--enable-old-
        fi
 fi
 
+if test "x$have_cluster_support" = "xyes" ; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CTDB_CONTROL_CHECK_SRVIDS declaration" >&5
+$as_echo_n "checking for CTDB_CONTROL_CHECK_SRVIDS declaration... " >&6; }
+if ${ac_cv_have_CTDB_CONTROL_CHECK_SRVIDS_decl+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #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>
+
+int
+main ()
+{
+int i = (int)CTDB_CONTROL_CHECK_SRVIDS
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_have_CTDB_CONTROL_CHECK_SRVIDS_decl=yes
+else
+  ac_cv_have_CTDB_CONTROL_CHECK_SRVIDS_decl=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_CTDB_CONTROL_CHECK_SRVIDS_decl" >&5
+$as_echo "$ac_cv_have_CTDB_CONTROL_CHECK_SRVIDS_decl" >&6; }
+ if test x"$ac_cv_have_CTDB_CONTROL_CHECK_SRVIDS_decl" = x"yes"; then
+
+$as_echo "#define HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL 1" >>confdefs.h
+
+ fi
+
+       if test x"$ac_cv_have_CTDB_CONTROL_CHECK_SRVIDS_decl" != x"yes"
+       then
+               if test "x$enable_old_ctdb" = "xyes" ; then
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ignoring missing CHECK_SRVIDS (--enable-old-ctdb)" >&5
+$as_echo "$as_me: WARNING: ignoring missing CHECK_SRVIDS (--enable-old-ctdb)" >&2;}
+               else
+                       ctdb_broken="support for CHECK_SRVIDS control missing"
+                       have_cluster_support=no
+               fi
+       fi
+fi
+
+# Check whether --enable-ctdb-readonly-records was given.
+if test "${enable_ctdb_readonly_records+set}" = set; then :
+  enableval=$enable_ctdb_readonly_records; want_ctdb_readonly=$enableval
+else
+  want_ctdb_readonly=yes
+fi
+
+
+if test "x$have_cluster_support" = "xyes" -a "x$want_ctdb_readonly" = "xyes" ; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CTDB_WANT_READONLY declaration" >&5
+$as_echo_n "checking for CTDB_WANT_READONLY declaration... " >&6; }
+if ${ac_cv_have_CTDB_WANT_READONLY_decl+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #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>
+
+int
+main ()
+{
+int i = (int)CTDB_WANT_READONLY
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_have_CTDB_WANT_READONLY_decl=yes
+else
+  ac_cv_have_CTDB_WANT_READONLY_decl=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_CTDB_WANT_READONLY_decl" >&5
+$as_echo "$ac_cv_have_CTDB_WANT_READONLY_decl" >&6; }
+ if test x"$ac_cv_have_CTDB_WANT_READONLY_decl" = x"yes"; then
+
+$as_echo "#define HAVE_CTDB_WANT_READONLY_DECL 1" >>confdefs.h
+
+ fi
+
+
+       if test "x$ac_cv_have_CTDB_WANT_READONLY_decl" != "xyes" ; then
+               if test "x$enable_old_ctdb" = "xyes" ; then
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ignoring missing READONLY support (--enable-old-ctdb)" >&5
+$as_echo "$as_me: WARNING: ignoring missing READONLY support (--enable-old-ctdb)" >&2;}
+               else
+                       ctdb_broken="support for CTDB readonly records missing"
+                       have_cluster_support=no
+               fi
+       fi
+fi
+
 if test "x$have_cluster_support" = "xyes" ; then
        # In ctdb 1.0.57, ctdb_control_tcp was temporarily renamed
        # to ctdb_tcp_client.
@@ -34214,9 +34919,6 @@ $as_echo "$with_acl_support" >&6; }
 if test x"$with_acl_support" = x"no"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling ACL support" >&5
 $as_echo "Disabling ACL support" >&6; }
-
-$as_echo "#define HAVE_NO_ACLS 1" >>confdefs.h
-
 else
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ACL support is available:" >&5
 $as_echo "$as_me: checking whether ACL support is available:" >&6;}
@@ -34274,9 +34976,6 @@ $as_echo "#define HAVE_TRU64_ACLS 1" >>confdefs.h
        *darwin*)
                { $as_echo "$as_me:${as_lineno-$LINENO}: ACLs on Darwin currently not supported" >&5
 $as_echo "$as_me: ACLs on Darwin currently not supported" >&6;}
-
-$as_echo "#define HAVE_NO_ACLS 1" >>confdefs.h
-
                ;;
        *)
                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lacl" >&5
@@ -34455,9 +35154,6 @@ $as_echo "#define HAVE_ACL_GET_PERM_NP 1" >>confdefs.h
                else
                        { $as_echo "$as_me:${as_lineno-$LINENO}: ACL support is not avaliable" >&5
 $as_echo "$as_me: ACL support is not avaliable" >&6;}
-
-$as_echo "#define HAVE_NO_ACLS 1" >>confdefs.h
-
                fi
                ;;
         esac
@@ -34487,18 +35183,28 @@ esac
 #################################################
 # check for AIO support
 
+with_aio=auto
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support asynchronous io" >&5
 $as_echo_n "checking whether to support asynchronous io... " >&6; }
 
 # Check whether --with-aio-support was given.
 if test "${with_aio_support+set}" = set; then :
-  withval=$with_aio_support;  case "$withval" in
-  yes)
+  withval=$with_aio_support;   case "$withval" in
+    yes|no)
+       with_aio=$withval
+       ;;
+   esac
+fi
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-       case "$host_os" in
-       *)
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aio" >&5
+$as_echo "$with_aio" >&6; }
+
+if test x"$with_aio" = x"no"; then
+
+$as_echo "#define HAVE_NO_AIO 1" >>confdefs.h
+
+else
                AIO_LIBS=$LIBS
                no_rt_LIBS=$LIBS
                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aio_read in -lrt" >&5
@@ -34613,53 +35319,11 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_AIO" >&5
 $as_echo "$samba_cv_HAVE_AIO" >&6; }
-               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit asynchronous io support" >&5
-$as_echo_n "checking for 64-bit asynchronous io support... " >&6; }
-if ${samba_cv_HAVE_AIO64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-               aio_LIBS=$LIBS
-               LIBS=$AIO_LIBS
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <aio.h>
-int
-main ()
-{
- struct aiocb64 a; return aio_read64(&a);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  samba_cv_HAVE_AIO64=yes
-else
-  samba_cv_HAVE_AIO64=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-               LIBS=$aio_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_AIO64" >&5
-$as_echo "$samba_cv_HAVE_AIO64" >&6; }
-               if test x"$samba_cv_HAVE_AIO64" = x"yes"; then
-
-$as_echo "#define HAVE_AIOCB64 1" >>confdefs.h
-
-
-$as_echo "#define WITH_AIO 1" >>confdefs.h
-
-                       LIBS=$AIO_LIBS
-               elif test x"$samba_cv_HAVE_AIO" = x"yes"; then
+               if test x"$samba_cv_HAVE_AIO" = x"yes"; then
 
-$as_echo "#define WITH_AIO 1" >>confdefs.h
+$as_echo "#define HAVE_AIO 1" >>confdefs.h
 
                        LIBS=$AIO_LIBS
-               fi
-
-               if test x"$samba_cv_HAVE_AIO" = x"yes"; then
                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aio_read" >&5
 $as_echo_n "checking for aio_read... " >&6; }
                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -34779,7 +35443,7 @@ $as_echo_n "checking for aio_suspend... " >&6; }
                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <aio.h>
-int main() { struct aiocb a; struct timespec t; return aio_suspend(&a, 1, &t); }
+int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
 
@@ -34792,168 +35456,119 @@ $as_echo "no" >&6; }
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-               fi
+               else
 
-               if test x"$samba_cv_HAVE_AIO64" = x"yes"; then
-                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aio_read64" >&5
-$as_echo_n "checking for aio_read64... " >&6; }
-                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <aio.h>
-int main() { struct aiocb a; return aio_read64(&a); }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+$as_echo "#define HAVE_NO_AIO 1" >>confdefs.h
 
-$as_echo "#define HAVE_AIO_READ64 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+               fi
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
-                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aio_write64" >&5
-$as_echo_n "checking for aio_write64... " >&6; }
-                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <aio.h>
-int main() { struct aiocb a; return aio_write64(&a); }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
 
-$as_echo "#define HAVE_AIO_WRITE64 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+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
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
-                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aio_fsync64" >&5
-$as_echo_n "checking for aio_fsync64... " >&6; }
-                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <aio.h>
-int main() { struct aiocb a; return aio_fsync64(1, &a); }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
 
-$as_echo "#define HAVE_AIO_FSYNC64 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+# Check for Linux kernel aio support.
+case "$host_os" in
+*linux*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_submit in -laio" >&5
+$as_echo_n "checking for io_submit in -laio... " >&6; }
+if ${ac_cv_lib_aio_io_submit+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
-                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aio_return64" >&5
-$as_echo_n "checking for aio_return64... " >&6; }
-                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-laio  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <aio.h>
-int main() { struct aiocb a; return aio_return64(&a); }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-$as_echo "#define HAVE_AIO_RETURN64 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aio_error64" >&5
-$as_echo_n "checking for aio_error64... " >&6; }
-                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <aio.h>
-int main() { struct aiocb a; return aio_error64(&a); }
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char io_submit ();
+int
+main ()
+{
+return io_submit ();
+  ;
+  return 0;
+}
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-
-$as_echo "#define HAVE_AIO_ERROR64 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+  ac_cv_lib_aio_io_submit=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  ac_cv_lib_aio_io_submit=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aio_io_submit" >&5
+$as_echo "$ac_cv_lib_aio_io_submit" >&6; }
+if test "x$ac_cv_lib_aio_io_submit" = xyes; then :
+  AIO_LIBS="$LIBS -laio"
+fi
 
-                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aio_cancel64" >&5
-$as_echo_n "checking for aio_cancel64... " >&6; }
-                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <aio.h>
-int main() { struct aiocb a; return aio_cancel64(1, &a); }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-$as_echo "#define HAVE_AIO_CANCEL64 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux kernel asynchronous io support" >&5
+$as_echo_n "checking for Linux kernel asynchronous io support... " >&6; }
+if ${samba_cv_HAVE_LINUX_KERNEL_AIO+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aio_suspend64" >&5
-$as_echo_n "checking for aio_suspend64... " >&6; }
-                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    aio_LIBS=$LIBS
+    LIBS=$AIO_LIBS
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <aio.h>
-int main() { struct aiocb a; return aio_suspend64(&a, 1, NULL); }
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/eventfd.h>
+#include <libaio.h>
+int
+main ()
+{
+ struct io_event ioev;
+struct iocb *ioc;
+io_context_t ctx;
+struct timespec ts;
+int fd;
+char *buf;
+fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
+io_queue_init(128,&ctx);
+io_prep_pwrite(ioc, 1, buf, 1, 0);
+io_prep_pread(ioc, 1, buf, 1, 0);
+io_set_eventfd(ioc, fd);
+io_set_callback(ioc, (io_callback_t)(0));
+io_submit(ctx, 1, &ioc);
+io_getevents(ctx, 1, 1, &ioev, &ts);
+  ;
+  return 0;
+}
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-
-$as_echo "#define HAVE_AIO_SUSPEND64 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+  samba_cv_HAVE_LINUX_KERNEL_AIO=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  samba_cv_HAVE_LINUX_KERNEL_AIO=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-               fi
-            ;;
-        esac
-        ;;
-  *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define HAVE_NO_AIO 1" >>confdefs.h
-
-    ;;
-  esac
-else
-
-$as_echo "#define HAVE_NO_AIO 1" >>confdefs.h
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
+               LIBS=$aio_LIBS
 fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_LINUX_KERNEL_AIO" >&5
+$as_echo "$samba_cv_HAVE_LINUX_KERNEL_AIO" >&6; }
+    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
-       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
+  default_shared_modules="$default_shared_modules vfs_aio_posix"
 fi
 
 #################################################
 if test x$with_sendfile_support != xno ; then
     case "$host_os" in
        *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
-               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linux sendfile64 support" >&5
-$as_echo_n "checking for linux sendfile64 support... " >&6; }
-if ${samba_cv_HAVE_SENDFILE64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/sendfile.h>
-int
-main ()
-{
-\
-int tofd, fromfd;
-off64_t offset;
-size_t total;
-ssize_t nwritten = sendfile64(tofd, fromfd, &offset, total);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  samba_cv_HAVE_SENDFILE64=yes
-else
-  samba_cv_HAVE_SENDFILE64=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_SENDFILE64" >&5
-$as_echo "$samba_cv_HAVE_SENDFILE64" >&6; }
-
                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linux sendfile support" >&5
 $as_echo_n "checking for linux sendfile support... " >&6; }
 if ${samba_cv_HAVE_SENDFILE+:} false; then :
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_SENDFILE" >&5
 $as_echo "$samba_cv_HAVE_SENDFILE" >&6; }
 
-# Try and cope with broken Linux sendfile....
-               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken linux sendfile support" >&5
-$as_echo_n "checking for broken linux sendfile support... " >&6; }
-if ${samba_cv_HAVE_BROKEN_LINUX_SENDFILE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-\
-#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
-#undef _FILE_OFFSET_BITS
-#endif
-#include <sys/sendfile.h>
-int
-main ()
-{
-\
-int tofd, fromfd;
-off_t offset;
-size_t total;
-ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes
-else
-  samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_BROKEN_LINUX_SENDFILE" >&5
-$as_echo "$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" >&6; }
-
-       if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
-
-$as_echo "#define HAVE_SENDFILE64 1" >>confdefs.h
-
-
-$as_echo "#define LINUX_SENDFILE_API 1" >>confdefs.h
-
-
-$as_echo "#define WITH_SENDFILE 1" >>confdefs.h
-
-       elif test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
+        if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
 
 $as_echo "#define HAVE_SENDFILE 1" >>confdefs.h
 
@@ -35104,13 +35638,6 @@ $as_echo "#define HAVE_SENDFILE 1" >>confdefs.h
 $as_echo "#define LINUX_SENDFILE_API 1" >>confdefs.h
 
 
-$as_echo "#define WITH_SENDFILE 1" >>confdefs.h
-
-       elif test x"$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
-
-$as_echo "#define LINUX_BROKEN_SENDFILE_API 1" >>confdefs.h
-
-
 $as_echo "#define WITH_SENDFILE 1" >>confdefs.h
 
        else
@@ -35179,54 +35706,57 @@ $as_echo "#define WITH_SENDFILE 1" >>confdefs.h
 $as_echo "no" >&6; };
        fi
        ;;
-
-       *hpux*)
-               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hpux sendfile64 support" >&5
-$as_echo_n "checking for hpux sendfile64 support... " >&6; }
-if ${samba_cv_HAVE_SENDFILE64+:} false; then :
+       *darwin*)
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Darwin sendfile support" >&5
+$as_echo_n "checking for Darwin sendfile support... " >&6; }
+if ${samba_cv_HAVE_SENDFILE+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-\
+
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
+
 int
 main ()
 {
-\
-       int fromfd, tofd;
-       size_t total=0;
-       struct iovec hdtrl[2];
-       ssize_t nwritten;
-       off64_t offset;
-
-       hdtrl[0].iov_base = 0;
-       hdtrl[0].iov_len = 0;
 
-       nwritten = sendfile64(tofd, fromfd, offset, total, &hdtrl[0], 0);
+       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);
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  samba_cv_HAVE_SENDFILE64=yes
+  samba_cv_HAVE_SENDFILE=yes
 else
-  samba_cv_HAVE_SENDFILE64=no
+  samba_cv_HAVE_SENDFILE=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_SENDFILE64" >&5
-$as_echo "$samba_cv_HAVE_SENDFILE64" >&6; }
-       if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_SENDFILE" >&5
+$as_echo "$samba_cv_HAVE_SENDFILE" >&6; }
+
+       if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
 
-$as_echo "#define HAVE_SENDFILE64 1" >>confdefs.h
+$as_echo "#define HAVE_SENDFILE 1" >>confdefs.h
 
 
-$as_echo "#define HPUX_SENDFILE_API 1" >>confdefs.h
+$as_echo "#define DARWIN_SENDFILE_API 1" >>confdefs.h
 
 
 $as_echo "#define WITH_SENDFILE 1" >>confdefs.h
@@ -35235,9 +35765,10 @@ $as_echo "#define WITH_SENDFILE 1" >>confdefs.h
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; };
        fi
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hpux sendfile support" >&5
-$as_echo_n "checking for hpux sendfile support... " >&6; }
+       ;;
+       *hpux*|*osf*)
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for osf/hpux sendfile support" >&5
+$as_echo_n "checking for osf/hpux sendfile support... " >&6; }
 if ${samba_cv_HAVE_SENDFILE+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -35338,69 +35869,6 @@ _ACEOF
 
 fi
 
-               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for solaris sendfilev64 support" >&5
-$as_echo_n "checking for solaris sendfilev64 support... " >&6; }
-if ${samba_cv_HAVE_SENDFILEV64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-\
-#include <sys/sendfile.h>
-int
-main ()
-{
-\
-        int sfvcnt;
-        size_t xferred;
-        struct sendfilevec vec[2];
-       ssize_t nwritten;
-       int tofd;
-
-       sfvcnt = 2;
-
-       vec[0].sfv_fd = SFV_FD_SELF;
-       vec[0].sfv_flag = 0;
-       vec[0].sfv_off = 0;
-       vec[0].sfv_len = 0;
-
-       vec[1].sfv_fd = 0;
-       vec[1].sfv_flag = 0;
-       vec[1].sfv_off = 0;
-       vec[1].sfv_len = 0;
-       nwritten = sendfilev64(tofd, vec, sfvcnt, &xferred);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  samba_cv_HAVE_SENDFILEV64=yes
-else
-  samba_cv_HAVE_SENDFILEV64=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_SENDFILEV64" >&5
-$as_echo "$samba_cv_HAVE_SENDFILEV64" >&6; }
-
-       if test x"$samba_cv_HAVE_SENDFILEV64" = x"yes"; then
-
-$as_echo "#define HAVE_SENDFILEV64 1" >>confdefs.h
-
-
-$as_echo "#define SOLARIS_SENDFILE_API 1" >>confdefs.h
-
-
-$as_echo "#define WITH_SENDFILE 1" >>confdefs.h
-
-       else
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; };
-       fi
-
                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for solaris sendfilev support" >&5
 $as_echo_n "checking for solaris sendfilev support... " >&6; }
 if ${samba_cv_HAVE_SENDFILEV+:} false; then :
@@ -35483,7 +35951,6 @@ main ()
        size_t total=0;
        struct sf_parms hdtrl;
        ssize_t nwritten;
-       off64_t offset;
 
        hdtrl.header_data = 0;
        hdtrl.header_length = 0;
@@ -35649,6 +36116,47 @@ $as_echo "#define HAVE_POSIX_FADVISE 1" >>confdefs.h
 
 fi
 
+############################################
+# See if we have the openat syscall.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openat" >&5
+$as_echo_n "checking for openat... " >&6; }
+if ${samba_cv_HAVE_OPENAT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <fcntl.h>
+int
+main ()
+{
+int fd = openat(AT_FDCWD, ".", O_RDONLY);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  samba_cv_HAVE_OPENAT=yes
+else
+  samba_cv_HAVE_OPENAT=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_OPENAT" >&5
+$as_echo "$samba_cv_HAVE_OPENAT" >&6; }
+
+if test x"$samba_cv_HAVE_OPENAT" = x"yes"; then
+
+$as_echo "#define HAVE_OPENAT 1" >>confdefs.h
+
+fi
+
 ############################################
 # See if we have the Linux splice syscall.
 
@@ -35670,7 +36178,7 @@ else
 int
 main ()
 {
-long ret = splice(0,0,1,0,400,0);
+long ret = splice(0,0,1,0,400,SPLICE_F_MOVE);
   ;
   return 0;
 }
@@ -35820,7 +36328,7 @@ case "$host_os" in
                NSSSONAMEVERSIONSUFFIX=".2"
                WINBIND_NSS_EXTRA_OBJS="../nsswitch/winbind_nss_linux.o"
                ;;
-       *freebsd[5-9]*)
+       *freebsd[5-9]* | *freebsd1[0-9]*)
                # FreeBSD winbind client is implemented as a wrapper around
                # the Linux version.
                NSSSONAMEVERSIONSUFFIX=".1"
@@ -35830,7 +36338,7 @@ case "$host_os" in
                WINBIND_WINS_NSS="../nsswitch/nss_wins.$SHLIBEXT"
                ;;
 
-       *netbsd*[3-9]*)
+       *netbsd*[3-9]* | *netbsd1[0-9]*)
                # NetBSD winbind client is implemented as a wrapper
                # around the Linux version. It needs getpwent_r() to
                # indicate libc's use of the correct nsdispatch API.
@@ -35870,6 +36378,8 @@ case "$host_os" in
                WINBIND_NSS="../nsswitch/WINBIND"
                WINBIND_WINS_NSS=""
                ;;
+       *darwin*)
+               ;;
        *)
                HAVE_WINBIND=no
                winbind_no_reason=", unsupported on $host_os"
@@ -35959,7 +36469,7 @@ $as_echo "yes" >&6; }
 
 $as_echo "#define WITH_WINBIND 1" >>confdefs.h
 
-       EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo\$(EXEEXT)"
+       EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo"
 else
        if test x"$enable_developer" = x"yes" -a x"$LINK_LIBWBCLIENT" = x"STATIC" ; then
                BUILD_LIBWBCLIENT_SHARED=no
@@ -35995,8 +36505,8 @@ $as_echo "yes" >&6; }
 $as_echo "#define WITH_WINBIND 1" >>confdefs.h
 
 
-       EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo\$(EXEEXT)"
-       EXTRA_SBIN_PROGS="$EXTRA_SBIN_PROGS bin/winbindd\$(EXEEXT)"
+       EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo"
+       EXTRA_SBIN_PROGS="$EXTRA_SBIN_PROGS bin/winbindd"
         if test $BLDSHARED = true -a x"$create_pam_modules" = x"yes"; then
                PAM_MODULES="$PAM_MODULES pam_winbind"
                INSTALL_PAM_MODULES="installpammodules"
@@ -36096,79 +36606,6 @@ _ACEOF
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SO_PEERCRED" >&5
-$as_echo_n "checking for SO_PEERCRED... " >&6; }
-if ${samba_cv_HAVE_PEERCRED+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/socket.h>
-int
-main ()
-{
-struct ucred cred;
- socklen_t cred_len;
- int ret = getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  samba_cv_HAVE_PEERCRED=yes
-else
-  samba_cv_HAVE_PEERCRED=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_PEERCRED" >&5
-$as_echo "$samba_cv_HAVE_PEERCRED" >&6; }
-if test x"$samba_cv_HAVE_PEERCRED" = x"yes"; then
-
-$as_echo "#define HAVE_PEERCRED 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeereid" >&5
-$as_echo_n "checking for getpeereid... " >&6; }
-if ${samba_cv_HAVE_GETPEEREID+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <unistd.h>
-int
-main ()
-{
-uid_t uid; gid_t gid; int ret;
- ret = getpeereid(0, &uid, &gid);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  samba_cv_HAVE_GETPEEREID=yes
-else
-  samba_cv_HAVE_GETPEEREID=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $samba_cv_HAVE_GETPEEREID" >&5
-$as_echo "$samba_cv_HAVE_GETPEEREID" >&6; }
-if test x"$samba_cv_HAVE_GETPEEREID" = xyes; then
-
-$as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
-
-fi
-
-
 #################################################
 # Check to see if we should use the included popt
 
@@ -36765,21 +37202,21 @@ if test x"$enable_pthreadpool" = xyes -a x"$samba_cv_HAVE_PTHREAD" != x"yes"; th
        as_fn_error $? "pthreadpool support cannot be enabled when pthread support was not found" "$LINENO" 5
 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"
-
-$as_echo "#define WITH_PTHREADPOOL 1" >>confdefs.h
-
     PTHREADPOOL_OBJ="lib/pthreadpool/pthreadpool.o"
 
-    PTHREADPOOLTEST="bin/pthreadpooltest\$(EXEEXT)"
+    default_shared_modules="$default_shared_modules vfs_aio_pthread"
+else
+    PTHREADPOOL_OBJ="lib/pthreadpool/pthreadpool_sync.o"
 
-    if test x"$samba_cv_HAVE_AIO" = x"yes"; then
-        default_shared_modules="$default_shared_modules vfs_aio_pthread"
-    fi
 fi
 
+PTHREADPOOLTEST="bin/pthreadpooltest"
+
+
+
 #################################################
 # Check to see if we should use the included iniparser
 
 
 
 
+# Check whether --enable-fault-handler was given.
+if test "${enable_fault_handler+set}" = set; then :
+  enableval=$enable_fault_handler;
+fi
+
+
+if test x"$enable_fault_handler" = x"no"; then
+
+$as_echo "#define HAVE_DISABLE_FAULT_HANDLER 1" >>confdefs.h
+
+fi
+
 ###################################################
 # Check for different/missing (set|get|end)netgrent prototypes
 CFLAGS_SAVE=$CFLAGS
 
 CFLAGS=$CFLAGS_SAVE
 
+# Checks for POSIX ignorant BSD style statvfs() function
+# Start
+for ac_header in sys/param.h sys/mount.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking checking for posix ignorant *bsd style statfs struct" >&5
+$as_echo_n "checking checking for posix ignorant *bsd style statfs struct... " >&6; }
+if ${bsdstatvfs_cv_statfs+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+            if test "$cross_compiling" = yes; then :
+  bsdstatvfs_cv_statfs=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+               #ifdef HAVE_SYS_PARAM_H
+               #include <sys/param.h>
+               #endif
+               #ifdef HAVE_SYS_MOUNT_H
+               #include <sys/mount.h>
+               #endif
+               int main (void)
+               {
+                       struct statfs fsd;
+                       fsd.f_bsize = 0;
+                       fsd.f_iosize = 0;
+                       return (statfs (".", &fsd));
+               }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  bsdstatvfs_cv_statfs=yes
+else
+  bsdstatvfs_cv_statfs=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bsdstatvfs_cv_statfs" >&5
+$as_echo "$bsdstatvfs_cv_statfs" >&6; }
+
+if test $bsdstatvfs_cv_statfs = yes; then
+
+$as_echo "#define BSD_STYLE_STATVFS 1" >>confdefs.h
+
+fi
+# End of checks POSIX ignorant BSD style statvfs() function
+
 # Checks for the vfs_fileid module
 # Start
 ac_fn_c_check_func "$LINENO" "getmntent" "ac_cv_func_getmntent"
@@ -36992,8 +37504,8 @@ fi
 done
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking vfs_fileid: checking for statfs() and struct statfs.f_fsid)" >&5
-$as_echo_n "checking vfs_fileid: checking for statfs() and struct statfs.f_fsid)... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking vfs_fileid: checking for statfs() and struct statfs.f_fsid" >&5
+$as_echo_n "checking vfs_fileid: checking for statfs() and struct statfs.f_fsid... " >&6; }
 if ${vfsfileid_cv_statfs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -37101,7 +37613,7 @@ $as_echo_n "checking how to build pdb_ldap... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define pdb_ldap_init init_samba_module" >>confdefs.h
+$as_echo "#define pdb_ldap_init samba_init_module" >>confdefs.h
 
                PDB_MODULES="$PDB_MODULES "bin/ldapsam.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37112,7 +37624,7 @@ $as_echo "shared" >&6; }
                init_static_modules_pdb="$init_static_modules_pdb  pdb_ldap_init();"
                decl_static_modules_pdb="$decl_static_modules_pdb extern NTSTATUS pdb_ldap_init(void);"
                string_static_modules="$string_static_modules pdb_ldap"
-               PDB_STATIC="$PDB_STATIC passdb/pdb_ldap.o passdb/pdb_nds.o passdb/pdb_ipa.o"
+               PDB_STATIC="$PDB_STATIC passdb/pdb_ldap.o passdb/pdb_nds.o passdb/pdb_ipa.o passdb/pdb_ldap_util.o"
 
                 PASSDB_LIBS="$PASSDB_LIBS $LDAP_LIBS"
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
@@ -37124,41 +37636,6 @@ $as_echo "not" >&6; }
        fi
 
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build pdb_ads" >&5
-$as_echo_n "checking how to build pdb_ads... " >&6; }
-       if test "$MODULE_pdb_ads"; then
-               DEST=$MODULE_pdb_ads
-       elif test "$MODULE_pdb" -a "$MODULE_DEFAULT_pdb_ads"; then
-               DEST=$MODULE_pdb
-       else
-               DEST=$MODULE_DEFAULT_pdb_ads
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define pdb_ads_init init_samba_module" >>confdefs.h
-
-               PDB_MODULES="$PDB_MODULES "bin/ads.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules pdb_ads"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_pdb="$init_static_modules_pdb  pdb_ads_init();"
-               decl_static_modules_pdb="$decl_static_modules_pdb extern NTSTATUS pdb_ads_init(void);"
-               string_static_modules="$string_static_modules pdb_ads"
-               PDB_STATIC="$PDB_STATIC passdb/pdb_ads.o \$(TLDAP_OBJ)"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules pdb_ads"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build pdb_smbpasswd" >&5
 $as_echo_n "checking how to build pdb_smbpasswd... " >&6; }
        if test "$MODULE_pdb_smbpasswd"; then
@@ -37171,7 +37648,7 @@ $as_echo_n "checking how to build pdb_smbpasswd... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define pdb_smbpasswd_init init_samba_module" >>confdefs.h
+$as_echo "#define pdb_smbpasswd_init samba_init_module" >>confdefs.h
 
                PDB_MODULES="$PDB_MODULES "bin/smbpasswd.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37206,7 +37683,7 @@ $as_echo_n "checking how to build pdb_tdbsam... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define pdb_tdbsam_init init_samba_module" >>confdefs.h
+$as_echo "#define pdb_tdbsam_init samba_init_module" >>confdefs.h
 
                PDB_MODULES="$PDB_MODULES "bin/tdbsam.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37241,7 +37718,7 @@ $as_echo_n "checking how to build pdb_wbc_sam... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define pdb_wbc_sam_init init_samba_module" >>confdefs.h
+$as_echo "#define pdb_wbc_sam_init samba_init_module" >>confdefs.h
 
                PDB_MODULES="$PDB_MODULES "bin/wbc_sam.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37292,7 +37769,7 @@ $as_echo_n "checking how to build idmap_ldap... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define idmap_ldap_init init_samba_module" >>confdefs.h
+$as_echo "#define idmap_ldap_init samba_init_module" >>confdefs.h
 
                IDMAP_MODULES="$IDMAP_MODULES "bin/ldap.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37327,7 +37804,7 @@ $as_echo_n "checking how to build idmap_tdb... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define idmap_tdb_init init_samba_module" >>confdefs.h
+$as_echo "#define idmap_tdb_init samba_init_module" >>confdefs.h
 
                IDMAP_MODULES="$IDMAP_MODULES "bin/tdb.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37362,7 +37839,7 @@ $as_echo_n "checking how to build idmap_tdb2... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define idmap_tdb2_init init_samba_module" >>confdefs.h
+$as_echo "#define idmap_tdb2_init samba_init_module" >>confdefs.h
 
                IDMAP_MODULES="$IDMAP_MODULES "bin/tdb2.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37397,7 +37874,7 @@ $as_echo_n "checking how to build idmap_passdb... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define idmap_passdb_init init_samba_module" >>confdefs.h
+$as_echo "#define idmap_passdb_init samba_init_module" >>confdefs.h
 
                IDMAP_MODULES="$IDMAP_MODULES "bin/passdb.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37432,7 +37909,7 @@ $as_echo_n "checking how to build idmap_nss... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define idmap_nss_init init_samba_module" >>confdefs.h
+$as_echo "#define idmap_nss_init samba_init_module" >>confdefs.h
 
                IDMAP_MODULES="$IDMAP_MODULES "bin/nss.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37467,7 +37944,7 @@ $as_echo_n "checking how to build idmap_rid... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define idmap_rid_init init_samba_module" >>confdefs.h
+$as_echo "#define idmap_rid_init samba_init_module" >>confdefs.h
 
                IDMAP_MODULES="$IDMAP_MODULES "bin/rid.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37502,7 +37979,7 @@ $as_echo_n "checking how to build idmap_autorid... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define idmap_autorid_init init_samba_module" >>confdefs.h
+$as_echo "#define idmap_autorid_init samba_init_module" >>confdefs.h
 
                IDMAP_MODULES="$IDMAP_MODULES "bin/autorid.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37537,7 +38014,7 @@ $as_echo_n "checking how to build idmap_ad... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define idmap_ad_init init_samba_module" >>confdefs.h
+$as_echo "#define idmap_ad_init samba_init_module" >>confdefs.h
 
                IDMAP_MODULES="$IDMAP_MODULES "bin/ad.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37572,7 +38049,7 @@ $as_echo_n "checking how to build idmap_hash... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define idmap_hash_init init_samba_module" >>confdefs.h
+$as_echo "#define idmap_hash_init samba_init_module" >>confdefs.h
 
                IDMAP_MODULES="$IDMAP_MODULES "bin/hash.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37595,41 +38072,6 @@ $as_echo "not" >&6; }
        fi
 
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build idmap_adex" >&5
-$as_echo_n "checking how to build idmap_adex... " >&6; }
-       if test "$MODULE_idmap_adex"; then
-               DEST=$MODULE_idmap_adex
-       elif test "$MODULE_idmap" -a "$MODULE_DEFAULT_idmap_adex"; then
-               DEST=$MODULE_idmap
-       else
-               DEST=$MODULE_DEFAULT_idmap_adex
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define idmap_adex_init init_samba_module" >>confdefs.h
-
-               IDMAP_MODULES="$IDMAP_MODULES "bin/adex.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules idmap_adex"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_idmap="$init_static_modules_idmap  idmap_adex_init();"
-               decl_static_modules_idmap="$decl_static_modules_idmap extern NTSTATUS idmap_adex_init(void);"
-               string_static_modules="$string_static_modules idmap_adex"
-               IDMAP_STATIC="$IDMAP_STATIC \$(IDMAP_ADEX_OBJ)"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules idmap_adex"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
 
 
 
@@ -37658,7 +38100,7 @@ $as_echo_n "checking how to build nss_info_template... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define nss_info_template_init init_samba_module" >>confdefs.h
+$as_echo "#define nss_info_template_init samba_init_module" >>confdefs.h
 
                NSS_INFO_MODULES="$NSS_INFO_MODULES "bin/template.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37697,162 +38139,6 @@ _ACEOF
 
 
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build charset_weird" >&5
-$as_echo_n "checking how to build charset_weird... " >&6; }
-       if test "$MODULE_charset_weird"; then
-               DEST=$MODULE_charset_weird
-       elif test "$MODULE_charset" -a "$MODULE_DEFAULT_charset_weird"; then
-               DEST=$MODULE_charset
-       else
-               DEST=$MODULE_DEFAULT_charset_weird
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define charset_weird_init init_samba_module" >>confdefs.h
-
-               CHARSET_MODULES="$CHARSET_MODULES "bin/weird.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules charset_weird"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_charset="$init_static_modules_charset  charset_weird_init();"
-               decl_static_modules_charset="$decl_static_modules_charset extern NTSTATUS charset_weird_init(void);"
-               string_static_modules="$string_static_modules charset_weird"
-               CHARSET_STATIC="$CHARSET_STATIC modules/weird.o"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules charset_weird"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build charset_CP850" >&5
-$as_echo_n "checking how to build charset_CP850... " >&6; }
-       if test "$MODULE_charset_CP850"; then
-               DEST=$MODULE_charset_CP850
-       elif test "$MODULE_charset" -a "$MODULE_DEFAULT_charset_CP850"; then
-               DEST=$MODULE_charset
-       else
-               DEST=$MODULE_DEFAULT_charset_CP850
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define charset_CP850_init init_samba_module" >>confdefs.h
-
-               CHARSET_MODULES="$CHARSET_MODULES "bin/CP850.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules charset_CP850"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_charset="$init_static_modules_charset  charset_CP850_init();"
-               decl_static_modules_charset="$decl_static_modules_charset extern NTSTATUS charset_CP850_init(void);"
-               string_static_modules="$string_static_modules charset_CP850"
-               CHARSET_STATIC="$CHARSET_STATIC modules/CP850.o"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules charset_CP850"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build charset_CP437" >&5
-$as_echo_n "checking how to build charset_CP437... " >&6; }
-       if test "$MODULE_charset_CP437"; then
-               DEST=$MODULE_charset_CP437
-       elif test "$MODULE_charset" -a "$MODULE_DEFAULT_charset_CP437"; then
-               DEST=$MODULE_charset
-       else
-               DEST=$MODULE_DEFAULT_charset_CP437
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define charset_CP437_init init_samba_module" >>confdefs.h
-
-               CHARSET_MODULES="$CHARSET_MODULES "bin/CP437.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules charset_CP437"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_charset="$init_static_modules_charset  charset_CP437_init();"
-               decl_static_modules_charset="$decl_static_modules_charset extern NTSTATUS charset_CP437_init(void);"
-               string_static_modules="$string_static_modules charset_CP437"
-               CHARSET_STATIC="$CHARSET_STATIC modules/CP437.o"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules charset_CP437"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build charset_macosxfs" >&5
-$as_echo_n "checking how to build charset_macosxfs... " >&6; }
-       if test "$MODULE_charset_macosxfs"; then
-               DEST=$MODULE_charset_macosxfs
-       elif test "$MODULE_charset" -a "$MODULE_DEFAULT_charset_macosxfs"; then
-               DEST=$MODULE_charset
-       else
-               DEST=$MODULE_DEFAULT_charset_macosxfs
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define charset_macosxfs_init init_samba_module" >>confdefs.h
-
-               CHARSET_MODULES="$CHARSET_MODULES "bin/macosxfs.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules charset_macosxfs"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_charset="$init_static_modules_charset  charset_macosxfs_init();"
-               decl_static_modules_charset="$decl_static_modules_charset extern NTSTATUS charset_macosxfs_init(void);"
-               string_static_modules="$string_static_modules charset_macosxfs"
-               CHARSET_STATIC="$CHARSET_STATIC modules/charset_macosxfs.o"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules charset_macosxfs"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define static_init_charset {$init_static_modules_charset}
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define static_decl_charset $decl_static_modules_charset
-_ACEOF
-
-       rm -f lib/iconv.o
-
-
-
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build auth_sam" >&5
 $as_echo_n "checking how to build auth_sam... " >&6; }
        if test "$MODULE_auth_sam"; then
@@ -37865,7 +38151,7 @@ $as_echo_n "checking how to build auth_sam... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define auth_sam_init init_samba_module" >>confdefs.h
+$as_echo "#define auth_sam_init samba_init_module" >>confdefs.h
 
                AUTH_MODULES="$AUTH_MODULES "bin/sam.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37900,7 +38186,7 @@ $as_echo_n "checking how to build auth_unix... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define auth_unix_init init_samba_module" >>confdefs.h
+$as_echo "#define auth_unix_init samba_init_module" >>confdefs.h
 
                AUTH_MODULES="$AUTH_MODULES "bin/unix.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37935,7 +38221,7 @@ $as_echo_n "checking how to build auth_winbind... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define auth_winbind_init init_samba_module" >>confdefs.h
+$as_echo "#define auth_winbind_init samba_init_module" >>confdefs.h
 
                AUTH_MODULES="$AUTH_MODULES "bin/winbind.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37970,7 +38256,7 @@ $as_echo_n "checking how to build auth_wbc... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define auth_wbc_init init_samba_module" >>confdefs.h
+$as_echo "#define auth_wbc_init samba_init_module" >>confdefs.h
 
                AUTH_MODULES="$AUTH_MODULES "bin/wbc.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -37993,41 +38279,6 @@ $as_echo "not" >&6; }
        fi
 
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build auth_server" >&5
-$as_echo_n "checking how to build auth_server... " >&6; }
-       if test "$MODULE_auth_server"; then
-               DEST=$MODULE_auth_server
-       elif test "$MODULE_auth" -a "$MODULE_DEFAULT_auth_server"; then
-               DEST=$MODULE_auth
-       else
-               DEST=$MODULE_DEFAULT_auth_server
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define auth_server_init init_samba_module" >>confdefs.h
-
-               AUTH_MODULES="$AUTH_MODULES "bin/smbserver.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules auth_server"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_auth="$init_static_modules_auth  auth_server_init();"
-               decl_static_modules_auth="$decl_static_modules_auth extern NTSTATUS auth_server_init(void);"
-               string_static_modules="$string_static_modules auth_server"
-               AUTH_STATIC="$AUTH_STATIC \$(AUTH_SERVER_OBJ)"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules auth_server"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build auth_domain" >&5
 $as_echo_n "checking how to build auth_domain... " >&6; }
        if test "$MODULE_auth_domain"; then
@@ -38040,7 +38291,7 @@ $as_echo_n "checking how to build auth_domain... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define auth_domain_init init_samba_module" >>confdefs.h
+$as_echo "#define auth_domain_init samba_init_module" >>confdefs.h
 
                AUTH_MODULES="$AUTH_MODULES "bin/domain.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38075,7 +38326,7 @@ $as_echo_n "checking how to build auth_builtin... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define auth_builtin_init init_samba_module" >>confdefs.h
+$as_echo "#define auth_builtin_init samba_init_module" >>confdefs.h
 
                AUTH_MODULES="$AUTH_MODULES "bin/builtin.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38110,7 +38361,7 @@ $as_echo_n "checking how to build auth_script... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define auth_script_init init_samba_module" >>confdefs.h
+$as_echo "#define auth_script_init samba_init_module" >>confdefs.h
 
                AUTH_MODULES="$AUTH_MODULES "bin/script.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38133,41 +38384,6 @@ $as_echo "not" >&6; }
        fi
 
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build auth_netlogond" >&5
-$as_echo_n "checking how to build auth_netlogond... " >&6; }
-       if test "$MODULE_auth_netlogond"; then
-               DEST=$MODULE_auth_netlogond
-       elif test "$MODULE_auth" -a "$MODULE_DEFAULT_auth_netlogond"; then
-               DEST=$MODULE_auth
-       else
-               DEST=$MODULE_DEFAULT_auth_netlogond
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define auth_netlogond_init init_samba_module" >>confdefs.h
-
-               AUTH_MODULES="$AUTH_MODULES "bin/netlogond.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules auth_netlogond"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_auth="$init_static_modules_auth  auth_netlogond_init();"
-               decl_static_modules_auth="$decl_static_modules_auth extern NTSTATUS auth_netlogond_init(void);"
-               string_static_modules="$string_static_modules auth_netlogond"
-               AUTH_STATIC="$AUTH_STATIC \$(AUTH_NETLOGOND_OBJ)"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules auth_netlogond"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
 
 
 
@@ -38196,7 +38412,7 @@ $as_echo_n "checking how to build vfs_default... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_default_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_default_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/default.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38231,7 +38447,7 @@ $as_echo_n "checking how to build vfs_recycle... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_recycle_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_recycle_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/recycle.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38266,7 +38482,7 @@ $as_echo_n "checking how to build vfs_audit... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_audit_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_audit_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/audit.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38301,7 +38517,7 @@ $as_echo_n "checking how to build vfs_extd_audit... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_extd_audit_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_extd_audit_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/extd_audit.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38336,7 +38552,7 @@ $as_echo_n "checking how to build vfs_full_audit... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_full_audit_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_full_audit_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/full_audit.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38371,7 +38587,7 @@ $as_echo_n "checking how to build vfs_netatalk... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_netatalk_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_netatalk_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/netatalk.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38406,7 +38622,7 @@ $as_echo_n "checking how to build vfs_fake_perms... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_fake_perms_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_fake_perms_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/fake_perms.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38429,6 +38645,41 @@ $as_echo "not" >&6; }
        fi
 
 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_fake_acls" >&5
+$as_echo_n "checking how to build vfs_fake_acls... " >&6; }
+       if test "$MODULE_vfs_fake_acls"; then
+               DEST=$MODULE_vfs_fake_acls
+       elif test "$MODULE_vfs" -a "$MODULE_DEFAULT_vfs_fake_acls"; then
+               DEST=$MODULE_vfs
+       else
+               DEST=$MODULE_DEFAULT_vfs_fake_acls
+       fi
+
+       if test x"$DEST" = xSHARED; then
+
+$as_echo "#define vfs_fake_acls_init samba_init_module" >>confdefs.h
+
+               VFS_MODULES="$VFS_MODULES "bin/fake_acls.$SHLIBEXT""
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
+$as_echo "shared" >&6; }
+
+               string_shared_modules="$string_shared_modules vfs_fake_acls"
+       elif test x"$DEST" = xSTATIC; then
+               init_static_modules_vfs="$init_static_modules_vfs  vfs_fake_acls_init();"
+               decl_static_modules_vfs="$decl_static_modules_vfs extern NTSTATUS vfs_fake_acls_init(void);"
+               string_static_modules="$string_static_modules vfs_fake_acls"
+               VFS_STATIC="$VFS_STATIC \$(VFS_FAKE_ACLS_OBJ)"
+
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
+$as_echo "static" >&6; }
+       else
+           string_ignored_modules="$string_ignored_modules vfs_fake_acls"
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
+$as_echo "not" >&6; }
+       fi
+
+
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_default_quota" >&5
 $as_echo_n "checking how to build vfs_default_quota... " >&6; }
        if test "$MODULE_vfs_default_quota"; then
@@ -38441,7 +38692,7 @@ $as_echo_n "checking how to build vfs_default_quota... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_default_quota_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_default_quota_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/default_quota.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38476,7 +38727,7 @@ $as_echo_n "checking how to build vfs_readonly... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_readonly_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_readonly_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/readonly.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38511,7 +38762,7 @@ $as_echo_n "checking how to build vfs_cap... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_cap_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_cap_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/cap.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38546,7 +38797,7 @@ $as_echo_n "checking how to build vfs_expand_msdfs... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_expand_msdfs_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_expand_msdfs_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/expand_msdfs.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38581,7 +38832,7 @@ $as_echo_n "checking how to build vfs_shadow_copy... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_shadow_copy_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_shadow_copy_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/shadow_copy.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38616,7 +38867,7 @@ $as_echo_n "checking how to build vfs_shadow_copy2... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_shadow_copy2_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_shadow_copy2_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/shadow_copy2.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38651,7 +38902,7 @@ $as_echo_n "checking how to build vfs_afsacl... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_afsacl_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_afsacl_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/afsacl.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38686,7 +38937,7 @@ $as_echo_n "checking how to build vfs_xattr_tdb... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_xattr_tdb_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_xattr_tdb_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/xattr_tdb.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38721,7 +38972,7 @@ $as_echo_n "checking how to build vfs_posixacl... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_posixacl_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_posixacl_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/posixacl.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38756,7 +39007,7 @@ $as_echo_n "checking how to build vfs_aixacl... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_aixacl_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_aixacl_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/aixacl.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38791,7 +39042,7 @@ $as_echo_n "checking how to build vfs_aixacl2... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_aixacl2_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_aixacl2_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/aixacl2.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38826,7 +39077,7 @@ $as_echo_n "checking how to build vfs_solarisacl... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_solarisacl_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_solarisacl_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/solarisacl.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38861,7 +39112,7 @@ $as_echo_n "checking how to build vfs_irixacl... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_irixacl_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_irixacl_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/irixacl.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38896,7 +39147,7 @@ $as_echo_n "checking how to build vfs_hpuxacl... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_hpuxacl_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_hpuxacl_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/hpuxacl.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38931,7 +39182,7 @@ $as_echo_n "checking how to build vfs_tru64acl... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_tru64acl_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_tru64acl_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/tru64acl.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -38966,7 +39217,7 @@ $as_echo_n "checking how to build vfs_catia... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_catia_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_catia_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/catia.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39001,7 +39252,7 @@ $as_echo_n "checking how to build vfs_streams_xattr... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_streams_xattr_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_streams_xattr_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/streams_xattr.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39036,7 +39287,7 @@ $as_echo_n "checking how to build vfs_streams_depot... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_streams_depot_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_streams_depot_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/streams_depot.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39071,7 +39322,7 @@ $as_echo_n "checking how to build vfs_cacheprime... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_cacheprime_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_cacheprime_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/cacheprime.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39106,7 +39357,7 @@ $as_echo_n "checking how to build vfs_prealloc... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_prealloc_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_prealloc_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/prealloc.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39141,7 +39392,7 @@ $as_echo_n "checking how to build vfs_commit... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_commit_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_commit_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/commit.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39176,7 +39427,7 @@ $as_echo_n "checking how to build vfs_gpfs... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_gpfs_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_gpfs_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/gpfs.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39199,41 +39450,6 @@ $as_echo "not" >&6; }
        fi
 
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_gpfs_hsm_notify" >&5
-$as_echo_n "checking how to build vfs_gpfs_hsm_notify... " >&6; }
-       if test "$MODULE_vfs_gpfs_hsm_notify"; then
-               DEST=$MODULE_vfs_gpfs_hsm_notify
-       elif test "$MODULE_vfs" -a "$MODULE_DEFAULT_vfs_gpfs_hsm_notify"; then
-               DEST=$MODULE_vfs
-       else
-               DEST=$MODULE_DEFAULT_vfs_gpfs_hsm_notify
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define vfs_gpfs_hsm_notify_init init_samba_module" >>confdefs.h
-
-               VFS_MODULES="$VFS_MODULES "bin/gpfs_hsm_notify.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules vfs_gpfs_hsm_notify"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_vfs="$init_static_modules_vfs  vfs_gpfs_hsm_notify_init();"
-               decl_static_modules_vfs="$decl_static_modules_vfs extern NTSTATUS vfs_gpfs_hsm_notify_init(void);"
-               string_static_modules="$string_static_modules vfs_gpfs_hsm_notify"
-               VFS_STATIC="$VFS_STATIC \$(VFS_GPFS_PREFETCH_OBJ)"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules vfs_gpfs_hsm_notify"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_readahead" >&5
 $as_echo_n "checking how to build vfs_readahead... " >&6; }
        if test "$MODULE_vfs_readahead"; then
@@ -39246,7 +39462,7 @@ $as_echo_n "checking how to build vfs_readahead... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_readahead_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_readahead_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/readahead.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39281,7 +39497,7 @@ $as_echo_n "checking how to build vfs_tsmsm... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_tsmsm_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_tsmsm_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/tsmsm.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39316,7 +39532,7 @@ $as_echo_n "checking how to build vfs_fileid... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_fileid_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_fileid_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/fileid.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39351,7 +39567,7 @@ $as_echo_n "checking how to build vfs_aio_fork... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_aio_fork_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_aio_fork_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/aio_fork.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39386,7 +39602,7 @@ $as_echo_n "checking how to build vfs_aio_pthread... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_aio_pthread_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_aio_pthread_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/aio_pthread.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39409,6 +39625,76 @@ $as_echo "not" >&6; }
        fi
 
 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_aio_posix" >&5
+$as_echo_n "checking how to build vfs_aio_posix... " >&6; }
+       if test "$MODULE_vfs_aio_posix"; then
+               DEST=$MODULE_vfs_aio_posix
+       elif test "$MODULE_vfs" -a "$MODULE_DEFAULT_vfs_aio_posix"; then
+               DEST=$MODULE_vfs
+       else
+               DEST=$MODULE_DEFAULT_vfs_aio_posix
+       fi
+
+       if test x"$DEST" = xSHARED; then
+
+$as_echo "#define vfs_aio_posix_init samba_init_module" >>confdefs.h
+
+               VFS_MODULES="$VFS_MODULES "bin/aio_posix.$SHLIBEXT""
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
+$as_echo "shared" >&6; }
+
+               string_shared_modules="$string_shared_modules vfs_aio_posix"
+       elif test x"$DEST" = xSTATIC; then
+               init_static_modules_vfs="$init_static_modules_vfs  vfs_aio_posix_init();"
+               decl_static_modules_vfs="$decl_static_modules_vfs extern NTSTATUS vfs_aio_posix_init(void);"
+               string_static_modules="$string_static_modules vfs_aio_posix"
+               VFS_STATIC="$VFS_STATIC \$(VFS_AIO_POSIX_OBJ)"
+
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
+$as_echo "static" >&6; }
+       else
+           string_ignored_modules="$string_ignored_modules vfs_aio_posix"
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
+$as_echo "not" >&6; }
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_aio_linux" >&5
+$as_echo_n "checking how to build vfs_aio_linux... " >&6; }
+       if test "$MODULE_vfs_aio_linux"; then
+               DEST=$MODULE_vfs_aio_linux
+       elif test "$MODULE_vfs" -a "$MODULE_DEFAULT_vfs_aio_linux"; then
+               DEST=$MODULE_vfs
+       else
+               DEST=$MODULE_DEFAULT_vfs_aio_linux
+       fi
+
+       if test x"$DEST" = xSHARED; then
+
+$as_echo "#define vfs_aio_linux_init samba_init_module" >>confdefs.h
+
+               VFS_MODULES="$VFS_MODULES "bin/aio_linux.$SHLIBEXT""
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
+$as_echo "shared" >&6; }
+
+               string_shared_modules="$string_shared_modules vfs_aio_linux"
+       elif test x"$DEST" = xSTATIC; then
+               init_static_modules_vfs="$init_static_modules_vfs  vfs_aio_linux_init();"
+               decl_static_modules_vfs="$decl_static_modules_vfs extern NTSTATUS vfs_aio_linux_init(void);"
+               string_static_modules="$string_static_modules vfs_aio_linux"
+               VFS_STATIC="$VFS_STATIC \$(VFS_AIO_LINUX_OBJ)"
+
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
+$as_echo "static" >&6; }
+       else
+           string_ignored_modules="$string_ignored_modules vfs_aio_linux"
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
+$as_echo "not" >&6; }
+       fi
+
+
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_preopen" >&5
 $as_echo_n "checking how to build vfs_preopen... " >&6; }
        if test "$MODULE_vfs_preopen"; then
@@ -39421,7 +39707,7 @@ $as_echo_n "checking how to build vfs_preopen... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_preopen_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_preopen_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/preopen.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39456,7 +39742,7 @@ $as_echo_n "checking how to build vfs_syncops... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_syncops_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_syncops_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/syncops.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39491,7 +39777,7 @@ $as_echo_n "checking how to build vfs_zfsacl... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_zfsacl_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_zfsacl_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/zfsacl.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39526,7 +39812,7 @@ $as_echo_n "checking how to build vfs_notify_fam... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_notify_fam_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_notify_fam_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/notify_fam.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39561,7 +39847,7 @@ $as_echo_n "checking how to build vfs_acl_xattr... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_acl_xattr_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_acl_xattr_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/acl_xattr.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39596,7 +39882,7 @@ $as_echo_n "checking how to build vfs_acl_tdb... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_acl_tdb_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_acl_tdb_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/acl_tdb.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39631,7 +39917,7 @@ $as_echo_n "checking how to build vfs_smb_traffic_analyzer... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_smb_traffic_analyzer_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_smb_traffic_analyzer_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/smb_traffic_analyzer.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39654,76 +39940,6 @@ $as_echo "not" >&6; }
        fi
 
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_onefs" >&5
-$as_echo_n "checking how to build vfs_onefs... " >&6; }
-       if test "$MODULE_vfs_onefs"; then
-               DEST=$MODULE_vfs_onefs
-       elif test "$MODULE_vfs" -a "$MODULE_DEFAULT_vfs_onefs"; then
-               DEST=$MODULE_vfs
-       else
-               DEST=$MODULE_DEFAULT_vfs_onefs
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define vfs_onefs_init init_samba_module" >>confdefs.h
-
-               VFS_MODULES="$VFS_MODULES "bin/onefs.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules vfs_onefs"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_vfs="$init_static_modules_vfs  vfs_onefs_init();"
-               decl_static_modules_vfs="$decl_static_modules_vfs extern NTSTATUS vfs_onefs_init(void);"
-               string_static_modules="$string_static_modules vfs_onefs"
-               VFS_STATIC="$VFS_STATIC \$(VFS_ONEFS)"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules vfs_onefs"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_onefs_shadow_copy" >&5
-$as_echo_n "checking how to build vfs_onefs_shadow_copy... " >&6; }
-       if test "$MODULE_vfs_onefs_shadow_copy"; then
-               DEST=$MODULE_vfs_onefs_shadow_copy
-       elif test "$MODULE_vfs" -a "$MODULE_DEFAULT_vfs_onefs_shadow_copy"; then
-               DEST=$MODULE_vfs
-       else
-               DEST=$MODULE_DEFAULT_vfs_onefs_shadow_copy
-       fi
-
-       if test x"$DEST" = xSHARED; then
-
-$as_echo "#define vfs_onefs_shadow_copy_init init_samba_module" >>confdefs.h
-
-               VFS_MODULES="$VFS_MODULES "bin/onefs_shadow_copy.$SHLIBEXT""
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
-
-               string_shared_modules="$string_shared_modules vfs_onefs_shadow_copy"
-       elif test x"$DEST" = xSTATIC; then
-               init_static_modules_vfs="$init_static_modules_vfs  vfs_onefs_shadow_copy_init();"
-               decl_static_modules_vfs="$decl_static_modules_vfs extern NTSTATUS vfs_onefs_shadow_copy_init(void);"
-               string_static_modules="$string_static_modules vfs_onefs_shadow_copy"
-               VFS_STATIC="$VFS_STATIC \$(VFS_ONEFS_SHADOW_COPY)"
-
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
-       else
-           string_ignored_modules="$string_ignored_modules vfs_onefs_shadow_copy"
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
-$as_echo "not" >&6; }
-       fi
-
-
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_dirsort" >&5
 $as_echo_n "checking how to build vfs_dirsort... " >&6; }
        if test "$MODULE_vfs_dirsort"; then
@@ -39736,7 +39952,7 @@ $as_echo_n "checking how to build vfs_dirsort... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_dirsort_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_dirsort_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/dirsort.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39771,7 +39987,7 @@ $as_echo_n "checking how to build vfs_scannedonly... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_scannedonly_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_scannedonly_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/scannedonly.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39806,7 +40022,7 @@ $as_echo_n "checking how to build vfs_crossrename... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_crossrename_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_crossrename_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/crossrename.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39841,7 +40057,7 @@ $as_echo_n "checking how to build vfs_linux_xfs_sgid... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_linux_xfs_sgid_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_linux_xfs_sgid_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/linux_xfs_sgid.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39876,7 +40092,7 @@ $as_echo_n "checking how to build vfs_time_audit... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define vfs_time_audit_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_time_audit_init samba_init_module" >>confdefs.h
 
                VFS_MODULES="$VFS_MODULES "bin/time_audit.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -39899,58 +40115,58 @@ $as_echo "not" >&6; }
        fi
 
 
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define static_init_vfs {$init_static_modules_vfs}
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define static_decl_vfs $decl_static_modules_vfs
-_ACEOF
-
-       rm -f smbd/vfs.o
-
-
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build perfcount_onefs" >&5
-$as_echo_n "checking how to build perfcount_onefs... " >&6; }
-       if test "$MODULE_perfcount_onefs"; then
-               DEST=$MODULE_perfcount_onefs
-       elif test "$MODULE_perfcount" -a "$MODULE_DEFAULT_perfcount_onefs"; then
-               DEST=$MODULE_perfcount
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build vfs_media_harmony" >&5
+$as_echo_n "checking how to build vfs_media_harmony... " >&6; }
+       if test "$MODULE_vfs_media_harmony"; then
+               DEST=$MODULE_vfs_media_harmony
+       elif test "$MODULE_vfs" -a "$MODULE_DEFAULT_vfs_media_harmony"; then
+               DEST=$MODULE_vfs
        else
-               DEST=$MODULE_DEFAULT_perfcount_onefs
+               DEST=$MODULE_DEFAULT_vfs_media_harmony
        fi
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define perfcount_onefs_init init_samba_module" >>confdefs.h
+$as_echo "#define vfs_media_harmony_init samba_init_module" >>confdefs.h
 
-               PERFCOUNT_MODULES="$PERFCOUNT_MODULES "bin/pc_onefs.$SHLIBEXT""
+               VFS_MODULES="$VFS_MODULES "bin/media_harmony.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
 $as_echo "shared" >&6; }
 
-               string_shared_modules="$string_shared_modules perfcount_onefs"
+               string_shared_modules="$string_shared_modules vfs_media_harmony"
        elif test x"$DEST" = xSTATIC; then
-               init_static_modules_perfcount="$init_static_modules_perfcount  perfcount_onefs_init();"
-               decl_static_modules_perfcount="$decl_static_modules_perfcount extern NTSTATUS perfcount_onefs_init(void);"
-               string_static_modules="$string_static_modules perfcount_onefs"
-               PERFCOUNT_STATIC="$PERFCOUNT_STATIC \$(PERFCOUNT_ONEFS)"
+               init_static_modules_vfs="$init_static_modules_vfs  vfs_media_harmony_init();"
+               decl_static_modules_vfs="$decl_static_modules_vfs extern NTSTATUS vfs_media_harmony_init(void);"
+               string_static_modules="$string_static_modules vfs_media_harmony"
+               VFS_STATIC="$VFS_STATIC \$(VFS_MEDIA_HARMONY_OBJ)"
 
 
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
 $as_echo "static" >&6; }
        else
-           string_ignored_modules="$string_ignored_modules perfcount_onefs"
+           string_ignored_modules="$string_ignored_modules vfs_media_harmony"
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: not" >&5
 $as_echo "not" >&6; }
        fi
 
 
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define static_init_vfs {$init_static_modules_vfs}
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define static_decl_vfs $decl_static_modules_vfs
+_ACEOF
+
+       rm -f smbd/vfs.o
+
+
+
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build perfcount_test" >&5
 $as_echo_n "checking how to build perfcount_test... " >&6; }
        if test "$MODULE_perfcount_test"; then
@@ -39963,7 +40179,7 @@ $as_echo_n "checking how to build perfcount_test... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define perfcount_test_init init_samba_module" >>confdefs.h
+$as_echo "#define perfcount_test_init samba_init_module" >>confdefs.h
 
                PERFCOUNT_MODULES="$PERFCOUNT_MODULES "bin/pc_test.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -40014,7 +40230,7 @@ $as_echo_n "checking how to build gpext_registry... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define gpext_registry_init init_samba_module" >>confdefs.h
+$as_echo "#define gpext_registry_init samba_init_module" >>confdefs.h
 
                GPEXT_MODULES="$GPEXT_MODULES "bin/registry.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -40049,7 +40265,7 @@ $as_echo_n "checking how to build gpext_scripts... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define gpext_scripts_init init_samba_module" >>confdefs.h
+$as_echo "#define gpext_scripts_init samba_init_module" >>confdefs.h
 
                GPEXT_MODULES="$GPEXT_MODULES "bin/scripts.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
@@ -40084,7 +40300,7 @@ $as_echo_n "checking how to build gpext_security... " >&6; }
 
        if test x"$DEST" = xSHARED; then
 
-$as_echo "#define gpext_security_init init_samba_module" >>confdefs.h
+$as_echo "#define gpext_security_init samba_init_module" >>confdefs.h
 
                GPEXT_MODULES="$GPEXT_MODULES "bin/security.$SHLIBEXT""
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
 #################################################
 # If run from the build farm, enable NASTY hacks
 #################################################
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build farm hacks" >&5
-$as_echo_n "checking whether to enable build farm hacks... " >&6; }
-if test x"$RUN_FROM_BUILD_FARM" = x"yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable features for selftest" >&5
+$as_echo_n "checking whether to enable features for selftest... " >&6; }
+if test x"$selftest" = x"yes"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define ENABLE_BUILD_FARM_HACKS 1" >>confdefs.h
+$as_echo "#define ENABLE_SELFTEST 1" >>confdefs.h
 
+       if test x"$selftest_possible" != xyes; then
+               as_fn_error including development headers "selftest support only possible with python" "$LINENO" 5
+       fi
 else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
 
 
-if test x$smbtorture4_possible = xyes; then
-       saved_USESHARED="$USESHARED"
-       USESHARED="false"
-       smbtorture4_path="bin/smbtorture4"
-       smbtorture4_option="-t bin/smbtorture4"
-
-
-       USESHARED="$saved_USESHARED"
-       SMBTORTURE4="bin/smbtorture4"
-
-fi
-
 
 
 
@@ -40493,6 +40700,13 @@ else
 fi
 
 
+
+$as_echo "#define STATIC_gensec_MODULES gensec_spnego_init,gensec_ntlmssp_init,NULL" >>confdefs.h
+
+
+$as_echo "#define STATIC_gensec_MODULES_PROTO _MODULE_PROTO(gensec_spnego_init)_MODULE_PROTO(gensec_ntlmssp_init)" >>confdefs.h
+
+
 # Check whether --enable-dmalloc was given.
 if test "${enable_dmalloc+set}" = set; then :
   enableval=$enable_dmalloc;
@@ -40528,6 +40742,7 @@ fi
     -Wl,-rpath-Wl,/usr/lib/) l="";;
     -Wl,-rpath-Wl,/usr/lib64) l="";;
     -Wl,-rpath-Wl,/usr/lib64/) l="";;
+    -rpath=/usr/lib:*) l="-rpath=${i#-rpath=*:}";;
     *)
        s=" "
         if test x"$ac_new_flags" = x""; then
@@ -40562,6 +40777,7 @@ fi
     -Wl,-rpath-Wl,/usr/lib/) l="";;
     -Wl,-rpath-Wl,/usr/lib64) l="";;
     -Wl,-rpath-Wl,/usr/lib64/) l="";;
+    -rpath=/usr/lib:*) l="-rpath=${i#-rpath=*:}";;
     *)
        s=" "
         if test x"$ac_new_flags" = x""; then
@@ -40615,10 +40831,6 @@ if test x"$with_ldap_support" != x"no"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: result:     LDAP_LIBS = $LDAP_LIBS" >&5
 $as_echo "    LDAP_LIBS = $LDAP_LIBS" >&6; }
 fi
-if test x"$with_dnsupdate_support" != x"no"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result:     UUID_LIBS = $UUID_LIBS" >&5
-$as_echo "    UUID_LIBS = $UUID_LIBS" >&6; }
-fi
 if test x"$have_dnssd_support" != x"no"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: result:     DNSSD_LIBS = $DNSSD_LIBS" >&5
 $as_echo "    DNSSD_LIBS = $DNSSD_LIBS" >&6; }
@@ -40652,7 +40864,7 @@ fi
 
 
 if test x"$krb5_developer" = x"yes" -o x"$developer" = x"yes" -o x"$picky_developer" = x"yes"; then
-    CFLAGS="${CFLAGS} \$(DEVELOPER_CFLAGS)"
+    CFLAGS="${CFLAGS} \$(DEVELOPER_CFLAGS) ${CFLAGS_APPEND}"
 fi
 
 # Stuff the smbd-only libraries at the end of the smbd link
@@ -40667,7 +40879,7 @@ CFLAGS="${CFLAGS} -D_SAMBA_BUILD_=3"
 ac_config_commands="$ac_config_commands default-1"
 
 
-ac_config_files="$ac_config_files Makefile script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh lib/netapi/examples/Makefile lib/netapi/tests/Makefile pkgconfig/smbclient.pc pkgconfig/wbclient.pc pkgconfig/netapi.pc pkgconfig/smbsharemodes.pc ../examples/libsmbclient/Makefile.internal"
+ac_config_files="$ac_config_files Makefile script/findsmb smbadduser script/installbin.sh script/uninstallbin.sh lib/netapi/examples/Makefile lib/netapi/tests/Makefile pkgconfig/smbclient.pc pkgconfig/wbclient.pc pkgconfig/netapi.pc pkgconfig/smbsharemodes.pc ../examples/libsmbclient/Makefile.internal"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -41078,16 +41290,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
+    # In both cases, we have to default to `cp -p'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
+      as_ln_s='cp -p'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -pR'
+    as_ln_s='cp -p'
   fi
 else
-  as_ln_s='cp -pR'
+  as_ln_s='cp -p'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -41147,16 +41359,28 @@ else
   as_mkdir_p=false
 fi
 
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -41178,7 +41402,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # values after options handling.
 ac_log="
 This file was extended by Samba $as_me 3, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -41244,10 +41468,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 Samba config.status 3
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -41337,7 +41561,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -41375,7 +41599,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
+    "include/autoconf/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/autoconf/config.h" ;;
     "rm-stdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS rm-stdint.h" ;;
     "mk-stdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS mk-stdint.h" ;;
     "rm-stdbool.h") CONFIG_COMMANDS="$CONFIG_COMMANDS rm-stdbool.h" ;;
@@ -41384,7 +41608,6 @@ do
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "script/findsmb") CONFIG_FILES="$CONFIG_FILES script/findsmb" ;;
     "smbadduser") CONFIG_FILES="$CONFIG_FILES smbadduser" ;;
-    "script/gen-8bit-gap.sh") CONFIG_FILES="$CONFIG_FILES script/gen-8bit-gap.sh" ;;
     "script/installbin.sh") CONFIG_FILES="$CONFIG_FILES script/installbin.sh" ;;
     "script/uninstallbin.sh") CONFIG_FILES="$CONFIG_FILES script/uninstallbin.sh" ;;
     "lib/netapi/examples/Makefile") CONFIG_FILES="$CONFIG_FILES lib/netapi/examples/Makefile" ;;