--- tf-4.0s1.orig/unix/tfconfig
+++ tf-4.0s1/unix/tfconfig
@@ -168,18 +168,18 @@
 # The cd;pwd is needed to normalize the directory name in case of links, etc.
 
 DIR1=`echo $TF      | sed 's;/[^/]*$;;'`
-DIR1=`cd $DIR1 && pwd`
+#DIR1=`cd $DIR1 && pwd`
 DIR2=`echo $LIBDIR  | sed 's;/[^/]*$;;'`
-DIR2=`cd $DIR2 && pwd`
+#DIR2=`cd $DIR2 && pwd`
 DIR3=`echo $SYMLINK | sed 's;/[^/]*$;;'`
-DIR3=`cd $DIR3 && pwd`
+#DIR3=`cd $DIR3 && pwd`
 
-if [ -z "$DIR1" ] || [ -z "$DIR2" ] || [ -z "$DIR3" ]; then
+if [ -z "$DIR1" ] || [ -z "$DIR2" ]; then
     echo "Error in directory."
     exit 1;
 fi
 
-DIR1=`cd $DIR1 && pwd || { echo "Error in directory $DIR1."; false; }`
+#DIR1=`cd $DIR1 && pwd || { echo "Error in directory $DIR1."; false; }`
 
 BUILDTREE=`cd .. && pwd`
 if echo "${DIR1}/" | egrep "^${BUILDTREE}/" >/dev/null 2>&1 ||
@@ -482,6 +482,14 @@
     echo "I can't find <pwd.h>.  Filename '~user' expansion won't be supported."
 fi
 
+### Find zlib.h
+if echo '#include <zlib.h>' >test.c; ${CPP} test.c >/dev/null 2>&1; then
+    echo "#define MUDCOMPRESS" >&4
+    echo "Found <zlib.h>."
+else
+    echo "I can't find <zlib.h>.  The Mud Client Compression Protocol will not be supported."
+fi
+
 ### Figure out how to do varadic args.
 if [ "$STD_C" = "1" ] || [ "$GNU_C" = "1" ]; then
     if echo '#include <stdarg.h>' >test.c; ${CPP} test.c >/dev/null 2>&1; then
@@ -758,6 +766,12 @@
     echo "/* warning: tfconfig couldn't find connect() */" >&4
 fi
 
+### Test for zlib for mud compression
+if eval "${LIBTEST} -lz ${LIBS} >/dev/null 2>&1" && test -f ${AOUT}; then
+    echo "Will link with -lz."
+    LIBS="-lz $LIBS"
+fi
+
 ### Test for SOCKS firewall proxy server.
 if [ -n "$SOCKS" ]; then
     # SOCKS uses res_init(), so we need -lresolv if there is one.
