From dcff75d6da80bab3defbe66f49b379ac91cf48dd Mon Sep 17 00:00:00 2001 From: Jay Threeth Date: Sat, 23 Apr 2011 12:52:06 -0700 Subject: Build libotr, and static link it, libgpg-error and libgcrypt into the exe (on linux) --- linden/indra/CMakeLists.txt | 14 ++++++++++++++ linden/indra/newview/CMakeLists.txt | 22 ++++++++++++++++++++-- linden/indra/newview/viewer_manifest.py | 12 ++++++++---- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/linden/indra/CMakeLists.txt b/linden/indra/CMakeLists.txt index 5ef5d2c..2085ea1 100644 --- a/linden/indra/CMakeLists.txt +++ b/linden/indra/CMakeLists.txt @@ -35,6 +35,20 @@ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/temp) file(WRITE ${CMAKE_BINARY_DIR}/temp/sentinel_installed "0") add_subdirectory(cmake) +# [$PLOTR$] +if (WINDOWS) + add_subdirectory(${LIBS_OPEN_PREFIX}gpg.vs) + add_subdirectory(${LIBS_OPEN_PREFIX}libgcrypt) + add_subdirectory(${LIBS_OPEN_PREFIX}libgpg-error) +endif (WINDOWS) + +# if ON will cause linux to link in static OTR like windows does +# if off will use the systems libotr.so but won't be fully compatible with windows version +set(STATIC_LIBOTR_ETC 1) + +add_subdirectory(${LIBS_OPEN_PREFIX}libotr) +# [/$PLOTR$] + add_subdirectory(${LIBS_OPEN_PREFIX}llaudio) add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter) add_subdirectory(${LIBS_OPEN_PREFIX}llcommon) diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index 299164d..6d6e8c9 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -45,10 +45,13 @@ endif (WINDOWS) # [$PLOTR$] include(libgcrypt) include(libgpg-error) -include(libotr) if (DARWIN OR LINUX) + if (STATIC_LIBOTR_ETC) + include(libotr) # to build libotr from source and statically link in libgcrypt and libgpg-error + else (STATIC_LIBOTR_ETC) include(libotrb) + endif (STATIC_LIBOTR_ETC) endif (DARWIN OR LINUX) # [/$PLOTR$] @@ -1059,9 +1062,19 @@ if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") + # [$PLOTR$] + if (STATIC_LIBOTR_ETC) # defined in .../linden/indra/CMakeLists.txt set(viewer_LIBRARIES - Xinerama + Xinerama + gpg-error + gcrypt # to build libotr from source and statically link in libgcrypt and libgpg-error ) + else (STATIC_LIBOTR_ETC) # below for dynamically linked, unmodified libotr + set(viewer_LIBRARIES + Xinerama + ) + endif (STATIC_LIBOTR_ETC) + # [/$PLOTR$] endif (LINUX) if (WINDOWS) @@ -1424,8 +1437,13 @@ if (WINDOWS) ${LIBOTR_LIBRARIES} ) else (WINDOWS) + if (STATIC_LIBOTR_ETC) + set(otr_link_libs ${LIBOTR_LIBRARIES} + ) # statically linked libotr, built from source + else (STATIC_LIBOTR_ETC) set(otr_link_libs ${OTR_LIBRARY} ) + endif (STATIC_LIBOTR_ETC) endif (WINDOWS) # [/$PLOTR$] diff --git a/linden/indra/newview/viewer_manifest.py b/linden/indra/newview/viewer_manifest.py index 0008e45..719c34e 100755 --- a/linden/indra/newview/viewer_manifest.py +++ b/linden/indra/newview/viewer_manifest.py @@ -1118,8 +1118,10 @@ class Linux_i686Manifest(LinuxManifest): #self.end_prefix("gstreamer-plugins") - self.path("libotr.so.2.2.0") - self.path("libotr.so.2") +# [$PLOTR$] these two are not needed when STATIC_LIBOTR_ETC is on in .../linden/indra/CMakeLists.txt +# self.path("libotr.so.2.2.0") +# self.path("libotr.so.2") +# [/$PLOTR$] self.end_prefix("lib") # Vivox runtimes and libs @@ -1252,8 +1254,10 @@ class Linux_x86_64Manifest(LinuxManifest): #self.path("libgstwavparse.so") #self.end_prefix("gstreamer-plugins") - self.path("libotr.so.2.2.0") - self.path("libotr.so.2") +# [$PLOTR$] these two are not needed when STATIC_LIBOTR_ETC is on in .../linden/indra/CMakeLists.txt +# self.path("libotr.so.2.2.0") +# self.path("libotr.so.2") +# [/$PLOTR$] self.end_prefix("lib64") -- cgit v1.1