                  searchdirs=os.environ['BEINCLUDES'].split(';')
              elif sys.platform.startswith("atheos"):
                  searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
-diff -urN Python-2.6.5/configure.in Python-2.6.5-haiku/configure.in
---- Python-2.6.5/configure.in	2010-03-09 21:47:28.038273024 +0000
-+++ Python-2.6.5-haiku/configure.in	2010-03-11 16:54:31.812908544 +0000
-@@ -747,7 +747,7 @@
- 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
- 	  INSTSONAME="$LDLIBRARY".$SOVERSION
-           ;;
--    Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
-+    Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*)
- 	  LDLIBRARY='libpython$(VERSION).so'
- 	  BLDLIBRARY='-L. -lpython$(VERSION)'
- 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
-@@ -825,7 +825,7 @@
- AC_SUBST(LN)
- if test -z "$LN" ; then
- 	case $ac_sys_system in
--		BeOS*) LN="ln -s";;
-+		BeOS*|Haiku*) LN="ln -s";;
- 		CYGWIN*) LN="ln -s";;
- 		atheos*) LN="ln -s";;
- 		*) LN=ln;;
-@@ -1813,7 +1813,7 @@
- 			fi
- 		fi
- 		;;
--	Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
-+	Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';;
- 	BSD/OS*/4*) LDSHARED="gcc -shared";;
- 	FreeBSD*)
- 		if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
-@@ -1867,7 +1867,7 @@
- 		 then CCSHARED="-fPIC";
- 		 else CCSHARED="+z";
- 		 fi;;
--	Linux*|GNU*) CCSHARED="-fPIC";;
-+	Linux*|GNU*|Haiku*) CCSHARED="-fPIC";;
- 	BSD/OS*/4*) CCSHARED="-fpic";;
- 	FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
- 	OpenUNIX*|UnixWare*)
-@@ -1900,7 +1900,7 @@
- 	    LINKFORSHARED="-Wl,-E -Wl,+s";;
- #	    LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
- 	BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
--	Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
-+	Linux*|GNU*|Haiku*) LINKFORSHARED="-Xlinker -export-dynamic";;
- 	# -u libsys_s pulls in all symbols in libsys
- 	Darwin/*) 
- 		# -u _PyMac_Error is needed to pull in the mac toolbox glue,
-@@ -2019,6 +2019,9 @@
- BeOS*)
- AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
- ;;
-+Haiku*)
-+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
-+;;
- esac
- 
- AC_MSG_CHECKING(for --with-libs)
-@@ -3249,7 +3252,7 @@
- AC_SUBST(LIBM)
- case $ac_sys_system in
- Darwin) ;;
--BeOS) ;;
-+BeOS|Haiku) ;;
- *) LIBM=-lm
- esac
- AC_MSG_CHECKING(for --with-libm=STRING)
-diff -urN Python-2.6.5/setup.py Python-2.6.5-haiku/setup.py
---- Python-2.6.5/setup.py	2010-03-08 07:08:25.030146560 +0000
-+++ Python-2.6.5-haiku/setup.py	2010-03-11 16:55:47.940834816 +0000
-@@ -382,6 +382,10 @@
-             inc_dirs += ['/system/include', '/atheos/autolnk/include']
-             inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
- 
-+        if platform == 'haiku1':
-+            inc_dirs += ['/boot/develop/headers/posix', '/boot/develop/headers/3rdparty', '/boot/common/include']
-+            lib_dirs += ['/boot/system/lib', '/boot/develop/lib/x86', '/boot/common/lib']
-+
-         # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
-         if platform in ['osf1', 'unixware7', 'openunix8']:
-             lib_dirs += ['/usr/ccs/lib']
-@@ -405,7 +409,7 @@
- 
-         # Check for MacOS X, which doesn't need libm.a at all
-         math_libs = ['m']
--        if platform in ['darwin', 'beos', 'mac']:
-+        if platform in ['darwin', 'beos', 'haiku1', 'mac']:
-             math_libs = []
- 
-         # XXX Omitted modules: gl, pure, dl, SGI-specific modules
-@@ -1068,7 +1072,7 @@
-                 missing.append('resource')
- 
-             # Sun yellow pages. Some systems have the functions in libc.
--            if (platform not in ['cygwin', 'atheos', 'qnx6'] and
-+            if (platform not in ['cygwin', 'atheos', 'qnx6', 'haiku1'] and
-                 find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
-                 if (self.compiler.find_library_file(lib_dirs, 'nsl')):
-                     libs = ['nsl']

 		}
 
 		Py_BEGIN_ALLOW_THREADS
diff -urN Python-2.6.5/Parser/asdl_c.py Python-2.6.5-haiku/Parser/asdl_c.py
--- Python-2.6.5/Parser/asdl_c.py	2009-12-13 00:59:01.033030144 +0000
+++ Python-2.6.5-haiku/Parser/asdl_c.py	2010-03-11 16:54:31.798228480 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
 """Generate C code from an ASDL description."""
 
 # TO DO
diff -urN Python-2.6.5/Tools/scripts/h2py.py Python-2.6.5-haiku/Tools/scripts/h2py.py
--- Python-2.6.5/Tools/scripts/h2py.py	2004-08-09 17:27:55.039059456 +0000
+++ Python-2.6.5-haiku/Tools/scripts/h2py.py	2010-03-11 16:54:31.805830656 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
 
 # Read #define's and translate to Python code.
 # Handle #include statements.
@@ -50,7 +50,7 @@
         searchdirs=os.environ['INCLUDE'].split(';')
     except KeyError:
         try:

 
 	if (PyErr_Occurred()) {
 		Py_DECREF(result);
diff -up Python-2.6.5/Modules/socketmodule.c.orig Python-2.6.5/Modules/socketmodule.c
--- Python-2.6.5/Modules/socketmodule.c.orig	2010-02-04 13:26:34.065011712 -0700
+++ Python-2.6.5/Modules/socketmodule.c	2010-04-26 15:46:55.934805504 -0600
@@ -4647,7 +4647,9 @@ init_socket(void)
 #ifndef __BEOS__
 /* We have incomplete socket support. */
 	PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
