From 586d878ef5c415ebf711e5b3a5ad220e9671e50b Mon Sep 17 00:00:00 2001 From: callum_linden Date: Mon, 12 Nov 2012 16:55:20 -0800 Subject: First round of fixes to make viewer work with Boost 1.52 --- indra/cmake/Boost.cmake | 10 +++++----- indra/llvfs/lldiriterator.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 2135f0584c..6b5af44a99 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -17,7 +17,7 @@ else (STANDALONE) set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) if (WINDOWS) - set(BOOST_VERSION 1_45) + set(BOOST_VERSION 1_52) if(MSVC80) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized libboost_program_options-vc80-mt-${BOOST_VERSION} @@ -50,9 +50,9 @@ else (STANDALONE) debug libboost_filesystem-vc100-mt-gd-${BOOST_VERSION}) endif (MSVC80) elseif (DARWIN OR LINUX) - set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options) - set(BOOST_REGEX_LIBRARY boost_regex) - set(BOOST_SYSTEM_LIBRARY boost_system) - set(BOOST_FILESYSTEM_LIBRARY boost_filesystem) + set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) + set(BOOST_REGEX_LIBRARY boost_regex-mt) + set(BOOST_SYSTEM_LIBRARY boost_system-mt) + set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt) endif (WINDOWS) endif (STANDALONE) diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index ff92cbb7fd..fa806bf23e 100644 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -59,7 +59,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) { is_dir = fs::is_directory(dir_path); } - catch (fs::basic_filesystem_error& e) + catch (const fs::filesystem_error& e) { llwarns << e.what() << llendl; return; @@ -76,7 +76,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) { mIter = fs::directory_iterator(dir_path); } - catch (fs::basic_filesystem_error& e) + catch (const fs::filesystem_error& e) { llwarns << e.what() << llendl; return; @@ -121,7 +121,7 @@ bool LLDirIterator::Impl::next(std::string &fname) while (mIter != end_itr && !found) { boost::smatch match; - std::string name = mIter->path().filename(); + std::string name = mIter->path().filename().string(); if (found = boost::regex_match(name, match, mFilterExp)) { fname = name; -- cgit v1.2.3 From f4d30bd1ed7a175f659f5460ee4a78c332974cec Mon Sep 17 00:00:00 2001 From: callum_linden Date: Tue, 13 Nov 2012 14:25:01 -0800 Subject: Update Windows lib names for new Boost package --- indra/cmake/Boost.cmake | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 6b5af44a99..b857822071 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -17,8 +17,8 @@ else (STANDALONE) set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) if (WINDOWS) - set(BOOST_VERSION 1_52) if(MSVC80) + set(BOOST_VERSION 1_52) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized libboost_program_options-vc80-mt-${BOOST_VERSION} debug libboost_program_options-vc80-mt-gd-${BOOST_VERSION}) @@ -37,17 +37,17 @@ else (STANDALONE) else(MSVC80) # MSVC 10.0 config set(BOOST_PROGRAM_OPTIONS_LIBRARY - optimized libboost_program_options-vc100-mt-${BOOST_VERSION} - debug libboost_program_options-vc100-mt-gd-${BOOST_VERSION}) + optimized libboost_program_options-mt + debug libboost_program_options-mt-gd) set(BOOST_REGEX_LIBRARY - optimized libboost_regex-vc100-mt-${BOOST_VERSION} - debug libboost_regex-vc100-mt-gd-${BOOST_VERSION}) + optimized libboost_regex-mt} + debug libboost_regex-mt-gd) set(BOOST_SYSTEM_LIBRARY - optimized libboost_system-vc100-mt-${BOOST_VERSION} - debug libboost_system-vc100-mt-gd-${BOOST_VERSION}) + optimized libboost_system-mt} + debug libboost_system-mt-gd) set(BOOST_FILESYSTEM_LIBRARY - optimized libboost_filesystem-vc100-mt-${BOOST_VERSION} - debug libboost_filesystem-vc100-mt-gd-${BOOST_VERSION}) + optimized libboost_filesystem-mt} + debug libboost_filesystem-mt-gd) endif (MSVC80) elseif (DARWIN OR LINUX) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) -- cgit v1.2.3 From dfdab39c5e1933b3bada15035a5aff2882eb479d Mon Sep 17 00:00:00 2001 From: callum_linden Date: Tue, 13 Nov 2012 14:58:43 -0800 Subject: Stupid typo in Boost Cmake file --- indra/cmake/Boost.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index b857822071..8c0dfe4fb2 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -40,13 +40,13 @@ else (STANDALONE) optimized libboost_program_options-mt debug libboost_program_options-mt-gd) set(BOOST_REGEX_LIBRARY - optimized libboost_regex-mt} + optimized libboost_regex-mt debug libboost_regex-mt-gd) set(BOOST_SYSTEM_LIBRARY - optimized libboost_system-mt} + optimized libboost_system-mt debug libboost_system-mt-gd) set(BOOST_FILESYSTEM_LIBRARY - optimized libboost_filesystem-mt} + optimized libboost_filesystem-mt debug libboost_filesystem-mt-gd) endif (MSVC80) elseif (DARWIN OR LINUX) -- cgit v1.2.3 From 8edd1c72be078977c045792c815defc324fb2696 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 15 Nov 2012 21:31:32 -0500 Subject: Remove Boost version "1_45" baked into library names. On Windows, LLPrimitive.cmake named four Boost libraries with names ending in the string 1_45. Now that we're trying to upgrade Boost to 1.52, those suffixes are inappropriate. Fortunately the libraries in our current Boost package do not have version-stamped names, so we hope this fix can survive for several Boost upgrades to come. --- indra/cmake/LLPrimitive.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index f15a2c2649..ab39cbb6be 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -15,10 +15,10 @@ if (WINDOWS) optimized llprimitive debug libcollada14dom22-d optimized libcollada14dom22 - debug libboost_filesystem-vc100-mt-gd-1_45 - optimized libboost_filesystem-vc100-mt-1_45 - debug libboost_system-vc100-mt-gd-1_45 - optimized libboost_system-vc100-mt-1_45 + debug libboost_filesystem-mt-gd + optimized libboost_filesystem-mt + debug libboost_system-mt-gd + optimized libboost_system-mt ) else (WINDOWS) set(LLPRIMITIVE_LIBRARIES -- cgit v1.2.3 From 3581bba2822cf995423fdb8cc82af118a7808ac9 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 16 Nov 2012 15:39:58 -0500 Subject: Fix Boost shared-library version suffixes in Copy3rdPartyLibs.cmake. --- indra/cmake/Boost.cmake | 2 +- indra/cmake/Copy3rdPartyLibs.cmake | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index dfa59bcb7e..1acb2bbbfd 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -16,10 +16,10 @@ if (STANDALONE) else (STANDALONE) use_prebuilt_binary(boost) set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + set(BOOST_VERSION "1.52") if (WINDOWS) if(MSVC80) - set(BOOST_VERSION 1_52) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized libboost_program_options-vc80-mt-${BOOST_VERSION} debug libboost_program_options-vc80-mt-gd-${BOOST_VERSION}) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index a5483ba678..c32e357da3 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -254,12 +254,12 @@ elseif(LINUX) libapr-1.so.0 libaprutil-1.so.0 libatk-1.0.so - libboost_program_options-mt.so.1.48.0 - libboost_regex-mt.so.1.48.0 - libboost_thread-mt.so.1.48.0 - libboost_filesystem-mt.so.1.48.0 - libboost_signals-mt.so.1.48.0 - libboost_system-mt.so.1.48.0 + libboost_program_options-mt.so.${BOOST_VERSION}.0 + libboost_regex-mt.so.${BOOST_VERSION}.0 + libboost_thread-mt.so.${BOOST_VERSION}.0 + libboost_filesystem-mt.so.${BOOST_VERSION}.0 + libboost_signals-mt.so.${BOOST_VERSION}.0 + libboost_system-mt.so.${BOOST_VERSION}.0 libbreakpad_client.so.0 libcollada14dom.so libcrypto.so.1.0.0 -- cgit v1.2.3 From 184b81aac47038f06c3eafd6cdd9b4ad7c4bc7b5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 16 Nov 2012 17:05:32 -0500 Subject: Remove sensitivity to Boost library versions in viewer_manifest.py. --- indra/newview/viewer_manifest.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 86f978faf1..ea75d4f4f6 100644 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1065,12 +1065,12 @@ class Linux_i686Manifest(LinuxManifest): self.path("libaprutil-1.so") self.path("libaprutil-1.so.0") self.path("libaprutil-1.so.0.4.1") - self.path("libboost_program_options-mt.so.1.48.0") - self.path("libboost_regex-mt.so.1.48.0") - self.path("libboost_thread-mt.so.1.48.0") - self.path("libboost_filesystem-mt.so.1.48.0") - self.path("libboost_signals-mt.so.1.48.0") - self.path("libboost_system-mt.so.1.48.0") + self.path("libboost_program_options-mt.so.*") + self.path("libboost_regex-mt.so.*") + self.path("libboost_thread-mt.so.*") + self.path("libboost_filesystem-mt.so.*") + self.path("libboost_signals-mt.so.*") + self.path("libboost_system-mt.so.*") self.path("libbreakpad_client.so.0.0.0") self.path("libbreakpad_client.so.0") self.path("libbreakpad_client.so") -- cgit v1.2.3 From 8fc651d06776a8edf8e5af7b86d11a1c83cbbbf0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 16 Nov 2012 17:56:30 -0500 Subject: Boost 1.52 no longer supports Boost.Filesystem v2 -- don't request. Instead of compatibility mode, #defining BOOST_FILESYSTEM_VERSION to 2 only gets you a compile error these days. --- indra/llcommon/linden_common.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h index f0a5603d06..5cfcdab41c 100644 --- a/indra/llcommon/linden_common.h +++ b/indra/llcommon/linden_common.h @@ -59,8 +59,4 @@ #include "llerror.h" #include "llfile.h" -// Boost 1.45 had version 2 as the default for the filesystem library, -// 1.48 has version 3 as the default. Keep compatibility for now. -#define BOOST_FILESYSTEM_VERSION 2 - #endif -- cgit v1.2.3 From 4d1b62f46be4322333e57fd09a195a51de7c7bf5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 16 Nov 2012 18:04:07 -0500 Subject: Certain test and example programs now need the Boost.System library. --- indra/llcorehttp/CMakeLists.txt | 2 ++ indra/newview/CMakeLists.txt | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'indra') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 8632a2b722..82fb3f0d4e 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -130,6 +130,7 @@ if (LL_TESTS) ${CARES_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES} + ${BOOST_SYSTEM_LIBRARY} ${BOOST_THREAD_LIBRARY} ) @@ -157,6 +158,7 @@ if (LL_TESTS) ${CARES_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES} + ${BOOST_SYSTEM_LIBRARY} ${BOOST_THREAD_LIBRARY} ) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 7eea9ece5a..8f9b887538 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2079,6 +2079,12 @@ if (LL_TESTS) LL_TEST_ADDITIONAL_LIBRARIES "${JSONCPP_LIBRARIES}" ) + set_source_files_properties( + lllogininstance.cpp + PROPERTIES + LL_TEST_ADDITIONAL_LIBRARIES "${BOOST_SYSTEM_LIBRARY}" + ) + ################################################## # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS ################################################## -- cgit v1.2.3 From aaf96507a15196145d903764dc905d8d6e7df7b0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 16 Nov 2012 18:08:40 -0500 Subject: Some Mac header #defines macros like check and equivalent -- gack!! Given that third-party libraries (such as Boost) can and do use those names, properly namespace-scoped, it's unpardonable to break any such innocent usage with a macro. Given the pervasiveness of the need, introduce a header file with the requisite #undef directives. --- indra/llcommon/CMakeLists.txt | 1 + indra/llcommon/fix_macros.h | 25 +++++++++++++++++++++++++ indra/llcorehttp/_refcounted.h | 1 + indra/llvfs/lldiriterator.cpp | 1 + indra/llwindow/llwindowmacosx.h | 2 +- indra/llwindow/llwindowsdl.h | 2 +- indra/newview/lldirpicker.h | 2 +- indra/newview/llfilepicker.h | 2 +- indra/newview/lllocalbitmaps.cpp | 4 +--- indra/newview/macutil_Prefix.h | 2 +- 10 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 indra/llcommon/fix_macros.h (limited to 'indra') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 36a8319189..66e2bc9095 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -116,6 +116,7 @@ set(llcommon_HEADER_FILES bitpack.h ctype_workaround.h doublelinkedlist.h + fix_macros.h imageids.h indra_constants.h linden_common.h diff --git a/indra/llcommon/fix_macros.h b/indra/llcommon/fix_macros.h new file mode 100644 index 0000000000..ef959decff --- /dev/null +++ b/indra/llcommon/fix_macros.h @@ -0,0 +1,25 @@ +/** + * @file fix_macros.h + * @author Nat Goodspeed + * @date 2012-11-16 + * @brief The Mac system headers seem to #define macros with obnoxiously + * generic names, preventing any library from using those names. We've + * had to fix these in so many places that it's worth making a header + * file to handle it. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Copyright (c) 2012, Linden Research, Inc. + * $/LicenseInfo$ + */ + +// DON'T use an #include guard: every time we encounter this header, #undef +// these macros all over again. + +// who injects MACROS with such generic names?! Grr. +#ifdef equivalent +#undef equivalent +#endif + +#ifdef check +#undef check +#endif diff --git a/indra/llcorehttp/_refcounted.h b/indra/llcorehttp/_refcounted.h index a96c65fb6b..21a916b13b 100644 --- a/indra/llcorehttp/_refcounted.h +++ b/indra/llcorehttp/_refcounted.h @@ -30,6 +30,7 @@ #include "linden_common.h" +#include "fix_macros.h" #include #include "llapr.h" diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index fa806bf23e..460d2a8b4f 100644 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -26,6 +26,7 @@ #include "lldiriterator.h" +#include "fix_macros.h" #include #include diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 52ba8b3bf3..af83b50097 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -36,8 +36,8 @@ #include // AssertMacros.h does bad things. +#include "fix_macros.h" #undef verify -#undef check #undef require diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 4e2a269ea3..c5ce892a04 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -41,8 +41,8 @@ #endif // AssertMacros.h does bad things. +#include "fix_macros.h" #undef verify -#undef check #undef require diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index 2188b7edd0..682f9d6476 100644 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -37,8 +37,8 @@ #include // AssertMacros.h does bad things. +#include "fix_macros.h" #undef verify -#undef check #undef require #include diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 55c665b9c7..4f602f63f1 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -39,8 +39,8 @@ #include // AssertMacros.h does bad things. +#include "fix_macros.h" #undef verify -#undef check #undef require #include diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 459e52c4f4..97ba5b634a 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -32,9 +32,7 @@ #include "lllocalbitmaps.h" /* boost: will not compile unless equivalent is undef'd, beware. */ -#ifdef equivalent -#undef equivalent -#endif +#include "fix_macros.h" #include /* image compression headers. */ diff --git a/indra/newview/macutil_Prefix.h b/indra/newview/macutil_Prefix.h index fd8e927a08..b54a764a62 100644 --- a/indra/newview/macutil_Prefix.h +++ b/indra/newview/macutil_Prefix.h @@ -33,7 +33,7 @@ */ #include +#include "fix_macros.h" -#undef check #undef verify #undef require -- cgit v1.2.3