      if test -x "$i/bin/xml2-config"; then
        ac_cv_php_xml2_config_path="$i/bin/xml2-config"
        break
+diff -urN php-5.2.9/aclocal.m4 php-5.2.9-haiku/aclocal.m4
+--- php-5.2.9/aclocal.m4	2009-03-01 12:12:52.000000000 +0000
++++ php-5.2.9-haiku/aclocal.m4	2009-03-01 14:55:37.000000000 +0000
+@@ -4142,6 +4142,15 @@
+   shlibpath_var=LIBRARY_PATH
+   ;;
+ 
++haiku*)
++  version_type=linux
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LD_LIBRARY_PATH
++  hardcode_into_libs=yes;;
++
+ bsdi[[45]]*)
+   version_type=linux
+   need_version=no
 diff -urN php-5.2.9/configure.in php-5.2.9-haiku/configure.in
 --- php-5.2.9/configure.in	2009-03-01 12:13:18.000000000 +0000
-+++ php-5.2.9-haiku/configure.in	2009-03-01 12:02:35.000000000 +0000
++++ php-5.2.9-haiku/configure.in	2009-03-01 14:55:53.000000000 +0000
 @@ -345,6 +345,11 @@
  PHP_CHECK_FUNC(gethostbyaddr, nsl)
  PHP_CHECK_FUNC(yp_get_default_domain, nsl)

 PHP_CHECK_FUNC(dlopen, dl)
 if test "$ac_cv_func_dlopen" = "yes"; then
   AC_DEFINE(HAVE_LIBDL, 1, [ ])
diff -urN php-5.2.9/ext/standard/microtime.c php-5.2.9-haiku/ext/standard/microtime.c
--- php-5.2.9/ext/standard/microtime.c	2009-03-01 12:12:26.000000000 +0000
+++ php-5.2.9-haiku/ext/standard/microtime.c	2009-03-01 12:06:02.000000000 +0000

 	PHP_RUSAGE_PARA(ru_oublock);
 	PHP_RUSAGE_PARA(ru_inblock);
 	PHP_RUSAGE_PARA(ru_msgsnd);
diff -urN php-5.2.9/main/network.c php-5.2.9-haiku/main/network.c
--- php-5.2.9/main/network.c	2009-03-01 12:12:46.000000000 +0000
+++ php-5.2.9-haiku/main/network.c	2009-03-01 14:58:23.000000000 +0000
@@ -268,7 +268,7 @@
 #define O_NONBLOCK O_NDELAY
 #endif
 
-#if !defined(__BEOS__)
+#if !defined(__BEOS__) || defined(__HAIKU__)
 # define HAVE_NON_BLOCKING_CONNECT 1
 # ifdef PHP_WIN32
 typedef u_long php_non_blocking_flags_t;
