diff -urN htmldoc-1.8.27-orig/configure.in htmldoc-1.8.27/configure.in
--- htmldoc-1.8.27-orig/configure.in	2006-08-02 19:36:53.000000000 +0000
+++ htmldoc-1.8.27/configure.in	2011-05-23 09:05:32.608174080 +0000
@@ -109,7 +109,7 @@
 AC_SUBST(LDFLAGS)
 
 AC_CHECK_LIB(m,pow)
-AC_SEARCH_LIBS(socket, socket)
+AC_SEARCH_LIBS(socket, network socket)
 AC_SEARCH_LIBS(gethostbyaddr, nsl)
 AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO))
 AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO))
@@ -316,8 +316,8 @@
     bindir="$exec_prefix/bin"
 fi
 
-AC_DEFINE_UNQUOTED(DOCUMENTATION, "$prefix/share/doc/htmldoc")
-AC_DEFINE_UNQUOTED(HTML_DATA, "$prefix/share/htmldoc")
+AC_DEFINE_UNQUOTED(DOCUMENTATION, "$prefix/data/doc/htmldoc")
+AC_DEFINE_UNQUOTED(HTML_DATA, "$prefix/data/htmldoc")
 
 dnl Update compiler options...
 if test -n "$GXX"; then
diff -urN htmldoc-1.8.27-orig/data/Makefile htmldoc-1.8.27/data/Makefile
--- htmldoc-1.8.27-orig/data/Makefile	2004-05-10 01:14:53.000000000 +0000
+++ htmldoc-1.8.27/data/Makefile	2011-05-23 09:03:53.007602176 +0000
@@ -53,11 +53,11 @@
 #
 
 install:
-	if [ ! -d $(datadir)/htmldoc/data ]; then\
-		$(MKDIR) $(datadir)/htmldoc/data;\
+	if [ ! -d $(DESTDIR)$(datadir)/htmldoc/data ]; then\
+		$(MKDIR) $(DESTDIR)$(datadir)/htmldoc/data;\
 	fi
-	$(CP) $(FILES) $(datadir)/htmldoc/data
-	$(CHMOD) ugo+r $(datadir)/htmldoc/data/*
+	$(CP) $(FILES) $(DESTDIR)$(datadir)/htmldoc/data
+	$(CHMOD) ugo+r $(DESTDIR)$(datadir)/htmldoc/data/*
 
 
 #
diff -urN htmldoc-1.8.27-orig/doc/Makefile htmldoc-1.8.27/doc/Makefile
--- htmldoc-1.8.27-orig/doc/Makefile	2005-10-28 20:32:59.000000000 +0000
+++ htmldoc-1.8.27/doc/Makefile	2011-05-23 09:03:57.148897792 +0000
@@ -57,16 +57,16 @@
 #
 
 install: $(DOCUMENTS)
-	if [ ! -d $(datadir)/doc/htmldoc ]; then\
-		$(MKDIR) $(datadir)/doc/htmldoc;\
+	if [ ! -d $(DESTDIR)$(mandir)/doc/htmldoc ]; then\
+		$(MKDIR) $(DESTDIR)$(mandir)/doc/htmldoc;\
 	fi
-	$(CP) $(DOCFILES) $(datadir)/doc/htmldoc
-	$(CHMOD) ugo+r $(datadir)/doc/htmldoc/*
-	if [ ! -d $(mandir)/man1 ]; then\
-		$(MKDIR) $(mandir)/man1;\
+	$(CP) $(DOCFILES) $(DESTDIR)/$(mandir)/doc/htmldoc
+	$(CHMOD) ugo+r $(DESTDIR)/$(mandir)/doc/htmldoc/*
+	if [ ! -d $(DESTDIR)$(mandir)/man1 ]; then\
+		$(MKDIR) $(DESTDIR)/$(mandir)/man1;\
 	fi
-	$(CP) htmldoc.man $(mandir)/man1/htmldoc.1
-	$(CHMOD) ugo+r $(mandir)/man1/htmldoc.1
+	$(CP) htmldoc.man $(DESTDIR)/$(mandir)/man1/htmldoc.1
+	$(CHMOD) ugo+r $(DESTDIR)/$(mandir)/man1/htmldoc.1
 
 
 #
diff -urN htmldoc-1.8.27-orig/fonts/Makefile htmldoc-1.8.27/fonts/Makefile
--- htmldoc-1.8.27-orig/fonts/Makefile	2005-10-28 20:32:59.000000000 +0000
+++ htmldoc-1.8.27/fonts/Makefile	2011-05-23 09:04:00.721682432 +0000
@@ -75,14 +75,14 @@
 
 install:
 	echo "Installing font files in $(datadir)/htmldoc/fonts..."
-	if [ ! -d $(datadir)/htmldoc/fonts ]; then\
-		$(MKDIR) $(datadir)/htmldoc/fonts;\
+	if [ ! -d $(DESTDIR)/$(datadir)/htmldoc/fonts ]; then\
+		$(MKDIR) $(DESTDIR)/$(datadir)/htmldoc/fonts;\
 	fi
 	for font in $(FONTS); do \
-		$(CP) $$font.afm $(datadir)/htmldoc/fonts; \
-		$(CP) $$font.pfa $(datadir)/htmldoc/fonts; \
+		$(CP) $$font.afm $(DESTDIR)/$(datadir)/htmldoc/fonts; \
+		$(CP) $$font.pfa $(DESTDIR)/$(datadir)/htmldoc/fonts; \
 	done
-	$(CHMOD) ugo+r $(datadir)/htmldoc/fonts/*
+	$(CHMOD) ugo+r $(DESTDIR)/$(datadir)/htmldoc/fonts/*
 
 
 #
diff -urN htmldoc-1.8.27-orig/htmldoc/Makefile htmldoc-1.8.27/htmldoc/Makefile
--- htmldoc-1.8.27-orig/htmldoc/Makefile	2005-10-28 20:32:59.000000000 +0000
+++ htmldoc-1.8.27/htmldoc/Makefile	2011-05-23 09:04:04.563609600 +0000
@@ -50,11 +50,11 @@
 #
 
 install:	all
-	if [ ! -d $(bindir) ]; then\
-		$(MKDIR) $(bindir);\
+	if [ ! -d $(DESTDIR)/$(bindir) ]; then\
+		$(MKDIR) $(DESTDIR)/$(bindir);\
 	fi
-	cp htmldoc$(EXEEXT) $(bindir)
-	chmod ugo+rx $(bindir)/htmldoc$(EXEEXT)
+	cp htmldoc$(EXEEXT) $(DESTDIR)/$(bindir)
+	chmod ugo+rx $(DESTDIR)/$(bindir)/htmldoc$(EXEEXT)
 
 
 #
diff -urN htmldoc-1.8.27-orig/htmldoc/http.h htmldoc-1.8.27/htmldoc/http.h
--- htmldoc-1.8.27-orig/htmldoc/http.h	2006-04-03 15:41:08.000000000 +0000
+++ htmldoc-1.8.27/htmldoc/http.h	2011-05-23 09:04:08.438304768 +0000
@@ -102,6 +102,8 @@
 #    define s6_addr32	_S6_un._S6_u32
 #  elif defined(__FreeBSD__) || defined(__APPLE__)
 #    define s6_addr32	__u6_addr.__u6_addr32
+#  elif defined(__HAIKU__)
+#    define s6_addr32   s6_addr
 #  elif defined(__osf__)
 #    define s6_addr32	s6_un.sa6_laddr
 #  elif defined(WIN32)
