  #  define fdopen(fd,mode) NULL /* No fdopen() */
  #endif
  
-diff -ur cmake-2.6.1/bootstrap cmake-2.6.1-haiku/bootstrap
+diff -urN cmake-2.6.1/bootstrap cmake-2.6.1-haiku/bootstrap
 --- cmake-2.6.1/bootstrap	2008-08-01 15:34:50.000000000 +0000
-+++ cmake-2.6.1-haiku/bootstrap	2008-08-13 16:07:42.000000000 +0000
++++ cmake-2.6.1-haiku/bootstrap	2008-08-20 13:49:07.000000000 +0000
 @@ -73,6 +73,13 @@
    cmake_system_beos=false
  fi

 #  ifdef ZLIB_DLL
 #    ifdef ZLIB_INTERNAL
 #      define ZEXPORT   __declspec(dllexport)
diff -ur cmake-2.6.1/Utilities/cmzlib/zutil.h cmake-2.6.1-haiku/Utilities/cmzlib/zutil.h
--- cmake-2.6.1/Utilities/cmzlib/zutil.h	2008-08-01 15:34:59.000000000 +0000
+++ cmake-2.6.1-haiku/Utilities/cmzlib/zutil.h	2008-08-13 16:07:42.000000000 +0000
@@ -147,7 +147,13 @@
 #  define OS_CODE  0x0f
 #endif

   usleep(1); // for strange behavior on single-processor sun
 #endif
 
diff -urN cmake-2.6.1/Modules/Platform/Haiku.cmake cmake-2.6.1-haiku/Modules/Platform/Haiku.cmake
--- cmake-2.6.1/Modules/Platform/Haiku.cmake	1970-01-01 00:00:00.000000000 +0000
+++ cmake-2.6.1-haiku/Modules/Platform/Haiku.cmake	2008-08-20 13:49:06.000000000 +0000
@@ -0,0 +1,14 @@
+SET(BEOS 1)
+
+# GCC is the default compiler on Haiku.
+INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
+
+SET(CMAKE_DL_LIBS root be)
+SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
+SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart")
+SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-soname,")
+
+INCLUDE(Platform/UnixPaths)
diff -urN cmake-2.6.1/Source/CPack/cmCPackGeneratorFactory.cxx cmake-2.6.1-haiku/Source/CPack/cmCPackGeneratorFactory.cxx
--- cmake-2.6.1/Source/CPack/cmCPackGeneratorFactory.cxx	2008-08-01 15:34:53.000000000 +0000
+++ cmake-2.6.1-haiku/Source/CPack/cmCPackGeneratorFactory.cxx	2008-08-20 13:49:06.000000000 +0000
@@ -36,7 +36,7 @@
 #endif
 
