               CircleMUD Server-side Compression Support

These comments do not need to be removed first, patch is (or at least, is in
Unix) smart enough to ignore them.

See the comments in the code below to see which clients this is currently
known to work with.

And, obviously, this patch was made against CircleMUD 3.0 bpl15.  If you don't
have patch, look in ftp://ftp.circlemud.org/pub/CircleMUD/contrib/server/ for
a pre-patched version.

Please report problems to George Greer <greerga@circlemud.org>


diff -upr circle30bpl15/cnf/configure.in circle30bpl15-zlib/cnf/configure.in
--- circle30bpl15/cnf/configure.in	Tue Oct 20 01:42:43 1998
+++ circle30bpl15-zlib/cnf/configure.in	Sun Mar 21 22:27:14 1999
@@ -89,6 +89,17 @@ AC_CHECK_HEADERS(signal.h sys/uio.h)
 
 AC_UNSAFE_CRYPT
 
+dnl Test for libz
+AC_CHECK_LIB(z, inflate,
+  AC_CHECK_HEADER(zlib.h,
+    Z_LIBS="-lz";  AC_DEFINE(HAVE_ZLIB)))
+AC_CHECK_LIB(z, compress, ,
+   AC_MSG_ERROR([[
+*** An incorrect version of zlib was found.  Please do a 'locate' or
+*** 'find' to make sure you do not have old copies of libz.a or libz.so
+*** in other parts of your system.  In particular, X11 may contain one.
+]]))
+
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_PID_T
diff -upr circle30bpl15/configure circle30bpl15-zlib/configure
--- circle30bpl15/configure	Fri Oct 23 23:31:30 1998
+++ circle30bpl15-zlib/configure	Sun Mar 21 22:27:22 1999
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -49,6 +49,7 @@ mandir='${prefix}/man'
 # Initialize some other variables.
 subdirs=
 MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
 # Maximum number of lines to put in a shell here document.
 ac_max_here_lines=12
 
@@ -332,7 +333,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -502,9 +503,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -533,15 +536,16 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:537: checking for $ac_word" >&5
+echo "configure:540: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MORE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$MORE"; then
   ac_cv_prog_MORE="$MORE" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_MORE="$ac_prog"
@@ -565,15 +569,16 @@ done
 # 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:569: checking for $ac_word" >&5
+echo "configure:573: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -594,16 +599,17 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:598: checking for $ac_word" >&5
+echo "configure:603: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -638,25 +644,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:654: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:646: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:686: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 656 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 697 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:702: \"$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
@@ -670,18 +712,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:680: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:728: 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:685: checking whether we are using GNU C" >&5
+echo "configure:733: 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
@@ -690,7 +738,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:694: \"$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:742: \"$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
@@ -701,11 +749,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:709: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:761: 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
@@ -720,23 +772,27 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
 
 
 if test $ac_cv_prog_gcc = yes; then
 
     echo $ac_n "checking whether ${CC-cc} -Wall also needs -Wno-char-subscripts""... $ac_c" 1>&6
-echo "configure:740: checking whether ${CC-cc} -Wall also needs -Wno-char-subscripts" >&5
+echo "configure:796: checking whether ${CC-cc} -Wall also needs -Wno-char-subscripts" >&5
 if eval "test \"`echo '$''{'ac_cv_char_warn'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -744,7 +800,7 @@ else
     OLDCFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -Wall -Werror"
     cat > conftest.$ac_ext <<EOF
-#line 748 "configure"
+#line 804 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 int main() {
@@ -755,7 +811,7 @@ int main() {
        
 ; return 0; }
 EOF
-if { (eval echo configure:759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_char_warn=no
 else
@@ -772,7 +828,7 @@ fi
 echo "$ac_t""$ac_cv_char_warn" 1>&6
 
     echo $ac_n "checking whether ${CC-cc} accepts -Wno-char-subscripts""... $ac_c" 1>&6
-echo "configure:776: checking whether ${CC-cc} accepts -Wno-char-subscripts" >&5
+echo "configure:832: checking whether ${CC-cc} accepts -Wno-char-subscripts" >&5
 if eval "test \"`echo '$''{'ac_cv_gcc_ncs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -780,14 +836,14 @@ else
     OLDCFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -Wno-char-subscripts"
     cat > conftest.$ac_ext <<EOF
-#line 784 "configure"
+#line 840 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_gcc_ncs=yes
 else
@@ -820,12 +876,12 @@ else
 fi
 
 echo $ac_n "checking for gethostbyaddr""... $ac_c" 1>&6
-echo "configure:824: checking for gethostbyaddr" >&5
+echo "configure:880: checking for gethostbyaddr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyaddr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 829 "configure"
+#line 885 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyaddr(); below.  */
@@ -848,7 +904,7 @@ gethostbyaddr();
 
 ; return 0; }
 EOF
-if { (eval echo configure:852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyaddr=yes"
 else
@@ -866,7 +922,7 @@ if eval "test \"`echo '$ac_cv_func_'geth
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6
-echo "configure:870: checking for gethostbyaddr in -lnsl" >&5
+echo "configure:926: checking for gethostbyaddr in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyaddr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -874,7 +930,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 878 "configure"
+#line 934 "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
@@ -885,7 +941,7 @@ int main() {
 gethostbyaddr()
 ; return 0; }
 EOF
-if { (eval echo configure:889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:945: \"$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
@@ -909,12 +965,12 @@ fi
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:913: checking for socket" >&5
+echo "configure:969: 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 918 "configure"
+#line 974 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -937,7 +993,7 @@ socket();
 
 ; return 0; }
 EOF
-if { (eval echo configure:941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:997: \"$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
@@ -955,7 +1011,7 @@ if eval "test \"`echo '$ac_cv_func_'sock
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:959: checking for socket in -lsocket" >&5
+echo "configure:1015: 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
@@ -963,7 +1019,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 967 "configure"
+#line 1023 "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
@@ -974,7 +1030,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1034: \"$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
@@ -998,12 +1054,12 @@ fi
 
 
 echo $ac_n "checking for malloc""... $ac_c" 1>&6
-echo "configure:1002: checking for malloc" >&5
+echo "configure:1058: checking for malloc" >&5
 if eval "test \"`echo '$''{'ac_cv_func_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1007 "configure"
+#line 1063 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc(); below.  */
@@ -1026,7 +1082,7 @@ malloc();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_malloc=yes"
 else
@@ -1044,7 +1100,7 @@ if eval "test \"`echo '$ac_cv_func_'mall
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for malloc in -lmalloc""... $ac_c" 1>&6
-echo "configure:1048: checking for malloc in -lmalloc" >&5
+echo "configure:1104: checking for malloc in -lmalloc" >&5
 ac_lib_var=`echo malloc'_'malloc | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1052,7 +1108,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmalloc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1056 "configure"
+#line 1112 "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
@@ -1063,7 +1119,7 @@ int main() {
 malloc()
 ; return 0; }
 EOF
-if { (eval echo configure:1067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1123: \"$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
@@ -1094,12 +1150,12 @@ fi
 
 
 echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:1098: checking for crypt" >&5
+echo "configure:1154: checking for crypt" >&5
 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1103 "configure"
+#line 1159 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -1122,7 +1178,7 @@ crypt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_crypt=yes"
 else
@@ -1143,7 +1199,7 @@ EOF
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:1147: checking for crypt in -lcrypt" >&5
+echo "configure:1203: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1151,7 +1207,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1155 "configure"
+#line 1211 "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
@@ -1162,7 +1218,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:1166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1222: \"$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
@@ -1190,7 +1246,7 @@ fi
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1194: checking how to run the C preprocessor" >&5
+echo "configure:1250: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1205,14 +1261,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1209 "configure"
+#line 1265 "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:1215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1222,14 +1278,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1226 "configure"
+#line 1282 "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:1232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 1299 "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:1305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1242,6 +1315,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1251,12 +1326,12 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1255: checking for ANSI C header files" >&5
+echo "configure:1330: 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 1260 "configure"
+#line 1335 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1264,8 +1339,8 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   ac_cv_header_stdc=yes
@@ -1281,7 +1356,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1285 "configure"
+#line 1360 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1299,7 +1374,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1303 "configure"
+#line 1378 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1320,7 +1395,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1324 "configure"
+#line 1399 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1331,7 +1406,7 @@ if (XOR (islower (i), ISLOWER (i)) || to
 exit (0); }
 
 EOF
-if { (eval echo configure:1335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1355,12 +1430,12 @@ EOF
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1359: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1434: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1364 "configure"
+#line 1439 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -1376,7 +1451,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:1380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -1400,18 +1475,18 @@ for ac_hdr in fcntl.h sys/fcntl.h errno.
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1404: checking for $ac_hdr" >&5
+echo "configure:1479: 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 1409 "configure"
+#line 1484 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1489: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1440,18 +1515,18 @@ for ac_hdr in limits.h sys/time.h sys/se
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1444: checking for $ac_hdr" >&5
+echo "configure:1519: 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 1449 "configure"
+#line 1524 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1480,18 +1555,18 @@ for ac_hdr in memory.h crypt.h assert.h 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1484: checking for $ac_hdr" >&5
+echo "configure:1559: 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 1489 "configure"
+#line 1564 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1520,18 +1595,18 @@ for ac_hdr in sys/stat.h sys/socket.h sy
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1524: checking for $ac_hdr" >&5
+echo "configure:1599: 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 1529 "configure"
+#line 1604 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1560,18 +1635,18 @@ for ac_hdr in signal.h sys/uio.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1564: checking for $ac_hdr" >&5
+echo "configure:1639: 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 1569 "configure"
+#line 1644 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1599,7 +1674,7 @@ done
 
 
   echo $ac_n "checking whether crypt needs over 10 characters""... $ac_c" 1>&6
-echo "configure:1603: checking whether crypt needs over 10 characters" >&5
+echo "configure:1678: checking whether crypt needs over 10 characters" >&5
 if eval "test \"`echo '$''{'ac_cv_unsafe_crypt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1615,7 +1690,7 @@ else
   ac_cv_unsafe_crypt=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1619 "configure"
+#line 1694 "configure"
 #include "confdefs.h"
 
 #define _XOPEN_SOURCE
@@ -1638,7 +1713,7 @@ int main(void)
 
 
 EOF
-if { (eval echo configure:1642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_unsafe_crypt=yes
 else
@@ -1664,13 +1739,141 @@ if test ${ac_cv_lib_crypt_crypt-no} = ye
 fi
 
 
+echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
+echo "configure:1744: checking for inflate in -lz" >&5
+ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lz  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1752 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char inflate();
+
+int main() {
+inflate()
+; return 0; }
+EOF
+if { (eval echo configure:1763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ac_safe=`echo "zlib.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for zlib.h""... $ac_c" 1>&6
+echo "configure:1780: checking for zlib.h" >&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 1785 "configure"
+#include "confdefs.h"
+#include <zlib.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  Z_LIBS="-lz";  cat >> confdefs.h <<\EOF
+#define HAVE_ZLIB 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for compress in -lz""... $ac_c" 1>&6
+echo "configure:1819: checking for compress in -lz" >&5
+ac_lib_var=`echo z'_'compress | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lz  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1827 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char compress();
+
+int main() {
+compress()
+; return 0; }
+EOF
+if { (eval echo configure:1838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lz $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+{ echo "configure: error: 
+*** An incorrect version of zlib was found.  Please do a 'locate' or
+*** 'find' to make sure you do not have old copies of libz.a or libz.so
+*** in other parts of your system.  In particular, X11 may contain one.
+" 1>&2; exit 1; }
+fi
+
+
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1669: checking for working const" >&5
+echo "configure:1872: 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 1674 "configure"
+#line 1877 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1719,7 +1922,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1723: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1740,12 +1943,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1744: checking for pid_t" >&5
+echo "configure:1947: 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 1749 "configure"
+#line 1952 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1754,7 +1957,7 @@ else
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_pid_t=yes
 else
@@ -1773,12 +1976,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1777: checking for size_t" >&5
+echo "configure:1980: 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 1782 "configure"
+#line 1985 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1787,7 +1990,7 @@ else
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_size_t=yes
 else
@@ -1806,12 +2009,12 @@ EOF
 fi
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:1810: checking for ssize_t" >&5
+echo "configure:2013: checking for ssize_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1815 "configure"
+#line 2018 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1820,7 +2023,7 @@ else
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_ssize_t=yes
 else
@@ -1839,12 +2042,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1843: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2046: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1848 "configure"
+#line 2051 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1853,7 +2056,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -1888,19 +2091,19 @@ EOF
   fi
 
   echo $ac_n "checking for struct in_addr""... $ac_c" 1>&6
-echo "configure:1892: checking for struct in_addr" >&5
+echo "configure:2095: checking for struct in_addr" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_in_addr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 1897 "configure"
+#line 2100 "configure"
 #include "confdefs.h"
 $headers
 int main() {
 struct in_addr tp; tp.s_addr;
 ; return 0; }
 EOF
-if { (eval echo configure:1904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_in_addr=yes
 else
@@ -1924,12 +2127,12 @@ fi
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1928: checking return type of signal handlers" >&5
+echo "configure:2131: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1933 "configure"
+#line 2136 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -1946,7 +2149,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:1950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -1970,12 +2173,12 @@ LIBS="$LIBS $NETLIB"
 for ac_func in inet_addr inet_aton
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1974: checking for $ac_func" >&5
+echo "configure:2177: 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 1979 "configure"
+#line 2182 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1998,7 +2201,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2205: \"$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
@@ -2030,13 +2233,13 @@ ac_proto=NEED_`echo accept | sed 's/[^a-
 
 
 echo $ac_n "checking if accept is prototyped""... $ac_c" 1>&6
-echo "configure:2034: checking if accept is prototyped" >&5
+echo "configure:2237: checking if accept is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2040 "configure"
+#line 2243 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2052,7 +2255,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2082,13 +2285,13 @@ ac_proto=NEED_`echo atoi | sed 's/[^a-zA
 
 
 echo $ac_n "checking if atoi is prototyped""... $ac_c" 1>&6
-echo "configure:2086: checking if atoi is prototyped" >&5
+echo "configure:2289: checking if atoi is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2092 "configure"
+#line 2295 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2104,7 +2307,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2134,13 +2337,13 @@ ac_proto=NEED_`echo atol | sed 's/[^a-zA
 
 
 echo $ac_n "checking if atol is prototyped""... $ac_c" 1>&6
-echo "configure:2138: checking if atol is prototyped" >&5
+echo "configure:2341: checking if atol is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2144 "configure"
+#line 2347 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2156,7 +2359,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2186,13 +2389,13 @@ ac_proto=NEED_`echo bind | sed 's/[^a-zA
 
 
 echo $ac_n "checking if bind is prototyped""... $ac_c" 1>&6
-echo "configure:2190: checking if bind is prototyped" >&5
+echo "configure:2393: checking if bind is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2196 "configure"
+#line 2399 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2208,7 +2411,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2238,13 +2441,13 @@ ac_proto=NEED_`echo bzero | sed 's/[^a-z
 
 
 echo $ac_n "checking if bzero is prototyped""... $ac_c" 1>&6
-echo "configure:2242: checking if bzero is prototyped" >&5
+echo "configure:2445: checking if bzero is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2248 "configure"
+#line 2451 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2260,7 +2463,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2290,13 +2493,13 @@ ac_proto=NEED_`echo chdir | sed 's/[^a-z
 
 
 echo $ac_n "checking if chdir is prototyped""... $ac_c" 1>&6
-echo "configure:2294: checking if chdir is prototyped" >&5
+echo "configure:2497: checking if chdir is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2300 "configure"
+#line 2503 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2312,7 +2515,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2342,13 +2545,13 @@ ac_proto=NEED_`echo close | sed 's/[^a-z
 
 
 echo $ac_n "checking if close is prototyped""... $ac_c" 1>&6
-echo "configure:2346: checking if close is prototyped" >&5
+echo "configure:2549: checking if close is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2352 "configure"
+#line 2555 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2364,7 +2567,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2394,13 +2597,13 @@ ac_proto=NEED_`echo crypt | sed 's/[^a-z
 
 
 echo $ac_n "checking if crypt is prototyped""... $ac_c" 1>&6
-echo "configure:2398: checking if crypt is prototyped" >&5
+echo "configure:2601: checking if crypt is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2404 "configure"
+#line 2607 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2416,7 +2619,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2446,13 +2649,13 @@ ac_proto=NEED_`echo fclose | sed 's/[^a-
 
 
 echo $ac_n "checking if fclose is prototyped""... $ac_c" 1>&6
-echo "configure:2450: checking if fclose is prototyped" >&5
+echo "configure:2653: checking if fclose is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2456 "configure"
+#line 2659 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2468,7 +2671,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2498,13 +2701,13 @@ ac_proto=NEED_`echo fcntl | sed 's/[^a-z
 
 
 echo $ac_n "checking if fcntl is prototyped""... $ac_c" 1>&6
-echo "configure:2502: checking if fcntl is prototyped" >&5
+echo "configure:2705: checking if fcntl is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2508 "configure"
+#line 2711 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2520,7 +2723,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2550,13 +2753,13 @@ ac_proto=NEED_`echo fflush | sed 's/[^a-
 
 
 echo $ac_n "checking if fflush is prototyped""... $ac_c" 1>&6
-echo "configure:2554: checking if fflush is prototyped" >&5
+echo "configure:2757: checking if fflush is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2560 "configure"
+#line 2763 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2572,7 +2775,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2576: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2602,13 +2805,13 @@ ac_proto=NEED_`echo fprintf | sed 's/[^a
 
 
 echo $ac_n "checking if fprintf is prototyped""... $ac_c" 1>&6
-echo "configure:2606: checking if fprintf is prototyped" >&5
+echo "configure:2809: checking if fprintf is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2612 "configure"
+#line 2815 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2624,7 +2827,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2654,13 +2857,13 @@ ac_proto=NEED_`echo fputc | sed 's/[^a-z
 
 
 echo $ac_n "checking if fputc is prototyped""... $ac_c" 1>&6
-echo "configure:2658: checking if fputc is prototyped" >&5
+echo "configure:2861: checking if fputc is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2664 "configure"
+#line 2867 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2676,7 +2879,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2706,13 +2909,13 @@ ac_proto=NEED_`echo fputs | sed 's/[^a-z
 
 
 echo $ac_n "checking if fputs is prototyped""... $ac_c" 1>&6
-echo "configure:2710: checking if fputs is prototyped" >&5
+echo "configure:2913: checking if fputs is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2716 "configure"
+#line 2919 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2728,7 +2931,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2758,13 +2961,13 @@ ac_proto=NEED_`echo fread | sed 's/[^a-z
 
 
 echo $ac_n "checking if fread is prototyped""... $ac_c" 1>&6
-echo "configure:2762: checking if fread is prototyped" >&5
+echo "configure:2965: checking if fread is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2768 "configure"
+#line 2971 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2780,7 +2983,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2810,13 +3013,13 @@ ac_proto=NEED_`echo fscanf | sed 's/[^a-
 
 
 echo $ac_n "checking if fscanf is prototyped""... $ac_c" 1>&6
-echo "configure:2814: checking if fscanf is prototyped" >&5
+echo "configure:3017: checking if fscanf is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2820 "configure"
+#line 3023 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2832,7 +3035,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2862,13 +3065,13 @@ ac_proto=NEED_`echo fseek | sed 's/[^a-z
 
 
 echo $ac_n "checking if fseek is prototyped""... $ac_c" 1>&6
-echo "configure:2866: checking if fseek is prototyped" >&5
+echo "configure:3069: checking if fseek is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2872 "configure"
+#line 3075 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2884,7 +3087,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2914,13 +3117,13 @@ ac_proto=NEED_`echo fwrite | sed 's/[^a-
 
 
 echo $ac_n "checking if fwrite is prototyped""... $ac_c" 1>&6
-echo "configure:2918: checking if fwrite is prototyped" >&5
+echo "configure:3121: checking if fwrite is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2924 "configure"
+#line 3127 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2936,7 +3139,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -2966,13 +3169,13 @@ ac_proto=NEED_`echo getpeername | sed 's
 
 
 echo $ac_n "checking if getpeername is prototyped""... $ac_c" 1>&6
-echo "configure:2970: checking if getpeername is prototyped" >&5
+echo "configure:3173: checking if getpeername is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 2976 "configure"
+#line 3179 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -2988,7 +3191,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3018,13 +3221,13 @@ ac_proto=NEED_`echo getpid | sed 's/[^a-
 
 
 echo $ac_n "checking if getpid is prototyped""... $ac_c" 1>&6
-echo "configure:3022: checking if getpid is prototyped" >&5
+echo "configure:3225: checking if getpid is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3028 "configure"
+#line 3231 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3040,7 +3243,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3070,13 +3273,13 @@ ac_proto=NEED_`echo getrlimit | sed 's/[
 
 
 echo $ac_n "checking if getrlimit is prototyped""... $ac_c" 1>&6
-echo "configure:3074: checking if getrlimit is prototyped" >&5
+echo "configure:3277: checking if getrlimit is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3080 "configure"
+#line 3283 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3092,7 +3295,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3122,13 +3325,13 @@ ac_proto=NEED_`echo getsockname | sed 's
 
 
 echo $ac_n "checking if getsockname is prototyped""... $ac_c" 1>&6
-echo "configure:3126: checking if getsockname is prototyped" >&5
+echo "configure:3329: checking if getsockname is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3132 "configure"
+#line 3335 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3144,7 +3347,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3174,13 +3377,13 @@ ac_proto=NEED_`echo gettimeofday | sed '
 
 
 echo $ac_n "checking if gettimeofday is prototyped""... $ac_c" 1>&6
-echo "configure:3178: checking if gettimeofday is prototyped" >&5
+echo "configure:3381: checking if gettimeofday is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3184 "configure"
+#line 3387 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3196,7 +3399,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3226,13 +3429,13 @@ ac_proto=NEED_`echo htonl | sed 's/[^a-z
 
 
 echo $ac_n "checking if htonl is prototyped""... $ac_c" 1>&6
-echo "configure:3230: checking if htonl is prototyped" >&5
+echo "configure:3433: checking if htonl is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3236 "configure"
+#line 3439 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3248,7 +3451,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3278,13 +3481,13 @@ ac_proto=NEED_`echo htons | sed 's/[^a-z
 
 
 echo $ac_n "checking if htons is prototyped""... $ac_c" 1>&6
-echo "configure:3282: checking if htons is prototyped" >&5
+echo "configure:3485: checking if htons is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3288 "configure"
+#line 3491 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3300,7 +3503,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3330,13 +3533,13 @@ ac_proto=NEED_`echo inet_addr | sed 's/[
 
 
 echo $ac_n "checking if inet_addr is prototyped""... $ac_c" 1>&6
-echo "configure:3334: checking if inet_addr is prototyped" >&5
+echo "configure:3537: checking if inet_addr is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3340 "configure"
+#line 3543 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3352,7 +3555,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3382,13 +3585,13 @@ ac_proto=NEED_`echo inet_aton | sed 's/[
 
 
 echo $ac_n "checking if inet_aton is prototyped""... $ac_c" 1>&6
-echo "configure:3386: checking if inet_aton is prototyped" >&5
+echo "configure:3589: checking if inet_aton is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3392 "configure"
+#line 3595 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3404,7 +3607,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3434,13 +3637,13 @@ ac_proto=NEED_`echo inet_ntoa | sed 's/[
 
 
 echo $ac_n "checking if inet_ntoa is prototyped""... $ac_c" 1>&6
-echo "configure:3438: checking if inet_ntoa is prototyped" >&5
+echo "configure:3641: checking if inet_ntoa is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3444 "configure"
+#line 3647 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3456,7 +3659,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3486,13 +3689,13 @@ ac_proto=NEED_`echo listen | sed 's/[^a-
 
 
 echo $ac_n "checking if listen is prototyped""... $ac_c" 1>&6
-echo "configure:3490: checking if listen is prototyped" >&5
+echo "configure:3693: checking if listen is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3496 "configure"
+#line 3699 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3508,7 +3711,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3538,13 +3741,13 @@ ac_proto=NEED_`echo ntohl | sed 's/[^a-z
 
 
 echo $ac_n "checking if ntohl is prototyped""... $ac_c" 1>&6
-echo "configure:3542: checking if ntohl is prototyped" >&5
+echo "configure:3745: checking if ntohl is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3548 "configure"
+#line 3751 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3560,7 +3763,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3590,13 +3793,13 @@ ac_proto=NEED_`echo perror | sed 's/[^a-
 
 
 echo $ac_n "checking if perror is prototyped""... $ac_c" 1>&6
-echo "configure:3594: checking if perror is prototyped" >&5
+echo "configure:3797: checking if perror is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3600 "configure"
+#line 3803 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3612,7 +3815,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3642,13 +3845,13 @@ ac_proto=NEED_`echo printf | sed 's/[^a-
 
 
 echo $ac_n "checking if printf is prototyped""... $ac_c" 1>&6
-echo "configure:3646: checking if printf is prototyped" >&5
+echo "configure:3849: checking if printf is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3652 "configure"
+#line 3855 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3664,7 +3867,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3694,13 +3897,13 @@ ac_proto=NEED_`echo qsort | sed 's/[^a-z
 
 
 echo $ac_n "checking if qsort is prototyped""... $ac_c" 1>&6
-echo "configure:3698: checking if qsort is prototyped" >&5
+echo "configure:3901: checking if qsort is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3704 "configure"
+#line 3907 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3716,7 +3919,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3746,13 +3949,13 @@ ac_proto=NEED_`echo read | sed 's/[^a-zA
 
 
 echo $ac_n "checking if read is prototyped""... $ac_c" 1>&6
-echo "configure:3750: checking if read is prototyped" >&5
+echo "configure:3953: checking if read is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3756 "configure"
+#line 3959 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3768,7 +3971,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3798,13 +4001,13 @@ ac_proto=NEED_`echo remove | sed 's/[^a-
 
 
 echo $ac_n "checking if remove is prototyped""... $ac_c" 1>&6
-echo "configure:3802: checking if remove is prototyped" >&5
+echo "configure:4005: checking if remove is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3808 "configure"
+#line 4011 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3820,7 +4023,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3850,13 +4053,13 @@ ac_proto=NEED_`echo rewind | sed 's/[^a-
 
 
 echo $ac_n "checking if rewind is prototyped""... $ac_c" 1>&6
-echo "configure:3854: checking if rewind is prototyped" >&5
+echo "configure:4057: checking if rewind is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3860 "configure"
+#line 4063 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3872,7 +4075,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3902,13 +4105,13 @@ ac_proto=NEED_`echo select | sed 's/[^a-
 
 
 echo $ac_n "checking if select is prototyped""... $ac_c" 1>&6
-echo "configure:3906: checking if select is prototyped" >&5
+echo "configure:4109: checking if select is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3912 "configure"
+#line 4115 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3924,7 +4127,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -3954,13 +4157,13 @@ ac_proto=NEED_`echo setitimer | sed 's/[
 
 
 echo $ac_n "checking if setitimer is prototyped""... $ac_c" 1>&6
-echo "configure:3958: checking if setitimer is prototyped" >&5
+echo "configure:4161: checking if setitimer is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 3964 "configure"
+#line 4167 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -3976,7 +4179,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4006,13 +4209,13 @@ ac_proto=NEED_`echo setrlimit | sed 's/[
 
 
 echo $ac_n "checking if setrlimit is prototyped""... $ac_c" 1>&6
-echo "configure:4010: checking if setrlimit is prototyped" >&5
+echo "configure:4213: checking if setrlimit is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 4016 "configure"
+#line 4219 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -4028,7 +4231,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4058,13 +4261,13 @@ ac_proto=NEED_`echo setsockopt | sed 's/
 
 
 echo $ac_n "checking if setsockopt is prototyped""... $ac_c" 1>&6
-echo "configure:4062: checking if setsockopt is prototyped" >&5
+echo "configure:4265: checking if setsockopt is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 4068 "configure"
+#line 4271 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -4080,7 +4283,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4110,13 +4313,13 @@ ac_proto=NEED_`echo socket | sed 's/[^a-
 
 
 echo $ac_n "checking if socket is prototyped""... $ac_c" 1>&6
-echo "configure:4114: checking if socket is prototyped" >&5
+echo "configure:4317: checking if socket is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 4120 "configure"
+#line 4323 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -4132,7 +4335,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4162,13 +4365,13 @@ ac_proto=NEED_`echo sprintf | sed 's/[^a
 
 
 echo $ac_n "checking if sprintf is prototyped""... $ac_c" 1>&6
-echo "configure:4166: checking if sprintf is prototyped" >&5
+echo "configure:4369: checking if sprintf is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 4172 "configure"
+#line 4375 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -4184,7 +4387,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4214,13 +4417,13 @@ ac_proto=NEED_`echo sscanf | sed 's/[^a-
 
 
 echo $ac_n "checking if sscanf is prototyped""... $ac_c" 1>&6
-echo "configure:4218: checking if sscanf is prototyped" >&5
+echo "configure:4421: checking if sscanf is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 4224 "configure"
+#line 4427 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -4236,7 +4439,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4266,13 +4469,13 @@ ac_proto=NEED_`echo strerror | sed 's/[^
 
 
 echo $ac_n "checking if strerror is prototyped""... $ac_c" 1>&6
-echo "configure:4270: checking if strerror is prototyped" >&5
+echo "configure:4473: checking if strerror is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 4276 "configure"
+#line 4479 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -4288,7 +4491,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4318,13 +4521,13 @@ ac_proto=NEED_`echo system | sed 's/[^a-
 
 
 echo $ac_n "checking if system is prototyped""... $ac_c" 1>&6
-echo "configure:4322: checking if system is prototyped" >&5
+echo "configure:4525: checking if system is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 4328 "configure"
+#line 4531 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -4340,7 +4543,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4370,13 +4573,13 @@ ac_proto=NEED_`echo time | sed 's/[^a-zA
 
 
 echo $ac_n "checking if time is prototyped""... $ac_c" 1>&6
-echo "configure:4374: checking if time is prototyped" >&5
+echo "configure:4577: checking if time is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 4380 "configure"
+#line 4583 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -4392,7 +4595,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4422,13 +4625,13 @@ ac_proto=NEED_`echo unlink | sed 's/[^a-
 
 
 echo $ac_n "checking if unlink is prototyped""... $ac_c" 1>&6
-echo "configure:4426: checking if unlink is prototyped" >&5
+echo "configure:4629: checking if unlink is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 4432 "configure"
+#line 4635 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -4444,7 +4647,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4474,13 +4677,13 @@ ac_proto=NEED_`echo write | sed 's/[^a-z
 
 
 echo $ac_n "checking if write is prototyped""... $ac_c" 1>&6
-echo "configure:4478: checking if write is prototyped" >&5
+echo "configure:4681: checking if write is prototyped" >&5
 if eval "test \"`echo '$''{'ac_cv_prototype_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   #
 cat > conftest.$ac_ext <<EOF
-#line 4484 "configure"
+#line 4687 "configure"
 #include "confdefs.h"
 
 #define NO_LIBRARY_PROTOTYPES
@@ -4496,7 +4699,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_prototype_$ac_safe=no"
 else
@@ -4544,7 +4747,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -4611,7 +4814,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -4630,9 +4833,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g
  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
 $ac_vpsub
 $extrasub
+s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
diff -upr circle30bpl15/src/act.informative.c circle30bpl15-zlib/src/act.informative.c
--- circle30bpl15/src/act.informative.c	Fri Mar  5 01:47:45 1999
+++ circle30bpl15-zlib/src/act.informative.c	Sun Mar 21 22:27:06 1999
@@ -1573,6 +1573,8 @@ ACMD(do_toggle)
 	  "Auction Channel: %-3s    "
 	  "  Grats Channel: %-3s\r\n"
 
+          "    Compression: %-3s    "
+          "  Auto-Compress: %-3s    "
 	  "    Color Level: %s\r\n",
 
 	  ONOFF(PRF_FLAGGED(ch, PRF_DISPHP)),
@@ -1595,7 +1597,14 @@ ACMD(do_toggle)
 	  ONOFF(!PRF_FLAGGED(ch, PRF_NOAUCT)),
 	  ONOFF(!PRF_FLAGGED(ch, PRF_NOGRATZ)),
 
-	  ctypes[COLOR_LEV(ch)]);
+#if defined(HAVE_ZLIB)
+          ONOFF(ch->desc->deflate),
+          YESNO(PRF_FLAGGED(ch, PRF_AUTOZLIB)),
+#else
+          "N/A", "N/A",
+#endif
+          ctypes[COLOR_LEV(ch)]
+        );
 
   send_to_char(buf, ch);
 }
diff -upr circle30bpl15/src/act.other.c circle30bpl15-zlib/src/act.other.c
--- circle30bpl15/src/act.other.c	Fri Mar  5 01:47:46 1999
+++ circle30bpl15-zlib/src/act.other.c	Sun Mar 21 22:28:46 1999
@@ -886,7 +886,11 @@ ACMD(do_gen_tog)
     {"Autoexits disabled.\r\n",
     "Autoexits enabled.\r\n"},
     {"Will no longer track through doors.\r\n",
-    "Will now track through doors.\r\n"}
+    "Will now track through doors.\r\n"},
+    {"Compression disabled.\r\n",
+    "Compression enabled.\r\n"},
+    {"Compression will not be enabled automatically.\r\n",
+    "Compression will be automatically enabled if your client supports it.\r\n"}
   };
 
 
@@ -945,6 +949,21 @@ ACMD(do_gen_tog)
   case SCMD_TRACK:
     result = (track_through_doors = !track_through_doors);
     break;
+
+#if defined(HAVE_ZLIB)
+   case SCMD_COMPRESS:
+     result = toggle_compression(ch->desc);
+     break;
+   case SCMD_AUTOZLIB:
+     result = PRF_TOG_CHK(ch, PRF_AUTOZLIB);
+     break;
+#else
+   case SCMD_COMPRESS:
+   case SCMD_AUTOZLIB:
+     send_to_char("Compression not supported.\r\n", ch);
+     return;
+#endif
+
   default:
     log("SYSERR: Unknown subcmd %d in do_gen_toggle.", subcmd);
     return;
diff -upr circle30bpl15/src/comm.c circle30bpl15-zlib/src/comm.c
--- circle30bpl15/src/comm.c	Fri Mar  5 00:42:32 1999
+++ circle30bpl15-zlib/src/comm.c	Sun Mar 21 23:27:57 1999
@@ -8,6 +8,21 @@
 *  CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.               *
 ************************************************************************ */
 
+/*
+ * Compression support.  Currently could be used with:
+ *
+ *   MUD Client for Linux, by Erwin S. Andreasen
+ *     http://www.andreasen.org/mcl/
+ *
+ *   mcclient, by Oliver 'Nemon@AR' Jowett
+ *     http://homepages.ihug.co.nz/~icecube/compress/
+ *
+ * Contact them for help with the clients. Contact greerga@circlemud.org
+ * for problems with the server end of the connection.  If you think you
+ * have found a bug, please test another MUD for the same problem to see
+ * if it is a client or server problem.
+ */
+
 #define __COMM_C__
 
 #include "conf.h"
@@ -141,6 +156,10 @@ int open_logfile(const char *filename, F
 #if defined(POSIX)
 sigfunc *my_signal(int signo, sigfunc * func);
 #endif
+#if defined(HAVE_ZLIB)
+void *zlib_alloc(void *opaque, unsigned int items, unsigned int size);
+void zlib_free(void *opaque, void *address);
+#endif
 
 /* extern fcnts */
 void reboot_wizlists(void);
@@ -163,6 +182,26 @@ void weather_and_time(int mode);
 #define FD_CLR(x, y)
 #endif
 
+/*
+ * MUD Client for Linux and mcclient compression support.
+ * "The COMPRESS option (unofficial and completely arbitary) is
+ * option 85." -- mcclient documentation as of Dec '98.
+ *
+ * [ Compression protocol documentation below, from Compress.c ]
+ *
+ * Server sends  IAC WILL COMPRESS
+ * We reply with IAC DO COMPRESS
+ *
+ * Later the server sends IAC SB COMPRESS WILL SE, and immediately following
+ * that, begins compressing
+ *
+ * Compression ends on a Z_STREAM_END, no other marker is used
+ */
+#define TELOPT_COMPRESS        85
+static char will_sig[] = { IAC, WILL, TELOPT_COMPRESS, 0 };
+static char do_sig[] =   { IAC, DO, TELOPT_COMPRESS, 0 };
+static char on_sig[] =   { IAC, SB, TELOPT_COMPRESS, WILL, SE, 0 };
+
 
 /***********************************************************************
 *  main game loop and related stuff                                    *
@@ -742,7 +781,7 @@ void game_loop(int mother_desc)
     /* Print prompts for other descriptors who had no other output */
     for (d = descriptor_list; d; d = d->next) {
       if (!d->has_prompt) {
-	write_to_descriptor(d->descriptor, make_prompt(d));
+	SEND_TO_Q(make_prompt(d), d);
 	d->has_prompt = 1;
       }
     }
@@ -1217,7 +1256,7 @@ int new_descriptor(int s)
     sockets_connected++;
 
   if (sockets_connected >= max_players) {
-    write_to_descriptor(desc, "Sorry, CircleMUD is full right now... please try again later!\r\n");
+    SEND_TO_SOCKET("Sorry, CircleMUD is full right now... please try again later!\r\n", desc);
     CLOSE_SOCKET(desc);
     return (0);
   }
@@ -1287,19 +1326,72 @@ int new_descriptor(int s)
 
   SEND_TO_Q(GREETINGS, newd);
 
+  write_to_descriptor(newd->descriptor, will_sig, strlen(will_sig));
+
   return (0);
 }
 
+int toggle_compression(struct descriptor_data *t)
+{
+#if defined(HAVE_ZLIB)
+  int derr, turn_on = (t->deflate == NULL);
+
+  if (turn_on && !DESC_FLAGGED(t, DESC_CANZLIB))
+    return 0;
+
+  if (turn_on) {
+    /* Notify client. */
+    write_to_descriptor(t->descriptor, on_sig, strlen(on_sig));
+
+    /* Set up zlib structures. */
+    CREATE(t->deflate, z_stream, 1);
+    t->deflate->zalloc = zlib_alloc;
+    t->deflate->zfree = zlib_free;
+    t->deflate->opaque = NULL;
+    t->deflate->next_in = t->small_outbuf;
+    t->deflate->next_out = t->small_outbuf;
+    t->deflate->avail_out = SMALL_BUFSIZE;
+    t->deflate->avail_in = 0;
+
+    /* Initialize. */
+    if ((derr = deflateInit(t->deflate, Z_DEFAULT_COMPRESSION)) != 0)
+      log("SYSERR: deflateEnd returned %d.", derr);
+
+    return 1;
+  }
+
+  if (!turn_on) { /* off */
+    int pending = t->deflate->avail_out;
+
+    t->deflate->next_out = t->small_outbuf;
+
+    if ((derr = deflate(t->deflate, Z_FINISH)) != Z_STREAM_END)
+      log("SYSERR: deflate returned %d upon Z_FINISH. (in: %d, out: %d)", derr, t->deflate->avail_in, t->deflate->avail_out);
+
+    pending -= t->deflate->avail_out;
+    if (pending)
+      write_to_descriptor(t->descriptor, t->small_outbuf, 6);
+
+    if ((derr = deflateEnd(t->deflate)) != Z_OK)
+      log("SYSERR: deflateEnd returned %d. (in: %d, out: %d)", derr, t->deflate->avail_in, t->deflate->avail_out);
+
+    free(t->deflate);
+    t->deflate = NULL;
+
+    return 0;
+  }
+#endif
+  return 0;
+}
 
 /*
  * Send all of the output that we've accumulated for a player out to
  * the player's descriptor.
- * FIXME - This will be rewritten before 3.1, this code is dumb.
  */
 int process_output(struct descriptor_data *t)
 {
   char i[MAX_SOCK_BUF];
-  int result;
+  int written = 0, offset, result;
 
   /* we may need this \r\n for later -- see below */
   strcpy(i, "\r\n");
@@ -1323,9 +1415,50 @@ int process_output(struct descriptor_dat
    * CRLF, otherwise send the straight output sans CRLF.
    */
   if (t->has_prompt)		/* && !t->connected) */
-    result = write_to_descriptor(t->descriptor, i);
-  else
-    result = write_to_descriptor(t->descriptor, i + 2);
+    offset = 0;
+   else
+    offset = 2;
+
+  /*
+   * This huge #ifdef could be a function of its own, if desired. -gg 2/27/99
+   */
+#if defined(HAVE_ZLIB)
+  if (t->deflate) {    /* Complex case, compression, write it out. */
+    /* Keep compiler happy, and MUD, just in case we don't write anything. */
+    result = 1;
+
+    /* First we set up our input data. */
+    t->deflate->avail_in = strlen(i + offset);
+    t->deflate->next_in = i + offset;
+
+    do {
+      int df, prevsize = SMALL_BUFSIZE - t->deflate->avail_out;
+
+      /* If there is input or the output has reset from being previously full, run compression again. */
+      if (t->deflate->avail_in || t->deflate->avail_out == SMALL_BUFSIZE)
+        if ((df = deflate(t->deflate, Z_SYNC_FLUSH)) != 0)
+          log("SYSERR: process_output: deflate() returned %d.", df);
+
+      /* There should always be something new to write out. */
+      result = write_to_descriptor(t->descriptor, t->small_outbuf + prevsize, SMALL_BUFSIZE - t->deflate->avail_out - prevsize);
+
+      /* Wrap the buffer when we've run out of buffer space for the output. */
+      if (t->deflate->avail_out == 0) {
+        t->deflate->avail_out = SMALL_BUFSIZE;
+        t->deflate->next_out = t->small_outbuf;
+      }
+
+      /* Oops. This shouldn't happen, I hope. -gg 2/19/99 */
+      if (result <= 0)
+        return -1;
+
+    /* Need to loop while we still have input or when the output buffer was previously full. */
+    } while (t->deflate->avail_out == SMALL_BUFSIZE || t->deflate->avail_in);
+  } else
+#endif
+    result = write_to_descriptor(t->descriptor, i + offset, strlen(i + offset));
+
+  written = result >= 0 ? result : -result;
 
   /* handle snooping: prepend "% " and send to snooper */
   if (t->snoop_by) {
@@ -1333,6 +1466,7 @@ int process_output(struct descriptor_dat
     SEND_TO_Q(t->output, t->snoop_by);
     SEND_TO_Q("%%", t->snoop_by);
   }
+
   /*
    * if we were using a large buffer, put the large buffer on the buffer pool
    * and switch back to the small one
@@ -1343,12 +1477,27 @@ int process_output(struct descriptor_dat
     t->large_outbuf = NULL;
     t->output = t->small_outbuf;
   }
+
   /* reset total bufspace back to that of a small buffer */
   t->bufspace = SMALL_BUFSIZE - 1;
   t->bufptr = 0;
   *(t->output) = '\0';
 
-  return (result);
+  /* Error, cut off. */
+  if (result == 0)
+     return (-1);
+
+  /* Normal case, wrote ok. */
+  if (result > 0)
+     return (1);
+
+  /*
+   * We blocked, restore the unwritten output. Known
+   * bug in that the snooping immortal will see it twice
+   * but details...
+   */
+  write_to_output(i + written + offset, t);
+  return (0);
 }
 
 
@@ -1454,41 +1603,47 @@ ssize_t perform_socket_write(socket_t de
  * write_to_descriptor takes a descriptor, and text to write to the
  * descriptor.  It keeps calling the system-level write() until all
  * the text has been delivered to the OS, or until an error is
- * encountered.
+ * encountered. 'written' is updated to add how many bytes were sent
+ * over the socket successfully prior to the return. It is not zero'd.
  *
  * Returns:
- *  0  If all is well and good,
- * -1  If an error was encountered, so that the player should be cut off
+ *  +  All is well and good.
+ *  0  A fatal or unexpected error was encountered.
+ *  -  The socket write would block.
  */
-int write_to_descriptor(socket_t desc, const char *txt)
+int write_to_descriptor(socket_t desc, const char *txt, size_t total)
 {
-  size_t total;
-  ssize_t bytes_written;
+  ssize_t bytes_written, total_written = 0;
 
-  total = strlen(txt);
+  if (total == 0) {
+    log("write_to_descriptor: write nothing?!");
+    return 0;
+  }
 
   while (total > 0) {
     bytes_written = perform_socket_write(desc, txt, total);
 
     if (bytes_written < 0) {
       /* Fatal error.  Disconnect the player. */
-      perror("SYSERR: Write to socket");
-      return (-1);
+      perror("SYSERR: write_to_descriptor");
+      return (0);
     } else if (bytes_written == 0) {
       /*
        * Temporary failure -- socket buffer full.  For now we'll just
        * cut off the player, but eventually we'll stuff the unsent
        * text into a buffer and retry the write later.  JE 30 June 98.
+       * Implemented the anti-cut-off code he wanted. GG 13 Jan 99.
        */
-      log("WARNING: write_to_descriptor: socket write would block, about to close");
-      return (-1);
+      log("WARNING: write_to_descriptor: socket write would block.");
+      return (-total_written);
     } else {
       txt += bytes_written;
       total -= bytes_written;
+      total_written += bytes_written;
     }
   }
 
-  return (0);
+  return (total_written);
 }
 
 
@@ -1566,7 +1721,7 @@ int process_input(struct descriptor_data
   int buf_length, failed_subst;
   ssize_t bytes_read;
   size_t space_left;
-  char *ptr, *read_point, *write_point, *nl_pos = NULL;
+  char *ptr, *read_point, *write_point, *nl_pos;
   char tmp[MAX_INPUT_LENGTH + 8];
 
   /* first, find the point where we left off reading data */
@@ -1589,12 +1744,33 @@ int process_input(struct descriptor_data
 
     /* at this point, we know we got some data from the read */
 
-    *(read_point + bytes_read) = '\0';	/* terminate the string */
+    read_point[bytes_read] = '\0';	/* terminate the string */
 
     /* search for a newline in the data we just read */
-    for (ptr = read_point; *ptr && !nl_pos; ptr++)
-      if (ISNEWL(*ptr))
-	nl_pos = ptr;
+    for (ptr = read_point, nl_pos = NULL; *ptr && !nl_pos; ptr++) {
+      /*
+       * Search for an "Interpret As Command" marker. Note that we still
+       * have an ostrich attitude to all other IAC markers.  At least now
+       * they won't show up in the users' input streams. -gg 2/28/99
+       */
+      if (*(unsigned char *)ptr == IAC) {
+        if (!strcmp(ptr, do_sig))
+          SET_BIT(DESC_FLAGS(t), DESC_CANZLIB);
+
+        /*
+         * Convert the IAC string so that it is filtered out. This
+         * should, in theory, leave the 'U' from the compression
+         * handshake but in my testing it didn't show up... -gg 3/21/99
+         */
+        while (*ptr < 0)
+          *ptr++ = '\0';
+
+       /* If this was everything, pretend we had nothing. */
+       if (ISNEWL(*ptr))
+          *ptr++ = '\0';
+      } else if (ISNEWL(*ptr))
+       nl_pos = ptr;
+    }
 
     read_point += bytes_read;
     space_left -= bytes_read;
@@ -1653,8 +1829,7 @@ int process_input(struct descriptor_data
       char buffer[MAX_INPUT_LENGTH + 64];
 
       sprintf(buffer, "Line too long.  Truncated to:\r\n%s\r\n", tmp);
-      if (write_to_descriptor(t->descriptor, buffer) < 0)
-	return (-1);
+      SEND_TO_Q(buffer, t);
     }
     if (t->snoop_by) {
       SEND_TO_Q("% ", t->snoop_by);
@@ -1833,6 +2008,11 @@ void close_socket(struct descriptor_data
   if (d->showstr_count)
     free(d->showstr_vector);
 
+  if (d->deflate) {
+    deflateEnd(d->deflate);
+    free(d->deflate);
+  }
+
   free(d);
 }
 
@@ -2349,3 +2529,20 @@ int open_logfile(const char *filename, F
   printf("SYSERR: Error opening file '%s': %s\n", filename, strerror(errno));
   return FALSE;
 }
+
+
+#if defined(HAVE_ZLIB)
+
+/* Compression stuff. */
+
+void *zlib_alloc(void *opaque, unsigned int items, unsigned int size)
+{
+    return calloc(items, size);
+}
+
+void zlib_free(void *opaque, void *address)
+{
+    free(address);
+}
+
+#endif
diff -upr circle30bpl15/src/comm.h circle30bpl15-zlib/src/comm.h
--- circle30bpl15/src/comm.h	Mon Jan 25 12:47:55 1999
+++ circle30bpl15-zlib/src/comm.h	Sun Mar 21 22:38:10 1999
@@ -31,14 +31,17 @@ void	act(const char *str, int hide_invis
 #define TO_SLEEP	128	/* to char, even if sleeping */
 
 /* I/O functions */
-int	write_to_descriptor(socket_t desc, const char *txt);
+int	write_to_descriptor(socket_t desc, const char *txt, size_t total);
 void	write_to_q(const char *txt, struct txt_q *queue, int aliased);
 void	write_to_output(const char *txt, struct descriptor_data *d);
 void	page_string(struct descriptor_data *d, char *str, int keep_internal);
 void	string_add(struct descriptor_data *d, char *str);
 void	string_write(struct descriptor_data *d, char **txt, size_t len, long mailto, void *data);
 
-#define SEND_TO_Q(messg, desc)  write_to_output((messg), desc)
+int	toggle_compression(struct descriptor_data *d);
+
+#define SEND_TO_Q(messg, desc)		write_to_output((messg), desc)
+#define SEND_TO_SOCKET(messg, desc)	write_to_descriptor((desc), (messg), strlen(messg))
 
 #define USING_SMALL(d)	((d)->output == (d)->small_outbuf)
 #define USING_LARGE(d)  ((d)->output == (d)->large_outbuf)
diff -upr circle30bpl15/src/conf.h.in circle30bpl15-zlib/src/conf.h.in
--- circle30bpl15/src/conf.h.in	Tue Oct 13 23:50:37 1998
+++ circle30bpl15-zlib/src/conf.h.in	Sun Mar 21 22:38:43 1999
@@ -33,6 +33,9 @@
 /* Define if your crypt isn't safe with only 10 characters. */
 #undef HAVE_UNSAFE_CRYPT
 
+/* Define if your system has compression support in zlib. */
+#undef HAVE_ZLIB
+
 /* Define to `int' if <sys/types.h> doesn't define.  */
 #undef ssize_t
 
diff -upr circle30bpl15/src/constants.c circle30bpl15-zlib/src/constants.c
--- circle30bpl15/src/constants.c	Fri Mar  5 00:39:21 1999
+++ circle30bpl15-zlib/src/constants.c	Sun Mar 21 22:39:00 1999
@@ -182,6 +182,7 @@ const char *preference_bits[] = {
   "!GOS",
   "!GTZ",
   "RMFLG",
+  "ZLIB",
   "\n"
 };
 
diff -upr circle30bpl15/src/interpreter.c circle30bpl15-zlib/src/interpreter.c
--- circle30bpl15/src/interpreter.c	Fri Mar  5 00:55:38 1999
+++ circle30bpl15-zlib/src/interpreter.c	Sun Mar 21 22:39:42 1999
@@ -226,6 +226,7 @@ cpp_extern const struct command_info cmd
   { "assist"   , POS_FIGHTING, do_assist   , 1, 0 },
   { "ask"      , POS_RESTING , do_spec_comm, 0, SCMD_ASK },
   { "auction"  , POS_SLEEPING, do_gen_comm , 0, SCMD_AUCTION },
+  { "autocompress", POS_DEAD , do_gen_tog  , 0, SCMD_AUTOZLIB },
   { "autoexit" , POS_DEAD    , do_gen_tog  , 0, SCMD_AUTOEXIT },
 
   { "bounce"   , POS_STANDING, do_action   , 0, 0 },
@@ -255,6 +256,7 @@ cpp_extern const struct command_info cmd
   { "color"    , POS_DEAD    , do_color    , 0, 0 },
   { "comfort"  , POS_RESTING , do_action   , 0, 0 },
   { "comb"     , POS_RESTING , do_action   , 0, 0 },
+  { "compress" , POS_DEAD    , do_gen_tog  , 0, SCMD_COMPRESS },
   { "commands" , POS_DEAD    , do_commands , 0, SCMD_COMMANDS },
   { "compact"  , POS_DEAD    , do_gen_tog  , 0, SCMD_COMPACT },
   { "cough"    , POS_RESTING , do_action   , 0, 0 },
@@ -1448,6 +1450,9 @@ void nanny(struct descriptor_data *d, ch
       /* check and make sure no other copies of this player are logged in */
       if (perform_dupe_check(d))
 	return;
+
+      if (PRF_FLAGGED(d->character, PRF_AUTOZLIB))
+        toggle_compression(d);
 
       if (GET_LEVEL(d->character) >= LVL_IMMORT)
 	SEND_TO_Q(imotd, d);
diff -upr circle30bpl15/src/interpreter.h circle30bpl15-zlib/src/interpreter.h
--- circle30bpl15/src/interpreter.h	Fri Jan  8 03:20:00 1999
+++ circle30bpl15-zlib/src/interpreter.h	Sun Mar 21 22:40:01 1999
@@ -119,6 +119,8 @@ struct alias_data {
 #define SCMD_SLOWNS	14
 #define SCMD_AUTOEXIT	15
 #define SCMD_TRACK	16
+#define SCMD_COMPRESS	17
+#define SCMD_AUTOZLIB	18
 
 /* do_wizutil */
 #define SCMD_REROLL	0
diff -upr circle30bpl15/src/structs.h circle30bpl15-zlib/src/structs.h
--- circle30bpl15/src/structs.h	Fri Mar  5 00:39:21 1999
+++ circle30bpl15-zlib/src/structs.h	Sun Mar 21 22:41:09 1999
@@ -170,6 +170,10 @@
 #define MOB_NOBLIND	 (1 << 17) /* Mob can't be blinded		*/
 
 
+/* Descriptor flags */
+#define DESC_CANZLIB	(1 << 0)  /* Client says compression capable.   */
+
+
 /* Preference flags: used by char_data.player_specials.pref */
 #define PRF_BRIEF       (1 << 0)  /* Room descs won't normally be shown	*/
 #define PRF_COMPACT     (1 << 1)  /* No extra CRLF pair before prompts	*/
@@ -193,6 +197,7 @@
 #define PRF_NOGOSS	(1 << 19) /* Can't hear gossip channel		*/
 #define PRF_NOGRATZ	(1 << 20) /* Can't hear grats channel		*/
 #define PRF_ROOMFLAGS	(1 << 21) /* Can see room flags (ROOM_x)	*/
+#define PRF_AUTOZLIB	(1 << 22) /* Automatically do compression.	*/
 
 
 /* Affect bits: used in char_data.char_specials.saved.affected_by */
@@ -969,6 +974,10 @@ struct descriptor_data {
    struct descriptor_data *snooping; /* Who is this char snooping	*/
    struct descriptor_data *snoop_by; /* And who is snooping this char	*/
    struct descriptor_data *next; /* link to next descriptor		*/
+   int  options;		 /* descriptor flags			*/
+#if defined(HAVE_ZLIB)
+   z_stream *deflate;		 /* compression engine			*/
+#endif
 };
 
 
diff -upr circle30bpl15/src/sysdep.h circle30bpl15-zlib/src/sysdep.h
--- circle30bpl15/src/sysdep.h	Wed Feb  3 18:06:57 1999
+++ circle30bpl15-zlib/src/sysdep.h	Sun Mar 21 22:41:24 1999
@@ -195,6 +195,9 @@ extern void abort (), exit ();
 #define assert(arg)
 #endif
 
+#ifdef HAVE_ZLIB
+# include <zlib.h>
+#endif
 
 /* Header files only used in comm.c and some of the utils */
 
diff -upr circle30bpl15/src/utils.h circle30bpl15-zlib/src/utils.h
--- circle30bpl15/src/utils.h	Sat Mar 13 19:59:47 1999
+++ circle30bpl15-zlib/src/utils.h	Sun Mar 21 22:41:55 1999
@@ -189,6 +189,7 @@ void	update_pos(struct char_data *victim
 #define PRF_FLAGS(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.pref))
 #define AFF_FLAGS(ch)	((ch)->char_specials.saved.affected_by)
 #define ROOM_FLAGS(loc)	(world[(loc)].room_flags)
+#define DESC_FLAGS(d)	((d)->options)
 #define SPELL_ROUTINES(spl)	(spell_info[spl].routines)
 
 /* See http://www.circlemud.org/~greerga/todo.009 to eliminate MOB_ISNPC. */
@@ -204,6 +205,7 @@ void	update_pos(struct char_data *victim
 #define OBJVAL_FLAGGED(obj, flag) (IS_SET(GET_OBJ_VAL((obj), 1), (flag)))
 #define OBJWEAR_FLAGGED(obj, flag) (IS_SET((obj)->obj_flags.wear_flags, (flag)))
 #define OBJ_FLAGGED(obj, flag) (IS_SET(GET_OBJ_EXTRA(obj), (flag)))
+#define DESC_FLAGGED(d, flag) (IS_SET(DESC_FLAGS(d), (flag)))
 #define HAS_SPELL_ROUTINE(spl, flag) (IS_SET(SPELL_ROUTINES(spl), (flag)))
 
 /* IS_AFFECTED for backwards compatibility */
