summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/00-COMPILE-LINK-RUN.txt344
-rwxr-xr-xindra/cmake/00-Common.cmake2
-rwxr-xr-xindra/cmake/Boost.cmake13
-rwxr-xr-xindra/cmake/Copy3rdPartyLibs.cmake29
-rwxr-xr-xindra/cmake/FreeType.cmake2
-rwxr-xr-xindra/cmake/GoogleMock.cmake2
-rwxr-xr-xindra/cmake/LLPrimitive.cmake28
-rwxr-xr-xindra/cmake/Linking.cmake1
-rwxr-xr-xindra/cmake/OpenSSL.cmake4
-rwxr-xr-xindra/cmake/PNG.cmake25
-rwxr-xr-xindra/cmake/WebKitLibPlugin.cmake43
-rwxr-xr-xindra/cmake/ZLIB.cmake21
12 files changed, 446 insertions, 68 deletions
diff --git a/indra/cmake/00-COMPILE-LINK-RUN.txt b/indra/cmake/00-COMPILE-LINK-RUN.txt
new file mode 100644
index 0000000000..d08cc2dc0c
--- /dev/null
+++ b/indra/cmake/00-COMPILE-LINK-RUN.txt
@@ -0,0 +1,344 @@
+
+ A short guide to compiling, linking, running and debugging issues
+ in the viewer and its packaged libraries.
+
+Introduction
+
+ A recent pass through some third-party libraries resulted in the
+ collection of a lot of information about how things should and
+ shouldn't be built in the viewer. Some of that is presented below
+ with hints and rules about doing things well. What's presented is
+ a guideline only. Not all suggestions are hard rules and you'll
+ find exceptions all over. Some exceptions arise from solid
+ reasoning, others may be legacy that hasn't been re-examined.
+
+ Use good engineering judgement when applying this information.
+
+Compilation
+
+ Windows Targets
+
+ Significant compilation flags and defines follow:
+
+ ----------------------------------------------------------------------------
+ Option Release RelWithDebInfo Debug
+ ----------------------------------------------------------------------------
+ wchar_t /Zc:wchar_t- " "
+ RTL type /MD /MD /MDd
+ FLoating Point /fp:fast " "
+ Debug Info /Zi (app/dll), /Z7 (lib) " "
+ Optimizer /O2 /Ob2 /GR /Od /Ob0 /GR /Od /GR
+ Incr. Link /INCREMENTAL:NO /INCREMENTAL /INCREMENTAL:NO
+ Debug /DEBUG /DEBUG /DEBUG
+ /OPT:REF
+ Ignore Libs LIBCMT LIBCMT LIBCMT;LIBCMTD;MSVCRT
+ Alignment Default " "
+
+ Defines WIN32 " "
+ _WINDOWS " "
+ LL_RELEASE=1 LL_RELEASE=1 n/a
+ LL_RELEASE_FOR_DOWNLOAD=1 n/a n/a
+ NDEBUG NDEBUG _DEBUG
+ n/a n/a LL_DEBUG=1
+ n/a LL_RELEASE_WITH_\ n/a
+ DEBUG_INFO=1
+ n/a n/a _SCL_SECURE_NO_WARNINGS=1
+ _SECURE_STL=0 _SECURE_STL=0 _SECURE_STL=0
+ _HAS_ITERATOR_DEBUGGING=0 n/a n/a
+ LL_WINDOWS=1 " "
+ UNICODE " "
+ _UNICODE " "
+ WINVER=0x0501 " "
+ _WIN32_WINNT=0x0501 " "
+ LL_OS_DRAGDROP_ENABLED=1 " "
+ CARES_STATICLIB " "
+ LIB_NDOF=1 " "
+
+ ----------------------------------------------------------------------------
+ Notes:
+
+ 1. /Zc:wchar_t-. Not certain where this comes from. It may be
+ due to a default set of compilation flags in Qt 4.X that then
+ propagates outward. In Qt 5.X, this setting is flipped back to
+ default (wchar_t is a built-in). Other options for dealing with
+ this include:
+
+ http://msdn.microsoft.com/en-us/library/dh8che7s%28v=vs.110%29.aspx
+
+ Recommend trying to stay with /Zc:wchar_t (the default) when
+ adding libraries. If incompatible, you'll typically get some
+ missing ostream '<<' operators or something similar in the stream
+ headers.
+
+ 2. /Z7 (VC 7.0 compatibility symbols) gives us debug information
+ in the static libraries we build. Otherwise builds generate
+ vc100.pdb files all over the place which generally aren't useful.
+ DLL's and .EXEs are to get /Zi or /ZI with separate .PDB files.
+ These .PDB files can then be packaged up in symbol tarballs for
+ the crash dump analyzer or used in debugging. There are issues here
+ for VS 2013 (see below).
+
+
+ Mac Targets
+
+ Fairly straightforward, optimization level is easily changed (may
+ be little or negative gain for -O3 and RelWithDebInfo should be
+ kicked up to 1 or 2. Boost debug symbols to dwarf-2 with a goal
+ of dwarf-2 in separate dSYM file when building .dylibs and
+ executables.
+
+ ----------------------------------------------------------------------------
+ Option Release RelWithDebInfo Debug
+ ----------------------------------------------------------------------------
+ Strip Debug Symbols On " "
+ During Copy
+
+ Generate Debug Syms On " "
+
+ Level Debug Syms -gdwarf-2 " "
+
+ Optimization -O3 -O0 -O0
+
+ PIC -fPIC -DPIC " "
+
+ Defines LL_RELEASE=1 LL_RELEASE=1 n/a
+ LL_RELEASE_FOR_DOWNLOAD=1 n/a n/a
+ NDEBUG NDEBUG _DEBUG
+ n/a n/a LL_DEBUG=1
+ n/a LL_RELEASE_WITH_\ n/a
+ DEBUG_INFO=1
+ LL_DARWIN=1 " "
+ LL_OS_DRAGDROP_ENABLED=1 " "
+ CARES_STATICLIB " "
+ LIB_NDOF=1 " "
+
+ ----------------------------------------------------------------------------
+ Notes:
+
+ 1. We’re also building dylibs in a somewhat unusual way. They’re
+ currently being generated with a link path of
+ ‘@executable_path/../Resources/<library>’. If we were to follow
+ the recommendations in dyld’s man page, we’d instead reference
+ ‘@loader_path/<library>’, use -rpath on the executable link
+ (pointing to the ‘Resources’ subdir of the main executable), and
+ be able to avoid some symlinking in the .app tree.
+
+ 2. Use the -headerpad_max_install_names link option on all .dylibs.
+
+
+ Linux Targets
+
+ Not much variety here.
+
+ ----------------------------------------------------------------------------
+ Option Release RelWithDebInfo Debug
+ ----------------------------------------------------------------------------
+ Debug Level -g (-g0/1 better?) -g -g
+ During Copy
+
+ Optimization -O2 -O0 -O0
+
+ PIC -fPIC " "
+ ----------------------------------------------------------------------------
+ Notes:
+
+
+Linking
+
+ The library update work has generally moved in the direction of
+ preferring static libraries over dynamic (Qt4 being the notable
+ exception). It also mostly eliminated the extremely bad practice
+ of having multiple versions of a library built into an image.
+
+ How bad was it? Very. Appalling. A nightmare. On Windows, at
+ least four versions of zlib (1.2.3, 1.2.5, 1.2.6, unknown), three
+ versions of Boost (1.45, 1.48, 1.52), two versions of OpenSSL
+ (0.9.8q, 1.0.0g) and three different builds of libexpat
+ 2.0.5/1.5.2 were used. Mac was worse with five builds or versions
+ of zlib, two of PCRE, two of c-ares, and three of OpenSSL. Linux
+ topped that by adding two builds of libpng.
+
+ DO NOT ALLOW THIS TO HAPPEN AGAIN. It isn't enough to update a
+ library and then stuff a new triplet of S3 URLs into the viewer's
+ autobuild.xml. If you update a library you MUST:
+
+ * Update the autobuild.xml of ALL consumers of the library. In
+ the case of zlib, that meant updating freetype, libpng, openssl,
+ libxml2, fontconfig, curl, Boost, SDL, llqtwebkit, google-mock and
+ colladadom.
+
+ * Confirm by test and observation that the consumers actually use
+ your library rather than 'call home to mother' and find
+ system-supplied versions of your library. This may consist of
+ watching configuration scripts, probing with ldd/depends/otool,
+ pulling text out of binaries with 'strings'. The previously-
+ mentioned libraries all have a README.Linden file that gives
+ examples specific to the consumer library.
+
+ * DO NOT RE-EXPORT LIBRARIES. Colladadom was the worst offender
+ of this rule. As a shared library, it was re-exporting part, but
+ not all, of Boost filesystem and system, some zlib, some PCRE,
+ some libxml2 and minizip. This meant that depending upon link-
+ time and run-time symbol resolution, data constructed with one
+ version of a library might be processed by a method built in a
+ second, incompatible version of the library. Switching colladadom
+ to a static library ended the re-export problem.
+
+ * Preventing re-export is not sufficient. other libraries will
+ still be shipped as shared and they can still have Singleton and
+ Fragile Base Class issues. A DLL may be built with a static
+ archive of a library that has global data. That same static
+ archive might be linked into the application proper. An object
+ created with a method in the DLL may pass into a method in the
+ application where the archive's global data has a second instance
+ and no knowledge of the object. This is a failure due to an
+ assumption of Singleton global data which leads to some kind of
+ failure. This is the same effect as when, in Windows, both MSVCRT
+ and MSVCRTD get activated in a program. If you're lucky, some
+ asserts fail in that case having to do with file handle global
+ data.
+
+
+Running
+
+ Windows Debug Build. Seems to have been rendered nearly useless
+ by having the LL_CHECK_MEMORY define in llmemory.h calling
+ _CrtCheckMemory(). Viewer is almost useful disabling this in
+ llvoavatar code alone but not quite.
+
+
+Futures
+
+ Static Versus Dynamic Libraries
+
+ One solution to the above linking problems is the use of static
+ libraries for everything. Single version, singleton instancing of
+ data, etc. But it's not the 1950's and we're not running our
+ applications on bare metal. Every platform comes with 100s of
+ libraries waiting to interfere with operations by breaking the
+ single-version and singleton-data assumption.
+
+ Additionally, there are libraries that simply expect to be built
+ into shared libraries. Qt4 is one such. The version we're using
+ now, 4.7.1, is actually trying to disable both Webkit and plugin
+ modules because we're building it statically on Mac and Linux.
+ It's only because of configuration bugs that we're getting the
+ functionality out of it that we want.
+
+ With enough libraries and a single, global namespace, eventually
+ there will be collisions and there may not be a warning. All it
+ takes is two programmers who thought that 'FILE * open_file(const
+ char *);' was a safe signature to use between compilation units in
+ their libraries and glorious debugging sessions are in your
+ future. Having debugged it, you will now become the proud owner
+ of a one-off version of one of those libraries that uses a special
+ symbol prefix which you will be maintaining forever.
+
+ Lastly, we have some binary blobs that we must use as delivered.
+ Executables can be isolated at run-time if necessary. Shared
+ libraries are a different problem. They may bring their own
+ library dependencies that affect link- and run-time symbol
+ resolution and they'll impose that on us according to platform
+ rules.
+
+ So, what to do? My natural bias for large software is to use
+ shared libraries for everything. It's a path to single-version
+ and singleton data and isolates namespaces and prevents
+ interactions. It also has some field serviceability benefits if
+ you need to debug some bizarre problem a user has.
+
+ But there's a local preference for static. Here, my
+ rules-of-thumb are:
+
+ * Static library used by default.
+
+ * Shared library where the library must be built shared.
+
+ * Shared library if that is the only means to enforce the
+ single-version and singleton-data requirements.
+
+ * Shared library *on a case-by-case basis* if the library is also
+ provided by the platform and some benefit is plausible. (An
+ example of this is freetype/fontconfig on Linux. The .so
+ versions we build with, and incompletely ship, are inferior in
+ behavior to the platform libraries. By being shared libraries,
+ the platform-supplied option is available to all Linux users.)
+
+ In all cases, beware of cmake which appears to collapse and move
+ library references in links. This can drastically affect symbol
+ resolution when there are multiple sources for a symbol.
+
+ General
+
+ VS 2013. The /Z7 flag is rumored to be somewhat broken in 2013.
+ But it also sounds like there are explicit controls to name .PDB
+ files associated with static archives. That would make this an
+ ideal time to switch to /Zi or /ZI everywhere with explicit naming
+ and bring all the .PDBs together.
+
+ The embedded browser technology (e.g. Qt4 with Webkit) is the
+ 800-pound gorilla in the viewer. When starting any major work,
+ decide what changes you need here as those changes will propagate
+ outwards forcing many other decisions (cf: /Zc:wchar_t- flag).
+
+ The current package structure (./include, ./lib/release,
+ ./lib/debug, etc.) really works against the conventions used by
+ configure-like programs. I wasted a lot of time getting each
+ library to work with our structure without having to go back to
+ automake/autoconf. For Linux and Mac (and even for Windows), a
+ structure like the following where each grouping is optional would
+ probably save some work:
+
+ ./debug/bin
+ /include
+ /lib
+ ./debug/shared/bin
+ /include
+ /lib
+ ./debug/static/bin
+ /include
+ /lib
+ ./release/bin
+ /include
+ /lib
+ ...
+
+ In zlib and openssl and in a few of the libraries that consume
+ them, I experimented with packaging both static and shared
+ libraries and then having the consumer library move the unwanted
+ pieces out of the way to use the library type of choice (see
+ restore_dylibs() and restore_sos() functions). It was a bit fussy
+ and simplicity and clarity are the keys to maintaining libraries
+ in the future.
+
+ But it did suggest another approach. The idea is that every build
+ pre-stages inputs. Before anything is built, package pieces are
+ copied or symlinked from the 'stage/packages' area to the
+ 'stage/input' area. Builds then proceed with a single set of
+ -I/-L options for the dependencies. And products are built and
+ installed in a similar output staging structure for the next
+ consumer:
+
+ stage/packages/<package>/[above structure]
+ stage/input/{bin,include,lib}
+ stage/<package>/[above structure]
+
+ Next library project. I'd recommend working on the related set of
+ libexpat, apr, aprutil, xmlrpc-epi. We know libexpat has some
+ updates that should improve stability. Libapr consumes it and it
+ could use some /Z7 flag work to get rid of some 1000's of PDB
+ warnings and improve our debug symbols.
+
+ Miscellany to be sorted out:
+
+ * The packaging of libfreetype and libfontconfig on Linux.
+ Determine what the right thing is, do it.
+
+ * Maybe do something with ICU4C. Qt5 will require it and a number
+ of our packages can consume it typically replacing iconv or some
+ other library. But it is a huge bolus of static data. It can be
+ trimmed, but still.
+
+ * Revisit openssl. Package as a shared library? Replace with
+ LibreSSL when available? Start using platform-supplied crypto?
+
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 6a0f7a214c..52b0f4e8b4 100755
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -62,7 +62,7 @@ if (WINDOWS)
add_definitions(
/DLL_WINDOWS=1
/DNOMINMAX
- /DDOM_DYNAMIC
+# /DDOM_DYNAMIC # For shared library colladadom
/DUNICODE
/D_UNICODE
/GS
diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake
index 50ac27d402..25e54b7cbd 100755
--- a/indra/cmake/Boost.cmake
+++ b/indra/cmake/Boost.cmake
@@ -8,6 +8,7 @@ if (USESYSTEMLIBS)
include(FindBoost)
set(BOOST_CONTEXT_LIBRARY boost_context-mt)
+ set(BOOST_COROUTINE_LIBRARY boost_coroutine-mt)
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
set(BOOST_REGEX_LIBRARY boost_regex-mt)
@@ -17,10 +18,11 @@ if (USESYSTEMLIBS)
else (USESYSTEMLIBS)
use_prebuilt_binary(boost)
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
- set(BOOST_VERSION "1.52")
+ set(BOOST_VERSION "1.55")
if (WINDOWS)
if(MSVC80)
+ # This should be obsolete at this point
set(BOOST_CONTEXT_LIBRARY
optimized libboost_context-vc80-mt-${BOOST_VERSION}
debug libboost_context-vc80-mt-gd-${BOOST_VERSION})
@@ -47,6 +49,9 @@ else (USESYSTEMLIBS)
set(BOOST_CONTEXT_LIBRARY
optimized libboost_context-mt
debug libboost_context-mt-gd)
+ set(BOOST_COROUTINE_LIBRARY
+ optimized libboost_coroutine-mt
+ debug libboost_coroutine-mt-gd)
set(BOOST_FILESYSTEM_LIBRARY
optimized libboost_filesystem-mt
debug libboost_filesystem-mt-gd)
@@ -70,6 +75,9 @@ else (USESYSTEMLIBS)
set(BOOST_CONTEXT_LIBRARY
optimized boost_context-mt
debug boost_context-mt-d)
+ set(BOOST_COROUTINE_LIBRARY
+ optimized boost_coroutine-mt
+ debug boost_coroutine-mt-d)
set(BOOST_FILESYSTEM_LIBRARY
optimized boost_filesystem-mt
debug boost_filesystem-mt-d)
@@ -92,6 +100,9 @@ else (USESYSTEMLIBS)
set(BOOST_CONTEXT_LIBRARY
optimized boost_context-mt
debug boost_context-mt-d)
+ set(BOOST_COROUTINE_LIBRARY
+ optimized boost_coroutine-mt
+ debug boost_coroutine-mt-d)
set(BOOST_FILESYSTEM_LIBRARY
optimized boost_filesystem-mt
debug boost_filesystem-mt-d)
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 4f1b6640c2..28202f85d6 100755
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -40,7 +40,6 @@ if(WINDOWS)
libapriconv-1.dll
ssleay32.dll
libeay32.dll
- libcollada14dom22-d.dll
glod.dll
libhunspell.dll
)
@@ -53,7 +52,6 @@ if(WINDOWS)
libapriconv-1.dll
ssleay32.dll
libeay32.dll
- libcollada14dom22.dll
glod.dll
libhunspell.dll
)
@@ -213,15 +211,12 @@ elseif(DARWIN)
libapr-1.dylib
libaprutil-1.0.dylib
libaprutil-1.dylib
+ libexception_handler.dylib
libexpat.1.5.2.dylib
libexpat.dylib
libGLOD.dylib
- libllqtwebkit.dylib
- libminizip.a
- libndofdev.dylib
libhunspell-1.3.0.dylib
- libexception_handler.dylib
- libcollada14dom.dylib
+ libndofdev.dylib
)
if (FMODEX)
@@ -259,35 +254,21 @@ elseif(LINUX)
libapr-1.so.0
libaprutil-1.so.0
libatk-1.0.so
- libboost_context-mt.so.${BOOST_VERSION}.0
- libboost_filesystem-mt.so.${BOOST_VERSION}.0
- libboost_program_options-mt.so.${BOOST_VERSION}.0
- libboost_regex-mt.so.${BOOST_VERSION}.0
- libboost_signals-mt.so.${BOOST_VERSION}.0
- libboost_system-mt.so.${BOOST_VERSION}.0
- libboost_thread-mt.so.${BOOST_VERSION}.0
- libcollada14dom.so
- libcrypto.so.1.0.0
libdb-5.1.so
libexpat.so
libexpat.so.1
+ libfreetype.so.6.6.2
libfreetype.so.6
libGLOD.so
- libgmock_main.so
- libgmock.so.0
libgmodule-2.0.so
libgobject-2.0.so
- libgtest_main.so
- libgtest.so.0
libhunspell-1.3.so.0.0.0
- libminizip.so
libopenal.so
libopenjpeg.so
- libssl.so
libuuid.so.16
libuuid.so.16.0.22
- libssl.so.1.0.0
- libfontconfig.so.1.4.4
+ libfontconfig.so.1.8.0
+ libfontconfig.so.1
)
if (USE_TCMALLOC)
diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake
index 02c5b37f28..a36485f6d0 100755
--- a/indra/cmake/FreeType.cmake
+++ b/indra/cmake/FreeType.cmake
@@ -7,7 +7,7 @@ if (USESYSTEMLIBS)
pkg_check_modules(FREETYPE REQUIRED freetype2)
else (USESYSTEMLIBS)
use_prebuilt_binary(freetype)
- set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
+ set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/freetype2/)
set(FREETYPE_LIBRARIES freetype)
endif (USESYSTEMLIBS)
diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake
index c4c96a9af7..cac072988e 100755
--- a/indra/cmake/GoogleMock.cmake
+++ b/indra/cmake/GoogleMock.cmake
@@ -2,7 +2,7 @@
include(Prebuilt)
include(Linking)
-use_prebuilt_binary(googlemock)
+use_prebuilt_binary(gmock)
set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include)
diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake
index 67c2115237..93626f689f 100755
--- a/indra/cmake/LLPrimitive.cmake
+++ b/indra/cmake/LLPrimitive.cmake
@@ -6,32 +6,40 @@ include(Boost)
use_prebuilt_binary(colladadom)
use_prebuilt_binary(pcre)
+use_prebuilt_binary(libxml2)
set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive
)
if (WINDOWS)
- set(LLPRIMITIVE_LIBRARIES
+ set(LLPRIMITIVE_LIBRARIES
debug llprimitive
optimized llprimitive
- debug libcollada14dom22-d
- optimized libcollada14dom22
+ debug libcollada14dom23-sd
+ optimized libcollada14dom23-s
+ libxml2_a
+ debug pcrecppd
+ optimized pcrecpp
+ debug pcred
+ optimized pcre
${BOOST_SYSTEM_LIBRARIES}
)
-elseif (LINUX)
- use_prebuilt_binary(libxml2)
- set(LLPRIMITIVE_LIBRARIES
+elseif (DARWIN)
+ set(LLPRIMITIVE_LIBRARIES
llprimitive
- collada14dom
+ debug collada14dom-d
+ optimized collada14dom
minizip
xml2
pcrecpp
pcre
+ iconv # Required by libxml2
)
-else (WINDOWS)
- set(LLPRIMITIVE_LIBRARIES
+elseif (LINUX)
+ set(LLPRIMITIVE_LIBRARIES
llprimitive
- collada14dom
+ debug collada14dom-d
+ optimized collada14dom
minizip
xml2
pcrecpp
diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake
index b9c9e531fc..74fe3f1137 100755
--- a/indra/cmake/Linking.cmake
+++ b/indra/cmake/Linking.cmake
@@ -6,6 +6,7 @@ set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(Variables)
set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib)
+set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins)
set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug)
if (WINDOWS)
diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake
index 5b469f74f9..eb548bdcc1 100755
--- a/indra/cmake/OpenSSL.cmake
+++ b/indra/cmake/OpenSSL.cmake
@@ -7,7 +7,7 @@ set(OpenSSL_FIND_REQUIRED ON)
if (USESYSTEMLIBS)
include(FindOpenSSL)
else (USESYSTEMLIBS)
- use_prebuilt_binary(openSSL)
+ use_prebuilt_binary(openssl)
if (WINDOWS)
set(OPENSSL_LIBRARIES ssleay32 libeay32)
else (WINDOWS)
@@ -17,7 +17,7 @@ else (USESYSTEMLIBS)
endif (USESYSTEMLIBS)
if (LINUX)
- set(CRYPTO_LIBRARIES crypto)
+ set(CRYPTO_LIBRARIES crypto dl)
elseif (DARWIN)
set(CRYPTO_LIBRARIES crypto)
endif (LINUX)
diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake
index 173d59391e..248a875a19 100755
--- a/indra/cmake/PNG.cmake
+++ b/indra/cmake/PNG.cmake
@@ -9,13 +9,26 @@ if (USESYSTEMLIBS)
else (USESYSTEMLIBS)
use_prebuilt_binary(libpng)
if (WINDOWS)
- set(PNG_LIBRARIES libpng15)
- set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
+ set(PNG_LIBRARIES libpng16)
+ set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16)
elseif(DARWIN)
- set(PNG_LIBRARIES png15)
- set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
+ set(PNG_LIBRARIES png16)
+ set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16)
else()
- set(PNG_LIBRARIES png15)
- set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
+ #
+ # When we have updated static libraries in competition with older
+ # shared libraries and we want the former to win, we need to do some
+ # extra work. The *_PRELOAD_ARCHIVES settings are invoked early
+ # and will pull in the entire archive to the binary giving it
+ # priority in symbol resolution. Beware of cmake moving the
+ # achive load itself to another place on the link command line. If
+ # that happens, you can try something like -Wl,-lpng16 here to hide
+ # the archive. Also be aware that the linker will not tolerate a
+ # second whole-archive load of the archive. See viewer's
+ # CMakeLists.txt for more information.
+ #
+ set(PNG_PRELOAD_ARCHIVES -Wl,--whole-archive png16 -Wl,--no-whole-archive)
+ set(PNG_LIBRARIES png16)
+ set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16)
endif()
endif (USESYSTEMLIBS)
diff --git a/indra/cmake/WebKitLibPlugin.cmake b/indra/cmake/WebKitLibPlugin.cmake
index 76f2c148db..f7c548a2fd 100755
--- a/indra/cmake/WebKitLibPlugin.cmake
+++ b/indra/cmake/WebKitLibPlugin.cmake
@@ -1,6 +1,7 @@
# -*- cmake -*-
include(Linking)
include(Prebuilt)
+include(OpenSSL)
if (USESYSTEMLIBS)
# The minimal version, 4.4.3, is rather arbitrary: it's the version in Debian/Lenny.
@@ -36,27 +37,32 @@ endif (USESYSTEMLIBS)
if (WINDOWS)
set(WEBKIT_PLUGIN_LIBRARIES
- debug llqtwebkitd
- debug QtWebKitd4
- debug QtOpenGLd4
- debug QtNetworkd4
- debug QtGuid4
- debug QtCored4
- debug qtmaind
- optimized llqtwebkit
- optimized QtWebKit4
- optimized QtOpenGL4
- optimized QtNetwork4
- optimized QtGui4
- optimized QtCore4
- optimized qtmain
+ debug llqtwebkitd
+ debug QtWebKitd4
+ debug QtOpenGLd4
+ debug QtNetworkd4
+ debug QtGuid4
+ debug QtCored4
+ debug qtmaind
+ optimized llqtwebkit
+ optimized QtWebKit4
+ optimized QtOpenGL4
+ optimized QtNetwork4
+ optimized QtGui4
+ optimized QtCore4
+ optimized qtmain
)
elseif (DARWIN)
set(WEBKIT_PLUGIN_LIBRARIES
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
- debug ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
- )
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.a
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libQtWebKit.4.dylib
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libQtOpenGL.4.dylib
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libQtNetwork.4.dylib
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libQtGui.4.dylib
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libQtCore.4.dylib
+ )
elseif (LINUX)
+ # *HUH: What does this do?
set(WEBKIT_PLUGIN_LIBRARIES ${LLQTWEBKIT_LIBRARY} ${QT_LIBRARIES} ${QT_PLUGIN_LIBRARIES})
set(WEBKIT_PLUGIN_LIBRARIES
llqtwebkit
@@ -68,9 +74,10 @@ elseif (LINUX)
QtWebKit
QtOpenGL
QtNetwork
+ ${OPENSSL_LIBRARIES}
QtGui
QtCore
- jscore
+# jscore
# qgif
# qjpeg
# jpeg
diff --git a/indra/cmake/ZLIB.cmake b/indra/cmake/ZLIB.cmake
index b99a8644c9..6cff0753b2 100755
--- a/indra/cmake/ZLIB.cmake
+++ b/indra/cmake/ZLIB.cmake
@@ -13,10 +13,23 @@ else (USESYSTEMLIBS)
set(ZLIB_LIBRARIES
debug zlibd
optimized zlib)
- else (WINDOWS)
+ elseif (LINUX)
+ #
+ # When we have updated static libraries in competition with older
+ # shared libraries and we want the former to win, we need to do some
+ # extra work. The *_PRELOAD_ARCHIVES settings are invoked early
+ # and will pull in the entire archive to the binary giving it
+ # priority in symbol resolution. Beware of cmake moving the
+ # achive load itself to another place on the link command line. If
+ # that happens, you can try something like -Wl,-lz here to hide
+ # the archive. Also be aware that the linker will not tolerate a
+ # second whole-archive load of the archive. See viewer's
+ # CMakeLists.txt for more information.
+ #
+ set(ZLIB_PRELOAD_ARCHIVES -Wl,--whole-archive z -Wl,--no-whole-archive)
+ set(ZLIB_LIBRARIES z)
+ elseif (DARWIN)
set(ZLIB_LIBRARIES z)
endif (WINDOWS)
- if (WINDOWS OR LINUX)
- set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/zlib)
- endif (WINDOWS OR LINUX)
+ set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/zlib)
endif (USESYSTEMLIBS)