diff -urN postgresql-9.2.3/configure.in postgresql-9.2.3-haiku/configure.in
--- postgresql-9.2.3/configure.in
+++ postgresql-9.2.3-haiku/configure.in
@@ -861,7 +861,7 @@
 AC_CHECK_LIB(m, main)
 AC_SEARCH_LIBS(setproctitle, util)
 AC_SEARCH_LIBS(dlopen, dl)
-AC_SEARCH_LIBS(socket, [socket wsock32])
+AC_SEARCH_LIBS(socket, [socket wsock32 network])
 AC_SEARCH_LIBS(shl_load, dld)
 # We only use libld in port/dynloader/aix.c
 case $host_os in
diff -urN postgresql-9.2.3/src/template/haiku postgresql-9.2.3-haiku/src/template/haiku
--- postgresql-9.2.3/src/template/haiku
+++ postgresql-9.2.3-haiku/src/template/haiku
@@ -0,0 +1,3 @@
+case $host_os in
+  haiku*) ;;
+esac
