Index: Makefile.in
--- Makefile.in.orig	2004-12-31 20:13:47 +0100
+++ Makefile.in	2005-01-06 10:37:07 +0100
@@ -659,7 +659,7 @@
 		-rpath $(libdir)/honeyd $(LIBHONEYDFILES) $(LIBS) $(LDFLAGS) \
 		-module -avoid-version -nostdlib @LIBDL@
 	rm -f libtmp$@.la tmp$@.so* $@
-	cp .libs/libtmp$@.so $@ || cp .libs/libtmp$@ $@
+	cp .libs/libtmp$@.a $@ || cp .libs/libtmp$@ $@
 	rm -f .libs/libtmp$@.*
 
 install-data-local:
Index: command.c
--- command.c.orig	2004-12-31 20:13:37 +0100
+++ command.c	2005-01-06 10:37:07 +0100
@@ -69,6 +69,9 @@
 #include "fdpass.h"
 #include "osfp.h"
 #include "pyextend.h"
+#ifndef HAVE_SETENV
+#include "setenv.h"
+#endif
 
 ssize_t atomicio(ssize_t (*)(), int, void *, size_t);
 
Index: compat/getopt.h
--- compat/getopt.h.orig	2004-12-31 20:13:36 +0100
+++ compat/getopt.h	2005-01-06 10:37:07 +0100
@@ -40,7 +40,11 @@
 #ifndef _GETOPT_H_
 #define _GETOPT_H_
 
+#ifdef HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#else
+#include "cdefs.h"
+#endif
 
 /*
  * GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions
Index: compat/sha1.h
--- compat/sha1.h.orig	2004-12-31 20:13:36.000000000 +0100
+++ compat/sha1.h	2005-01-07 13:53:01.066282520 +0100
@@ -15,7 +15,11 @@
     unsigned char buffer[64];
 } SHA1_CTX;
 
+#ifdef HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#else
+#include "cdefs.h"
+#endif
 
 __BEGIN_DECLS
 void SHA1Transform(u_int32_t [5], const unsigned char [64])
Index: config.h.in
--- config.h.in.orig	2004-12-06 04:17:14 +0100
+++ config.h.in	2005-01-06 10:37:07 +0100
@@ -210,6 +210,9 @@
 /* Define if you have the `strtoul' function. */
 #undef HAVE_STRTOUL
 
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
 /* Define if your system defines struct sockaddr_storage */
 #undef HAVE_STRUCT_SOCKADDR_STORAGE
 
@@ -240,6 +243,9 @@
 /* Define if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
+#undef HAVE_SYS_CDEFS_H
+
 /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
 #undef HAVE_SYS_WAIT_H
 
Index: configure
--- configure.orig	2004-12-31 20:13:48 +0100
+++ configure	2005-01-06 10:37:40 +0100
@@ -4631,7 +4631,7 @@
 
 fi
 
-for ac_header in stdarg.h errno.h fcntl.h paths.h stdlib.h string.h time.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/ioccom.h syslog.h unistd.h assert.h
+for ac_header in stdarg.h errno.h fcntl.h paths.h stdlib.h string.h time.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/ioccom.h syslog.h unistd.h assert.h sys/cdefs.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 echo "$as_me:4637: checking for $ac_header" >&5
@@ -5593,7 +5593,7 @@
 fi
 done
 
-for ac_func in dup2 fgetln gettimeofday memmove memset strcasecmp strchr strdup strncasecmp strtoul strspn getaddrinfo getnameinfo freeaddrinfo setgroups sendmsg recvmsg setregid setruid
+for ac_func in dup2 fgetln gettimeofday memmove memset strcasecmp strchr strdup strncasecmp strtoul strspn getaddrinfo getnameinfo freeaddrinfo setgroups sendmsg recvmsg setregid setruid setenv
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:5599: checking for $ac_func" >&5
Index: honeyd.c
--- honeyd.c.orig	2004-12-31 20:13:37 +0100
+++ honeyd.c	2005-01-06 10:38:13 +0100
@@ -98,6 +98,9 @@
 #include "rrdtool.h"
 #include "histogram.h"
 #include "update.h"
+#ifndef HAVE_SETENV
+#include "setenv.h"
+#endif
 
 #ifdef HAVE_PYTHON
 #include "pyextend.h"
Index: honeyd_overload.c
--- honeyd_overload.c.orig	2004-12-31 20:13:44 +0100
+++ honeyd_overload.c	2005-01-06 10:37:07 +0100
@@ -252,7 +252,7 @@
 	struct fd *nfd;
 	int pair[2];
 
-	if (socketpair(AF_LOCAL, type, 0, pair) == -1) {
+	if (socketpair(AF_UNIX, type, 0, pair) == -1) {
 		warn("%s: socketpair", __func__);
 		return (NULL);
 	}
@@ -530,7 +530,7 @@
 	}
 
 	/* Get another socketpair */
-	if (socketpair(AF_LOCAL, SOCK_STREAM, 0, pair) == -1) {
+	if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) {
 		DPRINTF((stderr, "%s: socketpair failed", __func__));
 		errno = ETIMEDOUT; /* XXX */
 		return (-1);
@@ -637,6 +637,7 @@
 }
 #endif /* !__FreeBSD__ */
 
+#ifndef sun
 ssize_t
 recvfrom(int sock, void *buf, size_t len, int flags, struct sockaddr *from,
     socklen_t *fromlen)
@@ -664,6 +665,7 @@
  out:
 	return (ret);
 }
+#endif /* !sun */
 
 ssize_t
 sendto(int sock, const void *buf, size_t len, int flags,
@@ -688,6 +690,7 @@
 	return (ret);
 }
 
+#ifndef sun
 int
 getsockname(int sock, struct sockaddr *to, socklen_t *tolen)
 {
@@ -713,6 +716,7 @@
 
 	return (0);
 }
+#endif /* !sun */
 
 ssize_t
 sendmsg(int sock, const struct msghdr *msg, int flags)
@@ -805,6 +809,7 @@
 	return (ret);
 }
 
+#ifndef sun
 int
 accept(int sock, struct sockaddr *addr, socklen_t *addrlen)
 {
@@ -843,3 +848,4 @@
 
 	return (fd);
 }
+#endif /* !sun */
Index: personality.c
--- personality.c.orig	2004-12-31 20:13:38 +0100
+++ personality.c	2005-01-06 10:37:07 +0100
@@ -32,6 +32,9 @@
 
 #include <sys/param.h>
 #include <sys/types.h>
+#ifndef UINT_MAX
+#define UINT_MAX    4294967295U
+#endif
 
 #include "config.h"
 
Index: pf_osfp.c
--- pf_osfp.c.orig	2004-12-31 20:13:43 +0100
+++ pf_osfp.c	2005-01-06 10:37:07 +0100
@@ -50,6 +50,10 @@
 #  define DPFPRINTF(format, x...)	((void)0)
 # endif /* PFDEBUG */
 
+#ifndef MAX
+# define MAX(a,b)  (((a) > (b)) ? (a) : (b))
+#endif
+
 SLIST_HEAD(pf_osfp_list, pf_os_fingerprint) pf_osfp_list;
 pool_t pf_osfp_entry_pl;
 pool_t pf_osfp_pl;
Index: Makefile.in
--- Makefile.in.orig	2005-01-06 10:38:41 +0100
+++ Makefile.in	2005-01-06 10:40:54 +0100
@@ -664,9 +664,9 @@
 
 install-data-local:
 	(cd $(top_srcdir) && tar -cf - $(top_srcdir)/webserver) | \
-	(cd $(honeyddatadir) && tar -xf -)
-	find $(honeyddatadir)/webserver -type f | xargs chmod a+r
-	find $(honeyddatadir)/webserver -type d | xargs chmod a+xr
+	(cd $(DESTDIR)$(honeyddatadir) && tar -xf -)
+	find $(DESTDIR)$(honeyddatadir)/webserver -type f | xargs chmod a+r
+	find $(DESTDIR)$(honeyddatadir)/webserver -type d | xargs chmod a+xr
 
 dist-hook:
 	./distribute.py $(distdir)/
Index: dhcpclient.c
--- dhcpclient.c.orig	2005-01-07 13:06:46.552453044 +0100
+++ dhcpclient.c	2005-01-07 13:06:48.391812793 +0100
@@ -94,6 +94,13 @@
 
 #define NTRIES 10
 
+#ifndef MIN
+# define MIN(a,b)	(((a) < (b)) ? (a) : (b))
+#endif /* MIN */
+#ifndef MAX
+# define MAX(a,b)	(((a) > (b)) ? (a) : (b))
+#endif /* MAX */
+
 static int  _pack_request(struct dhcpclient_req *, void *, size_t *);
 static int  _pack_release(struct dhcpclient_req *, void *, size_t *);
 static int  _bcast(struct template *,
