CMake: remove common/ references and fix use with distcc.

* common/ dir is no more.
 * When using distcc, our logic to detect the secondary architecture
didn't work because cmake ran "distcc" instad of "distcc gcc-x86". Add
the missing part to the command-line invocation.
This commit is contained in:
Adrien Destugues
2013-11-12 16:34:36 +01:00
parent 4e2a44f089
commit 1ee30d71a0
2 changed files with 102 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ LICENSE="CMake"
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="3"
REVISION="4"
ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64"
PROVIDES="

View File

@@ -1601,3 +1601,104 @@ index 0000000..ffa803d
--
1.8.3.4
From 4c66402a7b630969a74878a90af03c72edce3844 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 12 Nov 2013 15:15:33 +0100
Subject: Remove remaining references to "common" directory.
diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index 825f851..a3ebe24 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -53,14 +53,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 +106,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 +117,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()
--
1.8.3.4
From dc8f5b4f8c63f27b4c155246f4614120fbb4fb8b Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 12 Nov 2013 15:48:13 +0100
Subject: Fix compiler detection when distcc is involved
cmake will set CMAKE_CXX_COMPILER to "distcc" and put the actual compiler
into another variable, with other arguments. Append CMAKE_CXX_COMPILER_ARG1
to our compiler invocation to take this into account.
diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index a3ebe24..0aae768 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -21,18 +21,29 @@ 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)
- set(__HAIKU_COMPILER ${CMAKE_CXX_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")
+if(NOT 0 EQUAL _HAIKU_SEARCH_DIRS_FOUND)
+ message(FATAL_ERROR "Could not determine secondary architecture directory for ${__HAIKU_COMPILER}.")
+endif()
+
+string(REGEX MATCH "libraries: =?([^\n]*:)?/boot/system/develop/lib/([^/]*)/(:[^\n]*)?" _dummy "${_HAIKU_SEARCH_DIRS}")
set(CMAKE_HAIKU_SECONDARY_ARCH "${CMAKE_MATCH_2}")
if(NOT CMAKE_HAIKU_SECONDARY_ARCH)
--
1.8.3.4