summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2009-04-09 18:05:56 +0000
committerBryan O'Sullivan <bos@lindenlab.com>2009-04-09 18:05:56 +0000
commit1aca3ff6f5f6ce0d2414d4266e902ba40f4c8d84 (patch)
tree46dc3bc3dd068e9849014deb801c974df92fc532 /indra/cmake
parentfa121d8ee18978ffc25e9faeffcfa1d7c6e1592e (diff)
Get 32-bit builds going on 64-bit Debian Etch.
Reviewed by Brad.
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/00-Common.cmake8
-rw-r--r--indra/cmake/MySQL.cmake21
-rw-r--r--indra/cmake/Variables.cmake21
3 files changed, 39 insertions, 11 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 42f43f9d4e..ad7529ea0a 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -202,6 +202,14 @@ if (LINUX OR DARWIN)
set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
+
+ if (WORD_SIZE EQUAL 32)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
+ elseif (WORD_SIZE EQUAL 64)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
+ endif (WORD_SIZE EQUAL 32)
endif (LINUX OR DARWIN)
diff --git a/indra/cmake/MySQL.cmake b/indra/cmake/MySQL.cmake
index e124ebb45e..e591fbc3d8 100644
--- a/indra/cmake/MySQL.cmake
+++ b/indra/cmake/MySQL.cmake
@@ -1,14 +1,20 @@
# -*- cmake -*-
include(Linking)
include(Prebuilt)
-# We don't prebuild our own MySQL client library.
use_prebuilt_binary(mysql)
-set(MYSQL_FIND_QUIETLY ON)
-set(MYSQL_FIND_REQUIRED ON)
-
-if (WINDOWS)
+if (LINUX)
+ if (WORD_SIZE EQUAL 32 OR DEBIAN_VERSION STREQUAL "3.1")
+ set(MYSQL_LIBRARIES mysqlclient)
+ set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
+ else (WORD_SIZE EQUAL 32 OR DEBIAN_VERSION STREQUAL "3.1")
+ # Use the native MySQL library on a 64-bit system.
+ set(MYSQL_FIND_QUIETLY ON)
+ set(MYSQL_FIND_REQUIRED ON)
+ include(FindMySQL)
+ endif (WORD_SIZE EQUAL 32 OR DEBIAN_VERSION STREQUAL "3.1")
+elseif (WINDOWS)
set(MYSQL_LIBRARIES mysqlclient)
set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
elseif (DARWIN)
@@ -17,7 +23,4 @@ elseif (DARWIN)
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libmysqlclient.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libmysqlclient.a
)
-else (WINDOWS)
- set(MYSQL_FIND_REQUIRED)
- include(FindMySQL)
-endif (WINDOWS)
+endif (LINUX)
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index 5868e4d07e..c0b4191852 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -45,12 +45,28 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(ARCH i686)
set(LL_ARCH ${ARCH}_win32)
set(LL_ARCH_DIR ${ARCH}-win32)
+ set(WORD_SIZE 32)
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 (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 64)
+ 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")
@@ -73,6 +89,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
set(LL_ARCH ${ARCH}_darwin)
set(LL_ARCH_DIR universal-darwin)
+ set(WORD_SIZE 32)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# Default deploy grid