diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index ed909ce9a6c1ef574d7883b706c64e1a3b093517..3b1413c6f02fa47668a8b045ea1c69efc385f6f8 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -59,6 +59,14 @@ IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
   SET(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
 ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
 
+# The g++ that comes with BeOS 5 segfaults if you run "g++ -E"
+#  ("gcc -E" is fine), which throws up a system dialog box that hangs cmake
+#  until the user clicks "OK"...so for now, we just assume it's g++.
+IF(BEOS)
+  SET(CMAKE_COMPILER_IS_GNUCXX 1)
+  SET(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
+ENDIF(BEOS)
+
 IF(NOT CMAKE_COMPILER_IS_GNUCXX_RUN)
   # test to see if the cxx compiler is gnu
   SET(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
diff --git a/Modules/CheckForPthreads.c b/Modules/CheckForPthreads.c
index 2f0c203b55f66198e7f10a360c3f7a844506bf4a..a846567ffc42b76296ecca291e856c73b22ccd67 100644
--- a/Modules/CheckForPthreads.c
+++ b/Modules/CheckForPthreads.c
@@ -16,7 +16,10 @@ int main(int ac, char*av[]){
   pthread_create(&tid[0], 0, runner, (void*)1);
   pthread_create(&tid[1], 0, runner, (void*)2);
   
+#if defined(__BEOS__) && !defined(__ZETA__)  // (no usleep on BeOS 5.)
   usleep(1); // for strange behavior on single-processor sun
+#endif
+
   pthread_join(tid[0], 0);
   pthread_join(tid[1], 0);
   if(ac > 1000){return *av[0];}
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 653fc12ee8baf4b9e7d689bc0a2e77aae59bb4f8..8ca976db99bdfc686a86a91e698cf24da3df71a1 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -48,6 +48,10 @@
 
 #include <memory> // auto_ptr
 
+#if defined(__BEOS__)
+#include <be/kernel/OS.h>   /* disable_debugger() API. */
+#endif
+
 #define DEBUGOUT std::cout << __LINE__ << " "; std::cout
 #define DEBUGERR std::cerr << __LINE__ << " "; std::cerr
 
@@ -589,6 +593,8 @@ void cmCTest::BlockTestErrorDiagnostics()
   cmSystemTools::PutEnv("DASHBOARD_TEST_FROM_CTEST=" CMake_VERSION);
 #if defined(_WIN32)
   SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
+#elif defined(__BEOS__)
+  disable_debugger(1);
 #endif
 }
 
diff --git a/Source/cmDependsJavaLexer.cxx b/Source/cmDependsJavaLexer.cxx
index ac0da737e15ab41c1c74934256dd76a51b72e806..a168a7d278377daf4569dbc169c1220c12c23a11 100644
--- a/Source/cmDependsJavaLexer.cxx
+++ b/Source/cmDependsJavaLexer.cxx
@@ -23,6 +23,10 @@
 #include <errno.h>
 #include <stdlib.h>
 
+#if defined(__BEOS__)
+#include <unistd.h>   /* prevents a conflict with a #define later on... */
+#endif
+
 /* end standard C headers. */
 
 /* flex integer type definitions */
diff --git a/Source/cmDependsJavaLexer.h b/Source/cmDependsJavaLexer.h
index c32a364a9fba0f3e7a498ffea325ac1633a23a58..0379c852b89aba93637cabd46642585f294160db 100644
--- a/Source/cmDependsJavaLexer.h
+++ b/Source/cmDependsJavaLexer.h
@@ -22,6 +22,10 @@
 #include <errno.h>
 #include <stdlib.h>
 
+#if defined(__BEOS__)
+#include <unistd.h>   /* prevents a conflict with a #define later on... */
+#endif
+
 /* end standard C headers. */
 
 /* flex integer type definitions */
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 411dd257be112b1e247e4e740e321591a32ffd71..e4814de8a1c45b21ee1e94fe36ffba73ff5a1090 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1946,6 +1946,9 @@ void cmMakefile::AddDefaultDefinitions()
 #if defined(__QNXNTO__)
   this->AddDefinition("QNXNTO", "1");
 #endif
+#if defined(__BEOS__)
+  this->AddDefinition("BEOS", "1");
+#endif
 
   char temp[1024];
   sprintf(temp, "%d", cmVersion::GetMinorVersion());
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 8746c7aa6eb2f02aa9bec3b44a6fd4469d5fbad0..2a2ee918345c26f801ec7852667bb7ca3388db2f 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1432,7 +1432,12 @@ int cmSystemToolsGZStructOpen(void* call_data, const char *pathname,
     return -1;
     }
 
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#if defined(__BEOS__) && !defined(__ZETA__) // no fchmod on BeOS 5...do pathname instead.
+  if ((oflags & O_CREAT) && chmod(pathname, mode))
+    {
+    return -1;
+    }
+#elif !defined(_WIN32) || defined(__CYGWIN__)
   if ((oflags & O_CREAT) && fchmod(fd, mode))
     {
     return -1;
diff --git a/Source/kwsys/DynamicLoader.cxx b/Source/kwsys/DynamicLoader.cxx
index 0bcbba0f1199cb8a31f5e824ca2b04578407722e..87f957f3a324c1b95c6a84c7acc5ee302d0ca54d 100644
--- a/Source/kwsys/DynamicLoader.cxx
+++ b/Source/kwsys/DynamicLoader.cxx
@@ -319,7 +319,112 @@ const char* DynamicLoader::LastError()
 #endif //_WIN32
 
 // ---------------------------------------------------------------
-// 4. Implementation for default UNIX machines.
+// 4. Implementation for BeOS
+#ifdef __BEOS__
+#include <string.h> // for strerror()
+#include <be/kernel/image.h>
+#include <be/support/Errors.h>
+#define DYNAMICLOADER_DEFINED 1
+
+namespace KWSYS_NAMESPACE
+{
+
+static image_id last_dynamic_err = B_OK;
+
+//----------------------------------------------------------------------------
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const char* libname )
+{
+  // image_id's are integers, errors are negative. Add one just in case we
+  //  get a valid image_id of zero (is that even possible?).
+  image_id rc = load_add_on(libname);
+  if (rc < 0)
+    {
+    last_dynamic_err = rc;
+    return 0;
+    }
+
+  return rc+1;
+}
+
+//----------------------------------------------------------------------------
+int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
+{
+  if (!lib)
+    {
+      last_dynamic_err = B_BAD_VALUE;
+      return 0;
+    }
+  else
+    {
+    // The function dlclose() returns 0 on success, and non-zero on error.
+    status_t rc = unload_add_on(lib-1);
+    if (rc != B_OK)
+      {
+      last_dynamic_err = rc;
+      return 0;
+      }
+    }
+
+  return 1;
+}
+
+//----------------------------------------------------------------------------
+DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
+  DynamicLoader::LibraryHandle lib, const char* sym)
+{
+  // Hack to cast pointer-to-data to pointer-to-function.
+  union 
+  {
+    void* pvoid;
+    DynamicLoader::SymbolPointer psym;
+  } result;
+
+  result.psym = NULL;
+
+  if (!lib)
+    {
+      last_dynamic_err = B_BAD_VALUE;
+    }
+  else
+    {
+    // !!! FIXME: BeOS can do function-only lookups...does this ever
+    // !!! FIXME:  actually _want_ a data symbol lookup, or was this union
+    // !!! FIXME:  a leftover of dlsym()? (s/ANY/TEXT for functions only).
+    status_t rc = get_image_symbol(lib-1,sym,B_SYMBOL_TYPE_ANY,&result.pvoid);
+    if (rc != B_OK)
+      {
+      last_dynamic_err = rc;
+      result.psym = NULL;
+      }
+    }
+  return result.psym;
+}
+
+//----------------------------------------------------------------------------
+const char* DynamicLoader::LibPrefix()
+{
+  return "lib";
+}
+
+//----------------------------------------------------------------------------
+const char* DynamicLoader::LibExtension()
+{
+  return ".so";
+}
+
+//----------------------------------------------------------------------------
+const char* DynamicLoader::LastError()
+{
+  const char *retval = strerror(last_dynamic_err);
+  last_dynamic_err = B_OK;
+  return retval;
+}
+
+} // namespace KWSYS_NAMESPACE
+#endif
+
+// ---------------------------------------------------------------
+// 5. Implementation for default UNIX machines.
 // if nothing has been defined then use this
 #ifndef DYNAMICLOADER_DEFINED
 #define DYNAMICLOADER_DEFINED 1
diff --git a/Source/kwsys/DynamicLoader.hxx.in b/Source/kwsys/DynamicLoader.hxx.in
index ca1aa70186697fa0ab27cae60f8279c4d3f7d585..72dea57c3b30ee9170b8d40e7fe584da00ac46c3 100644
--- a/Source/kwsys/DynamicLoader.hxx.in
+++ b/Source/kwsys/DynamicLoader.hxx.in
@@ -25,6 +25,8 @@
   #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
     #include <mach-o/dyld.h>
   #endif
+#elif defined(__BEOS__)
+  #include <be/kernel/image.h>
 #endif
 
 namespace @KWSYS_NAMESPACE@
@@ -62,6 +64,8 @@ public:
   #else
     typedef void* LibraryHandle;
   #endif
+#elif defined(__BEOS__)
+  typedef image_id LibraryHandle;
 #else
   typedef void* LibraryHandle;
 #endif
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index f491cbf4c761f92d5cc151296afe4e0def1f16b1..33d3e64c62ac4d3c3162ea1ca53d29dd645622fe 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -108,6 +108,34 @@ public:
 #define _chdir chdir
 #endif
 
+#if defined(__BEOS__) && !defined(__ZETA__)
+#include <be/kernel/OS.h>
+#include <be/storage/Path.h>
+
+// BeOS 5 doesn't have usleep(), but it has snooze(), which is identical.
+static inline void usleep(unsigned int msec)
+{
+  ::snooze(msec);
+}
+
+// BeOS 5 also doesn't have realpath(), but its C++ API offers something close.
+static inline char *realpath(const char *path, char *resolved_path)
+{
+  const size_t maxlen = KWSYS_SYSTEMTOOLS_MAXPATH;
+  snprintf(resolved_path, maxlen, "%s", path);
+  BPath normalized(resolved_path, NULL, true);
+  const char *resolved = normalized.Path();
+  if (resolved != NULL)   // NULL == No such file. 
+    {
+    if (snprintf(resolved_path, maxlen, "%s", resolved) < maxlen) 
+      {
+      return resolved_path;
+      }
+    }
+  return NULL;   // something went wrong.
+}
+#endif
+
 #if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__)) 
 inline int Mkdir(const char* dir)
 {
@@ -291,7 +319,9 @@ void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char
     kwsys_stl::string::size_type endpos = pathEnv.find(pathSep, start);
     if(endpos != kwsys_stl::string::npos)
       {
-      path.push_back(pathEnv.substr(start, endpos-start));
+      kwsys_stl::string convertedPath;
+      Realpath(pathEnv.substr(start, endpos-start).c_str(), convertedPath);
+      path.push_back(convertedPath);
       start = endpos+1;
       }
     else
diff --git a/Source/kwsys/testDynamicLoader.cxx b/Source/kwsys/testDynamicLoader.cxx
index bd4fc223b9974d96c93416fc9d6123f257828deb..b13dec642d1aa20f9c55ea47819a98e51137cae3 100644
--- a/Source/kwsys/testDynamicLoader.cxx
+++ b/Source/kwsys/testDynamicLoader.cxx
@@ -17,6 +17,10 @@
 #include KWSYS_HEADER(ios/iostream)
 #include KWSYS_HEADER(stl/string)
 
+#if defined(__BEOS__)
+#include <be/kernel/OS.h>  /* disable_debugger() API. */
+#endif
+
 // Work-around CMake dependency scanning limitation.  This must
 // duplicate the above list of headers.
 #if 0
@@ -88,6 +92,8 @@ int main(int argc, char *argv[])
 {
 #if defined(_WIN32)
   SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
+#elif defined(__BEOS__)
+  disable_debugger(1);
 #endif
   int res;
   if( argc == 3 )
diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index b0ea7a3a15ea7ce0dd5584772187c2dab1fec8ff..a06745b354db82ab7b8b08c0200e38d0a1bb2958 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -46,7 +46,9 @@ ADD_LIBRARY(CMakeTestModule MODULE moduleFile.c)
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
 ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
 SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR)
-SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
+IF(NOT BEOS)  # No libm on BeOS.
+  SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
+ENDIF(NOT BEOS)
 GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
 IF(${FOO_BAR_VAR} MATCHES "BAR")
 ELSE(${FOO_BAR_VAR} MATCHES "BAR")
diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt
index b0ea7a3a15ea7ce0dd5584772187c2dab1fec8ff..a06745b354db82ab7b8b08c0200e38d0a1bb2958 100644
--- a/Tests/ComplexOneConfig/Library/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt
@@ -46,7 +46,9 @@ ADD_LIBRARY(CMakeTestModule MODULE moduleFile.c)
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
 ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
 SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR)
-SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
+IF(NOT BEOS)  # No libm on BeOS.
+  SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
+ENDIF(NOT BEOS)
 GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
 IF(${FOO_BAR_VAR} MATCHES "BAR")
 ELSE(${FOO_BAR_VAR} MATCHES "BAR")
diff --git a/Tests/ComplexRelativePaths/Library/CMakeLists.txt b/Tests/ComplexRelativePaths/Library/CMakeLists.txt
index b0ea7a3a15ea7ce0dd5584772187c2dab1fec8ff..a06745b354db82ab7b8b08c0200e38d0a1bb2958 100644
--- a/Tests/ComplexRelativePaths/Library/CMakeLists.txt
+++ b/Tests/ComplexRelativePaths/Library/CMakeLists.txt
@@ -46,7 +46,9 @@ ADD_LIBRARY(CMakeTestModule MODULE moduleFile.c)
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
 ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
 SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR)
-SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
+IF(NOT BEOS)  # No libm on BeOS.
+  SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
+ENDIF(NOT BEOS)
 GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
 IF(${FOO_BAR_VAR} MATCHES "BAR")
 ELSE(${FOO_BAR_VAR} MATCHES "BAR")
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 52717ccabab70aaf3a1e632a5ccd2603feb7bc37..3fcf926aab4e865b20d83a75a610f5bbc97ce830 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -135,6 +135,13 @@ CHECK_LIBRARY_EXISTS_CONCAT("ucb"    gethostname  HAVE_LIBUCB)
 CHECK_LIBRARY_EXISTS_CONCAT("socket" connect      HAVE_LIBSOCKET)
 CHECK_LIBRARY_EXISTS("c" gethostbyname "" NOT_NEED_LIBNSL)
 
+# Yellowtab Zeta needs different libraries than BeOS 5.
+IF(BEOS)
+  SET(NOT_NEED_LIBNSL 1)
+  CHECK_LIBRARY_EXISTS_CONCAT("bind" gethostbyname HAVE_LIBBIND)
+  CHECK_LIBRARY_EXISTS_CONCAT("bnetapi" closesocket HAVE_LIBBNETAPI)
+ENDIF(BEOS)
+
 IF(NOT NOT_NEED_LIBNSL)
   CHECK_LIBRARY_EXISTS_CONCAT("nsl"    gethostbyname  HAVE_LIBNSL)
 ENDIF(NOT NOT_NEED_LIBNSL)
diff --git a/Utilities/cmtar/encode.c b/Utilities/cmtar/encode.c
index 3c8cb6a5553389a24b52029582f9ec38b39a3984..1c7595442dfaba7e390b234abc11722effe7b2ee 100644
--- a/Utilities/cmtar/encode.c
+++ b/Utilities/cmtar/encode.c
@@ -197,11 +197,13 @@ void
 th_set_mode(TAR *t, mode_t fmode)
 {
 #ifndef WIN32
+#ifndef __BEOS__
   if (S_ISSOCK(fmode))
   {
     fmode &= ~S_IFSOCK;
     fmode |= S_IFIFO;
   }
+#endif
 #endif
   /* Looks like on windows the st_mode is longer than 8 characters. */
   int_to_oct(fmode & 07777777, (t)->th_buf.mode, 8);
diff --git a/Utilities/cmtar/extract.c b/Utilities/cmtar/extract.c
index cb1fab3c9c9917d7e9782eaa2b43166a9432e185..925f621588d0313318a7c967f71b95f24c85d3b5 100644
--- a/Utilities/cmtar/extract.c
+++ b/Utilities/cmtar/extract.c
@@ -116,7 +116,7 @@ tar_set_file_perms(TAR *t, char *realname)
     return -1;
   }
   /* change permissions */
-  if (!TH_ISSYM(t) && chmod(filename, mode) == -1)
+  if (!TH_ISSYM(t) && chmod(filename, mode & 07777) == -1)
   {
 #ifdef DEBUG
     perror("chmod()");
@@ -718,6 +718,7 @@ tar_extract_dir(TAR *t, char *realname)
   char *filename;
   char buf[T_BLOCKSIZE];
   char *pathname = 0;
+  size_t len = 0;
 
   if (!TH_ISDIR(t))
   {
@@ -750,14 +751,23 @@ tar_extract_dir(TAR *t, char *realname)
     return -1;
     }
 
+    /* Strip trailing '/'...it confuses some Unixes (and BeOS)... */
+    strncpy(buf, filename, sizeof(buf)-1);
+    buf[sizeof(buf)-1] = 0;
+    len = strlen(buf);
+    if ((len > 0) && (buf[len-1] == '/'))
+      {
+      buf[len-1] = '\0';
+      }
+
 #ifdef DEBUG
   printf("  ==> extracting: %s (mode %04o, directory)\n", filename,
          mode);
 #endif
 #ifdef WIN32
-  if (mkdir(filename) == -1)
+  if (mkdir(buf) == -1)
 #else
-  if (mkdir(filename, mode) == -1)
+  if (mkdir(buf, mode & 07777) == -1)
 #endif
   {
 #ifdef __BORLANDC__
@@ -772,7 +782,7 @@ tar_extract_dir(TAR *t, char *realname)
 #endif      
     if (errno == EEXIST)
     {
-      if (chmod(filename, mode) == -1)
+      if (chmod(filename, mode & 07777) == -1)
       {
 #ifdef DEBUG
         perror("chmod()");
@@ -860,7 +870,7 @@ tar_extract_fifo(TAR *t, char *realname)
   printf("  ==> extracting: %s (fifo)\n", filename);
 #endif
 #ifndef WIN32
-  if (mkfifo(filename, mode) == -1)
+  if (mkfifo(filename, mode & 07777) == -1)
 #else
     (void)mode;
 #endif
diff --git a/Utilities/cmtar/libtar.c b/Utilities/cmtar/libtar.c
index 362c105b2c6a9bc9c44dad988a1829fcff979aba..b19d043fcf1c17b1ad0143ced9d6869291800ce8 100644
--- a/Utilities/cmtar/libtar.c
+++ b/Utilities/cmtar/libtar.c
@@ -99,8 +99,13 @@ static int libtar_gzopen(void* call_data, const char *pathname,
     return -1;
     }
 
-#if !defined(_WIN32) || defined(__CYGWIN__)
-  if ((oflags & O_CREAT) && fchmod(fd, mode))
+#if defined(__BEOS__) && !defined(__ZETA__)  // no fchmod on BeOS...do pathname instead.
+  if ((oflags & O_CREAT) && chmod(pathname, mode & 07777))
+    {
+    return -1;
+    }
+#elif !defined(_WIN32) || defined(__CYGWIN__)
+  if ((oflags & O_CREAT) && fchmod(fd, mode & 07777))
     {
     return -1;
     }
diff --git a/Utilities/cmtar/util.c b/Utilities/cmtar/util.c
index 94cf544643202ef59bfa86bf5a025dbd55351757..550fb93df66fec49d9ea9a689271555516fa1fb3 100644
--- a/Utilities/cmtar/util.c
+++ b/Utilities/cmtar/util.c
@@ -100,6 +100,13 @@ mkdirhier(char *path)
     if (*dirp == '\0')
       continue;
 
+    /*
+     * Don't try to build current or parent dir. It doesn't make sense anyhow,
+     *  but it also returns EINVAL instead of EEXIST on BeOS!
+     */
+    if ((strcmp(dirp, ".") == 0) || (strcmp(dirp, "..") == 0))
+        continue;
+
     if (dst[0] != '\0')
       strcat(dst, "/");
     strcat(dst, dirp);
diff --git a/Utilities/cmxmlrpc/xmlrpc_curl_transport.c b/Utilities/cmxmlrpc/xmlrpc_curl_transport.c
index 15477cefbc302cdc4ef2e1c74ed2126b0c7a0b85..ad90874a8cbeae7f60779b55c761a45801c804b3 100644
--- a/Utilities/cmxmlrpc/xmlrpc_curl_transport.c
+++ b/Utilities/cmxmlrpc/xmlrpc_curl_transport.c
@@ -10,6 +10,11 @@
 
 #include "xmlrpc_config.h"
 
+#if defined(__BEOS__)
+/* Some helpful system header has char==bool, then bool.h does int==bool. */
+#define HAVE_BOOL 1
+#endif
+
 #include "bool.h"
 #include "mallocvar.h"
 #include "linklist.h"
diff --git a/bootstrap b/bootstrap
index ea601ddf5b7bdb40f1f0129b4dcf904a082b6253..c4df8a9b6b052905958cb48ce4d8097250567348 100755
--- a/bootstrap
+++ b/bootstrap
@@ -52,6 +52,13 @@ else
   cmake_system_darwin=false
 fi
 
+# Determine whether this is BeOS 
+if echo "${cmake_system}" | grep BeOS >/dev/null 2>&1; then
+  cmake_system_beos=true
+else
+  cmake_system_beos=false
+fi
+
 # Choose the generator to use for bootstrapping.
 if ${cmake_system_mingw}; then
   # Bootstrapping from an MSYS prompt.
@@ -549,6 +556,13 @@ else
   cmake_ld_flags=${LDFLAGS}
 fi
 
+# Add BeOS toolkits...
+if ${cmake_system_beos}; then
+  cmake_ld_flags="${LDFLAGS} -lroot -lbe"
+else
+  cmake_ld_flags=${LDFLAGS}
+fi
+
 # Test C compiler
 cmake_c_compiler=