From b276159bfadc50b488d9668409f5237edfd72d51 Mon Sep 17 00:00:00 2001
From: Drake Arconis <drake@alchemyviewer.org>
Date: Wed, 25 Feb 2015 17:17:02 -0500
Subject: [PATCH] Unbreak the build

---
 autobuild.xml                   | 106 +++++++++++++++++++-------------
 indra/cmake/FindURIPARSER.cmake |   6 +-
 indra/cmake/URIPARSER.cmake     |  21 +------
 indra/llcommon/CMakeLists.txt   |   2 +-
 indra/newview/CMakeLists.txt    |   2 +-
 indra/newview/llviewermenu.cpp  |   2 +-
 6 files changed, 72 insertions(+), 67 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 83a9eeb537..914442be01 100755
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -3379,51 +3379,71 @@
       </map>
       <key>uriparser</key>
       <map>
-          <key>license</key>
-          <string>uriparser</string>
-          <key>license_file</key>
-          <string>LICENSES/uriparser.txt</string>
-          <key>name</key>
-          <string>uriparser</string>
-          <key>platforms</key>
+        <key>copyright</key>
+        <string>Copyright (C) 2007, Weijia Song &lt;songweijia@gmail.com&gt;, Sebastian Pipping &lt;webmaster@hartwork.org&gt;</string>
+        <key>description</key>
+        <string>uriparser is a strictly RFC 3986 compliant URI parsing and handling library written in C. uriparser is cross-platform, fast, supports Unicode and is licensed under the New BSD license.</string>
+        <key>license</key>
+        <string>New BSD license</string>
+        <key>license_file</key>
+        <string>LICENSES/uriparser.txt</string>
+        <key>name</key>
+        <string>uriparser</string>
+        <key>platforms</key>
+        <map>
+          <key>darwin</key>
           <map>
-              <key>darwin</key>
-              <map>
-                  <key>archive</key>
-                  <map>
-                      <key>hash</key>
-                      <string>99c5a966ac74eea5a505317396152168</string>
-                      <key>url</key>
-                      <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-uriparser/rev/294299/arch/Darwin/installer/uriparser-0.8.0.1-darwin-20140917.tar.bz2</string>
-                  </map>
-                  <key>name</key>
-                  <string>darwin</string>
-              </map>
-              <key>linux</key>
-              <map>
-                  <key>archive</key>
-                  <map>
-                      <key>hash</key>
-                      <string>34306fb90364b182dc770375140d8557</string>
-                      <key>url</key>
-                      <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-uriparser/rev/294298/arch/Linux/installer/uriparser-0.8.0.1-linux-20140918.tar.bz2</string>
-                  </map>
-                  <key>name</key>
-                  <string>linux</string>
-              </map>
-              <key>windows</key>
-              <map>
-                  <key>archive</key>
-                  <map>
-                      <key>hash</key>
-                      <string>73817db47bc0f87269861b7887319414</string>
-                      <key>url</key>
-                      <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-uriparser/rev/294274/arch/CYGWIN/installer/uriparser-0.8.0.1-windows-20140917.tar.bz2</string>
-                  </map>
-                  <key>name</key>
-                  <string>windows</string>
-              </map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>99c5a966ac74eea5a505317396152168</string>
+              <key>url</key>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-uriparser/rev/294299/arch/Darwin/installer/uriparser-0.8.0.1-darwin-20140917.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>darwin</string>
+          </map>
+          <key>linux</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>34306fb90364b182dc770375140d8557</string>
+              <key>url</key>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-uriparser/rev/294298/arch/Linux/installer/uriparser-0.8.0.1-linux-20140918.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>linux</string>
+          </map>
+          <key>windows</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>73817db47bc0f87269861b7887319414</string>
+              <key>url</key>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-uriparser/rev/294274/arch/CYGWIN/installer/uriparser-0.8.0.1-windows-20140917.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>windows</string>
           </map>
+          <key>windows64</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>a70e7e0a6ca9172b91c6e661a13f5110</string>
+              <key>hash_algorithm</key>
+              <string>md5</string>
+              <key>url</key>
+              <string>https://bitbucket.org/alchemyviewer/publiclibs-vs12/downloads/uriparser-0.8.1-windows64-201502250709.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>windows64</string>
+          </map>
+        </map>
+        <key>version</key>
+        <string>0.8.1</string>
       </map>
       <key>xmlrpc-epi</key>
       <map>
diff --git a/indra/cmake/FindURIPARSER.cmake b/indra/cmake/FindURIPARSER.cmake
index 8ab9f0f4ed..4f67dbcf43 100644
--- a/indra/cmake/FindURIPARSER.cmake
+++ b/indra/cmake/FindURIPARSER.cmake
@@ -4,7 +4,7 @@
 # Find the URIPARSER includes and library
 # This module defines
 #  URIPARSER_INCLUDE_DIRS, where to find uriparser.h, etc.
-#  URIPARSER_LIBRARIES, the libraries needed to use uriparser.
+#  URIPARSER_LIBRARY, the libraries needed to use uriparser.
 #  URIPARSER_FOUND, If false, do not try to use uriparser.
 #
 # This FindURIPARSER is about 43 times as fast the one provided with cmake (2.8.x),
@@ -22,7 +22,7 @@ FIND_LIBRARY(URIPARSER_LIBRARY uriparser)
 
 if (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
   SET(URIPARSER_INCLUDE_DIRS ${URIPARSER_INCLUDE_DIR})
-  SET(URIPARSER_LIBRARIES ${URIPARSER_LIBRARY})
+  SET(URIPARSER_LIBRARY ${URIPARSER_LIBRARY})
   SET(URIPARSER_FOUND "YES")
 else (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
   SET(URIPARSER_FOUND "NO")
@@ -30,7 +30,7 @@ endif (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
 
 if (URIPARSER_FOUND)
   if (NOT URIPARSER_FIND_QUIETLY)
-    message(STATUS "Found URIPARSER: ${URIPARSER_LIBRARIES}")
+    message(STATUS "Found URIPARSER: ${URIPARSER_LIBRARY}")
     SET(URIPARSER_FIND_QUIETLY TRUE)
   endif (NOT URIPARSER_FIND_QUIETLY)
 else (URIPARSER_FOUND)
diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake
index de146885a0..47c3ccd376 100644
--- a/indra/cmake/URIPARSER.cmake
+++ b/indra/cmake/URIPARSER.cmake
@@ -10,26 +10,11 @@ if (USESYSTEMLIBS)
 else (USESYSTEMLIBS)
   use_prebuilt_binary(uriparser)
   if (WINDOWS)
-    set(URIPARSER_LIBRARIES
+    set(URIPARSER_LIBRARY
       debug uriparserd
       optimized uriparser)
-  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,-luriparser 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(URIPARSER_PRELOAD_ARCHIVES -Wl,--whole-archive uriparser -Wl,--no-whole-archive)
-    set(URIPARSER_LIBRARIES uriparser)
-  elseif (DARWIN)
-    set(URIPARSER_LIBRARIES uriparser)
+  elseif (DARWIN OR LINUX)
+    set(URIPARSER_LIBRARY uriparser)
   endif (WINDOWS)
   set(URIPARSER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/uriparser)
 endif (USESYSTEMLIBS)
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 765f25d3a2..477b2cb1f2 100755
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -281,7 +281,7 @@ target_link_libraries(
     ${BOOST_THREAD_LIBRARY}
     ${BOOST_SYSTEM_LIBRARY}
     ${GOOGLE_PERFTOOLS_LIBRARIES}
-    ${URIPARSER_LIBRARIES}
+    ${URIPARSER_LIBRARY}
     )
 
 add_dependencies(llcommon stage_third_party_libs)
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index dab709b290..bb2a4b8466 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2038,7 +2038,6 @@ endif (WINDOWS)
 target_link_libraries(${VIEWER_BINARY_NAME}
     ${PNG_PRELOAD_ARCHIVES}
     ${ZLIB_PRELOAD_ARCHIVES}
-    ${URIPARSER_PRELOAD_ARCHIVES}
     ${UPDATER_LIBRARIES}
     ${GOOGLE_PERFTOOLS_LIBRARIES}
     ${LLAUDIO_LIBRARIES}
@@ -2059,6 +2058,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
     ${LLCOMMON_LIBRARIES}
     ${NDOF_LIBRARY}
     ${NVAPI_LIBRARY}
+    ${URIPARSER_LIBRARY}
     ${HUNSPELL_LIBRARY}
     ${viewer_LIBRARIES}
     ${BOOST_PROGRAM_OPTIONS_LIBRARY}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 9ddd35b1d7..de2db02e4b 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -3713,7 +3713,7 @@ class LLSelfSitDown : public view_listener_t
 
 bool enable_sitdown_self()
 {
-    return isAgentAvatarValid() && && !gAgentAvatarp->isEditingAppearance() && !gAgent.getFlying();
+    return isAgentAvatarValid() && !gAgentAvatarp->isEditingAppearance() && !gAgent.getFlying();
 }
 
 class LLCheckPanelPeopleTab : public view_listener_t
-- 
GitLab