diff options
62 files changed, 425 insertions, 411 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt index 9ce91bb8cb..a3ca5d5f58 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -688,6 +688,7 @@ Jonathan Yap  	STORM-1858  	STORM-1862  	STORM-1918 +	STORM-1915  	STORM-1929  	STORM-1953  	OPEN-161 diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 87484f4ae3..335dd89080 100755 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -173,12 +173,12 @@ if (LINUX)    endif (WORD_SIZE EQUAL 32)    add_definitions(-mfpmath=sse)    #add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2 -  if (NOT STANDALONE) +  if (NOT USESYSTEMLIBS)      # this stops us requiring a really recent glibc at runtime      add_definitions(-fno-stack-protector)      # linking can be very memory-hungry, especially the final viewer link      set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") -  endif (NOT STANDALONE) +  endif (NOT USESYSTEMLIBS)    set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}")    set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}") @@ -225,14 +225,14 @@ if (LINUX OR DARWIN)  endif (LINUX OR DARWIN) -if (STANDALONE) -  add_definitions(-DLL_STANDALONE=1) +if (USESYSTEMLIBS) +  add_definitions(-DLL_USESYSTEMLIBS=1)    if (LINUX AND ${ARCH} STREQUAL "i686")      add_definitions(-march=pentiumpro)    endif (LINUX AND ${ARCH} STREQUAL "i686") -else (STANDALONE) +else (USESYSTEMLIBS)    set(${ARCH}_linux_INCLUDES        ELFIO        atk-1.0 @@ -241,6 +241,6 @@ else (STANDALONE)        gtk-2.0        pango-1.0        ) -endif (STANDALONE) +endif (USESYSTEMLIBS)  endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index a87027f5f6..1a01671002 100755 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -8,9 +8,9 @@ set(APR_FIND_REQUIRED ON)  set(APRUTIL_FIND_QUIETLY ON)  set(APRUTIL_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindAPR) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(apr_suite)    if (WINDOWS)      if (LLCOMMON_LINK_SHARED) @@ -52,4 +52,4 @@ else (STANDALONE)        list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} uuid)      list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} rt)    endif (LINUX) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index d23bc2f9c6..876b7f82a8 100755 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -1,13 +1,13 @@  # -*- cmake -*-  include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindPkgConfig)    pkg_check_modules(OGG REQUIRED ogg)    pkg_check_modules(VORBIS REQUIRED vorbis)    pkg_check_modules(VORBISENC REQUIRED vorbisenc)    pkg_check_modules(VORBISFILE REQUIRED vorbisfile) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(ogg-vorbis)    set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)    set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) @@ -32,7 +32,7 @@ else (STANDALONE)      set(VORBISENC_LIBRARIES vorbisenc)      set(VORBISFILE_LIBRARIES vorbisfile)    endif (WINDOWS) -endif (STANDALONE) +endif (USESYSTEMLIBS)  link_directories(      ${VORBIS_LIBRARY_DIRS} diff --git a/indra/cmake/BerkeleyDB.cmake b/indra/cmake/BerkeleyDB.cmake index 57b53f46ff..5f6b644a15 100755 --- a/indra/cmake/BerkeleyDB.cmake +++ b/indra/cmake/BerkeleyDB.cmake @@ -3,9 +3,9 @@  set(DB_FIND_QUIETLY ON)  set(DB_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindBerkeleyDB) -else (STANDALONE) +else (USESYSTEMLIBS)    if (LINUX)      # Need to add dependency pthread explicitely to support ld.gold.      use_prebuilt_binary(db) @@ -14,4 +14,4 @@ else (STANDALONE)      set(DB_LIBRARIES db-4.2)    endif (LINUX)    set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index cff762e1f0..50ac27d402 100755 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -4,7 +4,7 @@ include(Prebuilt)  set(Boost_FIND_QUIETLY ON)  set(Boost_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindBoost)    set(BOOST_CONTEXT_LIBRARY boost_context-mt) @@ -14,7 +14,7 @@ if (STANDALONE)    set(BOOST_SIGNALS_LIBRARY boost_signals-mt)    set(BOOST_SYSTEM_LIBRARY boost_system-mt)    set(BOOST_THREAD_LIBRARY boost_thread-mt) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(boost)    set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)    set(BOOST_VERSION "1.52") @@ -111,4 +111,4 @@ else (STANDALONE)          optimized boost_thread-mt          debug boost_thread-mt-d)    endif (WINDOWS) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/CARes.cmake b/indra/cmake/CARes.cmake index b0dac5b12f..baa55aa49d 100755 --- a/indra/cmake/CARes.cmake +++ b/indra/cmake/CARes.cmake @@ -5,9 +5,9 @@ include(Prebuilt)  set(CARES_FIND_QUIETLY ON)  set(CARES_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindCARes) -else (STANDALONE) +else (USESYSTEMLIBS)      use_prebuilt_binary(ares)      add_definitions("-DCARES_STATICLIB")      if (WINDOWS) @@ -18,4 +18,4 @@ else (STANDALONE)          set(CARES_LIBRARIES cares)      endif (WINDOWS)      set(CARES_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/ares) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index 9aba08e573..04afae594d 100755 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -4,9 +4,9 @@ include(Prebuilt)  set(CURL_FIND_QUIETLY ON)  set(CURL_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindCURL) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(curl)    if (WINDOWS)      set(CURL_LIBRARIES  @@ -16,4 +16,4 @@ else (STANDALONE)      set(CURL_LIBRARIES libcurl.a)    endif (WINDOWS)    set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index f98e88b697..4f1b6640c2 100755 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -374,9 +374,9 @@ copy_if_different(      )  set(third_party_targets ${third_party_targets} ${out_targets}) -if(NOT STANDALONE) +if(NOT USESYSTEMLIBS)    add_custom_target(        stage_third_party_libs ALL        DEPENDS ${third_party_targets}        ) -endif(NOT STANDALONE) +endif(NOT USESYSTEMLIBS) diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake index 83c08d3350..d148a35a5b 100755 --- a/indra/cmake/DBusGlib.cmake +++ b/indra/cmake/DBusGlib.cmake @@ -1,7 +1,7 @@  # -*- cmake -*-  include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindPkgConfig)    pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) @@ -18,7 +18,7 @@ elseif (LINUX)        gobject-2.0        glib-2.0        ) -endif (STANDALONE) +endif (USESYSTEMLIBS)  if (DBUSGLIB_FOUND)    set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index acb15dc623..c1155531ff 100755 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -4,9 +4,9 @@ include(Prebuilt)  set(EXPAT_FIND_QUIETLY ON)  set(EXPAT_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindEXPAT) -else (STANDALONE) +else (USESYSTEMLIBS)      use_prebuilt_binary(expat)      if (WINDOWS)          set(EXPAT_LIBRARIES libexpatMT) @@ -14,4 +14,4 @@ else (STANDALONE)          set(EXPAT_LIBRARIES expat)      endif (WINDOWS)      set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/ExamplePlugin.cmake b/indra/cmake/ExamplePlugin.cmake index 599787ad21..5d826c1f66 100755 --- a/indra/cmake/ExamplePlugin.cmake +++ b/indra/cmake/ExamplePlugin.cmake @@ -2,13 +2,13 @@  include(Linking)  include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS)      set(EXAMPLEPLUGIN OFF CACHE BOOL          "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") -else (STANDALONE) +else (USESYSTEMLIBS)      set(EXAMPLEPLUGIN ON CACHE BOOL          "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") -endif (STANDALONE) +endif (USESYSTEMLIBS)  if (WINDOWS)  elseif (DARWIN) diff --git a/indra/cmake/FMODEX.cmake b/indra/cmake/FMODEX.cmake index 163260137b..4981bfb7a6 100644 --- a/indra/cmake/FMODEX.cmake +++ b/indra/cmake/FMODEX.cmake @@ -4,17 +4,17 @@  # When building using proprietary binaries though (i.e. having access to LL private servers),  # we always build with FMODEX.  # Open source devs should use the -DFMODEX:BOOL=ON then if they want to build with FMOD, whether -# they are using STANDALONE or not. +# they are using USESYSTEMLIBS or not.  if (INSTALL_PROPRIETARY)    set(FMODEX ON CACHE BOOL "Using FMOD Ex sound library.")  endif (INSTALL_PROPRIETARY)  if (FMODEX) -  if (STANDALONE) +  if (USESYSTEMLIBS)      # In that case, we use the version of the library installed on the system      set(FMODEX_FIND_REQUIRED ON)      include(FindFMODEX) -  else (STANDALONE) +  else (USESYSTEMLIBS)      if (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)        # If the path have been specified in the arguments, use that        set(FMODEX_LIBRARIES ${FMODEX_LIBRARY}) @@ -41,6 +41,6 @@ if (FMODEX)        set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})        set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/)      endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR) -  endif (STANDALONE) +  endif (USESYSTEMLIBS)  endif (FMODEX) diff --git a/indra/cmake/FindJsonCpp.cmake b/indra/cmake/FindJsonCpp.cmake index 0b056ada58..9398779cff 100755 --- a/indra/cmake/FindJsonCpp.cmake +++ b/indra/cmake/FindJsonCpp.cmake @@ -23,10 +23,10 @@ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}  # Try to find a library that was compiled with the same compiler version as we currently use.  SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so) -IF (STANDALONE) +IF (USESYSTEMLIBS)      # On standalone, assume that the system installed library was compiled with the used compiler.      SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so) -ENDIF (STANDALONE) +ENDIF (USESYSTEMLIBS)  FIND_LIBRARY(JSONCPP_LIBRARY    NAMES ${JSONCPP_NAMES}    PATHS /usr/lib /usr/local/lib diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index c9a90a9a8d..02c5b37f28 100755 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -1,14 +1,14 @@  # -*- cmake -*-  include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindPkgConfig)    pkg_check_modules(FREETYPE REQUIRED freetype2) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(freetype)    set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)    set(FREETYPE_LIBRARIES freetype) -endif (STANDALONE) +endif (USESYSTEMLIBS)  link_directories(${FREETYPE_LIBRARY_DIRS}) diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index 0a3dd976b4..a749644202 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -1,8 +1,8 @@  # -*- cmake -*-  include(Prebuilt) -if (NOT STANDALONE) +if (NOT USESYSTEMLIBS)    use_prebuilt_binary(glext)    use_prebuilt_binary(glh_linear)    set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) -endif (NOT STANDALONE) +endif (NOT USESYSTEMLIBS) diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index 911dbe4017..d5262f2efa 100755 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -4,8 +4,8 @@ include(Prebuilt)  set(GLH_FIND_REQUIRED TRUE)  set(GLH_FIND_QUIETLY TRUE) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindGLH) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(glh_linear) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake index 6bdbaf621e..3683768af9 100755 --- a/indra/cmake/GLOD.cmake +++ b/indra/cmake/GLOD.cmake @@ -1,9 +1,9 @@  # -*- cmake -*-  include(Prebuilt) -if (NOT STANDALONE) +if (NOT USESYSTEMLIBS)    use_prebuilt_binary(GLOD) -endif (NOT STANDALONE) +endif (NOT USESYSTEMLIBS)  set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)  set(GLOD_LIBRARIES GLOD) diff --git a/indra/cmake/GStreamer010Plugin.cmake b/indra/cmake/GStreamer010Plugin.cmake index d1c99d5409..3fbc40ef8f 100755 --- a/indra/cmake/GStreamer010Plugin.cmake +++ b/indra/cmake/GStreamer010Plugin.cmake @@ -1,7 +1,7 @@  # -*- cmake -*-  include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindPkgConfig)    pkg_check_modules(GSTREAMER010 REQUIRED gstreamer-0.10) @@ -26,7 +26,7 @@ elseif (LINUX)        gthread-2.0        glib-2.0        ) -endif (STANDALONE) +endif (USESYSTEMLIBS)  if (GSTREAMER010_FOUND AND GSTREAMER010_PLUGINS_BASE_FOUND)    set(GSTREAMER010 ON CACHE BOOL "Build with GStreamer-0.10 streaming media support.") diff --git a/indra/cmake/Glui.cmake b/indra/cmake/Glui.cmake index f62a56856c..db353a91ec 100755 --- a/indra/cmake/Glui.cmake +++ b/indra/cmake/Glui.cmake @@ -2,14 +2,14 @@  include(Linking)  include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS)      set(GLUI OFF CACHE BOOL          "GLUI support for the llplugin/llmedia test apps.") -else (STANDALONE) +else (USESYSTEMLIBS)      use_prebuilt_binary(glui)      set(GLUI ON CACHE BOOL          "GLUI support for the llplugin/llmedia test apps.") -endif (STANDALONE) +endif (USESYSTEMLIBS)  if (LINUX)      set(GLUI ON CACHE BOOL diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake index 7f9ba4ea8e..829e1ac08a 100755 --- a/indra/cmake/GoogleBreakpad.cmake +++ b/indra/cmake/GoogleBreakpad.cmake @@ -1,10 +1,10 @@  # -*- cmake -*-  include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS)    set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)    include(FindGoogleBreakpad) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(google_breakpad)    if (DARWIN)      set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler) @@ -18,5 +18,5 @@ else (STANDALONE)    # yes, this does look dumb, no, it's not incorrect    #    set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/include/google_breakpad/google_breakpad") -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/GooglePerfTools.cmake b/indra/cmake/GooglePerfTools.cmake index f3fd008e49..c1faeb9325 100755 --- a/indra/cmake/GooglePerfTools.cmake +++ b/indra/cmake/GooglePerfTools.cmake @@ -5,9 +5,9 @@ include(Prebuilt)  # set ON or OFF as desired.  set (USE_TCMALLOC OFF) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindGooglePerfTools) -else (STANDALONE) +else (USESYSTEMLIBS)    if (WINDOWS)      if (USE_TCMALLOC)         use_prebuilt_binary(gperftools) @@ -34,7 +34,7 @@ else (STANDALONE)          ${LIBS_PREBUILT_DIR}/include)      set(GOOGLE_PERFTOOLS_FOUND "YES")    endif (LINUX) -endif (STANDALONE) +endif (USESYSTEMLIBS)  if (GOOGLE_PERFTOOLS_FOUND)    # XXX Disable temporarily, until we have compilation issues on 64-bit diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 0c9cf93316..ef74d95b2a 100755 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -4,9 +4,9 @@ include(Prebuilt)  set(HUNSPELL_FIND_QUIETLY ON)  set(HUNSPELL_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindHUNSPELL) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(libhunspell)    if (WINDOWS)      set(HUNSPELL_LIBRARY libhunspell) @@ -19,4 +19,4 @@ else (STANDALONE)    endif()    set(HUNSPELL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/hunspell)    use_prebuilt_binary(dictionaries) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index 4f99efd602..d6da22aecc 100755 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -5,9 +5,9 @@ include(Linking)  set(JPEG_FIND_QUIETLY ON)  set(JPEG_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindJPEG) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(jpeglib)    if (LINUX)      set(JPEG_LIBRARIES jpeg) @@ -17,4 +17,4 @@ else (STANDALONE)      set(JPEG_LIBRARIES jpeglib)    endif (LINUX)    set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index 7ad73e5683..0aab2d6634 100755 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -5,9 +5,9 @@ include(Prebuilt)  set(JSONCPP_FIND_QUIETLY ON)  set(JSONCPP_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindJsonCpp) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(jsoncpp)    if (WINDOWS)      set(JSONCPP_LIBRARIES  @@ -19,4 +19,4 @@ else (STANDALONE)      set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)    endif (WINDOWS)    set(JSONCPP_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json") -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 9bb3077797..4e6c41e528 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -202,9 +202,9 @@ FUNCTION(LL_ADD_INTEGRATION_TEST    ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})    SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}") -  if(STANDALONE) +  if(USESYSTEMLIBS)      SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}") -  endif(STANDALONE) +  endif(USESYSTEMLIBS)    # The following was copied to llcorehttp/CMakeLists.txt's texture_load target.     # Any changes made here should be replicated there. @@ -275,10 +275,10 @@ MACRO(SET_TEST_PATH LISTVAR)      set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib)    ELSE(WINDOWS)      # Linux uses a single staging directory anyway. -    IF (STANDALONE) +    IF (USESYSTEMLIBS)        set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib) -    ELSE (STANDALONE) +    ELSE (USESYSTEMLIBS)        set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib) -    ENDIF (STANDALONE) +    ENDIF (USESYSTEMLIBS)    ENDIF(WINDOWS)  ENDMACRO(SET_TEST_PATH) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index ad732ef650..ba07a80f05 100755 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -4,7 +4,7 @@ include(Variables)  include(GLEXT)  include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindSDL)    # This should be done by FindSDL.  Sigh. @@ -13,14 +13,14 @@ if (STANDALONE)        SDL_INCLUDE_DIR        SDL_LIBRARY        ) -else (STANDALONE) +else (USESYSTEMLIBS)    if (LINUX)      use_prebuilt_binary(SDL)      set (SDL_FOUND TRUE)      set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux)      set (SDL_LIBRARY SDL directfb fusion direct)    endif (LINUX) -endif (STANDALONE) +endif (USESYSTEMLIBS)  if (SDL_FOUND)    include_directories(${SDL_INCLUDE_DIR}) diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index be6fe415f2..e72845db53 100755 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -4,10 +4,10 @@ include(Prebuilt)  set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.")  if (NDOF) -  if (STANDALONE) +  if (USESYSTEMLIBS)      set(NDOF_FIND_REQUIRED ON)      include(FindNDOF) -  else (STANDALONE) +  else (USESYSTEMLIBS)      use_prebuilt_binary(ndofdev)      if (WINDOWS) @@ -18,7 +18,7 @@ if (NDOF)      set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)      set(NDOF_FOUND 1) -  endif (STANDALONE) +  endif (USESYSTEMLIBS)  endif (NDOF)  if (NDOF_FOUND) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index a3e1fb924e..c084d68de7 100755 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -10,14 +10,14 @@ endif (LINUX)  if (OPENAL)    set(OPENAL_LIB_INCLUDE_DIRS "${LIBS_PREBUILT_DIR}/include/AL") -  if (STANDALONE) +  if (USESYSTEMLIBS)      include(FindPkgConfig)      include(FindOpenAL)      pkg_check_modules(OPENAL_LIB REQUIRED openal)      pkg_check_modules(FREEALUT_LIB REQUIRED freealut) -  else (STANDALONE) +  else (USESYSTEMLIBS)      use_prebuilt_binary(openal_soft) -  endif (STANDALONE) +  endif (USESYSTEMLIBS)    if(WINDOWS)      set(OPENAL_LIBRARIES         OpenAL32 diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index fcc82c2f49..bf0bde2ba7 100755 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -4,9 +4,9 @@ include(Prebuilt)  set(OPENJPEG_FIND_QUIETLY ON)  set(OPENJPEG_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindOpenJPEG) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(openjpeg)    if(WINDOWS) @@ -19,4 +19,4 @@ else (STANDALONE)    endif(WINDOWS)      set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 2704912eb5..5b469f74f9 100755 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -4,9 +4,9 @@ include(Prebuilt)  set(OpenSSL_FIND_QUIETLY ON)  set(OpenSSL_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindOpenSSL) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(openSSL)    if (WINDOWS)      set(OPENSSL_LIBRARIES ssleay32 libeay32) @@ -14,7 +14,7 @@ else (STANDALONE)      set(OPENSSL_LIBRARIES ssl crypto)    endif (WINDOWS)    set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) -endif (STANDALONE) +endif (USESYSTEMLIBS)  if (LINUX)    set(CRYPTO_LIBRARIES crypto) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 913c575672..173d59391e 100755 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -4,9 +4,9 @@ include(Prebuilt)  set(PNG_FIND_QUIETLY ON)  set(PNG_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindPNG) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(libpng)    if (WINDOWS)      set(PNG_LIBRARIES libpng15) @@ -18,4 +18,4 @@ else (STANDALONE)      set(PNG_LIBRARIES png15)      set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)    endif() -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index ac0cbde253..e548805148 100755 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -17,11 +17,11 @@ endif(INSTALL_PROPRIETARY)  # of previous attempts is serialized in the file  # ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)  macro (use_prebuilt_binary _binary) -  if (NOT DEFINED STANDALONE_${_binary}) -    set(STANDALONE_${_binary} ${STANDALONE}) -  endif (NOT DEFINED STANDALONE_${_binary}) +  if (NOT DEFINED USESYSTEMLIBS_${_binary}) +    set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS}) +  endif (NOT DEFINED USESYSTEMLIBS_${_binary}) -  if (NOT STANDALONE_${_binary}) +  if (NOT USESYSTEMLIBS_${_binary})      if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed")        file(READ ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${_binary}_installed")        if(DEBUG_PREBUILT) @@ -52,7 +52,7 @@ macro (use_prebuilt_binary _binary)                "Failed to download or unpack prebuilt '${_binary}'."                " Process returned ${${_binary}_installed}.")      endif (NOT ${_binary}_installed EQUAL 0) -  endif (NOT STANDALONE_${_binary}) +  endif (NOT USESYSTEMLIBS_${_binary})  endmacro (use_prebuilt_binary _binary)  endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/PulseAudio.cmake b/indra/cmake/PulseAudio.cmake index 360a971058..cce27f1bdd 100755 --- a/indra/cmake/PulseAudio.cmake +++ b/indra/cmake/PulseAudio.cmake @@ -4,7 +4,7 @@ include(Prebuilt)  set(PULSEAUDIO OFF CACHE BOOL "Build with PulseAudio support, if available.")  if (PULSEAUDIO) -  if (STANDALONE) +  if (USESYSTEMLIBS)      include(FindPkgConfig)      pkg_check_modules(PULSEAUDIO libpulse) @@ -20,7 +20,7 @@ if (PULSEAUDIO)      set(PULSEAUDIO_LIBRARIES        # none needed!        ) -  endif (STANDALONE) +  endif (USESYSTEMLIBS)  endif (PULSEAUDIO)  if (PULSEAUDIO_FOUND) diff --git a/indra/cmake/Tut.cmake b/indra/cmake/Tut.cmake index 7488e9dcb0..e11a3c3314 100755 --- a/indra/cmake/Tut.cmake +++ b/indra/cmake/Tut.cmake @@ -1,6 +1,6 @@  # -*- cmake -*-  include(Prebuilt) -if (NOT STANDALONE) +if (NOT USESYSTEMLIBS)    use_prebuilt_binary(tut) -endif(NOT STANDALONE) +endif(NOT USESYSTEMLIBS) diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index d0fd4df03a..58acdc22bd 100755 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -2,7 +2,7 @@  include(Prebuilt)  include(FreeType) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindPkgConfig)    if (LINUX) @@ -31,7 +31,7 @@ if (STANDALONE)      list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})      add_definitions(${${pkg}_CFLAGS_OTHERS})    endforeach(pkg) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(gtk-atk-pango-glib)    if (LINUX)      set(UI_LIBRARIES @@ -59,7 +59,7 @@ else (STANDALONE)    foreach(include ${${LL_ARCH}_INCLUDES})        include_directories(${LIBS_PREBUILT_DIR}/include/${include})    endforeach(include) -endif (STANDALONE) +endif (USESYSTEMLIBS)  if (LINUX)    add_definitions(-DLL_GTK=1 -DLL_X11=1) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 22d0a7f0fe..963b1bd386 100755 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -183,7 +183,7 @@ if (XCODE_VERSION GREATER 4.2)  endif (XCODE_VERSION GREATER 4.2)  set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside") -set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.") +set(USESYSTEMLIBS OFF CACHE BOOL "Use libraries from your system rather than Linden-supplied prebuilt libraries.")  set(UNATTENDED OFF CACHE BOOL "Should be set to ON for building with VC Express editions.")  set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.") diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 5b00c989a4..d4be24799f 100755 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -1,10 +1,10 @@  # -*- cmake -*-  include(Prebuilt) -if (NOT STANDALONE) +if (NOT USESYSTEMLIBS)    use_prebuilt_binary(libhunspell)    use_prebuilt_binary(libuuid)    use_prebuilt_binary(slvoice)    use_prebuilt_binary(fontconfig) -endif(NOT STANDALONE) +endif(NOT USESYSTEMLIBS) diff --git a/indra/cmake/WebKitLibPlugin.cmake b/indra/cmake/WebKitLibPlugin.cmake index d9df78bfc8..76f2c148db 100755 --- a/indra/cmake/WebKitLibPlugin.cmake +++ b/indra/cmake/WebKitLibPlugin.cmake @@ -2,7 +2,7 @@  include(Linking)  include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS)    # The minimal version, 4.4.3, is rather arbitrary: it's the version in Debian/Lenny.    find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtNetwork QtOpenGL QtWebKit REQUIRED)    include(${QT_USE_FILE}) @@ -28,11 +28,11 @@ if (STANDALONE)    list(APPEND QT_PLUGIN_LIBRARIES jpeg)      set(WEBKITLIBPLUGIN OFF CACHE BOOL          "WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.") -else (STANDALONE) +else (USESYSTEMLIBS)      use_prebuilt_binary(llqtwebkit)      set(WEBKITLIBPLUGIN ON CACHE BOOL          "WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.") -endif (STANDALONE) +endif (USESYSTEMLIBS)  if (WINDOWS)      set(WEBKIT_PLUGIN_LIBRARIES  diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 5bd4848245..3a0caa0a06 100755 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -4,9 +4,9 @@ include(Prebuilt)  set(XMLRPCEPI_FIND_QUIETLY ON)  set(XMLRPCEPI_FIND_REQUIRED ON) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindXmlRpcEpi) -else (STANDALONE) +else (USESYSTEMLIBS)      use_prebuilt_binary(xmlrpc-epi)      if (WINDOWS)          set(XMLRPCEPI_LIBRARIES  @@ -17,4 +17,4 @@ else (STANDALONE)          set(XMLRPCEPI_LIBRARIES xmlrpc-epi)      endif (WINDOWS)      set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/cmake/ZLIB.cmake b/indra/cmake/ZLIB.cmake index 48e5130ad5..b99a8644c9 100755 --- a/indra/cmake/ZLIB.cmake +++ b/indra/cmake/ZLIB.cmake @@ -5,9 +5,9 @@ set(ZLIB_FIND_REQUIRED ON)  include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS)    include(FindZLIB) -else (STANDALONE) +else (USESYSTEMLIBS)    use_prebuilt_binary(zlib)    if (WINDOWS)      set(ZLIB_LIBRARIES  @@ -19,4 +19,4 @@ else (STANDALONE)    if (WINDOWS OR LINUX)      set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/zlib)    endif (WINDOWS OR LINUX) -endif (STANDALONE) +endif (USESYSTEMLIBS) diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index ad4fce6f35..77841918ca 100755 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -34,7 +34,7 @@  #include <iostream>  #include "apr_base64.h" -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  # include <zlib.h>  #else  # include "zlib/zlib.h"  // for davep's dirty little zip functions diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp index 614a2d5636..4f2a652044 100755 --- a/indra/llcommon/llsdserialize_xml.cpp +++ b/indra/llcommon/llsdserialize_xml.cpp @@ -35,7 +35,7 @@  extern "C"  { -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  # include <expat.h>  #else  # include "expat/expat.h" diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index e63045659e..436745c5e4 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -33,7 +33,7 @@  #include "llsys.h"  #include <iostream> -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  # include <zlib.h>  #else  # include "zlib/zlib.h" diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h index 7ac7f5d2e0..3d364551a9 100755 --- a/indra/llimage/llimagejpeg.h +++ b/indra/llimage/llimagejpeg.h @@ -32,7 +32,7 @@  #include "llimage.h"  extern "C" { -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  # include <jpeglib.h>  # include <jerror.h>  #else diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index 5abd9a0d06..9cf6903197 100755 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -1,4 +1,4 @@ -/**  +/**   * @file llmath.h   * @brief Useful math constants and macros.   * @@ -82,6 +82,9 @@ const F32	OO_LN2		= 1.4426950408889634073599246810019f;  const F32	F_ALMOST_ZERO	= 0.0001f;  const F32	F_ALMOST_ONE	= 1.0f - F_ALMOST_ZERO; +const F32	GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees +// formula: GIMBAL_THRESHOLD = sin(DEG_TO_RAD * gimbal_threshold_angle); +  // BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above?  const F32 FP_MAG_THRESHOLD = 0.0000001f; diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index 7381d5eb99..47374c287f 100755 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -1,4 +1,4 @@ -/**  +/**   * @file llquaternion.cpp   * @brief LLQuaternion class implementation.   * @@ -58,34 +58,40 @@ LLQuaternion::LLQuaternion(const LLMatrix3 &mat)  LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec)  { -	LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]); -	v.normalize(); - -	F32 c, s; -	c = cosf(angle*0.5f); -	s = sinf(angle*0.5f); - -	mQ[VX] = v.mV[VX] * s; -	mQ[VY] = v.mV[VY] * s; -	mQ[VZ] = v.mV[VZ] * s; -	mQ[VW] = c; -	normalize(); +	F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]); +	if (mag > FP_MAG_THRESHOLD) +	{ +		angle *= 0.5; +		F32 c = cosf(angle); +		F32 s = sinf(angle) / mag; +		mQ[VX] = vec.mV[VX] * s; +		mQ[VY] = vec.mV[VY] * s; +		mQ[VZ] = vec.mV[VZ] * s; +		mQ[VW] = c; +	} +	else +	{ +		loadIdentity(); +	}  }  LLQuaternion::LLQuaternion(F32 angle, const LLVector3 &vec)  { -	LLVector3 v(vec); -	v.normalize(); - -	F32 c, s; -	c = cosf(angle*0.5f); -	s = sinf(angle*0.5f); - -	mQ[VX] = v.mV[VX] * s; -	mQ[VY] = v.mV[VY] * s; -	mQ[VZ] = v.mV[VZ] * s; -	mQ[VW] = c; -	normalize(); +	F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]); +	if (mag > FP_MAG_THRESHOLD) +	{ +		angle *= 0.5; +		F32 c = cosf(angle); +		F32 s = sinf(angle) / mag; +		mQ[VX] = vec.mV[VX] * s; +		mQ[VY] = vec.mV[VY] * s; +		mQ[VZ] = vec.mV[VZ] * s; +		mQ[VW] = c; +	} +	else +	{ +		loadIdentity(); +	}  }  LLQuaternion::LLQuaternion(const LLVector3 &x_axis, @@ -136,57 +142,61 @@ void	LLQuaternion::quantize8(F32 lower, F32 upper)  const LLQuaternion&	LLQuaternion::setAngleAxis(F32 angle, F32 x, F32 y, F32 z)  { -	LLVector3 vec(x, y, z); -	vec.normalize(); - -	angle *= 0.5f; -	F32 c, s; -	c = cosf(angle); -	s = sinf(angle); - -	mQ[VX] = vec.mV[VX]*s; -	mQ[VY] = vec.mV[VY]*s; -	mQ[VZ] = vec.mV[VZ]*s; -	mQ[VW] = c; - -	normalize(); +	F32 mag = sqrtf(x * x + y * y + z * z); +	if (mag > FP_MAG_THRESHOLD) +	{ +		angle *= 0.5; +		F32 c = cosf(angle); +		F32 s = sinf(angle) / mag; +		mQ[VX] = x * s; +		mQ[VY] = y * s; +		mQ[VZ] = z * s; +		mQ[VW] = c; +	} +	else +	{ +		loadIdentity(); +	}  	return (*this);  }  const LLQuaternion&	LLQuaternion::setAngleAxis(F32 angle, const LLVector3 &vec)  { -	LLVector3 v(vec); -	v.normalize(); - -	angle *= 0.5f; -	F32 c, s; -	c = cosf(angle); -	s = sinf(angle); - -	mQ[VX] = v.mV[VX]*s; -	mQ[VY] = v.mV[VY]*s; -	mQ[VZ] = v.mV[VZ]*s; -	mQ[VW] = c; - -	normalize(); +	F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]); +	if (mag > FP_MAG_THRESHOLD) +	{ +		angle *= 0.5; +		F32 c = cosf(angle); +		F32 s = sinf(angle) / mag; +		mQ[VX] = vec.mV[VX] * s; +		mQ[VY] = vec.mV[VY] * s; +		mQ[VZ] = vec.mV[VZ] * s; +		mQ[VW] = c; +	} +	else +	{ +		loadIdentity(); +	}  	return (*this);  }  const LLQuaternion&	LLQuaternion::setAngleAxis(F32 angle, const LLVector4 &vec)  { -	LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]); -	v.normalize(); - -	F32 c, s; -	c = cosf(angle*0.5f); -	s = sinf(angle*0.5f); - -	mQ[VX] = v.mV[VX]*s; -	mQ[VY] = v.mV[VY]*s; -	mQ[VZ] = v.mV[VZ]*s; -	mQ[VW] = c; - -	normalize(); +	F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]); +	if (mag > FP_MAG_THRESHOLD) +	{ +		angle *= 0.5; +		F32 c = cosf(angle); +		F32 s = sinf(angle) / mag; +		mQ[VX] = vec.mV[VX] * s; +		mQ[VY] = vec.mV[VY] * s; +		mQ[VZ] = vec.mV[VZ] * s; +		mQ[VW] = c; +	} +	else +	{ +		loadIdentity(); +	}  	return (*this);  } @@ -219,68 +229,80 @@ const LLQuaternion&	LLQuaternion::set(const LLMatrix4 &mat)  // deprecated  const LLQuaternion&	LLQuaternion::setQuat(F32 angle, F32 x, F32 y, F32 z)  { -	LLVector3 vec(x, y, z); -	vec.normalize(); - -	angle *= 0.5f; -	F32 c, s; -	c = cosf(angle); -	s = sinf(angle); - -	mQ[VX] = vec.mV[VX]*s; -	mQ[VY] = vec.mV[VY]*s; -	mQ[VZ] = vec.mV[VZ]*s; -	mQ[VW] = c; - -	normalize(); +	F32 mag = sqrtf(x * x + y * y + z * z); +	if (mag > FP_MAG_THRESHOLD) +	{ +		angle *= 0.5; +		F32 c = cosf(angle); +		F32 s = sinf(angle) / mag; +		mQ[VX] = x * s; +		mQ[VY] = y * s; +		mQ[VZ] = z * s; +		mQ[VW] = c; +	} +	else +	{ +		loadIdentity(); +	}  	return (*this);  }  // deprecated  const LLQuaternion&	LLQuaternion::setQuat(F32 angle, const LLVector3 &vec)  { -	LLVector3 v(vec); -	v.normalize(); - -	angle *= 0.5f; -	F32 c, s; -	c = cosf(angle); -	s = sinf(angle); - -	mQ[VX] = v.mV[VX]*s; -	mQ[VY] = v.mV[VY]*s; -	mQ[VZ] = v.mV[VZ]*s; -	mQ[VW] = c; - -	normalize(); +	F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]); +	if (mag > FP_MAG_THRESHOLD) +	{ +		angle *= 0.5; +		F32 c = cosf(angle); +		F32 s = sinf(angle) / mag; +		mQ[VX] = vec.mV[VX] * s; +		mQ[VY] = vec.mV[VY] * s; +		mQ[VZ] = vec.mV[VZ] * s; +		mQ[VW] = c; +	} +	else +	{ +		loadIdentity(); +	}  	return (*this);  }  const LLQuaternion&	LLQuaternion::setQuat(F32 angle, const LLVector4 &vec)  { -	LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]); -	v.normalize(); - -	F32 c, s; -	c = cosf(angle*0.5f); -	s = sinf(angle*0.5f); - -	mQ[VX] = v.mV[VX]*s; -	mQ[VY] = v.mV[VY]*s; -	mQ[VZ] = v.mV[VZ]*s; -	mQ[VW] = c; - -	normalize(); +	F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]); +	if (mag > FP_MAG_THRESHOLD) +	{ +		angle *= 0.5; +		F32 c = cosf(angle); +		F32 s = sinf(angle) / mag; +		mQ[VX] = vec.mV[VX] * s; +		mQ[VY] = vec.mV[VY] * s; +		mQ[VZ] = vec.mV[VZ] * s; +		mQ[VW] = c; +	} +	else +	{ +		loadIdentity(); +	}  	return (*this);  }  const LLQuaternion&	LLQuaternion::setQuat(F32 roll, F32 pitch, F32 yaw)  { -	LLMatrix3 rot_mat(roll, pitch, yaw); -	rot_mat.orthogonalize(); -	*this = rot_mat.quaternion(); -		 -	normalize(); +	roll  *= 0.5f; +	pitch *= 0.5f; +	yaw   *= 0.5f; +	F32 sinX = sinf(roll); +	F32 cosX = cosf(roll); +	F32 sinY = sinf(pitch); +	F32 cosY = cosf(pitch); +	F32 sinZ = sinf(yaw); +	F32 cosZ = cosf(yaw); +	mQ[VW] = cosX * cosY * cosZ - sinX * sinY * sinZ; +	mQ[VX] = sinX * cosY * cosZ + cosX * sinY * sinZ; +	mQ[VY] = cosX * sinY * cosZ - sinX * cosY * sinZ; +	mQ[VZ] = cosX * cosY * sinZ + sinX * sinY * cosZ;  	return (*this);  } @@ -425,68 +447,44 @@ LLMatrix4	LLQuaternion::getMatrix4(void) const  // calculate the shortest rotation from a to b  void LLQuaternion::shortestArc(const LLVector3 &a, const LLVector3 &b)  { -	// Make a local copy of both vectors. -	LLVector3 vec_a = a; -	LLVector3 vec_b = b; - -	// Make sure neither vector is zero length.  Also normalize -	// the vectors while we are at it. -	F32 vec_a_mag = vec_a.normalize(); -	F32 vec_b_mag = vec_b.normalize(); -	if (vec_a_mag < F_APPROXIMATELY_ZERO || -		vec_b_mag < F_APPROXIMATELY_ZERO) -	{ -		// Can't calculate a rotation from this. -		// Just return ZERO_ROTATION instead. -		loadIdentity(); -		return; -	} - -	// Create an axis to rotate around, and the cos of the angle to rotate. -	LLVector3 axis = vec_a % vec_b; -	F32 cos_theta  = vec_a * vec_b; - -	// Check the angle between the vectors to see if they are parallel or anti-parallel. -	if (cos_theta > 1.0 - F_APPROXIMATELY_ZERO) -	{ -		// a and b are parallel.  No rotation is necessary. -		loadIdentity(); -	} -	else if (cos_theta < -1.0 + F_APPROXIMATELY_ZERO) +	F32 ab = a * b; // dotproduct +	LLVector3 c = a % b; // crossproduct +	F32 cc = c * c; // squared length of the crossproduct +	if (ab * ab + cc) // test if the arguments have sufficient magnitude  	{ -		// a and b are anti-parallel. -		// Rotate 180 degrees around some orthogonal axis. -		// Find the projection of the x-axis onto a, and try -		// using the vector between the projection and the x-axis -		// as the orthogonal axis. -		LLVector3 proj = vec_a.mV[VX] / (vec_a * vec_a) * vec_a; -		LLVector3 ortho_axis(1.f, 0.f, 0.f); -		ortho_axis -= proj; -		 -		// Turn this into an orthonormal axis. -		F32 ortho_length = ortho_axis.normalize(); -		// If the axis' length is 0, then our guess at an orthogonal axis -		// was wrong (a is parallel to the x-axis). -		if (ortho_length < F_APPROXIMATELY_ZERO) +		if (cc > 0.0f) // test if the arguments are (anti)parallel  		{ -			// Use the z-axis instead. -			ortho_axis.setVec(0.f, 0.f, 1.f); +			F32 s = sqrtf(ab * ab + cc) + ab; // note: don't try to optimize this line +			F32 m = 1.0f / sqrtf(cc + s * s); // the inverted magnitude of the quaternion +			mQ[VX] = c.mV[VX] * m; +			mQ[VY] = c.mV[VY] * m; +			mQ[VZ] = c.mV[VZ] * m; +			mQ[VW] = s * m; +			return; +		} +		if (ab < 0.0f) // test if the angle is bigger than PI/2 (anti parallel) +		{ +			c = a - b; // the arguments are anti-parallel, we have to choose an axis +			F32 m = sqrtf(c.mV[VX] * c.mV[VX] +  c.mV[VY] * c.mV[VY]); // the length projected on the XY-plane +			if (m > FP_MAG_THRESHOLD) +			{ +				mQ[VX] = -c.mV[VY] / m; // return the quaternion with the axis in the XY-plane +				mQ[VY] =  c.mV[VX] / m; +				mQ[VZ] = 0.0f; +				mQ[VW] = 0.0f; +				return; +			} +			else // the vectors are parallel to the Z-axis +			{ +				mQ[VX] = 1.0f; // rotate around the X-axis +				mQ[VY] = 0.0f; +				mQ[VZ] = 0.0f; +				mQ[VW] = 0.0f; +				return; +			}  		} - -		// Construct a quaternion from this orthonormal axis. -		mQ[VX] = ortho_axis.mV[VX]; -		mQ[VY] = ortho_axis.mV[VY]; -		mQ[VZ] = ortho_axis.mV[VZ]; -		mQ[VW] = 0.f; -	} -	else -	{ -		// a and b are NOT parallel or anti-parallel. -		// Return the rotation between these vectors. -		F32 theta = (F32)acos(cos_theta); - -		setAngleAxis(theta, axis);  	} +	loadIdentity();  }  // constrains rotation to a cone angle specified in radians @@ -838,79 +836,82 @@ LLQuaternion::Order StringToOrder( const char *str )  void LLQuaternion::getAngleAxis(F32* angle, LLVector3 &vec) const  { -	F32 cos_a = mQ[VW]; -	if (cos_a > 1.0f) cos_a = 1.0f; -	if (cos_a < -1.0f) cos_a = -1.0f; - -    F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a ); - -    if ( fabs( sin_a ) < 0.0005f ) -		sin_a = 1.0f; -	else -		sin_a = 1.f/sin_a; - -    F32 temp_angle = 2.0f * (F32) acos( cos_a ); -	if (temp_angle > F_PI) -	{ -		// The (angle,axis) pair should never have angles outside [PI, -PI] -		// since we want the _shortest_ (angle,axis) solution. -		// Since acos is defined for [0, PI], and we multiply by 2.0, we -		// can push the angle outside the acceptible range. -		// When this happens we set the angle to the other portion of a  -		// full 2PI rotation, and negate the axis, which reverses the  -		// direction of the rotation (by the right-hand rule). -		*angle = 2.f * F_PI - temp_angle; -    	vec.mV[VX] = - mQ[VX] * sin_a; -    	vec.mV[VY] = - mQ[VY] * sin_a; -    	vec.mV[VZ] = - mQ[VZ] * sin_a; +	F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component +	if (v > FP_MAG_THRESHOLD) +	{ +		F32 oomag = 1.0f / v; +		F32 w = mQ[VW]; +		if (mQ[VW] < 0.0f) +		{ +			w = -w; // make VW positive +			oomag = -oomag; // invert the axis +		} +		vec.mV[VX] = mQ[VX] * oomag; // normalize the axis +		vec.mV[VY] = mQ[VY] * oomag; +		vec.mV[VZ] = mQ[VZ] * oomag; +		*angle = 2.0f * atan2f(v, w); // get the angle  	}  	else  	{ -		*angle = temp_angle; -    	vec.mV[VX] = mQ[VX] * sin_a; -    	vec.mV[VY] = mQ[VY] * sin_a; -    	vec.mV[VZ] = mQ[VZ] * sin_a; +		*angle = 0.0f; // no rotation +		vec.mV[VX] = 0.0f; // around some dummy axis +		vec.mV[VY] = 0.0f; +		vec.mV[VZ] = 1.0f;  	}  } -  // quaternion does not need to be normalized  void LLQuaternion::getEulerAngles(F32 *roll, F32 *pitch, F32 *yaw) const  { -	LLMatrix3 rot_mat(*this); -	rot_mat.orthogonalize(); -	rot_mat.getEulerAngles(roll, pitch, yaw); - -//	// NOTE: LLQuaternion's are actually inverted with respect to -//	// the matrices, so this code also assumes inverted quaternions -//	// (-x, -y, -z, w). The result is that roll,pitch,yaw are applied -//	// in reverse order (yaw,pitch,roll). -//	F32 x = -mQ[VX], y = -mQ[VY], z = -mQ[VZ], w = mQ[VW]; -//	F64 m20 = 2.0*(x*z-y*w); -//	if (1.0f - fabsf(m20) < F_APPROXIMATELY_ZERO) -//	{ -//		*roll = 0.0f; -//		*pitch = (F32)asin(m20); -//		*yaw = (F32)atan2(2.0*(x*y-z*w), 1.0 - 2.0*(x*x+z*z)); -//	} -//	else -//	{ -//		*roll  = (F32)atan2(-2.0*(y*z+x*w), 1.0-2.0*(x*x+y*y)); -//		*pitch = (F32)asin(m20); -//		*yaw   = (F32)atan2(-2.0*(x*y+z*w), 1.0-2.0*(y*y+z*z)); -//	} +	F32 sx = 2 * (mQ[VX] * mQ[VW] - mQ[VY] * mQ[VZ]); // sine of the roll +	F32 sy = 2 * (mQ[VY] * mQ[VW] + mQ[VX] * mQ[VZ]); // sine of the pitch +	F32 ys = mQ[VW] * mQ[VW] - mQ[VY] * mQ[VY]; // intermediate cosine 1 +	F32 xz = mQ[VX] * mQ[VX] - mQ[VZ] * mQ[VZ]; // intermediate cosine 2 +	F32 cx = ys - xz; // cosine of the roll +	F32 cy = sqrtf(sx * sx + cx * cx); // cosine of the pitch +	if (cy > GIMBAL_THRESHOLD) // no gimbal lock +	{ +		*roll  = atan2f(sx, cx); +		*pitch = atan2f(sy, cy); +		*yaw   = atan2f(2 * (mQ[VZ] * mQ[VW] - mQ[VX] * mQ[VY]), ys + xz); +	} +	else // gimbal lock +	{ +		if (sy > 0) +		{ +			*pitch = F_PI_BY_TWO; +			*yaw = 2 * atan2f(mQ[VZ] + mQ[VX], mQ[VW] + mQ[VY]); +		} +		else +		{ +			*pitch = -F_PI_BY_TWO; +			*yaw = 2 * atan2f(mQ[VZ] - mQ[VX], mQ[VW] - mQ[VY]); +		} +		*roll = 0; +	}  }  // Saves space by using the fact that our quaternions are normalized  LLVector3 LLQuaternion::packToVector3() const  { +	F32 x = mQ[VX]; +	F32 y = mQ[VY]; +	F32 z = mQ[VZ]; +	F32 w = mQ[VW]; +	F32 mag = sqrtf(x * x + y * y + z * z + w * w); +	if (mag > FP_MAG_THRESHOLD) +	{ +		x /= mag; +		y /= mag; +		z /= mag; // no need to normalize w, it's not used +	}  	if( mQ[VW] >= 0 )  	{ -		return LLVector3( mQ[VX], mQ[VY], mQ[VZ] ); +		return LLVector3( x, y , z );  	}  	else  	{ -		return LLVector3( -mQ[VX], -mQ[VY], -mQ[VZ] ); +		return LLVector3( -x, -y, -z );  	}  } diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h index ca0dfe206b..e56929ed0f 100755 --- a/indra/llmath/llquaternion.h +++ b/indra/llmath/llquaternion.h @@ -1,4 +1,4 @@ -/**  +/**   * @file llquaternion.h   * @brief LLQuaternion class header file.   * @@ -304,43 +304,29 @@ inline const LLQuaternion&	LLQuaternion::setQuat(const F32 *q)  	return (*this);  } -// There may be a cheaper way that avoids the sqrt. -// Does sin_a = VX*VX + VY*VY + VZ*VZ? -// Copied from Matrix and Quaternion FAQ 1.12  inline void LLQuaternion::getAngleAxis(F32* angle, F32* x, F32* y, F32* z) const  { -	F32 cos_a = mQ[VW]; -	if (cos_a > 1.0f) cos_a = 1.0f; -	if (cos_a < -1.0f) cos_a = -1.0f; - -    F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a ); - -    if ( fabs( sin_a ) < 0.0005f ) -		sin_a = 1.0f; -	else -		sin_a = 1.f/sin_a; - -    F32 temp_angle = 2.0f * (F32) acos( cos_a ); -	if (temp_angle > F_PI) +	F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component +	if (v > FP_MAG_THRESHOLD)  	{ -		// The (angle,axis) pair should never have angles outside [PI, -PI] -		// since we want the _shortest_ (angle,axis) solution. -		// Since acos is defined for [0, PI], and we multiply by 2.0, we -		// can push the angle outside the acceptible range. -		// When this happens we set the angle to the other portion of a  -		// full 2PI rotation, and negate the axis, which reverses the  -		// direction of the rotation (by the right-hand rule). -		*angle = 2.f * F_PI - temp_angle; -    	*x = - mQ[VX] * sin_a; -    	*y = - mQ[VY] * sin_a; -    	*z = - mQ[VZ] * sin_a; +		F32 oomag = 1.0f / v; +		F32 w = mQ[VW]; +		if (w < 0.0f) +		{ +			w = -w; // make VW positive +			oomag = -oomag; // invert the axis +		} +		*x = mQ[VX] * oomag; // normalize the axis +		*y = mQ[VY] * oomag; +		*z = mQ[VZ] * oomag; +		*angle = 2.0f * atan2f(v, w); // get the angle  	}  	else  	{ -		*angle = temp_angle; -    	*x = mQ[VX] * sin_a; -    	*y = mQ[VY] * sin_a; -    	*z = mQ[VZ] * sin_a; +		*angle = 0.0f; // no rotation +		*x = 0.0f; // around some dummy axis +		*y = 0.0f; +		*z = 1.0f;  	}  } diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 1461cd57b6..f3fbce4843 100755 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -1,4 +1,4 @@ -/**  +/**   * @file v3math.h   * @brief LLVector3 class header file.   * @@ -491,9 +491,15 @@ inline F32	dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b)  inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b)  { -	LLVector3 project_axis = b; -	project_axis.normalize(); -	return project_axis * (a * project_axis); +	F32 bb = b * b; +	if (bb > FP_MAG_THRESHOLD * FP_MAG_THRESHOLD) +	{ +		return ((a * b) / bb) * b; +	} +	else +	{ +		return b.zero; +	}  }  inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b) @@ -569,15 +575,13 @@ inline void update_min_max(LLVector3& min, LLVector3& max, const F32* pos)  inline F32 angle_between(const LLVector3& a, const LLVector3& b)  { -	LLVector3 an = a; -	LLVector3 bn = b; -	an.normalize(); -	bn.normalize(); -	F32 cosine = an * bn; -	F32 angle = (cosine >= 1.0f) ? 0.0f : -				(cosine <= -1.0f) ? F_PI : -				(F32)acos(cosine); -	return angle; +	F32 ab = a * b; // dotproduct +	if (ab == -0.0f) +	{ +		ab = 0.0f; // get rid of negative zero +	} +	LLVector3 c = a % b; // crossproduct +	return atan2f(sqrtf(c * c), ab); // return the angle  }  inline BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon) diff --git a/indra/llmessage/llares.h b/indra/llmessage/llares.h index 800781ee88..675120c621 100755 --- a/indra/llmessage/llares.h +++ b/indra/llmessage/llares.h @@ -39,7 +39,7 @@  # pragma warning(pop)  #endif -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  # include <ares.h>  #else  # include <ares/ares.h> diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp index 7dcf160c9b..9a6b1e0eb7 100755 --- a/indra/llmessage/llhttpassetstorage.cpp +++ b/indra/llmessage/llhttpassetstorage.cpp @@ -37,7 +37,7 @@  #include "llvfile.h"  #include "llvfs.h" -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  # include <zlib.h>  #else  # include "zlib/zlib.h" diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 34e0483a83..36d9232cca 100755 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -44,7 +44,7 @@  #pragma warning (default : 4264)  #endif -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  # include <zlib.h>  #else  # include "zlib/zlib.h" diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 6322da9123..0b84b9f694 100755 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -30,7 +30,7 @@  #include "llxmlnode.h" -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  #include <expat.h>  #else  #include "expat/expat.h" diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 11c0b51086..ed0348e10e 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -39,6 +39,7 @@  #include "indra_constants.h"  #include <OpenGL/OpenGL.h> +#include <Carbon/Carbon.h>  #include <CoreServices/CoreServices.h>  extern BOOL gDebugWindowProc; @@ -1743,16 +1744,34 @@ LLSD LLWindowMacOSX::getNativeKeyData()  	return result;  } -  BOOL LLWindowMacOSX::dialogColorPicker( F32 *r, F32 *g, F32 *b)  { -	// Is this even used anywhere?  Do we really need an OS color picker?  	BOOL	retval = FALSE; -	//S32		error = 0; +	OSErr	error = noErr; +	NColorPickerInfo	info; +	 +	memset(&info, 0, sizeof(info)); +	info.theColor.color.rgb.red = (UInt16)(*r * 65535.f); +	info.theColor.color.rgb.green = (UInt16)(*g * 65535.f); +	info.theColor.color.rgb.blue = (UInt16)(*b * 65535.f); +	info.placeWhere = kCenterOnMainScreen; + +	error = NPickColor(&info); +	 +	if (error == noErr) +	{ +		retval = info.newColorChosen; +		if (info.newColorChosen) +		{ +			*r = ((float) info.theColor.color.rgb.red) / 65535.0; +			*g = ((float) info.theColor.color.rgb.green) / 65535.0; +			*b = ((float) info.theColor.color.rgb.blue) / 65535.0; +		} +	} +  	return (retval);  } -  void *LLWindowMacOSX::getPlatformWindow()  {  	// NOTE: this will be NULL in fullscreen mode.  Plan accordingly. diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h index ec486d7957..c1c0bfe5d0 100755 --- a/indra/llxml/llxmlnode.h +++ b/indra/llxml/llxmlnode.h @@ -30,7 +30,7 @@  #ifndef XML_STATIC  #define XML_STATIC  #endif -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  #include <expat.h>  #else  #include "expat/expat.h" diff --git a/indra/llxml/llxmlparser.h b/indra/llxml/llxmlparser.h index e0f8b69452..a5b210404f 100755 --- a/indra/llxml/llxmlparser.h +++ b/indra/llxml/llxmlparser.h @@ -30,7 +30,7 @@  #ifndef XML_STATIC  #define XML_STATIC  #endif -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  #include <expat.h>  #else  #include "expat/expat.h" diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f4c1d0b151..fa88d34310 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1461,9 +1461,9 @@ if (WINDOWS)      SOURCE_GROUP("Resource Files" FILES ${viewer_RESOURCE_FILES}) -    if (NOT STANDALONE) +    if (NOT USESYSTEMLIBS)          list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) -    endif (NOT STANDALONE) +    endif (NOT USESYSTEMLIBS)      find_library(DINPUT_LIBRARY dinput8 ${DIRECTX_LIBRARY_DIR})      find_library(DXGUID_LIBRARY dxguid ${DIRECTX_LIBRARY_DIR}) @@ -1574,9 +1574,9 @@ source_group("Character File" FILES ${viewer_CHARACTER_FILES})  set_source_files_properties(${viewer_CHARACTER_FILES}                              PROPERTIES HEADER_FILE_ONLY TRUE) -if (NOT STANDALONE) +if (NOT USESYSTEMLIBS)      list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES}) -endif (NOT STANDALONE) +endif (NOT USESYSTEMLIBS)  if (WINDOWS)    file(GLOB viewer_INSTALLER_FILES installers/windows/*.nsi) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 63c69b4481..816ca70534 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -68,7 +68,7 @@  #include "u64.h"  #include "llviewertexturelist.h"  #include "lldatapacker.h" -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  #include <zlib.h>  #else  #include "zlib/zlib.h" diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 050d9dd785..b9856e3a83 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -35,7 +35,7 @@  #include "llbufferstream.h"  #include "llfile.h"  #include "llmenugl.h" -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  # include "expat.h"  #else  # include "expat/expat.h" diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index c325d72ba6..5e876fa2ef 100755 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -38,7 +38,7 @@ class LLVivoxProtocolParser;  #include "llviewerregion.h"  #include "llcallingcard.h"   // for LLFriendObserver -#ifdef LL_STANDALONE +#ifdef LL_USESYSTEMLIBS  # include "expat.h"  #else  # include "expat/expat.h" diff --git a/indra/test/llsdmessagebuilder_tut.cpp b/indra/test/llsdmessagebuilder_tut.cpp index be0692557a..b7283f53a6 100755 --- a/indra/test/llsdmessagebuilder_tut.cpp +++ b/indra/test/llsdmessagebuilder_tut.cpp @@ -649,7 +649,7 @@ namespace tut  	template<> template<>  	void LLSDMessageBuilderTestObject::test<37>()  	{ -	  LLQuaternion data(1,2,3,0); +	  LLQuaternion data(0.3713907f, 0.5570861f, 0.7427813f,0.0f);  	  //we send a quaternion packed into a vec3 (w is infered) - so sizeof(vec) == 12 bytes not 16.  	  LLVector3 vec = data.packToVector3(); diff --git a/indra/test/lltemplatemessagebuilder_tut.cpp b/indra/test/lltemplatemessagebuilder_tut.cpp index dde70f98c8..7136d36553 100755 --- a/indra/test/lltemplatemessagebuilder_tut.cpp +++ b/indra/test/lltemplatemessagebuilder_tut.cpp @@ -320,7 +320,7 @@ namespace tut  	{  		LLMessageTemplate messageTemplate = defaultTemplate();  		messageTemplate.addBlock(defaultBlock(MVT_LLQuaternion, 12)); -		LLQuaternion outValue, inValue = LLQuaternion(1,2,3,0); +		LLQuaternion outValue, inValue = LLQuaternion(0.3713907f, 0.5570861f, 0.7427813f,0.0f);  		LLTemplateMessageBuilder* builder = defaultBuilder(messageTemplate);  		builder->addQuat(_PREHASH_Test0, inValue);  		LLTemplateMessageReader* reader = setReader(messageTemplate, builder); @@ -787,7 +787,7 @@ namespace tut  	{  		LLMessageTemplate messageTemplate = defaultTemplate();  		messageTemplate.addBlock(defaultBlock(MVT_LLQuaternion, 12)); -		LLQuaternion outValue, inValue = LLQuaternion(1,2,3,0); +		LLQuaternion outValue, inValue = LLQuaternion(0.3713907f, 0.5570861f, 0.7427813f,0.0f);  		LLTemplateMessageBuilder* builder = defaultBuilder(messageTemplate);  		builder->addQuat(_PREHASH_Test0, inValue);  		LLTemplateMessageReader* reader = setReader(  | 
