summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBoroondas Gupte (patch by Robin Cornelius) <hg@boroon.dasgupta.ch>2010-08-31 12:16:03 +0200
committerBoroondas Gupte (patch by Robin Cornelius) <hg@boroon.dasgupta.ch>2010-08-31 12:16:03 +0200
commit136858bd20acab9684c2bd1673663fc925f0cc77 (patch)
treee1967316a5fe020a4ecf7966870723ede27a574a /indra
parent9ff0490998b0ff47f4372b0f6ef32c8abb534ba2 (diff)
VWR-20911 FIXED CMake build arch detection is inaccurate and incomplete
Robin Cornelius' patch from http://jira.secondlife.com/secure/attachment/42801/SNOW-776+Don%27t+use+uname+for+build+arch+detection%2C+use+compiler.patch applied without fuzz: patching file indra/cmake/Variables.cmake Hunk #1 succeeded at 52 (offset -2 lines). Added entry in doc/contributions.txt. No further changes other than that. (transplanted from a9132a63e4739965d65ddd58a7be9eabe4321c2a)
Diffstat (limited to 'indra')
-rw-r--r--indra/cmake/Variables.cmake17
1 files changed, 9 insertions, 8 deletions
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index bfaf3f4f26..8a08154295 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -54,19 +54,20 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX ON BOOl FORCE)
# If someone has specified a word size, use that to determine the
- # architecture. Otherwise, let the architecture specify the word size.
+ # architecture. Otherwise, let the compiler specify the word size.
+ # Using uname will break under chroots and other cross arch compiles. RC
if (WORD_SIZE EQUAL 32)
set(ARCH i686)
elseif (WORD_SIZE EQUAL 64)
set(ARCH x86_64)
else (WORD_SIZE EQUAL 32)
- execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/
- OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
- if (ARCH STREQUAL x86_64)
- set(WORD_SIZE 64)
- else (ARCH STREQUAL x86_64)
- set(WORD_SIZE 32)
- endif (ARCH STREQUAL x86_64)
+ if(CMAKE_SIZEOF_VOID_P MATCHES 4)
+ set(ARCH i686)
+ set(WORD_SIZE 32)
+ else(CMAKE_SIZEOF_VOID_P MATCHES 4)
+ set(ARCH x86_64)
+ set(WORD_SIZE 64)
+ endif(CMAKE_SIZEOF_VOID_P MATCHES 4)
endif (WORD_SIZE EQUAL 32)
set(LL_ARCH ${ARCH}_linux)