Merge work on CMake 2.8.5 to 2.8.11

* The testsuite does not deadlock anymore
 * However, we only get 49% passing tests. Still some workto do there.
This commit is contained in:
Adrien Destugues
2013-10-03 09:31:22 +02:00
parent 6419a8dc1d
commit 2a68df0986
2 changed files with 279 additions and 4 deletions

View File

@@ -11,23 +11,24 @@ COPYRIGHT="2002-2013 Kitware, Inc., Insight Consortium, All rights reserved."
SRC_URI="http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz"
CHECKSUM_MD5="6f5d7b8e7534a5d9e1a7664ba63cf882"
REVISION="1"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64"
PROVIDES="
cmake = $portVersion compat >= 2.8
cmd:cmake = $portVersion compat >= 2.8
cmd:ccmake = $portVersion compat >= 2.8
cmd:cpack = $portVersion compat >= 2.8
cmd:ctest = $portVersion compat >= 2.8
"
REQUIRES="
haiku >= $haikuVersion
lib:libncurses
"
BUILD_REQUIRES="
lib:libncurses
devel:libncurses
"
BUILD_PREREQUIRES="
haiku_devel >= $haikuVersion
ncurses_devel
cmd:gcc
cmd:grep
cmd:ld
@@ -49,10 +50,14 @@ BUILD()
INSTALL()
{
make install
# No way to tell this to configure...
mv $prefix/share/aclocal $dataDir
rmdir $prefix/share
}
TEST()
{
make test
make test VERBOSE=1
}

View File

@@ -313,3 +313,273 @@ index 3236b58..dfb3526 100644
--
1.8.3.4
From be0844f3d3b16856732f3336053896df077d3317 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 3 Oct 2013 08:40:31 +0200
Subject: Merge changes from our CMake 2.8.5 patchset
* This one had already been modified for better PM support.
* Also includes some cleanups, which we should upstream
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index a2bf0c0..770e93a 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 AND NOT BEOS)
+ if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
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
diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index dfb3526..2f8125d 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -1,3 +1,8 @@
+# process only once
+if(HAIKU)
+ return()
+endif()
+
set(HAIKU 1)
set(UNIX 1)
@@ -10,34 +15,110 @@ set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
-# FIXME need to detect if we are on gcc4 or gcc4hybrid, the path are different
-if(CMAKE_C_COMPILER_VERSION VERSION_LESS 3.0.0)
- # Use gcc2 libs
- set(__HAIKU_LIBDIR_SUFFIX "")
-else()
- # Use gcc4 libs
- set(__HAIKU_LIBDIR_SUFFIX "/x86")
+# Determine, if the C or C++ compiler is configured for a secondary
+# architecture. If so, that will change the search paths we set below. We check
+# whether the compiler's library search paths contain a
+# "/boot/system/develop/lib/<subdir>/", which we assume to be the secondary
+# architecture specific subdirectory and extract the name of the architecture
+# accordingly.
+set(__HAIKU_COMPILER ${CMAKE_C_COMPILER})
+
+if("${__HAIKU_COMPILER}" STREQUAL "")
+ set(__HAIKU_COMPILER ${CMAKE_CXX_COMPILER})
endif()
+execute_process(
+ COMMAND ${__HAIKU_COMPILER} -print-search-dirs
+ COMMAND sed -ne "/^libraries:/!d; s,libraries: =*\\(.*\\):,\\1,; s,:,\\n,gp"
+ COMMAND sed -ne "/\\/boot\\/system\\/develop\\/lib\\/[^\\/]*\\/$/!d; s,.*/\\([^/]*\\)/$,\\1,; p"
+ OUTPUT_VARIABLE CMAKE_HAIKU_SECONDARY_ARCH)
+string(STRIP "${CMAKE_HAIKU_SECONDARY_ARCH}"
+ CMAKE_HAIKU_SECONDARY_ARCH)
+
+if("${CMAKE_HAIKU_SECONDARY_ARCH}" STREQUAL "")
+ set(CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR "")
+ unset(CMAKE_HAIKU_SECONDARY_ARCH)
+else()
+ set(CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR "/${CMAKE_HAIKU_SECONDARY_ARCH}")
+
+ # Override CMAKE_*LIBRARY_ARCHITECTURE. This will cause FIND_LIBRARY to search
+ # the libraries in the correct subdirectory first. It still isn't completely
+ # correct, since the parent directories shouldn't be searched at all. The
+ # primary architecture library might still be found, if there isn't one
+ # installed for the secondary architecture or it is installed in a less
+ # specific location.
+ set(CMAKE_LIBRARY_ARCHITECTURE ${CMAKE_HAIKU_SECONDARY_ARCH})
+ set(CMAKE_C_LIBRARY_ARCHITECTURE ${CMAKE_HAIKU_SECONDARY_ARCH})
+ set(CMAKE_CXX_LIBRARY_ARCHITECTURE ${CMAKE_HAIKU_SECONDARY_ARCH})
+endif("${CMAKE_HAIKU_SECONDARY_ARCH}" STREQUAL "")
+
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
/boot/common/non-packaged
/boot/common
/boot/system
)
-list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- /boot/common/non-packaged/lib${__HAIKU_LIBDIR_SUFFIX}
- /boot/common/develop/lib${__HAIKU_LIBDIR_SUFFIX}
- /boot/system/develop/lib${__HAIKU_LIBDIR_SUFFIX}
+
+LIST(APPEND CMAKE_HAIKU_COMMON_INCLUDE_DIRECTORIES
+ /boot/common/non-packaged/develop/headers${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
+ /boot/common/develop/headers${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
+ /boot/system/develop/headers/os
+ /boot/system/develop/headers/os/app
+ /boot/system/develop/headers/os/device
+ /boot/system/develop/headers/os/drivers
+ /boot/system/develop/headers/os/game
+ /boot/system/develop/headers/os/interface
+ /boot/system/develop/headers/os/kernel
+ /boot/system/develop/headers/os/locale
+ /boot/system/develop/headers/os/mail
+ /boot/system/develop/headers/os/media
+ /boot/system/develop/headers/os/midi
+ /boot/system/develop/headers/os/midi2
+ /boot/system/develop/headers/os/net
+ /boot/system/develop/headers/os/opengl
+ /boot/system/develop/headers/os/storage
+ /boot/system/develop/headers/os/support
+ /boot/system/develop/headers/os/translation
+ /boot/system/develop/headers/os/add-ons/graphics
+ /boot/system/develop/headers/os/add-ons/input_server
+ /boot/system/develop/headers/os/add-ons/screen_saver
+ /boot/system/develop/headers/os/add-ons/tracker
+ /boot/system/develop/headers/os/be_apps/Deskbar
+ /boot/system/develop/headers/os/be_apps/NetPositive
+ /boot/system/develop/headers/os/be_apps/Tracker
+ /boot/system/develop/headers/3rdparty
+ /boot/system/develop/headers/bsd
+ /boot/system/develop/headers/glibc
+ /boot/system/develop/headers/gnu
+ /boot/system/develop/headers/posix
+ /boot/system/develop/headers${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
+ )
+IF (CMAKE_HAIKU_SECONDARY_ARCH)
+ LIST(APPEND CMAKE_HAIKU_COMMON_INCLUDE_DIRECTORIES
+ /boot/system/develop/headers
+ )
+ENDIF (CMAKE_HAIKU_SECONDARY_ARCH)
+
+LIST(APPEND CMAKE_HAIKU_C_INCLUDE_DIRECTORIES
+ ${CMAKE_HAIKU_COMMON_INCLUDE_DIRECTORIES}
)
-list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
- /boot/common/develop/headers${__HAIKU_LIBDIR_SUFFIX}
- /boot/system/develop/headers${__HAIKU_LIBDIR_SUFFIX}
+
+LIST(APPEND CMAKE_HAIKU_CXX_INCLUDE_DIRECTORIES
+ ${CMAKE_HAIKU_COMMON_INCLUDE_DIRECTORIES})
+
+LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_HAIKU_C_INCLUDE_DIRECTORIES})
+
+LIST(APPEND CMAKE_HAIKU_DEVELOP_LIB_DIRECTORIES
+ /boot/common/non-packaged/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
+ /boot/common/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
+ /boot/system/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
)
-list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
- /boot/common/develop/lib${__HAIKU_LIBDIR_SUFFIX}
- /boot/system/develop/lib${__HAIKU_LIBDIR_SUFFIX}
+
+LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+ ${CMAKE_HAIKU_DEVELOP_LIB_DIRECTORIES}
)
+LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_HAIKU_DEVELOP_LIB_DIRECTORIES})
+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/boot/common" CACHE PATH
"Install path prefix, prepended onto install directories." FORCE)
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 322a6a2..2aaedec 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -53,14 +53,10 @@
#include <cm_zlib.h>
#include <cmsys/Base64.h>
-#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
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index a09958b..6dd2f49 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1590,9 +1590,10 @@ void cmFindPackageCommand::AddPrefixesUserRegistry()
if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, dir, sizeof(dir)) ==
B_OK)
{
- strlcat(dir, "/cmake/packages/", sizeof(dir));
- strlcat(dir, this->Name.c_str(), sizeof(dir));
- this->LoadPackageRegistryDir(dir);
+ std::string fname = dir;
+ fname += "/cmake/packages/";
+ fname += Name;
+ this->LoadPackageRegistryDir(fname);
}
#else
if(const char* home = cmSystemTools::GetEnv("HOME"))
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 8b25d60..51dba3c 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -152,11 +152,6 @@ public:
#define _chdir chdir
#endif
-#if defined(__HAIKU__)
-#include <os/kernel/OS.h>
-#include <os/storage/Path.h>
-#endif
-
#if defined(__BEOS__) && !defined(__ZETA__)
#include <be/kernel/OS.h>
#include <be/storage/Path.h>
diff --git a/Source/kwsys/testDynamicLoader.cxx b/Source/kwsys/testDynamicLoader.cxx
index 61c1572..fc0215e 100644
--- a/Source/kwsys/testDynamicLoader.cxx
+++ b/Source/kwsys/testDynamicLoader.cxx
@@ -15,14 +15,10 @@
#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/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index 5c43052..f00cbd6 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -51,7 +51,7 @@ define_property(
FULL_DOCS "A simple etst proerty that means nothign and is used for nothing"
)
set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR)
-if(NOT BEOS AND NOT WIN32) # No libm on BeOS.
+if(NOT BEOS AND NOT WIN32 AND NOT HAIKU) # No libm on BeOS.
set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
endif()
get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
diff --git a/Utilities/cmzlib/zutil.h b/Utilities/cmzlib/zutil.h
index 74ef1f8..3053cd8 100644
--- a/Utilities/cmzlib/zutil.h
+++ b/Utilities/cmzlib/zutil.h
@@ -147,12 +147,6 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define OS_CODE 0x0f
#endif
-/* Haiku defines both __HAIKU__ and __BEOS__ (for now) */
-/* many BeOS workarounds are no longer needed in Haiku */
-#if defined(__HAIKU__) && defined(__BEOS__)
-#undef __BEOS__
-#endif
-
#if defined(_BEOS_) || defined(RISCOS)
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
--
1.8.3.4