  #      define ZEXPORT   __declspec(dllexport)
 diff -urN 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-09-10 15:34:40.000000000 +0000
++++ cmake-2.6.1-haiku/Utilities/cmzlib/zutil.h	2008-09-12 15:07:34.000000000 +0000
 @@ -147,7 +147,13 @@
  #  define OS_CODE  0x0f
  #endif

     return -1;
diff -urN cmake-2.6.1/Source/kwsys/DynamicLoader.cxx cmake-2.6.1-haiku/Source/kwsys/DynamicLoader.cxx
--- cmake-2.6.1/Source/kwsys/DynamicLoader.cxx	2008-08-01 15:34:54.000000000 +0000
+++ cmake-2.6.1-haiku/Source/kwsys/DynamicLoader.cxx	2008-09-10 15:34:37.000000000 +0000
@@ -335,11 +335,21 @@
 #endif //_WIN32
 

 
diff -urN cmake-2.6.1/Source/cmSystemTools.cxx cmake-2.6.1-haiku/Source/cmSystemTools.cxx
--- cmake-2.6.1/Source/cmSystemTools.cxx	2008-08-01 15:34:53.000000000 +0000
+++ cmake-2.6.1-haiku/Source/cmSystemTools.cxx	2008-09-12 15:10:22.000000000 +0000
@@ -910,7 +910,7 @@
   fflush(stdout);
   fflush(stderr);
 
-#ifdef __BEOS__
+#if defined __BEOS__ && !defined __HAIKU__
   beos_seen_signal = false;
   signal(SIGCHLD, beos_popen_workaround);
 #endif
@@ -918,7 +918,7 @@
   FILE* cpipe = popen(command, "r");
   if(!cpipe)
     {
-#ifdef __BEOS__
+#if defined __BEOS__ && !defined __HAIKU__
     signal(SIGCHLD, SIG_DFL);
 #endif
     return false;
@@ -931,12 +931,13 @@
       cmSystemTools::Stdout(buffer);
       }
     output += buffer;
+    buffer[0] = 0;
     fgets(buffer, BUFFER_SIZE, cpipe);
     }
 
   retVal = pclose(cpipe);
 
-#ifdef __BEOS__
+#if defined __BEOS__ && !defined __HAIKU__
   for (int i = 0; (!beos_seen_signal) && (i < 3); i++)
     {
     ::sleep(1);   // signals should interrupt this...
@@ -970,11 +971,13 @@
         error << "SIGFPE";
         break;
 #endif
