diff -up w3m-0.5.3/acinclude.m4.orig w3m-0.5.3/acinclude.m4
--- w3m-0.5.3/acinclude.m4.orig	2011-01-04 02:22:18.056885248 -0700
+++ w3m-0.5.3/acinclude.m4	2012-05-04 23:23:51.741605376 -0600
@@ -382,7 +382,7 @@ AC_DEFUN([AC_W3M_EXTLIBS],
 [lib=$1
  AC_MSG_CHECKING(for -l$lib)
  extlib="not found"
- for dir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib /lib64 /usr/lib64
+ for dir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib /lib64 /usr/lib64 /boot/home/config/develop/lib /boot/system/develop/lib
  do
    if test -f $dir/lib$lib.a -o -f $dir/lib$lib.so ; then 
     LIBS="$LIBS -l$lib"
@@ -420,7 +420,7 @@ AC_ARG_WITH(gc,
  [test x"$with_gc" = xno && AC_MSG_ERROR([You can not build w3m without gc])],
  [with_gc="yes"])
  AC_MSG_RESULT($with_gc)
- test x"$with_gc" = xyes && with_gc="/usr /usr/local ${HOME}"
+ test x"$with_gc" = xyes && with_gc="/usr /usr/local /boot/common ${HOME}"
  unset ac_cv_header_gc_h
  AC_CHECK_HEADER(gc.h)
  if test x"$ac_cv_header_gc_h" = xno; then
@@ -477,7 +477,7 @@ AC_MSG_RESULT($with_ssl)
 if test x"$with_ssl" != xno; then
   PKG_CHECK_MODULES(SSL, openssl,,[
     AC_MSG_CHECKING(for SSL library/header)
-    test x"$with_ssl" = xyes && with_ssl="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
+    test x"$with_ssl" = xyes && with_ssl="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local /boot/system/develop /boot/home/config/develop"
     AC_MSG_RESULT($with_ssl)
     for dir in $with_ssl
     do
diff -up w3m-0.5.3/configure.ac.orig w3m-0.5.3/configure.ac
--- w3m-0.5.3/configure.ac.orig	2011-01-14 20:01:55.044826624 -0700
+++ w3m-0.5.3/configure.ac	2012-05-04 23:25:37.043778048 -0600
@@ -82,7 +82,7 @@ AC_W3M_MAILER
 AC_W3M_EXT_BROWSER
 
 dnl Checks for ext libs
-for lib in bsd BSD 44bsd socket nsl dld dl
+for lib in bsd BSD 44bsd socket network nsl dld dl
 do
  AC_W3M_EXTLIBS($lib)
 done
@@ -169,7 +169,14 @@ AC_SUBST(HELP_DIR)
 HELP_DIR="$datadir/$PACKAGE"
 AC_DEFINE(HELP_DIR, "$HELP_DIR")
 AC_SUBST(RC_DIR)
-RC_DIR="~/.$PACKAGE"
+case "$host_os" in
+  *haiku*)
+    RC_DIR="~/config/settings/$PACKAGE"
+    ;;
+  *)
+    RC_DIR="~/.$PACKAGE"
+    ;;
+esac
 AC_DEFINE(RC_DIR, "$RC_DIR")
 AC_SUBST(DOCDIRS)
 DOCDIRS="doc:en_English doc-jp:ja_Japanese"
diff -up w3m-0.5.3/main.c.orig w3m-0.5.3/main.c
--- w3m-0.5.3/main.c.orig	2011-01-04 02:42:19.049807360 -0700
+++ w3m-0.5.3/main.c	2012-05-04 23:23:51.778305536 -0600
@@ -833,7 +833,12 @@ main(int argc, char **argv, char **envp)
     mySignal(SIGPIPE, SigPipe);
 #endif
 
+#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2
+    orig_GC_warn_proc = GC_get_warn_proc();
+    GC_set_warn_proc(wrap_GC_warn_proc);
+#else
     orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc);
+#endif
     err_msg = Strnew();
     if (load_argc == 0) {
 	/* no URL specified */
