[Cmake-commits] CMake branch, next, updated. v3.0.0-rc2-1387-g4cc2eec

Brad King brad.king at kitware.com
Fri Mar 21 08:25:27 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  4cc2eec542cd0dd8ffc221028e7867ed03a0ceab (commit)
       via  0cc42b871ab9c9153d839ab8fc55a6a887d55092 (commit)
       via  84603d804c285c75f4bf81f9d79f0ebd0ca68fea (commit)
      from  5bb40a56aa41d8227099a7b37fc43792fbce3140 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4cc2eec542cd0dd8ffc221028e7867ed03a0ceab
commit 4cc2eec542cd0dd8ffc221028e7867ed03a0ceab
Merge: 5bb40a5 0cc42b8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 21 08:25:26 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Mar 21 08:25:26 2014 -0400

    Merge topic 'haiku-updates' into next
    
    0cc42b87 Haiku: Fix compiler detection when using distcc
    84603d80 Haiku: Enable CMake builtin ELF editor


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0cc42b871ab9c9153d839ab8fc55a6a887d55092
commit 0cc42b871ab9c9153d839ab8fc55a6a887d55092
Author:     Adrien Destugues <pulkomandy at pulkomandy.tk>
AuthorDate: Mon Mar 3 15:57:05 2014 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 21 08:19:10 2014 -0400

    Haiku: Fix compiler detection when using distcc
    
    Also remove outdated include directories.

diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index 825f851..dfc2664 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -21,18 +21,26 @@ set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
 # "/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(NOT __HAIKU_COMPILER)
+# First of all, find a C or C++ compiler we can run. The "arg1" is necessary
+# here for compilers such as "distcc gcc-x86" or "ccache gcc-x86"
+# TODO See CMakeDetermineCompilerId.cmake for some more things we may want to do.
+if(CMAKE_C_COMPILER)
+  set(__HAIKU_COMPILER ${CMAKE_C_COMPILER})
+  string (STRIP "${CMAKE_C_COMPILER_ARG1}" __HAIKU_COMPILER_FLAGS)
+else()
   set(__HAIKU_COMPILER ${CMAKE_CXX_COMPILER})
+  string (STRIP "${CMAKE_CXX_COMPILER_ARG1}" __HAIKU_COMPILER_FLAGS)
 endif()
 
+
 execute_process(
-  COMMAND ${__HAIKU_COMPILER} -print-search-dirs
+  COMMAND ${__HAIKU_COMPILER} ${__HAIKU_COMPILER_FLAGS} -print-search-dirs
   OUTPUT_VARIABLE _HAIKU_SEARCH_DIRS
+  RESULT_VARIABLE _HAIKU_SEARCH_DIRS_FOUND
   OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-string(REGEX MATCH ".*\nlibraries: =?([^\n]*:)?/boot/system/develop/lib/([^/]*)/(:[^\n]*)?\n.*" _dummy "\n${_HAIKU_SEARCH_DIRS}\n")
+string(REGEX MATCH "libraries: =?([^\n]*:)?/boot/system/develop/lib/([^/]*)/?(:?\n+)" _dummy "${_HAIKU_SEARCH_DIRS}\n")
 set(CMAKE_HAIKU_SECONDARY_ARCH "${CMAKE_MATCH_2}")
 
 if(NOT CMAKE_HAIKU_SECONDARY_ARCH)
@@ -53,14 +61,12 @@ else()
 endif()
 
 list(APPEND CMAKE_SYSTEM_PREFIX_PATH
-  /boot/common/non-packaged
-  /boot/common
+  /boot/system/non-packaged
   /boot/system
   )
 
 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/non-packaged/develop/headers${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
   /boot/system/develop/headers/os
   /boot/system/develop/headers/os/app
   /boot/system/develop/headers/os/device
@@ -108,8 +114,7 @@ LIST(APPEND CMAKE_HAIKU_CXX_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/non-packaged/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
   /boot/system/develop/lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR}
   )
 
@@ -120,6 +125,6 @@ LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_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
+  set(CMAKE_INSTALL_PREFIX "/boot/system" CACHE PATH
     "Install path prefix, prepended onto install directories." FORCE)
 endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=84603d804c285c75f4bf81f9d79f0ebd0ca68fea
commit 84603d804c285c75f4bf81f9d79f0ebd0ca68fea
Author:     Adrien Destugues <pulkomandy at pulkomandy.tk>
AuthorDate: Mon Mar 3 15:47:08 2014 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 21 08:19:09 2014 -0400

    Haiku: Enable CMake builtin ELF editor
    
    Co-Author: Brad King <brad.king at kitware.com>

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 762470f..27d099d 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -18,6 +18,23 @@ else()
 endif()
 if(HAVE_ELF_H)
   set(CMAKE_USE_ELF_PARSER 1)
+elseif(HAIKU)
+  # On Haiku, we need to include elf32.h from the private headers
+  set(CMake_HAIKU_INCLUDE_DIRS
+    /boot/system/develop/headers/private/system
+    /boot/system/develop/headers/private/system/arch/x86
+    )
+
+  set(CMAKE_REQUIRED_INCLUDES ${CMake_HAIKU_INCLUDE_DIRS})
+  CHECK_INCLUDE_FILE("elf32.h" HAVE_ELF32_H)
+  unset(CMAKE_REQUIRED_INCLUDES)
+
+  if(HAVE_ELF32_H)
+    set(CMAKE_USE_ELF_PARSER 1)
+  else()
+    unset(CMake_HAIKU_INCLUDE_DIRS)
+    set(CMAKE_USE_ELF_PARSER)
+  endif()
 else()
   set(CMAKE_USE_ELF_PARSER)
 endif()
@@ -57,6 +74,7 @@ include_directories(
   ${CMAKE_EXPAT_INCLUDES}
   ${CMAKE_TAR_INCLUDES}
   ${CMAKE_COMPRESS_INCLUDES}
+  ${CMake_HAIKU_INCLUDE_DIRS}
   )
 
 # let cmake know it is supposed to use it
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index bc1c25b..dc6772c 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -23,6 +23,26 @@
 #if defined(__OpenBSD__)
 # include <stdint.h>
 # include <elf_abi.h>
+#elif defined(__HAIKU__)
+# include <elf32.h>
+# include <elf64.h>
+  typedef struct Elf32_Ehdr Elf32_Ehdr;
+  typedef struct Elf32_Shdr Elf32_Shdr;
+  typedef struct Elf32_Sym Elf32_Sym;
+  typedef struct Elf32_Rel Elf32_Rel;
+  typedef struct Elf32_Rela Elf32_Rela;
+# define ELFMAG0 0x7F
+# define ELFMAG1 'E'
+# define ELFMAG2 'L'
+# define ELFMAG3 'F'
+# define ET_NONE 0
+# define ET_REL 1
+# define ET_EXEC 2
+# define ET_DYN 3
+# define ET_CORE 4
+# define EM_386 3
+# define EM_SPARC 2
+# define EM_PPC 20
 #else
 # include <elf.h>
 #endif

-----------------------------------------------------------------------

Summary of changes:
 Modules/Platform/Haiku.cmake |   27 ++++++++++++++++-----------
 Source/CMakeLists.txt        |   18 ++++++++++++++++++
 Source/cmELF.cxx             |   20 ++++++++++++++++++++
 3 files changed, 54 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list