Commits

Anonymous committed 3f17e67 Merge

merge of login-api

  • Participants
  • Parent commits 7ea65e7, e412efe

Comments (0)

Files changed (822)

 indra/lib/mono/indra/*.dll
 indra/lib/mono/indra/*.exe
 indra/lib/mono/indra/*.pdb
+indra/lib/python/eventlet/
 indra/llwindow/glh/glh_linear.h
 indra/newview/app_settings/mozilla
 indra/newview/app_settings/mozilla-runtime-*
 indra/newview/app_settings/mozilla_debug
 indra/newview/app_settings/static_*.db2
+indra/newview/browser_profile
 indra/newview/character
 indra/newview/fmod.dll
 indra/newview/mozilla-theme
 installed.xml
 libraries
 tarfile_tmp
+^indra/lib/python/mulib.*
 ^web/locale.*
 ^web/secondlife.com.*
 ^web/config.*

File doc/contributions.txt

File contents unchanged.

File indra/CMakeLists.txt

   add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
   add_subdirectory(${LIBS_OPEN_PREFIX}llui)
   add_subdirectory(${LIBS_OPEN_PREFIX}llxuixml)
+  add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
 
   # viewer media plugins
   add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)

File indra/cmake/00-Common.cmake

 
 
 if (DARWIN)
-  add_definitions(-DLL_DARWIN=1)
+  # NOTE (per http://lists.apple.com/archives/darwin-dev/2008/Jan/msg00232.html):
+  # > Why the bus error? What am I doing wrong? 
+  # This is a known issue where getcontext(3) is writing past the end of the
+  # ucontext_t struct when _XOPEN_SOURCE is not defined (rdar://problem/5578699 ).
+  # As a workaround, define _XOPEN_SOURCE before including ucontext.h.
+  add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE)
   set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch")
+  set(DARWIN_extra_cstar_flags "-mlong-branch")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  ${DARWIN_extra_cstar_flags}")
   # NOTE: it's critical that the optimization flag is put in front.
   # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")

File indra/cmake/APR.cmake

 else (STANDALONE)
   use_prebuilt_binary(apr_suite)
   if (WINDOWS)
+    if (LLCOMMON_LINK_SHARED)
+      set(APR_selector "lib")
+    else (LLCOMMON_LINK_SHARED)
+      set(APR_selector "")
+    endif (LLCOMMON_LINK_SHARED)
     set(APR_LIBRARIES 
-      debug ${ARCH_PREBUILT_DIRS_DEBUG}/apr-1.lib
-      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apr-1.lib
+      debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apr-1.lib
+      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib
       )
     set(APRICONV_LIBRARIES 
-      debug ${ARCH_PREBUILT_DIRS_DEBUG}/apriconv-1.lib
-      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apriconv-1.lib
+      debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apriconv-1.lib
+      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib
       )
     set(APRUTIL_LIBRARIES 
-      debug ${ARCH_PREBUILT_DIRS_DEBUG}/aprutil-1.lib ${APRICONV_LIBRARIES}
-      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1.lib ${APRICONV_LIBRARIES}
+      debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
+      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
       )
   elseif (DARWIN)
+    if (LLCOMMON_LINK_SHARED)
+      set(APR_selector     "0.3.7.dylib")
+      set(APRUTIL_selector "0.3.8.dylib")
+    else (LLCOMMON_LINK_SHARED)
+      set(APR_selector     "a")
+      set(APRUTIL_selector "a")
+    endif (LLCOMMON_LINK_SHARED)
     set(APR_LIBRARIES 
-      debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a
-      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a
+      debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.${APR_selector}
+      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.${APR_selector}
       )
     set(APRUTIL_LIBRARIES 
-      debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a
-      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a
+      debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.${APRUTIL_selector}
+      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.${APRUTIL_selector}
       )
     set(APRICONV_LIBRARIES iconv)
   else (WINDOWS)

File indra/cmake/Boost.cmake

   set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
 
   if (WINDOWS)
-    set(BOOST_VERSION 1_34_1)
+    set(BOOST_VERSION 1_39)
     if (MSVC71)
       set(BOOST_PROGRAM_OPTIONS_LIBRARY 
           optimized libboost_program_options-vc71-mt-s-${BOOST_VERSION}

File indra/cmake/CMakeLists.txt

     LLPrimitive.cmake
     LLRender.cmake
     LLScene.cmake
+    LLTestCommand.cmake
     LLUI.cmake
     LLVFS.cmake
     LLWindow.cmake
     PNG.cmake
     Python.cmake
     Prebuilt.cmake
-    RunBuildTest.cmake
     TemplateCheck.cmake
     Tut.cmake
     UI.cmake

File indra/cmake/Externals.cmake

+# -*- cmake -*-
+
+include(Python)
+include(FindSVN)
+
+macro (use_svn_external _binary _path _url _rev)
+  if (NOT STANDALONE)
+    if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+      if(SVN_FOUND)
+        if(DEBUG_EXTERNALS)
+          message("cd ${_path} && ${SVN_EXECUTABLE} checkout -r ${_rev} ${_url} ${_binary}")
+        endif(DEBUG_EXTERNALS)
+        execute_process(COMMAND ${SVN_EXECUTABLE}
+          checkout
+          -r ${_rev}
+          ${_url}
+          ${_binary}
+          WORKING_DIRECTORY ${_path}
+          RESULT_VARIABLE ${_binary}_installed
+          )
+      else(SVN_FOUND)
+        message(FATAL_ERROR "Failed to find SVN_EXECUTABLE")
+      endif(SVN_FOUND)
+      file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}")
+    else(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+      set(${_binary}_installed 0)
+    endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+    if(NOT ${_binary}_installed EQUAL 0)
+      message(FATAL_ERROR
+              "Failed to download or unpack prebuilt '${_binary}'."
+              " Process returned ${${_binary}_installed}.")
+    endif (NOT ${_binary}_installed EQUAL 0)
+  endif (NOT STANDALONE)
+endmacro (use_svn_external _binary _path _url _rev)

File indra/cmake/FindMono.cmake

              /usr/local/bin
 )
 FIND_PROGRAM (ILASM_EXECUTABLE
-             ilasm
+             NAMES ilasm.bat ilasm
              NO_DEFAULT_PATH
              PATHS "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" "$ENV{PROGRAMFILES}/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin
 )

File indra/cmake/FindSVN.cmake

+# -*- cmake -*-
+#
+# Find the svn executable for exporting old svn:externals.
+#
+# Input variables:
+#   SVN_FIND_REQUIRED - set this if configuration should fail without scp
+#
+# Output variables:
+#
+#   SVN_FOUND - set if svn was found
+#   SVN_EXECUTABLE - path to svn executable
+#   SVN_BATCH_FLAG - how to put svn into batch mode
+
+
+SET(SVN_EXECUTABLE)
+FIND_PROGRAM(SVN_EXECUTABLE NAMES svn svn.exe)
+
+IF (SVN_EXECUTABLE)
+  SET(SVN_FOUND ON)
+ELSE (SVN_EXECUTABLE)
+  SET(SVN_FOUND OFF)
+ENDIF (SVN_EXECUTABLE)
+
+IF (SVN_FOUND)
+  GET_FILENAME_COMPONENT(_svn_name ${SVN_EXECUTABLE} NAME_WE)
+  SET(SVN_BATCH_FLAG --non-interactive)
+ELSE (SVN_FOUND)
+  IF (SVN_FIND_REQUIRED)
+    MESSAGE(FATAL_ERROR "Could not find svn executable")
+  ENDIF (SVN_FIND_REQUIRED)
+ENDIF (SVN_FOUND)
+
+MARK_AS_ADVANCED(SVN_EXECUTABLE SVN_FOUND SVN_BATCH_FLAG)
+

File indra/cmake/LLAddBuildTest.cmake

 # -*- cmake -*-
+include(LLTestCommand)
 
 MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
   # Given a project name and a list of sourcefiles (with optional properties on each),
     GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION)
     SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt)
     SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
-    # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
+
+	# daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
     IF(LL_TEST_VERBOSE)
       MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd  = ${TEST_CMD}")
     ENDIF(LL_TEST_VERBOSE)
-    SET(TEST_SCRIPT_CMD 
-      ${CMAKE_COMMAND} 
-      -DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib
-      -DTEST_CMD:STRING="${TEST_CMD}" 
-      -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
-      )
+    
+    IF(WINDOWS)
+      set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
+    ELSE(WINDOWS)
+      set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib)
+    ENDIF(WINDOWS)
+
+    LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${TEST_CMD})
+    SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value})
     IF(LL_TEST_VERBOSE)
       MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script  = ${TEST_SCRIPT_CMD}")
     ENDIF(LL_TEST_VERBOSE)
     LIST(INSERT test_command test_exe_pos "${TEST_EXE}")
   ENDIF (test_exe_pos LESS 0)
 
-  SET(TEST_SCRIPT_CMD 
-    ${CMAKE_COMMAND} 
-    -DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib
-    -DTEST_CMD:STRING="${test_command}" 
-    -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
-    )
+  IF(WINDOWS)
+    set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
+  ELSE(WINDOWS)
+    set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib)
+  ENDIF(WINDOWS)
+
+  LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${test_command})
+  SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value})
 
   if(TEST_DEBUG)
     message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}")

File indra/cmake/LLCommon.cmake

 
 add_definitions(${TCMALLOC_FLAG})
 
+set(LLCOMMON_LINK_SHARED ON CACHE BOOL "Build the llcommon target as a shared library.")
+if(LLCOMMON_LINK_SHARED)
+  add_definitions(-DLL_COMMON_LINK_SHARED=1)
+endif(LLCOMMON_LINK_SHARED)

File indra/cmake/LLLogin.cmake

+# -*- cmake -*-
+
+set(LLLOGIN_INCLUDE_DIRS
+    ${LIBS_OPEN_DIR}/viewer_components/login
+    )
+
+set(LLLOGIN_LIBRARIES lllogin)

File indra/cmake/LLTestCommand.cmake

+MACRO(LL_TEST_COMMAND LD_LIBRARY_PATH)
+  # nat wonders how Kitware can use the term 'function' for a construct that
+  # cannot return a value. And yet, variables you set inside a FUNCTION are
+  # local. Try a MACRO instead.
+  SET(LL_TEST_COMMAND_value
+    ${PYTHON_EXECUTABLE}
+    "${CMAKE_SOURCE_DIR}/cmake/run_build_test.py")
+  IF(LD_LIBRARY_PATH)
+    LIST(APPEND LL_TEST_COMMAND_value "-l${LD_LIBRARY_PATH}")
+  ENDIF(LD_LIBRARY_PATH)
+  LIST(APPEND LL_TEST_COMMAND_value ${ARGN})
+##MESSAGE(STATUS "Will run: ${LL_TEST_COMMAND_value}")
+ENDMACRO(LL_TEST_COMMAND)

File indra/cmake/Linking.cmake

     set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
     set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
     set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
+    set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs")
   elseif (LINUX)
     if (VIEWER)
       set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client)
     endif (VIEWER)
     set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS})
     set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS})
+    set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged .sos")
   elseif (DARWIN)
     set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release)
     set(ARCH_PREBUILT_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
     set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS_RELEASE})
+    set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs")
   endif (WINDOWS)
 endif (NOT STANDALONE)
 

File indra/cmake/Pth.cmake

+# -*- cmake -*-
+include(Prebuilt)
+
+set(PTH_FIND_QUIETLY ON)
+set(PTH_FIND_REQUIRED ON)
+
+if (STANDALONE)
+#  ?? How would I construct FindPTH.cmake? This file was cloned from
+#  CURL.cmake, which uses include(FindCURL), but there's no FindCURL.cmake?
+#  include(FindPTH)
+else (STANDALONE)
+  # This library is only needed to support Boost.Coroutine, and only on Mac.
+  if (DARWIN)
+    use_prebuilt_binary(pth)
+    set(PTH_LIBRARIES pth)
+    set(PTH_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
+  else (DARWIN)
+    set(PTH_LIBRARIES)
+    set(PTH_INCLUDE_DIRS)
+  endif (DARWIN)
+endif (STANDALONE)

File indra/cmake/Variables.cmake

File contents unchanged.

File indra/cmake/run_build_test.py

+#!/usr/bin/python
+"""\
+@file   run_build_test.py
+@author Nat Goodspeed
+@date   2009-09-03
+@brief  Helper script to allow CMake to run some command after setting
+        environment variables.
+
+CMake has commands to run an external program. But remember that each CMake
+command must be backed by multiple build-system implementations. Unfortunately
+it seems CMake can't promise that every target build system can set specified
+environment variables before running the external program of interest.
+
+This helper script is a workaround. It simply sets the requested environment
+variables and then executes the program specified on the rest of its command
+line.
+
+Example:
+
+python run_build_test.py -DFOO=bar myprog somearg otherarg
+
+sets environment variable FOO=bar, then runs:
+myprog somearg otherarg
+
+$LicenseInfo:firstyear=2009&license=internal$
+Copyright (c) 2009, Linden Research, Inc.
+$/LicenseInfo$
+"""
+
+import os
+import sys
+import subprocess
+
+def main(command, libpath=[], vars={}):
+    """Pass:
+    command is a sequence (e.g. a list) of strings. The first item in the list
+    must be the command name, the rest are its arguments.
+
+    libpath is a sequence of directory pathnames. These will be appended to
+    the platform-specific dynamic library search path environment variable.
+
+    vars is a dict of arbitrary (var, value) pairs to be added to the
+    environment before running 'command'.
+
+    This function runs the specified command, waits for it to terminate and
+    returns its return code. This will be negative if the command terminated
+    with a signal, else it will be the process's specified exit code.
+    """
+    # Handle platform-dependent libpath first.
+    if sys.platform == "win32":
+        lpvars = ["PATH"]
+    elif sys.platform == "darwin":
+        lpvars = ["LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"]
+    elif sys.platform.startswith("linux"):
+        lpvars = ["LD_LIBRARY_PATH"]
+    else:
+        # No idea what the right pathname might be! But only crump if this
+        # feature is requested.
+        if libpath:
+            raise NotImplemented("run_build_test: unknown platform %s" % sys.platform)
+        lpvars = []
+    for var in lpvars:
+        # Split the existing path. Bear in mind that the variable in question
+        # might not exist; instead of KeyError, just use an empty string.
+        dirs = os.environ.get(var, "").split(os.pathsep)
+        # Append the sequence in libpath
+##         print "%s += %r" % (var, libpath)
+        dirs.extend(libpath)
+        # Now rebuild the path string. This way we use a minimum of separators
+        # -- and we avoid adding a pointless separator when libpath is empty.
+        os.environ[var] = os.pathsep.join(dirs)
+    # Now handle arbitrary environment variables. The tricky part is ensuring
+    # that all the keys and values we try to pass are actually strings.
+##     if vars:
+##         print "Setting:"
+##         for key, value in vars.iteritems():
+##             print "%s=%s" % (key, value)
+    os.environ.update(dict([(str(key), str(value)) for key, value in vars.iteritems()]))
+    # Run the child process.
+##     print "Running: %s" % " ".join(command)
+    return subprocess.call(command)
+
+if __name__ == "__main__":
+    from optparse import OptionParser
+    parser = OptionParser(usage="usage: %prog [options] command args...")
+    # We want optparse support for the options we ourselves handle -- but we
+    # DO NOT want it looking at options for the executable we intend to run,
+    # rejecting them as invalid because we don't define them. So configure the
+    # parser to stop looking for options as soon as it sees the first
+    # positional argument (traditional Unix syntax).
+    parser.disable_interspersed_args()
+    parser.add_option("-D", "--define", dest="vars", default=[], action="append",
+                      metavar="VAR=value",
+                      help="Add VAR=value to the env variables defined")
+    parser.add_option("-l", "--libpath", dest="libpath", default=[], action="append",
+                      metavar="DIR",
+                      help="Add DIR to the platform-dependent DLL search path")
+    opts, args = parser.parse_args()
+    # What we have in opts.vars is a list of strings of the form "VAR=value"
+    # or possibly just "VAR". What we want is a dict. We can build that dict by
+    # constructing a list of ["VAR", "value"] pairs -- so split each
+    # "VAR=value" string on the '=' sign (but only once, in case we have
+    # "VAR=some=user=string"). To handle the case of just "VAR", append "" to
+    # the list returned by split(), then slice off anything after the pair we
+    # want.
+    rc = main(command=args, libpath=opts.libpath,
+              vars=dict([(pair.split('=', 1) + [""])[:2] for pair in opts.vars]))
+    if rc not in (None, 0):
+        print >>sys.stderr, "Failure running: %s" % " ".join(args)
+        print >>sys.stderr, "Error: %s" % rc
+    sys.exit((rc < 0) and 255 or rc)

File indra/develop.py

             )
         if self.universal == 'ON':
             args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'i386;ppc\''
-            pass
         #if simple:
         #    return 'cmake %(opts)s %(dir)r' % args
         return ('cmake -G %(generator)r '

File indra/integration_tests/llui_libtest/CMakeLists.txt

File contents unchanged.

File indra/integration_tests/llui_libtest/llui_libtest.cpp

File contents unchanged.

File indra/integration_tests/llui_libtest/llwidgetreg.cpp

File contents unchanged.

File indra/integration_tests/llui_libtest/llwidgetreg.h

File contents unchanged.

File indra/lib/python/indra/util/test_win32_manifest.py

+#!/usr/bin/env python
+# @file test_win32_manifest.py
+# @brief Test an assembly binding version and uniqueness in a windows dll or exe.  
+#
+# $LicenseInfo:firstyear=2009&license=viewergpl$
+# 
+# Copyright (c) 2009, Linden Research, Inc.
+# 
+# Second Life Viewer Source Code
+# The source code in this file ("Source Code") is provided by Linden Lab
+# to you under the terms of the GNU General Public License, version 2.0
+# ("GPL"), unless you have obtained a separate licensing agreement
+# ("Other License"), formally executed by you and Linden Lab.  Terms of
+# the GPL can be found in doc/GPL-license.txt in this distribution, or
+# online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+# 
+# There are special exceptions to the terms and conditions of the GPL as
+# it is applied to this Source Code. View the full text of the exception
+# in the file doc/FLOSS-exception.txt in this software distribution, or
+# online at
+# http://secondlifegrid.net/programs/open_source/licensing/flossexception
+# 
+# By copying, modifying or distributing this software, you acknowledge
+# that you have read and understood your obligations described above,
+# and agree to abide by those obligations.
+# 
+# ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+# WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+# COMPLETENESS OR PERFORMANCE.
+# $/LicenseInfo$
+
+import sys, os
+import tempfile
+from xml.dom.minidom import parse
+
+class AssemblyTestException(Exception):
+    pass
+
+class NoManifestException(AssemblyTestException):
+    pass
+
+class MultipleBindingsException(AssemblyTestException):
+    pass
+
+class UnexpectedVersionException(AssemblyTestException):
+    pass
+
+class NoMatchingAssemblyException(AssemblyTestException):
+    pass
+
+def get_HKLM_registry_value(key_str, value_str):
+    import _winreg
+    reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
+    key = _winreg.OpenKey(reg, key_str)
+    value = _winreg.QueryValueEx(key, value_str)[0]
+    #print 'Found: %s' % value
+    return value
+        
+def find_vc_dir():
+    supported_versions = (r'8.0', r'9.0')
+    value_str = (r'ProductDir')
+    
+    for version in supported_versions:
+        key_str = (r'SOFTWARE\Microsoft\VisualStudio\%s\Setup\VC' %
+                   version)
+        try:
+            return get_HKLM_registry_value(key_str, value_str)
+        except WindowsError, err:
+            x64_key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
+                       version)
+            try:
+                return get_HKLM_registry_value(x64_key_str, value_str)
+            except:
+                print >> sys.stderr, "Didn't find MS VC version %s " % version
+        
+    raise
+
+def find_mt_path():
+    vc_dir = find_vc_dir()
+    mt_path = '\"%sbin\\mt.exe\"' % vc_dir
+    return mt_path
+    
+def test_assembly_binding(src_filename, assembly_name, assembly_ver):
+    print "checking %s dependency %s..." % (src_filename, assembly_name)
+
+    (tmp_file_fd, tmp_file_name) = tempfile.mkstemp(suffix='.xml')
+    tmp_file = os.fdopen(tmp_file_fd)
+    tmp_file.close()
+
+    mt_path = find_mt_path()
+    resource_id = ""
+    if os.path.splitext(src_filename)[1].lower() == ".dll":
+       resource_id = ";#2"
+    system_call = '%s -nologo -inputresource:%s%s -out:%s > NUL' % (mt_path, src_filename, resource_id, tmp_file_name)
+    print "Executing: %s" % system_call
+    mt_result = os.system(system_call)
+    if mt_result == 31:
+        print "No manifest found in %s" % src_filename
+        raise NoManifestException()
+
+    manifest_dom = parse(tmp_file_name)
+    nodes = manifest_dom.getElementsByTagName('assemblyIdentity')
+
+    versions = list()
+    for node in nodes:
+        if node.getAttribute('name') == assembly_name:
+            versions.append(node.getAttribute('version'))
+
+    if len(versions) == 0:
+        print "No matching assemblies found in %s" % src_filename
+        raise NoMatchingAssemblyException()
+        
+    elif len(versions) > 1:
+        print "Multiple bindings to %s found:" % assembly_name
+        print versions
+        print 
+        raise MultipleBindingsException(versions)
+
+    elif versions[0] != assembly_ver:
+        print "Unexpected version found for %s:" % assembly_name
+        print "Wanted %s, found %s" % (assembly_ver, versions[0])
+        print
+        raise UnexpectedVersionException(assembly_ver, versions[0])
+            
+    os.remove(tmp_file_name)
+    
+    print "SUCCESS: %s OK!" % src_filename
+    print
+  
+if __name__ == '__main__':
+
+    print
+    print "Running test_win32_manifest.py..."
+    
+    usage = 'test_win32_manfest <srcFileName> <assemblyName> <assemblyVersion>'
+
+    try:
+        src_filename = sys.argv[1]
+        assembly_name = sys.argv[2]
+        assembly_ver = sys.argv[3]
+    except:
+        print "Usage:"
+        print usage
+        print
+        raise
+    
+    test_assembly_binding(src_filename, assembly_name, assembly_ver)
+
+    

File indra/llcharacter/llcharacter.h

File contents unchanged.

File indra/llcommon/CMakeLists.txt

 include(00-Common)
 include(LLAddBuildTest)
 include(LLCommon)
+include(Linking)
 include(Boost)
+include (Pth)
+
+if (WINDOWS)
+    include(CopyWinLibs)
+endif (WINDOWS)
 
 include_directories(
     ${EXPAT_INCLUDE_DIRS}
     ${LLCOMMON_INCLUDE_DIRS}
     ${ZLIB_INCLUDE_DIRS}
+    ${PTH_INCLUDE_DIRS}
     )
 
 # add_executable(lltreeiterators lltreeiterators.cpp)
     llbase32.cpp
     llbase64.cpp
     llcommon.cpp
+    llcoros.cpp
     llcrc.cpp
     llcriticaldamp.cpp
     llcursortypes.cpp
     llerror.cpp
     llerrorthread.cpp
     llevent.cpp
+    lleventcoro.cpp
+    lleventdispatcher.cpp
+    lleventfilter.cpp
     llevents.cpp
     llfasttimer.cpp
     llfile.cpp
     llsdserialize_xml.cpp
     llsdutil.cpp
     llsecondlifeurls.cpp
+    llsingleton.cpp
     llstat.cpp
     llstacktrace.cpp
     llstreamtools.cpp
     llchat.h
     llclickaction.h
     llcommon.h
+    llcoros.h
     llcrc.h
     llcriticaldamp.h
     llcursortypes.h
     llerrorlegacy.h
     llerrorthread.h
     llevent.h
+    lleventcoro.h
+    lleventdispatcher.h
+    lleventfilter.h
     llevents.h
     lleventemitter.h
     llextendedstatus.h
     llhttpstatuscodes.h
     llindexedqueue.h
     llinstancetracker.h
+    llinstancetracker.h
     llkeythrottle.h
     lllazy.h
     lllinkedqueue.h
 
 list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES})
 
-add_library (llcommon ${llcommon_SOURCE_FILES})
+if(LLCOMMON_LINK_SHARED)
+    add_library (llcommon SHARED ${llcommon_SOURCE_FILES})
+
+    if(SHARED_LIB_STAGING_DIR)
+        # *FIX:Mani ---
+        # llcommon.dll get written to the DLL staging directory.
+        # Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
+        set_target_properties(llcommon PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
+        if(NOT WINDOWS)
+          get_target_property(LLCOMMON_PATH llcommon LOCATION)
+          get_filename_component(LLCOMMON_FILE ${LLCOMMON_PATH} NAME)
+          add_custom_command(
+            TARGET llcommon POST_BUILD
+            COMMAND ${CMAKE_COMMAND}
+            ARGS
+              -E
+              copy_if_different
+              ${LLCOMMON_PATH}
+              ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/${LLCOMMON_FILE}
+            COMMENT "Copying llcommon to the staging folder."
+            )
+        endif(NOT WINDOWS)
+    endif(SHARED_LIB_STAGING_DIR)
+
+    if (DARWIN)
+      set_target_properties(llcommon PROPERTIES
+        BUILD_WITH_INSTALL_RPATH 1
+        INSTALL_NAME_DIR "@executable_path/../Resources"
+        )
+    endif(DARWIN)
+
+else(LLCOMMON_LINK_SHARED)
+    add_library (llcommon ${llcommon_SOURCE_FILES})
+endif(LLCOMMON_LINK_SHARED)
+
 target_link_libraries(
     llcommon
     ${APRUTIL_LIBRARIES}
     ${APR_LIBRARIES}
     ${EXPAT_LIBRARIES}
     ${ZLIB_LIBRARIES}
+    ${WINDOWS_LIBRARIES}
     ${BOOST_PROGRAM_OPTIONS_LIBRARY}
     ${BOOST_REGEX_LIBRARY}
+    ${PTH_LIBRARIES}
     )
 
+add_dependencies(llcommon stage_third_party_libs)
+
 include(LLAddBuildTest)
 SET(llcommon_TEST_SOURCE_FILES
   )

File indra/llcommon/linden_common.h

 #ifdef LL_WINDOWS
 // Reenable warnings we disabled above
 #pragma warning (3 : 4702) // unreachable code, we like level 3, not 4
-// level 4 warnings that we need to disable:
-#pragma warning (disable : 4100) // unreferenced formal parameter
-#pragma warning (disable : 4127) // conditional expression is constant (e.g. while(1) )
-#pragma warning (disable : 4244) // possible loss of data on conversions
-#pragma warning (disable : 4396) // the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
-#pragma warning (disable : 4512) // assignment operator could not be generated
-#pragma warning (disable : 4706) // assignment within conditional (even if((x = y)) )
+// moved msvc warnings to llpreprocessor.h  *TODO - delete this comment after merge conflicts are unlikely -brad
 #endif	//	LL_WINDOWS
 
 // Linden only libs in alpha-order other than stdtypes.h

File indra/llcommon/llallocator.h

-/** 
- * @file llallocator.h
- * @brief Declaration of the LLAllocator class.
- *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * 
- * Copyright (c) 2009-2009, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLALLOCATOR_H
-#define LL_LLALLOCATOR_H
-
-#include <string>
-
-#include "llmemtype.h"
-#include "llallocator_heap_profile.h"
-
-class LLAllocator {
-    friend class LLMemoryView;
-    friend class LLMemType;
-
-private:
-	static void pushMemType(S32 type);
-	static S32 popMemType();
-
-public:
-    void setProfilingEnabled(bool should_enable);
-
-    static bool isProfiling();
-
-    LLAllocatorHeapProfile const & getProfile();
-
-private:
-    std::string getRawProfile();
-
-private:
-    LLAllocatorHeapProfile mProf;
-};
-
-#endif // LL_LLALLOCATOR_H
+/** 
+ * @file llallocator.h
+ * @brief Declaration of the LLAllocator class.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * 
+ * Copyright (c) 2009-2009, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *