diff -uNr samba-2.0.6/source/client/client.c samba-2.0.6.netbeui/source/client/client.c
--- samba-2.0.6/source/client/client.c	Thu Nov 11 00:35:59 1999
+++ samba-2.0.6.netbeui/source/client/client.c	Tue Jul 17 15:44:18 2001
@@ -27,6 +27,9 @@
 #define REGISTER 0
 #endif
 
+extern BOOL receive_netbeui_smb(int fd,char *buffer,unsigned int timeout);
+extern BOOL send_netbeui_smb(int fd,char *buffer);
+
 struct cli_state *cli;
 extern BOOL in_client;
 static int port = SMB_PORT;
@@ -44,6 +47,12 @@
 extern struct in_addr ipzero;
 extern pstring scope;
 
+extern int Client_protocol;
+#ifdef WITH_NETBEUI
+extern char NetBEUI_name[];
+#endif /* WITH_NETBEUI */
+ 
+
 static int name_type = 0x20;
 
 extern pstring user_socket_options;
@@ -1735,7 +1744,9 @@
   
 	while (1) {
 		FD_ZERO(&fds);
+#ifndef WITH_NETBEUI
 		FD_SET(cli->fd,&fds);
+#endif /* WITH_NETBEUI */
 		FD_SET(fileno(stdin),&fds);
 
 		timeout.tv_sec = 20;
@@ -1749,8 +1760,10 @@
 		   client_receive_smb as we want to receive
 		   session keepalives and then drop them here.
 		*/
+#ifndef WITH_NETBEUI
 		if (FD_ISSET(cli->fd,&fds))
 			receive_smb(cli->fd,cli->inbuf,0);
+#endif /* WITH_NETBEUI */
       
 		cli_chkpath(cli, "\\");
 	}  
@@ -2027,6 +2040,9 @@
   DEBUG(0,("\t-D directory          start from directory\n"));
   DEBUG(0,("\t-c command string     execute semicolon separated commands\n"));
   DEBUG(0,("\t-b xmit/send buffer   changes the transmit/send buffer (default: 65520)\n"));
+#ifdef WITH_NETBEUI
+  DEBUG(0,("\t-Z transport protocol TCPIP or NETBEUI    \n"));
+#endif /* WITH_NETBEUI */
   DEBUG(0,("\n"));
 }
 
@@ -2312,7 +2328,7 @@
 	}
 
 	while ((opt = 
-		getopt(argc, argv,"s:O:R:M:i:Nn:d:Pp:l:hI:EU:L:t:m:W:T:D:c:b:")) != EOF) {
+		getopt(argc, argv,"s:O:R:M:i:Nn:d:Pp:l:hI:EU:L:t:m:W:T:D:c:b:Z:")) != EOF) {
 		switch (opt) {
 		case 's':
 			pstrcpy(servicesf, optarg);
@@ -2414,6 +2430,19 @@
 		case 'b':
 			io_bufsize = MAX(1, atoi(optarg));
 			break;
+#ifdef WITH_NETBEUI
+		case 'Z':
+			if (!optarg)  break;
+			strupper(optarg);
+			if (strcmp(optarg, "NETBEUI") == 0) {
+				Client_protocol = NETBEUI;
+				receive_smb_func = receive_netbeui_smb;
+				send_smb_func = send_netbeui_smb;
+				tag_chained_commands();
+			}
+			break;
+#endif /* WITH_NETBEUI */
+
 		default:
 			usage(pname);
 			exit(1);
diff -uNr samba-2.0.6/source/configure samba-2.0.6.netbeui/source/configure
--- samba-2.0.6/source/configure	Wed Oct 13 03:26:42 1999
+++ samba-2.0.6.netbeui/source/configure	Tue Jul 17 20:11:59 2001
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -61,6 +61,9 @@
   --with-netatalk     Include experimental Netatalk support
   --without-netatalk  Don't include experimental Netatalk support (default)"
 ac_help="$ac_help
+  --with-netbeui     Include experimental netbeui support
+  --without-netbeui  Don't include experimental netbeui support (default)"
+ac_help="$ac_help
   --with-quotas     Include experimental disk-quota support
   --without-quotas  Don't include experimental disk-quota support (default)"
 ac_help="$ac_help
@@ -107,6 +110,7 @@
 # Initialize some other variables.
 subdirs=
 MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
 # Maximum number of lines to put in a shell here document.
 ac_max_here_lines=12
 
@@ -390,7 +394,7 @@
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -560,9 +564,11 @@
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -596,15 +602,16 @@
 # 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:600: checking for $ac_word" >&5
+echo "configure:606: 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
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  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_CC="gcc"
@@ -625,16 +632,17 @@
   # 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:629: checking for $ac_word" >&5
+echo "configure:636: 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
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -669,25 +677,61 @@
   echo "$ac_t""no" 1>&6
 fi
 
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # 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:687: 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
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # 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_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:677: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:719: 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.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 687 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 730 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:735: \"$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
@@ -701,18 +745,24 @@
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 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:711: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:761: 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:716: checking whether we are using GNU C" >&5
+echo "configure:766: 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
@@ -721,7 +771,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:725: \"$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:775: \"$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
@@ -732,11 +782,15 @@
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  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:740: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+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:794: 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
@@ -751,16 +805,20 @@
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
 
 ac_aux_dir=
@@ -789,28 +847,30 @@
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # 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:797: checking for a BSD compatible install" >&5
+echo "configure:856: 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
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
-      for ac_prog in ginstall installbsd scoinst install; do
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
         if test -f $ac_dir/$ac_prog; then
 	  if test $ac_prog = install &&
             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
-	    # OSF/1 installbsd also uses dspmsg, but is usable.
 	    :
 	  else
 	    ac_cv_path_install="$ac_dir/$ac_prog -c"
@@ -840,22 +900,25 @@
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+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:851: checking for $ac_word" >&5
+echo "configure:913: 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
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  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_AWK="$ac_prog"
@@ -878,10 +941,10 @@
 
 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:882: checking whether $CC and cc understand -c and -o together" >&5
+echo "configure:945: 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:885: checking whether cc understands -c and -o together" >&5
+echo "configure:948: 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]/_/'`"
@@ -893,16 +956,16 @@
 # 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:897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
-   test -f conftest.o && { (eval echo configure:898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+if { (eval echo configure:960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+   test -f conftest.o && { (eval echo configure:961: \"$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:903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+    if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:966: \"$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:905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
-	 test -f conftest.o && { (eval echo configure:906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+      if { (eval echo configure:968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+	 test -f conftest.o && { (eval echo configure:969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
       then
         # cc works too.
         :
@@ -936,20 +999,20 @@
 
 
 echo $ac_n "checking that the C compiler understands volatile""... $ac_c" 1>&6
-echo "configure:940: checking that the C compiler understands volatile" >&5
+echo "configure:1003: 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 946 "configure"
+#line 1009 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 volatile int i = 0
 ; return 0; }
 EOF
-if { (eval echo configure:953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_volatile=yes
 else
@@ -994,33 +1057,33 @@
 
 
 # Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
+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:1003: checking host system type" >&5
+echo "configure:1066: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
 NONE)
   case $nonopt in
   NONE)
-    if host_alias=`$ac_config_guess`; then :
+    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=`$ac_config_sub $host_alias`
+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:1024: checking target system type" >&5
+echo "configure:1087: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -1031,14 +1094,14 @@
   esac ;;
 esac
 
-target=`$ac_config_sub $target_alias`
+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:1042: checking build system type" >&5
+echo "configure:1105: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -1049,7 +1112,7 @@
   esac ;;
 esac
 
-build=`$ac_config_sub $build_alias`
+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/'`
@@ -1063,7 +1126,7 @@
 
     
     echo $ac_n "checking config.cache system type""... $ac_c" 1>&6
-echo "configure:1067: checking config.cache system type" >&5
+echo "configure:1130: 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" &&
@@ -1093,7 +1156,7 @@
   # Extract the first word of "autoconf", so it can be a program name with args.
 set dummy autoconf; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1097: checking for $ac_word" >&5
+echo "configure:1160: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AUTOCONF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1101,9 +1164,13 @@
   /*)
   ac_cv_path_AUTOCONF="$AUTOCONF" # Let the user override the test with a path.
   ;;
+  ?:/*)			 
+  ac_cv_path_AUTOCONF="$AUTOCONF" # Let the user override the test with a dos path.
+  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  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_path_AUTOCONF="$ac_dir/$ac_word"
@@ -1126,7 +1193,7 @@
   # Extract the first word of "autoheader", so it can be a program name with args.
 set dummy autoheader; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1130: checking for $ac_word" >&5
+echo "configure:1197: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AUTOHEADER'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1134,9 +1201,13 @@
   /*)
   ac_cv_path_AUTOHEADER="$AUTOHEADER" # Let the user override the test with a path.
   ;;
+  ?:/*)			 
+  ac_cv_path_AUTOHEADER="$AUTOHEADER" # Let the user override the test with a dos path.
+  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  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_path_AUTOHEADER="$ac_dir/$ac_word"
@@ -1166,7 +1237,7 @@
 # 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:1170: checking whether ${CC-cc} accepts -Ae" >&5
+echo "configure:1241: 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
@@ -1250,14 +1321,14 @@
     *sysv4*)
       if test $host = mips-sni-sysv4 ; then
         echo $ac_n "checking for LFS support""... $ac_c" 1>&6
-echo "configure:1254: checking for LFS support" >&5
+echo "configure:1325: 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 1261 "configure"
+#line 1332 "configure"
 #include "confdefs.h"
 
 #include <unistd.h>
@@ -1269,7 +1340,7 @@
 #endif
 }
 EOF
-if { (eval echo configure:1273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1344: \"$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
@@ -1300,14 +1371,14 @@
 		;;
     *hurd*)
         echo $ac_n "checking for LFS support""... $ac_c" 1>&6
-echo "configure:1304: checking for LFS support" >&5
+echo "configure:1375: 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 1311 "configure"
+#line 1382 "configure"
 #include "confdefs.h"
 
 #include <unistd.h>
@@ -1319,7 +1390,7 @@
 #endif
 }
 EOF
-if { (eval echo configure:1323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1394: \"$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
@@ -1341,21 +1412,21 @@
 esac
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1345: checking for inline" >&5
+echo "configure:1416: 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 1352 "configure"
+#line 1423 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:1359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -1381,7 +1452,7 @@
 esac
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1385: checking how to run the C preprocessor" >&5
+echo "configure:1456: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1396,14 +1467,14 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1400 "configure"
+#line 1471 "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:1406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1477: \"$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
   :
 else
@@ -1413,14 +1484,31 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1417 "configure"
+#line 1488 "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:1494: \"$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
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 1505 "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:1423: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1511: \"$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
   :
 else
@@ -1433,6 +1521,8 @@
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1442,12 +1532,12 @@
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1446: checking for ANSI C header files" >&5
+echo "configure:1536: 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 1451 "configure"
+#line 1541 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1455,8 +1545,8 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1549: \"$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*
   ac_cv_header_stdc=yes
@@ -1472,7 +1562,7 @@
 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 1476 "configure"
+#line 1566 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1490,7 +1580,7 @@
 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 1494 "configure"
+#line 1584 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1511,7 +1601,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1515 "configure"
+#line 1605 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1522,7 +1612,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:1526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1550,12 +1640,12 @@
 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:1554: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1644: 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 1559 "configure"
+#line 1649 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -1563,7 +1653,7 @@
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:1567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1657: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -1588,7 +1678,7 @@
 # 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:1592: checking for opendir in -ldir" >&5
+echo "configure:1682: 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
@@ -1596,7 +1686,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1600 "configure"
+#line 1690 "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
@@ -1607,7 +1697,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1701: \"$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
@@ -1629,7 +1719,7 @@
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1633: checking for opendir in -lx" >&5
+echo "configure:1723: 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
@@ -1637,7 +1727,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1641 "configure"
+#line 1731 "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
@@ -1648,7 +1738,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:1652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1742: \"$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
@@ -1671,12 +1761,12 @@
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1675: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1765: 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 1680 "configure"
+#line 1770 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1685,7 +1775,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -1706,12 +1796,12 @@
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1710: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1800: 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 1715 "configure"
+#line 1805 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -1727,7 +1817,7 @@
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:1731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -1751,18 +1841,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1755: checking for $ac_hdr" >&5
+echo "configure:1845: 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 1760 "configure"
+#line 1850 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1855: \"$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"
@@ -1791,18 +1881,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1795: checking for $ac_hdr" >&5
+echo "configure:1885: 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 1800 "configure"
+#line 1890 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1895: \"$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"
@@ -1831,18 +1921,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1835: checking for $ac_hdr" >&5
+echo "configure:1925: 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 1840 "configure"
+#line 1930 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1935: \"$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"
@@ -1871,18 +1961,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1875: checking for $ac_hdr" >&5
+echo "configure:1965: 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 1880 "configure"
+#line 1970 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1885: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1975: \"$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"
@@ -1911,18 +2001,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1915: checking for $ac_hdr" >&5
+echo "configure:2005: 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 1920 "configure"
+#line 2010 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2015: \"$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"
@@ -1951,18 +2041,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1955: checking for $ac_hdr" >&5
+echo "configure:2045: 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 1960 "configure"
+#line 2050 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2055: \"$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"
@@ -1991,18 +2081,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1995: checking for $ac_hdr" >&5
+echo "configure:2085: 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 2000 "configure"
+#line 2090 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2095: \"$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"
@@ -2034,14 +2124,14 @@
 case "$host_os" in
     *hpux*)
 		cat > conftest.$ac_ext <<EOF
-#line 2038 "configure"
+#line 2128 "configure"
 #include "confdefs.h"
 #include <shadow.h>
 int main() {
 struct spwd testme
 ; return 0; }
 EOF
-if { (eval echo configure:2045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_shadow_h=yes
 else
@@ -2063,18 +2153,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2067: checking for $ac_hdr" >&5
+echo "configure:2157: 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 2072 "configure"
+#line 2162 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2167: \"$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"
@@ -2103,18 +2193,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2107: checking for $ac_hdr" >&5
+echo "configure:2197: 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 2112 "configure"
+#line 2202 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2207: \"$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"
@@ -2143,18 +2233,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2147: checking for $ac_hdr" >&5
+echo "configure:2237: 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 2152 "configure"
+#line 2242 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2247: \"$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"
@@ -2183,18 +2273,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2187: checking for $ac_hdr" >&5
+echo "configure:2277: 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 2192 "configure"
+#line 2282 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2287: \"$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"
@@ -2223,18 +2313,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2227: checking for $ac_hdr" >&5
+echo "configure:2317: 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 2232 "configure"
+#line 2322 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2327: \"$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"
@@ -2261,7 +2351,7 @@
 
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:2265: checking size of int" >&5
+echo "configure:2355: 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
@@ -2269,7 +2359,7 @@
   ac_cv_sizeof_int=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 2273 "configure"
+#line 2363 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -2280,7 +2370,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2374: \"$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
@@ -2300,7 +2390,7 @@
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:2304: checking size of long" >&5
+echo "configure:2394: 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
@@ -2308,7 +2398,7 @@
   ac_cv_sizeof_long=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 2312 "configure"
+#line 2402 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -2319,7 +2409,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:2323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2413: \"$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
@@ -2339,7 +2429,7 @@
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:2343: checking size of short" >&5
+echo "configure:2433: 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
@@ -2347,7 +2437,7 @@
   ac_cv_sizeof_short=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 2351 "configure"
+#line 2441 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -2358,7 +2448,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:2362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2452: \"$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
@@ -2379,12 +2469,12 @@
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2383: checking for working const" >&5
+echo "configure:2473: 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 2388 "configure"
+#line 2478 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2433,7 +2523,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2454,21 +2544,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2458: checking for inline" >&5
+echo "configure:2548: 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 2465 "configure"
+#line 2555 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2494,14 +2584,14 @@
 esac
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:2498: checking whether byte ordering is bigendian" >&5
+echo "configure:2588: 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 2505 "configure"
+#line 2595 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -2512,11 +2602,11 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:2516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2606: \"$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 2520 "configure"
+#line 2610 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -2527,7 +2617,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:2531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2621: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -2547,7 +2637,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 2551 "configure"
+#line 2641 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -2560,7 +2650,7 @@
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:2564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2654: \"$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
@@ -2584,14 +2674,14 @@
 fi
 
 echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:2588: checking whether char is unsigned" >&5
+echo "configure:2678: 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 2595 "configure"
+#line 2685 "configure"
 #include "confdefs.h"
 #ifdef __CHAR_UNSIGNED__
   yes
@@ -2613,7 +2703,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 2617 "configure"
+#line 2707 "configure"
 #include "confdefs.h"
 /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
 #if !defined(__STDC__) || __STDC__ != 1
@@ -2623,7 +2713,7 @@
   volatile char c = 255; exit(c < 0);
 }
 EOF
-if { (eval echo configure:2627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2717: \"$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
@@ -2648,12 +2738,12 @@
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2652: checking return type of signal handlers" >&5
+echo "configure:2742: 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 2657 "configure"
+#line 2747 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2670,7 +2760,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:2674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -2689,12 +2779,12 @@
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2693: checking for uid_t in sys/types.h" >&5
+echo "configure:2783: 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 2698 "configure"
+#line 2788 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -2723,12 +2813,12 @@
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:2727: checking for mode_t" >&5
+echo "configure:2817: 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 2732 "configure"
+#line 2822 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2737,7 +2827,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_mode_t=yes
 else
@@ -2756,12 +2846,12 @@
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2760: checking for off_t" >&5
+echo "configure:2850: 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 2765 "configure"
+#line 2855 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2770,7 +2860,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_off_t=yes
 else
@@ -2789,12 +2879,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2793: checking for size_t" >&5
+echo "configure:2883: 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 2798 "configure"
+#line 2888 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2803,7 +2893,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_size_t=yes
 else
@@ -2822,12 +2912,12 @@
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2826: checking for pid_t" >&5
+echo "configure:2916: 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 2831 "configure"
+#line 2921 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2836,7 +2926,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_pid_t=yes
 else
@@ -2855,12 +2945,12 @@
 fi
 
 echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:2859: checking for st_rdev in struct stat" >&5
+echo "configure:2949: 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 2864 "configure"
+#line 2954 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -2868,7 +2958,7 @@
 struct stat s; s.st_rdev;
 ; return 0; }
 EOF
-if { (eval echo configure:2872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_rdev=yes
 else
@@ -2889,12 +2979,12 @@
 fi
 
 echo $ac_n "checking for d_off in dirent""... $ac_c" 1>&6
-echo "configure:2893: checking for d_off in dirent" >&5
+echo "configure:2983: 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 2898 "configure"
+#line 2988 "configure"
 #include "confdefs.h"
 
 #include <unistd.h>
@@ -2904,7 +2994,7 @@
 struct dirent d; d.d_off;
 ; return 0; }
 EOF
-if { (eval echo configure:2908: \"$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_dirent_d_off=yes
 else
@@ -2925,12 +3015,12 @@
 fi
 
 echo $ac_n "checking for ino_t""... $ac_c" 1>&6
-echo "configure:2929: checking for ino_t" >&5
+echo "configure:3019: 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 2934 "configure"
+#line 3024 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2939,7 +3029,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "ino_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])ino_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_ino_t=yes
 else
@@ -2958,12 +3048,12 @@
 fi
 
 echo $ac_n "checking for loff_t""... $ac_c" 1>&6
-echo "configure:2962: checking for loff_t" >&5
+echo "configure:3052: 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 2967 "configure"
+#line 3057 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2972,7 +3062,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "loff_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])loff_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_loff_t=yes
 else
@@ -2991,12 +3081,12 @@
 fi
 
 echo $ac_n "checking for offset_t""... $ac_c" 1>&6
-echo "configure:2995: checking for offset_t" >&5
+echo "configure:3085: 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 3000 "configure"
+#line 3090 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3005,7 +3095,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "offset_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])offset_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_offset_t=yes
 else
@@ -3024,12 +3114,12 @@
 fi
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:3028: checking for ssize_t" >&5
+echo "configure:3118: 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 3033 "configure"
+#line 3123 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3038,7 +3128,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_ssize_t=yes
 else
@@ -3057,9 +3147,58 @@
 fi
 
 
+# we need libcups for CUPS support...
+echo $ac_n "checking for httpConnect in -lcups""... $ac_c" 1>&6
+echo "configure:3153: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lcups  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3161 "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 httpConnect();
+
+int main() {
+httpConnect()
+; return 0; }
+EOF
+if { (eval echo configure:3172: \"$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 cups | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lcups $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
 # we need libdl for PAM and the new VFS code
 echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6
-echo "configure:3063: checking for main in -ldl" >&5
+echo "configure:3202: checking for main in -ldl" >&5
 ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3067,14 +3206,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3071 "configure"
+#line 3210 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3217: \"$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
@@ -3103,13 +3242,13 @@
 
 
 echo $ac_n "checking for sig_atomic_t type""... $ac_c" 1>&6
-echo "configure:3107: checking for sig_atomic_t type" >&5
+echo "configure:3246: 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 3113 "configure"
+#line 3252 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -3122,7 +3261,7 @@
 sig_atomic_t i = 0
 ; return 0; }
 EOF
-if { (eval echo configure:3126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_sig_atomic_t=yes
 else
@@ -3143,20 +3282,20 @@
 fi
 
 echo $ac_n "checking for errno in errno.h""... $ac_c" 1>&6
-echo "configure:3147: checking for errno in errno.h" >&5
+echo "configure:3286: checking for errno in errno.h" >&5
 if eval "test \"`echo '$''{'samba_cv_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 3153 "configure"
+#line 3292 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 int i = errno
 ; return 0; }
 EOF
-if { (eval echo configure:3160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_errno=yes
 else
@@ -3178,20 +3317,20 @@
 
 # stupid glibc has the functions but no declaration. grrrr.
 echo $ac_n "checking for setresuid declaration""... $ac_c" 1>&6
-echo "configure:3182: checking for setresuid declaration" >&5
+echo "configure:3321: checking for setresuid declaration" >&5
 if eval "test \"`echo '$''{'samba_cv_have_setresuid_decl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 3188 "configure"
+#line 3327 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 int main() {
 int i = (int)setresuid
 ; return 0; }
 EOF
-if { (eval echo configure:3195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_have_setresuid_decl=yes
 else
@@ -3213,20 +3352,20 @@
 
 # stupid glibc has the functions but no declaration. grrrr.
 echo $ac_n "checking for setresgid declaration""... $ac_c" 1>&6
-echo "configure:3217: checking for setresgid declaration" >&5
+echo "configure:3356: checking for setresgid declaration" >&5
 if eval "test \"`echo '$''{'samba_cv_have_setresgid_decl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 3223 "configure"
+#line 3362 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 int main() {
 int i = (int)setresgid
 ; return 0; }
 EOF
-if { (eval echo configure:3230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_have_setresgid_decl=yes
 else
@@ -3249,7 +3388,7 @@
 # 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:3253: checking for real setresuid" >&5
+echo "configure:3392: 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
@@ -3258,12 +3397,12 @@
   samba_cv_have_setresuid=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 3262 "configure"
+#line 3401 "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:3267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3406: \"$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
@@ -3288,7 +3427,7 @@
 # Do the same check for setresguid...
 #
 echo $ac_n "checking for real setresgid""... $ac_c" 1>&6
-echo "configure:3292: checking for real setresgid" >&5
+echo "configure:3431: 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
@@ -3297,13 +3436,13 @@
   samba_cv_have_setresgid=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 3301 "configure"
+#line 3440 "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:3307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3446: \"$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
@@ -3326,7 +3465,7 @@
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:3330: checking for 8-bit clean memcmp" >&5
+echo "configure:3469: 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
@@ -3334,7 +3473,7 @@
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3338 "configure"
+#line 3477 "configure"
 #include "confdefs.h"
 
 main()
@@ -3344,7 +3483,7 @@
 }
 
 EOF
-if { (eval echo configure:3348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3487: \"$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
@@ -3359,7 +3498,7 @@
 fi
 
 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
-test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
 
 ###############################################
@@ -3367,12 +3506,12 @@
 for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3371: checking for $ac_func" >&5
+echo "configure:3510: 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 3376 "configure"
+#line 3515 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3395,7 +3534,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3538: \"$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
@@ -3421,7 +3560,7 @@
 
 if test x"$ac_cv_func_crypt" = x"no"; then
     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:3425: checking for crypt in -lcrypt" >&5
+echo "configure:3564: 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
@@ -3429,7 +3568,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3433 "configure"
+#line 3572 "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
@@ -3440,7 +3579,7 @@
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:3444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3583: \"$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
@@ -3472,7 +3611,7 @@
 if test "$ac_cv_header_readline_h" = "yes" ||
    test "$ac_cv_header_readline_readline_h" = "yes"; then
   echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:3476: checking for readline in -lreadline" >&5
+echo "configure:3615: checking for readline in -lreadline" >&5
 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3480,7 +3619,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3484 "configure"
+#line 3623 "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
@@ -3491,7 +3630,7 @@
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:3495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3634: \"$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
@@ -3530,12 +3669,12 @@
 for ac_func in connect
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3534: checking for $ac_func" >&5
+echo "configure:3673: 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 3539 "configure"
+#line 3678 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3558,7 +3697,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3701: \"$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
@@ -3586,7 +3725,7 @@
     case "$LIBS" in
     *-lnsl*) ;;
     *) echo $ac_n "checking for printf in -lnsl_s""... $ac_c" 1>&6
-echo "configure:3590: checking for printf in -lnsl_s" >&5
+echo "configure:3729: 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
@@ -3594,7 +3733,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3598 "configure"
+#line 3737 "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
@@ -3605,7 +3744,7 @@
 printf()
 ; return 0; }
 EOF
-if { (eval echo configure:3609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3748: \"$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
@@ -3636,7 +3775,7 @@
     case "$LIBS" in
     *-lnsl*) ;;
     *) echo $ac_n "checking for printf in -lnsl""... $ac_c" 1>&6
-echo "configure:3640: checking for printf in -lnsl" >&5
+echo "configure:3779: 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
@@ -3644,7 +3783,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3648 "configure"
+#line 3787 "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
@@ -3655,7 +3794,7 @@
 printf()
 ; return 0; }
 EOF
-if { (eval echo configure:3659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3798: \"$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
@@ -3686,7 +3825,7 @@
     case "$LIBS" in
     *-lsocket*) ;;
     *) echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3690: checking for connect in -lsocket" >&5
+echo "configure:3829: 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
@@ -3694,7 +3833,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3698 "configure"
+#line 3837 "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
@@ -3705,7 +3844,7 @@
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:3709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3848: \"$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
@@ -3736,7 +3875,7 @@
     case "$LIBS" in
     *-linet*) ;;
     *) echo $ac_n "checking for connect in -linet""... $ac_c" 1>&6
-echo "configure:3740: checking for connect in -linet" >&5
+echo "configure:3879: 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
@@ -3744,7 +3883,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3748 "configure"
+#line 3887 "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
@@ -3755,7 +3894,7 @@
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:3759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3898: \"$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
@@ -3798,12 +3937,12 @@
 for ac_func in execl
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3802: checking for $ac_func" >&5
+echo "configure:3941: 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 3807 "configure"
+#line 3946 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3826,7 +3965,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3969: \"$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
@@ -3859,12 +3998,12 @@
 for ac_func in waitpid getcwd strdup strtoul strerror chown chmod chroot
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3863: checking for $ac_func" >&5
+echo "configure:4002: 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 3868 "configure"
+#line 4007 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3887,7 +4026,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4030: \"$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
@@ -3914,12 +4053,12 @@
 for ac_func in fstat strchr utime utimes getrlimit fsync bzero memset
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3918: checking for $ac_func" >&5
+echo "configure:4057: 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 3923 "configure"
+#line 4062 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3942,7 +4081,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4085: \"$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
@@ -3969,12 +4108,12 @@
 for ac_func in memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3973: checking for $ac_func" >&5
+echo "configure:4112: 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 3978 "configure"
+#line 4117 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3997,7 +4136,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4140: \"$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
@@ -4024,12 +4163,12 @@
 for ac_func in strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4028: checking for $ac_func" >&5
+echo "configure:4167: 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 4033 "configure"
+#line 4172 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4052,7 +4191,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4195: \"$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
@@ -4079,12 +4218,12 @@
 for ac_func in initgroups select rdchk getgrnam getgrent pathconf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4083: checking for $ac_func" >&5
+echo "configure:4222: 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 4088 "configure"
+#line 4227 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4107,7 +4246,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4250: \"$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
@@ -4134,12 +4273,12 @@
 for ac_func in setpriv setgidx setuidx setgroups mktime rename ftruncate stat64 fstat64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4138: checking for $ac_func" >&5
+echo "configure:4277: 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 4143 "configure"
+#line 4282 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4162,7 +4301,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4305: \"$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
@@ -4189,12 +4328,12 @@
 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:4193: checking for $ac_func" >&5
+echo "configure:4332: 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 4198 "configure"
+#line 4337 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4217,7 +4356,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4360: \"$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
@@ -4244,12 +4383,12 @@
 for ac_func in fseek64 fseeko64 ftell64 ftello64 setluid yp_get_default_domain getpwanam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4248: checking for $ac_func" >&5
+echo "configure:4387: 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 4253 "configure"
+#line 4392 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4272,7 +4411,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4415: \"$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
@@ -4299,12 +4438,12 @@
 for ac_func in srandom random srand rand setenv usleep mmap64 strcasecmp fcvt fcvtl
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4303: checking for $ac_func" >&5
+echo "configure:4442: 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 4308 "configure"
+#line 4447 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4327,7 +4466,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4470: \"$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
@@ -4356,12 +4495,12 @@
 for ac_func in syscall
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4360: checking for $ac_func" >&5
+echo "configure:4499: 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 4365 "configure"
+#line 4504 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4384,7 +4523,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4527: \"$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
@@ -4412,12 +4551,12 @@
 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:4416: checking for $ac_func" >&5
+echo "configure:4555: 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 4421 "configure"
+#line 4560 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4440,7 +4579,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4583: \"$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
@@ -4467,12 +4606,12 @@
 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:4471: checking for $ac_func" >&5
+echo "configure:4610: 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 4476 "configure"
+#line 4615 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4495,7 +4634,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4638: \"$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
@@ -4522,12 +4661,12 @@
 for ac_func in __getcwd _getcwd
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4526: checking for $ac_func" >&5
+echo "configure:4665: 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 4531 "configure"
+#line 4670 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4550,7 +4689,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4693: \"$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
@@ -4577,12 +4716,12 @@
 for ac_func in __xstat __fxstat __lxstat
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4581: checking for $ac_func" >&5
+echo "configure:4720: 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 4586 "configure"
+#line 4725 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4605,7 +4744,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4748: \"$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
@@ -4632,12 +4771,12 @@
 for ac_func in _stat _lstat _fstat __stat __lstat __fstat
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4636: checking for $ac_func" >&5
+echo "configure:4775: 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 4641 "configure"
+#line 4780 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4660,7 +4799,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4803: \"$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
@@ -4687,12 +4826,12 @@
 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:4691: checking for $ac_func" >&5
+echo "configure:4830: 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 4696 "configure"
+#line 4835 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4715,7 +4854,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4858: \"$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
@@ -4742,12 +4881,12 @@
 for ac_func in _close __close _fchdir __fchdir _fcntl __fcntl
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4746: checking for $ac_func" >&5
+echo "configure:4885: 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 4751 "configure"
+#line 4890 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4770,7 +4909,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4913: \"$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
@@ -4797,12 +4936,12 @@
 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:4801: checking for $ac_func" >&5
+echo "configure:4940: 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 4806 "configure"
+#line 4945 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4825,7 +4964,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4968: \"$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
@@ -4852,12 +4991,12 @@
 for ac_func in _write __write _fork __fork
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4856: checking for $ac_func" >&5
+echo "configure:4995: 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 4861 "configure"
+#line 5000 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4880,7 +5019,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5023: \"$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
@@ -4907,12 +5046,12 @@
 for ac_func in _stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4911: checking for $ac_func" >&5
+echo "configure:5050: 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 4916 "configure"
+#line 5055 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4935,7 +5074,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5078: \"$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
@@ -4962,12 +5101,12 @@
 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:4966: checking for $ac_func" >&5
+echo "configure:5105: 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 4971 "configure"
+#line 5110 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4990,7 +5129,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5133: \"$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
@@ -5017,12 +5156,12 @@
 for ac_func in pread _pread __pread pread64 _pread64 __pread64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5021: checking for $ac_func" >&5
+echo "configure:5160: 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 5026 "configure"
+#line 5165 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5045,7 +5184,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5188: \"$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
@@ -5072,12 +5211,12 @@
 for ac_func in pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5076: checking for $ac_func" >&5
+echo "configure:5215: 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 5081 "configure"
+#line 5220 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5100,7 +5239,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5243: \"$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
@@ -5127,12 +5266,12 @@
 for ac_func in open64 _open64 __open64 creat64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5131: checking for $ac_func" >&5
+echo "configure:5270: 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 5136 "configure"
+#line 5275 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5155,7 +5294,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5298: \"$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
@@ -5186,9 +5325,9 @@
 
 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:5190: checking for stat64 in <sys/stat.h>" >&5
+echo "configure:5329: checking for stat64 in <sys/stat.h>" >&5
   cat > conftest.$ac_ext <<EOF
-#line 5192 "configure"
+#line 5331 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -5200,7 +5339,7 @@
 struct stat64 st64; exit(stat64(".",&st64));
 ; return 0; }
 EOF
-if { (eval echo configure:5204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_stat64=yes
 else
@@ -5219,9 +5358,9 @@
 
 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:5223: checking for lstat64 in <sys/stat.h>" >&5
+echo "configure:5362: checking for lstat64 in <sys/stat.h>" >&5
   cat > conftest.$ac_ext <<EOF
-#line 5225 "configure"
+#line 5364 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -5233,7 +5372,7 @@
 struct stat64 st64; exit(lstat64(".",&st64));
 ; return 0; }
 EOF
-if { (eval echo configure:5237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_lstat64=yes
 else
@@ -5252,9 +5391,9 @@
 
 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:5256: checking for fstat64 in <sys/stat.h>" >&5
+echo "configure:5395: checking for fstat64 in <sys/stat.h>" >&5
   cat > conftest.$ac_ext <<EOF
-#line 5258 "configure"
+#line 5397 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -5266,7 +5405,7 @@
 struct stat64 st64; exit(fstat64(0,&st64));
 ; return 0; }
 EOF
-if { (eval echo configure:5270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_fstat64=yes
 else
@@ -5291,7 +5430,7 @@
 
 if test x$ac_cv_func_strcasecmp = xno ; then
 	echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6
-echo "configure:5295: checking for strcasecmp in -lresolv" >&5
+echo "configure:5434: 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
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5299,7 +5438,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5303 "configure"
+#line 5442 "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
@@ -5310,7 +5449,7 @@
 strcasecmp()
 ; return 0; }
 EOF
-if { (eval echo configure:5314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5453: \"$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
@@ -5346,12 +5485,12 @@
   *-lsecurity*) for ac_func in putprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5350: checking for $ac_func" >&5
+echo "configure:5489: 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 5355 "configure"
+#line 5494 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5374,7 +5513,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5517: \"$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
@@ -5399,7 +5538,7 @@
 done
  ;;
   *) echo $ac_n "checking for putprpwnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:5403: checking for putprpwnam in -lsecurity" >&5
+echo "configure:5542: 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
@@ -5407,7 +5546,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsecurity  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5411 "configure"
+#line 5550 "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
@@ -5418,7 +5557,7 @@
 putprpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:5422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5561: \"$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
@@ -5448,12 +5587,12 @@
      for ac_func in putprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5452: checking for $ac_func" >&5
+echo "configure:5591: 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 5457 "configure"
+#line 5596 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5476,7 +5615,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5619: \"$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
@@ -5507,12 +5646,12 @@
   *-lsec*) for ac_func in putprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5511: 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 5516 "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.  */
@@ -5535,7 +5674,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
@@ -5560,7 +5699,7 @@
 done
  ;;
   *) echo $ac_n "checking for putprpwnam in -lsec""... $ac_c" 1>&6
-echo "configure:5564: checking for putprpwnam in -lsec" >&5
+echo "configure:5703: 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
@@ -5568,7 +5707,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5572 "configure"
+#line 5711 "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
@@ -5579,7 +5718,7 @@
 putprpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:5583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5722: \"$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
@@ -5609,12 +5748,12 @@
      for ac_func in putprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5613: checking for $ac_func" >&5
+echo "configure:5752: 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 5618 "configure"
+#line 5757 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5637,7 +5776,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5780: \"$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
@@ -5669,12 +5808,12 @@
   *-lsecurity*) for ac_func in set_auth_parameters
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5673: checking for $ac_func" >&5
+echo "configure:5812: 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 5678 "configure"
+#line 5817 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5697,7 +5836,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5840: \"$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
@@ -5722,7 +5861,7 @@
 done
  ;;
   *) echo $ac_n "checking for set_auth_parameters in -lsecurity""... $ac_c" 1>&6
-echo "configure:5726: checking for set_auth_parameters in -lsecurity" >&5
+echo "configure:5865: 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
@@ -5730,7 +5869,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsecurity  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5734 "configure"
+#line 5873 "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
@@ -5741,7 +5880,7 @@
 set_auth_parameters()
 ; return 0; }
 EOF
-if { (eval echo configure:5745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5884: \"$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
@@ -5771,12 +5910,12 @@
      for ac_func in set_auth_parameters
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5775: checking for $ac_func" >&5
+echo "configure:5914: 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 5780 "configure"
+#line 5919 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5799,7 +5938,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5942: \"$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
@@ -5830,12 +5969,12 @@
   *-lsec*) for ac_func in set_auth_parameters
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5834: checking for $ac_func" >&5
+echo "configure:5973: 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 5839 "configure"
+#line 5978 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5858,7 +5997,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6001: \"$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
@@ -5883,7 +6022,7 @@
 done
  ;;
   *) echo $ac_n "checking for set_auth_parameters in -lsec""... $ac_c" 1>&6
-echo "configure:5887: checking for set_auth_parameters in -lsec" >&5
+echo "configure:6026: 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
@@ -5891,7 +6030,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5895 "configure"
+#line 6034 "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
@@ -5902,7 +6041,7 @@
 set_auth_parameters()
 ; return 0; }
 EOF
-if { (eval echo configure:5906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6045: \"$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
@@ -5932,12 +6071,12 @@
      for ac_func in set_auth_parameters
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5936: checking for $ac_func" >&5
+echo "configure:6075: 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 5941 "configure"
+#line 6080 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5960,7 +6099,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6103: \"$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
@@ -5993,12 +6132,12 @@
   *-lgen*) for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5997: checking for $ac_func" >&5
+echo "configure:6136: 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 6002 "configure"
+#line 6141 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6021,7 +6160,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6164: \"$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
@@ -6046,7 +6185,7 @@
 done
  ;;
   *) echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
-echo "configure:6050: checking for getspnam in -lgen" >&5
+echo "configure:6189: 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
@@ -6054,7 +6193,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6058 "configure"
+#line 6197 "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
@@ -6065,7 +6204,7 @@
 getspnam()
 ; return 0; }
 EOF
-if { (eval echo configure:6069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6208: \"$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
@@ -6095,12 +6234,12 @@
      for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6099: checking for $ac_func" >&5
+echo "configure:6238: 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 6104 "configure"
+#line 6243 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6123,7 +6262,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6266: \"$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
@@ -6155,12 +6294,12 @@
   *-lsecurity*) for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6159: checking for $ac_func" >&5
+echo "configure:6298: 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 6164 "configure"
+#line 6303 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6183,7 +6322,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6326: \"$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
@@ -6208,7 +6347,7 @@
 done
  ;;
   *) echo $ac_n "checking for getspnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:6212: checking for getspnam in -lsecurity" >&5
+echo "configure:6351: 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
@@ -6216,7 +6355,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsecurity  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6220 "configure"
+#line 6359 "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
@@ -6227,7 +6366,7 @@
 getspnam()
 ; return 0; }
 EOF
-if { (eval echo configure:6231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6370: \"$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
@@ -6257,12 +6396,12 @@
      for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6261: checking for $ac_func" >&5
+echo "configure:6400: 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 6266 "configure"
+#line 6405 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6285,7 +6424,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6428: \"$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
@@ -6316,12 +6455,12 @@
   *-lsec*) for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6320: checking for $ac_func" >&5
+echo "configure:6459: 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 6325 "configure"
+#line 6464 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6344,7 +6483,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6487: \"$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
@@ -6369,7 +6508,7 @@
 done
  ;;
   *) echo $ac_n "checking for getspnam in -lsec""... $ac_c" 1>&6
-echo "configure:6373: checking for getspnam in -lsec" >&5
+echo "configure:6512: 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
@@ -6377,7 +6516,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6381 "configure"
+#line 6520 "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
@@ -6388,7 +6527,7 @@
 getspnam()
 ; return 0; }
 EOF
-if { (eval echo configure:6392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6531: \"$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
@@ -6418,12 +6557,12 @@
      for ac_func in getspnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6422: checking for $ac_func" >&5
+echo "configure:6561: 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 6427 "configure"
+#line 6566 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6446,7 +6585,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6589: \"$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
@@ -6478,12 +6617,12 @@
   *-lsecurity*) for ac_func in bigcrypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6482: checking for $ac_func" >&5
+echo "configure:6621: 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 6487 "configure"
+#line 6626 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6506,7 +6645,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6649: \"$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
@@ -6531,7 +6670,7 @@
 done
  ;;
   *) echo $ac_n "checking for bigcrypt in -lsecurity""... $ac_c" 1>&6
-echo "configure:6535: checking for bigcrypt in -lsecurity" >&5
+echo "configure:6674: 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
@@ -6539,7 +6678,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsecurity  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6543 "configure"
+#line 6682 "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
@@ -6550,7 +6689,7 @@
 bigcrypt()
 ; return 0; }
 EOF
-if { (eval echo configure:6554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6693: \"$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
@@ -6580,12 +6719,12 @@
      for ac_func in bigcrypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6584: checking for $ac_func" >&5
+echo "configure:6723: 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 6589 "configure"
+#line 6728 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6608,7 +6747,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6751: \"$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
@@ -6639,12 +6778,12 @@
   *-lsec*) for ac_func in bigcrypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6643: checking for $ac_func" >&5
+echo "configure:6782: 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 6648 "configure"
+#line 6787 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6667,7 +6806,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6810: \"$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
@@ -6692,7 +6831,7 @@
 done
  ;;
   *) echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
-echo "configure:6696: checking for bigcrypt in -lsec" >&5
+echo "configure:6835: 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
@@ -6700,7 +6839,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6704 "configure"
+#line 6843 "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
@@ -6711,7 +6850,7 @@
 bigcrypt()
 ; return 0; }
 EOF
-if { (eval echo configure:6715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6854: \"$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
@@ -6741,12 +6880,12 @@
      for ac_func in bigcrypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6745: checking for $ac_func" >&5
+echo "configure:6884: 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 6750 "configure"
+#line 6889 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6769,7 +6908,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6912: \"$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
@@ -6801,12 +6940,12 @@
   *-lsecurity*) for ac_func in getprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6805: checking for $ac_func" >&5
+echo "configure:6944: 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 6810 "configure"
+#line 6949 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6829,7 +6968,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6972: \"$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
@@ -6854,7 +6993,7 @@
 done
  ;;
   *) echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:6858: checking for getprpwnam in -lsecurity" >&5
+echo "configure:6997: 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
@@ -6862,7 +7001,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsecurity  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6866 "configure"
+#line 7005 "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
@@ -6873,7 +7012,7 @@
 getprpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:6877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7016: \"$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
@@ -6903,12 +7042,12 @@
      for ac_func in getprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6907: checking for $ac_func" >&5
+echo "configure:7046: 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 6912 "configure"
+#line 7051 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6931,7 +7070,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7074: \"$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
@@ -6962,12 +7101,12 @@
   *-lsec*) for ac_func in getprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6966: checking for $ac_func" >&5
+echo "configure:7105: 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 6971 "configure"
+#line 7110 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6990,7 +7129,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7133: \"$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
@@ -7015,7 +7154,7 @@
 done
  ;;
   *) echo $ac_n "checking for getprpwnam in -lsec""... $ac_c" 1>&6
-echo "configure:7019: checking for getprpwnam in -lsec" >&5
+echo "configure:7158: 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
@@ -7023,7 +7162,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7027 "configure"
+#line 7166 "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
@@ -7034,7 +7173,7 @@
 getprpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:7038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7177: \"$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
@@ -7064,12 +7203,12 @@
      for ac_func in getprpwnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7068: checking for $ac_func" >&5
+echo "configure:7207: 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 7073 "configure"
+#line 7212 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7092,7 +7231,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7235: \"$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
@@ -7197,15 +7336,16 @@
 		*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:7201: checking for $ac_word" >&5
+echo "configure:7340: 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="${IFS}:"
-  for ac_dir in $PATH; do
+  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"
@@ -7251,7 +7391,7 @@
 
 # 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:7255: checking whether ${CC-cc} accepts -fpic" >&5
+echo "configure:7395: checking whether ${CC-cc} accepts -fpic" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_fpic'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7271,7 +7411,7 @@
 fi
 if test x$PICFLAG = x; then
   echo $ac_n "checking whether ${CC-cc} accepts -Kpic""... $ac_c" 1>&6
-echo "configure:7275: checking whether ${CC-cc} accepts -Kpic" >&5
+echo "configure:7415: checking whether ${CC-cc} accepts -Kpic" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_Kpic'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7292,7 +7432,7 @@
 fi
 if test x$PICFLAG = x; then
   echo $ac_n "checking whether ${CC-cc} accepts -KPIC""... $ac_c" 1>&6
-echo "configure:7296: checking whether ${CC-cc} accepts -KPIC" >&5
+echo "configure:7436: checking whether ${CC-cc} accepts -KPIC" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_KPIC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7315,7 +7455,7 @@
 ################
 
 echo $ac_n "checking for long long""... $ac_c" 1>&6
-echo "configure:7319: checking for long long" >&5
+echo "configure:7459: 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
@@ -7324,12 +7464,12 @@
   samba_cv_have_longlong=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7328 "configure"
+#line 7468 "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:7333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7473: \"$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
@@ -7352,7 +7492,7 @@
 fi
 
 echo $ac_n "checking for 64 bit off_t""... $ac_c" 1>&6
-echo "configure:7356: checking for 64 bit off_t" >&5
+echo "configure:7496: 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
@@ -7361,13 +7501,13 @@
   samba_cv_SIZEOF_OFF_T=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7365 "configure"
+#line 7505 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <sys/stat.h>
 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }
 EOF
-if { (eval echo configure:7371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7511: \"$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
@@ -7390,7 +7530,7 @@
 fi
 
 echo $ac_n "checking for off64_t""... $ac_c" 1>&6
-echo "configure:7394: checking for off64_t" >&5
+echo "configure:7534: 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
@@ -7399,7 +7539,7 @@
   samba_cv_HAVE_OFF64_T=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7403 "configure"
+#line 7543 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -7409,7 +7549,7 @@
 #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:7413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7553: \"$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
@@ -7432,7 +7572,7 @@
 fi
 
 echo $ac_n "checking for 64 bit ino_t""... $ac_c" 1>&6
-echo "configure:7436: checking for 64 bit ino_t" >&5
+echo "configure:7576: 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
@@ -7441,13 +7581,13 @@
   samba_cv_SIZEOF_INO_T=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7445 "configure"
+#line 7585 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <sys/stat.h>
 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }
 EOF
-if { (eval echo configure:7451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7591: \"$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
@@ -7470,7 +7610,7 @@
 fi
 
 echo $ac_n "checking for ino64_t""... $ac_c" 1>&6
-echo "configure:7474: checking for ino64_t" >&5
+echo "configure:7614: 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
@@ -7479,7 +7619,7 @@
   samba_cv_HAVE_INO64_T=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7483 "configure"
+#line 7623 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -7489,7 +7629,7 @@
 #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:7493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7633: \"$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
@@ -7512,13 +7652,13 @@
 fi
 
 echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6
-echo "configure:7516: checking for struct dirent64" >&5
+echo "configure:7656: 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
   
 cat > conftest.$ac_ext <<EOF
-#line 7522 "configure"
+#line 7662 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -7530,7 +7670,7 @@
 struct dirent64 de;
 ; return 0; }
 EOF
-if { (eval echo configure:7534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_STRUCT_DIRENT64=yes
 else
@@ -7551,7 +7691,7 @@
 fi
 
 echo $ac_n "checking for union semun""... $ac_c" 1>&6
-echo "configure:7555: checking for union semun" >&5
+echo "configure:7695: checking for union semun" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_UNION_SEMUN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7560,7 +7700,7 @@
   samba_cv_HAVE_UNION_SEMUN=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7564 "configure"
+#line 7704 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -7568,7 +7708,7 @@
 #include <sys/sem.h>
 main() { union semun ss; exit(0); }
 EOF
-if { (eval echo configure:7572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_UNION_SEMUN=yes
 else
@@ -7591,7 +7731,7 @@
 fi
 
 echo $ac_n "checking for unsigned char""... $ac_c" 1>&6
-echo "configure:7595: checking for unsigned char" >&5
+echo "configure:7735: 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
@@ -7600,12 +7740,12 @@
   samba_cv_HAVE_UNSIGNED_CHAR=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7604 "configure"
+#line 7744 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main() { char c; c=250; exit((c > 0)?0:1); }
 EOF
-if { (eval echo configure:7609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7749: \"$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
@@ -7628,13 +7768,13 @@
 fi
 
 echo $ac_n "checking for sin_len in sock""... $ac_c" 1>&6
-echo "configure:7632: checking for sin_len in sock" >&5
+echo "configure:7772: 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
   
 cat > conftest.$ac_ext <<EOF
-#line 7638 "configure"
+#line 7778 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -7643,7 +7783,7 @@
 struct sockaddr_in sock; sock.sin_len = sizeof(sock);
 ; return 0; }
 EOF
-if { (eval echo configure:7647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_SOCK_SIN_LEN=yes
 else
@@ -7664,13 +7804,13 @@
 fi
 
 echo $ac_n "checking whether seekdir returns void""... $ac_c" 1>&6
-echo "configure:7668: checking whether seekdir returns void" >&5
+echo "configure:7808: 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
   
 cat > conftest.$ac_ext <<EOF
-#line 7674 "configure"
+#line 7814 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <dirent.h>
@@ -7679,7 +7819,7 @@
 return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:7683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_SEEKDIR_RETURNS_VOID=yes
 else
@@ -7700,20 +7840,20 @@
 fi
 
 echo $ac_n "checking for __FILE__ macro""... $ac_c" 1>&6
-echo "configure:7704: checking for __FILE__ macro" >&5
+echo "configure:7844: 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
   
 cat > conftest.$ac_ext <<EOF
-#line 7710 "configure"
+#line 7850 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("%s\n", __FILE__);
 ; return 0; }
 EOF
-if { (eval echo configure:7717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_FILE_MACRO=yes
 else
@@ -7734,20 +7874,20 @@
 fi
 
 echo $ac_n "checking for __FUNCTION__ macro""... $ac_c" 1>&6
-echo "configure:7738: checking for __FUNCTION__ macro" >&5
+echo "configure:7878: 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 7744 "configure"
+#line 7884 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("%s\n", __FUNCTION__);
 ; return 0; }
 EOF
-if { (eval echo configure:7751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7891: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_FUNCTION_MACRO=yes
 else
@@ -7768,7 +7908,7 @@
 fi
 
 echo $ac_n "checking if gettimeofday takes tz argument""... $ac_c" 1>&6
-echo "configure:7772: checking if gettimeofday takes tz argument" >&5
+echo "configure:7912: 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
@@ -7777,14 +7917,14 @@
   samba_cv_HAVE_GETTIMEOFDAY_TZ=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7781 "configure"
+#line 7921 "configure"
 #include "confdefs.h"
 
 #include <sys/time.h>
 #include <unistd.h>
 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}
 EOF
-if { (eval echo configure:7788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7928: \"$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
 else
@@ -7808,7 +7948,7 @@
 
 
 echo $ac_n "checking for broken readdir""... $ac_c" 1>&6
-echo "configure:7812: checking for broken readdir" >&5
+echo "configure:7952: 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
@@ -7817,7 +7957,7 @@
   samba_cv_HAVE_BROKEN_READDIR=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7821 "configure"
+#line 7961 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <dirent.h>
@@ -7825,7 +7965,7 @@
 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:7829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7969: \"$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
 else
@@ -7848,13 +7988,13 @@
 fi
 
 echo $ac_n "checking for utimbuf""... $ac_c" 1>&6
-echo "configure:7852: checking for utimbuf" >&5
+echo "configure:7992: checking for utimbuf" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_UTIMBUF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 7858 "configure"
+#line 7998 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <utime.h>
@@ -7862,7 +8002,7 @@
 struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));
 ; return 0; }
 EOF
-if { (eval echo configure:7866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_UTIMBUF=yes
 else
@@ -7883,13 +8023,13 @@
 fi
 
 echo $ac_n "checking for kernel oplock type definitions""... $ac_c" 1>&6
-echo "configure:7887: checking for kernel oplock type definitions" >&5
+echo "configure:8027: checking for kernel oplock type definitions" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_KERNEL_OPLOCKS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 7893 "configure"
+#line 8033 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <fcntl.h>
@@ -7897,7 +8037,7 @@
 oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:7901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_KERNEL_OPLOCKS=yes
 else
@@ -7918,7 +8058,7 @@
 fi
 
 echo $ac_n "checking for irix specific capabilities""... $ac_c" 1>&6
-echo "configure:7922: checking for irix specific capabilities" >&5
+echo "configure:8062: 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
@@ -7927,7 +8067,7 @@
   samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7931 "configure"
+#line 8071 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/capability.h>
@@ -7942,7 +8082,7 @@
 }
 
 EOF
-if { (eval echo configure:7946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8086: \"$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
@@ -7970,13 +8110,13 @@
 #
 
 echo $ac_n "checking for int16 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:7974: checking for int16 typedef included by rpc/rpc.h" >&5
+echo "configure:8114: 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 7980 "configure"
+#line 8120 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if defined(HAVE_RPC_RPC_H)
@@ -7986,7 +8126,7 @@
 int16 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:7990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes
 else
@@ -8007,13 +8147,13 @@
 fi
 
 echo $ac_n "checking for uint16 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:8011: checking for uint16 typedef included by rpc/rpc.h" >&5
+echo "configure:8151: 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 8017 "configure"
+#line 8157 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if defined(HAVE_RPC_RPC_H)
@@ -8023,7 +8163,7 @@
 uint16 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:8027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8167: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes
 else
@@ -8044,13 +8184,13 @@
 fi
 
 echo $ac_n "checking for int32 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:8048: checking for int32 typedef included by rpc/rpc.h" >&5
+echo "configure:8188: 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 8054 "configure"
+#line 8194 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if defined(HAVE_RPC_RPC_H)
@@ -8060,7 +8200,7 @@
 int32 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:8064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes
 else
@@ -8081,13 +8221,13 @@
 fi
 
 echo $ac_n "checking for uint32 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:8085: checking for uint32 typedef included by rpc/rpc.h" >&5
+echo "configure:8225: 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 8091 "configure"
+#line 8231 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if defined(HAVE_RPC_RPC_H)
@@ -8097,7 +8237,7 @@
 uint32 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:8101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes
 else
@@ -8119,13 +8259,13 @@
 
 
 echo $ac_n "checking for conflicting AUTH_ERROR define in rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:8123: checking for conflicting AUTH_ERROR define in rpc/rpc.h" >&5
+echo "configure:8263: 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
   
 cat > conftest.$ac_ext <<EOF
-#line 8129 "configure"
+#line 8269 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_SYS_SECURITY_H
@@ -8139,7 +8279,7 @@
 int testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:8143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no
 else
@@ -8160,16 +8300,16 @@
 fi
 
 echo $ac_n "checking for test routines""... $ac_c" 1>&6
-echo "configure:8164: checking for test routines" >&5
+echo "configure:8304: checking for test routines" >&5
 if test "$cross_compiling" = yes; then
   echo "configure: warning: cannot run when cross-compiling" 1>&2
 else
   cat > conftest.$ac_ext <<EOF
-#line 8169 "configure"
+#line 8309 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/trivial.c"
 EOF
-if { (eval echo configure:8173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8313: \"$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
 else
@@ -8183,7 +8323,7 @@
 
 
 echo $ac_n "checking for ftruncate extend""... $ac_c" 1>&6
-echo "configure:8187: checking for ftruncate extend" >&5
+echo "configure:8327: 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
@@ -8192,11 +8332,11 @@
   samba_cv_HAVE_FTRUNCATE_EXTEND=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8196 "configure"
+#line 8336 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/ftruncate.c"
 EOF
-if { (eval echo configure:8200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8340: \"$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
 else
@@ -8219,7 +8359,7 @@
 fi
 
 echo $ac_n "checking for broken getgroups""... $ac_c" 1>&6
-echo "configure:8223: checking for broken getgroups" >&5
+echo "configure:8363: 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
@@ -8228,11 +8368,11 @@
   samba_cv_HAVE_BROKEN_GETGROUPS=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8232 "configure"
+#line 8372 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/getgroups.c"
 EOF
-if { (eval echo configure:8236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8376: \"$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
@@ -8255,7 +8395,7 @@
 fi
 
 echo $ac_n "checking whether getpass should be replaced""... $ac_c" 1>&6
-echo "configure:8259: checking whether getpass should be replaced" >&5
+echo "configure:8399: 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
@@ -8263,7 +8403,7 @@
 SAVE_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
 cat > conftest.$ac_ext <<EOF
-#line 8267 "configure"
+#line 8407 "configure"
 #include "confdefs.h"
 
 #define REPLACE_GETPASS 1
@@ -8276,7 +8416,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_REPLACE_GETPASS=yes
 else
@@ -8299,7 +8439,7 @@
 fi
 
 echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6
-echo "configure:8303: checking for working fnmatch" >&5
+echo "configure:8443: checking for working fnmatch" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_FNMATCH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8308,12 +8448,12 @@
   samba_cv_HAVE_FNMATCH=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8312 "configure"
+#line 8452 "configure"
 #include "confdefs.h"
 #include <fnmatch.h>
 main() { exit(fnmatch("*.o", "x.o", FNM_PATHNAME) == 0? 0: 1); }
 EOF
-if { (eval echo configure:8317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_FNMATCH=yes
 else
@@ -8336,7 +8476,7 @@
 fi
 
 echo $ac_n "checking for broken inet_ntoa""... $ac_c" 1>&6
-echo "configure:8340: checking for broken inet_ntoa" >&5
+echo "configure:8480: 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
@@ -8345,7 +8485,7 @@
   samba_cv_REPLACE_INET_NTOA=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8349 "configure"
+#line 8489 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -8359,7 +8499,7 @@
     strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } 
 exit(1);}
 EOF
-if { (eval echo configure:8363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8503: \"$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
@@ -8382,7 +8522,7 @@
 fi
 
 echo $ac_n "checking for root""... $ac_c" 1>&6
-echo "configure:8386: checking for root" >&5
+echo "configure:8526: checking for root" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_ROOT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8391,11 +8531,11 @@
   samba_cv_HAVE_ROOT=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8395 "configure"
+#line 8535 "configure"
 #include "confdefs.h"
 main() { exit(getuid() != 0); }
 EOF
-if { (eval echo configure:8399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8539: \"$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
 else
@@ -8423,7 +8563,7 @@
 # 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:8427: checking for iface AIX" >&5
+echo "configure:8567: 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
@@ -8432,7 +8572,7 @@
   samba_cv_HAVE_IFACE_AIX=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8436 "configure"
+#line 8576 "configure"
 #include "confdefs.h"
 
 #define HAVE_IFACE_AIX 1
@@ -8440,7 +8580,7 @@
 #include "confdefs.h"
 #include "${srcdir-.}/lib/interfaces.c"
 EOF
-if { (eval echo configure:8444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8584: \"$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
 else
@@ -8464,7 +8604,7 @@
 
 if test $iface = no; then
 echo $ac_n "checking for iface ifconf""... $ac_c" 1>&6
-echo "configure:8468: checking for iface ifconf" >&5
+echo "configure:8608: 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
@@ -8473,7 +8613,7 @@
   samba_cv_HAVE_IFACE_IFCONF=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8477 "configure"
+#line 8617 "configure"
 #include "confdefs.h"
 
 #define HAVE_IFACE_IFCONF 1
@@ -8481,7 +8621,7 @@
 #include "confdefs.h"
 #include "${srcdir-.}/lib/interfaces.c"
 EOF
-if { (eval echo configure:8485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8625: \"$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
 else
@@ -8506,7 +8646,7 @@
 
 if test $iface = no; then
 echo $ac_n "checking for iface ifreq""... $ac_c" 1>&6
-echo "configure:8510: checking for iface ifreq" >&5
+echo "configure:8650: 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
@@ -8515,7 +8655,7 @@
   samba_cv_HAVE_IFACE_IFREQ=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8519 "configure"
+#line 8659 "configure"
 #include "confdefs.h"
 
 #define HAVE_IFACE_IFREQ 1
@@ -8523,7 +8663,7 @@
 #include "confdefs.h"
 #include "${srcdir-.}/lib/interfaces.c"
 EOF
-if { (eval echo configure:8527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8667: \"$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
 else
@@ -8552,7 +8692,7 @@
 seteuid=no;
 if test $seteuid = no; then
 echo $ac_n "checking for setresuid""... $ac_c" 1>&6
-echo "configure:8556: checking for setresuid" >&5
+echo "configure:8696: checking for setresuid" >&5
 if eval "test \"`echo '$''{'samba_cv_USE_SETRESUID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8561,7 +8701,7 @@
   samba_cv_USE_SETRESUID=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8565 "configure"
+#line 8705 "configure"
 #include "confdefs.h"
 
 #define AUTOCONF_TEST 1
@@ -8569,7 +8709,7 @@
 #include "confdefs.h"
 #include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:8573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8713: \"$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
@@ -8595,7 +8735,7 @@
 
 if test $seteuid = no; then
 echo $ac_n "checking for setreuid""... $ac_c" 1>&6
-echo "configure:8599: checking for setreuid" >&5
+echo "configure:8739: checking for setreuid" >&5
 if eval "test \"`echo '$''{'samba_cv_USE_SETREUID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8604,7 +8744,7 @@
   samba_cv_USE_SETREUID=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8608 "configure"
+#line 8748 "configure"
 #include "confdefs.h"
 
 #define AUTOCONF_TEST 1
@@ -8612,7 +8752,7 @@
 #include "confdefs.h"
 #include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:8616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8756: \"$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
 else
@@ -8637,7 +8777,7 @@
 
 if test $seteuid = no; then
 echo $ac_n "checking for seteuid""... $ac_c" 1>&6
-echo "configure:8641: checking for seteuid" >&5
+echo "configure:8781: checking for seteuid" >&5
 if eval "test \"`echo '$''{'samba_cv_USE_SETEUID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8646,7 +8786,7 @@
   samba_cv_USE_SETEUID=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8650 "configure"
+#line 8790 "configure"
 #include "confdefs.h"
 
 #define AUTOCONF_TEST 1
@@ -8654,7 +8794,7 @@
 #include "confdefs.h"
 #include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:8658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8798: \"$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
 else
@@ -8679,7 +8819,7 @@
 
 if test $seteuid = no; then
 echo $ac_n "checking for setuidx""... $ac_c" 1>&6
-echo "configure:8683: checking for setuidx" >&5
+echo "configure:8823: checking for setuidx" >&5
 if eval "test \"`echo '$''{'samba_cv_USE_SETUIDX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8688,7 +8828,7 @@
   samba_cv_USE_SETUIDX=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8692 "configure"
+#line 8832 "configure"
 #include "confdefs.h"
 
 #define AUTOCONF_TEST 1
@@ -8696,7 +8836,7 @@
 #include "confdefs.h"
 #include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:8700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8840: \"$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
 else
@@ -8721,7 +8861,7 @@
 
 
 echo $ac_n "checking for shared mmap""... $ac_c" 1>&6
-echo "configure:8725: checking for shared mmap" >&5
+echo "configure:8865: checking for shared mmap" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_SHARED_MMAP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8730,11 +8870,11 @@
   samba_cv_HAVE_SHARED_MMAP=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8734 "configure"
+#line 8874 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/shared_mmap.c"
 EOF
-if { (eval echo configure:8738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_SHARED_MMAP=yes
 else
@@ -8761,7 +8901,7 @@
 fi
 
 echo $ac_n "checking for ftruncate needs root""... $ac_c" 1>&6
-echo "configure:8765: checking for ftruncate needs root" >&5
+echo "configure:8905: 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
@@ -8770,11 +8910,11 @@
   samba_cv_FTRUNCATE_NEEDS_ROOT=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8774 "configure"
+#line 8914 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/ftruncroot.c"
 EOF
-if { (eval echo configure:8778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8918: \"$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
 else
@@ -8797,7 +8937,7 @@
 fi
 
 echo $ac_n "checking for fcntl locking""... $ac_c" 1>&6
-echo "configure:8801: checking for fcntl locking" >&5
+echo "configure:8941: 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
@@ -8806,11 +8946,11 @@
   samba_cv_HAVE_FCNTL_LOCK=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8810 "configure"
+#line 8950 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/fcntl_lock.c"
 EOF
-if { (eval echo configure:8814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8954: \"$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
 else
@@ -8833,7 +8973,7 @@
 fi
 
 echo $ac_n "checking for broken (glibc2.1/x86) 64 bit fcntl locking""... $ac_c" 1>&6
-echo "configure:8837: checking for broken (glibc2.1/x86) 64 bit fcntl locking" >&5
+echo "configure:8977: 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
@@ -8842,11 +8982,11 @@
   samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8846 "configure"
+#line 8986 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/fcntl_lock64.c"
 EOF
-if { (eval echo configure:8850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8990: \"$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
 else
@@ -8871,7 +9011,7 @@
 
 
   echo $ac_n "checking for 64 bit fcntl locking""... $ac_c" 1>&6
-echo "configure:8875: checking for 64 bit fcntl locking" >&5
+echo "configure:9015: 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
@@ -8880,7 +9020,7 @@
   samba_cv_HAVE_STRUCT_FLOCK64=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8884 "configure"
+#line 9024 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -8904,7 +9044,7 @@
 #endif
 }
 EOF
-if { (eval echo configure:8908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9048: \"$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
 else
@@ -8929,7 +9069,7 @@
 fi
 
 echo $ac_n "checking for sysv ipc""... $ac_c" 1>&6
-echo "configure:8933: checking for sysv ipc" >&5
+echo "configure:9073: checking for sysv ipc" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_SYSV_IPC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8938,11 +9078,11 @@
   samba_cv_HAVE_SYSV_IPC=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8942 "configure"
+#line 9082 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/sysv_ipc.c"
 EOF
-if { (eval echo configure:8946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_SYSV_IPC=yes
 else
@@ -8965,7 +9105,7 @@
 fi
 
 echo $ac_n "checking for a crypt that needs truncated salt""... $ac_c" 1>&6
-echo "configure:8969: checking for a crypt that needs truncated salt" >&5
+echo "configure:9109: 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
@@ -8974,11 +9114,11 @@
   samba_cv_HAVE_TRUNCATED_SALT=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8978 "configure"
+#line 9118 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/crypttest.c"
 EOF
-if { (eval echo configure:8982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9122: \"$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
@@ -9001,13 +9141,13 @@
 fi
 
 echo $ac_n "checking for broken nisplus include files""... $ac_c" 1>&6
-echo "configure:9005: checking for broken nisplus include files" >&5
+echo "configure:9145: 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
   
 cat > conftest.$ac_ext <<EOF
-#line 9011 "configure"
+#line 9151 "configure"
 #include "confdefs.h"
 #include <sys/acl.h>
 #if defined(HAVE_RPCSVC_NIS_H)
@@ -9017,7 +9157,7 @@
 return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:9021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no
 else
@@ -9041,7 +9181,7 @@
 #################################################
 # check for smbwrapper support
 echo $ac_n "checking whether to use smbwrapper""... $ac_c" 1>&6
-echo "configure:9045: checking whether to use smbwrapper" >&5
+echo "configure:9185: 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"
@@ -9085,7 +9225,7 @@
 #################################################
 # check for the AFS filesystem
 echo $ac_n "checking whether to use AFS""... $ac_c" 1>&6
-echo "configure:9089: checking whether to use AFS" >&5
+echo "configure:9229: 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"
@@ -9111,7 +9251,7 @@
 #################################################
 # check for the DFS auth system
 echo $ac_n "checking whether to use DFS auth""... $ac_c" 1>&6
-echo "configure:9115: checking whether to use DFS auth" >&5
+echo "configure:9255: 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"
@@ -9136,7 +9276,7 @@
 #################################################
 # check for Kerberos IV auth system
 echo $ac_n "checking whether to use Kerberos IV""... $ac_c" 1>&6
-echo "configure:9140: checking whether to use Kerberos IV" >&5
+echo "configure:9280: 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"
@@ -9146,7 +9286,7 @@
 EOF
 
     echo $ac_n "checking for dn_expand in -lresolv""... $ac_c" 1>&6
-echo "configure:9150: checking for dn_expand in -lresolv" >&5
+echo "configure:9290: 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
@@ -9154,7 +9294,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9158 "configure"
+#line 9298 "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
@@ -9165,7 +9305,7 @@
 dn_expand()
 ; return 0; }
 EOF
-if { (eval echo configure:9169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9309: \"$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
@@ -9204,7 +9344,7 @@
 #################################################
 # check for Kerberos 5 auth system
 echo $ac_n "checking whether to use Kerberos 5""... $ac_c" 1>&6
-echo "configure:9208: checking whether to use Kerberos 5" >&5
+echo "configure:9348: 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"
@@ -9225,7 +9365,7 @@
 #################################################
 # check for automount support
 echo $ac_n "checking whether to use AUTOMOUNT""... $ac_c" 1>&6
-echo "configure:9229: checking whether to use AUTOMOUNT" >&5
+echo "configure:9369: 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"
@@ -9250,7 +9390,7 @@
 #################################################
 # check for smbmount support
 echo $ac_n "checking whether to use SMBMOUNT""... $ac_c" 1>&6
-echo "configure:9254: checking whether to use SMBMOUNT" >&5
+echo "configure:9394: 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"
@@ -9279,7 +9419,7 @@
 #################################################
 # check for a PAM password database
 echo $ac_n "checking whether to use PAM password database""... $ac_c" 1>&6
-echo "configure:9283: checking whether to use PAM password database" >&5
+echo "configure:9423: checking whether to use PAM password database" >&5
 # Check whether --with-pam or --without-pam was given.
 if test "${with_pam+set}" = set; then
   withval="$with_pam"
@@ -9306,7 +9446,7 @@
 #################################################
 # check for a LDAP password database
 echo $ac_n "checking whether to use LDAP password database""... $ac_c" 1>&6
-echo "configure:9310: checking whether to use LDAP password database" >&5
+echo "configure:9450: 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"
@@ -9332,7 +9472,7 @@
 #################################################
 # check for a NISPLUS password database
 echo $ac_n "checking whether to use NISPLUS password database""... $ac_c" 1>&6
-echo "configure:9336: checking whether to use NISPLUS password database" >&5
+echo "configure:9476: 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"
@@ -9357,7 +9497,7 @@
 #################################################
 # check for a NISPLUS_HOME support 
 echo $ac_n "checking whether to use NISPLUS_HOME""... $ac_c" 1>&6
-echo "configure:9361: checking whether to use NISPLUS_HOME" >&5
+echo "configure:9501: 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"
@@ -9382,7 +9522,7 @@
 #################################################
 # check for the secure socket layer
 echo $ac_n "checking whether to use SSL""... $ac_c" 1>&6
-echo "configure:9386: checking whether to use SSL" >&5
+echo "configure:9526: 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"
@@ -9442,7 +9582,7 @@
 #################################################
 # check for experimental mmap support
 echo $ac_n "checking whether to use MMAP""... $ac_c" 1>&6
-echo "configure:9446: checking whether to use MMAP" >&5
+echo "configure:9586: checking whether to use MMAP" >&5
 # Check whether --with-mmap or --without-mmap was given.
 if test "${with_mmap+set}" = set; then
   withval="$with_mmap"
@@ -9467,7 +9607,7 @@
 #################################################
 # check for syslog logging
 echo $ac_n "checking whether to use syslog logging""... $ac_c" 1>&6
-echo "configure:9471: checking whether to use syslog logging" >&5
+echo "configure:9611: 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"
@@ -9492,7 +9632,7 @@
 #################################################
 # check for experimental netatalk resource fork support
 echo $ac_n "checking whether to support netatalk""... $ac_c" 1>&6
-echo "configure:9496: checking whether to support netatalk" >&5
+echo "configure:9636: 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"
@@ -9515,11 +9655,36 @@
 
 
 #################################################
+# check for experimental netbeui support
+echo $ac_n "checking whether to support NetBEUI""... $ac_c" 1>&6
+echo "configure:9661: checking whether to support NetBEUI" >&5
+# Check whether --with-netbeui or --without-netbeui was given.
+if test "${with_netbeui+set}" = set; then
+  withval="$with_netbeui"
+   case "$withval" in
+  yes)
+    echo "$ac_t""yes" 1>&6
+    cat >> confdefs.h <<\EOF
+#define WITH_NETBEUI 1
+EOF
+
+    ;;
+  *)
+    echo "$ac_t""no" 1>&6
+    ;;
+  esac 
+else
+  echo "$ac_t""no" 1>&6
+
+fi
+
+
+#################################################
 # check for experimental disk-quotas support
 QUOTAOBJS=noquotas.o
 
 echo $ac_n "checking whether to support disk-quotas""... $ac_c" 1>&6
-echo "configure:9523: checking whether to support disk-quotas" >&5
+echo "configure:9688: 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"
@@ -9617,14 +9782,14 @@
 #################################################
 # these tests are taken from the GNU fileutils package
 echo "checking how to get filesystem space usage" 1>&6
-echo "configure:9621: checking how to get filesystem space usage" >&5
+echo "configure:9786: 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:9628: checking statvfs64 function (SVR4)" >&5
+echo "configure:9793: 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
@@ -9632,7 +9797,7 @@
   fu_cv_sys_stat_statvfs64=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9636 "configure"
+#line 9801 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -9646,7 +9811,7 @@
     exit (statvfs64 (".", &fsd));
   }
 EOF
-if { (eval echo configure:9650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9815: \"$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
@@ -9679,12 +9844,12 @@
 if test $space = no; then
   # SVR4
   echo $ac_n "checking statvfs function (SVR4)""... $ac_c" 1>&6
-echo "configure:9683: checking statvfs function (SVR4)" >&5
+echo "configure:9848: 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 9688 "configure"
+#line 9853 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/statvfs.h>
@@ -9692,7 +9857,7 @@
 struct statvfs fsd; statvfs (0, &fsd);
 ; return 0; }
 EOF
-if { (eval echo configure:9696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9861: \"$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
@@ -9717,7 +9882,7 @@
 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:9721: checking for 3-argument statfs function (DEC OSF/1)" >&5
+echo "configure:9886: 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
@@ -9725,7 +9890,7 @@
   fu_cv_sys_stat_statfs3_osf1=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 9729 "configure"
+#line 9894 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -9738,7 +9903,7 @@
     exit (statfs (".", &fsd, sizeof (struct statfs)));
   }
 EOF
-if { (eval echo configure:9742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9907: \"$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
@@ -9765,7 +9930,7 @@
 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:9769: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5
+echo "configure:9934: 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
@@ -9773,7 +9938,7 @@
   fu_cv_sys_stat_statfs2_bsize=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 9777 "configure"
+#line 9942 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_PARAM_H
@@ -9792,7 +9957,7 @@
   exit (statfs (".", &fsd));
   }
 EOF
-if { (eval echo configure:9796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9961: \"$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
@@ -9819,7 +9984,7 @@
 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:9823: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5
+echo "configure:9988: 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
@@ -9827,7 +9992,7 @@
   fu_cv_sys_stat_statfs4=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 9831 "configure"
+#line 9996 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/statfs.h>
@@ -9837,7 +10002,7 @@
   exit (statfs (".", &fsd, sizeof fsd, 0));
   }
 EOF
-if { (eval echo configure:9841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+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
   fu_cv_sys_stat_statfs4=yes
 else
@@ -9864,7 +10029,7 @@
 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:9868: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5
+echo "configure:10033: 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
@@ -9872,7 +10037,7 @@
   fu_cv_sys_stat_statfs2_fsize=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 9876 "configure"
+#line 10041 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
@@ -9888,7 +10053,7 @@
   exit (statfs (".", &fsd));
   }
 EOF
-if { (eval echo configure:9892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10057: \"$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
@@ -9915,7 +10080,7 @@
 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:9919: checking for two-argument statfs with struct fs_data (Ultrix)" >&5
+echo "configure:10084: 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
@@ -9923,7 +10088,7 @@
   fu_cv_sys_stat_fs_data=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 9927 "configure"
+#line 10092 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
@@ -9943,7 +10108,7 @@
   exit (statfs (".", &fsd) != 1);
   }
 EOF
-if { (eval echo configure:9947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10112: \"$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
@@ -9977,7 +10142,7 @@
 #
 echo "checking if large file support can be enabled"
 cat > conftest.$ac_ext <<EOF
-#line 9981 "configure"
+#line 10146 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
@@ -9990,7 +10155,7 @@
 int i
 ; return 0; }
 EOF
-if { (eval echo configure:9994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes
 else
@@ -10015,11 +10180,11 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 10019 "configure"
+#line 10184 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/summary.c"
 EOF
-if { (eval echo configure:10023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   echo "configure OK";
 else
@@ -10058,7 +10223,7 @@
 # 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) 2>&1` in
+  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 \).
@@ -10125,7 +10290,7 @@
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -10145,9 +10310,11 @@
  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
 $ac_vpsub
 $extrasub
+s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -10166,7 +10333,6 @@
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
-s%@SHELL@%$SHELL%g
 s%@RUNPROG@%$RUNPROG%g
 s%@MPROGS@%$MPROGS%g
 s%@LDSHFLAGS@%$LDSHFLAGS%g
@@ -10177,6 +10343,7 @@
 s%@SHLIBEXT@%$SHLIBEXT%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
diff -uNr samba-2.0.6/source/configure.in samba-2.0.6.netbeui/source/configure.in
--- samba-2.0.6/source/configure.in	Thu Nov 11 00:35:56 1999
+++ samba-2.0.6.netbeui/source/configure.in	Tue Jul 17 20:11:50 2001
@@ -1364,6 +1364,24 @@
 )
 
 #################################################
+# check for experimental netbeui support
+AC_MSG_CHECKING(whether to support NetBEUI)
+AC_ARG_WITH(netbeui,
+[  --with-netbeui     Include experimental netbeui support
+  --without-netbeui  Don't include experimental netbeui support (default)],
+[ case "$withval" in
+  yes)
+    AC_MSG_RESULT(yes)
+    AC_DEFINE(WITH_NETBEUI)
+    ;;
+  *)
+    AC_MSG_RESULT(no)
+    ;;
+  esac ],
+  AC_MSG_RESULT(no)
+)
+
+#################################################
 # check for experimental disk-quotas support
 QUOTAOBJS=noquotas.o
 
diff -uNr samba-2.0.6/source/include/config.h.in samba-2.0.6.netbeui/source/include/config.h.in
--- samba-2.0.6/source/include/config.h.in	Thu Nov 11 00:36:00 1999
+++ samba-2.0.6.netbeui/source/include/config.h.in	Tue Jul 17 15:29:54 2001
@@ -139,6 +139,7 @@
 #undef HAVE_SETRESUID_DECL
 #undef HAVE_SETRESUID
 #undef WITH_NETATALK
+#undef WITH_NETBEUI
 #undef HAVE_INO64_T
 #undef HAVE_STRUCT_FLOCK64
 #undef SIZEOF_INO_T
diff -uNr samba-2.0.6/source/include/includes.h samba-2.0.6.netbeui/source/include/includes.h
--- samba-2.0.6/source/include/includes.h	Thu Nov 11 00:36:00 1999
+++ samba-2.0.6.netbeui/source/include/includes.h	Sun Sep 16 10:40:19 2001
@@ -275,6 +275,10 @@
 #include <net/if.h>
 #endif
 
+#ifdef WITH_NETBEUI
+#include <linux/types.h>
+#include <linux/af_netb.h>
+#endif
 
 #ifdef HAVE_SYS_MOUNT_H
 #include <sys/mount.h>
@@ -857,12 +861,6 @@
 #define MSG_WAITALL 0
 #endif
 
-/* default socket options. Dave Miller thinks we should default to TCP_NODELAY
-   given the socket IO pattern that Samba uses */
-#ifdef TCP_NODELAY
-#define DEFAULT_SOCKET_OPTIONS "TCP_NODELAY"
-#else
 #define DEFAULT_SOCKET_OPTIONS ""
-#endif
 
 #endif /* _INCLUDES_H */
diff -uNr samba-2.0.6/source/include/nameserv.h samba-2.0.6.netbeui/source/include/nameserv.h
--- samba-2.0.6/source/include/nameserv.h	Fri Feb 26 21:07:06 1999
+++ samba-2.0.6.netbeui/source/include/nameserv.h	Tue Aug 28 01:36:22 2001
@@ -30,6 +30,13 @@
 
 #define MAX_DGRAM_SIZE (576) /* tcp/ip datagram limit is 576 bytes */
 #define MIN_DGRAM_SIZE 12
+#define TCP 0
+#define NETBEUI 1
+#define MAX_NETBEUI_DGRAM_SIZE  100
+#define MAX_NAME_IPS 255
+#define NETBEUI_SUBNET 0xC8;
+#define NETBEUI_NMASK 0xFFFFFF;
+ 
 
 /*********************************************************
  Types of reply packet.
@@ -142,7 +149,8 @@
 enum name_source {LMHOSTS_NAME, REGISTER_NAME, SELF_NAME, DNS_NAME, 
                   DNSFAIL_NAME, PERMANENT_NAME, WINS_PROXY_NAME};
 enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3};
-enum packet_type {NMB_PACKET, DGRAM_PACKET};
+enum packet_type {NMB_PACKET, DGRAM_PACKET, NETBEUI_PACKET};
+
 
 enum master_state
 {
@@ -191,6 +199,24 @@
   struct nmb_data       data;    /* The netbios data. */
   };
 
+#ifdef WITH_NETBEUI
+/* for netbeui layer only */
+struct netbeui_name {
+   union {
+      struct {
+         char bname[15];
+         unsigned char name_type;
+      } nb_name;
+      char name[16];
+   } netb_name;
+};
+
+struct name_ip {
+   unsigned char name[NETBEUI_NAME_LEN + 1];
+   struct in_addr ip;
+};
+#endif /* WITH_NETBEUI */
+
 /* Browser cache for synchronising browse lists. */
 struct browse_cache_record
   {
@@ -485,6 +511,11 @@
   struct packet_struct *prev;
   BOOL locked;
   struct in_addr ip;
+#ifdef WITH_NETBEUI
+  unsigned char name[NETBEUI_NAME_LEN];
+  BOOL unique;
+  int name_type;
+#endif /* WITH_NETBEUI */
   int port;
   int fd;
   time_t timestamp;
diff -uNr samba-2.0.6/source/include/smb.h samba-2.0.6.netbeui/source/include/smb.h
--- samba-2.0.6/source/include/smb.h	Thu Nov 11 00:36:01 1999
+++ samba-2.0.6.netbeui/source/include/smb.h	Tue Jul 17 15:44:51 2001
@@ -27,6 +27,14 @@
 #define BUFFER_SIZE (0xFFFF)
 #define SAFETY_MARGIN 1024
 
+#define TCPIP   0
+#define NETBEUI 1
+
+extern (*send_smb_func)(int fd, char *buffer);
+extern (*receive_smb_func)(int fd, char *buffer, unsigned int timeout);
+#define receive_smb(fd, buffer, timeout) ((*receive_smb_func)(fd, buffer, timeout))
+#define send_smb(fd, buffer) ((*send_smb_func)(fd, buffer))
+
 #define NMB_PORT 137
 #define DGRAM_PORT 138
 #define SMB_PORT 139
@@ -941,6 +949,9 @@
 
 /* the basic packet size, assuming no words or bytes */
 #define smb_size 39
+#ifdef WITH_NETBEUI
+#define netbeui_smb_size 35
+#endif /* WITH_NETBEUI */
 
 /* offsets into message for common items */
 #define smb_com 8
diff -uNr samba-2.0.6/source/lib/interface.c samba-2.0.6.netbeui/source/lib/interface.c
--- samba-2.0.6/source/lib/interface.c	Wed Oct 13 03:26:48 1999
+++ samba-2.0.6.netbeui/source/lib/interface.c	Tue Jul 17 15:42:01 2001
@@ -27,6 +27,7 @@
 static int total_probed;
 
 extern int DEBUGLEVEL;
+extern int Client_protocol;
 
 struct in_addr ipzero;
 struct in_addr allones_ip;
@@ -86,6 +87,20 @@
 }
 
 
+/****************************************************************************
+load a list of network interfaces
+****************************************************************************/
+#ifdef WITH_NETBEUI
+static void make_netbeui_interface(struct interface **interfaces)
+{
+  *interfaces = (struct interface *)malloc(sizeof(struct interface));
+  (*interfaces)->ip.s_addr = NETBEUI_SUBNET; 
+  (*interfaces)->nmask.s_addr = NETBEUI_NMASK; 
+  (*interfaces)->bcast.s_addr =  (*interfaces)->ip.s_addr | ~NETBEUI_NMASK; 
+  (*interfaces)->next = NULL; 
+}
+#endif
+
 
 /****************************************************************************
 interpret a single element from a interfaces= config line 
@@ -171,56 +186,62 @@
 	int i;
 	struct iface_struct ifaces[MAX_INTERFACES];
 
-	ptr = lp_interfaces();
-
-	ipzero = *interpret_addr2("0.0.0.0");
-	allones_ip = *interpret_addr2("255.255.255.255");
-	loopback_ip = *interpret_addr2("127.0.0.1");
+	if (Client_protocol == TCPIP) {
+		ptr = lp_interfaces();
 
-	if (probed_ifaces) {
-		free(probed_ifaces);
-		probed_ifaces = NULL;
-	}
+		ipzero = *interpret_addr2("0.0.0.0");
+		allones_ip = *interpret_addr2("255.255.255.255");
+		loopback_ip = *interpret_addr2("127.0.0.1");
+
+		if (probed_ifaces) {
+			free(probed_ifaces);
+			probed_ifaces = NULL;
+		}
 
-	/* dump the current interfaces if any */
-	while (local_interfaces) {
-		struct interface *iface = local_interfaces;
-		DLIST_REMOVE(local_interfaces, local_interfaces);
-		ZERO_STRUCTPN(iface);
-		free(iface);
-	}
+		/* dump the current interfaces if any */
+		while (local_interfaces) {
+			struct interface *iface = local_interfaces;
+			DLIST_REMOVE(local_interfaces, local_interfaces);
+			ZERO_STRUCTPN(iface);
+			free(iface);
+		}
 
-	/* probe the kernel for interfaces */
-	total_probed = get_interfaces(ifaces, MAX_INTERFACES);
+		/* probe the kernel for interfaces */
+		total_probed = get_interfaces(ifaces, MAX_INTERFACES);
 
-	if (total_probed > 0) {
-		probed_ifaces = memdup(ifaces, sizeof(ifaces[0])*total_probed);
-	}
-
-	/* if we don't have a interfaces line then use all broadcast capable 
-	   interfaces except loopback */
-	if (!ptr || !*ptr) {
-		if (total_probed <= 0) {
-			DEBUG(0,("ERROR: Could not determine network interfaces, you must use a interfaces config line\n"));
-			exit(1);
+		if (total_probed > 0) {
+			probed_ifaces = memdup(ifaces, sizeof(ifaces[0])*total_probed);
 		}
-		for (i=0;i<total_probed;i++) {
-			if (probed_ifaces[i].netmask.s_addr != allones_ip.s_addr &&
-			    probed_ifaces[i].ip.s_addr != loopback_ip.s_addr) {
-				add_interface(probed_ifaces[i].ip, 
-					      probed_ifaces[i].netmask);
+
+		/* if we don't have a interfaces line then use all broadcast capable 
+		   interfaces except loopback */
+		if (!ptr || !*ptr) {
+			if (total_probed <= 0) {
+				DEBUG(0,("ERROR: Could not determine network interfaces, you must use a interfaces config line\n"));
+				exit(1);
+			}
+			for (i=0;i<total_probed;i++) {
+				if (probed_ifaces[i].netmask.s_addr != allones_ip.s_addr &&
+				    probed_ifaces[i].ip.s_addr != loopback_ip.s_addr) {
+					add_interface(probed_ifaces[i].ip, 
+						      probed_ifaces[i].netmask);
+				}
 			}
+			return;
 		}
-		return;
-	}
 
-	while (next_token(&ptr,token,NULL,sizeof(token))) {
-		interpret_interface(token);
-	}
+		while (next_token(&ptr,token,NULL,sizeof(token))) {
+			interpret_interface(token);
+		}
 
-	if (!local_interfaces) {
-		DEBUG(0,("WARNING: no network interfaces found\n"));
+		if (!local_interfaces) {
+			DEBUG(0,("WARNING: no network interfaces found\n"));
+		}
 	}
+#ifdef WITH_NETBEUI
+  	else
+    		make_netbeui_interface(&local_interfaces);
+#endif
 }
 
 
diff -uNr samba-2.0.6/source/lib/util.c samba-2.0.6.netbeui/source/lib/util.c
--- samba-2.0.6/source/lib/util.c	Thu Nov 11 00:36:02 1999
+++ samba-2.0.6.netbeui/source/lib/util.c	Wed Sep 12 23:09:00 2001
@@ -69,6 +69,13 @@
 
 /* the client file descriptor */
 extern int Client;
+int Client_protocol = TCPIP;
+
+#ifdef WITH_NETBEUI
+unsigned char NetBEUI_name[NETBEUI_NAME_LEN + 1] = "SMB_SERVER      ";
+unsigned char lastname[NETBEUI_NAME_LEN + 1];
+#endif /* WITH_NETBEUI */
+
 
 /* this is used by the chaining code */
 int chain_size = 0;
@@ -107,6 +114,34 @@
 static char *filename_dos(char *path,char *buf);
 
 
+#ifdef WITH_NETBEUI
+/*******************************************************************
+Make a NetBEUI name 
+********************************************************************/
+char *make_netbeui_name(char *dname, char *sname, int name_type)
+{
+  struct netbeui_name nm;
+  char n[20];
+
+  memset(nm.netb_name.name, ' ', NETBEUI_NAME_LEN - 1);
+  strncpy(nm.netb_name.nb_name.bname, sname, strlen(sname));
+  nm.netb_name.nb_name.name_type = name_type;
+  strncpy(dname, nm.netb_name.name, NETBEUI_NAME_LEN);
+  strncpy(n, dname, 17);
+  return(dname);
+}
+
+char *take_netbeui_name(char *dname, char *sname)
+{
+  unsigned int i;
+
+  memcpy(dname, sname, NETBEUI_NAME_LEN);
+  for (i = 0; dname[i] != ' ' && i < NETBEUI_NAME_LEN; i++);
+  dname[i] = '\0';
+  return(dname);
+}
+#endif /* WITH_NETBEUI */
+
 
 /****************************************************************************
   find a suitable temporary directory. The result should be copied immediately
@@ -967,6 +1002,11 @@
 
   DEBUG(4,("transfer_file n=%.0f  (head=%d) called\n",(double)n,headlen));
 
+#ifdef WITH_NETBEUI
+  if ((headlen+n) == 0)
+    return ioctl(outfd, SIOCSENDZERO);
+#endif /* WITH_NETBEUI */
+
   if (size == 0) {
     size = lp_readsize();
     size = MAX(size,1024);
@@ -1739,6 +1779,15 @@
 
 	*hostname = 0;
 
+
+  	/* get name in case of NetBEUI */ 
+#ifdef WITH_NETBEUI
+	if (Client_protocol == NETBEUI) {
+	   pstrcpy(my_name, NetBEUI_name);
+	   return True;
+	}
+#endif /* WITH_NETBEUI */
+
 	/* get my host name */
 	if (gethostname(hostname, sizeof(hostname)) == -1) {
 		DEBUG(0,("gethostname failed\n"));
@@ -1766,6 +1815,73 @@
 BOOL ip_equal(struct in_addr ip1,struct in_addr ip2)
 {
 	return ip1.s_addr == ip2.s_addr;
+}
+
+/****************************************************************************
+ allocate and copy a packet structure
+****************************************************************************/
+struct nmb_name *nmb_name_cpy(struct nmb_name *dn, struct nmb_name *sn)
+{
+  pstrcpy(dn->name, sn->name);
+  pstrcpy(dn->scope, sn->scope);
+  dn->name_type = sn->name_type;
+  return(dn);
+}
+  
+
+struct res_rec *get_resrec(struct res_rec *r)
+{
+  if (r) {
+    struct res_rec *rec = (struct res_rec *)malloc(sizeof(*r));
+
+    nmb_name_cpy(&rec->rr_name, &r->rr_name);
+    rec->rr_type = r->rr_type;
+    rec->rr_class = r->rr_class;
+    rec->ttl = r->ttl;
+    rec->rdlength = r->rdlength;
+    memcpy(rec->rdata, r->rdata, MAX_DGRAM_SIZE);
+    return(rec);
+  }
+  return(NULL);
+}
+
+struct packet_struct *get_packet(struct packet_struct *p)
+{
+  struct packet_struct *packet = (struct packet_struct *)malloc(sizeof(*p));
+  struct nmb_packet *nmb = &packet->packet.nmb;
+  struct nmb_packet *snmb = &p->packet.nmb;
+
+  packet->ip = p->ip;
+  packet->packet_type = p->packet_type;
+  packet->timestamp = time(NULL);
+  packet->fd = p->fd;
+
+#ifdef WITH_NETBEUI
+  packet->unique = p->unique;
+  packet->name_type = p->name_type;
+  strncpy(packet->name, p->name, NETBEUI_NAME_LEN + 1);
+#endif /* WITH_NETBEUI */
+  
+  nmb->header.name_trn_id = snmb->header.name_trn_id;  
+  nmb->header.opcode = snmb->header.opcode;
+  nmb->header.response = snmb->header.response;
+  nmb->header.nm_flags.bcast = snmb->header.nm_flags.bcast;
+  nmb->header.nm_flags.recursion_available = snmb->header.nm_flags.recursion_available;
+  nmb->header.nm_flags.recursion_desired = snmb->header.nm_flags.recursion_desired;
+  nmb->header.nm_flags.trunc = snmb->header.nm_flags.trunc;
+  nmb->header.nm_flags.authoritative = snmb->header.nm_flags.authoritative;
+  nmb->header.rcode = snmb->header.rcode;
+  nmb->header.qdcount = snmb->header.qdcount;
+  nmb->header.ancount = snmb->header.ancount;
+  nmb->header.nscount = snmb->header.nscount;
+  nmb->header.arcount = snmb->header.arcount;
+  nmb_name_cpy(&nmb->question.question_name, &snmb->question.question_name);
+  nmb->question.question_type = snmb->question.question_type;
+  nmb->question.question_class = snmb->question.question_class;
+  nmb->answers = (nmb->header.ancount) ? get_resrec(snmb->answers) : NULL;
+  nmb->nsrecs = (nmb->header.nscount) ? get_resrec(snmb->nsrecs) : NULL;
+  nmb->additional = (nmb->header.arcount) ? get_resrec(snmb->additional) : NULL;
+  return(packet);
 }
 
 
diff -uNr samba-2.0.6/source/lib/util_sock.c samba-2.0.6.netbeui/source/lib/util_sock.c
--- samba-2.0.6/source/lib/util_sock.c	Thu Nov 11 00:36:02 1999
+++ samba-2.0.6.netbeui/source/lib/util_sock.c	Wed Sep 12 23:09:42 2001
@@ -20,6 +20,8 @@
 */
 
 #include "includes.h"
+extern BOOL receive_netbeui_smb(int fd,char *buffer,unsigned int timeout);
+extern BOOL send_netbeui_smb(int fd,char *buffer);
 
 #ifdef WITH_SSL
 #include <ssl.h>
@@ -32,6 +34,12 @@
 
 BOOL passive = False;
 
+BOOL send_tcpip_smb(int fd,char *buffer);
+BOOL receive_tcpip_smb(int fd,char *buffer, unsigned int timeout);
+
+BOOL (*receive_smb_func)(int fd, char *buffer, unsigned int timeout)= receive_tcpip_smb;
+BOOL (*send_smb_func)(int fd, char *buffer)= send_tcpip_smb;
+
 /* the client file descriptor */
 int Client = -1;
 
@@ -67,9 +75,6 @@
   {"SO_KEEPALIVE",      SOL_SOCKET,    SO_KEEPALIVE,    0,                 OPT_BOOL},
   {"SO_REUSEADDR",      SOL_SOCKET,    SO_REUSEADDR,    0,                 OPT_BOOL},
   {"SO_BROADCAST",      SOL_SOCKET,    SO_BROADCAST,    0,                 OPT_BOOL},
-#ifdef TCP_NODELAY
-  {"TCP_NODELAY",       IPPROTO_TCP,   TCP_NODELAY,     0,                 OPT_BOOL},
-#endif
 #ifdef IPTOS_LOWDELAY
   {"IPTOS_LOWDELAY",    IPPROTO_IP,    IP_TOS,          IPTOS_LOWDELAY,    OPT_ON},
 #endif
@@ -431,6 +436,8 @@
     }
     if (ret == -1)
     {
+	DEBUG(0,("Call Trace: [<%p>] [<%p>]\n", __builtin_return_address(0),
+                                              __builtin_return_address(1)));
       DEBUG(0,("read_data: read failure for %d. Error = %s\n", (int)(N - total), strerror(errno) ));
       smb_read_error = READ_ERROR;
       return -1;
@@ -629,6 +636,152 @@
   return len;
 }
 
+
+/****************************************************************************
+  Read an smb from a fd on NetBEUI transport
+The timeout is in milli seconds
+****************************************************************************/
+#ifdef WITH_NETBEUI
+
+BOOL chained_commands[0xFF]= {
+};
+
+#define is_chained(command)  (chained_commands[command] == True)
+
+void tag_chained_commands(void)
+{
+  chained_commands[ SMBtconX       ]= True;
+  chained_commands[ SMBlockingX    ]= True;
+  chained_commands[ SMBopenX       ]= True;
+  chained_commands[ SMBreadX       ]= True;
+  chained_commands[ SMBwriteX      ]= True;
+  chained_commands[ SMBsesssetupX  ]= True;
+  chained_commands[ SMBulogoffX    ]= True;
+} 
+
+int receive_chained_netbeui_smb(int fd, char *buffer, int len, 
+				unsigned char command, unsigned short offset)
+{
+  int ret= 0;
+  char *vwv= buffer + offset;
+  unsigned char wct;
+  unsigned short bcc;
+  int count= (offset+3 - len);
+  unsigned char com2;
+  unsigned short off2;
+
+  if (command == 0xFF)
+    return len;
+
+  ret= read_data(fd, vwv, count); 
+  if (ret != count)
+    return -1;
+
+  wct= CVAL(vwv, 0); 
+  if (wct) {
+    count= wct * 2;
+    ret= read_data(fd, vwv+3, count); 
+    if (ret != count)
+      return -1;
+  }
+
+  vwv++;
+  com2= CVAL(vwv, 0);
+  off2= SVAL(vwv, 2);
+  bcc= SVAL(vwv, wct * 2);
+
+  /*     wct      vwv      bcc    buf  */
+  len += (1) + (wct * 2) + (2) + (bcc);
+
+  if (len > BUFFER_SIZE) {
+    DEBUG(0,("Invalid packet length! (%d bytes).\n",len));
+    if (len > BUFFER_SIZE + (SAFETY_MARGIN/2))
+      exit(1);
+  }
+   
+  if (bcc) {
+    ret= read_data(fd, vwv+ (wct * 2) + 2, bcc); 
+    if (ret != bcc)
+      return -1;
+  }
+
+  if (is_chained(command))
+    len= receive_chained_netbeui_smb(fd, buffer, len, com2, off2);
+
+  return len;
+}
+
+
+
+BOOL receive_netbeui_smb(int fd,char *buffer,unsigned int timeout)
+{
+  int len,ret;
+  unsigned char word_count;
+  unsigned short smb_bcc;
+  BOOL ok=False;
+
+  smb_read_error = 0;
+
+  bzero(buffer,smb_size + 100);
+
+  /* Read SMB fixed header 
+     up to smb_wct+ first short is read, if smb_wct is zero then the first shor
+     is fortunately the smb_bcc 
+  */
+  if (timeout > 0)
+    ok = (read_with_timeout(fd,buffer+4, netbeui_smb_size, netbeui_smb_size, timeout) == netbeui_smb_size);
+  else 
+    ok = (read_data(fd,buffer+4, netbeui_smb_size) == netbeui_smb_size);
+
+  if (!ok)
+    return(False);
+
+  word_count = CVAL(buffer, smb_wct);
+  
+  if (word_count)
+     ok= (read_data(fd, buffer+smb_vwv1, word_count*2) == word_count*2);
+
+  if (!ok)
+    return(False);
+  
+  smb_bcc = smb_buflen(buffer);
+  len = smb_size + (word_count*2) + smb_bcc;
+  
+  DEBUG(0,("-->packet length (%d bytes).\n",len));
+
+  if (len > BUFFER_SIZE) {
+    DEBUG(0,("Invalid packet length! (%d bytes).\n",len));
+    if (len > BUFFER_SIZE + (SAFETY_MARGIN/2))
+      exit(1);
+  }
+
+  ret = (smb_bcc == 0) ? 0 : read_data(fd,smb_buf(buffer), smb_bcc);
+  if (ret != smb_bcc) {
+    smb_read_error = READ_ERROR;
+    return False;
+  }
+
+  if (is_chained(CVAL(buffer, smb_com))) {
+     len= receive_chained_netbeui_smb(fd, buffer, len, 
+					CVAL(buffer, smb_vwv0), 
+					SVAL(buffer, smb_vwv1)+4);
+     if (len < 0)
+         return False;
+  }
+
+  /* Simulate NetBIOS Session Data packet */
+  _smb_setlen(buffer, len-4);
+  SCVAL(buffer, 0, 0);     
+
+  DEBUG(10,("got smb length of %d\n",len-4));
+
+  ioctl(fd,SIOCTRIMDATA);
+  
+  return(True);
+}
+#endif /* WITH_NETBEUI */
+
+
 /****************************************************************************
   read an smb from a fd. Note that the buffer *MUST* be of size
   BUFFER_SIZE+SAFETY_MARGIN.
@@ -637,7 +790,7 @@
   receipt of a session keepalive packet.
 ****************************************************************************/
 
-BOOL receive_smb(int fd,char *buffer, unsigned int timeout)
+BOOL receive_tcpip_smb(int fd,char *buffer, unsigned int timeout)
 {
   ssize_t len,ret;
 
@@ -733,10 +886,39 @@
 }
 
 /****************************************************************************
-  send an smb to a fd 
+  send an smb to a fd on NetBEUI transport
 ****************************************************************************/
+#ifdef WITH_NETBEUI
+BOOL send_netbeui_smb(int fd,char *buffer)
+{
+  int len;
+  int ret,nwritten=0;
+  len = smb_len(buffer) + 4;
+
+  nwritten = 4; /* This is to bypass simulated NetBIOS Session Data packet */
+  while (nwritten < len)
+    {
+      ret = write_socket(fd,buffer+nwritten,len - nwritten);
+      if (ret <= 0)
+	{
+	  DEBUG(0,("NETBEUI: Error writing %d bytes to client. %d. Exiting\n",len,ret));
+          close_sockets();
+	  exit(1);
+	}
+      nwritten += ret;
+    }
 
-BOOL send_smb(int fd,char *buffer)
+
+  return True;
+}
+#endif /* WITH_NETBEUI */
+
+
+/****************************************************************************
+  send an smb to a fd on TCPIP
+****************************************************************************/
+
+BOOL send_tcpip_smb(int fd,char *buffer)
 {
   size_t len;
   size_t nwritten=0;
@@ -801,6 +983,96 @@
 }
 
 /****************************************************************************
+open a NETBEUI socket for sending and receiving data
+****************************************************************************/
+#ifdef WITH_NETBEUI
+int open_netbeui_dgram_socket_in(int type, char *nb_name, int dlevel)
+{
+  struct sockaddr_netbeui sock;
+  pstring host_name;
+  char name[NETBEUI_NAME_LEN];
+  int res;
+
+  
+  bzero((char *)&sock,sizeof(sock));
+  sock.snb_family = AF_NETBEUI;
+  sock.snb_addr.name_type = NETBEUI_NAME_GROUP;
+  memset(sock.snb_addr.name, ' ', NETBEUI_NAME_LEN);
+  make_netbeui_name(name, nb_name, 0);
+  memcpy(sock.snb_addr.name, name, NETBEUI_NAME_LEN);
+  res = socket(AF_NETBEUI, type, 0);
+  if (res == -1) 
+    { DEBUG(0,("NETBEUI: (%d)socket failed\n", errno)); return -1; }
+  if (bind(res, (struct sockaddr *) &sock,sizeof(sock)) < 0) {
+     DEBUG(0,("NETBEUI: bind failed on name %s (%s)\n", nb_name, strerror(errno))); 
+     close(res); 
+     return(-1); 
+  }
+
+  DEBUG(3,("NETBEUI: bind succeeded on name %s\n",nb_name));
+  return res;
+}
+
+ 
+/****************************************************************************
+ open a name socket to register and releas names.
+****************************************************************************/
+int open_name_socket(void)
+{
+  int sk;
+
+  if ((sk = socket(AF_NETBEUI, SOCK_NAME, 0)) <= 0) {
+     DEBUG(0, ("NETBEUI: Name socket error.\n"));
+     return -1;
+  }
+  else {
+     DEBUG(1, ("NETBEUI: Name socket opened successfully.\n"));
+     return sk;
+  }
+}     
+
+/****************************************************************************
+open a socket of the specified type, port and address for incoming data
+****************************************************************************/
+int open_netbeui_socket_in(int type, char *nb_name, int dlevel)
+{
+  struct sockaddr_netbeui sock;
+  pstring host_name;
+  int res;
+
+  
+  bzero((char *)&sock,sizeof(sock));
+  sock.snb_family = AF_NETBEUI;
+  sock.snb_addr.name_type = NETBEUI_NAME_UNIQUE;
+  memset(sock.snb_addr.name, ' ', NETBEUI_NAME_LEN);
+  memcpy(sock.snb_addr.name, nb_name, MIN(strlen(nb_name) ,NETBEUI_NAME_LEN));
+  res = socket(AF_NETBEUI, type, 0);
+  if (res == -1) 
+    { DEBUG(0,("NETBEUI: socket failed\n")); return -1; }
+
+  {
+   int one=1;
+   setsockopt(res,SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(one));
+  }
+
+  /* now we've got a socket - we need to bind it */
+  if (bind(res, (struct sockaddr * ) &sock,sizeof(sock)) < 0) 
+    { 
+       DEBUG(dlevel,("NETBEUI: bind failed on name (%s) (%s)\n", nb_name, strerror(errno))); 
+       close(res); 
+
+       if (dlevel > 0)  
+	  return(open_netbeui_socket_in(type, nb_name, dlevel));
+       return(-1); 
+    }
+  DEBUG(3,("NETBEUI: bind succeeded on name %s\n",nb_name));
+
+  return res;
+}
+#endif /* WITH_NETBEUI */
+
+
+/****************************************************************************
 open a socket of the specified type, port and address for incoming data
 ****************************************************************************/
 
@@ -866,6 +1138,74 @@
 
   return res;
 }
+
+/****************************************************************************
+  create an outgoing socket when NetBEUI transport is used
+  **************************************************************************/
+
+#ifdef WITH_NETBEUI
+int open_netbeui_socket_out(int type, char *nb_name ,int timeout)
+{
+  struct sockaddr_netbeui sock_out;
+  int res,ret;
+  int connect_loop = 250; /* 250 milliseconds */
+  int loops = (timeout * 1000) / connect_loop;
+
+  /* create a socket to write to */
+  res = socket(PF_NETBEUI, type, 0);
+  if (res == -1) 
+    { DEBUG(0,("NETBEUI: socket error\n")); return -1; }
+
+  if (type != SOCK_STREAM) return(res);
+  else
+	  printf("SOCK_STREAM\n");
+  
+  bzero((char *)&sock_out,sizeof(sock_out));
+  sock_out.snb_family = AF_NETBEUI;
+  sock_out.snb_addr.name_type = NETBEUI_NAME_UNIQUE; /* unique name */
+  memset(sock_out.snb_addr.name, ' ', NETBEUI_NAME_LEN);
+  memcpy(sock_out.snb_addr.name, nb_name, MIN(strlen(nb_name) ,NETBEUI_NAME_LEN));
+
+  /* set it non-blocking */
+  set_blocking(res,0);
+
+  DEBUG(1,("NETBEUI: Connecting to name %s \n", nb_name));
+  
+  /* and connect it to the destination */
+connect_again:
+  ret = connect(res,(struct sockaddr *)&sock_out,sizeof(sock_out));
+
+  if (ret < 0 && (errno == EINPROGRESS || errno == EALREADY) && loops--) {
+    msleep(connect_loop);
+    goto connect_again;
+  }
+
+  if (ret < 0 && (errno == EINPROGRESS || errno == EALREADY)) {
+      DEBUG(1,("NETBEUI: timeout connecting to %s\n", nb_name));
+      close(res);
+      return -1;
+  }
+
+#ifdef EISCONN
+  if (ret < 0 && errno == EISCONN) {
+    errno = 0;
+    ret = 0;
+  }
+#endif
+
+  if (ret < 0) {
+    DEBUG(1,("NETBEUI: error connecting to name %s (%s)\n",
+	     nb_name ,strerror(errno)));
+    return -1;
+  }
+
+  /* set it blocking again */
+  set_blocking(res,1);
+
+  return res;
+}
+#endif /* WITH_NETBEUI */
+
 
 /****************************************************************************
   create an outgoing socket. timeout is in milliseconds.
diff -uNr samba-2.0.6/source/libsmb/clientgen.c samba-2.0.6.netbeui/source/libsmb/clientgen.c
--- samba-2.0.6/source/libsmb/clientgen.c	Thu Nov 11 00:36:03 1999
+++ samba-2.0.6.netbeui/source/libsmb/clientgen.c	Tue Jul 17 15:44:24 2001
@@ -28,6 +28,7 @@
 extern int DEBUGLEVEL;
 extern pstring user_socket_options;
 extern pstring scope;
+extern int Client_protocol;
 
 static void cli_process_oplock(struct cli_state *cli);
 
@@ -78,6 +79,11 @@
 
 	len = smb_len(cli->outbuf) + 4;
 
+#ifdef WITH_NETBEUI
+	if (Client_protocol == NETBEUI)
+		nwritten=4;
+#endif /* WITH_NETBEUI */
+
 	while (nwritten < len) {
 		ret = write_socket(cli->fd,cli->outbuf+nwritten,len - nwritten);
 		if (ret <= 0 && errno == EPIPE && !reestablished) {
@@ -2507,6 +2513,12 @@
 	int len = 4;
 	/* send a session request (RFC 1002) */
 
+#ifdef WITH_NETBEUI
+	/* SMB over NetBEUI relies upon NetBEUI sessions started before */
+	if (Client_protocol == NETBEUI)
+	   return True;
+#endif /* WITH_NETBEUI */
+
 	memcpy(&(cli->calling), calling, sizeof(*calling));
 	memcpy(&(cli->called ), called , sizeof(*called ));
   
@@ -2546,12 +2558,19 @@
 		int16 port;
 		};
 		*/
-		int port = (CVAL(cli->inbuf,8)<<8)+CVAL(cli->inbuf,9);
-		/* SESSION RETARGET */
-		putip((char *)&cli->dest_ip,cli->inbuf+4);
+		if (Client_protocol == TCPIP) {
+			int port = (CVAL(cli->inbuf,8)<<8)+CVAL(cli->inbuf,9);
+			/* SESSION RETARGET */
+			putip((char *)&cli->dest_ip,cli->inbuf+4);
+
+			close_sockets();
+			cli->fd = open_socket_out(SOCK_STREAM, &cli->dest_ip, port, LONG_CONNECT_TIMEOUT);
+		}
+#ifdef WITH_NETBEUI
+		else
+			cli->fd = open_netbeui_socket_out(SOCK_STREAM, cli->desthost, SHORT_CONNECT_TIMEOUT);
+#endif /* WITH_NETBEUI */
 
-		close_sockets();
-		cli->fd = open_socket_out(SOCK_STREAM, &cli->dest_ip, port, LONG_CONNECT_TIMEOUT);
 		if (cli->fd == -1)
 			return False;
 
@@ -2586,27 +2605,45 @@
 ****************************************************************************/
 BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip)
 {
+	extern int Client_protocol;
 	extern struct in_addr ipzero;
+#ifdef WITH_NETBEUI
+  	extern char NetBEUI_name[];
+#endif /* WITH_NETBEUI */
+  
 
 	fstrcpy(cli->desthost, host);
-	
-	if (!ip || ip_equal(*ip, ipzero)) {
-                if (!resolve_name( cli->desthost, &cli->dest_ip, 0x20)) {
-                        return False;
-                }
-		if (ip) *ip = cli->dest_ip;
-	} else {
-		cli->dest_ip = *ip;
-	}
+	if (Client_protocol == TCPIP) {
+		
+		if (!ip || ip_equal(*ip, ipzero)) {
+			if (!resolve_name( cli->desthost, &cli->dest_ip, 0x20)) {
+				return False;
+			}
+			if (ip) *ip = cli->dest_ip;
+		} else {
+			cli->dest_ip = *ip;
+		}
+
+		if (cli->port == 0) cli->port = 139;  /* Set to default */
 
-        if (cli->port == 0) cli->port = 139;  /* Set to default */
+		cli->fd = open_socket_out(SOCK_STREAM, &cli->dest_ip, 
+					  cli->port, cli->timeout);
+	}
+#ifdef WITH_NETBEUI
+    	else if (Client_protocol == NETBEUI) {
+	       if (strcmp(cli->desthost, NetBEUI_name) == 0) {
+		 DEBUG(1, ("Password server loop - disabling server %s", cli->desthost)); 
+		 return False;
+	       }
+	       cli->fd = open_netbeui_socket_out(SOCK_STREAM, cli->desthost, cli->timeout);
+    	}
+#endif /* WITH_NETBEUI */
 
-	cli->fd = open_socket_out(SOCK_STREAM, &cli->dest_ip, 
-				  cli->port, cli->timeout);
 	if (cli->fd == -1)
 		return False;
 
-	set_socket_options(cli->fd,user_socket_options);
+	if (Client_protocol == TCPIP) 
+		set_socket_options(cli->fd,user_socket_options);
 
 	return True;
 }
diff -uNr samba-2.0.6/source/libsmb/namequery.c samba-2.0.6.netbeui/source/libsmb/namequery.c
--- samba-2.0.6/source/libsmb/namequery.c	Wed Oct 13 03:26:50 1999
+++ samba-2.0.6.netbeui/source/libsmb/namequery.c	Wed Sep 12 23:04:37 2001
@@ -129,6 +129,7 @@
   p.port = NMB_PORT;
   p.fd = fd;
   p.timestamp = time(NULL);
+  memcpy(p.name, nmb->question.question_name.name, NETBEUI_NAME_LEN);
   p.packet_type = NMB_PACKET;
 
   GetTimeOfDay(&tval);
@@ -251,6 +252,7 @@
   p.port = NMB_PORT;
   p.fd = fd;
   p.timestamp = time(NULL);
+  memcpy(p.name, nmb->question.question_name.name, NETBEUI_NAME_LEN);
   p.packet_type = NMB_PACKET;
 
   GetTimeOfDay(&tval);
@@ -901,6 +903,7 @@
   p.port = DGRAM_PORT;
   p.fd = sock;
   p.timestamp = time(NULL);
+  memcpy(p.name, &dgram->source_name, NETBEUI_NAME_LEN);
   p.packet_type = DGRAM_PACKET;
 
   GetTimeOfDay(&tval);
diff -uNr samba-2.0.6/source/libsmb/nmblib.c samba-2.0.6.netbeui/source/libsmb/nmblib.c
--- samba-2.0.6/source/libsmb/nmblib.c	Wed Oct 13 03:26:50 1999
+++ samba-2.0.6.netbeui/source/libsmb/nmblib.c	Wed Sep 12 23:05:30 2001
@@ -24,6 +24,17 @@
 
 extern int DEBUGLEVEL;
 
+extern int Client_protocol;
+extern struct packet_struct *get_packet();
+extern struct res_rec *get_resrec();
+
+#ifdef WITH_NETBEUI
+extern char lastname[];
+int ClientNAME = -1;
+
+static struct name_ip *ntab[MAX_NAME_IPS] = {0};
+#endif /* WITH_NETBEUI */
+
 int num_good_sends = 0;
 int num_good_receives = 0;
 
@@ -391,6 +402,172 @@
 }
 
 /*******************************************************************
+  create a pseudo-ip for netbeui name
+ ******************************************************************/
+extern struct in_addr lastip;
+
+#ifdef WITH_NETBEUI
+struct in_addr make_new_ip(char *name)
+{
+  int i;
+  char tmp[NETBEUI_NAME_LEN + 1];
+
+  memcpy(tmp, name, NETBEUI_NAME_LEN);
+  tmp[NETBEUI_NAME_LEN] = '\0';
+  name = tmp;
+
+  for (i = 0; ntab[i] && i < MAX_NAME_IPS; i++); 
+  if (!ntab[i]) {
+     ntab[i] = (struct name_ip *)malloc(sizeof(struct name_ip));
+     if (ntab[i]) {
+        memcpy(ntab[i]->name, name, NETBEUI_NAME_LEN); 
+	ntab[i]->name[NETBEUI_NAME_LEN] = '\0';
+        if (!i) {
+           ntab[i]->ip.s_addr = NETBEUI_SUBNET; 
+           ntab[i]->ip.s_addr = ntab[i]->ip.s_addr | ~NETBEUI_NMASK;
+        }
+        else 
+            ntab[i]->ip.s_addr = ntab[i-1]->ip.s_addr + 0x1000000; 
+
+        DEBUG(2,("NETBEUI: name <%s> added with pseudo-ip addr <%s>\n",
+              ntab[i]->name, inet_ntoa(ntab[i]->ip)));
+
+        ntab[i+1] = NULL;
+     }
+  return(ntab[i]->ip);
+  } 
+}
+
+/*******************************************************************
+  lookup the name of pseudo-ip
+ ******************************************************************/
+char *lookup_name(struct in_addr ip)
+{
+  int i;
+
+  for (i = 0; ntab[i] && i < MAX_NAME_IPS; i++) {
+      if (ntab[i]->ip.s_addr == ip.s_addr)
+         break;
+  }
+  if (ntab[i]) 
+      DEBUG(2,("NETBEUI: pseudo-ip addr <%s> found as <%s> at offset %d\n",
+         inet_ntoa(ntab[i]->ip), ntab[i]->name, i));
+
+  return((ntab[i]) ? ntab[i]->name : NULL);
+}
+
+/*******************************************************************
+  lookup the pseudo-ip of a name
+ ******************************************************************/
+struct in_addr lookup_ip(char *name)
+{
+  int i;
+  extern fstring global_myworkgroup;
+
+
+  for (i = 0; ntab[i] && i < MAX_NAME_IPS; i++) {
+      if (!strcmp(ntab[i]->name, name))
+         break;
+  }
+  if (ntab[i]) 
+       DEBUG(2,("NETBEUI: name <%s> found with pseudo_ip addr <%s> at offset %d\n",
+         ntab[i]->name, inet_ntoa(ntab[i]->ip), i));  
+
+{
+  struct in_addr in = ntab[i] ? ntab[i]->ip : make_new_ip(name);
+
+  DEBUG(0,("4.lookup_ip: name=%.*s\n", NETBEUI_NAME_LEN, name));
+
+  return in;
+}
+}
+
+/*******************************************************************
+   parse a netbeui dgram packet. Return False if the packet can't be 
+  parsed or is invalid for some reason, True otherwise 
+ ******************************************************************/
+static BOOL parse_netbeui_dgram(char *inbuf, int length, struct dgram_packet *dgram, char *dstname)
+{
+  char n[NETBEUI_NAME_LEN];
+  
+  memcpy(dgram->data,inbuf,length);
+  dgram->datasize = length;
+  dgram->header.msg_type = 0x10;
+  dgram->header.flags.node_type = 0;
+  dgram->header.flags.more = True;
+  dgram->header.flags.first = True;
+  dgram->header.dgm_id = 1;
+  dgram->header.source_port = DGRAM_PORT;
+  dgram->header.packet_offset = 0;
+//  make_nmb_name(&dgram->source_name, lastname, (int )lastname[15], scope); 
+  make_nmb_name(&dgram->source_name, lastname, (int )lastname[15], 0); 
+  make_nmb_name(&dgram->dest_name, dstname, (int )dstname[15], 0); 
+  
+  /* create a dummy source ip address for incoming data */
+  dgram->header.source_ip = lookup_ip(lastname);
+  dgram->header.dgm_length = 0;
+
+  return(True);
+}
+
+
+/****************************************************************************
+read from a netbeui socket
+****************************************************************************/
+int read_netbeui_socket(int fd,char *buf,int len, char * dstname)
+{
+  int ret;
+  struct sockaddr_netbeui sock;
+  struct msghdr mgh;
+  char name[NETBEUI_NAME_LEN];
+  struct iovec iov;
+  int socklen;
+ 
+  socklen = sizeof(sock);
+  bzero((char *)&sock,socklen);
+  bzero((char *)&mgh,sizeof(struct msghdr));
+  iov.iov_base = buf;
+  iov.iov_len = len;
+  mgh.msg_name = &sock;
+  mgh.msg_namelen = socklen;
+  mgh.msg_iov = &iov;
+  mgh.msg_iovlen = 1;
+  mgh.msg_control = name;
+  mgh.msg_controllen = NETBEUI_NAME_LEN;
+  ret = recvmsg(fd, &mgh, 0);
+  if (ret <= 0) {
+    DEBUG(2,("NETBEUI: read socket failed. ERRNO=%d\n",errno));
+    return(0);
+  }
+
+  take_netbeui_name(dstname, mgh.msg_control);
+  take_netbeui_name(lastname, sock.snb_addr.name);
+  lastip = lookup_ip(lastname);
+  return(ret);
+}
+
+/****************************************************************************
+ connect netbeui socket to peer name
+****************************************************************************/
+int connect_netbeui_socket(int fd, char * name)
+{
+  int ret;
+  struct sockaddr_netbeui sock;
+  int socklen;
+ 
+  socklen = sizeof(sock);
+  bzero((char *)&sock,socklen); 
+  pstrcpy(sock.snb_addr.name, name);
+  sock.snb_family = AF_NETBEUI;
+  ret = connect(fd, (struct sockaddr *)&sock, socklen);
+  if (ret < 0) 
+    DEBUG(2,("NETBEUI: socket connection to %s failed. ERRNO=%d\n", name, errno));
+  return(ret); 
+}
+#endif /* WITH_NETBEUI */
+
+
+/*******************************************************************
   put a compressed name pointer record into a packet
   ******************************************************************/
 static int put_compressed_name_ptr(unsigned char *buf,int offset,struct res_rec *rec,int ptr_offset)
@@ -686,11 +863,21 @@
   extern struct in_addr lastip;
   extern int lastport;
   struct packet_struct *packet;
+#ifdef WITH_NETBEUI
+  char dname[NETBEUI_NAME_LEN + 1];
+#endif /* WITH_NETBEUI */
   char buf[MAX_DGRAM_SIZE];
   int length;
   BOOL ok=False;
   
-  length = read_udp_socket(fd,buf,sizeof(buf));
+  if (Client_protocol == TCPIP)
+     length = read_udp_socket(fd,buf,sizeof(buf));
+#ifdef WITH_NETBEUI
+  else
+      length = read_netbeui_socket(fd,buf,sizeof(buf), dname);
+#endif /* WITH_NETBEUI */
+ 
+
   if (length < MIN_DGRAM_SIZE) return(NULL);
 
   packet = (struct packet_struct *)malloc(sizeof(*packet));
@@ -713,6 +900,13 @@
     case DGRAM_PACKET:
       ok = parse_dgram(buf,length,&packet->packet.dgram);
       break;
+
+#ifdef WITH_NETBEUI
+    case NETBEUI_PACKET:
+      ok = parse_netbeui_dgram(buf,length,&packet->packet.dgram,dname);
+      break;
+#endif /* WITH_NETBEUI */
+
     }
   if (!ok) {
     DEBUG(10,("read_packet: discarding packet id = %d\n", 
@@ -723,12 +917,157 @@
 
   num_good_receives++;
 
-  DEBUG(5,("Received a packet of len %d from (%s) port %d\n",
-	    length, inet_ntoa(packet->ip), packet->port ) );
+  if (Client_protocol == TCPIP)
+	  DEBUG(5,("Received a packet of len %d from (%s) port %d\n",
+		    length, inet_ntoa(packet->ip), packet->port ) );
+#ifdef WITH_NETBEUI
+  else
+     DEBUG(5,("NETBEUI: %s received a NETBEUI packet of len %d from (%s)\n",
+	   timestring(False),length,lastname));
+#endif /* WITH_NETBEUI */ 
 
   return(packet);
 }
 					 
+/*******************************************************************
+  send a NETBEUI packet 
+  ******************************************************************/
+#ifdef WITH_NETBEUI
+static BOOL send_netbeui(int fd,char *buf,int len, struct packet_struct *p)
+{
+  BOOL ret;
+  struct sockaddr_netbeui sock_out;
+  char dname[NETBEUI_NAME_LEN];
+  int i;
+
+  /* set the address and port */
+  bzero((char *)&sock_out,sizeof(sock_out));
+  sock_out.snb_addr.name_type = (p->unique) ? NETBEUI_NAME_UNIQUE : NETBEUI_NAME_GROUP;
+  memset(sock_out.snb_addr.name, ' ', NETBEUI_NAME_LEN);
+  make_netbeui_name(dname, p->name, p->name_type);
+  memcpy(sock_out.snb_addr.name, dname, NETBEUI_NAME_LEN);
+  sock_out.snb_family = AF_NETBEUI;
+  
+  DEBUG(5,("NETBEUI: %s sending a packet of len %d to <%s> %s(%x)\n",
+	   timestring(False),len, ((p->unique) ? "UNIQUE":"GROUP"), p->name, p->name_type));
+	
+  ret = (sendto(fd,buf,len,0,(struct sockaddr *)&sock_out,
+		sizeof(sock_out)) >= 0);
+
+  if (!ret) {
+    DEBUG(0,("Packet send failed to %s(%x) ERRNO=%s, fd=%d\n",
+	     p->name, p->name_type, strerror(errno), fd));
+    DEBUG(0,("Call Trace: [<%p>] [<%p> <%p> <%p> <%p>]\n",
+		__builtin_return_address(0),
+		__builtin_return_address(1),
+		__builtin_return_address(2),
+		__builtin_return_address(3),
+		__builtin_return_address(4)));
+  }
+  if (ret)
+    num_good_sends++;
+
+  return(ret);
+}
+
+/*******************************************************************
+  create a netbios response name packet for that request
+  ******************************************************************/
+static BOOL send_netbeui_nmb(struct packet_struct *);
+
+static int create_nmb_response_packet(struct packet_struct *p, BOOL resp)
+{
+  struct res_rec ans;
+  struct packet_struct *packet = get_packet(p);
+  struct nmb_packet *nmb = &packet->packet.nmb;
+  switch(nmb->header.opcode) {
+        
+        case 5:  {  /* NAME_REG RESPONSE */
+                nmb->header.response = True;
+                nmb->header.nm_flags.trunc = True;
+                nmb->header.nm_flags.bcast = True;
+                nmb->header.rcode = resp ? 0 : 0x7;
+                nmb->header.qdcount = 0;
+                nmb->header.ancount = 1;
+                nmb->header.arcount = 0;
+                nmb->answers = nmb->additional;
+                nmb->additional = NULL;
+                break;
+        }
+        case 0:  if (!resp) {  /* NAME_QUERY POSITIVE RESPONSE*/
+                   nmb->header.response = True;
+                   nmb->header.nm_flags.trunc = True;
+                   nmb->header.nm_flags.bcast = True;
+                   nmb->header.rcode = 0;
+                   nmb->header.qdcount = 0;
+                   nmb->header.ancount = 1;
+                   nmb->header.arcount = 0;
+                   nmb->question.question_type = 0;
+                   ans.rr_name = nmb->question.question_name;  
+                   ans.rr_type = NMB_QUERY;
+                   ans.rr_class = 1;
+                   ans.ttl = lp_max_ttl();
+                   ans.rdlength = (!resp) ? 1 : 0;
+                   ans.rdata[0] = 0;
+                   putip(&ans.rdata[2], (char *)iface_ip(p->ip));
+                   nmb->answers = get_resrec(&ans);
+                   break;
+               }
+               else { /* NAME_QUERY NEGATIVE RESPONSE */
+                  nmb->header.opcode = 1; /* release the name */
+                  send_netbeui_nmb(packet);
+		  free_packet(packet);
+                  return(0);
+               }
+  }
+//  queue_packet(packet);
+  return(0);
+}
+
+
+/*******************************************************************
+  process a name packet in NETBEUI protocol 
+  ******************************************************************/
+static BOOL send_netbeui_nmb(struct packet_struct *p)
+{
+  struct nmb_packet *nmb = &p->packet.nmb;
+  char name[NETBEUI_NAME_LEN];
+  BOOL res = True;
+  struct sockaddr_netbeui sock;
+  int cmd;
+
+  memset((char *)&sock, ' ', sizeof(sock));
+  make_netbeui_name(name, p->name, p->name_type);
+  memcpy((char *)&sock.snb_addr.name, name, NETBEUI_NAME_LEN);
+
+  cmd = (nmb->header.opcode == 5 ||
+         nmb->header.opcode == 0 ||
+         nmb->header.opcode == 9) ? NMB_REG : NMB_REL; 
+         /* create a nmb_reg request if nmb_reg or nmb_query */
+
+  if (cmd == NMB_REG)
+     sock.snb_addr.name_type = (p->unique) ? NETBEUI_NAME_UNIQUE : NETBEUI_NAME_GROUP;
+  else
+    if (cmd == NMB_REL)
+       sock.snb_addr.name_type = 0xFF;
+
+  sock.snb_family = PF_NETBEUI;
+  if (bind(ClientNAME, (struct sockaddr *)&sock, sizeof(sock)) != 0) {
+     DEBUG(0, ("NETBEUI: name %s failed for <%s(%x)>\n",
+           ((cmd == NMB_REL) ? "release" : "registration"), p->name, p->name_type));
+     res = False;
+     }
+  else
+      DEBUG(2, ("NETBEUI: name %s succeeded for <%s(%x)>\n",
+            ((cmd == NMB_REL) ? "release" : "registration"), p->name, p->name_type));
+
+  if ((nmb->header.opcode != 9) && (cmd != NMB_REL))
+     create_nmb_response_packet(p, res); 
+                    /* make a dummy response for nmb_packets */
+  return(True);
+}
+#endif /* WITH_NETBEUI */
+
 
 /*******************************************************************
   send a udp packet on a already open socket
@@ -899,6 +1238,20 @@
   return(offset);
 }
 
+/*******************************************************************
+  build a netbuei datagram ready for sending
+  ******************************************************************/
+#ifdef WITH_NETBEUI
+static int build_netbeui_dgram(char *buf, struct packet_struct *p)
+{
+  struct dgram_packet *dgram = &p->packet.dgram;
+  unsigned char *ubuf = (unsigned char *) buf;
+
+  memcpy(ubuf, dgram->data, dgram->datasize);
+  return(dgram->datasize);
+}
+#endif /* WITH_NETBEUI */
+
 
 /*******************************************************************
   send a packet_struct
@@ -920,11 +1273,30 @@
     case DGRAM_PACKET:
       len = build_dgram(buf,p);
       break;
+
+#ifdef WITH_NETBEUI
+    case NETBEUI_PACKET:
+      len = build_netbeui_dgram(buf,p);
+      break;
+#endif /* WITH_NETBEUI */
+
     }
 
   if (!len) return(False);
 
-  return(send_udp(p->fd,buf,len,p->ip,p->port));
+  if (Client_protocol == TCPIP)
+  	return(send_udp(p->fd,buf,len,p->ip,p->port));
+
+#ifdef WITH_NETBEUI
+  else
+       switch (p->packet_type) {
+              case NETBEUI_PACKET:
+                   return(send_netbeui(p->fd,buf,len,p));
+              case NMB_PACKET:
+                   return(send_netbeui_nmb(p));
+       }
+#endif /* WITH_NETBEUI */
+
 }
 
 /****************************************************************************
diff -uNr samba-2.0.6/source/nmbd/nmbd.c samba-2.0.6.netbeui/source/nmbd/nmbd.c
--- samba-2.0.6/source/nmbd/nmbd.c	Wed Oct 13 03:26:51 1999
+++ samba-2.0.6.netbeui/source/nmbd/nmbd.c	Wed Aug  1 23:00:17 2001
@@ -42,6 +42,9 @@
 extern pstring global_myname;
 extern fstring global_myworkgroup;
 extern char **my_netbios_names;
+extern int Client_protocol;
+extern int ClientNAME;
+ 
 
 extern BOOL global_in_nmbd;
 
@@ -57,6 +60,8 @@
 
 extern struct in_addr ipzero;
 
+extern int Client_protocol;
+
 /**************************************************************************** **
   catch a sigterm
  **************************************************************************** */
@@ -474,10 +479,42 @@
 } /* process */
 
 
+/****************************************************************************
+  open netbeui socket communication
+****************************************************************************/
+#ifdef WITH_NETBEUI 
+static BOOL open_netbeui_sockets(BOOL isdaemon)
+{
+  struct hostent *hp;
+  int one = 1;
+
+  printf(__FUNCTION__ ":begin global_myname=\"%s\"\n", global_myname);
+ 
+  if (isdaemon) { 
+     printf(__FUNCTION__ ": global_myname=\"%s\"\n", global_myname);
+     ClientDGRAM = open_netbeui_dgram_socket_in(SOCK_DGRAM, global_myname, 0); 
+     ClientNAME = open_name_socket();
+  }
+
+  if (ClientDGRAM < 0 || ClientNAME < 0) 
+     return False;
+
+//  signal(SIGPIPE, SIGNAL_CAST sig_pipe);
+
+  setsockopt(ClientDGRAM, SOL_SOCKET, SO_BROADCAST, (char *)&one, sizeof(one));
+  if (connect_netbeui_socket(ClientDGRAM, "*") < 0)
+     return False;
+
+  DEBUG(3,("NETBEUI: Sockets opened.\n"));
+  return True;
+}
+#endif /* WITH_NETBEUI */
+
+
 /**************************************************************************** **
- open the socket communication
+ open tcp socket communication
  **************************************************************************** */
-static BOOL open_sockets(BOOL isdaemon, int port)
+static BOOL open_tcpip_sockets(BOOL isdaemon, int port)
 {
   /* The sockets opened here will be used to receive broadcast
      packets *only*. Interface specific sockets are opened in
@@ -507,6 +544,26 @@
 } /* open_sockets */
 
 
+/****************************************************************************
+  open the socket communication
+****************************************************************************/
+static BOOL open_sockets(BOOL isdaemon, int port)
+{	
+  if (Client_protocol == TCPIP) {
+        DEBUG(3,("Opening sockets %d\n", port));
+	return open_tcpip_sockets(isdaemon, port);
+  }
+#ifdef WITH_NETBEUI
+  else
+	if (Client_protocol == NETBEUI) {
+                DEBUG(3,("NETBEUI: Opening NETBEUI sockets.\n"));
+		return open_netbeui_sockets(isdaemon);
+        }
+#endif /* WITH_NETBEUI */
+   return False;
+}
+
+
 /**************************************************************************** **
  initialise connect, service and file structs
  **************************************************************************** */
@@ -611,6 +668,9 @@
   printf( "\t-p port               Listen on the specified port\n" );
   printf( "\t-s configuration file Configuration file name\n" );
   printf( "\t-i scope              NetBIOS scope\n" );
+#ifdef WITH_NETBEUI
+  printf("\t-Z protocol           NETBEUI or TCPIP\n");
+#endif /* WITH_NETBEUI */
   printf( "\n");
 } /* usage */
 
@@ -680,7 +740,7 @@
 #endif /* MEM_MAN */
 
   while( EOF != 
-         (opt = getopt( argc, argv, "Vaos:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:f:" )) )
+         (opt = getopt( argc, argv, "Vaos:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:f:Z:" )) )
     {
       switch (opt)
         {
@@ -731,6 +791,21 @@
 	  printf( "Version %s\n", VERSION );
           exit(0);
           break;
+#ifdef WITH_NETBEUI
+	case 'Z':
+	  strupper(optarg);
+	  if (strcmp(optarg, "NETBEUI") == 0) 
+		Client_protocol = NETBEUI;
+	  else
+	  	if (strcmp(optarg, "TCPIP") == 0)  {
+	    		DEBUG(0,("using TCPIP as PROTOCOL!!!(%d)\n", getpid()));
+			Client_protocol = TCPIP;
+		} else {
+			usage(argv[0]);
+			exit(0);
+		}
+	  break;	
+#endif /* WITH_NETBEUI */
         default:
           if( !is_a_socket(0) )
           {
diff -uNr samba-2.0.6/source/nmbd/nmbd_become_lmb.c samba-2.0.6.netbeui/source/nmbd/nmbd_become_lmb.c
--- samba-2.0.6/source/nmbd/nmbd_become_lmb.c	Fri Nov 13 23:04:12 1998
+++ samba-2.0.6.netbeui/source/nmbd/nmbd_become_lmb.c	Thu Sep 13 14:44:14 2001
@@ -27,6 +27,8 @@
 extern int DEBUGLEVEL;
 extern pstring scope;
 extern pstring global_myname;
+extern int Client_protocol;
+
 
 extern uint16 samba_nb_type; /* Samba's NetBIOS name type. */
 
@@ -524,6 +526,10 @@
 {
   struct userdata_struct *userdata;
   int size = sizeof(struct userdata_struct) + sizeof(fstring) + 1;
+#ifdef WITH_NETBEUI
+  char lookup[NETBEUI_NAME_LEN + 1];
+#endif /* WITH_NETBEUI */
+
 
   /* Sanity check. */
   if (!lp_local_master())
@@ -569,6 +575,13 @@
   userdata->free_fn = NULL;
   userdata->userdata_len = strlen(work->work_group)+1;
   pstrcpy(userdata->data, work->work_group);
+
+#ifdef WITH_NETBEUI
+      if (Client_protocol == NETBEUI) {
+         pstrcpy(lookup, MSBROWSE);
+         lookup_ip(lookup);  /* make a pseudo-ip for MSBROWSE in local table */
+      }
+#endif /* WITH_NETBEUI */
 
   /* Register the special browser group name. */
   register_name(subrec, MSBROWSE, 0x01, samba_nb_type|NB_GROUP,
diff -uNr samba-2.0.6/source/nmbd/nmbd_mynames.c samba-2.0.6.netbeui/source/nmbd/nmbd_mynames.c
--- samba-2.0.6/source/nmbd/nmbd_mynames.c	Wed Oct 13 03:26:52 1999
+++ samba-2.0.6.netbeui/source/nmbd/nmbd_mynames.c	Thu Sep 13 14:47:34 2001
@@ -51,11 +51,13 @@
 void register_my_workgroup_one_subnet(struct subnet_record *subrec)
 {
 	int i;
-
+	char my_workgroup[NETBEUI_NAME_LEN + 1];
 	struct work_record *work;
 
+	memcpy(my_workgroup, global_myworkgroup, NETBEUI_NAME_LEN);
+	my_workgroup[NETBEUI_NAME_LEN] = '\0';
 	/* Create the workgroup on the subnet. */
-	if((work = create_workgroup_on_subnet(subrec, global_myworkgroup, 
+	if((work = create_workgroup_on_subnet(subrec, my_workgroup, 
 					      PERMANENT_TTL)) == NULL) {
 		DEBUG(0,("register_my_workgroup_and_names: Failed to create my workgroup %s on subnet %s. \
 Exiting.\n", global_myworkgroup, subrec->subnet_name));
diff -uNr samba-2.0.6/source/nmbd/nmbd_packets.c samba-2.0.6.netbeui/source/nmbd/nmbd_packets.c
--- samba-2.0.6/source/nmbd/nmbd_packets.c	Wed Oct 13 03:26:52 1999
+++ samba-2.0.6.netbeui/source/nmbd/nmbd_packets.c	Thu Sep 13 15:04:41 2001
@@ -38,7 +38,7 @@
 static void queue_packet(struct packet_struct *packet);
 
 BOOL rescan_listen_set = False;
-
+extern int Client_protocol;
 
 /*******************************************************************
   The global packet linked-list. Incoming entries are 
@@ -72,8 +72,11 @@
   struct subnet_record *subrec;
 
   for( subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec))
-    if(ip_equal(local_ip, subrec->myip))
+    if(ip_equal(local_ip, subrec->myip)) {
+      DEBUG(4,("find_subnet_mailslot_fd_for_address: fd=%d\n",
+	       subrec->dgram_sock));
       return subrec->dgram_sock;
+    }
 
   return ClientDGRAM;
 }
@@ -223,6 +226,14 @@
   packet->packet_type = NMB_PACKET;
   packet->locked = False;
   
+
+#ifdef WITH_NETBEUI
+  pstrcpy(packet->name, nmbname->name);
+  packet->unique = //(strequal(myname, name) && nmbname->name_type == 0) ||
+             (nmbname->name_type == 0x1d);  /* Unique if master or machine name */
+  packet->name_type = nmbname->name_type; 
+#endif /* WITH_NETBEUI */
+
   return packet; /* Caller must free. */
 }
 
@@ -647,6 +658,7 @@
   if(assert_check_subnet(subrec))
     return NULL;
 
+DEBUG(0,("&namerec->name=\"%.*s\"\n", NETBEUI_NAME_LEN, &namerec->name));
   if(( p = create_and_init_netbios_packet(&namerec->name, bcast,
                      subrec->bcast_ip)) == NULL)
     return NULL;
@@ -1027,6 +1039,7 @@
   int command = CVAL(buf,0);
   struct subnet_record *subrec = find_subnet_for_dgram_browse_packet(p);
 
+   DEBUG(0,("process_browse_packet: from NAME %s", p->name));
   /* Drop the packet if it's a different NetBIOS scope, or
      the source is from one of our names. */
 
@@ -1734,10 +1747,10 @@
 }
 
 /****************************************************************************
-  Listens for NMB or DGRAM packets, and queues them.
+  Listens for NMB or DGRAM packets, and queues them. (TCPIP)
 ***************************************************************************/
 
-BOOL listen_for_packets(BOOL run_election)
+BOOL listen_for_tcpip_packets(BOOL run_election)
 {
   static fd_set *listen_set = NULL;
   static int listen_number = 0;
@@ -1891,6 +1904,50 @@
 }
 
 /****************************************************************************
+  listens for DGRAM packets, and queues them (Netbeui)
+  ***************************************************************************/
+#ifdef WITH_NETBEUI
+BOOL listen_for_netbeui_packets(BOOL run_election)
+{
+  fd_set fds;
+  int selrtn;
+  struct timeval timeout;
+
+  FD_ZERO(&fds);
+  FD_SET(ClientDGRAM,&fds);
+
+  timeout.tv_sec = (run_election||num_response_packets) ? 1 : NMBD_SELECT_LOOP;
+  timeout.tv_usec = 0;
+
+  selrtn = sys_select(FD_SETSIZE,&fds,&timeout);
+
+  if (FD_ISSET(ClientDGRAM,&fds))
+    {
+      struct packet_struct *packet = read_packet(ClientDGRAM, NETBEUI_PACKET);
+      if (packet) 
+	 queue_packet(packet);
+    }
+  return False;
+}
+#endif /* WITH_NETBEUI */
+
+
+/****************************************************************************
+  Get all packets (TCP/IP) or browse datagrams (Netbeui)
+  ***************************************************************************/
+BOOL listen_for_packets(BOOL run_election)
+{
+  if (Client_protocol == TCPIP)
+	return(listen_for_tcpip_packets(run_election));
+#ifdef WITH_NETBEUI
+  else 
+  if (Client_protocol == NETBEUI) 
+	return(listen_for_netbeui_packets(run_election));
+#endif /* WITH_NETBEUI */
+}
+
+
+/****************************************************************************
   Construct and send a netbios DGRAM.
 **************************************************************************/
 BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len,
@@ -1956,6 +2013,16 @@
   p.fd = find_subnet_mailslot_fd_for_address( src_ip );
   p.timestamp = time(NULL);
   p.packet_type = DGRAM_PACKET;
+
+#ifdef WITH_NETBEUI
+  if (Client_protocol == NETBEUI) {
+     p.packet_type = NETBEUI_PACKET;
+     p.name_type = dest_type;
+     p.unique = (dest_type == 0) ||
+                (dest_type == 0x1d); /* Unique if machine name or master */
+     strncpy(p.name, dgram->dest_name.name, NETBEUI_NAME_LEN);
+  }
+#endif /* WITH_NETBEUI */
 
   DEBUG(4,("send_mailslot: Sending to mailslot %s from %s IP %s ", mailslot,
                     nmb_namestr(&dgram->source_name), inet_ntoa(src_ip)));
diff -uNr samba-2.0.6/source/nmbd/nmbd_sendannounce.c samba-2.0.6.netbeui/source/nmbd/nmbd_sendannounce.c
--- samba-2.0.6/source/nmbd/nmbd_sendannounce.c	Wed Oct 13 03:26:52 1999
+++ samba-2.0.6.netbeui/source/nmbd/nmbd_sendannounce.c	Thu Aug  2 01:52:40 2001
@@ -280,6 +280,7 @@
 {
   struct subnet_record *subrec;
 
+
   for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec))
   {
     struct work_record *work = find_workgroup_on_subnet(subrec, global_myworkgroup);
@@ -389,7 +390,6 @@
 {
   struct subnet_record *subrec;
   struct work_record *work;
-
   if(!we_are_a_wins_client())
   {
     DEBUG(10,("announce_myself_to_domain_master_browser: no unicast subnet, ignoring.\n"));
diff -uNr samba-2.0.6/source/nmbd/nmbd_serverlistdb.c samba-2.0.6.netbeui/source/nmbd/nmbd_serverlistdb.c
--- samba-2.0.6/source/nmbd/nmbd_serverlistdb.c	Wed Oct 13 03:26:52 1999
+++ samba-2.0.6.netbeui/source/nmbd/nmbd_serverlistdb.c	Wed Aug  1 10:12:44 2001
@@ -136,6 +136,8 @@
 {
   struct server_record *servrec;
   
+  DEBUG(0,("create_server_on_workgroup: work->work_group=\"%s\"\n",
+	   work->work_group));
   if (name[0] == '*')
   {
       DEBUG(7,("create_server_on_workgroup: not adding name starting with '*' (%s)\n",
diff -uNr samba-2.0.6/source/nmbd/nmbd_subnetdb.c samba-2.0.6.netbeui/source/nmbd/nmbd_subnetdb.c
--- samba-2.0.6/source/nmbd/nmbd_subnetdb.c	Wed Oct 13 03:26:52 1999
+++ samba-2.0.6.netbeui/source/nmbd/nmbd_subnetdb.c	Thu Aug  2 17:17:25 2001
@@ -36,6 +36,7 @@
 extern fstring myworkgroup;
 extern char **my_netbios_names;
 extern struct in_addr ipzero;
+extern int Client_protocol;
 
 /* This is the broadcast subnets database. */
 struct subnet_record *subnetlist = NULL;
@@ -137,6 +138,9 @@
      * Fail the subnet creation if this fails.
      */
 
+
+    if (Client_protocol == TCPIP) {
+
     if((nmb_sock = open_socket_in(SOCK_DGRAM, global_nmb_port,0, myip.s_addr,True)) == -1)
     {
       if( DEBUGLVL( 0 ) )
@@ -161,9 +165,11 @@
       return NULL;
     }
 
+
     /* Make sure we can broadcast from these sockets. */
     set_socket_options(nmb_sock,"SO_BROADCAST");
     set_socket_options(dgram_sock,"SO_BROADCAST");
+    }
 
   }
 
@@ -203,8 +209,13 @@
   subrec->mask_ip  = mask_ip;
   subrec->myip = myip;
   subrec->type = type;
-  subrec->nmb_sock = nmb_sock;
-  subrec->dgram_sock = dgram_sock;
+  if (Client_protocol == TCPIP) {
+  	subrec->nmb_sock = nmb_sock;
+  	subrec->dgram_sock = dgram_sock;
+  } else {
+  	subrec->nmb_sock = ClientNMB;
+  	subrec->dgram_sock = ClientDGRAM;
+  }
   
   return subrec;
 }
diff -uNr samba-2.0.6/source/nmbd/nmbd_workgroupdb.c samba-2.0.6.netbeui/source/nmbd/nmbd_workgroupdb.c
--- samba-2.0.6/source/nmbd/nmbd_workgroupdb.c	Wed Oct 13 03:26:52 1999
+++ samba-2.0.6.netbeui/source/nmbd/nmbd_workgroupdb.c	Thu Sep 13 15:06:28 2001
@@ -34,6 +34,8 @@
 extern char **my_netbios_names;
 extern uint16 samba_nb_type;
 extern struct in_addr ipzero;
+extern int Client_protocol;
+
 
 int workgroup_count = 0; /* unique index key: one for each workgroup */
 
@@ -183,13 +185,23 @@
                                                fstring name, int ttl)
 {
   struct work_record *work = NULL;
+  char tmp[NETBEUI_NAME_LEN + 1];
+
+  memcpy(tmp, name, NETBEUI_NAME_LEN);
+  tmp[NETBEUI_NAME_LEN] = '\0';
 
   DEBUG(4,("create_workgroup_on_subnet: creating group %s on subnet %s\n",
            name, subrec->subnet_name));
-  
+#ifdef WITH_NETBEUI
+  if (Client_protocol == NETBEUI)
+     lookup_ip(tmp);   /* make a pseudo-ip in local table */
+#endif /* WITH_NETBEUI */
+  DEBUG(4,("create_workgroup_on_subnet: tmp=%s\n", tmp));
   if ((work = create_workgroup(name, ttl)))
   {
     add_workgroup(subrec, work);
+  DEBUG(4,("create_workgroup_on_subnet: added group %s on subnet %s\n",
+           work->work_group, subrec->subnet_name));
 
     subrec->work_changed = True;
 
diff -uNr samba-2.0.6/source/smbadduser samba-2.0.6.netbeui/source/smbadduser
--- samba-2.0.6/source/smbadduser	Mon Oct 13 10:13:11 1997
+++ samba-2.0.6.netbeui/source/smbadduser	Thu May 31 19:33:02 2001
@@ -10,9 +10,9 @@
 #
 # Set to site specific passwd command
 #
-#set passwd    = "cat /etc/passwd"
+set passwd    = "cat /etc/passwd"
 #set passwd    = "niscat passwd.org_dir"
-set passwd    = "ypcat passwd"
+#set passwd    = "ypcat passwd"
 
 set line = "----------------------------------------------------------"
 if ($#argv == 0) then
diff -uNr samba-2.0.6/source/smbd/password.c samba-2.0.6.netbeui/source/smbd/password.c
--- samba-2.0.6/source/smbd/password.c	Thu Nov 11 00:36:10 1999
+++ samba-2.0.6.netbeui/source/smbd/password.c	Tue Jul 17 15:44:12 2001
@@ -31,6 +31,7 @@
 extern pstring scope;
 extern pstring global_myname;
 extern fstring global_myworkgroup;
+extern int Client_protocol;
 
 /* Data to do lanman1/2 password challenge. */
 static unsigned char saved_challenge[8];
@@ -960,7 +961,11 @@
 	fstring desthost;
 	struct in_addr dest_ip;
 	char *p;
-    BOOL connected_ok = False;
+    	BOOL connected_ok = False;
+#ifdef WITH_NETBEUI
+  	extern char NetBEUI_name[];
+#endif /* WITH_NETBEUI */
+  
 
 	cli = server_client();
 
@@ -972,14 +977,16 @@
 		standard_sub_basic(desthost);
 		strupper(desthost);
 
-		if(!resolve_name( desthost, &dest_ip, 0x20)) {
-			DEBUG(1,("server_cryptkey: Can't resolve address for %s\n",desthost));
-			continue;
-		}
+		if (Client_protocol = TCPIP) {
+			if(!resolve_name( desthost, &dest_ip, 0x20)) {
+				DEBUG(1,("server_cryptkey: Can't resolve address for %s\n",desthost));
+				continue;
+			}
 
-		if (ismyip(dest_ip)) {
-			DEBUG(1,("Password server loop - disabling password server %s\n",desthost));
-			continue;
+			if (ismyip(dest_ip)) {
+				DEBUG(1,("Password server loop - disabling password server %s\n",desthost));
+				continue;
+			}
 		}
 
 		if (cli_connect(cli, desthost, &dest_ip)) {
@@ -995,8 +1002,10 @@
 		return NULL;
 	}
 
-	if (!attempt_netbios_session_request(cli, global_myname, desthost, &dest_ip))
-		return NULL;
+	if (Client_protocol == TCPIP) {
+		if (!attempt_netbios_session_request(cli, global_myname, desthost, &dest_ip))
+			return NULL;
+	}
 
 	DEBUG(3,("got session\n"));
 
diff -uNr samba-2.0.6/source/smbd/process.c samba-2.0.6.netbeui/source/smbd/process.c
--- samba-2.0.6/source/smbd/process.c	Thu Nov 11 00:36:10 1999
+++ samba-2.0.6.netbeui/source/smbd/process.c	Tue Aug 28 01:50:34 2001
@@ -177,6 +177,7 @@
 
   /* Check if error */
   if(selrtn == -1) {
+    DEBUG(0,("sys_select error!\n"));
     /* something is wrong. Maybe the socket is dead? */
     smb_read_error = READ_ERROR;
     return False;
@@ -184,6 +185,7 @@
     
   /* Did we timeout ? */
   if (selrtn == 0) {
+    DEBUG(0,("we timeout :(\n"));
     smb_read_error = READ_TIMEOUT;
     return False;
   }
@@ -1016,8 +1018,11 @@
 
     while(!receive_message_or_smb(InBuffer,BUFFER_SIZE,select_timeout,&got_smb))
     {
-      if(!timeout_processing( deadtime, &select_timeout, &last_timeout_processing_time))
+      if(!timeout_processing( deadtime, &select_timeout, &last_timeout_processing_time)) {
+
+      	DEBUG(1,("timed out processing 1...\n"));
         return;
+      }
       num_smbs = 0; /* Reset smb counter. */
     }
 
@@ -1036,8 +1041,10 @@
       process_smb(InBuffer, OutBuffer);
 
       if(smb_echo_count != num_echos) {
-        if(!timeout_processing( deadtime, &select_timeout, &last_timeout_processing_time))
+        if(!timeout_processing( deadtime, &select_timeout, &last_timeout_processing_time)) {
+      	DEBUG(1,("timed out processing 2...\n"));
           return;
+	}
         num_smbs = 0; /* Reset smb counter. */
       }
 
@@ -1053,8 +1060,10 @@
       if((num_smbs % 200) == 0) {
         time_t new_check_time = time(NULL);
         if(last_timeout_processing_time - new_check_time >= (select_timeout/1000)) {
-          if(!timeout_processing( deadtime, &select_timeout, &last_timeout_processing_time))
+          if(!timeout_processing( deadtime, &select_timeout, &last_timeout_processing_time)) {
+      	    DEBUG(1,("timed out processing 3...\n"));
             return;
+	  }
           num_smbs = 0; /* Reset smb counter. */
           last_timeout_processing_time = new_check_time; /* Reset time. */
         }
diff -uNr samba-2.0.6/source/smbd/reply.c samba-2.0.6.netbeui/source/smbd/reply.c
--- samba-2.0.6/source/smbd/reply.c	Thu Nov 11 00:36:11 1999
+++ samba-2.0.6.netbeui/source/smbd/reply.c	Tue Jul 17 15:44:01 2001
@@ -42,6 +42,7 @@
 extern fstring global_myworkgroup;
 extern int Client;
 extern int global_oplock_break;
+extern int Client_protocol;
 uint32 global_client_caps = 0;
 unsigned int smb_echo_count = 0;
 
@@ -2054,7 +2055,13 @@
   if(global_oplock_break)
   {
     _smb_setlen(header,0);
-    transfer_file(0,Client,(SMB_OFF_T)0,header,4,0);
+
+    if (Client_protocol == TCPIP)
+    	transfer_file(0,Client,(SMB_OFF_T)0,header,4,0);
+#ifdef WITH_NETBEUI
+    else if (Client_protocol == NETBEUI)
+    	transfer_file(0,Client,(SMB_OFF_T)0,header,0,0);
+#endif /* WITH_NETBEUI */
     DEBUG(5,("readbraw - oplock break finished\n"));
     return -1;
   }
@@ -2141,6 +2148,7 @@
   {
     BOOL seek_fail = False;
     int predict=0;
+    int rawbytes=nread;
     _smb_setlen(header,nread);
 
 #if USE_READ_PREDICTION
@@ -2157,21 +2165,39 @@
     }
 
     if(!seek_fail)
-      ret = (ssize_t)transfer_file(fsp->fd_ptr->fd,Client,
+	if (Client_protocol == TCPIP) {
+		rawbytes += 4;
+      		ret = (ssize_t)transfer_file(fsp->fd_ptr->fd,Client,
                                    (SMB_OFF_T)(nread-predict),header,4+predict, 
                                    startpos+predict);
-  }
+	}
+#ifdef WITH_NETBEUI
+    	else if (Client_protocol == NetBEUI) {
+      		ret = (ssize_t)transfer_file(fsp->fd_ptr->fd,Client,
+                                   (SMB_OFF_T)(nread-predict),header+4,predict, 
+                                   startpos+predict);
+    	}
+#endif /* WITH_NETBEUI */
 
-  if (ret != nread+4)
+  if (ret != rawbytes)
     DEBUG(0,("ERROR: file read failure on %s at %d for %d bytes (%d)\n",
 	     fsp->fsp_name,startpos,nread,ret));
 
+  }
+
 #else /* UNSAFE_READRAW */
+
   ret = read_file(fsp,header+4,startpos,nread);
   if (ret < mincount) ret = 0;
 
   _smb_setlen(header,ret);
-  transfer_file(0,Client,0,header,4+ret,0);
+  if (Client_protocol == TCPIP) 
+    transfer_file(0,Client,0,header,4+ret,0);
+#ifdef WITH_NETBEUI
+  else if (Client_protocol == NETBEUI)
+    transfer_file(0,Client,0,header+4,ret,0);
+#endif /* WITH_NETBEUI */
+
 #endif /* UNSAFE_READRAW */
 
   DEBUG(5,("readbraw finished\n"));
@@ -2408,15 +2434,23 @@
   SSVALS(outbuf,smb_vwv0,-1);
   outsize = set_message(outbuf,Protocol>PROTOCOL_COREPLUS?1:0,0,True);
   send_smb(Client,outbuf);
-  
-  /* Now read the raw data into the buffer and write it */
-  if (read_smb_length(Client,inbuf,SMB_SECONDARY_WAIT) == -1) {
-    exit_server("secondary writebraw failed");
+
+  if (Client_protocol == TCPIP) {
+
+  	/* Now read the raw data into the buffer and write it */
+	if (read_smb_length(Client,inbuf,SMB_SECONDARY_WAIT) == -1) {
+	  exit_server("secondary writebraw failed");
+	}
+	
+	/* Even though this is not an smb message, smb_len
+	   returns the generic length of an smb message */
+	numtowrite = smb_len(inbuf);
+  }
+#ifdef WITH_NETBEUI 
+  else if (Client_protocol == NETBEUI) {
+     numtowrite = tcount - nwritten;
   }
-  
-  /* Even though this is not an smb message, smb_len
-     returns the generic length of an smb message */
-  numtowrite = smb_len(inbuf);
+#endif /* WITH_NETBEUI */
 
   if (tcount > nwritten+numtowrite) {
     DEBUG(3,("Client overestimated the write %d %d %d\n",
diff -uNr samba-2.0.6/source/smbd/server.c samba-2.0.6.netbeui/source/smbd/server.c
--- samba-2.0.6/source/smbd/server.c	Thu Nov 11 00:36:11 1999
+++ samba-2.0.6.netbeui/source/smbd/server.c	Tue Aug 28 01:36:30 2001
@@ -22,6 +22,9 @@
 #include "includes.h"
 #include "trans2.h"
 
+extern BOOL receive_netbeui_smb(int fd,char *buffer,unsigned int timeout);
+extern BOOL send_netbeui_smb(int fd,char *buffer);
+
 pstring servicesf = CONFIGFILE;
 extern pstring debugf;
 extern fstring global_myworkgroup;
@@ -87,11 +90,117 @@
 	return True;
 }
 
+/****************************************************************************
+  open the socket communication when NetBEUI transport is used
+****************************************************************************/
+#ifdef WITH_NETBEUI
+static BOOL open_netbeui_sockets(BOOL is_daemon,int port)
+{
+  extern int Client;
+  extern char NetBEUI_name[];
+
+  if (is_daemon)
+    {
+      int s;
+      struct sockaddr_netbeui addr;
+      int in_addrlen = sizeof(addr);
+       
+      /* Stop zombies */
+
+//#ifdef SIGCLD_IGNORE
+      signal(SIGCLD, SIG_IGN);
+//#else
+ //     signal(SIGCLD, SIGNAL_CAST sig_cld);
+//#endif
+
+      /* open an incoming socket */
+      s = open_netbeui_socket_in(SOCK_STREAM, NetBEUI_name, 0);
+      if (s == -1)
+	return(False);
+
+      DEBUG(1, ("Accepting connection on %s\n", NetBEUI_name));
+      /* ready to listen */
+      if (listen(s, 5) == -1) 
+	{
+	  DEBUG(0,("listen: %s",strerror(errno)));
+	  close(s);
+	  return False;
+	}
+      
+      DEBUG(1, ("Listening on %s\n", NetBEUI_name));
+      /* now accept incoming connections - forking a new process
+	 for each incoming connection */
+      DEBUG(2,("waiting for a connection\n"));
+      while (1)
+	{
+	  Client = accept(s, (struct sockaddr *)&addr, &in_addrlen);
+
+	  if (Client == -1 && errno == EINTR)
+	    continue;
+
+	  if (Client == -1 && errno == EINVAL)  {
+      	     DEBUG(2,("accept failed with errno=EINVAL: %s\n",
+		      strerror(errno)));
+             return False;
+	  }
+
+	  if (Client == -1)
+	    {
+	      DEBUG(0,("accept: %s\n",strerror(errno)));
+	      continue;
+	    }
+	  DEBUG(1,("accept got a connection!\n"));
+#ifdef NO_FORK_DEBUG
+
+#ifndef NO_SIGNAL_TEST
+//          signal(SIGPIPE, SIGNAL_CAST sig_pipe);
+          signal(SIGCLD, SIGNAL_CAST SIG_DFL);
+#endif
+	  return True;
+#else
+	  if (Client != -1 && fork()==0)
+	    {
+#ifndef NO_SIGNAL_TEST
+//	      signal(SIGPIPE, SIGNAL_CAST sig_pipe);
+	      signal(SIGCLD, SIGNAL_CAST SIG_DFL);
+#endif
+
+	      /* close the listening socket */
+	      close(s);
+
+	      /* close our standard file descriptors */
+	      close_low_fds();
+  
+	      set_socket_options(Client,"SO_KEEPALIVE");
+	      set_socket_options(Client,user_socket_options);
+
+	      memset(remote_machine, ' ', NETBEUI_NAME_LEN);
+	      memcpy(remote_machine, addr.snb_addr.name, NETBEUI_NAME_LEN);
+	      trim_string(remote_machine, " ", " ");
+	      DEBUG(0,("remote_machine: %.*s\n", NETBEUI_NAME_LEN, remote_machine));
+
+	      return True; 
+	    }
+          close(Client); /* The parent doesn't need this socket */
+#endif
+	}
+    }
+  else
+    {
+	DEBUG(0,("SAMBA over NetBEUI only runs in daemon mode \n"));
+	return False;
+    }
+
+  return True;
+}
+#endif /* WITH_NETBEUI */
+
+
 
 /****************************************************************************
-  open the socket communication
+  open the socket communication when TCP transport is used
 ****************************************************************************/
-static BOOL open_sockets(BOOL is_daemon,int port)
+static BOOL open_tcpip_sockets(BOOL is_daemon,int port)
 {
 	extern int Client;
 	int num_interfaces = iface_count();
@@ -278,6 +387,22 @@
 }
 
 /****************************************************************************
+  open the socket communication based on transport layer choosed
+****************************************************************************/
+static BOOL open_sockets(BOOL is_daemon,int port)
+{
+   extern int Client_protocol;
+   if (Client_protocol == TCPIP)
+      return open_tcpip_sockets(is_daemon, port);
+#ifdef WITH_NETBEUI
+   else if (Client_protocol == NETBEUI)
+      return open_netbeui_sockets(is_daemon, port);
+#endif /* WITH_NETBEUI */
+   return False;
+}
+
+
+/****************************************************************************
   reload the services file
   **************************************************************************/
 BOOL reload_services(BOOL test)
@@ -492,7 +617,11 @@
 	printf("\t-O socket options     Socket options\n");
 	printf("\t-s services file.     Filename of services file\n");
 	printf("\t-i scope              NetBIOS scope to use (default none)\n");
-	printf("\n");
+#ifdef WITH_NETBEUI
+  	printf("\t-S NetBIOS name       NetBIOS name to Listen on \n");
+  	printf("\t-Z Transport protocol TCPIP or NETBEUI transport protocol\n");
+#endif /* WITH_NETBEUI */
+  	printf("\n");
 }
 
 
@@ -501,6 +630,12 @@
 ****************************************************************************/
  int main(int argc,char *argv[])
 {
+
+  	extern int Client_protocol;
+#ifdef WITH_NETBEUI
+  	extern char NetBEUI_name[];
+#endif /* WITH_NETBEUI */
+
 	extern BOOL append_log;
 	/* shall I run as a daemon */
 	BOOL is_daemon = False;
@@ -518,7 +653,7 @@
 		argc--;
 	}
 
-	while ( EOF != (opt = getopt(argc, argv, "O:i:l:s:d:Dp:h?VPaof:")) )
+	while ( EOF != (opt = getopt(argc, argv, "O:i:l:s:d:Dp:h?VPaofZ:S:")) )
 		switch (opt)  {
 		case 'O':
 			pstrcpy(user_socket_options,optarg);
@@ -576,6 +711,22 @@
 			printf("Version %s\n",VERSION);
 			exit(0);
 			break;
+#ifdef WITH_NETBEUI
+	        case 'S':
+			if (!optarg) break;
+			memset(NetBEUI_name, ' ', NETBEUI_NAME_LEN);
+			memcpy(NetBEUI_name, optarg, MIN(strlen(optarg), NETBEUI_NAME_LEN));
+			break;
+	      	case 'Z':
+			if (!optarg) break;
+			if (strcmp(optarg, "NETBEUI") == 0) {
+			   Client_protocol = NETBEUI;
+			   receive_smb_func = receive_netbeui_smb;
+			   send_smb_func = send_netbeui_smb;
+			   tag_chained_commands();
+			}
+			break;
+#endif /* WITH_NETBEUI */
 		default:
 			DEBUG(0,("Incorrect program usage - are you sure the command line is correct?\n"));
 			usage(argv[0]);
@@ -734,7 +885,6 @@
 		if (sys_chroot(lp_rootdir()) == 0)
 			DEBUG(2,("Changed root to %s\n", lp_rootdir()));
 	}
-
 	/* Setup the oplock IPC socket. */
 	if( !open_oplock_ipc() )
 		exit(1);
diff -uNr samba-2.0.6/source/utils/torture.c samba-2.0.6.netbeui/source/utils/torture.c
--- samba-2.0.6/source/utils/torture.c	Thu Nov 11 00:36:18 1999
+++ samba-2.0.6.netbeui/source/utils/torture.c	Thu Jun  7 12:48:08 2001
@@ -25,7 +25,7 @@
 
 static fstring host, workgroup, share, password, username, myname;
 static int max_protocol = PROTOCOL_NT1;
-static char *sockops="TCP_NODELAY";
+static char *sockops="";
 static int nprocs=1, numops=100;
 static struct cli_state current_cli;