From c4891694b7c8fcc469dfa057ebf397ee28fc44b1 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Thu, 17 Jun 2010 11:15:54 +0200 Subject: Robin Cornelius: fixes for building plugins on Linux 64bit --- linden/indra/cmake/00-Common.cmake | 8 ++++++++ linden/indra/cmake/LLCommon.cmake | 13 ++++++++++++- linden/indra/llcommon/CMakeLists.txt | 20 ++++++++++++++++++++ linden/indra/llplugin/CMakeLists.txt | 4 ++++ linden/indra/media_plugins/base/CMakeLists.txt | 4 ++++ linden/indra/media_plugins/example/CMakeLists.txt | 4 ++++ .../indra/media_plugins/gstreamer010/CMakeLists.txt | 4 ++++ linden/indra/media_plugins/webkit/CMakeLists.txt | 4 ++++ linden/indra/newview/CMakeLists.txt | 2 ++ 9 files changed, 62 insertions(+), 1 deletion(-) mode change 100755 => 100644 linden/indra/llplugin/CMakeLists.txt mode change 100755 => 100644 linden/indra/media_plugins/base/CMakeLists.txt mode change 100755 => 100644 linden/indra/media_plugins/example/CMakeLists.txt mode change 100755 => 100644 linden/indra/media_plugins/gstreamer010/CMakeLists.txt diff --git a/linden/indra/cmake/00-Common.cmake b/linden/indra/cmake/00-Common.cmake index d335cb0..6403d49 100644 --- a/linden/indra/cmake/00-Common.cmake +++ b/linden/indra/cmake/00-Common.cmake @@ -20,6 +20,14 @@ set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING "Supported build types." FORCE) +# Determine the number of bits of this processor + +if(CMAKE_SIZEOF_VOID_P MATCHES 4) + set( HAVE_64_BIT 0 ) +else(CMAKE_SIZEOF_VOID_P MATCHES 4) + set( HAVE_64_BIT 1 ) +endif(CMAKE_SIZEOF_VOID_P MATCHES 4) + # Platform-specific compilation flags. if (WINDOWS) diff --git a/linden/indra/cmake/LLCommon.cmake b/linden/indra/cmake/LLCommon.cmake index 410766e..9158e98 100644 --- a/linden/indra/cmake/LLCommon.cmake +++ b/linden/indra/cmake/LLCommon.cmake @@ -12,4 +12,15 @@ set(LLCOMMON_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ) -set(LLCOMMON_LIBRARIES llcommon) +# Files that need PIC code (pluginAPI) need to set REQUIRE_PIC on 64bit systems +# this will link against a llcommon built with Position Independent Code +# this is a requirment to link a static library (.a) to a DSO on 64 bit systems + +if(REQUIRE_PIC) + set(LLCOMMON_LIBRARIES llcommonPIC) +else(REQUIRE_PIC) + set(LLCOMMON_LIBRARIES llcommon) +endif(REQUIRE_PIC) + +#force clear the flag, files that need this must explicity set it themselves +set(REQUIRE_PIC 0) \ No newline at end of file diff --git a/linden/indra/llcommon/CMakeLists.txt b/linden/indra/llcommon/CMakeLists.txt index 1c12e55..ae961a3 100644 --- a/linden/indra/llcommon/CMakeLists.txt +++ b/linden/indra/llcommon/CMakeLists.txt @@ -198,3 +198,23 @@ target_link_libraries( ${EXPAT_LIBRARIES} ${ZLIB_LIBRARIES} ) + +if(HAVE_64_BIT) + add_library (llcommonPIC ${llcommon_SOURCE_FILES}) + add_dependencies(llcommonPIC prepare) + + if(WINDOWS) + add_definitions(/FIXED:NO) + else(WINDOWS) # not windows therefore gcc LINUX and DARWIN + add_definitions(-fPIC) + endif(WINDOWS) + + target_link_libraries( + llcommonPIC + ${APRUTIL_LIBRARIES} + ${APR_LIBRARIES} + ${EXPAT_LIBRARIES} + ${ZLIB_LIBRARIES} + ) +endif(HAVE_64_BIT) + diff --git a/linden/indra/llplugin/CMakeLists.txt b/linden/indra/llplugin/CMakeLists.txt old mode 100755 new mode 100644 index d9b623d..8a2eff8 --- a/linden/indra/llplugin/CMakeLists.txt +++ b/linden/indra/llplugin/CMakeLists.txt @@ -2,6 +2,10 @@ project(llplugin) +if(HAVE_64_BIT) + set(REQUIRE_PIC) +endif(HAVE_64_BIT) + include(00-Common) include(LLCommon) include(LLImage) diff --git a/linden/indra/media_plugins/base/CMakeLists.txt b/linden/indra/media_plugins/base/CMakeLists.txt old mode 100755 new mode 100644 index 8d62043..dd0b0a0 --- a/linden/indra/media_plugins/base/CMakeLists.txt +++ b/linden/indra/media_plugins/base/CMakeLists.txt @@ -2,6 +2,10 @@ project(media_plugin_base) +if(HAVE_64_BIT) + set(REQUIRE_PIC) +endif(HAVE_64_BIT) + include(00-Common) include(LLCommon) include(LLImage) diff --git a/linden/indra/media_plugins/example/CMakeLists.txt b/linden/indra/media_plugins/example/CMakeLists.txt old mode 100755 new mode 100644 index 7822300..bac5fa2 --- a/linden/indra/media_plugins/example/CMakeLists.txt +++ b/linden/indra/media_plugins/example/CMakeLists.txt @@ -2,6 +2,10 @@ project(media_plugin_example) +if(HAVE_64_BIT) + set(REQUIRE_PIC) +endif(HAVE_64_BIT) + include(00-Common) include(LLCommon) include(LLImage) diff --git a/linden/indra/media_plugins/gstreamer010/CMakeLists.txt b/linden/indra/media_plugins/gstreamer010/CMakeLists.txt old mode 100755 new mode 100644 index ee16849..6eab49c --- a/linden/indra/media_plugins/gstreamer010/CMakeLists.txt +++ b/linden/indra/media_plugins/gstreamer010/CMakeLists.txt @@ -2,6 +2,10 @@ project(media_plugin_gstreamer010) +if(HAVE_64_BIT) + set(REQUIRE_PIC) +endif(HAVE_64_BIT) + include(00-Common) include(LLCommon) include(LLImage) diff --git a/linden/indra/media_plugins/webkit/CMakeLists.txt b/linden/indra/media_plugins/webkit/CMakeLists.txt index be02781..a47d5e0 100644 --- a/linden/indra/media_plugins/webkit/CMakeLists.txt +++ b/linden/indra/media_plugins/webkit/CMakeLists.txt @@ -2,6 +2,10 @@ project(media_plugin_webkit) +if(HAVE_64_BIT) + set(REQUIRE_PIC) +endif(HAVE_64_BIT) + include(00-Common) include(LLCommon) include(LLImage) diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index 75ba977..e0c6c61 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -1472,10 +1472,12 @@ if (DARWIN) --build=${CMAKE_CURRENT_BINARY_DIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) + add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit) add_custom_command( TARGET package POST_BUILD COMMAND ${PYTHON_EXECUTABLE} -- cgit v1.1