From ed96d9a605471694465dd7142dd25748dfdf3a90 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 7 Jan 2013 21:09:18 +0100 Subject: [PATCH 1/6] bootstrap: use better defaults for Haiku These values are patched into that file by Haiku since 2.8.1. --- bootstrap | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 643720c86..9a4f796fe 100755 --- a/bootstrap +++ b/bootstrap @@ -159,7 +159,9 @@ if ${cmake_system_mingw}; then cmake_default_prefix="c:/Program Files/CMake" fi elif ${cmake_system_haiku}; then - cmake_default_prefix=`/bin/finddir B_COMMON_DIRECTORY` + cmake_default_prefix=`finddir B_COMMON_DIRECTORY` + cmake_man_dir="/documentation/man" + cmake_doc_dir="/documentation/doc/cmake-${cmake_version}" else cmake_default_prefix="/usr/local" fi From 7a1b961de8b79416d168355e71f5af80fa4dbd02 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 7 Jan 2013 21:20:11 +0100 Subject: [PATCH 2/6] Haiku no longer defines __BEOS__ --- Modules/CheckForPthreads.c | 2 +- Source/CPack/cmCPackGeneratorFactory.cxx | 4 ++-- Source/cmCTest.cxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/CheckForPthreads.c b/Modules/CheckForPthreads.c index 882dc21b7..7250fbff6 100644 --- a/Modules/CheckForPthreads.c +++ b/Modules/CheckForPthreads.c @@ -16,7 +16,7 @@ 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__) && !defined(__HAIKU__) // (no usleep on BeOS 5.) +#if defined(__BEOS__) && !defined(__ZETA__) // (no usleep on BeOS 5.) usleep(1); // for strange behavior on single-processor sun #endif diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index 557767391..b36c2a2f8 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -33,7 +33,7 @@ #endif #if !defined(_WIN32) \ - && !defined(__QNXNTO__) && !defined(__BEOS__) + && !defined(__QNXNTO__) && !defined(__BEOS__) && !defined(__HAIKU__) # include "cmCPackDebGenerator.h" # include "cmCPackRPMGenerator.h" #endif @@ -126,7 +126,7 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory() } #endif #if !defined(_WIN32) \ - && !defined(__QNXNTO__) && !defined(__BEOS__) + && !defined(__QNXNTO__) && !defined(__BEOS__) && !defined(__HAIKU__) if (cmCPackDebGenerator::CanGenerate()) { this->RegisterGenerator("DEB", "Debian packages", diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index bb6f3f29d..322a6a26f 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -53,7 +53,7 @@ #include #include -#if defined(__BEOS__) && !defined(__HAIKU__) +#if defined(__BEOS__) #include /* disable_debugger() API. */ #endif From 3d2e6a06874603ebe6152045c34de9147a0c11dc Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 7 Jan 2013 21:52:45 +0100 Subject: [PATCH 3/6] check for Haiku only with __HAIKU__ --- Modules/CMakeFortranCompilerId.F.in | 6 +----- Modules/CMakePlatformId.h.in | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in index 4d25de0ba..f84852aeb 100644 --- a/Modules/CMakeFortranCompilerId.F.in +++ b/Modules/CMakeFortranCompilerId.F.in @@ -74,12 +74,8 @@ PRINT *, 'INFO:platform[IRIX]' #elif defined(__hpux) || defined(__hpux__) PRINT *, 'INFO:platform[HP-UX]' -#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU) +#elif defined(__HAIKU__) PRINT *, 'INFO:platform[Haiku]' -# if 0 -! Haiku also defines __BEOS__ so we must -! put it prior to the check for __BEOS__ -# endif #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) PRINT *, 'INFO:platform[BeOS]' #elif defined(__QNX__) || defined(__QNXNTO__) diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in index c37341411..69171c2a3 100644 --- a/Modules/CMakePlatformId.h.in +++ b/Modules/CMakePlatformId.h.in @@ -35,11 +35,8 @@ #elif defined(__hpux) || defined(__hpux__) # define PLATFORM_ID "HP-UX" -#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU) +#elif defined(__HAIKU__) # define PLATFORM_ID "Haiku" -/* Haiku also defines __BEOS__ so we must - put it prior to the check for __BEOS__ -*/ #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) # define PLATFORM_ID "BeOS" From 50bfedf391a078e628bf1259f819da42dea1cde0 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 7 Jan 2013 23:26:18 +0100 Subject: [PATCH 4/6] FindLua51: do not try to link libm on BeOS This includes Haiku, which currently is treated as BeOS. The ComplexOneConfig test already knew about this. --- Modules/FindLua51.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake index 2d7ed3d6c..a2bf0c0ef 100644 --- a/Modules/FindLua51.cmake +++ b/Modules/FindLua51.cmake @@ -54,7 +54,7 @@ find_library(LUA_LIBRARY if(LUA_LIBRARY) # include the math library for Unix - if(UNIX AND NOT APPLE) + if(UNIX AND NOT APPLE AND NOT BEOS) find_library(LUA_MATH_LIBRARY m) set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries") # For Windows and Mac, don't need to explicitly include the math library From 8e9630c719f59f69f813e3eb4a4f91ba2396b4ef Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 7 Jan 2013 23:57:07 +0100 Subject: [PATCH 5/6] FindGLUT: BeOS does not have libXi and libXmu --- Modules/FindGLUT.cmake | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake index 55790ae7c..843d1389f 100644 --- a/Modules/FindGLUT.cmake +++ b/Modules/FindGLUT.cmake @@ -40,25 +40,39 @@ else () set(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX") else () + if (BEOS) + + set(_GLUT_INC_DIR /boot/develop/headers/os/opengl) + set(_GLUT_glut_LIB_DIR /boot/develop/lib/x86) + + else() + + find_library( GLUT_Xi_LIBRARY Xi + /usr/openwin/lib + ) + + find_library( GLUT_Xmu_LIBRARY Xmu + /usr/openwin/lib + ) + + endif () + find_path( GLUT_INCLUDE_DIR GL/glut.h /usr/include/GL /usr/openwin/share/include /usr/openwin/include /opt/graphics/OpenGL/include /opt/graphics/OpenGL/contrib/libglut + ${_GLUT_INC_DIR} ) find_library( GLUT_glut_LIBRARY glut /usr/openwin/lib + ${_GLUT_glut_LIB_DIR} ) - find_library( GLUT_Xi_LIBRARY Xi - /usr/openwin/lib - ) - - find_library( GLUT_Xmu_LIBRARY Xmu - /usr/openwin/lib - ) + unset(_GLUT_INC_DIR) + unset(_GLUT_glut_LIB_DIR) endif () From 0380f36cd8dbdf7a89f8fac91d99235e75075bde Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 8 Jan 2013 00:38:08 +0100 Subject: [PATCH 6/6] FindOpenGL: add Haiku paths Also check the HP-UX specific paths only when on HP-UX. --- Modules/FindOpenGL.cmake | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index 4a393f225..96c4d8db5 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -58,14 +58,22 @@ else () find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX") else() - # Handle HP-UX cases where we only want to find OpenGL in either hpux64 - # or hpux32 depending on if we're doing a 64 bit build. - if(CMAKE_SIZEOF_VOID_P EQUAL 4) - set(HPUX_IA_OPENGL_LIB_PATH /opt/graphics/OpenGL/lib/hpux32/) - else() - set(HPUX_IA_OPENGL_LIB_PATH - /opt/graphics/OpenGL/lib/hpux64/ - /opt/graphics/OpenGL/lib/pa20_64) + if (CMAKE_SYSTEM_NAME MATCHES "HP-UX") + # Handle HP-UX cases where we only want to find OpenGL in either hpux64 + # or hpux32 depending on if we're doing a 64 bit build. + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(_OPENGL_LIB_PATH + /opt/graphics/OpenGL/lib/hpux32/) + else() + set(_OPENGL_LIB_PATH + /opt/graphics/OpenGL/lib/hpux64/ + /opt/graphics/OpenGL/lib/pa20_64) + endif() + elseif(CMAKE_SYSTEM_NAME STREQUAL Haiku) + set(_OPENGL_LIB_PATH + /boot/develop/lib/x86) + set(_OPENGL_INCLUDE_PATH + /boot/develop/headers/os/opengl) endif() # The first line below is to make sure that the proper headers @@ -80,6 +88,7 @@ else () /usr/share/doc/NVIDIA_GLX-1.0/include /usr/openwin/share/include /opt/graphics/OpenGL/include /usr/X11R6/include + ${_OPENGL_INCLUDE_PATH} ) find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h @@ -93,9 +102,12 @@ else () PATHS /opt/graphics/OpenGL/lib /usr/openwin/lib /usr/shlib /usr/X11R6/lib - ${HPUX_IA_OPENGL_LIB_PATH} + ${_OPENGL_LIB_PATH} ) + unset(_OPENGL_INCLUDE_PATH) + unset(_OPENGL_LIB_PATH) + # On Unix OpenGL most certainly always requires X11. # Feel free to tighten up these conditions if you don't # think this is always true.