diff -Nurd dictd-1.7.1.orig/Makefile.in dictd-1.7.1/Makefile.in
--- dictd-1.7.1.orig/Makefile.in	2002-05-04 21:59:56.000000000 -0400
+++ dictd-1.7.1/Makefile.in	2005-12-13 18:30:20.000000000 -0500
@@ -33,7 +33,7 @@
 srcdir=		@srcdir@
 VPATH=		@srcdir@
 prefix=		@prefix@
-subdirs=        @allsubdirs@ regex # doc -- use rfc2229 instead
+subdirs=        @allsubdirs@ # doc -- use rfc2229 instead
 exec_prefix=	@exec_prefix@
 man1_prefix=	@mandir@/man1
 man8_prefix=	@mandir@/man8
@@ -57,9 +57,9 @@
 		-DDICT_CONFIG_PATH=\"$(conf)\"
 SCFLAGS=        @SCFLAGS@
 LDFLAGS=        @LDFLAGS@
-XTRACFLAGS=     @WCFLAGS@ @XTRACFLAGS@ @DEFS@ @CPPFLAGS@ -I. -Iregex
+XTRACFLAGS=     @WCFLAGS@ @XTRACFLAGS@ @DEFS@ -I. @CPPFLAGS@
 XTRALDFLAGS=    @WLDFLAGS@ @XTRALDFLAGS@
-LDLIBS=		@LIBS@ -Lregex -lregex
+LDLIBS=		@LIBS@
 
 EXES=	 	dict dictd dictzip
 
@@ -105,10 +105,10 @@
 	$(CC) $(ALLFLAGS) -o $@ $< $(CLIOBJS) $(LDLIBS)
 
 dictd:: dictd.c $(HEADERS) $(NETOBJS) $(SRCHOBJS)
-	$(CC) $(ALLFLAGS) -o $@ $< $(NETOBJS) $(SRCHOBJS) $(ZIPOBJS) $(LDLIBS)
+	$(CC) -o $@ $< $(NETOBJS) $(SRCHOBJS) $(ZIPOBJS) $(LDLIBS) $(ALLFLAGS)
 
 dictzip:: dictzip.c $(HEADERS) $(SRCHOBJS)
-	$(CC) $(ALLFLAGS) -o $@ $< $(SRCHOBJS) $(LDLIBS)
+	$(CC) -o $@ $< $(SRCHOBJS) $(LDLIBS) $(ALLFLAGS)
 
 servscan.c: servscan.l
 	$(LEX) $(LFLAGS) -o$@ $<
@@ -144,7 +144,7 @@
 	if test ! -d $(bindir); then $(INSTALL) -d 755 $(bindir); fi
 	if test ! -d $(man1_prefix); then $(INSTALL) -d 755 $(man1_prefix); fi
 	$(INSTALL_PROGRAM) dict $(bindir)
-	$(INSTALL_DATA	dict.1 $(man1_prefix)/dict.1
+	$(INSTALL_DATA)	dict.1 $(man1_prefix)/dict.1
 
 install.dictzip: dictzip
 	if test ! -d $(bindir); then $(INSTALL) -d 755 $(bindir); fi
diff -Nurd dictd-1.7.1.orig/configure dictd-1.7.1/configure
--- dictd-1.7.1.orig/configure	2002-05-04 22:00:06.000000000 -0400
+++ dictd-1.7.1/configure	2005-12-13 18:19:29.000000000 -0500
@@ -1416,7 +1416,6 @@
     fi
 fi
 
-local_zlib=1
 if test "$local_zlib" = 0; then
     echo $ac_n "checking for zlibVersion in -lz""... $ac_c" 1>&6
 echo "configure:1423: checking for zlibVersion in -lz" >&5
diff -Nurd dictd-1.7.1.orig/dict.conf dictd-1.7.1/dict.conf
--- dictd-1.7.1.orig/dict.conf	1969-12-31 19:00:00.000000000 -0500
+++ dictd-1.7.1/dict.conf	2005-12-13 17:18:29.000000000 -0500
@@ -0,0 +1,16 @@
+#  /etc/dict.conf Written by Bob Hilliard <hilliard@debian.org>
+#  1998/03/20.  Last revised Sun, 22 Nov 1998 18:10:04 -0500 This is
+#  the configuration file for /usr/bin/dict.  In most cases only the
+#  server keyword need be specified.
+
+#  This default configuration will try to access a dictd server on the
+#  local host, failing that, it will try the public server.  In many
+#  cases this will be slow, so you should comment out the line for the
+#  server that you don't want to use. To use any other server, enter
+#  its IP address in place of "dict.org".
+
+#  Refer to the dict manpage (man dict) for other options that could
+#  be inserted in here.
+
+server localhost
+server dict.org
diff -Nurd dictd-1.7.1.orig/dictzip.c dictd-1.7.1/dictzip.c
--- dictd-1.7.1.orig/dictzip.c	2002-04-22 11:51:13.000000000 -0400
+++ dictd-1.7.1/dictzip.c	2005-12-13 18:42:53.000000000 -0500
@@ -22,6 +22,7 @@
  */
 
 #include "dictzip.h"
+#include <sys/types.h>
 #include <sys/stat.h>
 
 void dict_data_print_header( FILE *str, dictData *header )
@@ -163,7 +164,7 @@
    fstat( fileno( inStr ), &st );
    chunks = st.st_size / chunkLength;
    if (st.st_size % chunkLength) ++chunks;
-   PRINTF(DBG_VERBOSE,("%lu chunks * %u per chunk = %lu (filesize = %lu)\n",
+   PRINTF(DBG_VERBOSE,("%lu chunks * %u per chunk = %lu (filesize = %llu)\n",
 			chunks, chunkLength, chunks * chunkLength,
 			st.st_size ));
    dataLength   = chunks * 2;
@@ -230,13 +231,13 @@
 	 ++chunk;
 	 total += count;
 	 if (dbg_test( DBG_VERBOSE )) {
-	    printf( "chunk %5lu: %lu of %lu total\r",
+	    printf( "chunk %5lu: %lu of %llu total\r",
 		    chunk, total, st.st_size );
 	    fflush( stdout );
 	 }
       }
    }
-   PRINTF(DBG_VERBOSE,("total: %lu chunks, %lu bytes\n", chunks, st.st_size));
+   PRINTF(DBG_VERBOSE,("total: %lu chunks, %llu bytes\n", chunks, st.st_size));
     
    /* Write last bit */
 #if 0
diff -Nurd dictd-1.7.1.orig/libmaa/Makefile.in dictd-1.7.1/libmaa/Makefile.in
--- dictd-1.7.1.orig/libmaa/Makefile.in	2002-03-30 12:13:14.000000000 -0500
+++ dictd-1.7.1/libmaa/Makefile.in	2005-12-13 17:47:06.000000000 -0500
@@ -55,14 +55,14 @@
 CFLAGS=		@CFLAGS@
 LDFLAGS=        @LDFLAGS@
 VFLAGS=         -DMAA_MAJOR=$(MAA_MAJOR) -DMAA_MINOR=$(MAA_MINOR)
-XTRACFLAGS=     @WCFLAGS@ @XTRACFLAGS@ @DEFS@ $(VFLAGS) @CPPFLAGS@ -I.
-XTRALDFLAGS=    @WLDFLAGS@ @XTRALDFLAGS@ -L.
+XTRACFLAGS=     @WCFLAGS@ @XTRACFLAGS@ @DEFS@ $(VFLAGS) -I. @CPPFLAGS@
+XTRALDFLAGS=    @WLDFLAGS@ -L. @XTRALDFLAGS@
 RPATHFLAGS=     @RPATHFLAGS@
 LDLIBS=		-lmaa @LIBS@ -lm
 LDSHARED=       @LDSHARED@
 
 HEADERS= config.h maa.h maaP.h decl.h obstack.h @XTRAHEADERS@
-LIBOBJS= @LIBOBJS@ obstack.o getopt.o getopt1.o \
+LIBOBJS= @LIBOBJS@ obstack.o \
 	 hash.o set.o stack.o list.o error.o memory.o string.o \
 	 debug.o flags.o maa.o prime.o bit.o timer.o version.o \
 	 arg.o pr.o sl.o base64.o base26.o source.o parse.o parse-concrete.o \
diff -Nurd dictd-1.7.1.orig/libmaa/config.h.in dictd-1.7.1/libmaa/config.h.in
--- dictd-1.7.1.orig/libmaa/config.h.in	2002-03-30 09:52:01.000000000 -0500
+++ dictd-1.7.1/libmaa/config.h.in	2005-12-13 17:18:29.000000000 -0500
@@ -96,7 +96,7 @@
 #undef HAVE_SYSCONF
 
 /* Define if you have the <getopt.h> header file.  */
-#undef HAVE_GETOPT_H
+#define HAVE_GETOPT_H 1
 
 /* Define if you have the <limits.h> header file.  */
 #undef HAVE_LIMITS_H
diff -Nurd dictd-1.7.1.orig/libmaa/obstack.c dictd-1.7.1/libmaa/obstack.c
--- dictd-1.7.1.orig/libmaa/obstack.c	1995-04-21 11:31:47.000000000 -0400
+++ dictd-1.7.1/libmaa/obstack.c	2005-12-13 17:41:00.000000000 -0500
@@ -24,6 +24,8 @@
 /* This is just to get __GNU_LIBRARY__ defined.  */
 #include <stdio.h>
 
+#include <stdlib.h>
+
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself.  This code is part of the GNU C
    Library, but also included in many other GNU distributions.  Compiling
diff -Nurd dictd-1.7.1.orig/libmaa/parse.c dictd-1.7.1/libmaa/parse.c
--- dictd-1.7.1.orig/libmaa/parse.c	2002-03-30 12:13:14.000000000 -0500
+++ dictd-1.7.1/libmaa/parse.c	2005-12-13 17:20:11.000000000 -0500
@@ -75,7 +75,7 @@
 
    if (!cpp) {
       if ((cpp = getenv( "KHEPERA_CPP" ))) {
-         PRINTF(MAA_PARSE,(__FUNCTION__ ": Using KHEPERA_CPP from %s\n",cpp));
+	PRINTF(MAA_PARSE,("%s: Using KHEPERA_CPP from %s\n", __FUNCTION__, cpp));
       }
       
                                 /* Always look for gcc's cpp first, since
@@ -86,7 +86,7 @@
          
          if (fread( buf, 1, 1023, tmp ) > 0) {
             if ((t = strchr( buf, '\n' ))) *t = '\0';
-            PRINTF(MAA_PARSE,(__FUNCTION__ ": Using GNU cpp from %s\n",buf));
+            PRINTF(MAA_PARSE,("%s: Using GNU cpp from %s\n", __FUNCTION__, buf));
             cpp = str_find( buf );
             extra_options = "-nostdinc -nostdinc++";
          }
@@ -103,7 +103,7 @@
          for (pt = cpps; **pt; pt++) {
             if (!access( *pt, X_OK )) {
                PRINTF(MAA_PARSE,
-                      (__FUNCTION__ ": Using system cpp from %s\n",*pt));
+                      ("%s: Using system cpp from %s\n", __FUNCTION__, *pt));
                cpp = *pt;
                break;
             }
@@ -123,7 +123,7 @@
    sprintf( buffer, "%s -I. %s %s 2>/dev/null", cpp,
 	    _prs_cpp_options ? _prs_cpp_options : "", filename );
 
-   PRINTF(MAA_PARSE,(__FUNCTION__ ": %s\n",buffer));
+   PRINTF(MAA_PARSE,("%s: %s\n", __FUNCTION__, buffer));
    if (!(yyin = popen( buffer, "r" )))
       err_fatal_errno( __FUNCTION__,
 		       "Cannot open \"%s\" for read\n", filename );
diff -Nurd dictd-1.7.1.orig/regex/Makefile dictd-1.7.1/regex/Makefile
--- dictd-1.7.1.orig/regex/Makefile	2002-03-31 11:41:44.000000000 -0500
+++ dictd-1.7.1/regex/Makefile	2005-12-13 17:18:29.000000000 -0500
@@ -40,6 +40,7 @@
 libregex.a:	$(OBJPRODN)
 	rm -f libregex.a
 	ar crv libregex.a $(OBJPRODN)
+	ranlib libregex.a
 
 purge:
 	rm -f *.o
