Index: ncftp3/config.h.in
diff -u ncftp3/config.h.in:1.1.1.4 ncftp3/config.h.in:1.5
--- ncftp3/config.h.in:1.1.1.4	Tue Oct 19 02:38:52 1999
+++ ncftp3/config.h.in	Thu Feb 17 22:08:57 2000
@@ -121,6 +121,9 @@
 /* Define if you have the doupdate function.  */
 #undef HAVE_DOUPDATE
 
+/* Define if you have the getaddrinfo function.  */
+#undef HAVE_GETADDRINFO
+
 /* Define if you have the getcwd function.  */
 #undef HAVE_GETCWD
 
@@ -130,6 +133,9 @@
 /* Define if you have the gethostname function.  */
 #undef HAVE_GETHOSTNAME
 
+/* Define if you have the getaddrname function.  */
+#undef HAVE_GETNAMEINFO
+
 /* Define if you have the getpass function.  */
 #undef HAVE_GETPASS
 
@@ -178,6 +184,9 @@
 /* Define if you have the snprintf function.  */
 #undef HAVE_SNPRINTF
 
+/* Define if sockaddr has sa_len member */
+#undef HAVE_SOCKADDR_SA_LEN
+
 /* Define if you have the strcasecmp function.  */
 #undef HAVE_STRCASECMP
 
@@ -282,3 +291,6 @@
 
 /* Define if you have the socket library (-lsocket).  */
 #undef HAVE_LIBSOCKET
+
+/* Define if you want IPv6 support. */
+#undef ENABLE_IPV6
Index: ncftp3/configure
diff -u ncftp3/configure:1.1.1.6 ncftp3/configure:1.14
--- ncftp3/configure:1.1.1.6	Wed Apr 12 21:45:52 2000
+++ ncftp3/configure	Wed Apr 12 21:49:27 2000
@@ -19,6 +19,15 @@
   --disable-select        use alarm() for timeout handling rather than select()"
 ac_help="$ac_help
   --disable-extra-dirs    do not look for extra -I/include and -L/lib dirs"
+ac_help="$ac_help
+  --enable-ipv6		Enable ipv6 (with ipv4) support
+  --disable-ipv6		Disable ipv6 support"
+ac_help="$ac_help
+  --with-ipv6-includes=DIR Search for IPv6 header files in DIR"
+ac_help="$ac_help
+  --with-ipv6-libraries=DIR Search for IPv6 libraries in DIR"
+ac_help="$ac_help
+  --with-ipv6-libname=NAME library name for IPv6"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -572,17 +581,6 @@
 SYS=''
 NDEFS=''
 
-# Special case a few systems where if your CFLAGS appear
-# to want to generate for 32 bit, use that mode rather
-# than 64 bit.
-#
-case "$os,$CFLAGS" in
-	irix64,*-n32*)
-		os=irix
-		# then go to regular "irix" instead of "irix64" below.
-		;;
-esac
-
 case "$os" in
 	osf1)
 		OS="digitalunix${os_r}-$arch"
@@ -599,11 +597,6 @@
 		SYS=irix
 		NDEFS="$NDEFS -DIRIX=$os_r1"
 		;;
-	irix64)
-		OS="irix64_${os_r}"
-		SYS=irix64
-		NDEFS="$NDEFS -DIRIX=$os_r1 -DIRIX64=$os_r1"
-		;;
 	hp-ux)
 		os_r=`echo "${os_r}" | cut -d. -f2-`
 		os_r1=`echo "$os_r" | cut -d. -f1`
@@ -659,37 +652,17 @@
 		os_r3=`echo "$os_r" | cut -d- -f1 | cut -d. -f3`
 		os_int=`expr "$os_r1" '*' 10000 + "$os_r2" '*' 1000 + "$os_r3"`
 		NDEFS="$NDEFS -DLINUX=$os_int"
-		if test -f /lib/libc-2.1.5.so ; then
-			libc="glibc2.1"
-#			OS="linux-$arch-$libc"
-			OS="linux-$arch"
-		elif test -f /lib/libc-2.1.4.so ; then
-			libc="glibc2.1"
-#			OS="linux-$arch-$libc"
-			OS="linux-$arch"
-		elif test -f /lib/libc-2.1.3.so ; then
-			libc="glibc2.1"
-#			OS="linux-$arch-$libc"
-			OS="linux-$arch"
-		elif test -f /lib/libc-2.1.2.so ; then
-			libc="glibc2.1"
-#			OS="linux-$arch-$libc"
-			OS="linux-$arch"
-		elif test -f /lib/libc-2.1.1.so ; then
+		if test -f /lib/libc-2.1.1.so ; then
 			libc="glibc2.1"
-#			OS="linux-$arch-$libc"
 			OS="linux-$arch"
 		elif test -f /lib/libc.so.6 ; then
 			libc="glibc2.0"
-#			OS="linux-$arch-$libc"
 			OS="linux-$arch"
 		elif test -f /lib/libc.so.6.1 ; then
 			libc="glibc2.0"
-#			OS="linux-$arch-$libc"
 			OS="linux-$arch"
 		else
 			libc="libc5"
-#			OS="linux-$arch-$libc"
 			OS="linux-$arch"
 		fi
 		SYS=linux
@@ -852,7 +825,7 @@
 # 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:856: checking for $ac_word" >&5
+echo "configure:829: 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
@@ -882,7 +855,7 @@
   # 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:886: checking for $ac_word" >&5
+echo "configure:859: 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
@@ -933,7 +906,7 @@
       # 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:937: checking for $ac_word" >&5
+echo "configure:910: 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
@@ -965,7 +938,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:969: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:942: 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.
@@ -976,12 +949,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 980 "configure"
+#line 953 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:958: \"$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
@@ -1007,12 +980,12 @@
   { 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:1011: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:984: 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:1016: checking whether we are using GNU C" >&5
+echo "configure:989: 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
@@ -1021,7 +994,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1025: \"$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:998: \"$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
@@ -1040,7 +1013,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1044: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1017: 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
@@ -1072,7 +1045,7 @@
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1076: checking how to run the C preprocessor" >&5
+echo "configure:1049: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1087,13 +1060,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1091 "configure"
+#line 1064 "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:1097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1070: \"$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
   :
@@ -1104,13 +1077,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1108 "configure"
+#line 1081 "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:1114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1087: \"$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
   :
@@ -1121,13 +1094,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1125 "configure"
+#line 1098 "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:1131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1104: \"$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
   :
@@ -1154,7 +1127,7 @@
 
 
 echo $ac_n "checking if HP-UX ansi C compiler flags are needed""... $ac_c" 1>&6
-echo "configure:1158: checking if HP-UX ansi C compiler flags are needed" >&5
+echo "configure:1131: checking if HP-UX ansi C compiler flags are needed" >&5
 
 os=`uname -s | tr 'A-Z' 'a-z'`
 ac_cv_hpux_flags=no
@@ -1199,12 +1172,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1203: checking for working const" >&5
+echo "configure:1176: 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 1208 "configure"
+#line 1181 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1253,7 +1226,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1274,13 +1247,13 @@
 fi
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1278: checking for object suffix" >&5
+echo "configure:1251: checking for object suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -1298,12 +1271,12 @@
 ac_objext=$ac_cv_objext
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1302: checking for Cygwin environment" >&5
+echo "configure:1275: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1307 "configure"
+#line 1280 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1314,7 +1287,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:1318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -1331,19 +1304,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:1335: checking for mingw32 environment" >&5
+echo "configure:1308: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1340 "configure"
+#line 1313 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -1362,7 +1335,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1366: checking for executable suffix" >&5
+echo "configure:1339: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1372,7 +1345,7 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:1376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:1349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj) ;;
@@ -1397,7 +1370,7 @@
 if test "$nc_cv_extra_dirs" = yes ; then
 	
 echo $ac_n "checking for System V compatibility directories""... $ac_c" 1>&6
-echo "configure:1401: checking for System V compatibility directories" >&5
+echo "configure:1374: checking for System V compatibility directories" >&5
 echo "$ac_t""" 1>&6
 
 incdir=""/usr/5include""
@@ -1438,18 +1411,11 @@
 
 	
 echo $ac_n "checking for extra include and lib directories""... $ac_c" 1>&6
-echo "configure:1442: checking for extra include and lib directories" >&5
+echo "configure:1415: checking for extra include and lib directories" >&5
 echo "$ac_t""" 1>&6
 b1=`cd .. ; pwd`
 b2=`cd ../.. ; pwd`
 exdirs="$HOME $j $b1 $b2 $prefix /usr/local /usr/ccs"
-if test -x "$HOME/bin/OS" ; then
-	b3=`$HOME/bin/OS`
-	b3="$HOME/$b3"
-	if test -d "$b3" ; then
-		exdirs="$b3 $exdirs"
-	fi
-fi
 
 subexdirs="-"
 if test "$subexdirs" = "" ; then
@@ -1560,12 +1526,12 @@
 # Mostly for SunOS 4 -- needs to come first because other libs depend on it
 
 echo $ac_n "checking for strerror""... $ac_c" 1>&6
-echo "configure:1564: checking for strerror" >&5
+echo "configure:1530: checking for strerror" >&5
 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1569 "configure"
+#line 1535 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strerror(); below.  */
@@ -1588,7 +1554,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_strerror=yes"
 else
@@ -1611,7 +1577,7 @@
 if test "$a" = no ; then
 	# Not in libc, try lib44bsd.
 	echo $ac_n "checking for strerror in -l44bsd""... $ac_c" 1>&6
-echo "configure:1615: checking for strerror in -l44bsd" >&5
+echo "configure:1581: checking for strerror in -l44bsd" >&5
 ac_lib_var=`echo 44bsd'_'strerror | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1619,7 +1585,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-l44bsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1623 "configure"
+#line 1589 "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
@@ -1630,7 +1596,7 @@
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:1634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1600: \"$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
@@ -1662,12 +1628,12 @@
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:1666: checking for socket" >&5
+echo "configure:1632: checking for socket" >&5
 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1671 "configure"
+#line 1637 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -1690,7 +1656,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -1713,7 +1679,7 @@
 if test "$a" = no ; then
 	# Not in libc, try libsocket.
 	echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:1717: checking for socket in -lsocket" >&5
+echo "configure:1683: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1721,7 +1687,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1725 "configure"
+#line 1691 "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
@@ -1732,7 +1698,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:1736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1702: \"$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
@@ -1765,7 +1731,7 @@
 if test "$SYS" = unixware ; then
 	# So far, only UnixWare needs this.
 	echo $ac_n "checking for syslog in -lgen""... $ac_c" 1>&6
-echo "configure:1769: checking for syslog in -lgen" >&5
+echo "configure:1735: checking for syslog in -lgen" >&5
 ac_lib_var=`echo gen'_'syslog | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1773,7 +1739,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1777 "configure"
+#line 1743 "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
@@ -1784,7 +1750,7 @@
 syslog()
 ; return 0; }
 EOF
-if { (eval echo configure:1788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1754: \"$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
@@ -1831,7 +1797,7 @@
 	hpux1123456789*)
 		# HP-UX 11 uses NSL for YP services
 		echo $ac_n "checking for getpwent in -lnsl""... $ac_c" 1>&6
-echo "configure:1835: checking for getpwent in -lnsl" >&5
+echo "configure:1801: checking for getpwent in -lnsl" >&5
 ac_lib_var=`echo nsl'_'getpwent | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1839,7 +1805,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1843 "configure"
+#line 1809 "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
@@ -1850,7 +1816,7 @@
 getpwent()
 ; return 0; }
 EOF
-if { (eval echo configure:1854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1820: \"$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
@@ -1881,12 +1847,12 @@
 
 	*)
 		echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1885: checking for gethostbyname" >&5
+echo "configure:1851: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1890 "configure"
+#line 1856 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -1909,7 +1875,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -1932,7 +1898,7 @@
 		if test "$a" = no ; then
 			# Not in libc, try libnsl.
 			echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:1936: checking for gethostbyname in -lnsl" >&5
+echo "configure:1902: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1940,7 +1906,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1944 "configure"
+#line 1910 "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
@@ -1951,7 +1917,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:1955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1921: \"$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
@@ -1988,12 +1954,12 @@
 # libraries, like resolv.
 echo "configure: warning: the following check may take several minutes if networking is not up.  You may want to bring it up now and restart configure, otherwise please be patient." 1>&2
 echo $ac_n "checking if we need to look for -lresolv""... $ac_c" 1>&6
-echo "configure:1992: checking if we need to look for -lresolv" >&5
+echo "configure:1958: checking if we need to look for -lresolv" >&5
 if test "$cross_compiling" = yes; then
   look_for_resolv=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 1997 "configure"
+#line 1963 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -2012,7 +1978,7 @@
 	exit(! result);
 }
 EOF
-if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   look_for_resolv=no
 else
@@ -2028,7 +1994,7 @@
 echo "$ac_t""$look_for_resolv" 1>&6
 if test "$look_for_resolv" = yes ; then
 echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6
-echo "configure:2032: checking for main in -lresolv" >&5
+echo "configure:1998: checking for main in -lresolv" >&5
 ac_lib_var=`echo resolv'_'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
@@ -2036,14 +2002,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2040 "configure"
+#line 2006 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2013: \"$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
@@ -2085,23 +2051,23 @@
 	
 
 echo $ac_n "checking for curses library headers""... $ac_c" 1>&6
-echo "configure:2089: checking for curses library headers" >&5
+echo "configure:2055: checking for curses library headers" >&5
 if test "$nc_cv_ncurses" != "no" ; then
 	for ac_hdr in ncurses.h curses.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2095: checking for $ac_hdr" >&5
+echo "configure:2061: 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 2100 "configure"
+#line 2066 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2071: \"$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*
@@ -2132,17 +2098,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2136: checking for $ac_hdr" >&5
+echo "configure:2102: 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 2141 "configure"
+#line 2107 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2112: \"$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*
@@ -2180,7 +2146,7 @@
 fi
 
 echo $ac_n "checking for curses library""... $ac_c" 1>&6
-echo "configure:2184: checking for curses library" >&5
+echo "configure:2150: checking for curses library" >&5
 
 wi_cv_lib_curses=no
 wi_cv_lib_curses_result=no
@@ -2199,7 +2165,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 2203 "configure"
+#line 2169 "configure"
 #include "confdefs.h"
 
 	/* program */
@@ -2224,7 +2190,7 @@
 }
 
 EOF
-if { (eval echo configure:2228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
 	# action if true
@@ -2292,12 +2258,12 @@
 	for ac_func in getcwd
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2296: checking for $ac_func" >&5
+echo "configure:2262: 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 2301 "configure"
+#line 2267 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2320,7 +2286,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2290: \"$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
@@ -2348,12 +2314,12 @@
 for ac_func in gethostname getwd strerror strstr waitpid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2352: checking for $ac_func" >&5
+echo "configure:2318: 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 2357 "configure"
+#line 2323 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2376,7 +2342,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2346: \"$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
@@ -2403,12 +2369,12 @@
 for ac_func in getpass getpassphrase strcasecmp getdomainname mktime symlink
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2407: checking for $ac_func" >&5
+echo "configure:2373: 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 2412 "configure"
+#line 2378 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2431,7 +2397,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2401: \"$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
@@ -2458,12 +2424,12 @@
 for ac_func in memmove syslog uname setvbuf waitpid strtoq sigaction
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2462: checking for $ac_func" >&5
+echo "configure:2428: 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 2467 "configure"
+#line 2433 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2486,7 +2452,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2456: \"$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
@@ -2513,12 +2479,12 @@
 for ac_func in res_init snprintf vsnprintf setsid setpgid setpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2517: checking for $ac_func" >&5
+echo "configure:2483: 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 2522 "configure"
+#line 2488 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2541,7 +2507,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2511: \"$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
@@ -2568,12 +2534,12 @@
 for ac_func in setlocale strcoll strncoll inet_ntop
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2572: checking for $ac_func" >&5
+echo "configure:2538: 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 2577 "configure"
+#line 2543 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2596,7 +2562,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2566: \"$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
@@ -2621,7 +2587,7 @@
 done
 
 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:2625: checking whether setpgrp takes no argument" >&5
+echo "configure:2591: checking whether setpgrp takes no argument" >&5
 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2629,7 +2595,7 @@
   { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 2633 "configure"
+#line 2599 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_UNISTD_H
@@ -2649,7 +2615,7 @@
 }
 
 EOF
-if { (eval echo configure:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_setpgrp_void=no
 else
@@ -2673,7 +2639,7 @@
 fi
 
 echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
-echo "configure:2677: checking whether setvbuf arguments are reversed" >&5
+echo "configure:2643: checking whether setvbuf arguments are reversed" >&5
 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2681,7 +2647,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 2685 "configure"
+#line 2651 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 /* If setvbuf has the reversed format, exit 0. */
@@ -2695,7 +2661,7 @@
   exit(0);			/* Non-reversed systems segv here.  */
 }
 EOF
-if { (eval echo configure:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_setvbuf_reversed=yes
 else
@@ -2720,10 +2686,10 @@
 
 
 echo $ac_n "checking for sigsetjmp and siglongjmp""... $ac_c" 1>&6
-echo "configure:2724: checking for sigsetjmp and siglongjmp" >&5
+echo "configure:2690: checking for sigsetjmp and siglongjmp" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 2727 "configure"
+#line 2693 "configure"
 #include "confdefs.h"
 
 	/* includes */
@@ -2746,7 +2712,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 	cat >> confdefs.h <<\EOF
@@ -2775,9 +2741,9 @@
 
 	# maxx or _maxx
 	echo $ac_n "checking whether curses structure has maxx or _maxx field""... $ac_c" 1>&6
-echo "configure:2779: checking whether curses structure has maxx or _maxx field" >&5
+echo "configure:2745: checking whether curses structure has maxx or _maxx field" >&5
 	cat > conftest.$ac_ext <<EOF
-#line 2781 "configure"
+#line 2747 "configure"
 #include "confdefs.h"
 
 	/* includes */
@@ -2804,7 +2770,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 echo "$ac_t""maxx" 1>&6
@@ -2825,9 +2791,9 @@
 
 	# getbegx
 	echo $ac_n "checking for getbegx() functionality in curses library""... $ac_c" 1>&6
-echo "configure:2829: checking for getbegx() functionality in curses library" >&5
+echo "configure:2795: checking for getbegx() functionality in curses library" >&5
 	cat > conftest.$ac_ext <<EOF
-#line 2831 "configure"
+#line 2797 "configure"
 #include "confdefs.h"
 
 	/* includes */
@@ -2857,7 +2823,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 	cat >> confdefs.h <<\EOF
@@ -2879,9 +2845,9 @@
 
 	# getmaxx
 	echo $ac_n "checking for getmaxx() functionality in curses library""... $ac_c" 1>&6
-echo "configure:2883: checking for getmaxx() functionality in curses library" >&5
+echo "configure:2849: checking for getmaxx() functionality in curses library" >&5
 	cat > conftest.$ac_ext <<EOF
-#line 2885 "configure"
+#line 2851 "configure"
 #include "confdefs.h"
 
 	/* includes */
@@ -2910,7 +2876,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 	cat >> confdefs.h <<\EOF
@@ -2931,9 +2897,9 @@
 
 	# getmaxyx
 	echo $ac_n "checking for getmaxyx() functionality in curses library""... $ac_c" 1>&6
-echo "configure:2935: checking for getmaxyx() functionality in curses library" >&5
+echo "configure:2901: checking for getmaxyx() functionality in curses library" >&5
 	cat > conftest.$ac_ext <<EOF
-#line 2937 "configure"
+#line 2903 "configure"
 #include "confdefs.h"
 
 	/* includes */
@@ -2962,7 +2928,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 	cat >> confdefs.h <<\EOF
@@ -2983,9 +2949,9 @@
 
 	# touchwin
 	echo $ac_n "checking for touchwin() functionality in curses library""... $ac_c" 1>&6
-echo "configure:2987: checking for touchwin() functionality in curses library" >&5
+echo "configure:2953: checking for touchwin() functionality in curses library" >&5
 	cat > conftest.$ac_ext <<EOF
-#line 2989 "configure"
+#line 2955 "configure"
 #include "confdefs.h"
 
 	/* includes */
@@ -3012,7 +2978,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 	cat >> confdefs.h <<\EOF
@@ -3033,9 +2999,9 @@
 
 	# beep
 	echo $ac_n "checking for beep() functionality in curses library""... $ac_c" 1>&6
-echo "configure:3037: checking for beep() functionality in curses library" >&5
+echo "configure:3003: checking for beep() functionality in curses library" >&5
 	cat > conftest.$ac_ext <<EOF
-#line 3039 "configure"
+#line 3005 "configure"
 #include "confdefs.h"
 
 	/* includes */
@@ -3061,7 +3027,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 	cat >> confdefs.h <<\EOF
@@ -3083,12 +3049,12 @@
 	for ac_func in keypad nodelay curs_set doupdate wnoutrefresh
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3087: checking for $ac_func" >&5
+echo "configure:3053: 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 3092 "configure"
+#line 3058 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3111,7 +3077,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3081: \"$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
@@ -3147,12 +3113,12 @@
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3151: checking for ANSI C header files" >&5
+echo "configure:3117: 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 3156 "configure"
+#line 3122 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -3160,7 +3126,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3130: \"$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*
@@ -3177,7 +3143,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 3181 "configure"
+#line 3147 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -3195,7 +3161,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 3199 "configure"
+#line 3165 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -3216,7 +3182,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 3220 "configure"
+#line 3186 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3227,7 +3193,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:3231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -3254,17 +3220,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3258: checking for $ac_hdr" >&5
+echo "configure:3224: 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 3263 "configure"
+#line 3229 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3234: \"$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*
@@ -3294,17 +3260,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3298: checking for $ac_hdr" >&5
+echo "configure:3264: 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 3303 "configure"
+#line 3269 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3274: \"$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*
@@ -3334,17 +3300,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3338: checking for $ac_hdr" >&5
+echo "configure:3304: 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 3343 "configure"
+#line 3309 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3314: \"$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*
@@ -3374,17 +3340,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3378: checking for $ac_hdr" >&5
+echo "configure:3344: 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 3383 "configure"
+#line 3349 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3354: \"$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*
@@ -3417,17 +3383,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3421: checking for $ac_hdr" >&5
+echo "configure:3387: 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 3426 "configure"
+#line 3392 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3397: \"$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*
@@ -3458,17 +3424,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3462: checking for $ac_hdr" >&5
+echo "configure:3428: 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 3467 "configure"
+#line 3433 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3438: \"$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*
@@ -3497,11 +3463,11 @@
 fi
 if test "$ac_cv_header_sys_select_h" = yes ; then
 	echo $ac_n "checking if <sys/select.h> is compatible with <sys/time.h>""... $ac_c" 1>&6
-echo "configure:3501: checking if <sys/select.h> is compatible with <sys/time.h>" >&5
+echo "configure:3467: checking if <sys/select.h> is compatible with <sys/time.h>" >&5
 	selecth=yes
 	if test "$ac_cv_header_sys_time_h" = yes ; then
 		cat > conftest.$ac_ext <<EOF
-#line 3505 "configure"
+#line 3471 "configure"
 #include "confdefs.h"
 
 #if defined(_AIX) || defined(__aix) || defined(__AIX)
@@ -3521,7 +3487,7 @@
 		tmval.tv_sec = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:3525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   selecth=yes
 else
@@ -3542,7 +3508,7 @@
 fi
 
 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
-echo "configure:3546: checking types of arguments for select()" >&5
+echo "configure:3512: checking types of arguments for select()" >&5
  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3556,7 +3522,7 @@
      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
        cat > conftest.$ac_ext <<EOF
-#line 3560 "configure"
+#line 3526 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -3575,7 +3541,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
           ac_not_found=no ; break 3
 else
@@ -3615,12 +3581,12 @@
 
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3619: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3585: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3624 "configure"
+#line 3590 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3628,7 +3594,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3649,12 +3615,12 @@
 fi
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:3653: checking for st_blksize in struct stat" >&5
+echo "configure:3619: checking for st_blksize in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3658 "configure"
+#line 3624 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3662,7 +3628,7 @@
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:3666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -3683,12 +3649,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3687: checking for size_t" >&5
+echo "configure:3653: 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 3692 "configure"
+#line 3658 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3716,12 +3682,12 @@
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3720: checking for off_t" >&5
+echo "configure:3686: 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 3725 "configure"
+#line 3691 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3749,12 +3715,12 @@
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3753: checking for mode_t" >&5
+echo "configure:3719: 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 3758 "configure"
+#line 3724 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3782,12 +3748,12 @@
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3786: checking for pid_t" >&5
+echo "configure:3752: 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 3791 "configure"
+#line 3757 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3815,12 +3781,12 @@
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3819: checking for uid_t in sys/types.h" >&5
+echo "configure:3785: 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 3824 "configure"
+#line 3790 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3850,9 +3816,9 @@
 
 
 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:3854: checking for sig_atomic_t" >&5
+echo "configure:3820: checking for sig_atomic_t" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3856 "configure"
+#line 3822 "configure"
 #include "confdefs.h"
 
 	/* includes */
@@ -3877,7 +3843,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 	ac_cv_type_sig_atomic_t=yes
@@ -3901,7 +3867,7 @@
 
 
 echo $ac_n "checking for 64-bit integral type: long long""... $ac_c" 1>&6
-echo "configure:3905: checking for 64-bit integral type: long long" >&5
+echo "configure:3871: checking for 64-bit integral type: long long" >&5
 LONGEST_INT="long"
 if test "$cross_compiling" = yes; then
   
@@ -3910,7 +3876,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 3914 "configure"
+#line 3880 "configure"
 #include "confdefs.h"
 
 	/* program */
@@ -3933,7 +3899,7 @@
 
 
 EOF
-if { (eval echo configure:3937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
 	# action if true
@@ -3957,7 +3923,7 @@
 if test "$wi_cv_type_long_long" = yes ; then
 	
 echo $ac_n "checking how to print a 64-bit integral type""... $ac_c" 1>&6
-echo "configure:3961: checking how to print a 64-bit integral type" >&5
+echo "configure:3927: checking how to print a 64-bit integral type" >&5
 wi_cv_printf_long_long=fail
 
 if test "$cross_compiling" = yes; then
@@ -3967,7 +3933,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 3971 "configure"
+#line 3937 "configure"
 #include "confdefs.h"
 
 	/* program */
@@ -3991,7 +3957,7 @@
 }
 
 EOF
-if { (eval echo configure:3995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
 	# action if true
@@ -4020,7 +3986,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 4024 "configure"
+#line 3990 "configure"
 #include "confdefs.h"
 
 	/* program */
@@ -4044,7 +4010,7 @@
 }
 
 EOF
-if { (eval echo configure:4048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
 	# action if true
@@ -4074,7 +4040,7 @@
 
 	
 echo $ac_n "checking how to scan a 64-bit integral type""... $ac_c" 1>&6
-echo "configure:4078: checking how to scan a 64-bit integral type" >&5
+echo "configure:4044: checking how to scan a 64-bit integral type" >&5
 wi_cv_scanf_long_long=fail
 
 if test "$cross_compiling" = yes; then
@@ -4084,7 +4050,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 4088 "configure"
+#line 4054 "configure"
 #include "confdefs.h"
 
 	/* program */
@@ -4111,7 +4077,7 @@
 }
 
 EOF
-if { (eval echo configure:4115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
 	# action if true
@@ -4140,7 +4106,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 4144 "configure"
+#line 4110 "configure"
 #include "confdefs.h"
 
 	/* program */
@@ -4167,7 +4133,7 @@
 }
 
 EOF
-if { (eval echo configure:4171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
 	# action if true
@@ -4198,7 +4164,7 @@
 fi
 
 echo $ac_n "checking if everything was available to use the 64-bit integral type""... $ac_c" 1>&6
-echo "configure:4202: checking if everything was available to use the 64-bit integral type" >&5
+echo "configure:4168: checking if everything was available to use the 64-bit integral type" >&5
 
 if test "$wi_cv_type_long_long" = no ; then
 	wi_cv_use_long_long_msg_result="no (long long type not available)"
@@ -4223,12 +4189,6 @@
 #define HAVE_LONG_LONG 1
 EOF
 
-	if test "$wi_cv_printf_long_long$wi_cv_scanf_long_long" = "%lld%qd" ; then
-		# FreeBSD 3.2 has %lld and %qd, but we want to
-		# run on 3.1 and 3.0.
-		#
-		wi_cv_printf_long_long="%qd"
-	fi
 	cat >> confdefs.h <<EOF
 #define PRINTF_LONG_LONG "$wi_cv_printf_long_long"
 EOF
@@ -4266,9 +4226,9 @@
 
 
 echo $ac_n "checking for useable _res global variable""... $ac_c" 1>&6
-echo "configure:4270: checking for useable _res global variable" >&5
+echo "configure:4230: checking for useable _res global variable" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4272 "configure"
+#line 4232 "configure"
 #include "confdefs.h"
 
 	/* includes */
@@ -4295,7 +4255,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 	wi_cv__res_defdname=yes
@@ -4316,7 +4276,7 @@
 echo "$ac_t""$wi_cv__res_defdname" 1>&6
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:4320: checking for long file names" >&5
+echo "configure:4280: checking for long file names" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4363,7 +4323,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4367: checking for $ac_word" >&5
+echo "configure:4327: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4421,7 +4381,7 @@
 # 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:4425: checking for a BSD compatible install" >&5
+echo "configure:4385: 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
@@ -4478,7 +4438,7 @@
 # Extract the first word of ""tar"", so it can be a program name with args.
 set dummy "tar"; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4482: checking for $ac_word" >&5
+echo "configure:4442: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4531,6 +4491,331 @@
 		chmod a+r libncftp/ncftp.h
 	fi
 fi
+
+echo $ac_n "checking whether to enable ipv6""... $ac_c" 1>&6
+echo "configure:4497: checking whether to enable ipv6" >&5
+# Check whether --enable-ipv6 or --disable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then
+  enableval="$enable_ipv6"
+   case "$enableval" in
+  no)
+       echo "$ac_t""no" 1>&6
+       ipv6=no
+       ;;
+  *)   echo "$ac_t""yes" 1>&6
+       cat >> confdefs.h <<\EOF
+#define ENABLE_IPV6 1
+EOF
+
+       ipv6=yes
+       ;;
+  esac 
+else
+  if test "$cross_compiling" = yes; then
+  echo "$ac_t""no" 1>&6
+  ipv6=no
+
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4521 "configure"
+#include "confdefs.h"
+ /* AF_INET6 avalable check */
+#define INET6
+#include <sys/types.h>
+#include <sys/socket.h>
+main()
+{
+  exit(0);
+ if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
+   exit(1);
+ else
+   exit(0);
+}
+
+EOF
+if { (eval echo configure:4537: \"$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
+  cat >> confdefs.h <<\EOF
+#define ENABLE_IPV6 1
+EOF
+
+  ipv6=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  echo "$ac_t""no" 1>&6
+  ipv6=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+
+# Check whether --with-ipv6-includes or --without-ipv6-includes was given.
+if test "${with_ipv6_includes+set}" = set; then
+  withval="$with_ipv6_includes"
+  :
+fi
+
+test -n "${with_ipv6_includes}" && CFLAGS="-I${with_ipv6_includes} $CFLAGS"
+# Check whether --with-ipv6-libraries or --without-ipv6-libraries was given.
+if test "${with_ipv6_libraries+set}" = set; then
+  withval="$with_ipv6_libraries"
+  :
+fi
+
+test -n "${with_ipv6_libraries}" && LDFLAGS="-L${with_ipv6_libraries} $LDFLAGS"
+# Check whether --with-ipv6-libname or --without-ipv6-libname was given.
+if test "${with_ipv6_libname+set}" = set; then
+  withval="$with_ipv6_libname"
+  :
+fi
+
+test -n "${with_ipv6_libname}" && LIBS="$LIBS -l${with_ipv6_libname}"
+
+echo $ac_n "checking for getnameinfo""... $ac_c" 1>&6
+echo "configure:4581: checking for getnameinfo" >&5
+if eval "test \"`echo '$''{'ac_cv_func_getnameinfo'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4586 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char getnameinfo(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char getnameinfo();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_getnameinfo) || defined (__stub___getnameinfo)
+choke me
+#else
+getnameinfo();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_getnameinfo=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_getnameinfo=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'getnameinfo`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6
+echo "configure:4629: checking for getaddrinfo" >&5
+if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4634 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char getaddrinfo(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char getaddrinfo();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_getaddrinfo) || defined (__stub___getaddrinfo)
+choke me
+#else
+getaddrinfo();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_getaddrinfo=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_getaddrinfo=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'getaddrinfo`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+echo $ac_n "checking getaddrinfo bug""... $ac_c" 1>&6
+echo "configure:4673: checking getaddrinfo bug" >&5
+if test "$cross_compiling" = yes; then
+  echo "$ac_t""buggy" 1>&6
+buggygetaddrinfo=yes
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4679 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <netdb.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+main()
+{
+  int passive, gaierr, inet4 = 0, inet6 = 0;
+  struct addrinfo hints, *ai, *aitop;
+  char straddr[INET6_ADDRSTRLEN], strport[16];
+
+  for (passive = 0; passive <= 1; passive++) {
+    memset(&hints, 0, sizeof(hints));
+    hints.ai_family = AF_UNSPEC;
+    hints.ai_flags = passive ? AI_PASSIVE : 0;
+    hints.ai_socktype = SOCK_STREAM;
+    if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
+      (void)gai_strerror(gaierr);
+      goto bad;
+    }
+    for (ai = aitop; ai; ai = ai->ai_next) {
+      if (ai->ai_addr == NULL ||
+          ai->ai_addrlen == 0 ||
+          getnameinfo(ai->ai_addr, ai->ai_addrlen,
+                      straddr, sizeof(straddr), strport, sizeof(strport),
+                      NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
+        goto bad;
+      }
+      if (strcmp(strport, "54321") != 0) {
+        goto bad;
+      }
+      switch (ai->ai_family) {
+      case AF_INET:
+        if (passive) {
+          if (strcmp(straddr, "0.0.0.0") != 0) {
+            goto bad;
+          }
+        } else {
+          if (strcmp(straddr, "127.0.0.1") != 0) {
+            goto bad;
+          }
+        }
+        inet4++;
+        break;
+      case AF_INET6:
+        if (passive) {
+          if (strcmp(straddr, "::") != 0) {
+            goto bad;
+          }
+        } else {
+          if (strcmp(straddr, "::1") != 0) {
+            goto bad;
+          }
+        }
+        inet6++;
+        break;
+      case AF_UNSPEC:
+        goto bad;
+        break;
+      default:
+        /* another family support? */
+        break;
+      }
+    }
+  }
+
+  if (!(inet4 == 0 || inet4 == 2))
+    goto bad;
+  if (!(inet6 == 0 || inet6 == 2))
+    goto bad;
+
+  if (aitop)
+    freeaddrinfo(aitop);
+  exit(0);
+
+ bad:
+  if (aitop)
+    freeaddrinfo(aitop);
+  exit(1);
+}
+
+EOF
+if { (eval echo configure:4765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  echo "$ac_t""good" 1>&6
+buggygetaddrinfo=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  echo "$ac_t""buggy" 1>&6
+buggygetaddrinfo=yes
+fi
+rm -fr conftest*
+fi
+
+
+if test "$buggygetaddrinfo" = "yes"; then
+	if test "$ipv6" = "yes"; then
+		echo 'Fatal: You must get working getaddrinfo() function.'
+		echo '       or you can specify "--disable-ipv6"'.
+		exit 1
+	fi
+fi
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+# check if sockaddr has sa_len member
+echo $ac_n "checking if sockaddr has sa_len member""... $ac_c" 1>&6
+echo "configure:4795: checking if sockaddr has sa_len member" >&5
+cat > conftest.$ac_ext <<EOF
+#line 4797 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+int main() {
+struct sockaddr x;
+x.sa_len = 0;
+; return 0; }
+EOF
+if { (eval echo configure:4806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+       cat >> confdefs.h <<\EOF
+#define HAVE_SOCKADDR_SA_LEN 1
+EOF
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
 
 CPPFLAGS="-I$MAINDIR $CPPFLAGS"
 
Index: ncftp3/configure.in
diff -u ncftp3/configure.in:1.1.1.3 ncftp3/configure.in:1.8
--- ncftp3/configure.in:1.1.1.3	Wed Apr 12 21:45:51 2000
+++ ncftp3/configure.in	Wed Apr 12 21:49:27 2000
@@ -189,6 +189,165 @@
 	fi
 fi
 
+AC_MSG_CHECKING([whether to enable ipv6])
+AC_ARG_ENABLE(ipv6,
+[  --enable-ipv6		Enable ipv6 (with ipv4) support
+  --disable-ipv6		Disable ipv6 support],
+[ case "$enableval" in
+  no)
+       AC_MSG_RESULT(no)
+       ipv6=no
+       ;;
+  *)   AC_MSG_RESULT(yes)
+       AC_DEFINE(ENABLE_IPV6)
+       ipv6=yes
+       ;;
+  esac ],
+
+  AC_TRY_RUN([ /* AF_INET6 avalable check */
+#define INET6
+#include <sys/types.h>
+#include <sys/socket.h>
+main()
+{
+  exit(0);
+ if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
+   exit(1);
+ else
+   exit(0);
+}
+],
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(ENABLE_IPV6)
+  ipv6=yes,
+  AC_MSG_RESULT(no)
+  ipv6=no,
+  AC_MSG_RESULT(no)
+  ipv6=no
+))
+
+AC_ARG_WITH(ipv6-includes,
+[  --with-ipv6-includes=DIR Search for IPv6 header files in DIR])
+test -n "${with_ipv6_includes}" && CFLAGS="-I${with_ipv6_includes} $CFLAGS"
+AC_ARG_WITH(ipv6-libraries,
+[  --with-ipv6-libraries=DIR Search for IPv6 libraries in DIR])
+test -n "${with_ipv6_libraries}" && LDFLAGS="-L${with_ipv6_libraries} $LDFLAGS"
+AC_ARG_WITH(ipv6-libname,
+[  --with-ipv6-libname=NAME library name for IPv6])
+test -n "${with_ipv6_libname}" && LIBS="$LIBS -l${with_ipv6_libname}"
+
+AC_CHECK_FUNC(getnameinfo)
+AC_CHECK_FUNC(getaddrinfo, [
+AC_MSG_CHECKING(getaddrinfo bug)
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <netdb.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+main()
+{
+  int passive, gaierr, inet4 = 0, inet6 = 0;
+  struct addrinfo hints, *ai, *aitop;
+  char straddr[INET6_ADDRSTRLEN], strport[16];
+
+  for (passive = 0; passive <= 1; passive++) {
+    memset(&hints, 0, sizeof(hints));
+    hints.ai_family = AF_UNSPEC;
+    hints.ai_flags = passive ? AI_PASSIVE : 0;
+    hints.ai_socktype = SOCK_STREAM;
+    if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
+      (void)gai_strerror(gaierr);
+      goto bad;
+    }
+    for (ai = aitop; ai; ai = ai->ai_next) {
+      if (ai->ai_addr == NULL ||
+          ai->ai_addrlen == 0 ||
+          getnameinfo(ai->ai_addr, ai->ai_addrlen,
+                      straddr, sizeof(straddr), strport, sizeof(strport),
+                      NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
+        goto bad;
+      }
+      if (strcmp(strport, "54321") != 0) {
+        goto bad;
+      }
+      switch (ai->ai_family) {
+      case AF_INET:
+        if (passive) {
+          if (strcmp(straddr, "0.0.0.0") != 0) {
+            goto bad;
+          }
+        } else {
+          if (strcmp(straddr, "127.0.0.1") != 0) {
+            goto bad;
+          }
+        }
+        inet4++;
+        break;
+      case AF_INET6:
+        if (passive) {
+          if (strcmp(straddr, "::") != 0) {
+            goto bad;
+          }
+        } else {
+          if (strcmp(straddr, "::1") != 0) {
+            goto bad;
+          }
+        }
+        inet6++;
+        break;
+      case AF_UNSPEC:
+        goto bad;
+        break;
+      default:
+        /* another family support? */
+        break;
+      }
+    }
+  }
+
+  if (!(inet4 == 0 || inet4 == 2))
+    goto bad;
+  if (!(inet6 == 0 || inet6 == 2))
+    goto bad;
+
+  if (aitop)
+    freeaddrinfo(aitop);
+  exit(0);
+
+ bad:
+  if (aitop)
+    freeaddrinfo(aitop);
+  exit(1);
+}
+],
+AC_MSG_RESULT(good)
+buggygetaddrinfo=no,
+AC_MSG_RESULT(buggy)
+buggygetaddrinfo=yes,
+AC_MSG_RESULT(buggy)
+buggygetaddrinfo=yes)
+
+if test "$buggygetaddrinfo" = "yes"; then
+	if test "$ipv6" = "yes"; then
+		echo 'Fatal: You must get working getaddrinfo() function.'
+		echo '       or you can specify "--disable-ipv6"'.
+		exit 1
+	fi
+fi
+])
+
+# check if sockaddr has sa_len member
+AC_MSG_CHECKING(if sockaddr has sa_len member)
+AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/socket.h>],
+[struct sockaddr x;
+x.sa_len = 0;],
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_SOCKADDR_SA_LEN),
+       AC_MSG_RESULT(no))
+
 CPPFLAGS="-I$MAINDIR $CPPFLAGS"
 
 if test "$no_signals" = no ; then
Index: ncftp3/autoconf/configure.in
diff -u ncftp3/autoconf/configure.in:1.1.1.4 ncftp3/autoconf/configure.in:1.15
--- ncftp3/autoconf/configure.in:1.1.1.4	Tue Oct 19 02:39:22 1999
+++ ncftp3/autoconf/configure.in	Wed Apr 12 21:49:28 2000
@@ -11,13 +11,24 @@
 AC_ARG_ENABLE(curses,[  --disable-curses        do not try to find and use the curses library],nc_cv_curses=$enableval)
 AC_ARG_ENABLE(ncurses,[  --disable-ncurses       do not try to find and use the ncurses library],nc_cv_ncurses=$enableval)
 dnl AC_ARG_ENABLE(readline,[  --disable-readline      do not try to find and use the readline library],nc_cv_readline=$enableval)
-AC_ARG_ENABLE(signals,[  --enable-signals       allow use of signal handling],[no_signals=no])
+AC_ARG_ENABLE(signals,[  --disable-select        use alarm() for timeout handling rather than select()],[no_signals=no])
 AC_ARG_ENABLE(extra-dirs,[  --disable-extra-dirs    do not look for extra -I/include and -L/lib dirs],nc_cv_extra_dirs=$enableval)
 
 wi_OS_VAR
 
 changequote(<<, >>)dnl
 MAINDIR=`pwd`
+if test -f "$MAINDIR/sh/dos2unix.sh" ; then
+	chmod u+rwx $MAINDIR/sh/dos2unix.sh
+	for dir in . ; do
+		if [ -d "$dir" ] ; then
+			dir=`cd "$dir" ; pwd`
+			find "$dir" -name '*.in' -exec "$MAINDIR/sh/dos2unix.sh" {} \;
+			find "$dir" -name '*.h' -exec "$MAINDIR/sh/dos2unix.sh" {} \;
+			find "$dir" -name '*.c' -exec "$MAINDIR/sh/dos2unix.sh" {} \;
+		fi
+	done
+fi
 MAKE=make
 STATIC=""
 Z30='#'
@@ -177,6 +188,165 @@
 		chmod a+r libncftp/ncftp.h
 	fi
 fi
+
+AC_MSG_CHECKING([whether to enable ipv6])
+AC_ARG_ENABLE(ipv6,
+[  --enable-ipv6		Enable ipv6 (with ipv4) support
+  --disable-ipv6		Disable ipv6 support],
+[ case "$enableval" in
+  no)
+       AC_MSG_RESULT(no)
+       ipv6=no
+       ;;
+  *)   AC_MSG_RESULT(yes)
+       AC_DEFINE(ENABLE_IPV6)
+       ipv6=yes
+       ;;
+  esac ],
+
+  AC_TRY_RUN([ /* AF_INET6 avalable check */
+#define INET6
+#include <sys/types.h>
+#include <sys/socket.h>
+main()
+{
+  exit(0);
+ if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
+   exit(1);
+ else
+   exit(0);
+}
+],
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(ENABLE_IPV6)
+  ipv6=yes,
+  AC_MSG_RESULT(no)
+  ipv6=no,
+  AC_MSG_RESULT(no)
+  ipv6=no
+))
+
+AC_ARG_WITH(ipv6-includes,
+[  --with-ipv6-includes=DIR Search for IPv6 header files in DIR])
+test -n "${with_ipv6_includes}" && CFLAGS="-I${with_ipv6_includes} $CFLAGS"
+AC_ARG_WITH(ipv6-libraries,
+[  --with-ipv6-libraries=DIR Search for IPv6 libraries in DIR])
+test -n "${with_ipv6_libraries}" && LDFLAGS="-L${with_ipv6_libraries} $LDFLAGS"
+AC_ARG_WITH(ipv6-libname,
+[  --with-ipv6-libname=NAME library name for IPv6])
+test -n "${with_ipv6_libname}" && LIBS="$LIBS -l${with_ipv6_libname}"
+
+AC_CHECK_FUNC(getnameinfo)
+AC_CHECK_FUNC(getaddrinfo, [
+AC_MSG_CHECKING(getaddrinfo bug)
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <netdb.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+main()
+{
+  int passive, gaierr, inet4 = 0, inet6 = 0;
+  struct addrinfo hints, *ai, *aitop;
+  char straddr[INET6_ADDRSTRLEN], strport[16];
+
+  for (passive = 0; passive <= 1; passive++) {
+    memset(&hints, 0, sizeof(hints));
+    hints.ai_family = AF_UNSPEC;
+    hints.ai_flags = passive ? AI_PASSIVE : 0;
+    hints.ai_socktype = SOCK_STREAM;
+    if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
+      (void)gai_strerror(gaierr);
+      goto bad;
+    }
+    for (ai = aitop; ai; ai = ai->ai_next) {
+      if (ai->ai_addr == NULL ||
+          ai->ai_addrlen == 0 ||
+          getnameinfo(ai->ai_addr, ai->ai_addrlen,
+                      straddr, sizeof(straddr), strport, sizeof(strport),
+                      NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
+        goto bad;
+      }
+      if (strcmp(strport, "54321") != 0) {
+        goto bad;
+      }
+      switch (ai->ai_family) {
+      case AF_INET:
+        if (passive) {
+          if (strcmp(straddr, "0.0.0.0") != 0) {
+            goto bad;
+          }
+        } else {
+          if (strcmp(straddr, "127.0.0.1") != 0) {
+            goto bad;
+          }
+        }
+        inet4++;
+        break;
+      case AF_INET6:
+        if (passive) {
+          if (strcmp(straddr, "::") != 0) {
+            goto bad;
+          }
+        } else {
+          if (strcmp(straddr, "::1") != 0) {
+            goto bad;
+          }
+        }
+        inet6++;
+        break;
+      case AF_UNSPEC:
+        goto bad;
+        break;
+      default:
+        /* another family support? */
+        break;
+      }
+    }
+  }
+
+  if (!(inet4 == 0 || inet4 == 2))
+    goto bad;
+  if (!(inet6 == 0 || inet6 == 2))
+    goto bad;
+
+  if (aitop)
+    freeaddrinfo(aitop);
+  exit(0);
+
+ bad:
+  if (aitop)
+    freeaddrinfo(aitop);
+  exit(1);
+}
+],
+AC_MSG_RESULT(good)
+buggygetaddrinfo=no,
+AC_MSG_RESULT(buggy)
+buggygetaddrinfo=yes,
+AC_MSG_RESULT(buggy)
+buggygetaddrinfo=yes)
+
+if test "$buggygetaddrinfo" = "yes"; then
+	if test "$ipv6" = "yes"; then
+		echo 'Fatal: You must get working getaddrinfo() function.'
+		echo '       or you can specify "--disable-ipv6"'.
+		exit 1
+	fi
+fi
+])
+
+# check if sockaddr has sa_len member
+AC_MSG_CHECKING(if sockaddr has sa_len member)
+AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/socket.h>],
+[struct sockaddr x;
+x.sa_len = 0;],
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_SOCKADDR_SA_LEN),
+       AC_MSG_RESULT(no))
 
 CPPFLAGS="-I$MAINDIR $CPPFLAGS"
 
Index: ncftp3/libncftp/ftp.c
diff -u ncftp3/libncftp/ftp.c:1.1.1.6 ncftp3/libncftp/ftp.c:1.24
--- ncftp3/libncftp/ftp.c:1.1.1.6	Fri Mar 24 18:02:33 2000
+++ ncftp3/libncftp/ftp.c	Fri Mar 24 18:12:15 2000
@@ -43,6 +43,7 @@
 
 
 
+#ifndef ENABLE_IPV6
 /* On entry, you should have 'host' be set to a symbolic name (like
  * cse.unl.edu), or set to a numeric address (like 129.93.3.1).
  * If the function fails, it will return NULL, but if the host was
@@ -72,6 +73,7 @@
 		*ip_address = ip;
 	return (hp);
 }	/* GetHostEntry */
+#endif
 
 
 
@@ -219,9 +221,13 @@
 
 
 static int
-GetSocketAddress(const FTPCIPtr cip, int sockfd, struct sockaddr_in *saddr)
+GetSocketAddress(const FTPCIPtr cip, int sockfd, struct sockaddr *saddr)
 {
+#ifdef ENABLE_IPV6
+	int len = (int) sizeof (struct sockaddr_storage);
+#else
 	int len = (int) sizeof (struct sockaddr_in);
+#endif
 	int result = 0;
 
 	if (getsockname(sockfd, (struct sockaddr *)saddr, &len) < 0) {
@@ -354,7 +360,16 @@
 	volatile int sock2fd = -1;
 	ResponsePtr rp;
 	char **volatile curaddr;
+#ifdef ENABLE_IPV6
+	struct addrinfo hints;
+	struct addrinfo *res, *res0;
+	struct sockaddr_in *sin;
+	struct sockaddr_in6 *sin6;
+	int error;
+	char buf[NI_MAXHOST];
+#else
 	struct hostent *hp;
+#endif
 	char *volatile fhost;
 	unsigned int fport;
 #ifndef NO_SIGNALS
@@ -382,7 +397,21 @@
 	cip->cin = NULL;
 	cip->cout = NULL;
 
-	/* Make sure we use network byte-order. */
+#ifdef ENABLE_IPV6
+	memset(&hints, 0, sizeof(hints));
+	hints.ai_flags = AI_CANONNAME;
+	hints.ai_family = PF_UNSPEC;
+	hints.ai_socktype = SOCK_STREAM;
+	hints.ai_protocol = IPPROTO_TCP;
+	sprintf(buf, "%d\0", fport);
+	error = getaddrinfo(fhost, buf, &hints, &res0);
+	if (error) {
+		Error(cip, kDontPerror, "%s: %s.\n", fhost, gai_strerror(error));
+		cip->errNo = kErrHostUnknown;
+		return (kErrHostUnknown);
+	}
+#else
+ 	/* Make sure we use network byte-order. */
 	fport = (unsigned int) htons((unsigned short) fport);
 
 	cip->servCtlAddr.sin_port = (unsigned short) fport;
@@ -404,6 +433,7 @@
 		cip->servCtlAddr.sin_family = hp->h_addrtype;
 		/* We'll fill in the rest of the structure below. */
 	}
+#endif
 	
 	/* After obtaining a socket, try to connect it to a remote
 	 * address.  If we didn't get a host entry, we will only have
@@ -411,6 +441,7 @@
 	 * every address in the list from the host entry.
 	 */
 
+#ifndef ENABLE_IPV6
 	if (hp == NULL) {
 		/* Since we're given a single raw address, and not a host entry,
 		 * we can only try this one address and not any other addresses
@@ -493,9 +524,19 @@
 		}
 #endif	/* NO_SIGNALS */
 	} else {
+#endif
 		/* We can try each address in the list.  We'll quit when we
 		 * run out of addresses to try or get a successful connection.
 		 */
+#ifdef ENABLE_IPV6
+		for (res = res0; res; res = res->ai_next) {
+			(void) memcpy(&cip->servCtlAddr, res->ai_addr, (size_t)res->ai_addrlen);
+			if ((sockfd = socket(cip->servCtlAddr.ss_family, SOCK_STREAM, 0)) < 0) {
+				Error(cip, kDoPerror, "Could not get a socket.\n");
+				cip->errNo = kErrNewStreamSocket;
+				return (kErrNewStreamSocket);
+			}
+#else
 		for (curaddr = hp->h_addr_list; *curaddr != NULL; curaddr++) {
 			if ((sockfd = socket(cip->servCtlAddr.sin_family, SOCK_STREAM, 0)) < 0) {
 				Error(cip, kDoPerror, "Could not get a socket.\n");
@@ -507,6 +548,8 @@
 			 * just for this purpose.
 			 */
 			(void) memcpy(&cip->servCtlAddr.sin_addr, *curaddr, (size_t) hp->h_length);
+			cip->servCtlAddr.sin_family = hp->h_addrtype;
+#endif
 
 			/* This doesn't do anything if you left these
 			 * at their defaults (zero).  Otherwise it
@@ -561,8 +604,18 @@
 				}
 				return (result);
 			} else {
+#ifdef ENABLE_IPV6
+#ifdef HAVE_SOCKADDR_SA_LEN
 				err = connect(sockfd, (struct sockaddr *) &cip->servCtlAddr,
+					      cip->servCtlAddr.ss_len);
+#else
+				err = connect(sockfd, (struct sockaddr *) &cip->servCtlAddr,
+					      SA_LEN((struct sockaddr *)&cip->servCtlAddr));
+#endif
+#else
+				err = connect(sockfd, (struct sockaddr *) &cip->servCtlAddr,
 					      (int) sizeof (cip->servCtlAddr));
+#endif
 				if (cip->connTimeout > 0) {
 					(void) alarm(0);
 					(void) signal(SIGALRM, (FTPSigProc) osigalrm);
@@ -578,7 +631,12 @@
 			sockfd = -1;
 #endif /* NO_SIGNALS */
 		}
+#ifndef ENABLE_IPV6
 	}
+#endif
+#ifdef ENABLE_IPV6
+	freeaddrinfo(res0);
+#endif
 	
 	if (err < 0) {
 		/* Could not connect.  Close up shop and go home. */
@@ -636,7 +694,7 @@
 	}
 
 	/* Get our end of the socket address for later use. */
-	if ((result = GetSocketAddress(cip, sockfd, &cip->ourCtlAddr)) < 0)
+	if ((result = GetSocketAddress(cip, sockfd, (struct sockaddr *)&cip->ourCtlAddr)) < 0)
 		goto fatal;
 
 #ifdef SO_OOBINLINE
@@ -711,6 +769,20 @@
 #endif
 #endif	/* NO_SIGNALS */
 
+#ifdef ENABLE_IPV6
+#ifdef HAVE_SOCKADDR_SA_LEN
+	getnameinfo((struct sockaddr*)&cip->servCtlAddr, cip->servCtlAddr.ss_len, buf,
+		    sizeof(buf), NULL, 0, NI_NUMERICHOST);
+#else
+	getnameinfo((struct sockaddr*)&cip->servCtlAddr, SA_LEN((struct sockaddr *)&cip->servCtlAddr), buf,
+		    sizeof(buf), NULL, 0, NI_NUMERICHOST);
+#endif
+	(void) STRNCPY(cip->ip, buf);
+	if ((res0 == NULL) || (res0->ai_canonname == NULL))
+		(void) STRNCPY(cip->actualHost, fhost);
+	else
+		(void) STRNCPY(cip->actualHost, (char *) res0->ai_canonname);
+#else
 #ifdef HAVE_INET_NTOP	/* Mostly to workaround bug in IRIX 6.5's inet_ntoa */
 	(void) memset(cip->ip, 0, sizeof(cip->ip));
 	(void) inet_ntop(AF_INET, &cip->servCtlAddr.sin_addr, cip->ip, sizeof(cip->ip) - 1);
@@ -718,9 +790,10 @@
 	(void) STRNCPY(cip->ip, inet_ntoa(cip->servCtlAddr.sin_addr));
 #endif
 	if ((hp == NULL) || (hp->h_name == NULL))
-		(void) STRNCPY(cip->actualHost, fhost);
-	else
+ 		(void) STRNCPY(cip->actualHost, fhost);
+ 	else
 		(void) STRNCPY(cip->actualHost, (char *) hp->h_name);
+#endif
 
 	/* Read the startup message from the server. */	
 	rp = InitResponse();
@@ -887,11 +960,16 @@
 
 
 static int
-SendPort(const FTPCIPtr cip, struct sockaddr_in *saddr)
+SendPort(const FTPCIPtr cip, struct sockaddr *saddr)
 {
 	char *a, *p;
 	int result;
 	ResponsePtr rp;
+	struct sockaddr_in *saddr4;
+#ifdef ENABLE_IPV6
+	struct sockaddr_in6 *saddr6;
+	char buf[INET6_ADDRSTRLEN];
+#endif
 
 	rp = InitResponse();
 	if (rp == NULL) {
@@ -900,16 +978,42 @@
 		return (cip->errNo);
 	}
 
-	/* These will point to data in network byte order. */
-	a = (char *) &saddr->sin_addr;
-	p = (char *) &saddr->sin_port;
 #define UC(x) (int) (((int) x) & 0xff)
+#ifdef ENABLE_IPV6
+	if (saddr->sa_family == AF_INET6) {
+		saddr6 = (struct sockaddr_in6 *)saddr;
+		/* These will point to data in network byte order. */
+		a = (char *) &saddr6->sin6_addr;
+		p = (char *) &saddr6->sin6_port;
+		/* Need to tell the other side which host (the address) and
+		 * which process (port) on that host to send data to.
+		 */
+		result = RCmd(cip, rp, "EPRT |2|%s|%d|",
+			      inet_ntop(AF_INET6, &saddr6->sin6_addr, buf, sizeof(buf)),
+					ntohs(saddr6->sin6_port));
+		if (result != 2) {
+			result = RCmd(cip, rp, "LPRT 6,16,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,2,%d,%d",
+				      UC(a[ 0]), UC(a[ 1]), UC(a[ 2]), UC(a[ 3]),
+				      UC(a[ 4]), UC(a[ 5]), UC(a[ 6]), UC(a[ 7]),
+				      UC(a[ 8]), UC(a[ 9]), UC(a[10]), UC(a[11]),
+				      UC(a[12]), UC(a[13]), UC(a[14]), UC(a[15]),
+				      UC(p[0]), UC(p[1]));
+		}
+	} else {
+#endif
+		saddr4 = (struct sockaddr_in *)saddr;
+		/* These will point to data in network byte order. */
+		a = (char *) &saddr4->sin_addr;
+		p = (char *) &saddr4->sin_port;
 
-	/* Need to tell the other side which host (the address) and
-	 * which process (port) on that host to send data to.
-	 */
-	result = RCmd(cip, rp, "PORT %d,%d,%d,%d,%d,%d",
-		UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]), UC(p[0]), UC(p[1]));
+		/* Need to tell the other side which host (the address) and
+		 * which process (port) on that host to send data to.
+		 */
+		result = RCmd(cip, rp, "PORT %d,%d,%d,%d,%d,%d",
+			      UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]), UC(p[0]), UC(p[1]));
+#ifdef ENABLE_IPV6
+	}
+#endif
 
 	if (result < 0) {
 		return (result);
@@ -927,13 +1031,18 @@
 
 
 static int
-Passive(const FTPCIPtr cip, struct sockaddr_in *saddr, int *weird)
+Passive(const FTPCIPtr cip, struct sockaddr *saddr, int *weird)
 {
 	ResponsePtr rp;
-	int i[6], j;
-	unsigned char n[6];
+	int i[18], j;
+	unsigned char n[18];
 	char *cp;
 	int result;
+	struct sockaddr_in *saddr4 = (struct sockaddr_in *)saddr;
+#ifdef ENABLE_IPV6
+	struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *)saddr;
+#endif
+	unsigned short port;
 
 	rp = InitResponse();
 	if (rp == NULL) {
@@ -942,53 +1051,159 @@
 		return (cip->errNo);
 	}
 
-	result = RCmd(cip, rp, "PASV");
-	if (result < 0)
-		goto done;
-
-	if (rp->codeType != 2) {
-		/* Didn't understand or didn't want passive port selection. */
-		cip->errNo = result = kErrPASVFailed;
-		goto done;
-	}
-
-	/* The other side returns a specification in the form of
-	 * an internet address as the first four integers (each
-	 * integer stands for 8-bits of the real 32-bit address),
-	 * and two more integers for the port (16-bit port).
-	 *
-	 * It should give us something like:
-	 * "Entering Passive Mode (129,93,33,1,10,187)", so look for
-	 * digits with sscanf() starting 24 characters down the string.
-	 */
+	result = RCmd(cip, rp, "EPSV");
+	if (result != 2)
+		goto next;
+
+	if (rp->codeType != 2)
+		goto next;
+
 	for (cp = rp->msg.first->line; ; cp++) {
 		if (*cp == '\0') {
-			Error(cip, kDontPerror, "Cannot parse PASV response: %s\n", rp->msg.first->line);
-			goto done;
+			Error(cip, kDontPerror, "Cannot parse EPSV response: %s\n", rp->msg.first->line);
+			goto next;
 		}
 		if (isdigit((int) *cp))
 			break;
 	}
+	if (sscanf(cp, "%d|", &port) != 1) {
+		Error(cip, kDontPerror, "Cannot parse EPSV response: %s\n", rp->msg.first->line);
+		goto next;
+	}
+
 
-	if (sscanf(cp, "%d,%d,%d,%d,%d,%d",
-			&i[0], &i[1], &i[2], &i[3], &i[4], &i[5]) != 6) {
-		Error(cip, kDontPerror, "Cannot parse PASV response: %s\n", rp->msg.first->line);
-		goto done;
+#ifdef ENABLE_IPV6
+	if (saddr->sa_family == AF_INET6) {
+		saddr6->sin6_addr =
+			((struct sockaddr_in6 *)&cip->servCtlAddr)->sin6_addr;
+		saddr6->sin6_port = htons(port);
+	} else {
+#endif
+		saddr4->sin_addr =
+			((struct sockaddr_in *)&cip->servCtlAddr)->sin_addr;
+		saddr4->sin_port = htons(port);
+#ifdef ENABLE_IPV6
 	}
+#endif
+	goto done;
 
-	for (j=0, *weird = 0; j<6; j++) {
-		/* Some ftp servers return bogus port octets, such as
-		 * boombox.micro.umn.edu.  Let the caller know if we got a
-		 * weird looking octet.
-		 */
-		if ((i[j] < 0) || (i[j] > 255))
-			*weird = *weird + 1;
-		n[j] = (unsigned char) (i[j] & 0xff);
+ next:
+	rp = InitResponse();
+	if (rp == NULL) {
+		Error(cip, kDontPerror, "Malloc failed.\n");
+		cip->errNo = kErrMallocFailed;
+		return (cip->errNo);
 	}
+	
+#ifdef ENABLE_IPV6
+	if (saddr->sa_family == AF_INET6) {
+		int af, hal, pal;
 
-	(void) memcpy(&saddr->sin_addr, &n[0], (size_t) 4);
-	(void) memcpy(&saddr->sin_port, &n[4], (size_t) 2);
+		result = RCmd(cip, rp, "LPSV");
+		if (result < 0)
+			goto done;
+
+		if (rp->codeType != 2) {
+			/* Didn't understand or didn't want passive port selection. */
+			cip->errNo = result = kErrPASVFailed;
+			goto done;
+		}
+
+		/* The other side returns a specification in the form of
+		 * an internet address as the first four integers (each
+		 * integer stands for 8-bits of the real 32-bit address),
+		 * and two more integers for the port (16-bit port).
+		 *
+		 * It should give us something like:
+		 * "Entering Passive Mode (129,93,33,1,10,187)", so look for
+		 * digits with sscanf() starting 24 characters down the string.
+		 */
+		for (cp = rp->msg.first->line; ; cp++) {
+			if (*cp == '\0') {
+				Error(cip, kDontPerror, "Cannot parse LPSV response: %s\n", rp->msg.first->line);
+				goto done;
+			}
+			if (isdigit((int) *cp))
+				break;
+		}
+
+		if (sscanf(cp, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
+			   &af, &hal,
+			   &i[ 0], &i[ 1], &i[ 2], &i[ 3],
+			   &i[ 4], &i[ 5], &i[ 6], &i[ 7],
+			   &i[ 8], &i[ 9], &i[10], &i[11],
+			   &i[12], &i[13], &i[14], &i[15],
+			   &pal,
+			   &i[16], &i[17]) != 21) {
+			Error(cip, kDontPerror, "Cannot parse LPSV response: %s\n", rp->msg.first->line);
+			goto done;
+		}
+		if (af != 6 || hal != 16 || pal != 2) {
+			Error(cip, kDontPerror, "Cannot parse LPSV response: %s\n", rp->msg.first->line);
+			goto done;
+		}
+
+		for (j=0, *weird = 0; j<18; j++) {
+			/* Some ftp servers return bogus port octets, such as
+			 * boombox.micro.umn.edu.  Let the caller know if we got a
+			 * weird looking octet.
+			 */
+			if ((i[j] < 0) || (i[j] > 255))
+				*weird = *weird + 1;
+			n[j] = (unsigned char) (i[j] & 0xff);
+		}
+		(void) memcpy(&saddr6->sin6_addr, &n[ 0], (size_t) 16);
+		(void) memcpy(&saddr6->sin6_port, &n[16], (size_t) 2);
+	} else {
+#endif
+		result = RCmd(cip, rp, "PASV");
+		if (result < 0)
+			goto done;
+
+		if (rp->codeType != 2) {
+			/* Didn't understand or didn't want passive port selection. */
+			cip->errNo = result = kErrPASVFailed;
+			goto done;
+		}
 
+		/* The other side returns a specification in the form of
+		 * an internet address as the first four integers (each
+		 * integer stands for 8-bits of the real 32-bit address),
+		 * and two more integers for the port (16-bit port).
+		 *
+		 * It should give us something like:
+		 * "Entering Passive Mode (129,93,33,1,10,187)", so look for
+		 * digits with sscanf() starting 24 characters down the string.
+		 */
+		for (cp = rp->msg.first->line; ; cp++) {
+			if (*cp == '\0') {
+				Error(cip, kDontPerror, "Cannot parse PASV response: %s\n", rp->msg.first->line);
+				goto done;
+			}
+			if (isdigit((int) *cp))
+				break;
+		}
+
+		if (sscanf(cp, "%d,%d,%d,%d,%d,%d",
+			   &i[0], &i[1], &i[2], &i[3], &i[4], &i[5]) != 6) {
+			Error(cip, kDontPerror, "Cannot parse PASV response: %s\n", rp->msg.first->line);
+			goto done;
+		}
+
+		for (j=0, *weird = 0; j<6; j++) {
+			/* Some ftp servers return bogus port octets, such as
+			 * boombox.micro.umn.edu.  Let the caller know if we got a
+			 * weird looking octet.
+			 */
+			if ((i[j] < 0) || (i[j] > 255))
+				*weird = *weird + 1;
+			n[j] = (unsigned char) (i[j] & 0xff);
+		}
+		(void) memcpy(&saddr4->sin_addr, &n[0], (size_t) 4);
+		(void) memcpy(&saddr4->sin_port, &n[4], (size_t) 2);
+#ifdef ENABLE_IPV6
+	}
+#endif
 	result = kNoErr;
 done:
 	DoneWithResponse(cip, rp);
@@ -999,30 +1214,46 @@
 
 
 static int
-BindToEphemeralPortNumber(int sockfd, struct sockaddr_in *addrp, int ephemLo, int ephemHi)
+BindToEphemeralPortNumber(int sockfd, struct sockaddr *addrp, int ephemLo, int ephemHi)
 {
 	int i;
 	int result;
 	int rangesize;
 	unsigned short port;
 
-	addrp->sin_family = AF_INET;
 	if (((int) ephemLo == 0) || ((int) ephemLo >= (int) ephemHi)) {
 		/* Do it the normal way.  System will
 		 * pick one, typically in the range
 		 * of 1024-4999.
 		 */
-		addrp->sin_port = 0;	/* Let system pick one. */
-
-		result = bind(sockfd, (struct sockaddr *) addrp, sizeof(struct sockaddr_in));
+#ifdef ENABLE_IPV6
+		if (addrp->sa_family == AF_INET6)
+			((struct sockaddr_in6 *)addrp)->sin6_port = 0;	/* Let system pick one. */
+		else
+#endif
+			((struct sockaddr_in *)addrp)->sin_port = 0;	/* Let system pick one. */
+#ifdef HAVE_SOCKADDR_SA_LEN
+		result = bind(sockfd, addrp, addrp->sa_len);
+#else
+		result = bind(sockfd, addrp, SA_LEN(addrp));
+#endif
 	} else {
 		rangesize = (int) ((int) ephemHi - (int) ephemLo);
 		result = 0;
 		for (i=0; i<10; i++) {
 			port = (unsigned short) (((int) rand() % rangesize) + (int) ephemLo);
-			addrp->sin_port = port;
+#ifdef ENABLE_IPV6
+			if (addrp->sa_family == AF_INET6)
+				((struct sockaddr_in6 *)addrp)->sin6_port = port;
+			else
+#endif
+				((struct sockaddr_in *)addrp)->sin_port = port;
 
-			result = bind(sockfd, (struct sockaddr *) addrp, sizeof(struct sockaddr_in));
+#ifdef HAVE_SOCKADDR_SA_LEN
+			result = bind(sockfd, addrp, addrp->sa_len);
+#else
+			result = bind(sockfd, addrp, SA_LEN(addrp));
+#endif
 			if (result == 0)
 				break;
 			if ((errno != 999)
@@ -1057,7 +1288,11 @@
 	result = 0;
 	CloseDataConnection(cip);	/* In case we didn't before... */
 
+#ifdef ENABLE_IPV6
+	dataSocket = socket(cip->ourCtlAddr.ss_family, SOCK_STREAM, 0);
+#else
 	dataSocket = socket(AF_INET, SOCK_STREAM, 0);
+#endif
 	if (dataSocket < 0) {
 		Error(cip, kDoPerror, "Could not get a data socket.\n");
 		result = kErrNewStreamSocket;
@@ -1075,7 +1310,6 @@
 	if ((cip->hasPASV == kCommandNotAvailable) || (mode == kSendPortMode)) {
 tryPort:
 		cip->ourDataAddr = cip->ourCtlAddr;
-		cip->ourDataAddr.sin_family = AF_INET;
 
 #ifdef HAVE_LIBSOCKS
 		cip->ourDataAddr.sin_port = 0;
@@ -1083,7 +1317,7 @@
 			(int) sizeof (cip->ourDataAddr),
 			cip->servCtlAddr.sin_addr.s_addr) < 0) 
 #else
-		if (BindToEphemeralPortNumber(dataSocket, &cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0)
+		if (BindToEphemeralPortNumber(dataSocket, (struct sockaddr *)&cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0)
 #endif
 		{
 			Error(cip, kDoPerror, "Could not bind the data socket");
@@ -1095,7 +1329,7 @@
 		/* Need to do this so we can figure out which port the system
 		 * gave to us.
 		 */
-		if ((result = GetSocketAddress(cip, dataSocket, &cip->ourDataAddr)) < 0)
+		if ((result = GetSocketAddress(cip, dataSocket, (struct sockaddr *)&cip->ourDataAddr)) < 0)
 			goto bad;
 	
 		if (listen(dataSocket, 1) < 0) {
@@ -1105,7 +1339,7 @@
 			goto bad;
 		}
 	
-		if ((result = SendPort(cip, &cip->ourDataAddr)) < 0)
+		if ((result = SendPort(cip, (struct sockaddr *)&cip->ourDataAddr)) < 0)
 			goto bad;
 	
 		cip->dataPortMode = kSendPortMode;
@@ -1113,11 +1347,9 @@
 		/* Passive mode.  Let the other side decide where to send. */
 		
 		cip->servDataAddr = cip->servCtlAddr;
-		cip->servDataAddr.sin_family = AF_INET;
 		cip->ourDataAddr = cip->ourCtlAddr;
-		cip->ourDataAddr.sin_family = AF_INET;
 
-		if (Passive(cip, &cip->servDataAddr, &weirdPort) < 0) {
+		if (Passive(cip, (struct sockaddr *) &cip->servDataAddr, &weirdPort) < 0) {
 			Error(cip, kDontPerror, "Passive mode refused.\n");
 			cip->hasPASV = kCommandNotAvailable;
 			
@@ -1141,7 +1373,7 @@
 			(int) sizeof (cip->ourDataAddr),
 			cip->servCtlAddr.sin_addr.s_addr) < 0) 
 #else
-		if (BindToEphemeralPortNumber(dataSocket, &cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0)
+		if (BindToEphemeralPortNumber(dataSocket, (struct sockaddr *)&cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0)
 #endif
 		{
 			Error(cip, kDoPerror, "Could not bind the data socket");
@@ -1149,14 +1381,27 @@
 			cip->errNo = kErrBindDataSocket;
 			goto bad;
 		}
+	
+		/* Need to do this so we can figure out which port the system
+		 * gave to us.
+		 */
+		if ((result = GetSocketAddress(cip, dataSocket, (struct sockaddr *)&cip->ourDataAddr)) < 0)
+			goto bad;
 
 #ifdef NO_SIGNALS
 		result = SConnect(dataSocket, &cip->servDataAddr, (int) cip->connTimeout);
 #else	/* NO_SIGNALS */
 		if (cip->connTimeout > 0)
 			(void) alarm(cip->connTimeout);
-
+#ifdef ENABLE_IPV6
+#ifdef HAVE_SOCKADDR_SA_LEN
+		result = connect(dataSocket, (struct sockaddr *) &cip->servDataAddr, cip->servDataAddr.ss_len);
+#else
+		result = connect(dataSocket, (struct sockaddr *) &cip->servDataAddr, SA_LEN((struct sockaddr*)&cip->servDataAddr));
+#endif
+#else
 		result = connect(dataSocket, (struct sockaddr *) &cip->servDataAddr, (int) sizeof(cip->servDataAddr));
+#endif
 		if (cip->connTimeout > 0)
 			(void) alarm(0);
 #endif	/* NO_SIGNALS */
@@ -1208,7 +1453,7 @@
 		/* Need to do this so we can figure out which port the system
 		 * gave to us.
 		 */
-		if ((result = GetSocketAddress(cip, dataSocket, &cip->ourDataAddr)) < 0)
+		if ((result = GetSocketAddress(cip, dataSocket, (struct sockaddr *) &cip->ourDataAddr)) < 0)
 			goto bad;
 
 		cip->dataPortMode = kPassiveMode;
@@ -1273,23 +1518,54 @@
 		}
 
 		if (cip->require20 != 0) {
-			remoteDataPort = ntohs(cip->servDataAddr.sin_port);
-			remoteCtrlPort = ntohs(cip->servCtlAddr.sin_port);
-			if ((int) remoteDataPort != ((int) remoteCtrlPort - 1)) {
-				Error(cip, kDontPerror, "Data connection did not originate on correct port!\n");
-				(void) closesocket(newSocket);
-				cip->dataSocket = kClosedFileDescriptor;
-				cip->errNo = kErrAcceptDataSocket;
-				return (kErrAcceptDataSocket);
-			} else if (memcmp(&cip->servDataAddr.sin_addr.s_addr, &cip->servCtlAddr.sin_addr.s_addr, sizeof(cip->servDataAddr.sin_addr.s_addr)) != 0) {
-				Error(cip, kDontPerror, "Data connection did not originate from remote server!\n");
-				(void) closesocket(newSocket);
-				cip->dataSocket = kClosedFileDescriptor;
-				cip->errNo = kErrAcceptDataSocket;
-				return (kErrAcceptDataSocket);
+#ifdef ENABLE_IPV6
+			if (cip->servDataAddr.ss_family == AF_INET6) {
+				struct sockaddr_in6 *servDataAddr =
+					(struct sockaddr_in6 *) &cip->servDataAddr;
+				struct sockaddr_in6 *servCtlAddr =
+					(struct sockaddr_in6 *) &cip->servCtlAddr;
+
+				remoteDataPort = ntohs(servDataAddr->sin6_port);
+				remoteCtrlPort = ntohs(servCtlAddr->sin6_port);
+				if ((int) remoteDataPort != ((int) remoteCtrlPort - 1)) {
+					Error(cip, kDontPerror, "Data connection did not originate on correct port!\n");
+					(void) closesocket(newSocket);
+					cip->dataSocket = kClosedFileDescriptor;
+					cip->errNo = kErrAcceptDataSocket;
+					return (kErrAcceptDataSocket);
+				} else if (memcmp(&servDataAddr->sin6_addr, &servCtlAddr->sin6_addr, sizeof(servDataAddr->sin6_addr)) != 0) {
+					Error(cip, kDontPerror, "Data connection did not originate from remote server!\n");
+					(void) close(newSocket);
+					cip->dataSocket = kClosedFileDescriptor;
+					cip->errNo = kErrAcceptDataSocket;
+					return (kErrAcceptDataSocket);
+				}
+			} else {
+#endif
+				struct sockaddr_in *servDataAddr =
+					(struct sockaddr_in *) &cip->servDataAddr;
+				struct sockaddr_in *servCtlAddr =
+					(struct sockaddr_in *) &cip->servCtlAddr;
+
+				remoteDataPort = ntohs(servDataAddr->sin_port);
+				remoteCtrlPort = ntohs(servCtlAddr->sin_port);
+				if ((int) remoteDataPort != ((int) remoteCtrlPort - 1)) {
+					Error(cip, kDontPerror, "Data connection did not originate on correct port!\n");
+					(void) closesocket(newSocket);
+					cip->dataSocket = kClosedFileDescriptor;
+					cip->errNo = kErrAcceptDataSocket;
+					return (kErrAcceptDataSocket);
+				} else if (memcmp(&servDataAddr->sin_addr.s_addr, &servCtlAddr->sin_addr.s_addr, sizeof(servDataAddr->sin_addr.s_addr)) != 0) {
+					Error(cip, kDontPerror, "Data connection did not originate from remote server!\n");
+					(void) close(newSocket);
+					cip->dataSocket = kClosedFileDescriptor;
+					cip->errNo = kErrAcceptDataSocket;
+					return (kErrAcceptDataSocket);
+				}
+#ifdef ENABLE_IPV6
 			}
+#endif		
 		}
-		
 		cip->dataSocket = newSocket;
 	}
 
Index: ncftp3/libncftp/ncftp.h
diff -u ncftp3/libncftp/ncftp.h:1.1.1.7 ncftp3/libncftp/ncftp.h:1.10
--- ncftp3/libncftp/ncftp.h:1.1.1.7	Wed Apr 12 21:45:55 2000
+++ ncftp3/libncftp/ncftp.h	Wed Apr 12 21:49:28 2000
@@ -172,10 +172,17 @@
 	int mlsFeatures;			/* Do not modify this field. */
 	int STATfileParamWorks;			/* Do not modify this field. */
 	int NLSTfileParamWorks;			/* Do not modify this field. */
+#ifdef ENABLE_IPV6
+	struct sockaddr_storage servCtlAddr;	/* Do not modify this field. */
+	struct sockaddr_storage servDataAddr;	/* Do not modify this field. */
+	struct sockaddr_storage ourCtlAddr;	/* Do not modify this field. */
+	struct sockaddr_storage ourDataAddr;	/* Do not modify this field. */
+#else
 	struct sockaddr_in servCtlAddr;		/* Do not modify this field. */
 	struct sockaddr_in servDataAddr;	/* Do not modify this field. */
 	struct sockaddr_in ourCtlAddr;		/* Do not modify this field. */
 	struct sockaddr_in ourDataAddr;		/* Do not modify this field. */
+#endif
 	int netMode;				/* Do not use or modify. */
 	char *buf;				/* Do not modify this field. */
 	size_t bufSize;				/* Do not modify this field. */
Index: ncftp3/ncftp/cmds.c
diff -u ncftp3/ncftp/cmds.c:1.1.1.6 ncftp3/ncftp/cmds.c:1.3
--- ncftp3/ncftp/cmds.c:1.1.1.6	Fri Mar 24 18:02:55 2000
+++ ncftp3/ncftp/cmds.c	Fri Mar 24 18:12:16 2000
@@ -2117,8 +2117,7 @@
 			(void) printf("Unknown host \"%s\".\n", ohost);
 			return (-1);
 		}
-		(void) STRNCPY(gConn.host, ipstr);
-		OpenMsg("Connecting to %s...", ipstr);
+		OpenMsg("Connecting to %s...", gConn.host);
 	} else {
 		OpenMsg("Connecting to %s via %s...", gConn.host, gConn.firewallHost);
 		Trace(0, "Fw: %s  Type: %d  User: %s  Pass: %s  Port: %u\n", 
Index: ncftp3/ncftp/util.c
diff -u ncftp3/ncftp/util.c:1.1.1.5 ncftp3/ncftp/util.c:1.13
--- ncftp3/ncftp/util.c:1.1.1.5	Fri Mar 24 18:03:02 2000
+++ ncftp3/ncftp/util.c	Fri Mar 24 18:12:16 2000
@@ -829,11 +829,18 @@
 #else
 	int sj;
 	vsigproc_t osigpipe, osigint, osigalrm;
+#ifdef ENABLE_IPV6
+	struct addrinfo hints;
+	struct addrinfo *res;
+	int error;
+#else
 	struct hostent *hp;
+#endif
 #ifndef HAVE_INET_NTOP
 	struct in_addr ina;
 #endif
 
+#ifndef	ENABLE_IPV6
 #ifdef HAVE_INET_ATON
 	if (inet_aton(hn, &ina) != 0) {
 		/* Address is an IP address string, which is what we want. */
@@ -847,6 +854,7 @@
 		return (0);
 	}
 #endif
+#endif
 
 #ifdef HAVE_SIGSETJMP
 	sj = sigsetjmp(gGetHostByNameJmp, 1);
@@ -869,22 +877,44 @@
 		osigalrm = (vsigproc_t) NcSignal(SIGALRM, CancelGetHostByName);
 		if (t > 0)
 			(void) alarm((unsigned int) t);
+#ifdef ENABLE_IPV6
+		memset(&hints, 0, sizeof(hints));
+		hints.ai_flags = 0;
+		hints.ai_family = PF_UNSPEC;
+		hints.ai_socktype = SOCK_STREAM;
+		hints.ai_protocol = 0;
+		error = getaddrinfo(hn, NULL, &hints, &res);
+#else
 		hp = gethostbyname(hn);
+#endif
 		if (t > 0)
 			(void) alarm(0);
 		(void) NcSignal(SIGPIPE, (sigproc_t) osigpipe);
 		(void) NcSignal(SIGINT, (sigproc_t) osigint);
 		(void) NcSignal(SIGALRM, (sigproc_t) osigalrm);
+#ifdef ENABLE_IPV6
+		if (error == 0) {
+			char buf[NI_MAXHOST];
+
+			getnameinfo(res->ai_addr, res->ai_addrlen,
+				    buf, sizeof(buf),
+				    NULL, 0, NI_NUMERICHOST);
+			(void) Strncpy(dst, buf, dsize);
+			freeaddrinfo(res);
+			return (0);
+		}
+#else
 		if (hp != NULL) {
 #ifdef HAVE_INET_NTOP	/* Mostly to workaround bug in IRIX 6.5's inet_ntoa */
 			(void) memset(dst, 0, dsize);
-			(void) inet_ntop(AF_INET, hp->h_addr_list[0], dst, dsize - 1);
+			(void) inet_ntop(hp->h_addrtype, hp->h_addr_list[0], dst, dsize - 1);
 #else
 			(void) memcpy(&ina.s_addr, hp->h_addr_list[0], (size_t) hp->h_length);
 			(void) Strncpy(dst, inet_ntoa(ina), dsize);
 #endif
 			return (0);
 		}
+#endif
 	}
 #endif	/* !Windows */
 
Index: ncftp3/sio/SConnect.c
diff -u ncftp3/sio/SConnect.c:1.1.1.1 ncftp3/sio/SConnect.c:1.4
--- ncftp3/sio/SConnect.c:1.1.1.1	Tue Oct 19 02:39:23 1999
+++ ncftp3/sio/SConnect.c	Thu Jan 27 03:54:13 2000
@@ -6,7 +6,7 @@
 #endif
 
 int
-SConnect(int sfd, const struct sockaddr_in *const addr, int tlen)
+SConnect(int sfd, const struct sockaddr *const addr, int tlen)
 {
 #ifndef NO_SIGNALS
 	int result;
@@ -24,8 +24,13 @@
 
 	errno = 0;
 	do {
+#ifdef HAVE_SOCKADDR_SA_LEN
 		result = connect(sfd, (struct sockaddr *) addr,
-			(int) sizeof(struct sockaddr_in));
+			(int) addr->sa_len);
+#else
+		result = connect(sfd, (struct sockaddr *) addr,
+			(int) SA_LEN(addr));
+#endif
 	} while ((result < 0) && (errno == EINTR));
 
 	alarm(0);
@@ -44,8 +49,13 @@
 	errno = 0;
 	if (tlen <= 0) {
 		do {
+#ifdef HAVE_SOCKADDR_SA_LEN
+			result = connect(sfd, (struct sockaddr *) addr,
+				(int) addr->sa_len);
+#else
 			result = connect(sfd, (struct sockaddr *) addr,
-				(int) sizeof(struct sockaddr_in));
+				(int) SA_LEN(addr));
+#endif
 			SETERRNO
 		} while ((result < 0) && (errno == EINTR));
 		return (result);
@@ -68,8 +78,13 @@
 #endif
 
 	errno = 0;
+#ifdef HAVE_SOCKADDR_SA_LEN
+	result = connect(sfd, (struct sockaddr *) addr,
+			(int) addr->sa_len);
+#else
 	result = connect(sfd, (struct sockaddr *) addr,
-			(int) sizeof(struct sockaddr_in));
+			(int) SA_LEN(addr));
+#endif
 	if (result == 0) 
 		return 0;	/* Already?!? */
 
Index: ncftp3/sio/sio.h
diff -u ncftp3/sio/sio.h:1.1.1.1 ncftp3/sio/sio.h:1.2
--- ncftp3/sio/sio.h:1.1.1.1	Tue Oct 19 02:39:24 1999
+++ ncftp3/sio/sio.h	Wed Oct 20 18:28:34 1999
@@ -142,7 +142,7 @@
 int SClose(int, int);
 
 /* SConnect.c */
-int SConnect(int, const struct sockaddr_in *const, int);
+int SConnect(int, const struct sockaddr *const, int);
 
 /* SConnectByName.c */
 int SConnectByName(int, const char *const, const int);
