From 136858bd20acab9684c2bd1673663fc925f0cc77 Mon Sep 17 00:00:00 2001 From: "Boroondas Gupte (patch by Robin Cornelius)" Date: Tue, 31 Aug 2010 12:16:03 +0200 Subject: 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) --- indra/cmake/Variables.cmake | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/cmake/Variables.cmake') 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) -- cgit v1.2.3 From bd3d9e1ba99586d31b6deba2f9dc54d481f9740b Mon Sep 17 00:00:00 2001 From: Boroondas Gupte Date: Tue, 31 Aug 2010 14:41:46 +0200 Subject: VWR-20911 FOLLOWUP fixed indentation (cmake files use spaces only) (transplanted from d02b22278d5b0a0386b3a7c25221b2069bc02963) --- indra/cmake/Variables.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/cmake/Variables.cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 8a08154295..230e228c62 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -62,12 +62,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(ARCH x86_64) else (WORD_SIZE EQUAL 32) 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) + 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) -- cgit v1.2.3