Getting ready to add UNIX extensions in HEAD also.
[jra/samba/.git] / source / configure
index aa2325f8ebef69d0e38cbacb44b0884d109b50b0..ba55c698fa9881bc2040ce1b88c42b2cf522764e 100755 (executable)
@@ -13,97 +13,67 @@ ac_default_prefix=/usr/local
 # Any additions from configure.in:
 ac_default_prefix=/usr/local/samba
 ac_help="$ac_help
-  --enable-debug        turn on debugging [default=no]"
+  --enable-debug          turn on debugging [default=no]"
 ac_help="$ac_help
-  --enable-shared[=PKGS]  build shared libraries [default=yes]"
+  --enable-developer      turn on developer warnings and debugging [default=no]"
 ac_help="$ac_help
-  --enable-static[=PKGS]  build static libraries [default=yes]"
+  --enable-dmalloc          enable heap debugging [default=no]"
 ac_help="$ac_help
-  --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
+  --with-readline[=DIR]   Look for readline include/libs in DIR (default=auto) "
 ac_help="$ac_help
-  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
+  --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) "
 ac_help="$ac_help
-  --disable-libtool-lock  avoid locking (might break parallel builds)"
+  --with-smbwrapper       Include SMB wrapper support (default=no) "
 ac_help="$ac_help
-  --with-codepagedir=DIR     Where to put codepage files (\$libdir/codepages)"
+  --with-afs              Include AFS clear-text auth support (default=no) "
 ac_help="$ac_help
-  --with-readline[=DIR]   Look for readline include/libs in DIR
-  --without-readline      Don't include readline support"
+  --with-dce-dfs          Include DCE/DFS clear-text auth support (default=no)"
 ac_help="$ac_help
-  --with-smbwrapper     Include SMB wrapper support
-  --without-smbwrapper  Don't include SMB wrapper support (default)"
+  --with-krb5=base-dir    Locate Kerberos 5 support (default=/usr)"
 ac_help="$ac_help
-  --with-afs     Include AFS support
-  --without-afs  Don't include AFS support (default)"
+  --with-automount        Include AUTOMOUNT support (default=no)"
 ac_help="$ac_help
-  --with-dfs     Include DFS support
-  --without-dfs  Don't include DFS support (default)"
+  --with-smbmount         Include SMBMOUNT (Linux only) support (default=no)"
 ac_help="$ac_help
-  --with-krb4=base-dir     Include Kerberos IV support
-  --without-krb4          Don't include Kerberos IV support (default)"
+  --with-pam              Include PAM support (default=no)"
 ac_help="$ac_help
-  --with-krb5=base-dir     Include Kerberos 5 support
-  --without-krb5          Don't include Kerberos 5 support (default)"
+  --with-pam_smbpass      Build a PAM module to allow other applications to use our smbpasswd file (default=no)"
 ac_help="$ac_help
-  --with-automount     Include AUTOMOUNT support
-  --without-automount  Don't include AUTOMOUNT support (default)"
+  --with-tdbsam           Include experimental TDB SAM support (default=no)"
 ac_help="$ac_help
-  --with-smbmount     Include SMBMOUNT (Linux only) support
-  --without-smbmount  Don't include SMBMOUNT support (default)"
+  --with-ldapsam          Include experimental LDAP SAM support (default=no)"
 ac_help="$ac_help
-  --with-pam     Include PAM password database support
-  --without-pam  Don't include PAM password database support (default)"
+  --with-nisplussam       Include NISPLUS SAM support (default=no)"
 ac_help="$ac_help
-  --with-pam_smbpass     Include the smbpass PAM module
-  --without-pam_smbpass  Don't include the smbpass PAM module (default)"
+  --with-nisplus-home     Include NISPLUS_HOME support (default=no)"
 ac_help="$ac_help
-  --with-tdbsam   Include experimental TDB password database
-  --without-tdbsam  Don't include experimental TDB password database (default)"
+  --with-ssl              Include SSL support (default=no)
+  --with-sslinc=DIR          Where the SSL includes are (defaults to /usr/local/ssl/include)
+  --with-ssllib=DIR          Where the SSL libraries are (defaults to /usr/local/ssl/lib)"
 ac_help="$ac_help
-  --with-ldap     Include LDAP support
-  --without-ldap  Don't include LDAP support (default)"
+  --with-syslog           Include experimental SYSLOG support (default=no)"
 ac_help="$ac_help
-  --with-nisplus     Include NISPLUS password database support
-  --without-nisplus  Don't include NISPLUS password database support (default)"
+  --with-profiling-data   Include gathering source code profile information (default=no)"
 ac_help="$ac_help
-  --with-nisplus-home     Include NISPLUS_HOME support
-  --without-nisplus-home  Don't include NISPLUS_HOME support (default)"
+  --with-quotas           Include experimental disk-quota support (default=no)"
 ac_help="$ac_help
-  --with-ssl     Include SSL support
-  --without-ssl  Don't include SSL support (default)
-  --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl)"
+  --with-utmp             Include experimental utmp accounting (default=no)"
 ac_help="$ac_help
-  --with-syslog     Include experimental SYSLOG support
-  --without-syslog  Don't include SYSLOG support (default)"
+  --with-privatedir=DIR   Where to put smbpasswd ($ac_default_prefix/private)"
 ac_help="$ac_help
-  --with-profile     Include profile support
-  --without-profile  Don't include profile support (default)"
+  --with-lockdir=DIR      Where to put lock files ($ac_default_prefix/var/locks)"
 ac_help="$ac_help
-  --with-netatalk     Include experimental Netatalk support
-  --without-netatalk  Don't include experimental Netatalk support (default)"
+  --with-swatdir=DIR      Where to put SWAT files ($ac_default_prefix/swat)"
 ac_help="$ac_help
-  --with-quotas     Include experimental disk-quota support
-  --without-quotas  Don't include experimental disk-quota support (default)"
+  --with-manpages-langs={en,ja,pl}  Choose man pages' language(s). (en)"
 ac_help="$ac_help
-  --with-utmp     Include experimental utmp accounting
-  --without-utmp  Don't include experimental utmp accounting (default)"
+  --with-spinlocks        Use spin locks instead of fcntl locks (default=no) "
 ac_help="$ac_help
-  --with-msdfs         Include MS Dfs support
-  --without-msdfs      Don't include MS Dfs support (default)"
+  --with-acl-support      Include ACL support (default=no)"
 ac_help="$ac_help
-  --with-privatedir=DIR     Where to put smbpasswd ($ac_default_prefix/private)"
+  --with-winbind          Build winbind (default, if supported by OS)"
 ac_help="$ac_help
-  --with-lockdir=DIR     Where to put lock files ($ac_default_prefix/var/locks)"
-ac_help="$ac_help
-  --with-swatdir=DIR     Where to put SWAT files ($ac_default_prefix/swat)"
-ac_help="$ac_help
-  --with-spinlocks        use spin locks instead of fcntl locks "
-ac_help="$ac_help
-  --with-acl-support        Include ACL support
-  --without-acl-support  Don't include ACL support (default)"
-ac_help="$ac_help
-  --with-winbind       Build winbind library (default, if supported by OS)
-  --without-winbind    Don't build winbind library"
+  --with-included-popt    use bundled popt library, not from system"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -615,7 +585,10 @@ fi
 
 
 
-# we want to be compatibe with older versions of Samba
+# we want to be compatible with older versions of Samba
+
+
+
 
 
 
@@ -642,11 +615,39 @@ if test "${enable_debug+set}" = set; then
 fi
 
 
+# Check whether --enable-developer or --disable-developer was given.
+if test "${enable_developer+set}" = set; then
+  enableval="$enable_developer"
+  if eval "test x$enable_developer = xyes"; then
+       CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -DDEBUG_PASSWORD -DDEVELOPER"
+    fi
+fi
+
+
+# Check whether --enable-dmalloc or --disable-dmalloc was given.
+if test "${enable_dmalloc+set}" = set; then
+  enableval="$enable_dmalloc"
+  :
+fi
+
+
+if test "x$enable_dmalloc" = xyes
+then
+       cat >> confdefs.h <<\EOF
+#define ENABLE_DMALLOC 1
+EOF
+
+       cat >> confdefs.h <<\EOF
+#define DMALLOC_FUNC_CHECK 1
+EOF
+
+       LIBS="$LIBS -ldmalloc"  
+fi
 
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:650: checking for $ac_word" >&5
+echo "configure:651: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -676,7 +677,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:680: checking for $ac_word" >&5
+echo "configure:681: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -727,7 +728,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:731: checking for $ac_word" >&5
+echo "configure:732: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -759,7 +760,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:763: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:764: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -770,12 +771,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 774 "configure"
+#line 775 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -801,12 +802,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:805: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:806: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:810: checking whether we are using GNU C" >&5
+echo "configure:811: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -815,7 +816,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -834,7 +835,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:838: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:839: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -896,7 +897,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:900: checking for a BSD compatible install" >&5
+echo "configure:901: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -948,12 +949,12 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-for ac_prog in mawk gawk nawk awk
+for ac_prog in gawk mawk nawk awk
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:957: checking for $ac_word" >&5
+echo "configure:958: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -982,83 +983,152 @@ fi
 test -n "$AWK" && break
 done
 
-# Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
-  enableval="$enable_shared"
-  p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
-  enable_shared=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_shared=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
+
+echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
+echo "configure:989: checking for POSIXized ISC" >&5
+if test -d /etc/conf/kconfig.d &&
+  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+then
+  echo "$ac_t""yes" 1>&6
+  ISC=yes # If later tests want to check for ISC.
+  cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+  if test "$GCC" = yes; then
+    CC="$CC -posix"
+  else
+    CC="$CC -Xp"
+  fi
 else
-  enable_shared=yes
-fi
-
-# Check whether --enable-static or --disable-static was given.
-if test "${enable_static+set}" = set; then
-  enableval="$enable_static"
-  p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
-  enable_static=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_static=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
+  echo "$ac_t""no" 1>&6
+  ISC=
+fi
+
+
+if test "x$CC" != xcc; then
+  echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
+echo "configure:1012: checking whether $CC and cc understand -c and -o together" >&5
 else
-  enable_static=yes
-fi
-
-# Check whether --enable-fast-install or --disable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
-  enableval="$enable_fast_install"
-  p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_fast_install=yes ;;
-no) enable_fast_install=no ;;
-*)
-  enable_fast_install=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_fast_install=yes
+  echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
+echo "configure:1015: checking whether cc understands -c and -o together" >&5
+fi
+set dummy $CC; ac_cc="`echo $2 |
+                      sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
+if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'foo(){}' > conftest.c
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
+if { (eval echo configure:1027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+   test -f conftest.o && { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+      ac_try='cc -c conftest.c -o conftest.o 1>&5'
+      if { (eval echo configure:1035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+        test -f conftest.o && { (eval echo configure:1036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+      then
+        # cc works too.
+        :
+      else
+        # cc exists but doesn't like -o.
+        eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
     fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f conftest*
+
+fi
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+  cat >> confdefs.h <<\EOF
+#define NO_MINUS_C_MINUS_O 1
+EOF
+
+fi
+
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
+      BROKEN_CC=
+else
+      BROKEN_CC=#
+fi
+
+
+echo $ac_n "checking that the C compiler understands volatile""... $ac_c" 1>&6
+echo "configure:1070: checking that the C compiler understands volatile" >&5
+if eval "test \"`echo '$''{'samba_cv_volatile'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+    cat > conftest.$ac_ext <<EOF
+#line 1076 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+volatile int i = 0
+; return 0; }
+EOF
+if { (eval echo configure:1083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_volatile=yes
 else
-  enable_fast_install=yes
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_volatile=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_volatile" 1>&6
+if test x"$samba_cv_volatile" = x"yes"; then
+   cat >> confdefs.h <<\EOF
+#define HAVE_VOLATILE 1
+EOF
+
 fi
 
 
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+#    same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+#    as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
 # Make sure we can run config.sub.
 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1062: checking host system type" >&5
+echo "configure:1132: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -1078,8 +1148,26 @@ host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:1153: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+  case $nonopt in
+  NONE) target_alias=$host_alias ;;
+  *) target_alias=$nonopt ;;
+  esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1083: checking build system type" >&5
+echo "configure:1171: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -1096,603 +1184,68 @@ build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$build" 1>&6
 
-# Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1103: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_RANLIB="ranlib"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
-  echo "$ac_t""$RANLIB" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
+test "$host_alias" != "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
 
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
-  withval="$with_gnu_ld"
-  test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
 
-ac_prog=ld
-if test "$ac_cv_prog_gcc" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1142: checking for ld used by GCC" >&5
-  ac_prog=`($CC -print-prog-name=ld) 2>&5`
-  case "$ac_prog" in
-    # Accept absolute paths.
-    [\\/]* | [A-Za-z]:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1166: checking for GNU ld" >&5
-else
-  echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1169: checking for non-GNU ld" >&5
-fi
-if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      ac_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
-       test "$with_gnu_ld" != no && break
-      else
-       test "$with_gnu_ld" != yes && break
-      fi
+  case "$host_os" in
+       *irix6*) cat >> confdefs.h <<\EOF
+#include <standards.h>
+EOF
+
+       ;;
+esac
+
+
+    
+    echo $ac_n "checking config.cache system type""... $ac_c" 1>&6
+echo "configure:1205: checking config.cache system type" >&5
+    if { test x"${ac_cv_host_system_type+set}" = x"set" &&
+         test x"$ac_cv_host_system_type" != x"$host"; } ||
+       { test x"${ac_cv_build_system_type+set}" = x"set" &&
+         test x"$ac_cv_build_system_type" != x"$build"; } ||
+       { test x"${ac_cv_target_system_type+set}" = x"set" &&
+         test x"$ac_cv_target_system_type" != x"$target"; }; then
+       echo "$ac_t""different" 1>&6
+       { echo "configure: error: "you must remove config.cache and restart configure"" 1>&2; exit 1; }
+    else
+       echo "$ac_t""same" 1>&6
     fi
-  done
-  IFS="$ac_save_ifs"
-else
-  ac_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
+    ac_cv_host_system_type="$host"
+    ac_cv_build_system_type="$build"
+    ac_cv_target_system_type="$target"
 
-LD="$ac_cv_path_LD"
-if test -n "$LD"; then
-  echo "$ac_t""$LD" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
-echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1204: checking if the linker ($LD) is GNU ld" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+
+#
+# Config CPPFLAG settings for strange OS's that must be set
+# before other tests.
+#
+case "$host_os" in
+# Try to work out if this is the native HPUX compiler that uses the -Ae flag.
+    *hpux*)
+      echo $ac_n "checking whether ${CC-cc} accepts -Ae""... $ac_c" 1>&6
+echo "configure:1230: checking whether ${CC-cc} accepts -Ae" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_Ae'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
-  ac_cv_prog_gnu_ld=yes
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -Ae -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_Ae=yes
 else
-  ac_cv_prog_gnu_ld=no
+  ac_cv_prog_cc_Ae=no
 fi
+rm -f conftest*
+
 fi
 
-echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
+echo "$ac_t""$ac_cv_prog_cc_Ae" 1>&6
+      # mmap on HPUX is completely broken...
+      cat >> confdefs.h <<\EOF
+#define MMAP_BLACKLIST 1
+EOF
 
-
-echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1220: checking for BSD-compatible nm" >&5
-if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$NM"; then
-  # Let the user override the test.
-  ac_cv_path_NM="$NM"
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
-      # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
-      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-       ac_cv_path_NM="$ac_dir/nm -B"
-       break
-      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-       ac_cv_path_NM="$ac_dir/nm -p"
-       break
-      else
-       ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
-       continue # so that we can try to find one that supports BSD flags
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
-fi
-fi
-
-NM="$ac_cv_path_NM"
-echo "$ac_t""$NM" 1>&6
-
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1256: checking whether ln -s works" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
-  rm -f conftestdata
-  ac_cv_prog_LN_S="ln -s"
-else
-  ac_cv_prog_LN_S=ln
-fi
-fi
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
-  echo "$ac_t""yes" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
-case "$target" in
-NONE) lt_target="$host" ;;
-*) lt_target="$target" ;;
-esac
-
-# Check for any special flags to pass to ltconfig.
-libtool_flags="--cache-file=$cache_file"
-test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
-test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
-test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
-
-
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
-  :
-fi
-
-test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
-test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case "$lt_target" in
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '#line 1305 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-    case "`/usr/bin/file conftest.o`" in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1327: checking whether the C compiler needs -belf" >&5
-if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1332 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:1339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  lt_cv_cc_needs_belf=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  lt_cv_cc_needs_belf=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-
-
-esac
-
-
-# Save cache, so that ltconfig can load it
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
-  case `(ac_space=' '; set | grep ac_space) 2>&1` in
-  *ac_space=\ *)
-    # `set' does not quote correctly, so add quotes (double-quote substitution
-    # turns \\\\ into \\, and sed turns \\ into \).
-    sed -n \
-      -e "s/'/'\\\\''/g" \
-      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
-    ;;
-  *)
-    # `set' quotes correctly as required by POSIX, so do not add quotes.
-    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
-    ;;
-  esac >> confcache
-if cmp -s $cache_file confcache; then
-  :
-else
-  if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
-  else
-    echo "not updating unwritable cache $cache_file"
-  fi
-fi
-rm -f confcache
-
-
-# Actually configure libtool.  ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
-DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
-|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
-
-# Reload cache, that may have been modified by ltconfig
-if test -r "$cache_file"; then
-  echo "loading cache $cache_file"
-  . $cache_file
-else
-  echo "creating cache $cache_file"
-  > $cache_file
-fi
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
-
-
-
-if test "x$CC" != xcc; then
-  echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
-echo "configure:1444: checking whether $CC and cc understand -c and -o together" >&5
-else
-  echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
-echo "configure:1447: checking whether cc understands -c and -o together" >&5
-fi
-set dummy $CC; ac_cc="`echo $2 |
-                      sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
-if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  echo 'foo(){}' > conftest.c
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
-if { (eval echo configure:1459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
-   test -f conftest.o && { (eval echo configure:1460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
-then
-  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
-  if test "x$CC" != xcc; then
-    # Test first that cc exists at all.
-    if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
-      ac_try='cc -c conftest.c -o conftest.o 1>&5'
-      if { (eval echo configure:1467: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
-        test -f conftest.o && { (eval echo configure:1468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
-      then
-        # cc works too.
-        :
-      else
-        # cc exists but doesn't like -o.
-        eval ac_cv_prog_cc_${ac_cc}_c_o=no
-      fi
-    fi
-  fi
-else
-  eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f conftest*
-
-fi
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-  cat >> confdefs.h <<\EOF
-#define NO_MINUS_C_MINUS_O 1
-EOF
-
-fi
-
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
-      BROKEN_CC=
-else
-      BROKEN_CC=#
-fi
-
-
-echo $ac_n "checking that the C compiler understands volatile""... $ac_c" 1>&6
-echo "configure:1502: checking that the C compiler understands volatile" >&5
-if eval "test \"`echo '$''{'samba_cv_volatile'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-    cat > conftest.$ac_ext <<EOF
-#line 1508 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-int main() {
-volatile int i = 0
-; return 0; }
-EOF
-if { (eval echo configure:1515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_volatile=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_volatile=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$samba_cv_volatile" 1>&6
-if test x"$samba_cv_volatile" = x"yes"; then
-   cat >> confdefs.h <<\EOF
-#define HAVE_VOLATILE 1
-EOF
-
-fi
-
-
-#################################################
-# set codepage directory location
-# Check whether --with-codepagedir or --without-codepagedir was given.
-if test "${with_codepagedir+set}" = set; then
-  withval="$with_codepagedir"
-   case "$withval" in
-  yes|no)
-  #
-  # Just in case anybody does it
-  #
-    echo "configure: warning: --with-codepagedir called without argument - will use default" 1>&2
-  ;;
-  * )
-    codepagedir="$withval"
-    ;;
-  esac
-fi
-
-
-
-
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-#    same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-#    as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
-esac
-
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1584: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
-  case $nonopt in
-  NONE)
-    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
-    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
-    fi ;;
-  *) host_alias=$nonopt ;;
-  esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1605: checking target system type" >&5
-
-target_alias=$target
-case "$target_alias" in
-NONE)
-  case $nonopt in
-  NONE) target_alias=$host_alias ;;
-  *) target_alias=$nonopt ;;
-  esac ;;
-esac
-
-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$target" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1623: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
-  case $nonopt in
-  NONE) build_alias=$host_alias ;;
-  *) build_alias=$nonopt ;;
-  esac ;;
-esac
-
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-
-test "$host_alias" != "$target_alias" &&
-  test "$program_prefix$program_suffix$program_transform_name" = \
-    NONENONEs,x,x, &&
-  program_prefix=${target_alias}-
-
-
-  case "$host_os" in
-       *irix6*) cat >> confdefs.h <<\EOF
-#include <standards.h>
-EOF
-
-       ;;
-esac
-
-
-    
-    echo $ac_n "checking config.cache system type""... $ac_c" 1>&6
-echo "configure:1657: checking config.cache system type" >&5
-    if { test x"${ac_cv_host_system_type+set}" = x"set" &&
-         test x"$ac_cv_host_system_type" != x"$host"; } ||
-       { test x"${ac_cv_build_system_type+set}" = x"set" &&
-         test x"$ac_cv_build_system_type" != x"$build"; } ||
-       { test x"${ac_cv_target_system_type+set}" = x"set" &&
-         test x"$ac_cv_target_system_type" != x"$target"; }; then
-       echo "$ac_t""different" 1>&6
-       { echo "configure: error: "you must remove config.cache and restart configure"" 1>&2; exit 1; }
-    else
-       echo "$ac_t""same" 1>&6
-    fi
-    ac_cv_host_system_type="$host"
-    ac_cv_build_system_type="$build"
-    ac_cv_target_system_type="$target"
-
-
-#
-# Config CPPFLAG settings for strange OS's that must be set
-# before other tests.
-#
-case "$host_os" in
-# Try to work out if this is the native HPUX compiler that uses the -Ae flag.
-    *hpux*)
-      echo $ac_n "checking whether ${CC-cc} accepts -Ae""... $ac_c" 1>&6
-echo "configure:1682: checking whether ${CC-cc} accepts -Ae" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_Ae'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -Ae -c conftest.c 2>&1`"; then
-  ac_cv_prog_cc_Ae=yes
-else
-  ac_cv_prog_cc_Ae=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_Ae" 1>&6
       if test $ac_cv_prog_cc_Ae = yes; then
         CPPFLAGS="$CPPFLAGS -Ae"
       fi
@@ -1718,6 +1271,14 @@ EOF
                                ;;
       esac
       ;;
+
+#
+# CRAY Unicos has broken const handling
+       *unicos*)
+         echo "$ac_t""disabling const" 1>&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.
@@ -1736,7 +1297,10 @@ EOF
 #
        *solaris*)
                case `uname -r` in
-                       5.6*|5.7*)
+                       5.0*|5.1*|5.2*|5.3*|5.5*)
+                               echo "$ac_t""no large file support" 1>&6
+                               ;;
+                       5.*)
                        echo "$ac_t""enabling large file support" 1>&6
                        if test "$ac_cv_prog_gcc" = yes; then
                                ${CC-cc} -v >conftest.c 2>&1
@@ -1762,14 +1326,14 @@ EOF
     *sysv4*)
       if test $host = mips-sni-sysv4 ; then
         echo $ac_n "checking for LFS support""... $ac_c" 1>&6
-echo "configure:1766: checking for LFS support" >&5
+echo "configure:1330: checking for LFS support" >&5
         old_CPPFLAGS="$CPPFLAGS"
         CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
         if test "$cross_compiling" = yes; then
   SINIX_LFS_SUPPORT=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 1773 "configure"
+#line 1337 "configure"
 #include "confdefs.h"
 
 #include <unistd.h>
@@ -1781,7 +1345,7 @@ exit(1);
 #endif
 }
 EOF
-if { (eval echo configure:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   SINIX_LFS_SUPPORT=yes
 else
@@ -1808,14 +1372,14 @@ fi
 #
     *linux*)
         echo $ac_n "checking for LFS support""... $ac_c" 1>&6
-echo "configure:1812: checking for LFS support" >&5
+echo "configure:1376: checking for LFS support" >&5
         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 > conftest.$ac_ext <<EOF
-#line 1819 "configure"
+#line 1383 "configure"
 #include "confdefs.h"
 
 #include <unistd.h>
@@ -1853,7 +1417,7 @@ main() {
 }
 
 EOF
-if { (eval echo configure:1857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   LINUX_LFS_SUPPORT=yes
 else
@@ -1874,14 +1438,14 @@ fi
 
     *hurd*)
         echo $ac_n "checking for LFS support""... $ac_c" 1>&6
-echo "configure:1878: checking for LFS support" >&5
+echo "configure:1442: checking for LFS support" >&5
         old_CPPFLAGS="$CPPFLAGS"
         CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
         if test "$cross_compiling" = yes; then
   GLIBC_LFS_SUPPORT=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 1885 "configure"
+#line 1449 "configure"
 #include "confdefs.h"
 
 #include <unistd.h>
@@ -1893,7 +1457,7 @@ exit(1);
 #endif
 }
 EOF
-if { (eval echo configure:1897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   GLIBC_LFS_SUPPORT=yes
 else
@@ -1915,21 +1479,21 @@ fi
 esac
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1919: checking for inline" >&5
+echo "configure:1483: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 1926 "configure"
+#line 1490 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:1933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -1955,7 +1519,7 @@ EOF
 esac
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1959: checking how to run the C preprocessor" >&5
+echo "configure:1523: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1970,13 +1534,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1974 "configure"
+#line 1538 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1987,13 +1551,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1991 "configure"
+#line 1555 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2004,13 +1568,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2008 "configure"
+#line 1572 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2035,12 +1599,12 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2039: checking for ANSI C header files" >&5
+echo "configure:1603: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2044 "configure"
+#line 1608 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2048,7 +1612,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2065,7 +1629,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2069 "configure"
+#line 1633 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2083,7 +1647,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2087 "configure"
+#line 1651 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2104,7 +1668,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2108 "configure"
+#line 1672 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2115,7 +1679,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:2119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2143,12 +1707,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:2147: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1711: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2152 "configure"
+#line 1716 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -2156,7 +1720,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:2160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -2181,7 +1745,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:2185: checking for opendir in -ldir" >&5
+echo "configure:1749: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2189,7 +1753,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2193 "configure"
+#line 1757 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2200,7 +1764,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2222,7 +1786,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2226: checking for opendir in -lx" >&5
+echo "configure:1790: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2230,7 +1794,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2234 "configure"
+#line 1798 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2241,7 +1805,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2264,12 +1828,12 @@ fi
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2268: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1832: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2273 "configure"
+#line 1837 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2278,7 +1842,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2299,12 +1863,12 @@ EOF
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2303: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1867: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2308 "configure"
+#line 1872 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -2320,7 +1884,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:2324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -2344,17 +1908,17 @@ for ac_hdr in arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2348: checking for $ac_hdr" >&5
+echo "configure:1912: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2353 "configure"
+#line 1917 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2384,17 +1948,17 @@ for ac_hdr in unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2388: checking for $ac_hdr" >&5
+echo "configure:1952: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2393 "configure"
+#line 1957 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2424,17 +1988,17 @@ for ac_hdr in compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2428: checking for $ac_hdr" >&5
+echo "configure:1992: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2433 "configure"
+#line 1997 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2460,21 +2024,21 @@ else
 fi
 done
 
-for ac_hdr in sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h
+for ac_hdr in sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2468: checking for $ac_hdr" >&5
+echo "configure:2032: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2473 "configure"
+#line 2037 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2504,17 +2068,17 @@ for ac_hdr in sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h std
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2508: checking for $ac_hdr" >&5
+echo "configure:2072: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2513 "configure"
+#line 2077 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2544,17 +2108,17 @@ for ac_hdr in sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h term
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2548: checking for $ac_hdr" >&5
+echo "configure:2112: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2553 "configure"
+#line 2117 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2584,17 +2148,17 @@ for ac_hdr in sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2588: checking for $ac_hdr" >&5
+echo "configure:2152: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2593 "configure"
+#line 2157 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2620,21 +2184,21 @@ else
 fi
 done
 
-for ac_hdr in security/pam_modules.h security/_pam_macros.h
+for ac_hdr in security/pam_modules.h security/_pam_macros.h ldap.h lber.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2628: checking for $ac_hdr" >&5
+echo "configure:2192: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2633 "configure"
+#line 2197 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2668,14 +2232,14 @@ done
 case "$host_os" in
     *hpux*)
                cat > conftest.$ac_ext <<EOF
-#line 2672 "configure"
+#line 2236 "configure"
 #include "confdefs.h"
 #include <shadow.h>
 int main() {
 struct spwd testme
 ; return 0; }
 EOF
-if { (eval echo configure:2679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_shadow_h=yes
 else
@@ -2697,17 +2261,17 @@ for ac_hdr in shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2701: checking for $ac_hdr" >&5
+echo "configure:2265: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2706 "configure"
+#line 2270 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2733,21 +2297,21 @@ else
 fi
 done
 
-for ac_hdr in nss.h nss_common.h sys/security.h security/pam_appl.h security/pam_modules.h
+for ac_hdr in nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2741: checking for $ac_hdr" >&5
+echo "configure:2305: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2746 "configure"
+#line 2310 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2777,17 +2341,17 @@ for ac_hdr in stropts.h poll.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2781: checking for $ac_hdr" >&5
+echo "configure:2345: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2786 "configure"
+#line 2350 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2817,17 +2381,17 @@ for ac_hdr in sys/capability.h syscall.h sys/syscall.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2821: checking for $ac_hdr" >&5
+echo "configure:2385: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2826 "configure"
+#line 2390 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2857,17 +2421,17 @@ for ac_hdr in sys/acl.h sys/cdefs.h glob.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2861: checking for $ac_hdr" >&5
+echo "configure:2425: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2866 "configure"
+#line 2430 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2899,17 +2463,17 @@ for ac_hdr in utmp.h utmpx.h lastlog.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2903: checking for $ac_hdr" >&5
+echo "configure:2467: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2908 "configure"
+#line 2472 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2941,17 +2505,59 @@ for ac_hdr in sys/fs/vx_quota.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2945: checking for $ac_hdr" >&5
+echo "configure:2509: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2950 "configure"
+#line 2514 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+# For quotas on Linux XFS filesystems
+for ac_hdr in linux/xqm.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2551: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2556 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2979,7 +2585,7 @@ done
 
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:2983: checking size of int" >&5
+echo "configure:2589: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2987,19 +2593,18 @@ else
   ac_cv_sizeof_int=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 2991 "configure"
+#line 2597 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-#include <sys/types.h>
-main()
+int main()
 {
   FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
+  if (!f) return(1);
   fprintf(f, "%d\n", sizeof(int));
-  exit(0);
+  return(0);
 }
 EOF
-if { (eval echo configure:3003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -3019,7 +2624,7 @@ EOF
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:3023: checking size of long" >&5
+echo "configure:2628: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3027,19 +2632,18 @@ else
   ac_cv_sizeof_long=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 3031 "configure"
+#line 2636 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-#include <sys/types.h>
-main()
+int main()
 {
   FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
+  if (!f) return(1);
   fprintf(f, "%d\n", sizeof(long));
-  exit(0);
+  return(0);
 }
 EOF
-if { (eval echo configure:3043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -3059,7 +2663,7 @@ EOF
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:3063: checking size of short" >&5
+echo "configure:2667: checking size of short" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3067,19 +2671,18 @@ else
   ac_cv_sizeof_short=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 3071 "configure"
+#line 2675 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-#include <sys/types.h>
-main()
+int main()
 {
   FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
+  if (!f) return(1);
   fprintf(f, "%d\n", sizeof(short));
-  exit(0);
+  return(0);
 }
 EOF
-if { (eval echo configure:3083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -3100,12 +2703,12 @@ EOF
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3104: checking for working const" >&5
+echo "configure:2707: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3109 "configure"
+#line 2712 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3154,7 +2757,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3175,21 +2778,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:3179: checking for inline" >&5
+echo "configure:2782: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 3186 "configure"
+#line 2789 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -3215,14 +2818,14 @@ EOF
 esac
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3219: checking whether byte ordering is bigendian" >&5
+echo "configure:2822: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 3226 "configure"
+#line 2829 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3233,11 +2836,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3241 "configure"
+#line 2844 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3248,7 +2851,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3268,7 +2871,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3272 "configure"
+#line 2875 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3281,7 +2884,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -3305,14 +2908,14 @@ EOF
 fi
 
 echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3309: checking whether char is unsigned" >&5
+echo "configure:2912: checking whether char is unsigned" >&5
 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$GCC" = yes; then
   # GCC predefines this symbol on systems where it applies.
 cat > conftest.$ac_ext <<EOF
-#line 3316 "configure"
+#line 2919 "configure"
 #include "confdefs.h"
 #ifdef __CHAR_UNSIGNED__
   yes
@@ -3334,7 +2937,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3338 "configure"
+#line 2941 "configure"
 #include "confdefs.h"
 /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
 #if !defined(__STDC__) || __STDC__ != 1
@@ -3344,7 +2947,7 @@ main() {
   volatile char c = 255; exit(c < 0);
 }
 EOF
-if { (eval echo configure:3348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_char_unsigned=yes
 else
@@ -3369,12 +2972,12 @@ fi
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3373: checking return type of signal handlers" >&5
+echo "configure:2976: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3378 "configure"
+#line 2981 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3391,7 +2994,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2998: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3410,12 +3013,12 @@ EOF
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3414: checking for uid_t in sys/types.h" >&5
+echo "configure:3017: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3419 "configure"
+#line 3022 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3444,12 +3047,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3448: checking for mode_t" >&5
+echo "configure:3051: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3453 "configure"
+#line 3056 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3477,12 +3080,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3481: checking for off_t" >&5
+echo "configure:3084: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3486 "configure"
+#line 3089 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3510,12 +3113,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3514: checking for size_t" >&5
+echo "configure:3117: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3519 "configure"
+#line 3122 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3543,12 +3146,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3547: checking for pid_t" >&5
+echo "configure:3150: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3552 "configure"
+#line 3155 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3576,12 +3179,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:3580: checking for st_rdev in struct stat" >&5
+echo "configure:3183: checking for st_rdev in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3585 "configure"
+#line 3188 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3589,7 +3192,7 @@ int main() {
 struct stat s; s.st_rdev;
 ; return 0; }
 EOF
-if { (eval echo configure:3593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_rdev=yes
 else
@@ -3610,12 +3213,12 @@ EOF
 fi
 
 echo $ac_n "checking for d_off in dirent""... $ac_c" 1>&6
-echo "configure:3614: checking for d_off in dirent" >&5
+echo "configure:3217: checking for d_off in dirent" >&5
 if eval "test \"`echo '$''{'ac_cv_dirent_d_off'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3619 "configure"
+#line 3222 "configure"
 #include "confdefs.h"
 
 #include <unistd.h>
@@ -3625,7 +3228,7 @@ int main() {
 struct dirent d; d.d_off;
 ; return 0; }
 EOF
-if { (eval echo configure:3629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_dirent_d_off=yes
 else
@@ -3646,12 +3249,12 @@ EOF
 fi
 
 echo $ac_n "checking for ino_t""... $ac_c" 1>&6
-echo "configure:3650: checking for ino_t" >&5
+echo "configure:3253: checking for ino_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3655 "configure"
+#line 3258 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3679,12 +3282,12 @@ EOF
 fi
 
 echo $ac_n "checking for loff_t""... $ac_c" 1>&6
-echo "configure:3683: checking for loff_t" >&5
+echo "configure:3286: checking for loff_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_loff_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3688 "configure"
+#line 3291 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3712,12 +3315,12 @@ EOF
 fi
 
 echo $ac_n "checking for offset_t""... $ac_c" 1>&6
-echo "configure:3716: checking for offset_t" >&5
+echo "configure:3319: checking for offset_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_offset_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3721 "configure"
+#line 3324 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3745,12 +3348,12 @@ EOF
 fi
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:3749: checking for ssize_t" >&5
+echo "configure:3352: checking for ssize_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3754 "configure"
+#line 3357 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3778,12 +3381,12 @@ EOF
 fi
 
 echo $ac_n "checking for wchar_t""... $ac_c" 1>&6
-echo "configure:3782: checking for wchar_t" >&5
+echo "configure:3385: checking for wchar_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_wchar_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3787 "configure"
+#line 3390 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3811,9 +3414,11 @@ EOF
 fi
 
 
-# we need libcups for CUPS support...
+############################################
+# for cups support we need libcups, and a handful of header files
+
 echo $ac_n "checking for httpConnect in -lcups""... $ac_c" 1>&6
-echo "configure:3817: checking for httpConnect in -lcups" >&5
+echo "configure:3422: checking for httpConnect in -lcups" >&5
 ac_lib_var=`echo cups'_'httpConnect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3821,7 +3426,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcups  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3825 "configure"
+#line 3430 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3832,7 +3437,7 @@ int main() {
 httpConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:3836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3860,9 +3465,63 @@ else
 fi
 
 
+# I wonder if there is a nicer way of doing this?
+
+if test x"$ac_cv_lib_cups_httpConnect" = x"yes"; then
+        for ac_hdr in cups/cups.h cups/language.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3476: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3481 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+        if test x"$ac_cv_header_cups_cups_h" = x"yes"; then
+                if test x"$ac_cv_header_cups_language_h" = x"yes"; then
+                        cat >> confdefs.h <<\EOF
+#define HAVE_CUPS 1
+EOF
+
+                fi
+        fi
+fi
+
+############################################
 # we need libdl for PAM and the new VFS code
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:3866: checking for dlopen in -ldl" >&5
+echo "configure:3525: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3870,7 +3529,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3874 "configure"
+#line 3533 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3881,7 +3540,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:3885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3901,19 +3560,105 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 #define HAVE_LIBDL 1
 EOF
 
-else
-  echo "$ac_t""no" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+############################################
+# check if the compiler can do immediate structures
+echo $ac_n "checking for immediate structures""... $ac_c" 1>&6
+echo "configure:3572: checking for immediate structures" >&5
+if eval "test \"`echo '$''{'samba_cv_immediate_structures'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+    cat > conftest.$ac_ext <<EOF
+#line 3578 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+int main() {
+
+   #define X_FOOBAR(x) ((FOOBAR) { x })
+   typedef struct {unsigned x;} FOOBAR;
+   FOOBAR f = X_FOOBAR(1);   
+
+; return 0; }
+EOF
+if { (eval echo configure:3590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_immediate_structures=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_immediate_structures=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_immediate_structures" 1>&6
+if test x"$samba_cv_immediate_structures" = x"yes"; then
+   cat >> confdefs.h <<\EOF
+#define HAVE_IMMEDIATE_STRUCTURES 1
+EOF
+
+fi
+
+############################################
+# check for unix domain sockets
+echo $ac_n "checking for unix domain sockets""... $ac_c" 1>&6
+echo "configure:3613: checking for unix domain sockets" >&5
+if eval "test \"`echo '$''{'samba_cv_unixsocket'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+    cat > conftest.$ac_ext <<EOF
+#line 3619 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+int main() {
+
+  struct sockaddr_un sunaddr; 
+  sunaddr.sun_family = AF_UNIX;
+
+; return 0; }
+EOF
+if { (eval echo configure:3634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_unixsocket=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_unixsocket=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_unixsocket" 1>&6
+if test x"$samba_cv_unixsocket" = x"yes"; then
+   cat >> confdefs.h <<\EOF
+#define HAVE_UNIXSOCKET 1
+EOF
+
 fi
 
 
 echo $ac_n "checking for socklen_t type""... $ac_c" 1>&6
-echo "configure:3911: checking for socklen_t type" >&5
+echo "configure:3656: checking for socklen_t type" >&5
 if eval "test \"`echo '$''{'samba_cv_socklen_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 3917 "configure"
+#line 3662 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -3926,7 +3671,7 @@ int main() {
 socklen_t i = 0
 ; return 0; }
 EOF
-if { (eval echo configure:3930: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_socklen_t=yes
 else
@@ -3947,13 +3692,13 @@ EOF
 fi
 
 echo $ac_n "checking for sig_atomic_t type""... $ac_c" 1>&6
-echo "configure:3951: checking for sig_atomic_t type" >&5
+echo "configure:3696: checking for sig_atomic_t type" >&5
 if eval "test \"`echo '$''{'samba_cv_sig_atomic_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 3957 "configure"
+#line 3702 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -3966,7 +3711,7 @@ int main() {
 sig_atomic_t i = 0
 ; return 0; }
 EOF
-if { (eval echo configure:3970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_sig_atomic_t=yes
 else
@@ -3989,20 +3734,20 @@ fi
 # stupid headers have the functions but no declaration. grrrr.
 
  echo $ac_n "checking for errno declaration""... $ac_c" 1>&6
-echo "configure:3993: checking for errno declaration" >&5
+echo "configure:3738: checking for errno declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_have_errno_decl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 3999 "configure"
+#line 3744 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 int i = (int)errno
 ; return 0; }
 EOF
-if { (eval echo configure:4006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_errno_decl=yes
 else
@@ -4024,20 +3769,20 @@ EOF
 
 
  echo $ac_n "checking for setresuid declaration""... $ac_c" 1>&6
-echo "configure:4028: checking for setresuid declaration" >&5
+echo "configure:3773: checking for setresuid declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_have_setresuid_decl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 4034 "configure"
+#line 3779 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 int main() {
 int i = (int)setresuid
 ; return 0; }
 EOF
-if { (eval echo configure:4041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_setresuid_decl=yes
 else
@@ -4059,20 +3804,20 @@ EOF
 
 
  echo $ac_n "checking for setresgid declaration""... $ac_c" 1>&6
-echo "configure:4063: checking for setresgid declaration" >&5
+echo "configure:3808: checking for setresgid declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_have_setresgid_decl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 4069 "configure"
+#line 3814 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 int main() {
 int i = (int)setresgid
 ; return 0; }
 EOF
-if { (eval echo configure:4076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_setresgid_decl=yes
 else
@@ -4094,20 +3839,20 @@ EOF
 
 
  echo $ac_n "checking for asprintf declaration""... $ac_c" 1>&6
-echo "configure:4098: checking for asprintf declaration" >&5
+echo "configure:3843: checking for asprintf declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_have_asprintf_decl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 4104 "configure"
+#line 3849 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 int i = (int)asprintf
 ; return 0; }
 EOF
-if { (eval echo configure:4111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_asprintf_decl=yes
 else
@@ -4129,20 +3874,20 @@ EOF
 
 
  echo $ac_n "checking for vasprintf declaration""... $ac_c" 1>&6
-echo "configure:4133: checking for vasprintf declaration" >&5
+echo "configure:3878: checking for vasprintf declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_have_vasprintf_decl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 4139 "configure"
+#line 3884 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 int i = (int)vasprintf
 ; return 0; }
 EOF
-if { (eval echo configure:4146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3891: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_vasprintf_decl=yes
 else
@@ -4164,20 +3909,20 @@ EOF
 
 
  echo $ac_n "checking for vsnprintf declaration""... $ac_c" 1>&6
-echo "configure:4168: checking for vsnprintf declaration" >&5
+echo "configure:3913: checking for vsnprintf declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_have_vsnprintf_decl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 4174 "configure"
+#line 3919 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 int i = (int)vsnprintf
 ; return 0; }
 EOF
-if { (eval echo configure:4181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_vsnprintf_decl=yes
 else
@@ -4199,20 +3944,20 @@ EOF
 
 
  echo $ac_n "checking for snprintf declaration""... $ac_c" 1>&6
-echo "configure:4203: checking for snprintf declaration" >&5
+echo "configure:3948: checking for snprintf declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_have_snprintf_decl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 4209 "configure"
+#line 3954 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 int i = (int)snprintf
 ; return 0; }
 EOF
-if { (eval echo configure:4216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_snprintf_decl=yes
 else
@@ -4236,7 +3981,7 @@ EOF
 # and glibc has setresuid under linux but the function does
 # nothing until kernel 2.1.44! very dumb.
 echo $ac_n "checking for real setresuid""... $ac_c" 1>&6
-echo "configure:4240: checking for real setresuid" >&5
+echo "configure:3985: checking for real setresuid" >&5
 if eval "test \"`echo '$''{'samba_cv_have_setresuid'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4245,12 +3990,12 @@ else
   samba_cv_have_setresuid=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 4249 "configure"
+#line 3994 "configure"
 #include "confdefs.h"
 #include <errno.h>
 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}
 EOF
-if { (eval echo configure:4254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_have_setresuid=yes
 else
@@ -4275,7 +4020,7 @@ fi
 # Do the same check for setresguid...
 #
 echo $ac_n "checking for real setresgid""... $ac_c" 1>&6
-echo "configure:4279: checking for real setresgid" >&5
+echo "configure:4024: checking for real setresgid" >&5
 if eval "test \"`echo '$''{'samba_cv_have_setresgid'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4284,13 +4029,13 @@ else
   samba_cv_have_setresgid=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 4288 "configure"
+#line 4033 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 #include <errno.h>
 main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}
 EOF
-if { (eval echo configure:4294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_have_setresgid=yes
 else
@@ -4313,7 +4058,7 @@ EOF
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:4317: checking for 8-bit clean memcmp" >&5
+echo "configure:4062: checking for 8-bit clean memcmp" >&5
 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4321,7 +4066,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 4325 "configure"
+#line 4070 "configure"
 #include "confdefs.h"
 
 main()
@@ -4331,7 +4076,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:4335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -4354,12 +4099,12 @@ test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4358: checking for $ac_func" >&5
+echo "configure:4103: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4363 "configure"
+#line 4108 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4382,7 +4127,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4408,7 +4153,7 @@ done
 
 if test x"$ac_cv_func_crypt" = x"no"; then
     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:4412: checking for crypt in -lcrypt" >&5
+echo "configure:4157: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4416,7 +4161,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4420 "configure"
+#line 4165 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4427,7 +4172,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:4431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4460,7 +4205,7 @@ test "${with_readline+set}" != "set" && with_readline=yes
 
 # test for where we get readline() from
 echo $ac_n "checking whether to use readline""... $ac_c" 1>&6
-echo "configure:4464: checking whether to use readline" >&5
+echo "configure:4209: checking whether to use readline" >&5
 # Check whether --with-readline or --without-readline was given.
 if test "${with_readline+set}" = set; then
   withval="$with_readline"
@@ -4472,17 +4217,17 @@ if test "${with_readline+set}" = set; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4476: checking for $ac_hdr" >&5
+echo "configure:4221: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4481 "configure"
+#line 4226 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4512,17 +4257,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4516: checking for $ac_hdr" >&5
+echo "configure:4261: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4521 "configure"
+#line 4266 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4553,17 +4298,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4557: checking for $ac_hdr" >&5
+echo "configure:4302: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4562 "configure"
+#line 4307 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4586,7 +4331,7 @@ EOF
  
       for termlib in ncurses curses termcap terminfo termlib; do
        echo $ac_n "checking for tgetent in -l${termlib}""... $ac_c" 1>&6
-echo "configure:4590: checking for tgetent in -l${termlib}" >&5
+echo "configure:4335: checking for tgetent in -l${termlib}" >&5
 ac_lib_var=`echo ${termlib}'_'tgetent | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4594,7 +4339,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l${termlib}  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4598 "configure"
+#line 4343 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4605,7 +4350,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:4609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4627,7 +4372,7 @@ fi
 
       done
       echo $ac_n "checking for rl_callback_handler_install in -lreadline""... $ac_c" 1>&6
-echo "configure:4631: checking for rl_callback_handler_install in -lreadline" >&5
+echo "configure:4376: checking for rl_callback_handler_install in -lreadline" >&5
 ac_lib_var=`echo readline'_'rl_callback_handler_install | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4635,7 +4380,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline $TERMLIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4639 "configure"
+#line 4384 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4646,7 +4391,7 @@ int main() {
 rl_callback_handler_install()
 ; return 0; }
 EOF
-if { (eval echo configure:4650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4697,17 +4442,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4701: checking for $ac_hdr" >&5
+echo "configure:4446: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4706 "configure"
+#line 4451 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4737,17 +4482,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4741: checking for $ac_hdr" >&5
+echo "configure:4486: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4746 "configure"
+#line 4491 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4778,17 +4523,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4782: checking for $ac_hdr" >&5
+echo "configure:4527: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4787 "configure"
+#line 4532 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4792: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4811,7 +4556,7 @@ EOF
  
       for termlib in ncurses curses termcap terminfo termlib; do
        echo $ac_n "checking for tgetent in -l${termlib}""... $ac_c" 1>&6
-echo "configure:4815: checking for tgetent in -l${termlib}" >&5
+echo "configure:4560: checking for tgetent in -l${termlib}" >&5
 ac_lib_var=`echo ${termlib}'_'tgetent | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4819,7 +4564,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l${termlib}  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4823 "configure"
+#line 4568 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4830,7 +4575,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:4834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4852,7 +4597,7 @@ fi
 
       done
       echo $ac_n "checking for rl_callback_handler_install in -lreadline""... $ac_c" 1>&6
-echo "configure:4856: checking for rl_callback_handler_install in -lreadline" >&5
+echo "configure:4601: checking for rl_callback_handler_install in -lreadline" >&5
 ac_lib_var=`echo readline'_'rl_callback_handler_install | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4860,7 +4605,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline $TERMLIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4864 "configure"
+#line 4609 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4871,7 +4616,7 @@ int main() {
 rl_callback_handler_install()
 ; return 0; }
 EOF
-if { (eval echo configure:4875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4917,6 +4662,53 @@ fi
 
 
 
+# The readline API changed slightly from readline3 to readline4, so
+# code will generate warnings on one of them unless we have a few
+# special cases.
+echo $ac_n "checking for rl_completion_matches in -lreadline""... $ac_c" 1>&6
+echo "configure:4670: checking for rl_completion_matches in -lreadline" >&5
+ac_lib_var=`echo readline'_'rl_completion_matches | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lreadline $TERMLIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4678 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char rl_completion_matches();
+
+int main() {
+rl_completion_matches()
+; return 0; }
+EOF
+if { (eval echo configure:4689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_NEW_LIBREADLINE 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
 # The following test taken from the cvs sources
 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
@@ -4926,12 +4718,12 @@ fi
 for ac_func in connect
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4930: checking for $ac_func" >&5
+echo "configure:4722: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4935 "configure"
+#line 4727 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4954,7 +4746,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4982,7 +4774,7 @@ if test x"$ac_cv_func_connect" = x"no"; then
     case "$LIBS" in
     *-lnsl*) ;;
     *) echo $ac_n "checking for printf in -lnsl_s""... $ac_c" 1>&6
-echo "configure:4986: checking for printf in -lnsl_s" >&5
+echo "configure:4778: checking for printf in -lnsl_s" >&5
 ac_lib_var=`echo nsl_s'_'printf | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4990,7 +4782,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4994 "configure"
+#line 4786 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5001,7 +4793,7 @@ int main() {
 printf()
 ; return 0; }
 EOF
-if { (eval echo configure:5005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5032,7 +4824,7 @@ fi
     case "$LIBS" in
     *-lnsl*) ;;
     *) echo $ac_n "checking for printf in -lnsl""... $ac_c" 1>&6
-echo "configure:5036: checking for printf in -lnsl" >&5
+echo "configure:4828: checking for printf in -lnsl" >&5
 ac_lib_var=`echo nsl'_'printf | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5040,7 +4832,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5044 "configure"
+#line 4836 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5051,7 +4843,7 @@ int main() {
 printf()
 ; return 0; }
 EOF
-if { (eval echo configure:5055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5082,7 +4874,7 @@ fi
     case "$LIBS" in
     *-lsocket*) ;;
     *) echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:5086: checking for connect in -lsocket" >&5
+echo "configure:4878: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5090,7 +4882,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5094 "configure"
+#line 4886 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5101,7 +4893,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:5105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5132,7 +4924,7 @@ fi
     case "$LIBS" in
     *-linet*) ;;
     *) echo $ac_n "checking for connect in -linet""... $ac_c" 1>&6
-echo "configure:5136: checking for connect in -linet" >&5
+echo "configure:4928: checking for connect in -linet" >&5
 ac_lib_var=`echo inet'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5140,7 +4932,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5144 "configure"
+#line 4936 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5151,7 +4943,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:5155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5195,12 +4987,12 @@ fi
 for ac_func in yp_get_default_domain
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5199: checking for $ac_func" >&5
+echo "configure:4991: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5204 "configure"
+#line 4996 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5223,7 +5015,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5249,7 +5041,7 @@ done
 
 if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then
        echo $ac_n "checking for yp_get_default_domain in -lnsl""... $ac_c" 1>&6
-echo "configure:5253: checking for yp_get_default_domain in -lnsl" >&5
+echo "configure:5045: checking for yp_get_default_domain in -lnsl" >&5
 ac_lib_var=`echo nsl'_'yp_get_default_domain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5257,7 +5049,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5261 "configure"
+#line 5053 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5268,7 +5060,7 @@ int main() {
 yp_get_default_domain()
 ; return 0; }
 EOF
-if { (eval echo configure:5272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5283,27 +5075,253 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIBS="$LIBS -lnsl";
-       cat >> confdefs.h <<\EOF
-#define HAVE_YP_GET_DEFAULT_DOMAIN 1
+  LIBS="$LIBS -lnsl";
+       cat >> confdefs.h <<\EOF
+#define HAVE_YP_GET_DEFAULT_DOMAIN 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+fi
+
+# Check if we have execl, if not we need to compile smbrun.
+for ac_func in execl
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5094: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5099 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:5122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+if test x"$ac_cv_func_execl" = x"no"; then
+    RUNPROG="bin/smbrun"
+else
+    RUNPROG=""
+fi
+
+for ac_func in waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5155: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5160 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:5183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5210: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5215 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5265: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5270 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:5293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
 EOF
-
 else
   echo "$ac_t""no" 1>&6
 fi
-fi
+done
 
-# Check if we have execl, if not we need to compile smbrun.
-for ac_func in execl
+for ac_func in strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5302: checking for $ac_func" >&5
+echo "configure:5320: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5307 "configure"
+#line 5325 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5326,7 +5344,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5350,21 +5368,15 @@ else
 fi
 done
 
-if test x"$ac_cv_func_execl" = x"no"; then
-    RUNPROG="bin/smbrun"
-else
-    RUNPROG=""
-fi
-
-for ac_func in waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot
+for ac_func in initgroups select poll rdchk getgrnam getgrent pathconf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5363: checking for $ac_func" >&5
+echo "configure:5375: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5368 "configure"
+#line 5380 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5387,7 +5399,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5411,15 +5423,15 @@ else
 fi
 done
 
-for ac_func in fstat strchr utime utimes getrlimit fsync bzero memset
+for ac_func in setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5418: checking for $ac_func" >&5
+echo "configure:5430: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5423 "configure"
+#line 5435 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5442,7 +5454,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5466,15 +5478,15 @@ else
 fi
 done
 
-for ac_func in memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid
+for ac_func in lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5473: checking for $ac_func" >&5
+echo "configure:5485: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5478 "configure"
+#line 5490 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5497,7 +5509,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5521,15 +5533,15 @@ else
 fi
 done
 
-for ac_func in strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent
+for ac_func in fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5528: checking for $ac_func" >&5
+echo "configure:5540: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5533 "configure"
+#line 5545 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5552,7 +5564,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5576,15 +5588,15 @@ else
 fi
 done
 
-for ac_func in initgroups select poll rdchk getgrnam getgrent pathconf
+for ac_func in srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5583: checking for $ac_func" >&5
+echo "configure:5595: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5588 "configure"
+#line 5600 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5607,7 +5619,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5631,15 +5643,15 @@ else
 fi
 done
 
-for ac_func in setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64
+for ac_func in syslog vsyslog
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5638: checking for $ac_func" >&5
+echo "configure:5650: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5643 "configure"
+#line 5655 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5662,7 +5674,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5686,15 +5698,16 @@ else
 fi
 done
 
-for ac_func in lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64
+# setbuffer is needed for smbtorture
+for ac_func in setbuffer
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5693: checking for $ac_func" >&5
+echo "configure:5706: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5698 "configure"
+#line 5711 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5717,7 +5730,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5741,15 +5754,17 @@ else
 fi
 done
 
-for ac_func in fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf
+
+# syscall() is needed for smbwrapper.
+for ac_func in syscall
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5748: checking for $ac_func" >&5
+echo "configure:5763: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5753 "configure"
+#line 5768 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5772,7 +5787,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5796,15 +5811,16 @@ else
 fi
 done
 
-for ac_func in srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink
+
+for ac_func in _dup _dup2 _opendir _readdir _seekdir _telldir _closedir
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5803: checking for $ac_func" >&5
+echo "configure:5819: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5808 "configure"
+#line 5824 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5827,7 +5843,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5851,16 +5867,15 @@ else
 fi
 done
 
-# setbuffer is needed for smbtorture
-for ac_func in setbuffer
+for ac_func in __dup __dup2 __opendir __readdir __seekdir __telldir __closedir
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5859: checking for $ac_func" >&5
+echo "configure:5874: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5864 "configure"
+#line 5879 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5883,7 +5898,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5907,17 +5922,15 @@ else
 fi
 done
 
-
-# syscall() is needed for smbwrapper.
-for ac_func in syscall
+for ac_func in __getcwd _getcwd
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5916: checking for $ac_func" >&5
+echo "configure:5929: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5921 "configure"
+#line 5934 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5940,7 +5953,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5964,16 +5977,15 @@ else
 fi
 done
 
-
-for ac_func in _dup _dup2 _opendir _readdir _seekdir _telldir _closedir
+for ac_func in __xstat __fxstat __lxstat
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5972: checking for $ac_func" >&5
+echo "configure:5984: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5977 "configure"
+#line 5989 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5996,7 +6008,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6020,15 +6032,15 @@ else
 fi
 done
 
-for ac_func in __dup __dup2 __opendir __readdir __seekdir __telldir __closedir
+for ac_func in _stat _lstat _fstat __stat __lstat __fstat
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6027: checking for $ac_func" >&5
+echo "configure:6039: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6032 "configure"
+#line 6044 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6051,7 +6063,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6075,15 +6087,15 @@ else
 fi
 done
 
-for ac_func in __getcwd _getcwd
+for ac_func in _acl __acl _facl __facl _open __open _chdir __chdir
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6082: checking for $ac_func" >&5
+echo "configure:6094: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6087 "configure"
+#line 6099 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6106,7 +6118,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6130,15 +6142,15 @@ else
 fi
 done
 
-for ac_func in __xstat __fxstat __lxstat
+for ac_func in _close __close _fchdir __fchdir _fcntl __fcntl
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6137: checking for $ac_func" >&5
+echo "configure:6149: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6142 "configure"
+#line 6154 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6161,7 +6173,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6185,15 +6197,15 @@ else
 fi
 done
 
-for ac_func in _stat _lstat _fstat __stat __lstat __fstat
+for ac_func in getdents _getdents __getdents _lseek __lseek _read __read
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6192: checking for $ac_func" >&5
+echo "configure:6204: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6197 "configure"
+#line 6209 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6216,7 +6228,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6240,15 +6252,15 @@ else
 fi
 done
 
-for ac_func in _acl __acl _facl __facl _open __open _chdir __chdir
+for ac_func in _write __write _fork __fork
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6247: checking for $ac_func" >&5
+echo "configure:6259: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6252 "configure"
+#line 6264 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6271,7 +6283,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6295,15 +6307,15 @@ else
 fi
 done
 
-for ac_func in _close __close _fchdir __fchdir _fcntl __fcntl
+for ac_func in _stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6302: checking for $ac_func" >&5
+echo "configure:6314: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6307 "configure"
+#line 6319 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6326,7 +6338,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6350,15 +6362,15 @@ else
 fi
 done
 
-for ac_func in getdents _getdents __getdents _lseek __lseek _read __read
+for ac_func in __sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6357: checking for $ac_func" >&5
+echo "configure:6369: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6362 "configure"
+#line 6374 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6381,7 +6393,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6405,15 +6417,15 @@ else
 fi
 done
 
-for ac_func in _write __write _fork __fork
+for ac_func in pread _pread __pread pread64 _pread64 __pread64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6412: checking for $ac_func" >&5
+echo "configure:6424: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6417 "configure"
+#line 6429 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6436,7 +6448,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6460,15 +6472,15 @@ else
 fi
 done
 
-for ac_func in _stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64
+for ac_func in pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6467: checking for $ac_func" >&5
+echo "configure:6479: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6472 "configure"
+#line 6484 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6491,7 +6503,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6515,15 +6527,15 @@ else
 fi
 done
 
-for ac_func in __sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64
+for ac_func in open64 _open64 __open64 creat64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6522: checking for $ac_func" >&5
+echo "configure:6534: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6527 "configure"
+#line 6539 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6546,7 +6558,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6570,15 +6582,176 @@ else
 fi
 done
 
-for ac_func in pread _pread __pread pread64 _pread64 __pread64
+
+#
+# stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
+#
+
+if test x$ac_cv_func_stat64 = xno ; then
+  echo $ac_n "checking for stat64 in <sys/stat.h>""... $ac_c" 1>&6
+echo "configure:6593: checking for stat64 in <sys/stat.h>" >&5
+  cat > conftest.$ac_ext <<EOF
+#line 6595 "configure"
+#include "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; }
+EOF
+if { (eval echo configure:6607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_func_stat64=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+  echo "$ac_t""$ac_cv_func_stat64" 1>&6
+  if test x$ac_cv_func_stat64 = xyes ; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_STAT64 1
+EOF
+
+  fi
+fi
+
+if test x$ac_cv_func_lstat64 = xno ; then
+  echo $ac_n "checking for lstat64 in <sys/stat.h>""... $ac_c" 1>&6
+echo "configure:6626: checking for lstat64 in <sys/stat.h>" >&5
+  cat > conftest.$ac_ext <<EOF
+#line 6628 "configure"
+#include "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; }
+EOF
+if { (eval echo configure:6640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_func_lstat64=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+  echo "$ac_t""$ac_cv_func_lstat64" 1>&6
+  if test x$ac_cv_func_lstat64 = xyes ; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_LSTAT64 1
+EOF
+
+  fi
+fi
+
+if test x$ac_cv_func_fstat64 = xno ; then
+  echo $ac_n "checking for fstat64 in <sys/stat.h>""... $ac_c" 1>&6
+echo "configure:6659: checking for fstat64 in <sys/stat.h>" >&5
+  cat > conftest.$ac_ext <<EOF
+#line 6661 "configure"
+#include "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; }
+EOF
+if { (eval echo configure:6673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_func_fstat64=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+  echo "$ac_t""$ac_cv_func_fstat64" 1>&6
+  if test x$ac_cv_func_fstat64 = xyes ; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_FSTAT64 1
+EOF
+
+  fi
+fi
+
+#####################################
+# we might need the resolv library on some systems
+echo $ac_n "checking for dn_expand in -lresolv""... $ac_c" 1>&6
+echo "configure:6693: checking for dn_expand in -lresolv" >&5
+ac_lib_var=`echo resolv'_'dn_expand | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lresolv  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6701 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dn_expand();
+
+int main() {
+dn_expand()
+; return 0; }
+EOF
+if { (eval echo configure:6712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lresolv $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+#
+# Check for the functions putprpwnam, set_auth_parameters,
+# getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
+# Needed for OSF1 and HPUX.
+#
+
+case "$LIBS" in
+  *-lsecurity*) for ac_func in putprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6577: checking for $ac_func" >&5
+echo "configure:6750: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6582 "configure"
+#line 6755 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6601,7 +6774,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6613,27 +6786,74 @@ fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+ ;;
+  *) echo $ac_n "checking for putprpwnam in -lsecurity""... $ac_c" 1>&6
+echo "configure:6803: checking for putprpwnam in -lsecurity" >&5
+ac_lib_var=`echo security'_'putprpwnam | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lsecurity  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6811 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char putprpwnam();
+
+int main() {
+putprpwnam()
+; return 0; }
+EOF
+if { (eval echo configure:6822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+    ac_tr_lib=HAVE_LIB`echo security | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+#define $ac_tr_lib 1
 EOF
+
+  LIBS="-lsecurity $LIBS"
+
 else
   echo "$ac_t""no" 1>&6
 fi
-done
-
-for ac_func in pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64
+     for ac_func in putprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6632: checking for $ac_func" >&5
+echo "configure:6852: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6637 "configure"
+#line 6857 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6656,7 +6876,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6680,15 +6900,19 @@ else
 fi
 done
 
-for ac_func in open64 _open64 __open64 creat64
+  ;;
+  esac
+
+case "$LIBS" in
+  *-lsec*) for ac_func in putprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6687: checking for $ac_func" >&5
+echo "configure:6911: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6692 "configure"
+#line 6916 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6711,7 +6935,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6734,180 +6958,123 @@ else
   echo "$ac_t""no" 1>&6
 fi
 done
-
-
-#
-# stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
-#
-
-if test x$ac_cv_func_stat64 = xno ; then
-  echo $ac_n "checking for stat64 in <sys/stat.h>""... $ac_c" 1>&6
-echo "configure:6746: checking for stat64 in <sys/stat.h>" >&5
-  cat > conftest.$ac_ext <<EOF
-#line 6748 "configure"
-#include "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; }
-EOF
-if { (eval echo configure:6760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_func_stat64=yes
+ ;;
+  *) echo $ac_n "checking for putprpwnam in -lsec""... $ac_c" 1>&6
+echo "configure:6964: checking for putprpwnam in -lsec" >&5
+ac_lib_var=`echo sec'_'putprpwnam | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-  echo "$ac_t""$ac_cv_func_stat64" 1>&6
-  if test x$ac_cv_func_stat64 = xyes ; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_STAT64 1
-EOF
-
-  fi
-fi
-
-if test x$ac_cv_func_lstat64 = xno ; then
-  echo $ac_n "checking for lstat64 in <sys/stat.h>""... $ac_c" 1>&6
-echo "configure:6779: checking for lstat64 in <sys/stat.h>" >&5
-  cat > conftest.$ac_ext <<EOF
-#line 6781 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lsec  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6972 "configure"
 #include "confdefs.h"
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/stat.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char putprpwnam();
 
 int main() {
-struct stat64 st64; exit(lstat64(".",&st64));
+putprpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:6793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ac_cv_func_lstat64=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-  echo "$ac_t""$ac_cv_func_lstat64" 1>&6
-  if test x$ac_cv_func_lstat64 = xyes ; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_LSTAT64 1
-EOF
+LIBS="$ac_save_LIBS"
 
-  fi
 fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo sec | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
 
-if test x$ac_cv_func_fstat64 = xno ; then
-  echo $ac_n "checking for fstat64 in <sys/stat.h>""... $ac_c" 1>&6
-echo "configure:6812: checking for fstat64 in <sys/stat.h>" >&5
-  cat > conftest.$ac_ext <<EOF
-#line 6814 "configure"
-#include "confdefs.h"
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/stat.h>
+  LIBS="-lsec $LIBS"
 
-int main() {
-struct stat64 st64; exit(fstat64(0,&st64));
-; return 0; }
-EOF
-if { (eval echo configure:6826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_func_fstat64=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-  echo "$ac_t""$ac_cv_func_fstat64" 1>&6
-  if test x$ac_cv_func_fstat64 = xyes ; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_FSTAT64 1
-EOF
-
-  fi
+  echo "$ac_t""no" 1>&6
 fi
-
-#
-# If no strcasecmp, check for it in some known places
-# It is in -lresolv on ReliantUNIX and UnixWare
-#   -lresolve *must* follow -lnsl for name resolution to work properly
-#
-
-if test x$ac_cv_func_strcasecmp = xno ; then
-       echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6
-echo "configure:6851: checking for strcasecmp in -lresolv" >&5
-ac_lib_var=`echo resolv'_'strcasecmp | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+     for ac_func in putprpwnam
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:7013: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lresolv  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6859 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 7018 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char strcasecmp();
+char $ac_func();
 
 int main() {
-strcasecmp()
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:6870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIBS="$LIBS -lresolv"
-               cat >> confdefs.h <<\EOF
-#define HAVE_STRCASECMP 1
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
 EOF
-
 else
   echo "$ac_t""no" 1>&6
 fi
+done
 
-fi
+  ;;
+  esac
 
-#
-# Check for the functions putprpwnam, set_auth_parameters,
-# getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
-# Needed for OSF1 and HPUX.
-#
 
 case "$LIBS" in
-  *-lsecurity*) for ac_func in putprpwnam
+  *-lsecurity*) for ac_func in set_auth_parameters
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6906: checking for $ac_func" >&5
+echo "configure:7073: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6911 "configure"
+#line 7078 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6930,7 +7097,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6954,27 +7121,27 @@ else
 fi
 done
  ;;
-  *) echo $ac_n "checking for putprpwnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:6959: checking for putprpwnam in -lsecurity" >&5
-ac_lib_var=`echo security'_'putprpwnam | sed 'y%./+-%__p_%'`
+  *) echo $ac_n "checking for set_auth_parameters in -lsecurity""... $ac_c" 1>&6
+echo "configure:7126: checking for set_auth_parameters in -lsecurity" >&5
+ac_lib_var=`echo security'_'set_auth_parameters | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lsecurity  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6967 "configure"
+#line 7134 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char putprpwnam();
+char set_auth_parameters();
 
 int main() {
-putprpwnam()
+set_auth_parameters()
 ; return 0; }
 EOF
-if { (eval echo configure:6978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7001,15 +7168,15 @@ else
   echo "$ac_t""no" 1>&6
 fi
  
-     for ac_func in putprpwnam
+     for ac_func in set_auth_parameters
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7008: checking for $ac_func" >&5
+echo "configure:7175: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7013 "configure"
+#line 7180 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7032,7 +7199,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7060,15 +7227,15 @@ done
   esac
 
 case "$LIBS" in
-  *-lsec*) for ac_func in putprpwnam
+  *-lsec*) for ac_func in set_auth_parameters
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7067: checking for $ac_func" >&5
+echo "configure:7234: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7072 "configure"
+#line 7239 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7091,7 +7258,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7115,27 +7282,27 @@ else
 fi
 done
  ;;
-  *) echo $ac_n "checking for putprpwnam in -lsec""... $ac_c" 1>&6
-echo "configure:7120: checking for putprpwnam in -lsec" >&5
-ac_lib_var=`echo sec'_'putprpwnam | sed 'y%./+-%__p_%'`
+  *) echo $ac_n "checking for set_auth_parameters in -lsec""... $ac_c" 1>&6
+echo "configure:7287: checking for set_auth_parameters in -lsec" >&5
+ac_lib_var=`echo sec'_'set_auth_parameters | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lsec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7128 "configure"
+#line 7295 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char putprpwnam();
+char set_auth_parameters();
 
 int main() {
-putprpwnam()
+set_auth_parameters()
 ; return 0; }
 EOF
-if { (eval echo configure:7139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7162,15 +7329,15 @@ else
   echo "$ac_t""no" 1>&6
 fi
  
-     for ac_func in putprpwnam
+     for ac_func in set_auth_parameters
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7169: checking for $ac_func" >&5
+echo "configure:7336: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7174 "configure"
+#line 7341 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7193,7 +7360,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7221,16 +7388,17 @@ done
   esac
 
 
+# UnixWare 7.x has its getspnam in -lgen
 case "$LIBS" in
-  *-lsecurity*) for ac_func in set_auth_parameters
+  *-lgen*) for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7229: checking for $ac_func" >&5
+echo "configure:7397: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7234 "configure"
+#line 7402 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7253,7 +7421,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7277,27 +7445,27 @@ else
 fi
 done
  ;;
-  *) echo $ac_n "checking for set_auth_parameters in -lsecurity""... $ac_c" 1>&6
-echo "configure:7282: checking for set_auth_parameters in -lsecurity" >&5
-ac_lib_var=`echo security'_'set_auth_parameters | sed 'y%./+-%__p_%'`
+  *) echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
+echo "configure:7450: checking for getspnam in -lgen" >&5
+ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lsecurity  $LIBS"
+LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7290 "configure"
+#line 7458 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char set_auth_parameters();
+char getspnam();
 
 int main() {
-set_auth_parameters()
+getspnam()
 ; return 0; }
 EOF
-if { (eval echo configure:7301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7312,27 +7480,27 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo security | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lsecurity $LIBS"
+  LIBS="-lgen $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
 fi
  
-     for ac_func in set_auth_parameters
+     for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7331: checking for $ac_func" >&5
+echo "configure:7499: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7336 "configure"
+#line 7504 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7355,7 +7523,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7382,16 +7550,17 @@ done
   ;;
   esac
 
+
 case "$LIBS" in
-  *-lsec*) for ac_func in set_auth_parameters
+  *-lsecurity*) for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7390: checking for $ac_func" >&5
+echo "configure:7559: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7395 "configure"
+#line 7564 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7414,7 +7583,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7438,27 +7607,27 @@ else
 fi
 done
  ;;
-  *) echo $ac_n "checking for set_auth_parameters in -lsec""... $ac_c" 1>&6
-echo "configure:7443: checking for set_auth_parameters in -lsec" >&5
-ac_lib_var=`echo sec'_'set_auth_parameters | sed 'y%./+-%__p_%'`
+  *) echo $ac_n "checking for getspnam in -lsecurity""... $ac_c" 1>&6
+echo "configure:7612: checking for getspnam in -lsecurity" >&5
+ac_lib_var=`echo security'_'getspnam | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lsec  $LIBS"
+LIBS="-lsecurity  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7451 "configure"
+#line 7620 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char set_auth_parameters();
+char getspnam();
 
 int main() {
-set_auth_parameters()
+getspnam()
 ; return 0; }
 EOF
-if { (eval echo configure:7462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7473,27 +7642,27 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo sec | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo security | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lsec $LIBS"
+  LIBS="-lsecurity $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
 fi
  
-     for ac_func in set_auth_parameters
+     for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7492: checking for $ac_func" >&5
+echo "configure:7661: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7497 "configure"
+#line 7666 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7516,7 +7685,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7543,18 +7712,16 @@ done
   ;;
   esac
 
-
-# UnixWare 7.x has its getspnam in -lgen
 case "$LIBS" in
-  *-lgen*) for ac_func in getspnam
+  *-lsec*) for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7553: checking for $ac_func" >&5
+echo "configure:7720: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7558 "configure"
+#line 7725 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7577,7 +7744,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7601,16 +7768,16 @@ else
 fi
 done
  ;;
-  *) echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
-echo "configure:7606: checking for getspnam in -lgen" >&5
-ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
+  *) echo $ac_n "checking for getspnam in -lsec""... $ac_c" 1>&6
+echo "configure:7773: checking for getspnam in -lsec" >&5
+ac_lib_var=`echo sec'_'getspnam | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lgen  $LIBS"
+LIBS="-lsec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7614 "configure"
+#line 7781 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7621,7 +7788,7 @@ int main() {
 getspnam()
 ; return 0; }
 EOF
-if { (eval echo configure:7625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7636,13 +7803,13 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo sec | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lgen $LIBS"
+  LIBS="-lsec $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
@@ -7651,12 +7818,12 @@ fi
      for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7655: checking for $ac_func" >&5
+echo "configure:7822: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7660 "configure"
+#line 7827 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7679,7 +7846,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7708,15 +7875,15 @@ done
 
 
 case "$LIBS" in
-  *-lsecurity*) for ac_func in getspnam
+  *-lsecurity*) for ac_func in bigcrypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7715: checking for $ac_func" >&5
+echo "configure:7882: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7720 "configure"
+#line 7887 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7739,7 +7906,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7763,27 +7930,27 @@ else
 fi
 done
  ;;
-  *) echo $ac_n "checking for getspnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:7768: checking for getspnam in -lsecurity" >&5
-ac_lib_var=`echo security'_'getspnam | sed 'y%./+-%__p_%'`
+  *) echo $ac_n "checking for bigcrypt in -lsecurity""... $ac_c" 1>&6
+echo "configure:7935: checking for bigcrypt in -lsecurity" >&5
+ac_lib_var=`echo security'_'bigcrypt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lsecurity  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7776 "configure"
+#line 7943 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char getspnam();
+char bigcrypt();
 
 int main() {
-getspnam()
+bigcrypt()
 ; return 0; }
 EOF
-if { (eval echo configure:7787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7810,15 +7977,15 @@ else
   echo "$ac_t""no" 1>&6
 fi
  
-     for ac_func in getspnam
+     for ac_func in bigcrypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7817: checking for $ac_func" >&5
+echo "configure:7984: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7822 "configure"
+#line 7989 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7841,7 +8008,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7869,15 +8036,15 @@ done
   esac
 
 case "$LIBS" in
-  *-lsec*) for ac_func in getspnam
+  *-lsec*) for ac_func in bigcrypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7876: checking for $ac_func" >&5
+echo "configure:8043: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7881 "configure"
+#line 8048 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7900,7 +8067,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7924,27 +8091,27 @@ else
 fi
 done
  ;;
-  *) echo $ac_n "checking for getspnam in -lsec""... $ac_c" 1>&6
-echo "configure:7929: checking for getspnam in -lsec" >&5
-ac_lib_var=`echo sec'_'getspnam | sed 'y%./+-%__p_%'`
+  *) echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
+echo "configure:8096: checking for bigcrypt in -lsec" >&5
+ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lsec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7937 "configure"
+#line 8104 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char getspnam();
+char bigcrypt();
 
 int main() {
-getspnam()
+bigcrypt()
 ; return 0; }
 EOF
-if { (eval echo configure:7948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7971,15 +8138,15 @@ else
   echo "$ac_t""no" 1>&6
 fi
  
-     for ac_func in getspnam
+     for ac_func in bigcrypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7978: checking for $ac_func" >&5
+echo "configure:8145: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7983 "configure"
+#line 8150 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8002,7 +8169,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8031,15 +8198,15 @@ done
 
 
 case "$LIBS" in
-  *-lsecurity*) for ac_func in bigcrypt
+  *-lsecurity*) for ac_func in getprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8038: checking for $ac_func" >&5
+echo "configure:8205: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8043 "configure"
+#line 8210 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8062,7 +8229,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8086,27 +8253,27 @@ else
 fi
 done
  ;;
-  *) echo $ac_n "checking for bigcrypt in -lsecurity""... $ac_c" 1>&6
-echo "configure:8091: checking for bigcrypt in -lsecurity" >&5
-ac_lib_var=`echo security'_'bigcrypt | sed 'y%./+-%__p_%'`
+  *) echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
+echo "configure:8258: checking for getprpwnam in -lsecurity" >&5
+ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lsecurity  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8099 "configure"
+#line 8266 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char bigcrypt();
+char getprpwnam();
 
 int main() {
-bigcrypt()
+getprpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:8110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8133,15 +8300,15 @@ else
   echo "$ac_t""no" 1>&6
 fi
  
-     for ac_func in bigcrypt
+     for ac_func in getprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8140: checking for $ac_func" >&5
+echo "configure:8307: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8145 "configure"
+#line 8312 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8164,7 +8331,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8192,15 +8359,15 @@ done
   esac
 
 case "$LIBS" in
-  *-lsec*) for ac_func in bigcrypt
+  *-lsec*) for ac_func in getprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8199: checking for $ac_func" >&5
+echo "configure:8366: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8204 "configure"
+#line 8371 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8223,7 +8390,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8247,27 +8414,27 @@ else
 fi
 done
  ;;
-  *) echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
-echo "configure:8252: checking for bigcrypt in -lsec" >&5
-ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
+  *) echo $ac_n "checking for getprpwnam in -lsec""... $ac_c" 1>&6
+echo "configure:8419: checking for getprpwnam in -lsec" >&5
+ac_lib_var=`echo sec'_'getprpwnam | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lsec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8260 "configure"
+#line 8427 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char bigcrypt();
+char getprpwnam();
 
 int main() {
-bigcrypt()
+getprpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:8271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8294,15 +8461,15 @@ else
   echo "$ac_t""no" 1>&6
 fi
  
-     for ac_func in bigcrypt
+     for ac_func in getprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8301: checking for $ac_func" >&5
+echo "configure:8468: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8306 "configure"
+#line 8473 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
     builtin and then its argument prototype would still apply.  */
 char $ac_func();
 
-int main() {
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:8496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+  ;;
+  esac
+
+
+# this bit needs to be modified for each OS that is suported by
+# smbwrapper. You need to specify how to created a shared library and
+# how to compile C code to produce PIC object files
+
+# these are the defaults, good for lots of systems
+HOST_OS="$host_os"
+LDSHFLAGS="-shared"
+SHLD="\${CC}"
+PICFLAG=""
+PICSUFFIX="po"
+POBAD_CC="#"
+SHLIBEXT="so"
+# Assume non-shared by default and override below
+BLDSHARED="false"
+echo $ac_n "checking ability to build shared libraries""... $ac_c" 1>&6
+echo "configure:8539: checking ability to build shared libraries" >&5
+
+# and these are for particular systems
+case "$host_os" in
+               *linux*)   cat >> confdefs.h <<\EOF
+#define LINUX 1
+EOF
+
+                       BLDSHARED="true"
+                       LDSHFLAGS="-shared" 
+                       PICFLAG="-fPIC"
+                       cat >> confdefs.h <<\EOF
+#define STAT_ST_BLOCKSIZE 512
+EOF
+
+               ;;
+               *solaris*) cat >> confdefs.h <<\EOF
+#define SUNOS5 1
+EOF
+
+                       BLDSHARED="true"
+                       LDSHFLAGS="-h \$@ -G"
+                       if test "${ac_cv_prog_CC}" = "gcc"; then
+                               PICFLAG="-fPIC"
+                       else
+                               PICFLAG="-KPIC"
+                               POBAD_CC=""
+                               PICSUFFIX="po.o"
+                       fi
+                       cat >> confdefs.h <<\EOF
+#define STAT_ST_BLOCKSIZE 512
+EOF
+
+               ;;
+               *sunos*) cat >> confdefs.h <<\EOF
+#define SUNOS4 1
+EOF
+
+                       BLDSHARED="true"
+                       LDSHFLAGS="-Wl,-h,\$@ -G"
+                       PICFLAG="-KPIC"   # Is this correct for SunOS
+               ;;
+               *bsd*)  BLDSHARED="true"
+                       LDSHFLAGS="-Wl,-soname,\$@ -shared"
+                       PICFLAG="-fPIC"
+                       cat >> confdefs.h <<\EOF
+#define STAT_ST_BLOCKSIZE 512
+EOF
+
+               ;;
+               *irix*) cat >> confdefs.h <<\EOF
+#define IRIX 1
+EOF
+
+                       case "$host_os" in
+                       *irix6*) cat >> confdefs.h <<\EOF
+#define IRIX6 1
+EOF
+
+                       ;;
+                       esac
+                       ATTEMPT_WRAP32_BUILD=yes
+                       BLDSHARED="true"
+                       LDSHFLAGS="-Wl,-soname,\$@ -shared"
+                       if test "${ac_cv_prog_CC}" = "gcc"; then
+                               PICFLAG="-fPIC"
+                       else 
+                               PICFLAG="-KPIC"
+                       fi
+                       cat >> confdefs.h <<\EOF
+#define STAT_ST_BLOCKSIZE 512
+EOF
+
+               ;;
+               *aix*) cat >> confdefs.h <<\EOF
+#define AIX 1
+EOF
+
+                       BLDSHARED="true"
+                       LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
+                       PICFLAG="-O2 -qmaxmem=6000"
+                       cat >> confdefs.h <<\EOF
+#define STAT_ST_BLOCKSIZE DEV_BSIZE
+EOF
+
+               ;;
+               *hpux*) cat >> confdefs.h <<\EOF
+#define HPUX 1
+EOF
+
+                       SHLIBEXT="sl"
+                       # Use special PIC flags for the native HP-UX compiler.
+                       if test $ac_cv_prog_cc_Ae = yes; then
+                               #BLDSHARED="true"
+                               LDSHFLAGS="-b -z +h \$@"
+                               PICFLAG="+z"
+                       fi
+                       cat >> confdefs.h <<\EOF
+#define STAT_ST_BLOCKSIZE 8192
+EOF
+
+               ;;
+               *qnx*) cat >> confdefs.h <<\EOF
+#define QNX 1
+EOF
+;;
+               *osf*) cat >> confdefs.h <<\EOF
+#define OSF1 1
+EOF
+
+                       BLDSHARED="true"
+                       LDSHFLAGS="-Wl,-soname,\$@ -shared"
+                       PICFLAG="-fPIC"
+               ;;
+               *sco*) cat >> confdefs.h <<\EOF
+#define SCO 1
+EOF
+;;
+               *unixware*) cat >> confdefs.h <<\EOF
+#define UNIXWARE 1
+EOF
+
+                       BLDSHARED="true"
+                       LDSHFLAGS="-Wl,-soname,\$@ -shared"
+                       PICFLAG="-KPIC"
+               ;;
+               *next2*) cat >> confdefs.h <<\EOF
+#define NEXT2 1
+EOF
+;;
+               *dgux*) # Extract the first word of "groff", so it can be a program name with args.
+set dummy groff; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:8672: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_ROFF'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$ROFF"; then
+  ac_cv_prog_ROFF="$ROFF" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_ROFF="groff -etpsR -Tascii -man"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+ROFF="$ac_cv_prog_ROFF"
+if test -n "$ROFF"; then
+  echo "$ac_t""$ROFF" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+;;
+               *sysv4*)
+                       case "$host" in
+                               *-univel-*)     if  test "$GCC" != yes ; then
+                                                                       cat >> confdefs.h <<\EOF
+#define HAVE_MEMSET 1
+EOF
+
+                                                               fi
+                                                               LDSHFLAGS="-G"
+                               ;;
+                               *mips-sni-sysv4*) cat >> confdefs.h <<\EOF
+#define RELIANTUNIX 1
+EOF
+;;
+                       esac
+                       ;;
+               *sysv5*)
+                       if  test "$GCC" != yes ; then
+                               cat >> confdefs.h <<\EOF
+#define HAVE_MEMSET 1
+EOF
+
+                       fi
+                       LDSHFLAGS="-G"
+                       ;;
+esac
+echo "$ac_t""$BLDSHARED" 1>&6
+echo $ac_n "checking linker flags for shared libraries""... $ac_c" 1>&6
+echo "configure:8726: checking linker flags for shared libraries" >&5
+echo "$ac_t""$LDSHFLAGS" 1>&6
+echo $ac_n "checking compiler flags for position-independent code""... $ac_c" 1>&6
+echo "configure:8729: checking compiler flags for position-independent code" >&5
+echo "$ac_t""$PICFLAGS" 1>&6
+
+#######################################################
+# test whether building a shared library actually works
+if test $BLDSHARED = true; then
+echo $ac_n "checking whether building shared libraries actually works""... $ac_c" 1>&6
+echo "configure:8736: checking whether building shared libraries actually works" >&5
+if eval "test \"`echo '$''{'ac_cv_shlib_works'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+   ac_cv_shlib_works=no
+   # try building a trivial shared library
+   $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
+     $CC $CPPFLAGS $CFLAGS $LDSHFLAGS -o shlib.so shlib.po &&
+     ac_cv_shlib_works=yes
+   rm -f shlib.so shlib.po
+
+fi
+
+echo "$ac_t""$ac_cv_shlib_works" 1>&6
+if test $ac_cv_shlib_works = no; then
+   BLDSHARED=false
+fi
+fi
+
+
+# this updates our target list if we can build shared libs
+if test $BLDSHARED = true; then
+   LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
+else
+   LIBSMBCLIENT_SHARED=
+fi
 
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
+################
 
-; return 0; }
+echo $ac_n "checking for long long""... $ac_c" 1>&6
+echo "configure:8767: checking for long long" >&5
+if eval "test \"`echo '$''{'samba_cv_have_longlong'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+if test "$cross_compiling" = yes; then
+  samba_cv_have_longlong=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 8776 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }
 EOF
-if { (eval echo configure:8329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+if { (eval echo configure:8781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_have_longlong=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  rm -fr conftest*
+  samba_cv_have_longlong=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
 fi
-done
 
-  ;;
-  esac
+echo "$ac_t""$samba_cv_have_longlong" 1>&6
+if test x"$samba_cv_have_longlong" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_LONGLONG 1
+EOF
 
+fi
 
-case "$LIBS" in
-  *-lsecurity*) for ac_func in getprpwnam
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8361: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+#
+# Check if the compiler supports the LL prefix on long long integers.
+# AIX needs this.
+
+echo $ac_n "checking for LL suffix on long long integers""... $ac_c" 1>&6
+echo "configure:8808: checking for LL suffix on long long integers" >&5
+if eval "test \"`echo '$''{'samba_cv_compiler_supports_ll'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8366 "configure"
+  
+    cat > conftest.$ac_ext <<EOF
+#line 8814 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
+#include <stdio.h>
 int main() {
-
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
+long long i = 0x8000000000LL
 ; return 0; }
 EOF
-if { (eval echo configure:8389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+  samba_cv_compiler_supports_ll=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  samba_cv_compiler_supports_ll=no
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+echo "$ac_t""$samba_cv_compiler_supports_ll" 1>&6
+if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
+   cat >> confdefs.h <<\EOF
+#define COMPILER_SUPPORTS_LL 1
 EOF
-else
-  echo "$ac_t""no" 1>&6
+
 fi
-done
- ;;
-  *) echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:8414: checking for getprpwnam in -lsecurity" >&5
-ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+  
+echo $ac_n "checking for 64 bit off_t""... $ac_c" 1>&6
+echo "configure:8843: checking for 64 bit off_t" >&5
+if eval "test \"`echo '$''{'samba_cv_SIZEOF_OFF_T'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lsecurity  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8422 "configure"
+  
+if test "$cross_compiling" = yes; then
+  samba_cv_SIZEOF_OFF_T=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 8852 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getprpwnam();
-
-int main() {
-getprpwnam()
-; return 0; }
+#include <stdio.h>
+#include <sys/stat.h>
+main() { exit((sizeof(off_t) == 8) ? 0 : 1); }
 EOF
-if { (eval echo configure:8433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+if { (eval echo configure:8858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_SIZEOF_OFF_T=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  rm -fr conftest*
+  samba_cv_SIZEOF_OFF_T=no
+fi
+rm -fr conftest*
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo security | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
 
-  LIBS="-lsecurity $LIBS"
+echo "$ac_t""$samba_cv_SIZEOF_OFF_T" 1>&6
+if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define SIZEOF_OFF_T 8
+EOF
 
-else
-  echo "$ac_t""no" 1>&6
 fi
-     for ac_func in getprpwnam
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8463: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+
+echo $ac_n "checking for off64_t""... $ac_c" 1>&6
+echo "configure:8881: checking for off64_t" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_OFF64_T'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
+  
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_OFF64_T=cross
+else
   cat > conftest.$ac_ext <<EOF
-#line 8468 "configure"
+#line 8890 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
 
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
 #endif
-
-; return 0; }
+#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); }
 EOF
-if { (eval echo configure:8491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+if { (eval echo configure:8900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_OFF64_T=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  rm -fr conftest*
+  samba_cv_HAVE_OFF64_T=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
 fi
-done
 
-  ;;
-  esac
+echo "$ac_t""$samba_cv_HAVE_OFF64_T" 1>&6
+if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_OFF64_T 1
+EOF
 
-case "$LIBS" in
-  *-lsec*) for ac_func in getprpwnam
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8522: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+fi
+
+echo $ac_n "checking for 64 bit ino_t""... $ac_c" 1>&6
+echo "configure:8923: checking for 64 bit ino_t" >&5
+if eval "test \"`echo '$''{'samba_cv_SIZEOF_INO_T'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8527 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
+  
+if test "$cross_compiling" = yes; then
+  samba_cv_SIZEOF_INO_T=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 8932 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <sys/stat.h>
+main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }
 EOF
-if { (eval echo configure:8550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+if { (eval echo configure:8938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_SIZEOF_INO_T=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  rm -fr conftest*
+  samba_cv_SIZEOF_INO_T=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+fi
+
+echo "$ac_t""$samba_cv_SIZEOF_INO_T" 1>&6
+if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define SIZEOF_INO_T 8
 EOF
-else
-  echo "$ac_t""no" 1>&6
+
 fi
-done
- ;;
-  *) echo $ac_n "checking for getprpwnam in -lsec""... $ac_c" 1>&6
-echo "configure:8575: checking for getprpwnam in -lsec" >&5
-ac_lib_var=`echo sec'_'getprpwnam | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+echo $ac_n "checking for ino64_t""... $ac_c" 1>&6
+echo "configure:8961: checking for ino64_t" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_INO64_T'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lsec  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8583 "configure"
+  
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_INO64_T=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 8970 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getprpwnam();
 
-int main() {
-getprpwnam()
-; return 0; }
+#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); }
 EOF
-if { (eval echo configure:8594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+if { (eval echo configure:8980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_INO64_T=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  rm -fr conftest*
+  samba_cv_HAVE_INO64_T=no
+fi
+rm -fr conftest*
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo sec | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
 
-  LIBS="-lsec $LIBS"
+echo "$ac_t""$samba_cv_HAVE_INO64_T" 1>&6
+if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_INO64_T 1
+EOF
 
-else
-  echo "$ac_t""no" 1>&6
 fi
-     for ac_func in getprpwnam
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8624: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+
+echo $ac_n "checking for dev64_t""... $ac_c" 1>&6
+echo "configure:9003: checking for dev64_t" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_DEV64_T'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
+  
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_DEV64_T=cross
+else
   cat > conftest.$ac_ext <<EOF
-#line 8629 "configure"
+#line 9012 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
 
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
 #endif
-
-; return 0; }
+#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); }
 EOF
-if { (eval echo configure:8652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+if { (eval echo configure:9022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_DEV64_T=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  rm -fr conftest*
+  samba_cv_HAVE_DEV64_T=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
 fi
-done
-
-  ;;
-  esac
-
-
-# this bit needs to be modified for each OS that is suported by
-# smbwrapper. You need to specify how to created a shared library and
-# how to compile C code to produce PIC object files
-
-# these are the defaults, good for lots of systems
-HOST_OS="$host_os"
-LDSHFLAGS="-shared"
-PICFLAG=""
-SHLIBEXT="so"
-BLDSHARED="false"
-
-# and these are for particular systems
-case "$host_os" in
-               *linux*)   cat >> confdefs.h <<\EOF
-#define LINUX 1
-EOF
-
-                                       BLDSHARED="true"
-               ;;
-               *solaris*) cat >> confdefs.h <<\EOF
-#define SUNOS5 1
-EOF
-
-                                       LDSHFLAGS="-G"
-                                       BLDSHARED="true"
-               ;;
-               *sunos*) cat >> confdefs.h <<\EOF
-#define SUNOS4 1
-EOF
-
-                                       LDSHFLAGS=""
-               ;;
-               *bsd*) LDSHFLAGS="-shared -Bshareable"
-                       BLDSHARED="true"
-               ;;
-               *irix*) cat >> confdefs.h <<\EOF
-#define IRIX 1
-EOF
 
-                       case "$host_os" in
-                       *irix6*) cat >> confdefs.h <<\EOF
-#define IRIX6 1
+echo "$ac_t""$samba_cv_HAVE_DEV64_T" 1>&6
+if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_DEV64_T 1
 EOF
 
-                       ;;
-                       esac
-                       ATTEMPT_WRAP32_BUILD=yes
-               ;;
-               *aix*) cat >> confdefs.h <<\EOF
-#define AIX 1
-EOF
-;;
-               *hpux*) cat >> confdefs.h <<\EOF
-#define HPUX 1
-EOF
+fi
 
-                       SHLIBEXT="sl"
-                       # Use special PIC flags for the native HP-UX compiler.
-                       if test $ac_cv_prog_cc_Ae = yes; then
-                               LDSHFLAGS="-b"
-                               PICFLAG="+z"
-                       fi
-               ;;
-               *qnx*) cat >> confdefs.h <<\EOF
-#define QNX 1
-EOF
-;;
-               *osf*) cat >> confdefs.h <<\EOF
-#define OSF1 1
-EOF
-;;
-               *sco*) cat >> confdefs.h <<\EOF
-#define SCO 1
-EOF
-;;
-               *next2*) cat >> confdefs.h <<\EOF
-#define NEXT2 1
-EOF
-;;
-               *dgux*) # Extract the first word of "groff", so it can be a program name with args.
-set dummy groff; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8762: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_ROFF'+set}'`\" = set"; then
+echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6
+echo "configure:9045: checking for struct dirent64" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_STRUCT_DIRENT64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$ROFF"; then
-  ac_cv_prog_ROFF="$ROFF" # Let the user override the test.
+  
+cat > conftest.$ac_ext <<EOF
+#line 9051 "configure"
+#include "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; }
+EOF
+if { (eval echo configure:9063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_STRUCT_DIRENT64=yes
 else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_ROFF="groff -etpsR -Tascii -man"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_HAVE_STRUCT_DIRENT64=no
 fi
-ROFF="$ac_cv_prog_ROFF"
-if test -n "$ROFF"; then
-  echo "$ac_t""$ROFF" 1>&6
-else
-  echo "$ac_t""no" 1>&6
+rm -f conftest*
 fi
-;;
-               *sysv4*)
-                       case "$host" in
-                               *-univel-*)     if  test "$GCC" != yes ; then
-                                                                       cat >> confdefs.h <<\EOF
-#define HAVE_MEMSET 1
-EOF
 
-                                                               fi
-                                                               LDSHFLAGS="-G"
-                               ;;
-                               *mips-sni-sysv4*) cat >> confdefs.h <<\EOF
-#define RELIANTUNIX 1
-EOF
-;;
-                       esac
-                       ;;
-               *sysv5*)
-                       if  test "$GCC" != yes ; then
-                               cat >> confdefs.h <<\EOF
-#define HAVE_MEMSET 1
+echo "$ac_t""$samba_cv_HAVE_STRUCT_DIRENT64" 1>&6
+if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_DIRENT64 1
 EOF
 
-                       fi
-                       LDSHFLAGS="-G"
-                       ;;
-esac
+fi
 
-# try to work out how to produce PIC code with this compiler
-echo $ac_n "checking whether ${CC-cc} accepts -fPIC""... $ac_c" 1>&6
-echo "configure:8817: checking whether ${CC-cc} accepts -fPIC" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_fPIC'+set}'`\" = set"; then
+echo $ac_n "checking for unsigned char""... $ac_c" 1>&6
+echo "configure:9084: checking for unsigned char" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UNSIGNED_CHAR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -fPIC -c conftest.c 2>&1`"; then
-  ac_cv_prog_cc_fPIC=yes
+  
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_UNSIGNED_CHAR=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 9093 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+main() { char c; c=250; exit((c > 0)?0:1); }
+EOF
+if { (eval echo configure:9098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_UNSIGNED_CHAR=yes
 else
-  ac_cv_prog_cc_fPIC=no
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  samba_cv_HAVE_UNSIGNED_CHAR=no
+fi
+rm -fr conftest*
 fi
-rm -f conftest*
 
 fi
 
-echo "$ac_t""$ac_cv_prog_cc_fPIC" 1>&6
-if test $ac_cv_prog_cc_fPIC = yes; then
-    PICFLAG="-fPIC";
+echo "$ac_t""$samba_cv_HAVE_UNSIGNED_CHAR" 1>&6
+if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_UNSIGNED_CHAR 1
+EOF
+
 fi
-if test x$PICFLAG = x; then
-  echo $ac_n "checking whether ${CC-cc} accepts -KPIC""... $ac_c" 1>&6
-echo "configure:8837: checking whether ${CC-cc} accepts -KPIC" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_KPIC'+set}'`\" = set"; then
+
+echo $ac_n "checking for sin_len in sock""... $ac_c" 1>&6
+echo "configure:9121: checking for sin_len in sock" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_SOCK_SIN_LEN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -KPIC -c conftest.c 2>&1`"; then
-  ac_cv_prog_cc_KPIC=yes
+  
+cat > conftest.$ac_ext <<EOF
+#line 9127 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct sockaddr_in sock; sock.sin_len = sizeof(sock);
+; return 0; }
+EOF
+if { (eval echo configure:9136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_SOCK_SIN_LEN=yes
 else
-  ac_cv_prog_cc_KPIC=no
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_HAVE_SOCK_SIN_LEN=no
 fi
 rm -f conftest*
-
 fi
 
-echo "$ac_t""$ac_cv_prog_cc_KPIC" 1>&6
-  if test $ac_cv_prog_cc_KPIC = yes; then
-    PICFLAG="-KPIC";
-  fi
+echo "$ac_t""$samba_cv_HAVE_SOCK_SIN_LEN" 1>&6
+if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_SOCK_SIN_LEN 1
+EOF
+
 fi
-if test x$PICFLAG = x; then
-  echo $ac_n "checking whether ${CC-cc} accepts -Kpic""... $ac_c" 1>&6
-echo "configure:8858: checking whether ${CC-cc} accepts -Kpic" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_Kpic'+set}'`\" = set"; then
+
+echo $ac_n "checking whether seekdir returns void""... $ac_c" 1>&6
+echo "configure:9157: checking whether seekdir returns void" >&5
+if eval "test \"`echo '$''{'samba_cv_SEEKDIR_RETURNS_VOID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -Kpic -c conftest.c 2>&1`"; then
-  ac_cv_prog_cc_Kpic=yes
+  
+cat > conftest.$ac_ext <<EOF
+#line 9163 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <dirent.h>
+void seekdir(DIR *d, long loc) { return; }
+int main() {
+return 0;
+; return 0; }
+EOF
+if { (eval echo configure:9172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_SEEKDIR_RETURNS_VOID=yes
 else
-  ac_cv_prog_cc_Kpic=no
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_SEEKDIR_RETURNS_VOID=no
 fi
 rm -f conftest*
-
 fi
 
-echo "$ac_t""$ac_cv_prog_cc_Kpic" 1>&6
-  if test $ac_cv_prog_cc_Kpic = yes; then
-    PICFLAG="-Kpic";
-  fi
-fi
+echo "$ac_t""$samba_cv_SEEKDIR_RETURNS_VOID" 1>&6
+if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define SEEKDIR_RETURNS_VOID 1
+EOF
 
-################
+fi
 
-echo $ac_n "checking for long long""... $ac_c" 1>&6
-echo "configure:8881: checking for long long" >&5
-if eval "test \"`echo '$''{'samba_cv_have_longlong'+set}'`\" = set"; then
+echo $ac_n "checking for __FILE__ macro""... $ac_c" 1>&6
+echo "configure:9193: checking for __FILE__ macro" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_FILE_MACRO'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_have_longlong=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 8890 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 9199 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }
+int main() {
+printf("%s\n", __FILE__);
+; return 0; }
 EOF
-if { (eval echo configure:8895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_have_longlong=yes
+if { (eval echo configure:9206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_FILE_MACRO=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_have_longlong=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  samba_cv_HAVE_FILE_MACRO=no
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_have_longlong" 1>&6
-if test x"$samba_cv_have_longlong" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_FILE_MACRO" 1>&6
+if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_LONGLONG 1
+#define HAVE_FILE_MACRO 1
 EOF
 
 fi
 
-#
-# Check if the compiler supports the LL prefix on long long integers.
-# AIX needs this.
-
-echo $ac_n "checking for LL suffix on long long integers""... $ac_c" 1>&6
-echo "configure:8922: checking for LL suffix on long long integers" >&5
-if eval "test \"`echo '$''{'samba_cv_compiler_supports_ll'+set}'`\" = set"; then
+echo $ac_n "checking for __FUNCTION__ macro""... $ac_c" 1>&6
+echo "configure:9227: checking for __FUNCTION__ macro" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_FUNCTION_MACRO'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-    cat > conftest.$ac_ext <<EOF
-#line 8928 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 9233 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
-long long i = 0x8000000000LL
+printf("%s\n", __FUNCTION__);
 ; return 0; }
 EOF
-if { (eval echo configure:8935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_compiler_supports_ll=yes
+  samba_cv_HAVE_FUNCTION_MACRO=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_compiler_supports_ll=no
+  samba_cv_HAVE_FUNCTION_MACRO=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_compiler_supports_ll" 1>&6
-if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
-   cat >> confdefs.h <<\EOF
-#define COMPILER_SUPPORTS_LL 1
+echo "$ac_t""$samba_cv_HAVE_FUNCTION_MACRO" 1>&6
+if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_FUNCTION_MACRO 1
 EOF
 
 fi
 
-  
-echo $ac_n "checking for 64 bit off_t""... $ac_c" 1>&6
-echo "configure:8957: checking for 64 bit off_t" >&5
-if eval "test \"`echo '$''{'samba_cv_SIZEOF_OFF_T'+set}'`\" = set"; then
+echo $ac_n "checking if gettimeofday takes tz argument""... $ac_c" 1>&6
+echo "configure:9261: checking if gettimeofday takes tz argument" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_GETTIMEOFDAY_TZ'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_SIZEOF_OFF_T=cross
+  samba_cv_HAVE_GETTIMEOFDAY_TZ=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8966 "configure"
+#line 9270 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-#include <sys/stat.h>
-main() { exit((sizeof(off_t) == 8) ? 0 : 1); }
+
+#include <sys/time.h>
+#include <unistd.h>
+main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}
 EOF
-if { (eval echo configure:8972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_SIZEOF_OFF_T=yes
+  samba_cv_HAVE_GETTIMEOFDAY_TZ=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_SIZEOF_OFF_T=no
+  samba_cv_HAVE_GETTIMEOFDAY_TZ=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_SIZEOF_OFF_T" 1>&6
-if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_GETTIMEOFDAY_TZ" 1>&6
+if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define SIZEOF_OFF_T 8
+#define HAVE_GETTIMEOFDAY_TZ 1
 EOF
 
 fi
 
-echo $ac_n "checking for off64_t""... $ac_c" 1>&6
-echo "configure:8995: checking for off64_t" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_OFF64_T'+set}'`\" = set"; then
+echo $ac_n "checking for C99 vsnprintf""... $ac_c" 1>&6
+echo "configure:9300: checking for C99 vsnprintf" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_C99_VSNPRINTF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_OFF64_T=cross
+  samba_cv_HAVE_C99_VSNPRINTF=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9004 "configure"
+#line 9309 "configure"
 #include "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); }
+#include <sys/types.h>
+#include <stdarg.h>
+void foo(const char *format, ...) { 
+       va_list ap;
+       int len;
+       char buf[5];
+
+       va_start(ap, format);
+       len = vsnprintf(0, 0, format, ap);
+       va_end(ap);
+       if (len != 5) exit(1);
+
+       if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
+
+       exit(0);
+}
+main() { foo("hello"); }
+
+EOF
+if { (eval echo configure:9331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_C99_VSNPRINTF=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  samba_cv_HAVE_C99_VSNPRINTF=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$samba_cv_HAVE_C99_VSNPRINTF" 1>&6
+if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_C99_VSNPRINTF 1
+EOF
+
+fi
+
+echo $ac_n "checking for broken readdir""... $ac_c" 1>&6
+echo "configure:9354: checking for broken readdir" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_READDIR'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_BROKEN_READDIR=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 9363 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#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);} 
 EOF
-if { (eval echo configure:9014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_OFF64_T=yes
+  samba_cv_HAVE_BROKEN_READDIR=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_OFF64_T=no
+  samba_cv_HAVE_BROKEN_READDIR=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_OFF64_T" 1>&6
-if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_BROKEN_READDIR" 1>&6
+if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_OFF64_T 1
+#define HAVE_BROKEN_READDIR 1
 EOF
 
 fi
 
-echo $ac_n "checking for 64 bit ino_t""... $ac_c" 1>&6
-echo "configure:9037: checking for 64 bit ino_t" >&5
-if eval "test \"`echo '$''{'samba_cv_SIZEOF_INO_T'+set}'`\" = set"; then
+echo $ac_n "checking for utimbuf""... $ac_c" 1>&6
+echo "configure:9394: checking for utimbuf" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UTIMBUF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_SIZEOF_INO_T=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9046 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 9400 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-#include <sys/stat.h>
-main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }
+#include <sys/types.h>
+#include <utime.h>
+int main() {
+struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));
+; return 0; }
 EOF
-if { (eval echo configure:9052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_SIZEOF_INO_T=yes
+if { (eval echo configure:9408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UTIMBUF=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_SIZEOF_INO_T=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  samba_cv_HAVE_UTIMBUF=no
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_SIZEOF_INO_T" 1>&6
-if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UTIMBUF" 1>&6
+if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define SIZEOF_INO_T 8
+#define HAVE_UTIMBUF 1
 EOF
 
 fi
 
-echo $ac_n "checking for ino64_t""... $ac_c" 1>&6
-echo "configure:9075: checking for ino64_t" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_INO64_T'+set}'`\" = set"; then
+
+for ac_func in pututline pututxline updwtmp updwtmpx getutmpx
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:9432: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_INO64_T=cross
-else
   cat > conftest.$ac_ext <<EOF
-#line 9084 "configure"
+#line 9437 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
 
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
 #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); }
+
+; return 0; }
 EOF
-if { (eval echo configure:9094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_INO64_T=yes
+if { (eval echo configure:9460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_INO64_T=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_INO64_T" 1>&6
-if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_INO64_T 1
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
 EOF
-
+else
+  echo "$ac_t""no" 1>&6
 fi
+done
 
-echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6
-echo "configure:9117: checking for struct dirent64" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_STRUCT_DIRENT64'+set}'`\" = set"; then
+
+echo $ac_n "checking for ut_name in utmp""... $ac_c" 1>&6
+echo "configure:9486: checking for ut_name in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_NAME'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9123 "configure"
+#line 9492 "configure"
 #include "confdefs.h"
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
 #include <sys/types.h>
-#include <dirent.h>
+#include <utmp.h>
 int main() {
-struct dirent64 de;
+struct utmp ut;  ut.ut_name[0] = 'a';
 ; return 0; }
 EOF
-if { (eval echo configure:9135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_STRUCT_DIRENT64=yes
+  samba_cv_HAVE_UT_UT_NAME=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_STRUCT_DIRENT64=no
+  samba_cv_HAVE_UT_UT_NAME=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_STRUCT_DIRENT64" 1>&6
-if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UT_UT_NAME" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_STRUCT_DIRENT64 1
+#define HAVE_UT_UT_NAME 1
 EOF
 
-fi
+fi 
 
-echo $ac_n "checking for unsigned char""... $ac_c" 1>&6
-echo "configure:9156: checking for unsigned char" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UNSIGNED_CHAR'+set}'`\" = set"; then
+echo $ac_n "checking for ut_user in utmp""... $ac_c" 1>&6
+echo "configure:9521: checking for ut_user in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_USER'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_UNSIGNED_CHAR=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9165 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 9527 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-main() { char c; c=250; exit((c > 0)?0:1); }
+#include <sys/types.h>
+#include <utmp.h>
+int main() {
+struct utmp ut;  ut.ut_user[0] = 'a';
+; return 0; }
 EOF
-if { (eval echo configure:9170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_UNSIGNED_CHAR=yes
+if { (eval echo configure:9535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_USER=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_UNSIGNED_CHAR=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_USER=no
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UNSIGNED_CHAR" 1>&6
-if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UT_UT_USER" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UNSIGNED_CHAR 1
+#define HAVE_UT_UT_USER 1
 EOF
 
-fi
+fi 
 
-echo $ac_n "checking for sin_len in sock""... $ac_c" 1>&6
-echo "configure:9193: checking for sin_len in sock" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_SOCK_SIN_LEN'+set}'`\" = set"; then
+echo $ac_n "checking for ut_id in utmp""... $ac_c" 1>&6
+echo "configure:9556: checking for ut_id in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_ID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9199 "configure"
+#line 9562 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
+#include <utmp.h>
 int main() {
-struct sockaddr_in sock; sock.sin_len = sizeof(sock);
+struct utmp ut;  ut.ut_id[0] = 'a';
 ; return 0; }
 EOF
-if { (eval echo configure:9208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_SOCK_SIN_LEN=yes
+  samba_cv_HAVE_UT_UT_ID=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_SOCK_SIN_LEN=no
+  samba_cv_HAVE_UT_UT_ID=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_SOCK_SIN_LEN" 1>&6
-if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UT_UT_ID" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_SOCK_SIN_LEN 1
+#define HAVE_UT_UT_ID 1
 EOF
 
-fi
+fi 
 
-echo $ac_n "checking whether seekdir returns void""... $ac_c" 1>&6
-echo "configure:9229: checking whether seekdir returns void" >&5
-if eval "test \"`echo '$''{'samba_cv_SEEKDIR_RETURNS_VOID'+set}'`\" = set"; then
+echo $ac_n "checking for ut_host in utmp""... $ac_c" 1>&6
+echo "configure:9591: checking for ut_host in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_HOST'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9235 "configure"
+#line 9597 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#include <dirent.h>
-void seekdir(DIR *d, long loc) { return; }
+#include <utmp.h>
 int main() {
-return 0;
+struct utmp ut;  ut.ut_host[0] = 'a';
 ; return 0; }
 EOF
-if { (eval echo configure:9244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_SEEKDIR_RETURNS_VOID=yes
+  samba_cv_HAVE_UT_UT_HOST=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_SEEKDIR_RETURNS_VOID=no
+  samba_cv_HAVE_UT_UT_HOST=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_SEEKDIR_RETURNS_VOID" 1>&6
-if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UT_UT_HOST" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define SEEKDIR_RETURNS_VOID 1
+#define HAVE_UT_UT_HOST 1
 EOF
 
-fi
+fi 
 
-echo $ac_n "checking for __FILE__ macro""... $ac_c" 1>&6
-echo "configure:9265: checking for __FILE__ macro" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_FILE_MACRO'+set}'`\" = set"; then
+echo $ac_n "checking for ut_time in utmp""... $ac_c" 1>&6
+echo "configure:9626: checking for ut_time in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_TIME'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9271 "configure"
+#line 9632 "configure"
 #include "confdefs.h"
-#include <stdio.h>
+#include <sys/types.h>
+#include <utmp.h>
 int main() {
-printf("%s\n", __FILE__);
+struct utmp ut;  time_t t; ut.ut_time = t;
 ; return 0; }
 EOF
-if { (eval echo configure:9278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_FILE_MACRO=yes
+  samba_cv_HAVE_UT_UT_TIME=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_FILE_MACRO=no
+  samba_cv_HAVE_UT_UT_TIME=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_FILE_MACRO" 1>&6
-if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UT_UT_TIME" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_FILE_MACRO 1
+#define HAVE_UT_UT_TIME 1
 EOF
 
-fi
+fi 
 
-echo $ac_n "checking for __FUNCTION__ macro""... $ac_c" 1>&6
-echo "configure:9299: checking for __FUNCTION__ macro" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_FUNCTION_MACRO'+set}'`\" = set"; then
+echo $ac_n "checking for ut_tv in utmp""... $ac_c" 1>&6
+echo "configure:9661: checking for ut_tv in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_TV'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9305 "configure"
+#line 9667 "configure"
 #include "confdefs.h"
-#include <stdio.h>
+#include <sys/types.h>
+#include <utmp.h>
 int main() {
-printf("%s\n", __FUNCTION__);
+struct utmp ut;  struct timeval tv; ut.ut_tv = tv;
 ; return 0; }
 EOF
-if { (eval echo configure:9312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_FUNCTION_MACRO=yes
+  samba_cv_HAVE_UT_UT_TV=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_FUNCTION_MACRO=no
+  samba_cv_HAVE_UT_UT_TV=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_FUNCTION_MACRO" 1>&6
-if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UT_UT_TV" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_FUNCTION_MACRO 1
+#define HAVE_UT_UT_TV 1
 EOF
 
-fi
+fi 
 
-echo $ac_n "checking if gettimeofday takes tz argument""... $ac_c" 1>&6
-echo "configure:9333: checking if gettimeofday takes tz argument" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_GETTIMEOFDAY_TZ'+set}'`\" = set"; then
+echo $ac_n "checking for ut_type in utmp""... $ac_c" 1>&6
+echo "configure:9696: checking for ut_type in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_TYPE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_GETTIMEOFDAY_TZ=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9342 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 9702 "configure"
 #include "confdefs.h"
-
-#include <sys/time.h>
-#include <unistd.h>
-main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}
+#include <sys/types.h>
+#include <utmp.h>
+int main() {
+struct utmp ut;  ut.ut_type = 0;
+; return 0; }
 EOF
-if { (eval echo configure:9349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_GETTIMEOFDAY_TZ=yes
+if { (eval echo configure:9710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_TYPE=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_GETTIMEOFDAY_TZ=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_TYPE=no
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_GETTIMEOFDAY_TZ" 1>&6
-if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UT_UT_TYPE" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_GETTIMEOFDAY_TZ 1
+#define HAVE_UT_UT_TYPE 1
 EOF
 
-fi
+fi 
 
-echo $ac_n "checking for C99 vsnprintf""... $ac_c" 1>&6
-echo "configure:9372: checking for C99 vsnprintf" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_C99_VSNPRINTF'+set}'`\" = set"; then
+echo $ac_n "checking for ut_pid in utmp""... $ac_c" 1>&6
+echo "configure:9731: checking for ut_pid in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_PID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_C99_VSNPRINTF=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9381 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 9737 "configure"
 #include "confdefs.h"
-
 #include <sys/types.h>
-#include <stdarg.h>
-void foo(const char *format, ...) { 
-       va_list ap;
-       int len;
-       char buf[5];
-
-       va_start(ap, format);
-       len = vsnprintf(0, 0, format, ap);
-       va_end(ap);
-       if (len != 5) exit(1);
-
-       if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
-
-       exit(0);
-}
-main() { foo("hello"); }
-
+#include <utmp.h>
+int main() {
+struct utmp ut;  ut.ut_pid = 0;
+; return 0; }
 EOF
-if { (eval echo configure:9403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_C99_VSNPRINTF=yes
+if { (eval echo configure:9745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_PID=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_C99_VSNPRINTF=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_PID=no
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_C99_VSNPRINTF" 1>&6
-if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UT_UT_PID" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_C99_VSNPRINTF 1
+#define HAVE_UT_UT_PID 1
 EOF
 
-fi
+fi 
 
-echo $ac_n "checking for broken readdir""... $ac_c" 1>&6
-echo "configure:9426: checking for broken readdir" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_READDIR'+set}'`\" = set"; then
+echo $ac_n "checking for ut_exit in utmp""... $ac_c" 1>&6
+echo "configure:9766: checking for ut_exit in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_EXIT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_BROKEN_READDIR=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9435 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 9772 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#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);} 
+#include <utmp.h>
+int main() {
+struct utmp ut;  ut.ut_exit.e_exit = 0;
+; return 0; }
 EOF
-if { (eval echo configure:9443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_BROKEN_READDIR=yes
+if { (eval echo configure:9780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_EXIT=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_BROKEN_READDIR=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_EXIT=no
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_BROKEN_READDIR" 1>&6
-if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UT_UT_EXIT" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_BROKEN_READDIR 1
+#define HAVE_UT_UT_EXIT 1
 EOF
 
-fi
+fi 
 
-echo $ac_n "checking for utimbuf""... $ac_c" 1>&6
-echo "configure:9466: checking for utimbuf" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UTIMBUF'+set}'`\" = set"; then
+echo $ac_n "checking for ut_addr in utmp""... $ac_c" 1>&6
+echo "configure:9801: checking for ut_addr in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_ADDR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9472 "configure"
+#line 9807 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#include <utime.h>
+#include <utmp.h>
 int main() {
-struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));
+struct utmp ut;  ut.ut_addr = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:9480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_UTIMBUF=yes
+  samba_cv_HAVE_UT_UT_ADDR=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_UTIMBUF=no
+  samba_cv_HAVE_UT_UT_ADDR=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UTIMBUF" 1>&6
-if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UT_UT_ADDR" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UTIMBUF 1
+#define HAVE_UT_UT_ADDR 1
 EOF
 
-fi
-
+fi 
 
-for ac_func in pututline pututxline updwtmp updwtmpx getutmpx
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9504: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+if test x$ac_cv_func_pututline = xyes ; then
+  echo $ac_n "checking whether pututline returns pointer""... $ac_c" 1>&6
+echo "configure:9837: checking whether pututline returns pointer" >&5
+if eval "test \"`echo '$''{'samba_cv_PUTUTLINE_RETURNS_UTMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
+  
   cat > conftest.$ac_ext <<EOF
-#line 9509 "configure"
+#line 9843 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
+#include <sys/types.h>
+#include <utmp.h>
 int main() {
-
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
+struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);
 ; return 0; }
 EOF
-if { (eval echo configure:9532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+  samba_cv_PUTUTLINE_RETURNS_UTMP=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  samba_cv_PUTUTLINE_RETURNS_UTMP=no
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+echo "$ac_t""$samba_cv_PUTUTLINE_RETURNS_UTMP" 1>&6
+  if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
+      cat >> confdefs.h <<\EOF
+#define PUTUTLINE_RETURNS_UTMP 1
 EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
 
+  fi
+fi
 
-echo $ac_n "checking for ut_name in utmp""... $ac_c" 1>&6
-echo "configure:9558: checking for ut_name in utmp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_NAME'+set}'`\" = set"; then
+echo $ac_n "checking for ut_syslen in utmpx""... $ac_c" 1>&6
+echo "configure:9873: checking for ut_syslen in utmpx" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UX_UT_SYSLEN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9564 "configure"
+#line 9879 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#include <utmp.h>
+#include <utmpx.h>
 int main() {
-struct utmp ut;  ut.ut_name[0] = 'a';
+struct utmpx ux;  ux.ut_syslen = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:9572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_UT_UT_NAME=yes
+  samba_cv_HAVE_UX_UT_SYSLEN=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_UT_UT_NAME=no
+  samba_cv_HAVE_UX_UT_SYSLEN=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UT_UT_NAME" 1>&6
-if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UX_UT_SYSLEN" 1>&6
+if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UT_UT_NAME 1
+#define HAVE_UX_UT_SYSLEN 1
 EOF
 
 fi 
 
-echo $ac_n "checking for ut_user in utmp""... $ac_c" 1>&6
-echo "configure:9593: checking for ut_user in utmp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_USER'+set}'`\" = set"; then
+
+#################################################
+# check for libiconv support
+echo $ac_n "checking whether to use libiconv""... $ac_c" 1>&6
+echo "configure:9911: checking whether to use libiconv" >&5
+# Check whether --with-libiconv or --without-libiconv was given.
+if test "${with_libiconv+set}" = set; then
+  withval="$with_libiconv"
+   case "$withval" in
+  no)
+    echo "$ac_t""no" 1>&6
+    ;;
+  *)
+    echo "$ac_t""yes" 1>&6
+    CFLAGS="$CFLAGS -I$withval/include"
+    LDFLAGS="$LDFLAGS -L$withval/lib"
+    echo $ac_n "checking for iconv_open in -liconv""... $ac_c" 1>&6
+echo "configure:9924: checking for iconv_open in -liconv" >&5
+ac_lib_var=`echo iconv'_'iconv_open | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
+  ac_save_LIBS="$LIBS"
+LIBS="-liconv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9599 "configure"
+#line 9932 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <utmp.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char iconv_open();
+
 int main() {
-struct utmp ut;  ut.ut_user[0] = 'a';
+iconv_open()
 ; return 0; }
 EOF
-if { (eval echo configure:9607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  samba_cv_HAVE_UT_UT_USER=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_UT_UT_USER=no
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo iconv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-liconv $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UT_UT_USER" 1>&6
-if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_UT_UT_USER 1
+    cat >> confdefs.h <<EOF
+#define WITH_LIBICONV "${withval}"
 EOF
 
-fi 
+    ;;
+  esac 
+else
+  echo "$ac_t""no" 1>&6
 
-echo $ac_n "checking for ut_id in utmp""... $ac_c" 1>&6
-echo "configure:9628: checking for ut_id in utmp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_ID'+set}'`\" = set"; then
+fi
+
+
+
+############
+# check for iconv in libc
+echo $ac_n "checking for working iconv""... $ac_c" 1>&6
+echo "configure:9986: checking for working iconv" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_NATIVE_ICONV'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-cat > conftest.$ac_ext <<EOF
-#line 9634 "configure"
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_NATIVE_ICONV=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 9995 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <utmp.h>
-int main() {
-struct utmp ut;  ut.ut_id[0] = 'a';
-; return 0; }
+
+#include <iconv.h>
+main() {
+       iconv_t cd = iconv_open("ASCII", "UCS-2LE");
+       if (cd == 0 || cd == (iconv_t)-1) return -1;
+       return 0;
+}
+
 EOF
-if { (eval echo configure:9642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_HAVE_UT_UT_ID=yes
+if { (eval echo configure:10006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_NATIVE_ICONV=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_HAVE_UT_UT_ID=no
+  rm -fr conftest*
+  samba_cv_HAVE_NATIVE_ICONV=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UT_UT_ID" 1>&6
-if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
+fi
+
+echo "$ac_t""$samba_cv_HAVE_NATIVE_ICONV" 1>&6
+if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UT_UT_ID 1
+#define HAVE_NATIVE_ICONV 1
 EOF
 
-fi 
+fi
 
-echo $ac_n "checking for ut_host in utmp""... $ac_c" 1>&6
-echo "configure:9663: checking for ut_host in utmp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_HOST'+set}'`\" = set"; then
+
+echo $ac_n "checking for Linux kernel oplocks""... $ac_c" 1>&6
+echo "configure:10030: checking for Linux kernel oplocks" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_KERNEL_OPLOCKS_LINUX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-cat > conftest.$ac_ext <<EOF
-#line 9669 "configure"
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10039 "configure"
 #include "confdefs.h"
+
 #include <sys/types.h>
-#include <utmp.h>
-int main() {
-struct utmp ut;  ut.ut_host[0] = 'a';
-; return 0; }
+#include <fcntl.h>
+#ifndef F_GETLEASE
+#define F_GETLEASE     1025
+#endif
+main() {
+       int fd = open("/dev/null", O_RDONLY);
+       return fcntl(fd, F_GETLEASE, 0) == -1;
+}
+
 EOF
-if { (eval echo configure:9677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_HAVE_UT_UT_HOST=yes
+if { (eval echo configure:10053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_HAVE_UT_UT_HOST=no
+  rm -fr conftest*
+  samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UT_UT_HOST" 1>&6
-if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
+fi
+
+echo "$ac_t""$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" 1>&6
+if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UT_UT_HOST 1
+#define HAVE_KERNEL_OPLOCKS_LINUX 1
 EOF
 
-fi 
+fi
 
-echo $ac_n "checking for ut_time in utmp""... $ac_c" 1>&6
-echo "configure:9698: checking for ut_time in utmp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_TIME'+set}'`\" = set"; then
+echo $ac_n "checking for kernel change notify support""... $ac_c" 1>&6
+echo "configure:10076: checking for kernel change notify support" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_KERNEL_CHANGE_NOTIFY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-cat > conftest.$ac_ext <<EOF
-#line 9704 "configure"
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10085 "configure"
 #include "confdefs.h"
+
 #include <sys/types.h>
-#include <utmp.h>
-int main() {
-struct utmp ut;  time_t t; ut.ut_time = t;
-; return 0; }
+#include <fcntl.h>
+#include <signal.h>
+#ifndef F_NOTIFY
+#define F_NOTIFY 1026
+#endif
+main() {
+               exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ?  1 : 0);
+}
+
 EOF
-if { (eval echo configure:9712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_HAVE_UT_UT_TIME=yes
+if { (eval echo configure:10099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_HAVE_UT_UT_TIME=no
+  rm -fr conftest*
+  samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UT_UT_TIME" 1>&6
-if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
+fi
+
+echo "$ac_t""$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" 1>&6
+if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UT_UT_TIME 1
+#define HAVE_KERNEL_CHANGE_NOTIFY 1
 EOF
 
-fi 
+fi
 
-echo $ac_n "checking for ut_tv in utmp""... $ac_c" 1>&6
-echo "configure:9733: checking for ut_tv in utmp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_TV'+set}'`\" = set"; then
+echo $ac_n "checking for kernel share modes""... $ac_c" 1>&6
+echo "configure:10122: checking for kernel share modes" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_KERNEL_SHARE_MODES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-cat > conftest.$ac_ext <<EOF
-#line 9739 "configure"
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_KERNEL_SHARE_MODES=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10131 "configure"
 #include "confdefs.h"
+
 #include <sys/types.h>
-#include <utmp.h>
-int main() {
-struct utmp ut;  struct timeval tv; ut.ut_tv = tv;
-; return 0; }
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/file.h>
+#ifndef LOCK_MAND
+#define LOCK_MAND      32
+#define LOCK_READ      64
+#endif
+main() {
+               exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
+}
+
 EOF
-if { (eval echo configure:9747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_HAVE_UT_UT_TV=yes
+if { (eval echo configure:10147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_KERNEL_SHARE_MODES=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_HAVE_UT_UT_TV=no
+  rm -fr conftest*
+  samba_cv_HAVE_KERNEL_SHARE_MODES=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UT_UT_TV" 1>&6
-if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
+fi
+
+echo "$ac_t""$samba_cv_HAVE_KERNEL_SHARE_MODES" 1>&6
+if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UT_UT_TV 1
+#define HAVE_KERNEL_SHARE_MODES 1
 EOF
 
-fi 
+fi
 
-echo $ac_n "checking for ut_type in utmp""... $ac_c" 1>&6
-echo "configure:9768: checking for ut_type in utmp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_TYPE'+set}'`\" = set"; then
+
+
+
+echo $ac_n "checking for IRIX kernel oplock type definitions""... $ac_c" 1>&6
+echo "configure:10173: checking for IRIX kernel oplock type definitions" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_KERNEL_OPLOCKS_IRIX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9774 "configure"
+#line 10179 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#include <utmp.h>
+#include <fcntl.h>
 int main() {
-struct utmp ut;  ut.ut_type = 0;
+oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:9782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_UT_UT_TYPE=yes
+  samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_UT_UT_TYPE=no
+  samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UT_UT_TYPE" 1>&6
-if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" 1>&6
+if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UT_UT_TYPE 1
+#define HAVE_KERNEL_OPLOCKS_IRIX 1
 EOF
 
-fi 
+fi
 
-echo $ac_n "checking for ut_pid in utmp""... $ac_c" 1>&6
-echo "configure:9803: checking for ut_pid in utmp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_PID'+set}'`\" = set"; then
+echo $ac_n "checking for irix specific capabilities""... $ac_c" 1>&6
+echo "configure:10208: checking for irix specific capabilities" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-cat > conftest.$ac_ext <<EOF
-#line 9809 "configure"
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10217 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#include <utmp.h>
-int main() {
-struct utmp ut;  ut.ut_pid = 0;
-; return 0; }
+#include <sys/capability.h>
+main() {
+ cap_t cap;
+ if ((cap = cap_get_proc()) == NULL)
+   exit(1);
+ cap->cap_effective |= CAP_NETWORK_MGT;
+ cap->cap_inheritable |= CAP_NETWORK_MGT;
+ cap_set_proc(cap);
+ exit(0);
+}
+
 EOF
-if { (eval echo configure:9817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_HAVE_UT_UT_PID=yes
+if { (eval echo configure:10232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_HAVE_UT_UT_PID=no
+  rm -fr conftest*
+  samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UT_UT_PID" 1>&6
-if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
+fi
+
+echo "$ac_t""$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" 1>&6
+if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UT_UT_PID 1
+#define HAVE_IRIX_SPECIFIC_CAPABILITIES 1
 EOF
 
-fi 
+fi
 
-echo $ac_n "checking for ut_exit in utmp""... $ac_c" 1>&6
-echo "configure:9838: checking for ut_exit in utmp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_EXIT'+set}'`\" = set"; then
+#
+# Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
+# This is *really* broken but some systems (DEC OSF1) do this.... JRA.
+#
+
+echo $ac_n "checking for int16 typedef included by rpc/rpc.h""... $ac_c" 1>&6
+echo "configure:10260: checking for int16 typedef included by rpc/rpc.h" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_INT16_FROM_RPC_RPC_H'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9844 "configure"
+#line 10266 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#include <utmp.h>
+#if defined(HAVE_RPC_RPC_H)
+#include <rpc/rpc.h>
+#endif
 int main() {
-struct utmp ut;  ut.ut_exit.e_exit = 0;
+int16 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:9852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_UT_UT_EXIT=yes
+  samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_UT_UT_EXIT=no
+  samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UT_UT_EXIT" 1>&6
-if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" 1>&6
+if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UT_UT_EXIT 1
+#define HAVE_INT16_FROM_RPC_RPC_H 1
 EOF
 
-fi 
+fi
 
-echo $ac_n "checking for ut_addr in utmp""... $ac_c" 1>&6
-echo "configure:9873: checking for ut_addr in utmp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_ADDR'+set}'`\" = set"; then
+echo $ac_n "checking for uint16 typedef included by rpc/rpc.h""... $ac_c" 1>&6
+echo "configure:10297: checking for uint16 typedef included by rpc/rpc.h" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UINT16_FROM_RPC_RPC_H'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9879 "configure"
+#line 10303 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#include <utmp.h>
+#if defined(HAVE_RPC_RPC_H)
+#include <rpc/rpc.h>
+#endif
 int main() {
-struct utmp ut;  ut.ut_addr = 0;
+uint16 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:9887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_UT_UT_ADDR=yes
+  samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_UT_UT_ADDR=no
+  samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UT_UT_ADDR" 1>&6
-if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" 1>&6
+if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UT_UT_ADDR 1
+#define HAVE_UINT16_FROM_RPC_RPC_H 1
 EOF
 
-fi 
+fi
 
-if test x$ac_cv_func_pututline = xyes ; then
-  echo $ac_n "checking whether pututline returns pointer""... $ac_c" 1>&6
-echo "configure:9909: checking whether pututline returns pointer" >&5
-if eval "test \"`echo '$''{'samba_cv_PUTUTLINE_RETURNS_UTMP'+set}'`\" = set"; then
+echo $ac_n "checking for int32 typedef included by rpc/rpc.h""... $ac_c" 1>&6
+echo "configure:10334: checking for int32 typedef included by rpc/rpc.h" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_INT32_FROM_RPC_RPC_H'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-  cat > conftest.$ac_ext <<EOF
-#line 9915 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 10340 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#include <utmp.h>
+#if defined(HAVE_RPC_RPC_H)
+#include <rpc/rpc.h>
+#endif
 int main() {
-struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);
+int32 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:9923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_PUTUTLINE_RETURNS_UTMP=yes
+  samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_PUTUTLINE_RETURNS_UTMP=no
+  samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_PUTUTLINE_RETURNS_UTMP" 1>&6
-  if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
-      cat >> confdefs.h <<\EOF
-#define PUTUTLINE_RETURNS_UTMP 1
+echo "$ac_t""$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" 1>&6
+if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_INT32_FROM_RPC_RPC_H 1
 EOF
 
-  fi
 fi
 
-echo $ac_n "checking for ut_syslen in utmpx""... $ac_c" 1>&6
-echo "configure:9945: checking for ut_syslen in utmpx" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UX_UT_SYSLEN'+set}'`\" = set"; then
+echo $ac_n "checking for uint32 typedef included by rpc/rpc.h""... $ac_c" 1>&6
+echo "configure:10371: checking for uint32 typedef included by rpc/rpc.h" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UINT32_FROM_RPC_RPC_H'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9951 "configure"
+#line 10377 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-#include <utmpx.h>
+#if defined(HAVE_RPC_RPC_H)
+#include <rpc/rpc.h>
+#endif
 int main() {
-struct utmpx ux;  ux.ut_syslen = 0;
+uint32 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:9959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_UX_UT_SYSLEN=yes
+  samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_UX_UT_SYSLEN=no
+  samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UX_UT_SYSLEN" 1>&6
-if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" 1>&6
+if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UX_UT_SYSLEN 1
+#define HAVE_UINT32_FROM_RPC_RPC_H 1
 EOF
 
-fi 
+fi
 
-echo $ac_n "checking for Linux kernel oplocks""... $ac_c" 1>&6
-echo "configure:9980: checking for Linux kernel oplocks" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_KERNEL_OPLOCKS_LINUX'+set}'`\" = set"; then
+
+echo $ac_n "checking for conflicting AUTH_ERROR define in rpc/rpc.h""... $ac_c" 1>&6
+echo "configure:10409: checking for conflicting AUTH_ERROR define in rpc/rpc.h" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 9989 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 10415 "configure"
 #include "confdefs.h"
-
 #include <sys/types.h>
-#include <fcntl.h>
-#ifndef F_GETLEASE
-#define F_GETLEASE     1025
+#ifdef HAVE_SYS_SECURITY_H
+#include <sys/security.h>
+#include <prot.h>
+#endif  /* HAVE_SYS_SECURITY_H */
+#if defined(HAVE_RPC_RPC_H)
+#include <rpc/rpc.h>
 #endif
-main() {
-       int fd = open("/dev/null", O_RDONLY);
-       return fcntl(fd, F_GETLEASE, 0) == -1;
-}
-
+int main() {
+int testvar;
+; return 0; }
 EOF
-if { (eval echo configure:10003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes
+if { (eval echo configure:10429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" 1>&6
-if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" 1>&6
+if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_KERNEL_OPLOCKS_LINUX 1
+#define HAVE_RPC_AUTH_ERROR_CONFLICT 1
 EOF
 
 fi
 
-echo $ac_n "checking for kernel change notify support""... $ac_c" 1>&6
-echo "configure:10026: checking for kernel change notify support" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_KERNEL_CHANGE_NOTIFY'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
+echo $ac_n "checking for test routines""... $ac_c" 1>&6
+echo "configure:10450: checking for test routines" >&5
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross
+  echo "configure: warning: cannot run when cross-compiling" 1>&2
 else
   cat > conftest.$ac_ext <<EOF
-#line 10035 "configure"
+#line 10455 "configure"
 #include "confdefs.h"
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <signal.h>
-#ifndef F_NOTIFY
-#define F_NOTIFY 1026
-#endif
-main() {
-               exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ?  1 : 0);
-}
-
+#include "${srcdir-.}/tests/trivial.c"
 EOF
-if { (eval echo configure:10049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes
+  echo "$ac_t""yes" 1>&6
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no
+  { echo "configure: error: cant find test code. Aborting config" 1>&2; exit 1; }
 fi
 rm -fr conftest*
 fi
 
-fi
-
-echo "$ac_t""$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" 1>&6
-if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_KERNEL_CHANGE_NOTIFY 1
-EOF
-
-fi
 
-echo $ac_n "checking for kernel share modes""... $ac_c" 1>&6
-echo "configure:10072: checking for kernel share modes" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_KERNEL_SHARE_MODES'+set}'`\" = set"; then
+echo $ac_n "checking for ftruncate extend""... $ac_c" 1>&6
+echo "configure:10473: checking for ftruncate extend" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_FTRUNCATE_EXTEND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_KERNEL_SHARE_MODES=cross
+  samba_cv_HAVE_FTRUNCATE_EXTEND=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10081 "configure"
+#line 10482 "configure"
 #include "confdefs.h"
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/file.h>
-#ifndef LOCK_MAND
-#define LOCK_MAND      32
-#define LOCK_READ      64
-#endif
-main() {
-               exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
-}
-
+#include "${srcdir-.}/tests/ftruncate.c"
 EOF
-if { (eval echo configure:10097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_KERNEL_SHARE_MODES=yes
+  samba_cv_HAVE_FTRUNCATE_EXTEND=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_KERNEL_SHARE_MODES=no
+  samba_cv_HAVE_FTRUNCATE_EXTEND=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_KERNEL_SHARE_MODES" 1>&6
-if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_KERNEL_SHARE_MODES 1
-EOF
-
-fi
-
-
-
-
-echo $ac_n "checking for IRIX kernel oplock type definitions""... $ac_c" 1>&6
-echo "configure:10123: checking for IRIX kernel oplock type definitions" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_KERNEL_OPLOCKS_IRIX'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-cat > conftest.$ac_ext <<EOF
-#line 10129 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <fcntl.h>
-int main() {
-oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;
-; return 0; }
-EOF
-if { (eval echo configure:10137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" 1>&6
-if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_FTRUNCATE_EXTEND" 1>&6
+if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_KERNEL_OPLOCKS_IRIX 1
+#define HAVE_FTRUNCATE_EXTEND 1
 EOF
 
 fi
 
-echo $ac_n "checking for irix specific capabilities""... $ac_c" 1>&6
-echo "configure:10158: checking for irix specific capabilities" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES'+set}'`\" = set"; then
+echo $ac_n "checking for AF_LOCAL socket support""... $ac_c" 1>&6
+echo "configure:10509: checking for AF_LOCAL socket support" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_WORKING_AF_LOCAL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross
+  samba_cv_HAVE_WORKING_AF_LOCAL=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10167 "configure"
+#line 10518 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <sys/capability.h>
-main() {
- cap_t cap;
- if ((cap = cap_get_proc()) == NULL)
-   exit(1);
- cap->cap_effective |= CAP_NETWORK_MGT;
- cap->cap_inheritable |= CAP_NETWORK_MGT;
- cap_set_proc(cap);
- exit(0);
-}
-
+#include "${srcdir-.}/tests/unixsock.c"
 EOF
-if { (eval echo configure:10182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes
+  samba_cv_HAVE_WORKING_AF_LOCAL=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no
+  samba_cv_HAVE_WORKING_AF_LOCAL=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" 1>&6
-if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_WORKING_AF_LOCAL" 1>&6
+if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
+then
     cat >> confdefs.h <<\EOF
-#define HAVE_IRIX_SPECIFIC_CAPABILITIES 1
+#define HAVE_WORKING_AF_LOCAL 1
 EOF
 
 fi
 
-#
-# Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
-# This is *really* broken but some systems (DEC OSF1) do this.... JRA.
-#
-
-echo $ac_n "checking for int16 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:10210: checking for int16 typedef included by rpc/rpc.h" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_INT16_FROM_RPC_RPC_H'+set}'`\" = set"; then
+echo $ac_n "checking for broken getgroups""... $ac_c" 1>&6
+echo "configure:10546: checking for broken getgroups" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_GETGROUPS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-cat > conftest.$ac_ext <<EOF
-#line 10216 "configure"
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_BROKEN_GETGROUPS=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10555 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#if defined(HAVE_RPC_RPC_H)
-#include <rpc/rpc.h>
-#endif
-int main() {
-int16 testvar;
-; return 0; }
+#include "${srcdir-.}/tests/getgroups.c"
 EOF
-if { (eval echo configure:10226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes
+if { (eval echo configure:10559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_BROKEN_GETGROUPS=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no
+  rm -fr conftest*
+  samba_cv_HAVE_BROKEN_GETGROUPS=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" 1>&6
-if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
+fi
+
+echo "$ac_t""$samba_cv_HAVE_BROKEN_GETGROUPS" 1>&6
+if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_INT16_FROM_RPC_RPC_H 1
+#define HAVE_BROKEN_GETGROUPS 1
 EOF
 
 fi
 
-echo $ac_n "checking for uint16 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:10247: checking for uint16 typedef included by rpc/rpc.h" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UINT16_FROM_RPC_RPC_H'+set}'`\" = set"; then
+echo $ac_n "checking whether getpass should be replaced""... $ac_c" 1>&6
+echo "configure:10582: checking whether getpass should be replaced" >&5
+if eval "test \"`echo '$''{'samba_cv_REPLACE_GETPASS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
 cat > conftest.$ac_ext <<EOF
-#line 10253 "configure"
+#line 10590 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#if defined(HAVE_RPC_RPC_H)
-#include <rpc/rpc.h>
-#endif
+
+#define REPLACE_GETPASS 1
+#define NO_CONFIG_H 1
+#define main dont_declare_main
+#include "${srcdir-.}/lib/getsmbpass.c"
+#undef main
+
 int main() {
-uint16 testvar;
+
 ; return 0; }
 EOF
-if { (eval echo configure:10263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes
+  samba_cv_REPLACE_GETPASS=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no
+  samba_cv_REPLACE_GETPASS=no
 fi
 rm -f conftest*
+CPPFLAGS="$SAVE_CPPFLAGS"
+
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" 1>&6
-if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_UINT16_FROM_RPC_RPC_H 1
+echo "$ac_t""$samba_cv_REPLACE_GETPASS" 1>&6
+if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
+       cat >> confdefs.h <<\EOF
+#define REPLACE_GETPASS 1
 EOF
 
 fi
 
-echo $ac_n "checking for int32 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:10284: checking for int32 typedef included by rpc/rpc.h" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_INT32_FROM_RPC_RPC_H'+set}'`\" = set"; then
+echo $ac_n "checking for broken inet_ntoa""... $ac_c" 1>&6
+echo "configure:10626: checking for broken inet_ntoa" >&5
+if eval "test \"`echo '$''{'samba_cv_REPLACE_INET_NTOA'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-cat > conftest.$ac_ext <<EOF
-#line 10290 "configure"
+if test "$cross_compiling" = yes; then
+  samba_cv_REPLACE_INET_NTOA=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10635 "configure"
 #include "confdefs.h"
+
+#include <stdio.h>
 #include <sys/types.h>
-#if defined(HAVE_RPC_RPC_H)
-#include <rpc/rpc.h>
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
 #endif
-int main() {
-int32 testvar;
-; return 0; }
+main() { struct in_addr ip; ip.s_addr = 0x12345678;
+if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
+    strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } 
+exit(1);}
 EOF
-if { (eval echo configure:10300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes
+if { (eval echo configure:10649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_REPLACE_INET_NTOA=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no
+  rm -fr conftest*
+  samba_cv_REPLACE_INET_NTOA=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" 1>&6
-if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
+fi
+
+echo "$ac_t""$samba_cv_REPLACE_INET_NTOA" 1>&6
+if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_INT32_FROM_RPC_RPC_H 1
+#define REPLACE_INET_NTOA 1
 EOF
 
 fi
 
-echo $ac_n "checking for uint32 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:10321: checking for uint32 typedef included by rpc/rpc.h" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_UINT32_FROM_RPC_RPC_H'+set}'`\" = set"; then
+echo $ac_n "checking for secure mkstemp""... $ac_c" 1>&6
+echo "configure:10672: checking for secure mkstemp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_SECURE_MKSTEMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-cat > conftest.$ac_ext <<EOF
-#line 10327 "configure"
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_SECURE_MKSTEMP=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10681 "configure"
 #include "confdefs.h"
+#include <stdlib.h>
 #include <sys/types.h>
-#if defined(HAVE_RPC_RPC_H)
-#include <rpc/rpc.h>
-#endif
-int main() {
-uint32 testvar;
-; return 0; }
+#include <sys/stat.h>
+#include <unistd.h>
+main() { 
+  struct stat st;
+  char tpl[20]="/tmp/test.XXXXXX"; 
+  int fd = mkstemp(tpl); 
+  if (fd == -1) exit(1);
+  unlink(tpl);
+  if (fstat(fd, &st) != 0) exit(1);
+  if ((st.st_mode & 0777) != 0600) exit(1);
+  exit(0);
+}
 EOF
-if { (eval echo configure:10337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes
+if { (eval echo configure:10698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_SECURE_MKSTEMP=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no
+  rm -fr conftest*
+  samba_cv_HAVE_SECURE_MKSTEMP=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" 1>&6
-if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
+fi
+
+echo "$ac_t""$samba_cv_HAVE_SECURE_MKSTEMP" 1>&6
+if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_UINT32_FROM_RPC_RPC_H 1
+#define HAVE_SECURE_MKSTEMP 1
 EOF
 
 fi
 
-
-echo $ac_n "checking for conflicting AUTH_ERROR define in rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:10359: checking for conflicting AUTH_ERROR define in rpc/rpc.h" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT'+set}'`\" = set"; then
+echo $ac_n "checking for sysconf(_SC_NGROUPS_MAX)""... $ac_c" 1>&6
+echo "configure:10721: checking for sysconf(_SC_NGROUPS_MAX)" >&5
+if eval "test \"`echo '$''{'samba_cv_SYSCONF_SC_NGROUPS_MAX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-cat > conftest.$ac_ext <<EOF
-#line 10365 "configure"
+if test "$cross_compiling" = yes; then
+  samba_cv_SYSCONF_SC_NGROUPS_MAX=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10730 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#ifdef HAVE_SYS_SECURITY_H
-#include <sys/security.h>
-#include <prot.h>
-#endif  /* HAVE_SYS_SECURITY_H */
-#if defined(HAVE_RPC_RPC_H)
-#include <rpc/rpc.h>
-#endif
-int main() {
-int testvar;
-; return 0; }
+#include <unistd.h>
+main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }
 EOF
-if { (eval echo configure:10379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no
+if { (eval echo configure:10735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_SYSCONF_SC_NGROUPS_MAX=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes
+  rm -fr conftest*
+  samba_cv_SYSCONF_SC_NGROUPS_MAX=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-echo "$ac_t""$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" 1>&6
-if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
+fi
+
+echo "$ac_t""$samba_cv_SYSCONF_SC_NGROUPS_MAX" 1>&6
+if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_RPC_AUTH_ERROR_CONFLICT 1
+#define SYSCONF_SC_NGROUPS_MAX 1
 EOF
 
 fi
 
-echo $ac_n "checking for test routines""... $ac_c" 1>&6
-echo "configure:10400: checking for test routines" >&5
+echo $ac_n "checking for root""... $ac_c" 1>&6
+echo "configure:10758: checking for root" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_ROOT'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
 if test "$cross_compiling" = yes; then
-  echo "configure: warning: cannot run when cross-compiling" 1>&2
+  samba_cv_HAVE_ROOT=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10405 "configure"
+#line 10767 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/tests/trivial.c"
+main() { exit(getuid() != 0); }
 EOF
-if { (eval echo configure:10409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  echo "$ac_t""yes" 1>&6
+  samba_cv_HAVE_ROOT=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  { echo "configure: error: cant find test code. Aborting config" 1>&2; exit 1; }
+  samba_cv_HAVE_ROOT=no
 fi
 rm -fr conftest*
 fi
 
+fi
 
-echo $ac_n "checking for ftruncate extend""... $ac_c" 1>&6
-echo "configure:10423: checking for ftruncate extend" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_FTRUNCATE_EXTEND'+set}'`\" = set"; then
+echo "$ac_t""$samba_cv_HAVE_ROOT" 1>&6
+if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_ROOT 1
+EOF
+
+else
+    echo "configure: warning: running as non-root will disable some tests" 1>&2
+fi
+
+##################
+# look for a method of finding the list of network interfaces
+iface=no;
+echo $ac_n "checking for iface AIX""... $ac_c" 1>&6
+echo "configure:10799: checking for iface AIX" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_IFACE_AIX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_FTRUNCATE_EXTEND=cross
+  samba_cv_HAVE_IFACE_AIX=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10432 "configure"
+#line 10808 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/tests/ftruncate.c"
+
+#define HAVE_IFACE_AIX 1
+#define AUTOCONF_TEST 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/interfaces.c"
 EOF
-if { (eval echo configure:10436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_FTRUNCATE_EXTEND=yes
+  samba_cv_HAVE_IFACE_AIX=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_FTRUNCATE_EXTEND=no
+  samba_cv_HAVE_IFACE_AIX=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_FTRUNCATE_EXTEND" 1>&6
-if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_FTRUNCATE_EXTEND 1
+echo "$ac_t""$samba_cv_HAVE_IFACE_AIX" 1>&6
+if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
+    iface=yes;cat >> confdefs.h <<\EOF
+#define HAVE_IFACE_AIX 1
 EOF
 
 fi
 
-echo $ac_n "checking for AF_LOCAL socket support""... $ac_c" 1>&6
-echo "configure:10459: checking for AF_LOCAL socket support" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_WORKING_AF_LOCAL'+set}'`\" = set"; then
+if test $iface = no; then
+echo $ac_n "checking for iface ifconf""... $ac_c" 1>&6
+echo "configure:10840: checking for iface ifconf" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_IFACE_IFCONF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_WORKING_AF_LOCAL=cross
+  samba_cv_HAVE_IFACE_IFCONF=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10468 "configure"
+#line 10849 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/tests/unixsock.c"
+
+#define HAVE_IFACE_IFCONF 1
+#define AUTOCONF_TEST 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/interfaces.c"
 EOF
-if { (eval echo configure:10472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_WORKING_AF_LOCAL=yes
+  samba_cv_HAVE_IFACE_IFCONF=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_WORKING_AF_LOCAL=no
+  samba_cv_HAVE_IFACE_IFCONF=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_WORKING_AF_LOCAL" 1>&6
-if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
-then
-    cat >> confdefs.h <<\EOF
-#define HAVE_WORKING_AF_LOCAL 1
+echo "$ac_t""$samba_cv_HAVE_IFACE_IFCONF" 1>&6
+if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
+    iface=yes;cat >> confdefs.h <<\EOF
+#define HAVE_IFACE_IFCONF 1
 EOF
 
+fi
 fi
 
-echo $ac_n "checking for broken getgroups""... $ac_c" 1>&6
-echo "configure:10496: checking for broken getgroups" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_GETGROUPS'+set}'`\" = set"; then
+if test $iface = no; then
+echo $ac_n "checking for iface ifreq""... $ac_c" 1>&6
+echo "configure:10882: checking for iface ifreq" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_IFACE_IFREQ'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_BROKEN_GETGROUPS=cross
+  samba_cv_HAVE_IFACE_IFREQ=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10505 "configure"
+#line 10891 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/tests/getgroups.c"
+
+#define HAVE_IFACE_IFREQ 1
+#define AUTOCONF_TEST 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/interfaces.c"
 EOF
-if { (eval echo configure:10509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_BROKEN_GETGROUPS=yes
+  samba_cv_HAVE_IFACE_IFREQ=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_BROKEN_GETGROUPS=no
+  samba_cv_HAVE_IFACE_IFREQ=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_BROKEN_GETGROUPS" 1>&6
-if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_BROKEN_GETGROUPS 1
+echo "$ac_t""$samba_cv_HAVE_IFACE_IFREQ" 1>&6
+if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
+    iface=yes;cat >> confdefs.h <<\EOF
+#define HAVE_IFACE_IFREQ 1
 EOF
 
 fi
+fi
 
-echo $ac_n "checking whether getpass should be replaced""... $ac_c" 1>&6
-echo "configure:10532: checking whether getpass should be replaced" >&5
-if eval "test \"`echo '$''{'samba_cv_REPLACE_GETPASS'+set}'`\" = set"; then
+
+################################################
+# look for a method of setting the effective uid
+seteuid=no;
+if test $seteuid = no; then
+echo $ac_n "checking for setresuid""... $ac_c" 1>&6
+echo "configure:10928: checking for setresuid" >&5
+if eval "test \"`echo '$''{'samba_cv_USE_SETRESUID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
-cat > conftest.$ac_ext <<EOF
-#line 10540 "configure"
+if test "$cross_compiling" = yes; then
+  samba_cv_USE_SETRESUID=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10937 "configure"
 #include "confdefs.h"
 
-#define REPLACE_GETPASS 1
-#define NO_CONFIG_H 1
-#define main dont_declare_main
-#include "${srcdir-.}/lib/getsmbpass.c"
-#undef main
-
-int main() {
-
-; return 0; }
+#define AUTOCONF_TEST 1
+#define USE_SETRESUID 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:10553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  samba_cv_REPLACE_GETPASS=yes
+if { (eval echo configure:10945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_USE_SETRESUID=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  samba_cv_REPLACE_GETPASS=no
+  rm -fr conftest*
+  samba_cv_USE_SETRESUID=no
+fi
+rm -fr conftest*
 fi
-rm -f conftest*
-CPPFLAGS="$SAVE_CPPFLAGS"
 
 fi
 
-echo "$ac_t""$samba_cv_REPLACE_GETPASS" 1>&6
-if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
-       cat >> confdefs.h <<\EOF
-#define REPLACE_GETPASS 1
+echo "$ac_t""$samba_cv_USE_SETRESUID" 1>&6
+if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
+    seteuid=yes;cat >> confdefs.h <<\EOF
+#define USE_SETRESUID 1
 EOF
 
 fi
+fi
 
-echo $ac_n "checking for broken inet_ntoa""... $ac_c" 1>&6
-echo "configure:10576: checking for broken inet_ntoa" >&5
-if eval "test \"`echo '$''{'samba_cv_REPLACE_INET_NTOA'+set}'`\" = set"; then
+
+if test $seteuid = no; then
+echo $ac_n "checking for setreuid""... $ac_c" 1>&6
+echo "configure:10971: checking for setreuid" >&5
+if eval "test \"`echo '$''{'samba_cv_USE_SETREUID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_REPLACE_INET_NTOA=cross
+  samba_cv_USE_SETREUID=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10585 "configure"
+#line 10980 "configure"
 #include "confdefs.h"
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-main() { struct in_addr ip; ip.s_addr = 0x12345678;
-if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
-    strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } 
-exit(1);}
+#define AUTOCONF_TEST 1
+#define USE_SETREUID 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:10599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_REPLACE_INET_NTOA=yes
+  samba_cv_USE_SETREUID=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_REPLACE_INET_NTOA=no
+  samba_cv_USE_SETREUID=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_REPLACE_INET_NTOA" 1>&6
-if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define REPLACE_INET_NTOA 1
+echo "$ac_t""$samba_cv_USE_SETREUID" 1>&6
+if test x"$samba_cv_USE_SETREUID" = x"yes"; then
+    seteuid=yes;cat >> confdefs.h <<\EOF
+#define USE_SETREUID 1
 EOF
 
+fi
 fi
 
-echo $ac_n "checking for secure mkstemp""... $ac_c" 1>&6
-echo "configure:10622: checking for secure mkstemp" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_SECURE_MKSTEMP'+set}'`\" = set"; then
+if test $seteuid = no; then
+echo $ac_n "checking for seteuid""... $ac_c" 1>&6
+echo "configure:11013: checking for seteuid" >&5
+if eval "test \"`echo '$''{'samba_cv_USE_SETEUID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_SECURE_MKSTEMP=cross
+  samba_cv_USE_SETEUID=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10631 "configure"
+#line 11022 "configure"
 #include "confdefs.h"
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-main() { 
-  struct stat st;
-  char tpl[20]="/tmp/test.XXXXXX"; 
-  int fd = mkstemp(tpl); 
-  if (fd == -1) exit(1);
-  unlink(tpl);
-  if (fstat(fd, &st) != 0) exit(1);
-  if ((st.st_mode & 0777) != 0600) exit(1);
-  exit(0);
-}
+
+#define AUTOCONF_TEST 1
+#define USE_SETEUID 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:10648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_SECURE_MKSTEMP=yes
+  samba_cv_USE_SETEUID=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_SECURE_MKSTEMP=no
+  samba_cv_USE_SETEUID=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_SECURE_MKSTEMP" 1>&6
-if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_SECURE_MKSTEMP 1
+echo "$ac_t""$samba_cv_USE_SETEUID" 1>&6
+if test x"$samba_cv_USE_SETEUID" = x"yes"; then
+    seteuid=yes;cat >> confdefs.h <<\EOF
+#define USE_SETEUID 1
 EOF
 
+fi
 fi
 
-echo $ac_n "checking for sysconf(_SC_NGROUPS_MAX)""... $ac_c" 1>&6
-echo "configure:10671: checking for sysconf(_SC_NGROUPS_MAX)" >&5
-if eval "test \"`echo '$''{'samba_cv_SYSCONF_SC_NGROUPS_MAX'+set}'`\" = set"; then
+if test $seteuid = no; then
+echo $ac_n "checking for setuidx""... $ac_c" 1>&6
+echo "configure:11055: checking for setuidx" >&5
+if eval "test \"`echo '$''{'samba_cv_USE_SETUIDX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_SYSCONF_SC_NGROUPS_MAX=cross
+  samba_cv_USE_SETUIDX=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10680 "configure"
+#line 11064 "configure"
 #include "confdefs.h"
-#include <unistd.h>
-main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }
+
+#define AUTOCONF_TEST 1
+#define USE_SETUIDX 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:10685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_SYSCONF_SC_NGROUPS_MAX=yes
+  samba_cv_USE_SETUIDX=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_SYSCONF_SC_NGROUPS_MAX=no
+  samba_cv_USE_SETUIDX=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_SYSCONF_SC_NGROUPS_MAX" 1>&6
-if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define SYSCONF_SC_NGROUPS_MAX 1
+echo "$ac_t""$samba_cv_USE_SETUIDX" 1>&6
+if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
+    seteuid=yes;cat >> confdefs.h <<\EOF
+#define USE_SETUIDX 1
 EOF
 
 fi
+fi
 
-echo $ac_n "checking for root""... $ac_c" 1>&6
-echo "configure:10708: checking for root" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_ROOT'+set}'`\" = set"; then
+
+echo $ac_n "checking for working mmap""... $ac_c" 1>&6
+echo "configure:11097: checking for working mmap" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_MMAP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_ROOT=cross
+  samba_cv_HAVE_MMAP=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10717 "configure"
+#line 11106 "configure"
 #include "confdefs.h"
-main() { exit(getuid() != 0); }
+#include "${srcdir-.}/tests/shared_mmap.c"
 EOF
-if { (eval echo configure:10721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_ROOT=yes
+  samba_cv_HAVE_MMAP=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_ROOT=no
+  samba_cv_HAVE_MMAP=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_ROOT" 1>&6
-if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
+echo "$ac_t""$samba_cv_HAVE_MMAP" 1>&6
+if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
     cat >> confdefs.h <<\EOF
-#define HAVE_ROOT 1
+#define HAVE_MMAP 1
 EOF
 
-else
-    echo "configure: warning: running as non-root will disable some tests" 1>&2
 fi
 
-##################
-# look for a method of finding the list of network interfaces
-iface=no;
-echo $ac_n "checking for iface AIX""... $ac_c" 1>&6
-echo "configure:10749: checking for iface AIX" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_IFACE_AIX'+set}'`\" = set"; then
+echo $ac_n "checking for ftruncate needs root""... $ac_c" 1>&6
+echo "configure:11133: checking for ftruncate needs root" >&5
+if eval "test \"`echo '$''{'samba_cv_FTRUNCATE_NEEDS_ROOT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_IFACE_AIX=cross
+  samba_cv_FTRUNCATE_NEEDS_ROOT=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10758 "configure"
-#include "confdefs.h"
-
-#define HAVE_IFACE_AIX 1
-#define AUTOCONF_TEST 1
+#line 11142 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/lib/interfaces.c"
+#include "${srcdir-.}/tests/ftruncroot.c"
 EOF
-if { (eval echo configure:10766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_IFACE_AIX=yes
+  samba_cv_FTRUNCATE_NEEDS_ROOT=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_IFACE_AIX=no
+  samba_cv_FTRUNCATE_NEEDS_ROOT=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_IFACE_AIX" 1>&6
-if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
-    iface=yes;cat >> confdefs.h <<\EOF
-#define HAVE_IFACE_AIX 1
+echo "$ac_t""$samba_cv_FTRUNCATE_NEEDS_ROOT" 1>&6
+if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define FTRUNCATE_NEEDS_ROOT 1
 EOF
 
 fi
 
-if test $iface = no; then
-echo $ac_n "checking for iface ifconf""... $ac_c" 1>&6
-echo "configure:10790: checking for iface ifconf" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_IFACE_IFCONF'+set}'`\" = set"; then
+echo $ac_n "checking for fcntl locking""... $ac_c" 1>&6
+echo "configure:11169: checking for fcntl locking" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_FCNTL_LOCK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_IFACE_IFCONF=cross
+  samba_cv_HAVE_FCNTL_LOCK=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10799 "configure"
-#include "confdefs.h"
-
-#define HAVE_IFACE_IFCONF 1
-#define AUTOCONF_TEST 1
+#line 11178 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/lib/interfaces.c"
+#include "${srcdir-.}/tests/fcntl_lock.c"
 EOF
-if { (eval echo configure:10807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_IFACE_IFCONF=yes
+  samba_cv_HAVE_FCNTL_LOCK=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_IFACE_IFCONF=no
+  samba_cv_HAVE_FCNTL_LOCK=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_IFACE_IFCONF" 1>&6
-if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
-    iface=yes;cat >> confdefs.h <<\EOF
-#define HAVE_IFACE_IFCONF 1
+echo "$ac_t""$samba_cv_HAVE_FCNTL_LOCK" 1>&6
+if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_FCNTL_LOCK 1
 EOF
 
-fi
 fi
 
-if test $iface = no; then
-echo $ac_n "checking for iface ifreq""... $ac_c" 1>&6
-echo "configure:10832: checking for iface ifreq" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_IFACE_IFREQ'+set}'`\" = set"; then
+echo $ac_n "checking for broken (glibc2.1/x86) 64 bit fcntl locking""... $ac_c" 1>&6
+echo "configure:11205: checking for broken (glibc2.1/x86) 64 bit fcntl locking" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_FCNTL64_LOCKS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_IFACE_IFREQ=cross
+  samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10841 "configure"
-#include "confdefs.h"
-
-#define HAVE_IFACE_IFREQ 1
-#define AUTOCONF_TEST 1
+#line 11214 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/lib/interfaces.c"
+#include "${srcdir-.}/tests/fcntl_lock64.c"
 EOF
-if { (eval echo configure:10849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_HAVE_IFACE_IFREQ=yes
+  samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_HAVE_IFACE_IFREQ=no
+  samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_HAVE_IFACE_IFREQ" 1>&6
-if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
-    iface=yes;cat >> confdefs.h <<\EOF
-#define HAVE_IFACE_IFREQ 1
+echo "$ac_t""$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" 1>&6
+if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_BROKEN_FCNTL64_LOCKS 1
 EOF
 
-fi
-fi
 
+else
 
-################################################
-# look for a method of setting the effective uid
-seteuid=no;
-if test $seteuid = no; then
-echo $ac_n "checking for setresuid""... $ac_c" 1>&6
-echo "configure:10878: checking for setresuid" >&5
-if eval "test \"`echo '$''{'samba_cv_USE_SETRESUID'+set}'`\" = set"; then
+
+  echo $ac_n "checking for 64 bit fcntl locking""... $ac_c" 1>&6
+echo "configure:11243: checking for 64 bit fcntl locking" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_STRUCT_FLOCK64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_USE_SETRESUID=cross
+  if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_STRUCT_FLOCK64=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10887 "configure"
+#line 11252 "configure"
 #include "confdefs.h"
 
-#define AUTOCONF_TEST 1
-#define USE_SETRESUID 1
-#include "confdefs.h"
-#include "${srcdir-.}/lib/util_sec.c"
+#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
+}
 EOF
-if { (eval echo configure:10895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
-  samba_cv_USE_SETRESUID=yes
+  samba_cv_HAVE_STRUCT_FLOCK64=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  samba_cv_USE_SETRESUID=no
+  samba_cv_HAVE_STRUCT_FLOCK64=no
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$samba_cv_USE_SETRESUID" 1>&6
-if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
-    seteuid=yes;cat >> confdefs.h <<\EOF
-#define USE_SETRESUID 1
+echo "$ac_t""$samba_cv_HAVE_STRUCT_FLOCK64" 1>&6
+
+  if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
+      cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_FLOCK64 1
 EOF
 
-fi
+  fi
 fi
 
-
-if test $seteuid = no; then
-echo $ac_n "checking for setreuid""... $ac_c" 1>&6
-echo "configure:10921: checking for setreuid" >&5
-if eval "test \"`echo '$''{'samba_cv_USE_SETREUID'+set}'`\" = set"; then
+echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
+echo "configure:11301: checking for st_blocks in struct stat" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_STAT_ST_BLOCKS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_USE_SETREUID=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 10930 "configure"
-#include "confdefs.h"
-
-#define AUTOCONF_TEST 1
-#define USE_SETREUID 1
+cat > conftest.$ac_ext <<EOF
+#line 11307 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/lib/util_sec.c"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+int main() {
+struct stat st;  st.st_blocks = 0;
+; return 0; }
 EOF
-if { (eval echo configure:10938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_USE_SETREUID=yes
+if { (eval echo configure:11316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_STAT_ST_BLOCKS=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_USE_SETREUID=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  samba_cv_HAVE_STAT_ST_BLOCKS=no
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_USE_SETREUID" 1>&6
-if test x"$samba_cv_USE_SETREUID" = x"yes"; then
-    seteuid=yes;cat >> confdefs.h <<\EOF
-#define USE_SETREUID 1
+echo "$ac_t""$samba_cv_HAVE_STAT_ST_BLOCKS" 1>&6
+if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_STAT_ST_BLOCKS 1
 EOF
 
-fi
-fi
+fi 
 
-if test $seteuid = no; then
-echo $ac_n "checking for seteuid""... $ac_c" 1>&6
-echo "configure:10963: checking for seteuid" >&5
-if eval "test \"`echo '$''{'samba_cv_USE_SETEUID'+set}'`\" = set"; then
+case "$host_os" in
+*linux*)
+echo $ac_n "checking for broken RedHat 7.2 system header files""... $ac_c" 1>&6
+echo "configure:11339: checking for broken RedHat 7.2 system header files" >&5
+if eval "test \"`echo '$''{'samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_USE_SETEUID=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 10972 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 11345 "configure"
 #include "confdefs.h"
 
-#define AUTOCONF_TEST 1
-#define USE_SETEUID 1
-#include "confdefs.h"
-#include "${srcdir-.}/lib/util_sec.c"
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_CAPABILITY_H
+#include <sys/capability.h>
+#endif
+
+int main() {
+int i;
+; return 0; }
 EOF
-if { (eval echo configure:10980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_USE_SETEUID=yes
+if { (eval echo configure:11359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_USE_SETEUID=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$samba_cv_USE_SETEUID" 1>&6
-if test x"$samba_cv_USE_SETEUID" = x"yes"; then
-    seteuid=yes;cat >> confdefs.h <<\EOF
-#define USE_SETEUID 1
+echo "$ac_t""$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" 1>&6
+if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
+   cat >> confdefs.h <<\EOF
+#define BROKEN_REDHAT_7_SYSTEM_HEADERS 1
 EOF
 
 fi
-fi
+;;
+esac
 
-if test $seteuid = no; then
-echo $ac_n "checking for setuidx""... $ac_c" 1>&6
-echo "configure:11005: checking for setuidx" >&5
-if eval "test \"`echo '$''{'samba_cv_USE_SETUIDX'+set}'`\" = set"; then
+echo $ac_n "checking for broken nisplus include files""... $ac_c" 1>&6
+echo "configure:11382: checking for broken nisplus include files" >&5
+if eval "test \"`echo '$''{'samba_cv_BROKEN_NISPLUS_INCLUDE_FILES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-if test "$cross_compiling" = yes; then
-  samba_cv_USE_SETUIDX=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 11014 "configure"
-#include "confdefs.h"
-
-#define AUTOCONF_TEST 1
-#define USE_SETUIDX 1
+cat > conftest.$ac_ext <<EOF
+#line 11388 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/lib/util_sec.c"
+#include <sys/acl.h>
+#if defined(HAVE_RPCSVC_NIS_H)
+#include <rpcsvc/nis.h>
+#endif
+int main() {
+int i;
+; return 0; }
 EOF
-if { (eval echo configure:11022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_USE_SETUIDX=yes
+if { (eval echo configure:11398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_USE_SETUIDX=no
+  rm -rf conftest*
+  samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes
 fi
-rm -fr conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" 1>&6
+if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define BROKEN_NISPLUS_INCLUDE_FILES 1
+EOF
+
 fi
 
+
+#################################################
+# check for smbwrapper support
+echo $ac_n "checking whether to use smbwrapper""... $ac_c" 1>&6
+echo "configure:11422: checking whether to use smbwrapper" >&5
+# Check whether --with-smbwrapper or --without-smbwrapper was given.
+if test "${with_smbwrapper+set}" = set; then
+  withval="$with_smbwrapper"
+   case "$withval" in
+  yes)
+    echo "$ac_t""yes" 1>&6
+    cat >> confdefs.h <<\EOF
+#define WITH_SMBWRAPPER 1
+EOF
+
+       WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
+
+       if test x$ATTEMPT_WRAP32_BUILD = x; then
+               WRAP32=""
+       else
+                       WRAP32=bin/smbwrapper.32.$SHLIBEXT
+       fi
+
+# Conditions under which smbwrapper should not be built.
+
+       if test x$PICFLAG = x; then
+          echo No support for PIC code - disabling smbwrapper and smbsh
+          WRAP=""
+          WRAP32=""
+       elif test x$ac_cv_func_syscall = xno; then
+          echo "$ac_t""No syscall() -- disabling smbwrapper and smbsh" 1>&6
+          WRAP=""
+          WRAP32=""
+       fi
+    ;;
+  *)
+    echo "$ac_t""no" 1>&6
+    ;;
+  esac 
+else
+  echo "$ac_t""no" 1>&6
+
 fi
 
-echo "$ac_t""$samba_cv_USE_SETUIDX" 1>&6
-if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
-    seteuid=yes;cat >> confdefs.h <<\EOF
-#define USE_SETUIDX 1
+
+#################################################
+# check for AFS clear-text auth support
+echo $ac_n "checking whether to use AFS clear-text auth""... $ac_c" 1>&6
+echo "configure:11466: checking whether to use AFS clear-text auth" >&5
+# Check whether --with-afs or --without-afs was given.
+if test "${with_afs+set}" = set; then
+  withval="$with_afs"
+   case "$withval" in
+  yes)
+    echo "$ac_t""yes" 1>&6
+    cat >> confdefs.h <<\EOF
+#define WITH_AFS 1
 EOF
 
-fi
+    ;;
+  *)
+    echo "$ac_t""no" 1>&6
+    ;;
+  esac 
+else
+  echo "$ac_t""no" 1>&6
+
 fi
 
 
-echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:11047: checking for working mmap" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_MMAP'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_MMAP=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 11056 "configure"
-#include "confdefs.h"
-#include "${srcdir-.}/tests/shared_mmap.c"
+
+#################################################
+# check for the DFS clear-text auth system
+echo $ac_n "checking whether to use DFS clear-text auth""... $ac_c" 1>&6
+echo "configure:11492: checking whether to use DFS clear-text auth" >&5
+# Check whether --with-dfs or --without-dfs was given.
+if test "${with_dfs+set}" = set; then
+  withval="$with_dfs"
+   case "$withval" in
+  yes)
+    echo "$ac_t""yes" 1>&6
+    cat >> confdefs.h <<\EOF
+#define WITH_DFS 1
 EOF
-if { (eval echo configure:11060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_MMAP=yes
+
+    ;;
+  *)
+    echo "$ac_t""no" 1>&6
+    ;;
+  esac 
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_MMAP=no
-fi
-rm -fr conftest*
+  echo "$ac_t""no" 1>&6
+
 fi
 
+
+
+#################################################
+# see if this box has the RedHat location for kerberos
+echo $ac_n "checking for /usr/kerberos""... $ac_c" 1>&6
+echo "configure:11518: checking for /usr/kerberos" >&5
+if test -d /usr/kerberos; then
+    LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
+    CFLAGS="$CFLAGS -I/usr/kerberos/include"
+    CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
+    echo "$ac_t""yes" 1>&6
+else
+    echo "$ac_t""no" 1>&6
 fi
 
-echo "$ac_t""$samba_cv_HAVE_MMAP" 1>&6
-if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_MMAP 1
-EOF
+#################################################
+# check for location of Kerberos 5 install
+echo $ac_n "checking for kerberos 5 install path""... $ac_c" 1>&6
+echo "configure:11531: checking for kerberos 5 install path" >&5
+# Check whether --with-krb5 or --without-krb5 was given.
+if test "${with_krb5+set}" = set; then
+  withval="$with_krb5"
+   case "$withval" in
+  no)
+    echo "$ac_t""no" 1>&6
+    ;;
+  *)
+    echo "$ac_t""yes" 1>&6
+    LIBS="$LIBS -lkrb5"
+    CFLAGS="$CFLAGS -I$withval/include"
+    CPPFLAGS="$CPPFLAGS -I$withval/include"
+    LDFLAGS="$LDFLAGS -L$withval/lib"
+    ;;
+  esac 
+else
+  echo "$ac_t""no" 1>&6
 
 fi
 
-echo $ac_n "checking for ftruncate needs root""... $ac_c" 1>&6
-echo "configure:11083: checking for ftruncate needs root" >&5
-if eval "test \"`echo '$''{'samba_cv_FTRUNCATE_NEEDS_ROOT'+set}'`\" = set"; then
+
+# now check for krb5.h. Some systems have the libraries without the headers!
+# note that this check is done here to allow for different kerberos
+# include paths
+for ac_hdr in krb5.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:11560: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-if test "$cross_compiling" = yes; then
-  samba_cv_FTRUNCATE_NEEDS_ROOT=cross
-else
   cat > conftest.$ac_ext <<EOF
-#line 11092 "configure"
+#line 11565 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/tests/ftruncroot.c"
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:11096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_FTRUNCATE_NEEDS_ROOT=yes
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:11570: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_FTRUNCATE_NEEDS_ROOT=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
 fi
-
+rm -f conftest*
 fi
-
-echo "$ac_t""$samba_cv_FTRUNCATE_NEEDS_ROOT" 1>&6
-if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define FTRUNCATE_NEEDS_ROOT 1
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
 EOF
-
+else
+  echo "$ac_t""no" 1>&6
 fi
+done
 
-echo $ac_n "checking for fcntl locking""... $ac_c" 1>&6
-echo "configure:11119: checking for fcntl locking" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_FCNTL_LOCK'+set}'`\" = set"; then
+
+# now check for gssapi headers.  This is also done here to allow for
+# different kerberos include paths
+for ac_hdr in gssapi/gssapi_generic.h gssapi/gssapi.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:11603: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_FCNTL_LOCK=cross
-else
   cat > conftest.$ac_ext <<EOF
-#line 11128 "configure"
+#line 11608 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/tests/fcntl_lock.c"
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:11132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_FCNTL_LOCK=yes
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:11613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_FCNTL_LOCK=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
 fi
-
+rm -f conftest*
 fi
-
-echo "$ac_t""$samba_cv_HAVE_FCNTL_LOCK" 1>&6
-if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_FCNTL_LOCK 1
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
 EOF
-
+else
+  echo "$ac_t""no" 1>&6
 fi
+done
 
-echo $ac_n "checking for broken (glibc2.1/x86) 64 bit fcntl locking""... $ac_c" 1>&6
-echo "configure:11155: checking for broken (glibc2.1/x86) 64 bit fcntl locking" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_FCNTL64_LOCKS'+set}'`\" = set"; then
+
+##################################################################
+# we might need the k5crypto and com_err libraries on some systems
+echo $ac_n "checking for _et_list in -lcom_err""... $ac_c" 1>&6
+echo "configure:11643: checking for _et_list in -lcom_err" >&5
+ac_lib_var=`echo com_err'_'_et_list | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 11164 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lcom_err  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11651 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/tests/fcntl_lock64.c"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char _et_list();
+
+int main() {
+_et_list()
+; return 0; }
 EOF
-if { (eval echo configure:11168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes
+if { (eval echo configure:11662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
 
 fi
-
-echo "$ac_t""$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" 1>&6
-if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_BROKEN_FCNTL64_LOCKS 1
-EOF
-
-
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$LIBS -lcom_err"
 else
+  echo "$ac_t""no" 1>&6
+fi
 
-
-  echo $ac_n "checking for 64 bit fcntl locking""... $ac_c" 1>&6
-echo "configure:11193: checking for 64 bit fcntl locking" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_STRUCT_FLOCK64'+set}'`\" = set"; then
+echo $ac_n "checking for krb5_encrypt_data in -lk5crypto""... $ac_c" 1>&6
+echo "configure:11683: checking for krb5_encrypt_data in -lk5crypto" >&5
+ac_lib_var=`echo k5crypto'_'krb5_encrypt_data | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-  if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_STRUCT_FLOCK64=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 11202 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lk5crypto  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11691 "configure"
 #include "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
-}
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char krb5_encrypt_data();
+
+int main() {
+krb5_encrypt_data()
+; return 0; }
 EOF
-if { (eval echo configure:11226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_STRUCT_FLOCK64=yes
+if { (eval echo configure:11702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_STRUCT_FLOCK64=no
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
 
 fi
-
-echo "$ac_t""$samba_cv_HAVE_STRUCT_FLOCK64" 1>&6
-
-  if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
-      cat >> confdefs.h <<\EOF
-#define HAVE_STRUCT_FLOCK64 1
-EOF
-
-  fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$LIBS -lk5crypto"
+else
+  echo "$ac_t""no" 1>&6
 fi
 
-echo $ac_n "checking for a crypt that needs truncated salt""... $ac_c" 1>&6
-echo "configure:11251: checking for a crypt that needs truncated salt" >&5
-if eval "test \"`echo '$''{'samba_cv_HAVE_TRUNCATED_SALT'+set}'`\" = set"; then
+echo $ac_n "checking for gss_display_status in -lgssapi_krb5""... $ac_c" 1>&6
+echo "configure:11723: checking for gss_display_status in -lgssapi_krb5" >&5
+ac_lib_var=`echo gssapi_krb5'_'gss_display_status | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-if test "$cross_compiling" = yes; then
-  samba_cv_HAVE_TRUNCATED_SALT=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 11260 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lgssapi_krb5  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11731 "configure"
 #include "confdefs.h"
-#include "${srcdir-.}/tests/crypttest.c"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char gss_display_status();
+
+int main() {
+gss_display_status()
+; return 0; }
 EOF
-if { (eval echo configure:11264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  samba_cv_HAVE_TRUNCATED_SALT=no
+if { (eval echo configure:11742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  samba_cv_HAVE_TRUNCATED_SALT=yes
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
 
 fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$LIBS -lgssapi_krb5"
+else
+  echo "$ac_t""no" 1>&6
+fi
 
-echo "$ac_t""$samba_cv_HAVE_TRUNCATED_SALT" 1>&6
-if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_TRUNCATED_SALT 1
-EOF
 
-fi
 
-echo $ac_n "checking for broken nisplus include files""... $ac_c" 1>&6
-echo "configure:11287: checking for broken nisplus include files" >&5
-if eval "test \"`echo '$''{'samba_cv_BROKEN_NISPLUS_INCLUDE_FILES'+set}'`\" = set"; then
+########################################################
+# now see if we can find the krb5 libs in standard paths
+# or as specified above
+echo $ac_n "checking for krb5_mk_req_extended in -lkrb5""... $ac_c" 1>&6
+echo "configure:11768: checking for krb5_mk_req_extended in -lkrb5" >&5
+ac_lib_var=`echo krb5'_'krb5_mk_req_extended | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb5  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11293 "configure"
+#line 11776 "configure"
 #include "confdefs.h"
-#include <sys/acl.h>
-#if defined(HAVE_RPCSVC_NIS_H)
-#include <rpcsvc/nis.h>
-#endif
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char krb5_mk_req_extended();
+
 int main() {
-return 0;
+krb5_mk_req_extended()
 ; return 0; }
 EOF
-if { (eval echo configure:11303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-fi
-
-echo "$ac_t""$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" 1>&6
-if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
-    cat >> confdefs.h <<\EOF
-#define BROKEN_NISPLUS_INCLUDE_FILES 1
-EOF
+LIBS="$ac_save_LIBS"
 
 fi
-
-
-#################################################
-# check for smbwrapper support
-echo $ac_n "checking whether to use smbwrapper""... $ac_c" 1>&6
-echo "configure:11327: checking whether to use smbwrapper" >&5
-# Check whether --with-smbwrapper or --without-smbwrapper was given.
-if test "${with_smbwrapper+set}" = set; then
-  withval="$with_smbwrapper"
-   case "$withval" in
-  yes)
-    echo "$ac_t""yes" 1>&6
-    cat >> confdefs.h <<\EOF
-#define WITH_SMBWRAPPER 1
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$LIBS -lkrb5";
+       cat >> confdefs.h <<\EOF
+#define HAVE_KRB5 1
 EOF
 
-       WRAP="bin/smbsh bin/smbwrapper.$SHLIBEXT"
-
-       if test x$ATTEMPT_WRAP32_BUILD = x; then
-               WRAP32=""
-       else
-                       WRAP32=bin/smbwrapper.32.$SHLIBEXT
-       fi
-
-# Conditions under which smbwrapper should not be built.
-
-       if test x$PICFLAG = x; then
-          echo No support for PIC code - disabling smbwrapper and smbsh
-          WRAP=""
-          WRAP32=""
-       elif test x$ac_cv_func_syscall = xno; then
-          echo "$ac_t""No syscall() -- disabling smbwrapper and smbsh" 1>&6
-          WRAP=""
-          WRAP32=""
-       fi
-    ;;
-  *)
-    echo "$ac_t""no" 1>&6
-    ;;
-  esac 
 else
   echo "$ac_t""no" 1>&6
-
 fi
 
 
-#################################################
-# check for the AFS filesystem
-echo $ac_n "checking whether to use AFS""... $ac_c" 1>&6
-echo "configure:11371: checking whether to use AFS" >&5
-# Check whether --with-afs or --without-afs was given.
-if test "${with_afs+set}" = set; then
-  withval="$with_afs"
-   case "$withval" in
-  yes)
-    echo "$ac_t""yes" 1>&6
-    cat >> confdefs.h <<\EOF
-#define WITH_AFS 1
-EOF
-
-    ;;
-  *)
-    echo "$ac_t""no" 1>&6
-    ;;
-  esac 
+########################################################
+# now see if we can find the gssapi libs in standard paths
+echo $ac_n "checking for gss_display_status in -lgssapi_krb5""... $ac_c" 1>&6
+echo "configure:11815: checking for gss_display_status in -lgssapi_krb5" >&5
+ac_lib_var=`echo gssapi_krb5'_'gss_display_status | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  ac_save_LIBS="$LIBS"
+LIBS="-lgssapi_krb5  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11823 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char gss_display_status();
 
+int main() {
+gss_display_status()
+; return 0; }
+EOF
+if { (eval echo configure:11834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
 
-
-
-#################################################
-# check for the DFS auth system
-echo $ac_n "checking whether to use DFS auth""... $ac_c" 1>&6
-echo "configure:11397: checking whether to use DFS auth" >&5
-# Check whether --with-dfs or --without-dfs was given.
-if test "${with_dfs+set}" = set; then
-  withval="$with_dfs"
-   case "$withval" in
-  yes)
-    echo "$ac_t""yes" 1>&6
-    cat >> confdefs.h <<\EOF
-#define WITH_DFS 1
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_GSSAPI 1
 EOF
 
-    ;;
-  *)
-    echo "$ac_t""no" 1>&6
-    ;;
-  esac 
 else
   echo "$ac_t""no" 1>&6
-
 fi
 
 
-#################################################
-# check for Kerberos IV auth system
-echo $ac_n "checking whether to use Kerberos IV""... $ac_c" 1>&6
-echo "configure:11422: checking whether to use Kerberos IV" >&5
-# Check whether --with-krb4 or --without-krb4 was given.
-if test "${with_krb4+set}" = set; then
-  withval="$with_krb4"
-     echo "$ac_t""yes" 1>&6
-    cat >> confdefs.h <<\EOF
-#define KRB4_AUTH 1
-EOF
 
-    echo $ac_n "checking for dn_expand in -lresolv""... $ac_c" 1>&6
-echo "configure:11432: checking for dn_expand in -lresolv" >&5
-ac_lib_var=`echo resolv'_'dn_expand | sed 'y%./+-%__p_%'`
+##################################################################
+# we might need the lber lib on some systems. To avoid link errors
+# this test must be before the libldap test
+echo $ac_n "checking for ber_scanf in -llber""... $ac_c" 1>&6
+echo "configure:11863: checking for ber_scanf in -llber" >&5
+ac_lib_var=`echo lber'_'ber_scanf | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lresolv  $LIBS"
+LIBS="-llber  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11440 "configure"
+#line 11871 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char dn_expand();
+char ber_scanf();
 
 int main() {
-dn_expand()
+ber_scanf()
 ; return 0; }
 EOF
-if { (eval echo configure:11451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11462,52 +11893,65 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lresolv $LIBS"
-
+  LIBS="$LIBS -llber"
 else
   echo "$ac_t""no" 1>&6
 fi
 
-    LIBS="$LIBS -lkrb -ldes"
-    CFLAGS="$CFLAGS -I$withval/include"
-    LDFLAGS="$LDFLAGS -L$withval/lib"
+
+########################################################
+# now see if we can find the ldap libs in standard paths
+if test x$have_ldap != xyes; then
+echo $ac_n "checking for ldap_domain2hostlist in -lldap""... $ac_c" 1>&6
+echo "configure:11907: checking for ldap_domain2hostlist in -lldap" >&5
+ac_lib_var=`echo ldap'_'ldap_domain2hostlist | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  ac_save_LIBS="$LIBS"
+LIBS="-lldap  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11915 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char ldap_domain2hostlist();
 
+int main() {
+ldap_domain2hostlist()
+; return 0; }
+EOF
+if { (eval echo configure:11926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
 
-
-#################################################
-# check for Kerberos 5 auth system
-echo $ac_n "checking whether to use Kerberos 5""... $ac_c" 1>&6
-echo "configure:11490: checking whether to use Kerberos 5" >&5
-# Check whether --with-krb5 or --without-krb5 was given.
-if test "${with_krb5+set}" = set; then
-  withval="$with_krb5"
-     echo "$ac_t""yes" 1>&6
-    cat >> confdefs.h <<\EOF
-#define KRB5_AUTH 1
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$LIBS -lldap";
+       cat >> confdefs.h <<\EOF
+#define HAVE_LDAP 1
 EOF
 
-    LIBS="$LIBS -ldes425 -lkrb5 -lcrypto -lcom_err"
-    CFLAGS="$CFLAGS -I$withval/include"
-    LDFLAGS="$LDFLAGS -L$withval/lib"
 else
   echo "$ac_t""no" 1>&6
-
 fi
 
+fi
 
 #################################################
 # check for automount support
 echo $ac_n "checking whether to use AUTOMOUNT""... $ac_c" 1>&6
-echo "configure:11511: checking whether to use AUTOMOUNT" >&5
+echo "configure:11955: checking whether to use AUTOMOUNT" >&5
 # Check whether --with-automount or --without-automount was given.
 if test "${with_automount+set}" = set; then
   withval="$with_automount"
 #################################################
 # check for smbmount support
 echo $ac_n "checking whether to use SMBMOUNT""... $ac_c" 1>&6
-echo "configure:11536: checking whether to use SMBMOUNT" >&5
+echo "configure:11980: checking whether to use SMBMOUNT" >&5
 # Check whether --with-smbmount or --without-smbmount was given.
 if test "${with_smbmount+set}" = set; then
   withval="$with_smbmount"
    case "$withval" in
   yes)
-    echo "$ac_t""yes" 1>&6
-    cat >> confdefs.h <<\EOF
+       case "$host_os" in
+       *linux*)
+               echo "$ac_t""yes" 1>&6
+               cat >> confdefs.h <<\EOF
 #define WITH_SMBMOUNT 1
 EOF
 
-    MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
+               MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
+               ;;
+       *)
+               { echo "configure: error: not on a linux system!" 1>&2; exit 1; }
+               ;;
+       esac
     ;;
   *)
     echo "$ac_t""no" 1>&6
 
 
 #################################################
-# check for a PAM password database
-
-echo $ac_n "checking whether to use PAM password database""... $ac_c" 1>&6
-echo "configure:11566: checking whether to use PAM password database" >&5
+# check for a PAM clear-text auth, accounts, password and session support
+with_pam_for_crypt=no
+echo $ac_n "checking whether to use PAM""... $ac_c" 1>&6
+echo "configure:12017: checking whether to use PAM" >&5
 # Check whether --with-pam or --without-pam was given.
 if test "${with_pam+set}" = set; then
   withval="$with_pam"
@@ -11574,6 +12025,7 @@ if test "${with_pam+set}" = set; then
 EOF
 
     LIBS="$LIBS -lpam"
+    with_pam_for_crypt=yes
     ;;
   *)
     echo "$ac_t""no" 1>&6
@@ -11587,7 +12039,7 @@ fi
 
 # we can't build a pam module if we don't have pam.
 echo $ac_n "checking for pam_get_data in -lpam""... $ac_c" 1>&6
-echo "configure:11591: checking for pam_get_data in -lpam" >&5
+echo "configure:12043: checking for pam_get_data in -lpam" >&5
 ac_lib_var=`echo pam'_'pam_get_data | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11595,7 +12047,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpam  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11599 "configure"
+#line 12051 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11606,7 +12058,7 @@ int main() {
 pam_get_data()
 ; return 0; }
 EOF
-if { (eval echo configure:11610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11633,7 +12085,7 @@ fi
 #################################################
 # check for pam_smbpass support
 echo $ac_n "checking whether to use pam_smbpass""... $ac_c" 1>&6
-echo "configure:11637: checking whether to use pam_smbpass" >&5
+echo "configure:12089: checking whether to use pam_smbpass" >&5
 # Check whether --with-pam_smbpass or --without-pam_smbpass was given.
 if test "${with_pam_smbpass+set}" = set; then
   withval="$with_pam_smbpass"
@@ -11649,11 +12101,7 @@ if test "${with_pam_smbpass+set}" = set; then
        elif test x$ac_cv_lib_pam_pam_get_data = xno; then
           echo "$ac_t""No libpam found -- disabling pam_smbpass" 1>&6
           PAM_MOD=""
-       else
-          cat >> confdefs.h <<\EOF
-#define WITH_PAM_SMBPASS 1
-EOF
-
+       else
           PAM_MOD="bin/pam_smbpass.so"
        fi
     ;;
 ###############################################
 # test for where we get crypt() from, but only
 # if not using PAM
-if test $with_pam != yes; then
+if test $with_pam_for_crypt = no; then
 for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11679: checking for $ac_func" >&5
+echo "configure:12127: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11684 "configure"
+#line 12132 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -11703,7 +12151,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:11707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -11729,7 +12177,7 @@ done
 
 if test x"$ac_cv_func_crypt" = x"no"; then
     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:11733: checking for crypt in -lcrypt" >&5
+echo "configure:12181: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11737,7 +12185,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11741 "configure"
+#line 12189 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11748,7 +12196,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:11752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 fi
 fi
 
+##
+## moved after the check for -lcrypt in order to
+## ensure that the necessary libraries are included
+## check checking for truncated salt.  Wrapped by the
+## $with_pam_for_crypt variable as above   --jerry
+##
+if test $with_pam_for_crypt = no; then
+echo $ac_n "checking for a crypt that needs truncated salt""... $ac_c" 1>&6
+echo "configure:12235: checking for a crypt that needs truncated salt" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_TRUNCATED_SALT'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+if test "$cross_compiling" = yes; then
+  samba_cv_HAVE_TRUNCATED_SALT=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 12244 "configure"
+#include "confdefs.h"
+#include "${srcdir-.}/tests/crypttest.c"
+EOF
+if { (eval echo configure:12248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  samba_cv_HAVE_TRUNCATED_SALT=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  samba_cv_HAVE_TRUNCATED_SALT=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$samba_cv_HAVE_TRUNCATED_SALT" 1>&6
+if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_TRUNCATED_SALT 1
+EOF
+
+fi
+fi
+
+
+
+########################################################################################
+##
+## TESTS FOR SAM BACKENDS.  KEEP THESE GROUPED TOGETHER
+##
+########################################################################################
+
+## set the with_smbpasswd_sam as the default
+with_smbpasswd_sam=yes
+
 
 #################################################
 # check for a TDB password database
-echo $ac_n "checking whether to use TDB password database""... $ac_c" 1>&6
-echo "configure:11783: checking whether to use TDB password database" >&5
+echo $ac_n "checking whether to use TDB SAM database""... $ac_c" 1>&6
+echo "configure:12286: checking whether to use TDB SAM database" >&5
 # Check whether --with-tdbsam or --without-tdbsam was given.
 if test "${with_tdbsam+set}" = set; then
   withval="$with_tdbsam"
@@ -11787,10 +12290,10 @@ if test "${with_tdbsam+set}" = set; then
   yes)
     echo "$ac_t""yes" 1>&6
     cat >> confdefs.h <<\EOF
-#define WITH_TDBPWD 1
+#define WITH_TDB_SAM 1
 EOF
 
-#    AC_MSG_ERROR([TDB password database not supported in this version.])
+    with_smbpasswd_sam=no
     ;;
   *)
     echo "$ac_t""no" 1>&6
 
 #################################################
 # check for a LDAP password database
-echo $ac_n "checking whether to use LDAP password database""... $ac_c" 1>&6
-echo "configure:11809: checking whether to use LDAP password database" >&5
-# Check whether --with-ldap or --without-ldap was given.
-if test "${with_ldap+set}" = set; then
-  withval="$with_ldap"
+echo $ac_n "checking whether to use LDAP SAM database""... $ac_c" 1>&6
+echo "configure:12312: checking whether to use LDAP SAM database" >&5
+# Check whether --with-ldapsam or --without-ldapsam was given.
+if test "${with_ldapsam+set}" = set; then
+  withval="$with_ldapsam"
    case "$withval" in
   yes)
     echo "$ac_t""yes" 1>&6
     cat >> confdefs.h <<\EOF
-#define WITH_LDAP 1
+#define WITH_LDAP_SAM 1
 EOF
 
-    { echo "configure: error: LDAP password database not supported in this version." 1>&2; exit 1; }
+    LIBS="-lldap -llber $LIBS"
+    with_smbpasswd_sam=no
     ;;
   *)
     echo "$ac_t""no" 1>&6
 
 #################################################
 # check for a NISPLUS password database
-echo $ac_n "checking whether to use NISPLUS password database""... $ac_c" 1>&6
-echo "configure:11835: checking whether to use NISPLUS password database" >&5
-# Check whether --with-nisplus or --without-nisplus was given.
-if test "${with_nisplus+set}" = set; then
-  withval="$with_nisplus"
+echo $ac_n "checking whether to use NISPLUS SAM database""... $ac_c" 1>&6
+echo "configure:12339: checking whether to use NISPLUS SAM database" >&5
+# Check whether --with-nisplussam or --without-nisplussam was given.
+if test "${with_nisplussam+set}" = set; then
+  withval="$with_nisplussam"
    case "$withval" in
   yes)
     echo "$ac_t""yes" 1>&6
     cat >> confdefs.h <<\EOF
-#define WITH_NISPLUS 1
+#define WITH_NISPLUS_SAM 1
 EOF
 
+    with_smbpasswd_sam=no
     ;;
   *)
     echo "$ac_t""no" 1>&6
@@ -11853,10 +12358,32 @@ else
 fi
 
 
+################################################
+# This test should come last because the
+# smbpasswd SAM is only used if another format
+# has not been defined
+echo $ac_n "checking whether to use traditional smbpasswd file""... $ac_c" 1>&6
+echo "configure:12367: checking whether to use traditional smbpasswd file" >&5
+if test $with_smbpasswd_sam = yes; then
+       echo "$ac_t""yes" 1>&6
+       cat >> confdefs.h <<\EOF
+#define WITH_SMBPASSWD_SAM 1
+EOF
+
+else
+       echo "$ac_t""no" 1>&6
+fi
+
+########################################################################################
+##
+## END OF TESTS FOR SAM BACKENDS.  
+##
+########################################################################################
+
 #################################################
 # check for a NISPLUS_HOME support 
 echo $ac_n "checking whether to use NISPLUS_HOME""... $ac_c" 1>&6
-echo "configure:11860: checking whether to use NISPLUS_HOME" >&5
+echo "configure:12387: checking whether to use NISPLUS_HOME" >&5
 # Check whether --with-nisplus-home or --without-nisplus-home was given.
 if test "${with_nisplus_home+set}" = set; then
   withval="$with_nisplus_home"
@@ -11881,7 +12408,7 @@ fi
 #################################################
 # check for the secure socket layer
 echo $ac_n "checking whether to use SSL""... $ac_c" 1>&6
-echo "configure:11885: checking whether to use SSL" >&5
+echo "configure:12412: checking whether to use SSL" >&5
 # Check whether --with-ssl or --without-ssl was given.
 if test "${with_ssl+set}" = set; then
   withval="$with_ssl"
@@ -11901,28 +12428,43 @@ EOF
        yes|no)
          echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
          CFLAGS="-I/usr/local/ssl/include $CFLAGS"
-         LIBS="-lssl -lcrypto $LIBS"
-         LDFLAGS="=L/usr/local/ssl/lib $LDFLAGS"
        ;;
         * )
-          CFLAGS="-I${withval}/include $CFLAGS"
-         LIBS="-lssl -lcrypto $LIBS"
-         LDFLAGS="-L${withval}/lib $LDFLAGS"
+          CFLAGS="-I${withval} $CFLAGS"
        ;;
        esac
 
     else
 
        CFLAGS="-I/usr/local/ssl/include $CFLAGS"   
-       LIBS="-lssl -lcrypto $LIBS"
+
+    fi
+
+    if test "${with_ssllib+set}" = set; then
+
+       withval="$with_ssllib"
+       case "$withval" in
+       yes|no)
+         echo "configure: warning: --with-ssllib called without argument - will use default" 1>&w
+         LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
+       ;;
+        * )
+         LDFLAGS="-L${withval}/lib $LDFLAGS"
+       ;;
+       esac
+
+    else
+
        LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
 
     fi
 
-    if test ! -d ${withval}; then
-      echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
-      exit 1
-    fi 
+    LIBS="-lssl -lcrypto $LIBS"
+
+#    if test ! -d ${withval}; then
+#      echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
+#      exit 1
+#    fi 
 
     CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS"  # Damn, SSLeay defines its own
 
@@ -11940,7 +12482,7 @@ fi
 #################################################
 # check for syslog logging
 echo $ac_n "checking whether to use syslog logging""... $ac_c" 1>&6
-echo "configure:11944: checking whether to use syslog logging" >&5
+echo "configure:12486: checking whether to use syslog logging" >&5
 # Check whether --with-syslog or --without-syslog was given.
 if test "${with_syslog+set}" = set; then
   withval="$with_syslog"
 #################################################
 # check for a shared memory profiling support
 echo $ac_n "checking whether to use profiling""... $ac_c" 1>&6
-echo "configure:11969: checking whether to use profiling" >&5
-# Check whether --with-profile or --without-profile was given.
-if test "${with_profile+set}" = set; then
-  withval="$with_profile"
+echo "configure:12511: checking whether to use profiling" >&5
+# Check whether --with-profiling-data or --without-profiling-data was given.
+if test "${with_profiling_data+set}" = set; then
+  withval="$with_profiling_data"
    case "$withval" in
   yes)
     echo "$ac_t""yes" 1>&6
 
 
 
-#################################################
-# check for experimental netatalk resource fork support
-echo $ac_n "checking whether to support netatalk""... $ac_c" 1>&6
-echo "configure:11995: checking whether to support netatalk" >&5
-# Check whether --with-netatalk or --without-netatalk was given.
-if test "${with_netatalk+set}" = set; then
-  withval="$with_netatalk"
-   case "$withval" in
-  yes)
-    echo "$ac_t""yes" 1>&6
-    cat >> confdefs.h <<\EOF
-#define WITH_NETATALK 1
-EOF
-
-    ;;
-  *)
-    echo "$ac_t""no" 1>&6
-    ;;
-  esac 
-else
-  echo "$ac_t""no" 1>&6
-
-fi
-
-
 #################################################
 # check for experimental disk-quotas support
 QUOTAOBJS=smbd/noquotas.o
 
 echo $ac_n "checking whether to support disk-quotas""... $ac_c" 1>&6
-echo "configure:12022: checking whether to support disk-quotas" >&5
+echo "configure:12539: checking whether to support disk-quotas" >&5
 # Check whether --with-quotas or --without-quotas was given.
 if test "${with_quotas+set}" = set; then
   withval="$with_quotas"
    case "$withval" in
   yes)
     echo "$ac_t""yes" 1>&6
+    case "$host_os" in
+      *linux*)
+        # Check for kernel 2.4.x quota braindamage...
+        echo $ac_n "checking for linux 2.4.x quota braindamage..""... $ac_c" 1>&6
+echo "configure:12550: checking for linux 2.4.x quota braindamage.." >&5
+if eval "test \"`echo '$''{'samba_cv_linux_2_4_quota_braindamage'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        cat > conftest.$ac_ext <<EOF
+#line 12556 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <sys/types.h>
+#include <asm/types.h>
+#include <linux/quota.h>
+#include <mntent.h>
+#include <linux/unistd.h>
+int main() {
+struct mem_dqblk D;
+; return 0; }
+EOF
+if { (eval echo configure:12568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_linux_2_4_quota_braindamage=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_linux_2_4_quota_braindamage=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_linux_2_4_quota_braindamage" 1>&6
+if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
+        cat >> confdefs.h <<\EOF
+#define LINUX_QUOTAS_2 1
+EOF
+
+else
+        cat >> confdefs.h <<\EOF
+#define LINUX_QUOTAS_1 1
+EOF
+
+fi
+        ;;
+      *)
+        ;;
+    esac
     QUOTAOBJS=smbd/quotas.o
+    cat >> confdefs.h <<\EOF
+#define WITH_QUOTAS 1
+EOF
+
     ;;
   *)
     echo "$ac_t""no" 1>&6
@@ -12042,7 +12613,7 @@ fi
 # check for experimental utmp accounting
 
 echo $ac_n "checking whether to support utmp accounting""... $ac_c" 1>&6
-echo "configure:12046: checking whether to support utmp accounting" >&5
+echo "configure:12617: checking whether to support utmp accounting" >&5
 # Check whether --with-utmp or --without-utmp was given.
 if test "${with_utmp+set}" = set; then
   withval="$with_utmp"
@@ -12064,32 +12635,6 @@ else
 fi
 
 
-#################################################
-# check for MS Dfs support
-
-echo $ac_n "checking whether to support Microsoft Dfs""... $ac_c" 1>&6
-echo "configure:12072: checking whether to support Microsoft Dfs" >&5
-# Check whether --with-msdfs or --without-msdfs was given.
-if test "${with_msdfs+set}" = set; then
-  withval="$with_msdfs"
-   case "$withval" in
-  yes)
-     echo "$ac_t""yes" 1>&6
-     cat >> confdefs.h <<\EOF
-#define WITH_MSDFS 1
-EOF
-
-     ;;
-  *)
-    echo "$ac_t""no" 1>&6
-    ;;
-  esac 
-else
-  echo "$ac_t""no" 1>&6
-
-fi
-
-
 #################################################
 # set private directory location
 # Check whether --with-privatedir or --without-privatedir was given.
@@ -12165,17 +12710,45 @@ else
 fi
 
 
+#################################################
+# choose native language(s) of man pages
+echo $ac_n "checking chosen man pages' language(s)""... $ac_c" 1>&6
+echo "configure:12717: checking chosen man pages' language(s)" >&5
+# Check whether --with-manpages-langs or --without-manpages-langs was given.
+if test "${with_manpages_langs+set}" = set; then
+  withval="$with_manpages_langs"
+   case "$withval" in
+  yes|no)
+    echo "configure: warning: --with-manpages-langs called without argument - will use default" 1>&2
+    manlangs="en"
+  ;;
+  *)
+    manlangs="$withval"
+  ;;
+  esac
+
+  echo "$ac_t""$manlangs" 1>&6
+  manlangs=`echo $manlangs | sed "s/,/ /"`   # replacing commas with spaces to produce a list
+  
+else
+  manlangs="en"
+  echo "$ac_t""$manlangs" 1>&6
+  
+
+fi
+
+
 #################################################
 # these tests are taken from the GNU fileutils package
 echo "checking how to get filesystem space usage" 1>&6
-echo "configure:12172: checking how to get filesystem space usage" >&5
+echo "configure:12745: checking how to get filesystem space usage" >&5
 space=no
 
 # Test for statvfs64.
 if test $space = no; then
   # SVR4
   echo $ac_n "checking statvfs64 function (SVR4)""... $ac_c" 1>&6
-echo "configure:12179: checking statvfs64 function (SVR4)" >&5
+echo "configure:12752: checking statvfs64 function (SVR4)" >&5
 if eval "test \"`echo '$''{'fu_cv_sys_stat_statvfs64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12183,7 +12756,7 @@ else
   fu_cv_sys_stat_statvfs64=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 12187 "configure"
+#line 12760 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -12197,7 +12770,7 @@ else
     exit (statvfs64 (".", &fsd));
   }
 EOF
-if { (eval echo configure:12201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_statvfs64=yes
 else
 if test $space = no; then
   # SVR4
   echo $ac_n "checking statvfs function (SVR4)""... $ac_c" 1>&6
-echo "configure:12234: checking statvfs function (SVR4)" >&5
+echo "configure:12807: checking statvfs function (SVR4)" >&5
 if eval "test \"`echo '$''{'fu_cv_sys_stat_statvfs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12239 "configure"
+#line 12812 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/statvfs.h>
@@ -12243,7 +12816,7 @@ int main() {
 struct statvfs fsd; statvfs (0, &fsd);
 ; return 0; }
 EOF
-if { (eval echo configure:12247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   fu_cv_sys_stat_statvfs=yes
 else
@@ -12268,7 +12841,7 @@ fi
 if test $space = no; then
   # DEC Alpha running OSF/1
   echo $ac_n "checking for 3-argument statfs function (DEC OSF/1)""... $ac_c" 1>&6
-echo "configure:12272: checking for 3-argument statfs function (DEC OSF/1)" >&5
+echo "configure:12845: checking for 3-argument statfs function (DEC OSF/1)" >&5
   if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs3_osf1'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12276,7 +12849,7 @@ else
   fu_cv_sys_stat_statfs3_osf1=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 12280 "configure"
+#line 12853 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -12289,7 +12862,7 @@ else
     exit (statfs (".", &fsd, sizeof (struct statfs)));
   }
 EOF
-if { (eval echo configure:12293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_statfs3_osf1=yes
 else
@@ -12316,7 +12889,7 @@ fi
 if test $space = no; then
 # AIX
   echo $ac_n "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)""... $ac_c" 1>&6
-echo "configure:12320: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5
+echo "configure:12893: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5
   if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs2_bsize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12324,7 +12897,7 @@ else
   fu_cv_sys_stat_statfs2_bsize=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 12328 "configure"
+#line 12901 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_PARAM_H
@@ -12343,7 +12916,7 @@ else
   exit (statfs (".", &fsd));
   }
 EOF
-if { (eval echo configure:12347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_statfs2_bsize=yes
 else
@@ -12370,7 +12943,7 @@ fi
 if test $space = no; then
 # SVR3
   echo $ac_n "checking for four-argument statfs (AIX-3.2.5, SVR3)""... $ac_c" 1>&6
-echo "configure:12374: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5
+echo "configure:12947: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5
   if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs4'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12378,7 +12951,7 @@ else
   fu_cv_sys_stat_statfs4=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 12382 "configure"
+#line 12955 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/statfs.h>
@@ -12388,7 +12961,7 @@ else
   exit (statfs (".", &fsd, sizeof fsd, 0));
   }
 EOF
-if { (eval echo configure:12392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_statfs4=yes
 else
@@ -12415,7 +12988,7 @@ fi
 if test $space = no; then
 # 4.4BSD and NetBSD
   echo $ac_n "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)""... $ac_c" 1>&6
-echo "configure:12419: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5
+echo "configure:12992: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5
   if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs2_fsize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12423,7 +12996,7 @@ else
   fu_cv_sys_stat_statfs2_fsize=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 12427 "configure"
+#line 13000 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
@@ -12439,7 +13012,7 @@ else
   exit (statfs (".", &fsd));
   }
 EOF
-if { (eval echo configure:12443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_statfs2_fsize=yes
 else
@@ -12466,7 +13039,7 @@ fi
 if test $space = no; then
   # Ultrix
   echo $ac_n "checking for two-argument statfs with struct fs_data (Ultrix)""... $ac_c" 1>&6
-echo "configure:12470: checking for two-argument statfs with struct fs_data (Ultrix)" >&5
+echo "configure:13043: checking for two-argument statfs with struct fs_data (Ultrix)" >&5
   if eval "test \"`echo '$''{'fu_cv_sys_stat_fs_data'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12474,7 +13047,7 @@ else
   fu_cv_sys_stat_fs_data=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 12478 "configure"
+#line 13051 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
@@ -12494,7 +13067,7 @@ else
   exit (statfs (".", &fsd) != 1);
   }
 EOF
-if { (eval echo configure:12498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_fs_data=yes
 else
@@ -12527,9 +13100,9 @@ fi
 # file support.
 #
 echo $ac_n "checking if large file support can be enabled""... $ac_c" 1>&6
-echo "configure:12531: checking if large file support can be enabled" >&5
+echo "configure:13104: checking if large file support can be enabled" >&5
 cat > conftest.$ac_ext <<EOF
-#line 12533 "configure"
+#line 13106 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
@@ -12542,7 +13115,7 @@ int main() {
 int i
 ; return 0; }
 EOF
-if { (eval echo configure:12546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes
 else
 # check for ACL support
 
 echo $ac_n "checking whether to support ACLs""... $ac_c" 1>&6
-echo "configure:12611: checking whether to support ACLs" >&5
+echo "configure:13184: checking whether to support ACLs" >&5
 # Check whether --with-acl-support or --without-acl-support was given.
 if test "${with_acl_support+set}" = set; then
   withval="$with_acl_support"
    case "$withval" in
   yes)
 
-        case "$host_os" in
-        *sysv5*)
-            echo "$ac_t""Using UnixWare ACLs" 1>&6
-            cat >> confdefs.h <<\EOF
+       case "$host_os" in
+       *sysv5*)
+               echo "$ac_t""Using UnixWare ACLs" 1>&6
+               cat >> confdefs.h <<\EOF
 #define HAVE_UNIXWARE_ACLS 1
 EOF
 
-            ;;
-        *solaris*)
-            echo "$ac_t""Using solaris ACLs" 1>&6
-            cat >> confdefs.h <<\EOF
+               ;;
+       *solaris*)
+               echo "$ac_t""Using solaris ACLs" 1>&6
+               cat >> confdefs.h <<\EOF
 #define HAVE_SOLARIS_ACLS 1
 EOF
 
-            ;;
-               *irix*)
-                       echo "$ac_t""Using IRIX ACLs" 1>&6
-                       cat >> confdefs.h <<\EOF
+               ;;
+       *hpux*)
+               echo "$ac_t""Using HPUX ACLs" 1>&6
+               cat >> confdefs.h <<\EOF
+#define HAVE_HPUX_ACLS 1
+EOF
+
+               ;;
+       *irix*)
+               echo "$ac_t""Using IRIX ACLs" 1>&6
+               cat >> confdefs.h <<\EOF
 #define HAVE_IRIX_ACLS 1
 EOF
 
-                       ;;
-               *aix*)
-                       echo "$ac_t""Using AIX ACLs" 1>&6
-                       cat >> confdefs.h <<\EOF
+               ;;
+       *aix*)
+               echo "$ac_t""Using AIX ACLs" 1>&6
+               cat >> confdefs.h <<\EOF
 #define HAVE_AIX_ACLS 1
 EOF
 
-                       ;;
+               ;;
+       *osf*)
+               echo "$ac_t""Using Tru64 ACLs" 1>&6
+               cat >> confdefs.h <<\EOF
+#define HAVE_TRU64_ACLS 1
+EOF
+
+               LIBS="$LIBS -lpacl"
+               ;;
         *)
-                       echo $ac_n "checking for acl_get_file in -lacl""... $ac_c" 1>&6
-echo "configure:12649: checking for acl_get_file in -lacl" >&5
+               echo $ac_n "checking for acl_get_file in -lacl""... $ac_c" 1>&6
+echo "configure:13237: checking for acl_get_file in -lacl" >&5
 ac_lib_var=`echo acl'_'acl_get_file | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12653,7 +13241,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lacl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12657 "configure"
+#line 13245 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12664,7 +13252,7 @@ int main() {
 acl_get_file()
 ; return 0; }
 EOF
-if { (eval echo configure:12668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12691,14 +13279,14 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-                       echo $ac_n "checking for ACL support""... $ac_c" 1>&6
-echo "configure:12696: checking for ACL support" >&5
+               echo $ac_n "checking for ACL support""... $ac_c" 1>&6
+echo "configure:13284: checking for ACL support" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_POSIX_ACLS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-                       cat > conftest.$ac_ext <<EOF
-#line 12702 "configure"
+               cat > conftest.$ac_ext <<EOF
+#line 13290 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/acl.h>
@@ -12706,7 +13294,7 @@ int main() {
  acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);
 ; return 0; }
 EOF
-if { (eval echo configure:12710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   samba_cv_HAVE_POSIX_ACLS=yes
 else
@@ -12726,13 +13314,13 @@ echo "$ac_t""$samba_cv_HAVE_POSIX_ACLS" 1>&6
 EOF
 
                                echo $ac_n "checking for acl_get_perm_np""... $ac_c" 1>&6
-echo "configure:12730: checking for acl_get_perm_np" >&5
+echo "configure:13318: checking for acl_get_perm_np" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_ACL_GET_PERM_NP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                                cat > conftest.$ac_ext <<EOF
-#line 12736 "configure"
+#line 13324 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/acl.h>
@@ -12740,7 +13328,7 @@ int main() {
  acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);
 ; return 0; }
 EOF
-if { (eval echo configure:12744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   samba_cv_HAVE_ACL_GET_PERM_NP=yes
 else
 
 
 #################################################
-# check whether winbind is supported on this platform
+# Check whether winbind is supported on this platform.  If so we need to
+# build and install client programs (WINBIND_TARGETS), sbin programs
+# (WINBIND_STARGETS) and shared libraries (WINBIND_LTARGETS).
 
-echo $ac_n "checking whether to compile winbind""... $ac_c" 1>&6
-echo "configure:12789: checking whether to compile winbind" >&5
+echo $ac_n "checking whether to build winbind""... $ac_c" 1>&6
+echo "configure:13379: checking whether to build winbind" >&5
+
+# Initially, the value of $host_os decides whether winbind is supported
 
 case "$host_os" in 
-        *linux*|*solaris*)
-                WINBIND_TARGETS="$WINBIND_TARGETS \$(WINBIND_PROGS)"
-               case "$with_pam" in
-                       yes)
-                               WINBIND_TARGETS="$WINBIND_TARGETS \$(WINBIND_PAM_PROGS)"
-                       ;;
-                       *)
-               esac
+        *linux*|*solaris*|*irix*)
+               HAVE_WINBIND=yes
                 ;;
         *)
+               HAVE_WINBIND=no
                 winbind_no_reason=", unsupported on $host_os"
                 ;;
 esac
 
+# Check the setting of --with-winbindd
+
 # Check whether --with-winbind or --without-winbind was given.
 if test "${with_winbind+set}" = set; then
   withval="$with_winbind"
    
   case "$withval" in
+       yes)
+               HAVE_WINBIND=yes
+               ;;
         no)
-                WINBIND_TARGETS=""
+               HAVE_WINBIND=no
                 winbind_reason=""
                 ;;
   esac 
 fi
 
 
-if test x"$WINBIND_TARGETS" = x; then
+# We need unix domain sockets for winbind
+
+if test x"$HAVE_WINBIND" = x"yes"; then
+       if test x"$samba_cv_unixsocket" = x"no"; then
+               winbind_no_reason=", no unix domain socket support on $host_os"
+               HAVE_WINBIND=no
+       fi
+fi
+
+# Display test results
+
+
+WINBIND_TARGETS=""
+WINBIND_STARGETS=""
+WINBIND_LTARGETS=""
+WINBIND_PAM_PROGS=""
+
+if test x"$HAVE_WINBIND" = x"yes"; then
+        echo "$ac_t""yes" 1>&6
+
+       WINBIND_TARGETS="bin/wbinfo"
+       WINBIND_STARGETS="bin/winbindd"
+        if test x"$BLDSHARED" = x"true"; then
+               WINBIND_LTARGETS="nsswitch/libnss_winbind.so"
+               if test x"$with_pam" = x"yes"; then
+                       WINBIND_PAM_TARGETS="nsswitch/pam_winbind.so"
+               fi
+       fi
+else
         echo "$ac_t""no$winbind_no_reason" 1>&6
+fi
+
+# Substitution time!
+
+
+
+
+
+
+#################################################
+# Check to see if we should use the included popt 
+
+# Check whether --with-included-popt or --without-included-popt was given.
+if test "${with_included_popt+set}" = set; then
+  withval="$with_included_popt"
+   
+  case "$withval" in
+       yes)
+               INCLUDED_POPT=yes
+               ;;
+        no)
+               INCLUDED_POPT=no
+                ;;
+  esac 
+fi
+
+if test x"$INCLUDED_POPT" != x"yes"; then
+    echo $ac_n "checking for poptGetContext in -lpopt""... $ac_c" 1>&6
+echo "configure:13469: checking for poptGetContext in -lpopt" >&5
+ac_lib_var=`echo popt'_'poptGetContext | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-        echo "$ac_t""yes" 1>&6
+  ac_save_LIBS="$LIBS"
+LIBS="-lpopt  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 13477 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char poptGetContext();
+
+int main() {
+poptGetContext()
+; return 0; }
+EOF
+if { (eval echo configure:13488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  INCLUDED_POPT=no
+else
+  echo "$ac_t""no" 1>&6
+INCLUDED_POPT=yes
+fi
+
+fi
+
+echo $ac_n "checking whether to use included popt""... $ac_c" 1>&6
+echo "configure:13512: checking whether to use included popt" >&5
+if test x"$INCLUDED_POPT" = x"yes"; then
+    echo "$ac_t""$srcdir/popt" 1>&6
+    BUILD_POPT='$(POPT_OBJS)'
+    FLAGS1="-I$srcdir/popt"
+else
+    echo "$ac_t""no" 1>&6
+    LIBS="$LIBS -lpopt"
 fi
 
 
@@ -12831,11 +13528,11 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 12835 "configure"
+#line 13532 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/summary.c"
 EOF
-if { (eval echo configure:12839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   echo "configure OK";
 else
@@ -12987,38 +13684,37 @@ s%@mandir@%$mandir%g
 s%@RUNPROG@%$RUNPROG%g
 s%@MPROGS@%$MPROGS%g
 s%@LDSHFLAGS@%$LDSHFLAGS%g
+s%@SHLD@%$SHLD%g
 s%@HOST_OS@%$HOST_OS%g
 s%@PAM_MOD@%$PAM_MOD%g
 s%@WRAP@%$WRAP%g
 s%@WRAP32@%$WRAP32%g
 s%@PICFLAG@%$PICFLAG%g
+s%@PICSUFFIX@%$PICSUFFIX%g
+s%@POBAD_CC@%$POBAD_CC%g
 s%@SHLIBEXT@%$SHLIBEXT%g
-s%@BLDSHARED@%$BLDSHARED%g
+s%@LIBSMBCLIENT_SHARED@%$LIBSMBCLIENT_SHARED%g
 s%@CC@%$CC%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@AWK@%$AWK%g
+s%@BROKEN_CC@%$BROKEN_CC%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
 s%@host_cpu@%$host_cpu%g
 s%@host_vendor@%$host_vendor%g
 s%@host_os@%$host_os%g
-s%@build@%$build%g
-s%@build_alias@%$build_alias%g
-s%@build_cpu@%$build_cpu%g
-s%@build_vendor@%$build_vendor%g
-s%@build_os@%$build_os%g
-s%@RANLIB@%$RANLIB%g
-s%@LN_S@%$LN_S%g
-s%@LIBTOOL@%$LIBTOOL%g
-s%@LIBTOOL_DEPS@%$LIBTOOL_DEPS%g
-s%@BROKEN_CC@%$BROKEN_CC%g
 s%@target@%$target%g
 s%@target_alias@%$target_alias%g
 s%@target_cpu@%$target_cpu%g
 s%@target_vendor@%$target_vendor%g
 s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
 s%@CPP@%$CPP%g
 s%@LIBOBJS@%$LIBOBJS%g
 s%@TERMLIBS@%$TERMLIBS%g
@@ -13028,7 +13724,13 @@ s%@QUOTAOBJS@%$QUOTAOBJS%g
 s%@privatedir@%$privatedir%g
 s%@lockdir@%$lockdir%g
 s%@swatdir@%$swatdir%g
+s%@manlangs@%$manlangs%g
 s%@WINBIND_TARGETS@%$WINBIND_TARGETS%g
+s%@WINBIND_STARGETS@%$WINBIND_STARGETS%g
+s%@WINBIND_LTARGETS@%$WINBIND_LTARGETS%g
+s%@WINBIND_PAM_TARGETS@%$WINBIND_PAM_TARGETS%g
+s%@BUILD_POPT@%$BUILD_POPT%g
+s%@FLAGS1@%$FLAGS1%g
 s%@builddir@%$builddir%g
 
 CEOF
@@ -13249,3 +13951,11 @@ chmod +x $CONFIG_STATUS
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
+
+#################################################
+# Print very concise instructions on building/use
+if test "x$enable_dmalloc" = xyes
+then
+       echo "$ac_t""Note: The dmalloc debug library will be included.  To turn it on use" 1>&6
+       echo "$ac_t""      \$ eval \`dmalloc samba\`." 1>&6
+fi