From 64db97e226ec993b7336fe8ede0a00c938afdc61 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Sun, 13 Nov 2011 14:31:42 +0100 Subject: Linux: allow cross compiling the 32bit viewer on a x86_64 platform to do so: (have anything for crosscompiling installed), export WORD_SIZE='32' before configuring and/or building. Be aware: Mixing several platforms in one root directory probably wont work (didn't try though). Cross compiling the 64bit viewer on a i686 platform isn't tested, but probably will work using export WORD_SIZE='64' --- linden/indra/cmake/Variables.cmake | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'linden/indra/cmake/Variables.cmake') diff --git a/linden/indra/cmake/Variables.cmake b/linden/indra/cmake/Variables.cmake index eb9c004..6b7ded3 100644 --- a/linden/indra/cmake/Variables.cmake +++ b/linden/indra/cmake/Variables.cmake @@ -50,8 +50,30 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(LINUX ON BOOl FORCE) - execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/ - OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) + + # If someone has specified a word size, use that to determine the + # architecture. Otherwise, let the architecture specify the word size. + + if ("$ENV{WORD_SIZE}" MATCHES "32") + set(WORD_SIZE 32) + elseif ("$ENV{WORD_SIZE}" MATCHES "64") + set(WORD_SIZE 64) + endif () + + 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) + endif (WORD_SIZE EQUAL 32) + set(LL_ARCH ${ARCH}_linux) set(LL_ARCH_DIR ${ARCH}-linux) endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") -- cgit v1.1