summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-09-15 21:53:28 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-09-15 21:53:28 (GMT)
commit64fc597de292228b244a3ab18a33bcd8488e09d6 (patch)
tree17910ce2705e14c5428fdc4b1365b5c025867c58 /Source
parentf49f1d2973039b6e706326d763950c2ecd1d3153 (diff)
downloadCMake-64fc597de292228b244a3ab18a33bcd8488e09d6.zip
CMake-64fc597de292228b244a3ab18a33bcd8488e09d6.tar.gz
CMake-64fc597de292228b244a3ab18a33bcd8488e09d6.tar.bz2
ENH: add initial support for HAIKU OS from bug# 7425
Diffstat (limited to 'Source')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx10
-rw-r--r--Source/cmCTest.cxx9
-rw-r--r--Source/cmDependsJavaLexer.cxx2
-rw-r--r--Source/cmDependsJavaLexer.h2
-rw-r--r--Source/cmSystemTools.cxx5
-rw-r--r--Source/kwsys/DynamicLoader.cxx14
-rw-r--r--Source/kwsys/ProcessUNIX.c2
-rw-r--r--Source/kwsys/SystemTools.cxx7
-rw-r--r--Source/kwsys/testDynamicLoader.cxx6
-rw-r--r--Source/kwsys/testProcess.c2
10 files changed, 48 insertions, 11 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 90a33cb..83d882b 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1052,7 +1052,17 @@ bool cmCTestTestHandler::GetValue(const char* tag,
bool ret = true;
if(line == tag)
{
+#ifdef __HAIKU__
+ int tmp = 0;
+ fin >> tmp;
+ value = false;
+ if(tmp)
+ {
+ value = true;
+ }
+#else
fin >> value;
+#endif
ret = cmSystemTools::GetLineFromStream(fin, line); // read blank line
}
else
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 77bf102..012571f 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -49,10 +49,15 @@
#include <memory> // auto_ptr
-#if defined(__BEOS__)
+#if defined(__BEOS__) && !defined(__HAIKU__)
#include <be/kernel/OS.h> /* disable_debugger() API. */
#endif
+#if defined(__HAIKU__)
+#include <os/kernel/OS.h> /* disable_debugger() API. */
+#endif
+
+
#define DEBUGOUT std::cout << __LINE__ << " "; std::cout
#define DEBUGERR std::cerr << __LINE__ << " "; std::cerr
@@ -610,7 +615,7 @@ void cmCTest::BlockTestErrorDiagnostics()
cmSystemTools::PutEnv("DASHBOARD_TEST_FROM_CTEST=" CMake_VERSION);
#if defined(_WIN32)
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
disable_debugger(1);
#endif
}
diff --git a/Source/cmDependsJavaLexer.cxx b/Source/cmDependsJavaLexer.cxx
index 3af688a..1a5907f 100644
--- a/Source/cmDependsJavaLexer.cxx
+++ b/Source/cmDependsJavaLexer.cxx
@@ -23,7 +23,7 @@
#include <errno.h>
#include <stdlib.h>
-#if defined(__BEOS__)
+#if defined(__BEOS__) || defined (__HAIKU__)
#include <unistd.h> /* prevents a conflict with a #define later on... */
#endif
diff --git a/Source/cmDependsJavaLexer.h b/Source/cmDependsJavaLexer.h
index 78ee089..df7cffd 100644
--- a/Source/cmDependsJavaLexer.h
+++ b/Source/cmDependsJavaLexer.h
@@ -38,7 +38,7 @@
#include <errno.h>
#include <stdlib.h>
-#if defined(__BEOS__)
+#if defined(__BEOS__) || defined(__HAIKU__)
#include <unistd.h> /* prevents a conflict with a #define later on... */
#endif
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 1d2a0cf..298d779 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -932,6 +932,7 @@ bool RunCommandViaPopen(const char* command,
cmSystemTools::Stdout(buffer);
}
output += buffer;
+ buffer[0] = 0;
fgets(buffer, BUFFER_SIZE, cpipe);
}
@@ -971,11 +972,13 @@ bool RunCommandViaPopen(const char* command,
error << "SIGFPE";
break;
#endif
+#ifndef __HAIKU__
#ifdef SIGBUS
case SIGBUS:
error << "SIGBUS";
break;
#endif
+#endif
#ifdef SIGSEGV
case SIGSEGV:
error << "SIGSEGV";
@@ -1698,7 +1701,7 @@ int cmSystemToolsGZStructOpen(void* call_data, const char *pathname,
}
// no fchmod on BeOS 5...do pathname instead.
-#if defined(__BEOS__) && !defined(__ZETA__)
+#if defined(__BEOS__) && !defined(__ZETA__) && !defined(__HAIKU__)
if ((oflags & O_CREAT) && chmod(pathname, mode))
{
return -1;
diff --git a/Source/kwsys/DynamicLoader.cxx b/Source/kwsys/DynamicLoader.cxx
index 1fdcaf0..9ca9146 100644
--- a/Source/kwsys/DynamicLoader.cxx
+++ b/Source/kwsys/DynamicLoader.cxx
@@ -335,11 +335,21 @@ const char* DynamicLoader::LastError()
#endif //_WIN32
// ---------------------------------------------------------------
-// 4. Implementation for BeOS
-#ifdef __BEOS__
+// 4. Implementation for BeOS / Haiku
+#if defined __BEOS__ || defined(__HAIKU__)
+
#include <string.h> // for strerror()
+
+#ifdef __BEOS__
#include <be/kernel/image.h>
#include <be/support/Errors.h>
+#endif
+
+#ifdef __HAIKU__
+#include <os/kernel/image.h>
+#include <os/support/Errors.h>
+#endif
+
#define DYNAMICLOADER_DEFINED 1
namespace KWSYS_NAMESPACE
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index 515bceb..32b4d9e 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -75,7 +75,7 @@ typedef ssize_t kwsysProcess_ssize_t;
typedef int kwsysProcess_ssize_t;
#endif
-#if defined(__BEOS__) && !defined(__ZETA__)
+#if defined(__BEOS__) && !defined(__ZETA__)
/* BeOS 5 doesn't have usleep(), but it has snooze(), which is identical. */
# include <be/kernel/OS.h>
static inline void kwsysProcess_usleep(unsigned int msec)
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 1277d71..d4a8174 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -131,7 +131,12 @@ public:
#define _chdir chdir
#endif
-#if defined(__BEOS__) && !defined(__ZETA__)
+#if defined(__HAIKU__)
+#include <os/kernel/OS.h>
+#include <os/storage/Path.h>
+#endif
+
+#if defined(__BEOS__) && !defined(__ZETA__) && !defined(__HAIKU__)
#include <be/kernel/OS.h>
#include <be/storage/Path.h>
diff --git a/Source/kwsys/testDynamicLoader.cxx b/Source/kwsys/testDynamicLoader.cxx
index 9021239..e2ab12a 100644
--- a/Source/kwsys/testDynamicLoader.cxx
+++ b/Source/kwsys/testDynamicLoader.cxx
@@ -17,10 +17,14 @@
#include KWSYS_HEADER(ios/iostream)
#include KWSYS_HEADER(stl/string)
-#if defined(__BEOS__)
+#if defined(__BEOS__) && !defined(__HAIKU__)
#include <be/kernel/OS.h> /* disable_debugger() API. */
#endif
+#if defined(__HAIKU__)
+#include <os/kernel/OS.h> /* disable_debugger() API. */
+#endif
+
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
diff --git a/Source/kwsys/testProcess.c b/Source/kwsys/testProcess.c
index 8ca56ed..9002035 100644
--- a/Source/kwsys/testProcess.c
+++ b/Source/kwsys/testProcess.c
@@ -34,7 +34,7 @@
# pragma warn -8060 /* possibly incorrect assignment */
#endif
-#if defined(__BEOS__) && !defined(__ZETA__)
+#if defined(__BEOS__) && !defined(__ZETA__) && !defined(__HAIKU__)
/* BeOS 5 doesn't have usleep(), but it has snooze(), which is identical. */
# include <be/kernel/OS.h>
static inline void testProcess_usleep(unsigned int msec)