summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/cmake/Variables.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index 28315e66e0..405d80aeb0 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -73,19 +73,36 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# If someone has specified a word size, use that to determine the
# architecture. Otherwise, let the architecture specify the word size.
if (WORD_SIZE EQUAL 32)
+ #message(STATUS "WORD_SIZE is 32")
set(ARCH i686)
elseif (WORD_SIZE EQUAL 64)
+ #message(STATUS "WORD_SIZE is 64")
set(ARCH x86_64)
else (WORD_SIZE EQUAL 32)
+ #message(STATUS "WORD_SIZE is UNDEFINED")
execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/
OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
if (ARCH STREQUAL x86_64)
+ #message(STATUS "ARCH is detected as 64; ARCH is ${ARCH}")
set(WORD_SIZE 64)
else (ARCH STREQUAL x86_64)
+ #message(STATUS "ARCH is detected as 32; ARCH is ${ARCH}")
set(WORD_SIZE 32)
endif (ARCH STREQUAL x86_64)
endif (WORD_SIZE EQUAL 32)
+ if (WORD_SIZE EQUAL 32)
+ set(DEB_ARCHITECTURE i386)
+ else (WORD_SIZE EQUAL 32)
+ set(DEB_ARCHITECTURE amd64)
+ endif (WORD_SIZE EQUAL 32)
+
+ execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH RESULT_VARIABLE DPKG_RESULT OUTPUT_VARIABLE DPKG_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
+ #message (STATUS "DPKG_RESULT ${DPKG_RESULT}, DPKG_ARCH ${DPKG_ARCH}")
+ if (DPKG_RESULT EQUAL 0)
+ set(CMAKE_LIBRARY_ARCHITECTURE ${DPKG_ARCH})
+ endif (DPKG_RESULT EQUAL 0)
+
set(LL_ARCH ${ARCH}_linux)
set(LL_ARCH_DIR ${ARCH}-linux)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")