Merge. Pull in viewer-release reflecting new release structure.

Thu, 30 May 2013 21:28:02 +0000

author
Monty Brandenberg <monty@lindenlab.com>
date
Thu, 30 May 2013 21:28:02 +0000
changeset 40714
09d692569c32
parent 40674
e871c50e5754
parent 36234
41898042294e
child 40715
b0fe9917d9bd

Merge. Pull in viewer-release reflecting new release structure.

indra/cmake/CSharpMacros.cmake file | annotate | diff | revisions
indra/cmake/CopyBackToSource.cmake file | annotate | diff | revisions
indra/cmake/Externals.cmake file | annotate | diff | revisions
indra/cmake/FMOD.cmake file | annotate | diff | revisions
indra/cmake/FindELFIO.cmake file | annotate | diff | revisions
indra/cmake/FindFMOD.cmake file | annotate | diff | revisions
indra/cmake/FindLLQtWebkit.cmake file | annotate | diff | revisions
indra/cmake/FindMT.cmake file | annotate | diff | revisions
indra/cmake/FindMono.cmake file | annotate | diff | revisions
indra/cmake/FindMySQL.cmake file | annotate | diff | revisions
indra/cmake/FindSVN.cmake file | annotate | diff | revisions
indra/cmake/LLDatabase.cmake file | annotate | diff | revisions
indra/cmake/LLScene.cmake file | annotate | diff | revisions
indra/cmake/LLXUIXML.cmake file | annotate | diff | revisions
indra/cmake/MonoDeps.cmake file | annotate | diff | revisions
indra/cmake/MonoEmbed.cmake file | annotate | diff | revisions
indra/cmake/MySQL.cmake file | annotate | diff | revisions
indra/llaudio/llaudioengine_fmod.cpp file | annotate | diff | revisions
indra/llaudio/llaudioengine_fmod.h file | annotate | diff | revisions
indra/llaudio/lllistener_fmod.cpp file | annotate | diff | revisions
indra/llaudio/lllistener_fmod.h file | annotate | diff | revisions
indra/llaudio/llstreamingaudio_fmod.cpp file | annotate | diff | revisions
indra/llaudio/llstreamingaudio_fmod.h file | annotate | diff | revisions
indra/llcommon/CMakeLists.txt file | annotate | diff | revisions
indra/llcommon/lltimer.h file | annotate | diff | revisions
indra/llcommon/llversionviewer.h file | annotate | diff | revisions
indra/llui/lluiimage.cpp file | annotate | diff | revisions
indra/llui/lluiimage.h file | annotate | diff | revisions
indra/mac_updater/AutoUpdater.nib/classes.nib file | annotate | diff | revisions
indra/mac_updater/AutoUpdater.nib/info.nib file | annotate | diff | revisions
indra/mac_updater/AutoUpdater.nib/objects.xib file | annotate | diff | revisions
indra/mac_updater/CMakeLists.txt file | annotate | diff | revisions
indra/mac_updater/Info.plist file | annotate | diff | revisions
indra/mac_updater/mac_updater.cpp file | annotate | diff | revisions
indra/mac_updater/mac_updater.h file | annotate | diff | revisions
indra/newview/fmod_hidden_symbols.exp file | annotate | diff | revisions
indra/newview/fmodwrapper.cpp file | annotate | diff | revisions
indra/newview/icons/development/secondlife.icns file | annotate | diff | revisions
indra/newview/icons/development/secondlife.ico file | annotate | diff | revisions
indra/newview/icons/development/secondlife_128.png file | annotate | diff | revisions
indra/newview/icons/development/secondlife_16.png file | annotate | diff | revisions
indra/newview/icons/development/secondlife_256.BMP file | annotate | diff | revisions
indra/newview/icons/development/secondlife_256.png file | annotate | diff | revisions
indra/newview/icons/development/secondlife_32.png file | annotate | diff | revisions
indra/newview/icons/development/secondlife_48.png file | annotate | diff | revisions
indra/newview/icons/development/secondlife_512.png file | annotate | diff | revisions
indra/newview/lldriverparam.cpp file | annotate | diff | revisions
indra/newview/lldriverparam.h file | annotate | diff | revisions
indra/newview/lllocaltextureobject.cpp file | annotate | diff | revisions
indra/newview/lllocaltextureobject.h file | annotate | diff | revisions
indra/newview/llmeshrepository.cpp file | annotate | diff | revisions
indra/newview/llmeshrepository.h file | annotate | diff | revisions
indra/newview/llpolymesh.cpp file | annotate | diff | revisions
indra/newview/llpolymesh.h file | annotate | diff | revisions
indra/newview/llpolymorph.cpp file | annotate | diff | revisions
indra/newview/llpolymorph.h file | annotate | diff | revisions
indra/newview/lltexglobalcolor.cpp file | annotate | diff | revisions
indra/newview/lltexglobalcolor.h file | annotate | diff | revisions
indra/newview/lltexlayer.cpp file | annotate | diff | revisions
indra/newview/lltexlayer.h file | annotate | diff | revisions
indra/newview/lltexlayerparams.cpp file | annotate | diff | revisions
indra/newview/lltexlayerparams.h file | annotate | diff | revisions
indra/newview/llviewervisualparam.cpp file | annotate | diff | revisions
indra/newview/llviewervisualparam.h file | annotate | diff | revisions
indra/newview/llvoavatardefines.cpp file | annotate | diff | revisions
indra/newview/llvoavatardefines.h file | annotate | diff | revisions
indra/newview/llwearable.cpp file | annotate | diff | revisions
indra/newview/llwearable.h file | annotate | diff | revisions
indra/newview/llwearabletype.cpp file | annotate | diff | revisions
indra/newview/llwearabletype.h file | annotate | diff | revisions
indra/viewer_components/updater/scripts/darwin/update_install file | annotate | diff | revisions
scripts/build_version.py file | annotate | diff | revisions
scripts/update_version_files.py file | annotate | diff | revisions
     1.1 --- a/.hgignore	Thu May 02 19:12:59 2013 -0400
     1.2 +++ b/.hgignore	Thu May 30 21:28:02 2013 +0000
     1.3 @@ -10,7 +10,7 @@
     1.4  .*.swp
     1.5  #OSX image cache file
     1.6  *.DS_Store
     1.7 -*.orig
     1.8 +#*.orig
     1.9  LICENSES
    1.10  indra/.distcc
    1.11  build-linux-*
    1.12 @@ -50,6 +50,11 @@
    1.13  installed.xml
    1.14  libraries
    1.15  tarfile_tmp
    1.16 +debian/secondlife-viewer*
    1.17 +debian/secondlife-appearance-utility*
    1.18 +debian/files
    1.19 +build-stamp
    1.20 +configure-stamp
    1.21  ^indra/lib/python/mulib.*
    1.22  ^web/locale.*
    1.23  ^web/secondlife.com.*
    1.24 @@ -69,4 +74,4 @@
    1.25  glob:indra/newview/avatar_icons_cache.txt
    1.26  glob:indra/newview/avatar_lad.log
    1.27  glob:*.diff
    1.28 -*.rej
    1.29 +#*.rej
     2.1 --- a/.hgtags	Thu May 02 19:12:59 2013 -0400
     2.2 +++ b/.hgtags	Thu May 30 21:28:02 2013 +0000
     2.3 @@ -434,3 +434,26 @@
     2.4  902caf2b9fdbdbc5c399c4d5ebcecaf9cb97bab8 DRTVWR-306
     2.5  5c6098fd17d40ee3a38ca6b64f6be9db7f61f0a8 3.5.0-beta7
     2.6  adc360e6bf21390d2665380951d85937cd29a604 3.5.0-release
     2.7 +1ada73295ed0eaa4a772ef079c29f57069342c32 DRTVWR-310
     2.8 +20cdf370f5c8be6193bef6fb3a81cc3f81275191 3.5.1-beta1
     2.9 +2319904200de367646b9a9442239a38d52c1eeb5 DRTVWR-313
    2.10 +9d8726eca785acad694564516f16dd639faf45c0 3.5.1-beta2
    2.11 +4b7fa963b80e2056ab648f83a4d61310b3cedb3d DRTVWR-314
    2.12 +65ae89aeb7ea674a555e439e963f17949322ac94 3.5.1-beta3
    2.13 +13149a524874b608aeb76325b35faff113a5ea53 3.5.1-release
    2.14 +78a8fe6abf331944d6b6bb1ce1024a6bc08141f4 DRTVWR-298
    2.15 +50ccc12f38c3c99f03b374e32429cb043b73e2a6 DRTVWR-294
    2.16 +c2b1066514308dff1eeb91162392dfe08bf1c0fe DRTVWR-309
    2.17 +e6b8a92acffd693cd1459e4212e3dff1050acf67 DRTVWR-278
    2.18 +106f19cc011aafdfc9a6d12b641fe8db6e9735a7 3.5.2-beta1
    2.19 +509b97acc4ca1f2644197f1b555773ac0bb6838c 3.5.2-beta2
    2.20 +6cb3689d89c13876ce8fa8faefa7b05e4279502d DRTVWR-316
    2.21 +cfc3e650e5b2063288e7b832e9c9f521bbdacc92 DRTVWR-315
    2.22 +e6e35501f1fea252ef83080adcf30c3cb7c2f75c DRTVWR-299
    2.23 +b6a4ac8f1916ede76e8a023e1cf35c045d0ac707 3.5.2-beta3
    2.24 +a314f1c94374ab1f6633dd2983f7090a68663eb2 3.5.2-beta4
    2.25 +1cfa86d604909dfdb8b372069ff61f9afaa2aac1 MAINT-2647
    2.26 +895628bb5e162410cfdf4bca58f0a57d22ccfcde 3.5.2-beta5
    2.27 +9013c07bfe1c51107233f1924dccdcc5057dd909 3.5.2-beta6
    2.28 +9b1b6f33aa5394b27bb652b31b5cb81ef6060370 3.5.2-release
    2.29 +a277b841729f2a62ba1e34acacc964bc13c1ad6f 3.5.3-release
     3.1 --- a/BuildParams	Thu May 02 19:12:59 2013 -0400
     3.2 +++ b/BuildParams	Thu May 30 21:28:02 2013 +0000
     3.3 @@ -21,50 +21,49 @@
     3.4  # Limit extent of codeticket updates to revisions after...
     3.5  codeticket_since = 3.3.0-release
     3.6  
     3.7 -# ========================================
     3.8 -# Viewer Development
     3.9 -# ========================================
    3.10 +# Override build system default toolchain
    3.11 +# Note that this will only affect automated builds.
    3.12 +Linux.gcc_version = /usr/bin/gcc-4.6
    3.13 +Linux.cxx_version = /usr/bin/g++-4.6
    3.14 +
    3.15 +################################################################
    3.16 +####      Examples of how to set the viewer_channel         ####
    3.17 +#
    3.18 +# To build a Release or Release candidate in build bingo:
    3.19 +#    bingo.viewer_channel = "Second Life Release"
    3.20 +#
    3.21 +# To build a Beta for the 'Bingo' project in build bingo:
    3.22 +#    bingo.viewer_channel = "Second Life Beta Bingo"
    3.23 +#
    3.24 +# To build a Project viewer for the 'Bingo' project in build bingo:
    3.25 +#    bingo.viewer_channel = "Second Life Project Bingo"
    3.26 +#
    3.27 +# If left unset, viewer_channel defaults to 'Second Life Test',
    3.28 +# which is appropriate for individual developer builds.
    3.29 +#
    3.30 +# All Linden Lab builds (and only Linden Lab builds)
    3.31 +# should use a viewer_channel that begins with "Second Life"
    3.32 +################################################################
    3.33 +viewer_channel = "Second Life Test"
    3.34  
    3.35  # Report changes since...
    3.36  viewer-development.show_changes_since = last_sprint
    3.37  
    3.38  # Build Settings
    3.39 -viewer-development_coverity.coverity_product = viewer
    3.40 -viewer-development_coverity.run_tests = false
    3.41  viewer-development.build_debug_release_separately = true
    3.42  
    3.43  # Notifications - to configure email notices, add a setting like this:
    3.44  # <username>_<reponame>.email = <email-address>
    3.45  
    3.46 -
    3.47 -# =================================================================
    3.48 -# Canonical viewer integration builds - Oz Linden
    3.49 -# =================================================================
    3.50 -integration_viewer-development.viewer_channel = "Second Life Development"
    3.51 -integration_viewer-development.login_channel = "Second Life Development"
    3.52 -integration_viewer-development.build_viewer_update_version_manager = false
    3.53 -integration_viewer-development.email = viewer-development-builds@lists.secondlife.com
    3.54 -integration_viewer-development.build_enforce_coding_policy = false
    3.55 -integration_viewer-development.codeticket_add_context = false
    3.56 -
    3.57 -viewer-beta.viewer_channel = "Second Life Beta Viewer"
    3.58 -viewer-beta.login_channel = "Second Life Beta Viewer"
    3.59 -viewer-beta.build_debug_release_separately = true
    3.60 -viewer-beta.build_viewer_update_version_manager = true
    3.61 -viewer-beta.codeticket_add_context = false
    3.62 -
    3.63  viewer-release.viewer_channel = "Second Life Release"
    3.64 -viewer-release.login_channel = "Second Life Release"
    3.65  viewer-release.build_debug_release_separately = true
    3.66  viewer-release.build_viewer_update_version_manager = true
    3.67  viewer-release.codeticket_add_context = false
    3.68  
    3.69 -
    3.70  # ========================================
    3.71  # mesh-development
    3.72  # ========================================
    3.73  mesh-development.viewer_channel = "Project Viewer - Mesh"
    3.74 -mesh-development.login_channel = "Project Viewer - Mesh"
    3.75  mesh-development.viewer_grid = aditi
    3.76  mesh-development.build_debug_release_separately = true
    3.77  mesh-development.build_CYGWIN_Debug = false
    3.78 @@ -74,7 +73,6 @@
    3.79  # mesh-development-release-1-candidate
    3.80  # ========================================
    3.81  mesh-development-release-1-candidate.viewer_channel = "Project Viewer - Mesh"
    3.82 -mesh-development-release-1-candidate.login_channel = "Project Viewer - Mesh"
    3.83  mesh-development-release-1-candidate.viewer_grid = agni
    3.84  mesh-development-release-1-candidate.build_debug_release_separately = true
    3.85  mesh-development-release-1-candidate.build_CYGWIN_Debug = false
    3.86 @@ -84,7 +82,6 @@
    3.87  # mesh-development-rc
    3.88  # ========================================
    3.89  mesh-development-rc.viewer_channel = "Project Viewer - Mesh"
    3.90 -mesh-development-rc.login_channel = "Project Viewer - Mesh"
    3.91  mesh-development-rc.viewer_grid = agni
    3.92  mesh-development-rc.build_debug_release_separately = true
    3.93  mesh-development-rc.build_CYGWIN_Debug = false
    3.94 @@ -94,7 +91,6 @@
    3.95  # mesh-asset-deprecation
    3.96  # ========================================
    3.97  mesh-asset-deprecation.viewer_channel = "Project Viewer - Mesh Asset Deprecation"
    3.98 -mesh-asset-deprecation.login_channel = "Project Viewer - Mesh Asset Deprecation"
    3.99  mesh-asset-deprecation.viewer_grid = aditi
   3.100  mesh-asset-deprecation.build_debug_release_separately = true
   3.101  mesh-asset-deprecation.build_CYGWIN_Debug = false
   3.102 @@ -112,7 +108,6 @@
   3.103  viewer-mesh.build_Debug = false
   3.104  viewer-mesh.build_RelWithDebInfo = false
   3.105  viewer-mesh.viewer_channel = "Project Viewer - Mesh"
   3.106 -viewer-mesh.login_channel = "Project Viewer - Mesh"
   3.107  viewer-mesh.viewer_grid = aditi
   3.108  viewer-mesh.email = shining@lists.lindenlab.com
   3.109  
   3.110 @@ -121,7 +116,6 @@
   3.111  # ========================================
   3.112  
   3.113  viewer-pathfinding.viewer_channel = "Project Viewer - Pathfinding"
   3.114 -viewer-pathfinding.login_channel = "Project Viewer - Pathfinding"
   3.115  viewer-pathfinding.viewer_grid = agni
   3.116  viewer-pathfinding.build_debug_release_separately = true
   3.117  viewer-pathfinding.build_CYGWIN_Debug = false
   3.118 @@ -143,14 +137,12 @@
   3.119  # asset delivery 2010 projects
   3.120  # =================================================================
   3.121  viewer-asset-delivery.viewer_channel = "Second Life Development"
   3.122 -viewer-asset-delivery.login_channel = "Second Life Development"
   3.123  viewer-asset-delivery.build_viewer_update_version_manager = false
   3.124  viewer-asset-delivery.email = monty@lindenlab.com
   3.125  viewer-asset-delivery.build_server = false
   3.126  viewer-asset-delivery.build_server_tests = false
   3.127  
   3.128  viewer-asset-delivery-metrics.viewer_channel = "Second Life Development"
   3.129 -viewer-asset-delivery-metrics.login_channel = "Second Life Development"
   3.130  viewer-asset-delivery-metrics.build_viewer_update_version_manager = false
   3.131  viewer-asset-delivery-metrics.email = monty@lindenlab.com
   3.132  viewer-asset-delivery-metrics.build_server = false
   3.133 @@ -167,34 +159,29 @@
   3.134  # Vir
   3.135  # ========================================
   3.136  vir-project-1.viewer_channel = "Second Life Release"
   3.137 -vir-project-1.login_channel = "Second Life Release"
   3.138  
   3.139  # ========================================
   3.140  # THX-1138 / Runway projects
   3.141  # ========================================
   3.142  viewer-thx1138-runway-shared.viewer_channel = "Project Viewer - THX-1138 Runway"
   3.143 -viewer-thx1138-runway-shared.login_channel = "Project Viewer - THX-1138 Runway"
   3.144  viewer-thx1138-runway-shared.viewer_grid = uma
   3.145  viewer-thx1138-runway-shared.build_debug_release_separately = true
   3.146  viewer-thx1138-runway-shared.build_CYGWIN_Debug = false
   3.147  viewer-thx1138-runway-shared.build_viewer_update_version_manager = false
   3.148  
   3.149  viewer-thx1138.viewer_channel = "Project Viewer - THX-1138"
   3.150 -viewer-thx1138.login_channel = "Project Viewer - THX-1138"
   3.151  viewer-thx1138.viewer_grid = uma
   3.152  viewer-thx1138.build_debug_release_separately = true
   3.153  viewer-thx1138.build_CYGWIN_Debug = false
   3.154  viewer-thx1138.build_viewer_update_version_manager = false
   3.155  
   3.156  runway-merge.viewer_channel = "Project Viewer - Runway Merge"
   3.157 -runway-merge.login_channel = "Project Viewer - Runway Merge"
   3.158  runway-merge.viewer_grid = agni
   3.159  runway-merge.build_debug_release_separately = true
   3.160  runway-merge.build_CYGWIN_Debug = false
   3.161  runway-merge.build_viewer_update_version_manager = false
   3.162  
   3.163  runway.viewer_channel = "Project Viewer - Runway"
   3.164 -runway.login_channel = "Project Viewer - Runway"
   3.165  runway.viewer_grid = agni
   3.166  runway.build_debug_release_separately = true
   3.167  runway.build_CYGWIN_Debug = false
     4.1 --- a/autobuild.xml	Thu May 02 19:12:59 2013 -0400
     4.2 +++ b/autobuild.xml	Thu May 30 21:28:02 2013 +0000
     4.3 @@ -18,9 +18,9 @@
     4.4              <key>archive</key>
     4.5              <map>
     4.6                <key>hash</key>
     4.7 -              <string>b2fe1c860613a68e74d4384be418ffee</string>
     4.8 +              <string>e6071abd822c0688390382a26f8a782c</string>
     4.9                <key>url</key>
    4.10 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/232684/arch/Darwin/installer/glod-1.0pre4-darwin-20110610.tar.bz2</string>
    4.11 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/267984/arch/Darwin/installer/glod-1.0pre4-darwin-20121211.tar.bz2</string>
    4.12              </map>
    4.13              <key>name</key>
    4.14              <string>darwin</string>
    4.15 @@ -30,9 +30,9 @@
    4.16              <key>archive</key>
    4.17              <map>
    4.18                <key>hash</key>
    4.19 -              <string>c0c64dae149d0892343e2ff300fd06b9</string>
    4.20 +              <string>176736c52b3cde6ca8e7d9e173d91731</string>
    4.21                <key>url</key>
    4.22 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/232684/arch/Linux/installer/glod-1.0pre4-linux-20110611.tar.bz2</string>
    4.23 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/268002/arch/Linux/installer/glod-1.0pre4-linux-20121212.tar.bz2</string>
    4.24              </map>
    4.25              <key>name</key>
    4.26              <string>linux</string>
    4.27 @@ -186,9 +186,9 @@
    4.28              <key>archive</key>
    4.29              <map>
    4.30                <key>hash</key>
    4.31 -              <string>ac37d0038c91b0672fa31a02731f0eac</string>
    4.32 +              <string>06dd7af75e1eb179aed54fd58d8688af</string>
    4.33                <key>url</key>
    4.34 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/Darwin/installer/boost-1.52.0-darwin-20121218.tar.bz2</string>
    4.35 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/270698/arch/Darwin/installer/boost-1.52.0-darwin-20130221.tar.bz2</string>
    4.36              </map>
    4.37              <key>name</key>
    4.38              <string>darwin</string>
    4.39 @@ -198,9 +198,9 @@
    4.40              <key>archive</key>
    4.41              <map>
    4.42                <key>hash</key>
    4.43 -              <string>146ed8a8c2ef8ab3f0a6c4f214fc5c22</string>
    4.44 +              <string>50c8b50b7cced52cc5656fb44e9b12cf</string>
    4.45                <key>url</key>
    4.46 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/Linux/installer/boost-1.52.0-linux-20121218.tar.bz2</string>
    4.47 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/270698/arch/Linux/installer/boost-1.52.0-linux-20130222.tar.bz2</string>
    4.48              </map>
    4.49              <key>name</key>
    4.50              <string>linux</string>
    4.51 @@ -210,9 +210,9 @@
    4.52              <key>archive</key>
    4.53              <map>
    4.54                <key>hash</key>
    4.55 -              <string>3ea60f17d986b7e8a3351298734bdca4</string>
    4.56 +              <string>742fc9675b033df7f9c6f215ff250f6c</string>
    4.57                <key>url</key>
    4.58 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/CYGWIN/installer/boost-1.52.0-windows-20121218.tar.bz2</string>
    4.59 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/270698/arch/CYGWIN/installer/boost-1.52.0-windows-20130221.tar.bz2</string>
    4.60              </map>
    4.61              <key>name</key>
    4.62              <string>windows</string>
    4.63 @@ -483,14 +483,14 @@
    4.64            </map>
    4.65          </map>
    4.66        </map>
    4.67 -      <key>fmod</key>
    4.68 +      <key>fmodex</key>
    4.69        <map>
    4.70          <key>license</key>
    4.71 -        <string>fmod</string>
    4.72 +        <string>fmodex</string>
    4.73          <key>license_file</key>
    4.74 -        <string>LICENSES/fmod.txt</string>
    4.75 +        <string>LICENSES/fmodex.txt</string>
    4.76          <key>name</key>
    4.77 -        <string>fmod</string>
    4.78 +        <string>fmodex</string>
    4.79          <key>platforms</key>
    4.80          <map>
    4.81            <key>darwin</key>
    4.82 @@ -498,9 +498,9 @@
    4.83              <key>archive</key>
    4.84              <map>
    4.85                <key>hash</key>
    4.86 -              <string>61ead113e6479452e6b690c84b4e9d30</string>
    4.87 +	      <string>10352aab979c333a52dbad21b6e6fba9</string>
    4.88                <key>url</key>
    4.89 -              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/Darwin/installer/fmod-3.75-darwin-20110222.tar.bz2</string>
    4.90 +	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/274403/arch/Darwin/installer/fmodex-4.44-darwin-20130419.tar.bz2</string>
    4.91              </map>
    4.92              <key>name</key>
    4.93              <string>darwin</string>
    4.94 @@ -510,9 +510,9 @@
    4.95              <key>archive</key>
    4.96              <map>
    4.97                <key>hash</key>
    4.98 -              <string>0c61d643db54d2e5999be8254569d8b3</string>
    4.99 +          <string>79e45527aa9fb90b813599dff5ce01a7</string>
   4.100                <key>url</key>
   4.101 -              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/Linux/installer/fmod-3.75-linux-20110223.tar.bz2</string>
   4.102 +              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/274378/arch/Linux/installer/fmodex-4.44-linux-20130419.tar.bz2</string>
   4.103              </map>
   4.104              <key>name</key>
   4.105              <string>linux</string>
   4.106 @@ -522,9 +522,9 @@
   4.107              <key>archive</key>
   4.108              <map>
   4.109                <key>hash</key>
   4.110 -              <string>d9a9a6ad86895353bcd63374a4c1a91d</string>
   4.111 +	      <string>0980cdf98a322a780ba739e324d0b955</string>
   4.112                <key>url</key>
   4.113 -              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/CYGWIN/installer/fmod-3.75-windows-20110222.tar.bz2</string>
   4.114 +	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/274401/arch/CYGWIN/installer/fmodex-4.44-windows-20130419.tar.bz2</string>
   4.115              </map>
   4.116              <key>name</key>
   4.117              <string>windows</string>
   4.118 @@ -606,9 +606,9 @@
   4.119              <key>archive</key>
   4.120              <map>
   4.121                <key>hash</key>
   4.122 -              <string>9f8a9dc39fd7c3da0fb3533782d1fddf</string>
   4.123 +              <string>bd6f84f9fb3c2e68850676d06935373f</string>
   4.124                <key>url</key>
   4.125 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-freetype/rev/226814/arch/Linux/installer/freetype-2.3.9-linux-20110418.tar.bz2</string>
   4.126 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-freetype/rev/271684/arch/Linux/installer/freetype-2.4.4-linux-20130312.tar.bz2</string>
   4.127              </map>
   4.128              <key>name</key>
   4.129              <string>linux</string>
   4.130 @@ -690,9 +690,9 @@
   4.131              <key>archive</key>
   4.132              <map>
   4.133                <key>hash</key>
   4.134 -              <string>26f2df1f0b0fa01e94e0253e322f3583</string>
   4.135 +              <string>1b1f1e9975e3a671c9faf32fcf4b6d43</string>
   4.136                <key>url</key>
   4.137 -              <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glh_linear-linux-20101001.tar.bz2</string>
   4.138 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glh_linear/rev/263308/arch/Linux/installer/glh_linear-0.0.0-linux-20120810.tar.bz2</string>
   4.139              </map>
   4.140              <key>name</key>
   4.141              <string>linux</string>
   4.142 @@ -747,6 +747,7 @@
   4.143            </map>
   4.144          </map>
   4.145        </map>
   4.146 +
   4.147        <key>google_breakpad</key>
   4.148        <map>
   4.149          <key>license</key>
   4.150 @@ -761,10 +762,10 @@
   4.151            <map>
   4.152              <key>archive</key>
   4.153              <map>
   4.154 -              <key>hash</key>
   4.155 -              <string>21babc394dbf8572830f2e85adec7b9f</string>
   4.156 -              <key>url</key>
   4.157 -              <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-darwin-20110202.tar.bz2</string>
   4.158 +           <key>hash</key>
   4.159 +	   <string>aff5566e04003de0383941981198e04e</string>
   4.160 +          <key>url</key>
   4.161 +          <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273073/arch/Darwin/installer/google_breakpad-0.0.0-rev1099-darwin-20130329.tar.bz2</string>
   4.162              </map>
   4.163              <key>name</key>
   4.164              <string>darwin</string>
   4.165 @@ -773,10 +774,10 @@
   4.166            <map>
   4.167              <key>archive</key>
   4.168              <map>
   4.169 -              <key>hash</key>
   4.170 -              <string>204b02a9480c411232255798839431a2</string>
   4.171 -              <key>url</key>
   4.172 -              <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-linux-20110311.tar.bz2</string>
   4.173 +             <key>hash</key>
   4.174 +	         <string>52257e5eb166a0b69c9c0c38f6e1920e</string>
   4.175 +             <key>url</key>
   4.176 +	         <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273079/arch/Linux/installer/google_breakpad-0.0.0-rev1099-linux-20130329.tar.bz2</string>
   4.177              </map>
   4.178              <key>name</key>
   4.179              <string>linux</string>
   4.180 @@ -786,9 +787,9 @@
   4.181              <key>archive</key>
   4.182              <map>
   4.183                <key>hash</key>
   4.184 -              <string>627c51136e14e64c5d39933f3abd3bdf</string>
   4.185 +	      <string>d812a6dfcabe6528198a3191068dac09</string>
   4.186                <key>url</key>
   4.187 -              <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-windows-20110218.tar.bz2</string>
   4.188 +             <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273073/arch/CYGWIN/installer/google_breakpad-0.0.0-rev1099-windows-20130329.tar.bz2</string>
   4.189              </map>
   4.190              <key>name</key>
   4.191              <string>windows</string>
   4.192 @@ -834,9 +835,45 @@
   4.193              <key>archive</key>
   4.194              <map>
   4.195                <key>hash</key>
   4.196 -              <string>212701468920519f3989677cea9ca4f1</string>
   4.197 +              <string>98994d5b0b4b3d43be22aa6a5c36e6fa</string>
   4.198                <key>url</key>
   4.199 -              <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gmock-1.5.0-windows-20110224.tar.bz2</string>
   4.200 +		<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-mock-graham/rev/272961/arch/CYGWIN/installer/gmock-1.6.0-windows-20130327.tar.bz2</string>
   4.201 +            </map>
   4.202 +            <key>name</key>
   4.203 +            <string>windows</string>
   4.204 +          </map>
   4.205 +        </map>
   4.206 +      </map>
   4.207 +      <key>gperftools</key>
   4.208 +      <map>
   4.209 +        <key>license</key>
   4.210 +        <string>bsd</string>
   4.211 +        <key>license_file</key>
   4.212 +        <string>LICENSES/gperftools.txt</string>
   4.213 +        <key>name</key>
   4.214 +        <string>gperftools</string>
   4.215 +        <key>platforms</key>
   4.216 +        <map>
   4.217 +          <key>linux</key>
   4.218 +          <map>
   4.219 +            <key>archive</key>
   4.220 +            <map>
   4.221 +              <key>hash</key>
   4.222 +              <string>8aedfdcf670348c18a9991ae1b384a61</string>
   4.223 +              <key>url</key>
   4.224 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/Linux/installer/gperftools-2.0-linux-20120727.tar.bz2</string>
   4.225 +            </map>
   4.226 +            <key>name</key>
   4.227 +            <string>linux</string>
   4.228 +          </map>
   4.229 +          <key>windows</key>
   4.230 +          <map>
   4.231 +            <key>archive</key>
   4.232 +            <map>
   4.233 +              <key>hash</key>
   4.234 +              <string>f62841804acb91e1309603a84f3f0ce8</string>
   4.235 +              <key>url</key>
   4.236 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/CYGWIN/installer/gperftools-2.0-windows-20120727.tar.bz2</string>
   4.237              </map>
   4.238              <key>name</key>
   4.239              <string>windows</string>
   4.240 @@ -1239,6 +1276,32 @@
   4.241            </map>
   4.242          </map>
   4.243        </map>
   4.244 +      <key>llappearanceutility-source</key>
   4.245 +      <map>
   4.246 +        <key>license</key>
   4.247 +        <string>TEMPORARY</string>
   4.248 +        <key>license_file</key>
   4.249 +        <string>LICENSES/llappearanceutility.txt</string>
   4.250 +        <key>name</key>
   4.251 +        <string>llappearanceutility-source</string>
   4.252 +        <key>platforms</key>
   4.253 +        <map>
   4.254 +          <key>linux</key>
   4.255 +          <map>
   4.256 +            <key>archive</key>
   4.257 +            <map>
   4.258 +              <key>hash</key>
   4.259 +              <string>5bc44db15eb3cca021382e40e04a9a38</string>
   4.260 +              <key>url</key>
   4.261 +              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/271972/arch/Linux/installer/llappearanceutility_source-0.1-linux-20130315.tar.bz2</string>
   4.262 +            </map>
   4.263 +            <key>name</key>
   4.264 +            <string>linux</string>
   4.265 +          </map>
   4.266 +        </map>
   4.267 +        <key>version</key>
   4.268 +        <string>0.1</string>
   4.269 +      </map>
   4.270        <key>llphysicsextensions_source</key>
   4.271        <map>
   4.272          <key>license</key>
   4.273 @@ -1268,9 +1331,9 @@
   4.274              <key>archive</key>
   4.275              <map>
   4.276                <key>hash</key>
   4.277 -              <string>b706fdeed4ce2182d434043dc33d9d1d</string>
   4.278 +              <string>a6856b4d58a3b71321acad7e1fa9c8d4</string>
   4.279                <key>url</key>
   4.280 -              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/Linux/installer/llphysicsextensions_source-0.3-linux-20120814.tar.bz2</string>
   4.281 +              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/265749/arch/Linux/installer/llphysicsextensions_source-0.3-linux-20121011.tar.bz2</string>
   4.282              </map>
   4.283              <key>name</key>
   4.284              <string>linux</string>
   4.285 @@ -1779,42 +1842,6 @@
   4.286            </map>
   4.287          </map>
   4.288        </map>
   4.289 -      <key>tcmalloc</key>
   4.290 -      <map>
   4.291 -        <key>license</key>
   4.292 -        <string>bsd</string>
   4.293 -        <key>license_file</key>
   4.294 -        <string>LICENSES/google-perftools.txt</string>
   4.295 -        <key>name</key>
   4.296 -        <string>tcmalloc</string>
   4.297 -        <key>platforms</key>
   4.298 -        <map>
   4.299 -          <key>linux</key>
   4.300 -          <map>
   4.301 -            <key>archive</key>
   4.302 -            <map>
   4.303 -              <key>hash</key>
   4.304 -              <string>8aedfdcf670348c18a9991ae1b384a61</string>
   4.305 -              <key>url</key>
   4.306 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/Linux/installer/gperftools-2.0-linux-20120727.tar.bz2</string>
   4.307 -            </map>
   4.308 -            <key>name</key>
   4.309 -            <string>linux</string>
   4.310 -          </map>
   4.311 -          <key>windows</key>
   4.312 -          <map>
   4.313 -            <key>archive</key>
   4.314 -            <map>
   4.315 -              <key>hash</key>
   4.316 -              <string>f62841804acb91e1309603a84f3f0ce8</string>
   4.317 -              <key>url</key>
   4.318 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/CYGWIN/installer/gperftools-2.0-windows-20120727.tar.bz2</string>
   4.319 -            </map>
   4.320 -            <key>name</key>
   4.321 -            <string>windows</string>
   4.322 -          </map>
   4.323 -        </map>
   4.324 -      </map>
   4.325        <key>tut</key>
   4.326        <map>
   4.327          <key>license</key>
   4.328 @@ -2505,7 +2532,6 @@
   4.329                    <string>"Visual Studio 10"</string>
   4.330                    <string>-DUNATTENDED:BOOL=ON</string>
   4.331                    <string>-DUSE_KDU=FALSE</string>
   4.332 -                  <string>-DFMOD=FALSE</string>
   4.333                  </array>
   4.334                </map>
   4.335                <key>name</key>
   4.336 @@ -2594,7 +2620,6 @@
   4.337                    <string>-DUNATTENDED:BOOL=ON</string>
   4.338                    <string>-DINSTALL_PROPRIETARY=FALSE</string>
   4.339                    <string>-DUSE_KDU=FALSE</string>
   4.340 -                  <string>-DFMOD=FALSE</string>
   4.341                  </array>
   4.342                </map>
   4.343                <key>name</key>
   4.344 @@ -2682,7 +2707,6 @@
   4.345                    <string>-DUNATTENDED:BOOL=ON</string>
   4.346                    <string>-DINSTALL_PROPRIETARY=FALSE</string>
   4.347                    <string>-DUSE_KDU=FALSE</string>
   4.348 -                  <string>-DFMOD=FALSE</string>
   4.349                  </array>
   4.350                </map>
   4.351                <key>name</key>
     5.1 --- a/build.sh	Thu May 02 19:12:59 2013 -0400
     5.2 +++ b/build.sh	Thu May 30 21:28:02 2013 +0000
     5.3 @@ -65,19 +65,16 @@
     5.4      && [ -r "$master_message_template_checkout/message_template.msg" ] \
     5.5      && template_verifier_master_url="-DTEMPLATE_VERIFIER_MASTER_URL=file://$master_message_template_checkout/message_template.msg"
     5.6  
     5.7 -    check_for "Before 'autobuild configure'" ${build_dir}/packages/dictionaries
     5.8 +    check_for "Confirm dictionaries are installed before 'autobuild configure'" ${build_dir}/packages/dictionaries
     5.9  
    5.10      "$AUTOBUILD" configure -c $variant -- \
    5.11       -DPACKAGE:BOOL=ON \
    5.12       -DRELEASE_CRASH_REPORTING:BOOL=ON \
    5.13       -DVIEWER_CHANNEL:STRING="\"$viewer_channel\"" \
    5.14 -     -DVIEWER_LOGIN_CHANNEL:STRING="\"$viewer_login_channel\"" \
    5.15       -DGRID:STRING="\"$viewer_grid\"" \
    5.16       -DLL_TESTS:BOOL="$run_tests" \
    5.17       -DTEMPLATE_VERIFIER_OPTIONS:STRING="$template_verifier_options" $template_verifier_master_url
    5.18  
    5.19 -    check_for "After 'autobuild configure'" ${build_dir}/packages/dictionaries
    5.20 -
    5.21   end_section "Pre$variant"
    5.22  }
    5.23  
    5.24 @@ -110,21 +107,30 @@
    5.25    if $build_viewer
    5.26    then
    5.27      begin_section "Viewer$variant"
    5.28 -    check_for "Before 'autobuild build'" ${build_dir}/packages/dictionaries
    5.29  
    5.30      "$AUTOBUILD" build --no-configure -c $variant
    5.31 -    viewer_build_ok=$?
    5.32 +    build_ok=$?
    5.33      end_section "Viewer$variant"
    5.34 +
    5.35 +    # Run build extensions
    5.36 +    if [ $build_ok -eq 0 -a -d ${build_dir}/packages/build-extensions ]; then
    5.37 +        for extension in ${build_dir}/packages/build-extensions/*.sh; do
    5.38 +            . $extension
    5.39 +            if [ $build_ok -ne 0 ]; then
    5.40 +                break
    5.41 +            fi
    5.42 +        done
    5.43 +    fi
    5.44 +
    5.45 +    # *TODO: Make this a build extension.
    5.46      package_llphysicsextensions_tpv
    5.47      tpvlib_build_ok=$?
    5.48 -    if [ $viewer_build_ok -eq 0 -a $tpvlib_build_ok -eq 0 ]
    5.49 +    if [ $build_ok -eq 0 -a $tpvlib_build_ok -eq 0 ]
    5.50      then
    5.51        echo true >"$build_dir"/build_ok
    5.52      else
    5.53        echo false >"$build_dir"/build_ok
    5.54      fi
    5.55 -    check_for "After 'autobuild configure'" ${build_dir}/packages/dictionaries
    5.56 -
    5.57    fi
    5.58  }
    5.59  
    5.60 @@ -159,21 +165,6 @@
    5.61  # Check to see if we're skipping the platform
    5.62  eval '$build_'"$arch" || pass
    5.63  
    5.64 -# Run the version number update script
    5.65 -# File no longer exists in code-sep branch, so let's make sure it exists in order to use it.
    5.66 -if test -f scripts/update_version_files.py ; then
    5.67 -  begin_section UpdateVer
    5.68 -  eval $(python scripts/update_version_files.py \
    5.69 -                --channel="$viewer_channel" \
    5.70 -                --server_channel="$server_channel" \
    5.71 -                --revision=$revision \
    5.72 -                --verbose \
    5.73 -         | sed -n -e "s,Setting viewer channel/version: '\([^']*\)' / '\([^']*\)',VIEWER_CHANNEL='\1';VIEWER_VERSION='\2',p")\
    5.74 -  || fail update_version_files.py
    5.75 -  echo "{\"Type\":\"viewer\",\"Version\":\"${VIEWER_VERSION}\"}" > summary.json
    5.76 -  end_section UpdateVer
    5.77 -fi
    5.78 -
    5.79  if [ -z "$AUTOBUILD" ]
    5.80  then
    5.81    export autobuild_dir="$here/../../../autobuild/bin/"
    5.82 @@ -197,27 +188,11 @@
    5.83  fi
    5.84  
    5.85  # load autbuild provided shell functions and variables
    5.86 -# Merov: going back to the previous code that passes even if it fails catching a failure
    5.87 -# TODO: use the correct code here under and fix the llbase import in python code
    5.88 -#if "$AUTOBUILD" source_environment > source_environment
    5.89 -#then
    5.90 -#  . source_environment
    5.91 -#else
    5.92 -  # dump environment variables for debugging
    5.93 -#  env|sort
    5.94 -#  record_failure "autobuild source_environment failed"
    5.95 -#  cat source_environment >&3
    5.96 -#  exit 1
    5.97 -#fi
    5.98  eval "$("$AUTOBUILD" source_environment)"
    5.99  
   5.100  # dump environment variables for debugging
   5.101  env|sort
   5.102  
   5.103 -check_for "Before 'autobuild install'" ${build_dir}/packages/dictionaries
   5.104 -
   5.105 -
   5.106 -check_for "After 'autobuild install'" ${build_dir}/packages/dictionaries
   5.107  # Now run the build
   5.108  succeeded=true
   5.109  build_processes=
   5.110 @@ -292,12 +267,86 @@
   5.111    end_section WaitParallel
   5.112  fi
   5.113  
   5.114 +# build debian package
   5.115 +if [ "$arch" == "Linux" ]
   5.116 +then
   5.117 +  if $succeeded
   5.118 +  then
   5.119 +    if $build_viewer_deb && [ "$last_built_variant" == "Release" ]
   5.120 +    then
   5.121 +      begin_section "Build Viewer Debian Package"
   5.122 +      local have_private_repo=false
   5.123 +      # mangle the changelog
   5.124 +      dch --force-bad-version \
   5.125 +          --distribution unstable \
   5.126 +          --newversion "${VIEWER_VERSION}" \
   5.127 +          "Automated build #$build_id, repository $branch revision $revision." \
   5.128 +          >> "$build_log" 2>&1
   5.129 +
   5.130 +      # build the debian package
   5.131 +      $pkg_default_debuild_command  >>"$build_log" 2>&1 || record_failure "\"$pkg_default_debuild_command\" failed."
   5.132 +
   5.133 +      # Unmangle the changelog file
   5.134 +      hg revert debian/changelog
   5.135 +
   5.136 +      end_section "Build Viewer Debian Package"
   5.137 +
   5.138 +      # Run debian extensions
   5.139 +      if [ -d ${build_dir}/packages/debian-extensions ]; then
   5.140 +          for extension in ${build_dir}/packages/debian-extensions/*.sh; do
   5.141 +              . $extension
   5.142 +          done
   5.143 +      fi
   5.144 +      # Move any .deb results.
   5.145 +      mkdir -p ../packages_public
   5.146 +      mkdir -p ../packages_private
   5.147 +      mv ${build_dir}/packages/*.deb ../packages_public 2>/dev/null || true
   5.148 +      mv ${build_dir}/packages/packages_private/*.deb ../packages_private 2>/dev/null || true
   5.149 +
   5.150 +      # upload debian package and create repository
   5.151 +      begin_section "Upload Debian Repository"
   5.152 +      for deb_file in `/bin/ls ../packages_public/*.deb ../*.deb 2>/dev/null`; do
   5.153 +        upload_item debian $deb_file binary/octet-stream
   5.154 +      done
   5.155 +      for deb_file in `/bin/ls ../packages_private/*.deb 2>/dev/null`; do
   5.156 +        upload_item debian_private $deb_file binary/octet-stream
   5.157 +        have_private_repo=true
   5.158 +      done
   5.159 +
   5.160 +      create_deb_repo
   5.161 +
   5.162 +      # Rename the local debian_repo* directories so that the master buildscript
   5.163 +      # doesn't make a remote repo again.
   5.164 +      for debian_repo_type in debian_repo debian_repo_private; do
   5.165 +        if [ -d "$build_log_dir/$debian_repo_type" ]; then
   5.166 +          mv $build_log_dir/$debian_repo_type $build_log_dir/${debian_repo_type}_pushed
   5.167 +        fi
   5.168 +      done
   5.169 +
   5.170 +      if [ $have_private_repo = true ]; then
   5.171 +        eval "$python_command \"$redirect\" '\${private_S3PROXY_URL}${S3PREFIX}repo/$repo/rev/$revision/index.html'"\
   5.172 +            >"$build_log_dir/private.html" || fatal generating redirect
   5.173 +        upload_item global_redirect "$build_log_dir/private.html" text/html
   5.174 +        
   5.175 +      fi
   5.176 +
   5.177 +      end_section "Upload Debian Repository"
   5.178 +      
   5.179 +    else
   5.180 +      echo skipping debian build
   5.181 +    fi
   5.182 +  else
   5.183 +    echo skipping debian build due to failed build.
   5.184 +  fi
   5.185 +fi
   5.186 +
   5.187 +
   5.188  # check status and upload results to S3
   5.189  if $succeeded
   5.190  then
   5.191    if $build_viewer
   5.192    then
   5.193 -    begin_section Upload
   5.194 +    begin_section Upload Installer
   5.195      # Upload installer - note that ONLY THE FIRST ITEM uploaded as "installer"
   5.196      # will appear in the version manager.
   5.197      package=$(installer_$arch)
   5.198 @@ -308,7 +357,7 @@
   5.199      else
   5.200        upload_item installer "$package" binary/octet-stream
   5.201        upload_item quicklink "$package" binary/octet-stream
   5.202 -      [ -f summary.json ] && upload_item installer summary.json text/plain
   5.203 +      [ -f $build_dir/summary.json ] && upload_item installer $build_dir/summary.json text/plain
   5.204  
   5.205        case "$last_built_variant" in
   5.206        Release)
   5.207 @@ -317,8 +366,9 @@
   5.208          do
   5.209            upload_item symbolfile "$build_dir/$symbolfile" binary/octet-stream
   5.210          done
   5.211 -        
   5.212 +
   5.213          # Upload the llphysicsextensions_tpv package, if one was produced
   5.214 +        # *TODO: Make this an upload-extension
   5.215          if [ -r "$build_dir/llphysicsextensions_package" ]
   5.216          then
   5.217              llphysicsextensions_package=$(cat $build_dir/llphysicsextensions_package)
   5.218 @@ -332,15 +382,22 @@
   5.219          ;;
   5.220        esac
   5.221  
   5.222 +      # Run upload extensions
   5.223 +      if [ -d ${build_dir}/packages/upload-extensions ]; then
   5.224 +          for extension in ${build_dir}/packages/upload-extensions/*.sh; do
   5.225 +              . $extension
   5.226 +          done
   5.227 +      fi
   5.228 +
   5.229        # Upload stub installers
   5.230        upload_stub_installers "$build_dir_stubs"
   5.231      fi
   5.232 -    end_section Upload
   5.233 +    end_section Upload Installer
   5.234    else
   5.235 -    echo skipping viewer
   5.236 +    echo skipping upload of installer
   5.237    fi
   5.238  else
   5.239 -  echo skipping upload of build results due to failed build.
   5.240 +  echo skipping upload of installer due to failed build.
   5.241  fi
   5.242  
   5.243  # The branch independent build.sh script invoking this script will finish processing
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/debian/changelog	Thu May 30 21:28:02 2013 +0000
     6.3 @@ -0,0 +1,18 @@
     6.4 +secondlife-viewer (0.3) unstable; urgency=low
     6.5 +
     6.6 +  * Initial debian configuration
     6.7 +
     6.8 + -- Don Kjer <don@lindenlab.com>  Wed, 04 Jul 2012 00:43:03 +0000
     6.9 +
    6.10 +secondlife-viewer (0.2) unstable; urgency=low
    6.11 +
    6.12 +  * Adding default LSB headers for squeeze
    6.13 +
    6.14 + -- Tyler Kohler <tyler@lindenlab.com>  Thu, 24 Mar 2011 09:43:36 -0700
    6.15 +
    6.16 +secondlife-viewer (0.1) unstable; urgency=low
    6.17 +
    6.18 +  * Cloned from debian package skeleton.
    6.19 +
    6.20 + -- Lex Linden <lex@lindenlab.com>  Mon, 20 Sep 2010 08:01:59 -0700
    6.21 +
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/debian/compat	Thu May 30 21:28:02 2013 +0000
     7.3 @@ -0,0 +1,1 @@
     7.4 +5
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/debian/control	Thu May 30 21:28:02 2013 +0000
     8.3 @@ -0,0 +1,16 @@
     8.4 +Source: secondlife-viewer
     8.5 +Section: unknown
     8.6 +Priority: extra
     8.7 +Maintainer: Don Linden <don@lindenlab.com>
     8.8 +Build-Depends: debhelper (>= 5)
     8.9 +Homepage: http://secondlife.com
    8.10 +Standards-Version: 3.7.2
    8.11 +
    8.12 +Package: secondlife-viewer
    8.13 +Architecture: any
    8.14 +Depends: ${shlibs:Depends}, ${misc:Depends},
    8.15 + ia32-libs,
    8.16 + ia32-libs-gtk
    8.17 +Description: Second Life Viewer
    8.18 + Second Life is an online virtual world developed by Linden Lab.
    8.19 + 
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/debian/copyright	Thu May 30 21:28:02 2013 +0000
     9.3 @@ -0,0 +1,32 @@
     9.4 +Second Life Viewer Copyright: 2000-2012 Linden Research, Inc.
     9.5 +
     9.6 +License:
     9.7 +
     9.8 +3Dconnexion SDK Copyright (C) 1992-2009 3Dconnexion
     9.9 +APR Copyright (C) 2011 The Apache Software Foundation
    9.10 +Collada DOM Copyright 2006 Sony Computer Entertainment Inc.
    9.11 +cURL Copyright (C) 1996-2010, Daniel Stenberg, (daniel@haxx.se)
    9.12 +DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
    9.13 +expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
    9.14 +FreeType Copyright (C) 1996-2002, 2006 David Turner, Robert Wilhelm, and Werner Lemberg.
    9.15 +GL Copyright (C) 1999-2004 Brian Paul.
    9.16 +GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia.
    9.17 +google-perftools Copyright (c) 2005, Google Inc.
    9.18 +Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
    9.19 +jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
    9.20 +jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
    9.21 +ogg/vorbis Copyright (C) 2002, Xiphophorus
    9.22 +OpenSSL Copyright (C) 1998-2008 The OpenSSL Project.
    9.23 +PCRE Copyright (c) 1997-2012 University of Cambridge
    9.24 +SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
    9.25 +SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
    9.26 +xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
    9.27 +zlib Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler.
    9.28 +
    9.29 +Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details.
    9.30 +
    9.31 +This software contains source code provided by NVIDIA Corporation.
    9.32 +
    9.33 +All rights reserved.  See licenses.txt for details.
    9.34 +
    9.35 +Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/debian/postinst	Thu May 30 21:28:02 2013 +0000
    10.3 @@ -0,0 +1,43 @@
    10.4 +#!/bin/sh
    10.5 +# postinst script for secondlife-viewer
    10.6 +#
    10.7 +# Delete this file if you don't need it.
    10.8 +#
    10.9 +# see: dh_installdeb(1)
   10.10 +
   10.11 +set -e
   10.12 +
   10.13 +# summary of how this script can be called:
   10.14 +#        * <postinst> `configure' <most-recently-configured-version>
   10.15 +#        * <old-postinst> `abort-upgrade' <new version>
   10.16 +#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
   10.17 +#          <new-version>
   10.18 +#        * <postinst> `abort-remove'
   10.19 +#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
   10.20 +#          <failed-install-package> <version> `removing'
   10.21 +#          <conflicting-package> <version>
   10.22 +# for details, see http://www.debian.org/doc/debian-policy/ or
   10.23 +# the debian-policy package
   10.24 +
   10.25 +
   10.26 +case "$1" in
   10.27 +    configure)
   10.28 +    ;;
   10.29 +
   10.30 +    abort-upgrade|abort-remove|abort-deconfigure)
   10.31 +    ;;
   10.32 +
   10.33 +    *)
   10.34 +        echo "postinst called with unknown argument \`$1'" >&2
   10.35 +        exit 1
   10.36 +    ;;
   10.37 +esac
   10.38 +
   10.39 +# dh_installdeb will replace this with shell code automatically
   10.40 +# generated by other debhelper scripts.  Don't delete this!
   10.41 +
   10.42 +#DEBHELPER#
   10.43 +
   10.44 +exit 0
   10.45 +
   10.46 +
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/debian/postrm	Thu May 30 21:28:02 2013 +0000
    11.3 @@ -0,0 +1,41 @@
    11.4 +#!/bin/sh
    11.5 +# postrm script for secondlife-viewer
    11.6 +#
    11.7 +# Delete this file if you don't need it.
    11.8 +#
    11.9 +# see: dh_installdeb(1)
   11.10 +
   11.11 +set -e
   11.12 +
   11.13 +# summary of how this script can be called:
   11.14 +#        * <postrm> `remove'
   11.15 +#        * <postrm> `purge'
   11.16 +#        * <old-postrm> `upgrade' <new-version>
   11.17 +#        * <new-postrm> `failed-upgrade' <old-version>
   11.18 +#        * <new-postrm> `abort-install'
   11.19 +#        * <new-postrm> `abort-install' <old-version>
   11.20 +#        * <new-postrm> `abort-upgrade' <old-version>
   11.21 +#        * <disappearer's-postrm> `disappear' <overwriter>
   11.22 +#          <overwriter-version>
   11.23 +# for details, see http://www.debian.org/doc/debian-policy/ or
   11.24 +# the debian-policy package
   11.25 +
   11.26 +
   11.27 +case "$1" in
   11.28 +    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
   11.29 +    ;;
   11.30 +
   11.31 +    *)
   11.32 +        echo "postrm called with unknown argument \`$1'" >&2
   11.33 +        exit 1
   11.34 +    ;;
   11.35 +esac
   11.36 +
   11.37 +# dh_installdeb will replace this with shell code automatically
   11.38 +# generated by other debhelper scripts.  Don't delete this!
   11.39 +
   11.40 +#DEBHELPER#
   11.41 +
   11.42 +exit 0
   11.43 +
   11.44 +
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/debian/preinst	Thu May 30 21:28:02 2013 +0000
    12.3 @@ -0,0 +1,39 @@
    12.4 +#!/bin/sh
    12.5 +# preinst script for secondlife-viewer
    12.6 +#
    12.7 +# Delete this file if you don't need it.
    12.8 +#
    12.9 +# see: dh_installdeb(1)
   12.10 +
   12.11 +set -e
   12.12 +
   12.13 +# summary of how this script can be called:
   12.14 +#        * <new-preinst> `install'
   12.15 +#        * <new-preinst> `install' <old-version>
   12.16 +#        * <new-preinst> `upgrade' <old-version>
   12.17 +#        * <old-preinst> `abort-upgrade' <new-version>
   12.18 +# for details, see http://www.debian.org/doc/debian-policy/ or
   12.19 +# the debian-policy package
   12.20 +
   12.21 +
   12.22 +case "$1" in
   12.23 +    install|upgrade)
   12.24 +    ;;
   12.25 +
   12.26 +    abort-upgrade)
   12.27 +    ;;
   12.28 +
   12.29 +    *)
   12.30 +        echo "preinst called with unknown argument \`$1'" >&2
   12.31 +        exit 1
   12.32 +    ;;
   12.33 +esac
   12.34 +
   12.35 +# dh_installdeb will replace this with shell code automatically
   12.36 +# generated by other debhelper scripts.  Don't delete this!
   12.37 +
   12.38 +#DEBHELPER#
   12.39 +
   12.40 +exit 0
   12.41 +
   12.42 +
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/debian/prerm	Thu May 30 21:28:02 2013 +0000
    13.3 @@ -0,0 +1,42 @@
    13.4 +#!/bin/sh
    13.5 +# prerm script for secondlife-viewer
    13.6 +#
    13.7 +# Delete this file if you don't need it.
    13.8 +#
    13.9 +# see: dh_installdeb(1)
   13.10 +
   13.11 +set -e
   13.12 +
   13.13 +# summary of how this script can be called:
   13.14 +#        * <prerm> `remove'
   13.15 +#        * <old-prerm> `upgrade' <new-version>
   13.16 +#        * <new-prerm> `failed-upgrade' <old-version>
   13.17 +#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
   13.18 +#        * <deconfigured's-prerm> `deconfigure' `in-favour'
   13.19 +#          <package-being-installed> <version> `removing'
   13.20 +#          <conflicting-package> <version>
   13.21 +# for details, see http://www.debian.org/doc/debian-policy/ or
   13.22 +# the debian-policy package
   13.23 +
   13.24 +
   13.25 +case "$1" in
   13.26 +    remove|upgrade|deconfigure)
   13.27 +    ;;
   13.28 +
   13.29 +    failed-upgrade)
   13.30 +    ;;
   13.31 +
   13.32 +    *)
   13.33 +        echo "prerm called with unknown argument \`$1'" >&2
   13.34 +        exit 1
   13.35 +    ;;
   13.36 +esac
   13.37 +
   13.38 +# dh_installdeb will replace this with shell code automatically
   13.39 +# generated by other debhelper scripts.  Don't delete this!
   13.40 +
   13.41 +#DEBHELPER#
   13.42 +
   13.43 +exit 0
   13.44 +
   13.45 +
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/debian/rules	Thu May 30 21:28:02 2013 +0000
    14.3 @@ -0,0 +1,118 @@
    14.4 +#!/usr/bin/make -f
    14.5 +# -*- makefile -*-
    14.6 +# Sample debian/rules that uses debhelper.
    14.7 +# This file was originally written by Joey Hess and Craig Small.
    14.8 +# As a special exception, when this file is copied by dh-make into a
    14.9 +# dh-make output file, you may use that output file without restriction.
   14.10 +# This special exception was added by Craig Small in version 0.37 of dh-make.
   14.11 +
   14.12 +# Uncomment this to turn on verbose mode.
   14.13 +#export DH_VERBOSE=1
   14.14 +
   14.15 +BASEDIR=opt/linden
   14.16 +
   14.17 +VIEWER_PKG=secondlife-viewer
   14.18 +VIEWER_PACKAGEDIR=build-linux-i686/newview/packaged
   14.19 +VIEWER_DESTDIR=$(CURDIR)/debian/$(VIEWER_PKG)
   14.20 +VIEWER_VERSION:=$(shell dpkg-parsechangelog | grep ^Version | sed 's/^Version: //')
   14.21 +VIEWER_INSTALLDIR:=$(BASEDIR)/viewer/SecondLife-i686-$(VIEWER_VERSION)
   14.22 +
   14.23 +configure: configure-stamp
   14.24 +configure-stamp:
   14.25 +	dh_testdir
   14.26 +	# Add here commands to configure the package.
   14.27 +
   14.28 +	touch configure-stamp
   14.29 +
   14.30 +build: build-stamp
   14.31 +
   14.32 +build-stamp: configure-stamp 
   14.33 +	dh_testdir
   14.34 +
   14.35 +	# Add here commands to compile the package.
   14.36 +	#$(MAKE)
   14.37 +	#docbook-to-man debian/secondlife-viewer.sgml > secondlife-viewer.1
   14.38 +
   14.39 +	touch $@
   14.40 +
   14.41 +clean:
   14.42 +	dh_testdir
   14.43 +	dh_testroot
   14.44 +	rm -f build-stamp configure-stamp
   14.45 +
   14.46 +	# Add here commands to clean up after the build process.
   14.47 +	#-$(MAKE) clean
   14.48 +
   14.49 +	dh_clean 
   14.50 +
   14.51 +install: build
   14.52 +	dh_testdir
   14.53 +	dh_testroot
   14.54 +	dh_clean -k 
   14.55 +	dh_installdirs
   14.56 +
   14.57 +	# Add here commands to install the package into debian/secondlife-viewer.
   14.58 +	for file in $$(find $(VIEWER_PACKAGEDIR) -type f -o -type l | sed 's~$(VIEWER_PACKAGEDIR)/~~'); do \
   14.59 +		# create containing directory \
   14.60 +		install -v -m 755 -o root -g root -d "$$(dirname "$(VIEWER_DESTDIR)/$(VIEWER_INSTALLDIR)/$$file")"; \
   14.61 +		PERM=644; \
   14.62 +		if [ -x "$(VIEWER_PACKAGEDIR)/$$file" ]; then \
   14.63 +			PERM=755; \
   14.64 +		fi; \
   14.65 +		if [ -L "$(VIEWER_PACKAGEDIR)/$$file" ]; then \
   14.66 +			REAL="$$( readlink -f $(VIEWER_PACKAGEDIR)/$$file )"; \
   14.67 +			RELATIVE="$$( echo $$REAL | sed 's~$(CURDIR)/$(VIEWER_PACKAGEDIR)/~~' )"; \
   14.68 +			echo dh_link -p $(VIEWER_PKG) "$(VIEWER_INSTALLDIR)/$$RELATIVE" "$(VIEWER_INSTALLDIR)/$$file" ; \
   14.69 +			dh_link -p $(VIEWER_PKG) "$(VIEWER_INSTALLDIR)/$$RELATIVE" "$(VIEWER_INSTALLDIR)/$$file" ; \
   14.70 +		else \
   14.71 +			install -v -m $$PERM -o root -g root "$(VIEWER_PACKAGEDIR)/$$file" "$(VIEWER_DESTDIR)/$(VIEWER_INSTALLDIR)/$$file"; \
   14.72 +		fi; \
   14.73 +	done
   14.74 +	dh_link -p $(VIEWER_PKG) /$(VIEWER_INSTALLDIR)/secondlife /usr/bin/secondlife
   14.75 +	dh_link -p $(VIEWER_PKG) $(BASEDIR)/viewer/SecondLife-i686-$(VIEWER_VERSION) $(BASEDIR)/viewer/SecondLife
   14.76 +
   14.77 +
   14.78 +# Build architecture-independent files here.
   14.79 +binary-indep: build install
   14.80 +# We have nothing to do by default.
   14.81 +
   14.82 +# Build architecture-dependent files here.
   14.83 +binary-arch: build install
   14.84 +	dh_testdir
   14.85 +	dh_testroot
   14.86 +	dh_installchangelogs 
   14.87 +	dh_installdocs
   14.88 +	dh_installexamples
   14.89 +#	dh_install
   14.90 +#	dh_installmenu
   14.91 +#	dh_installdebconf	
   14.92 +#	dh_installlogrotate
   14.93 +#	dh_installemacsen
   14.94 +#	dh_installpam
   14.95 +#	dh_installmime
   14.96 +#	dh_python
   14.97 +
   14.98 +# To add an init script, uncomment this line and edit debian/init.d and 
   14.99 +# customize debian/secondlife-viewer.default to suit your needs.
  14.100 +#	dh_installinit
  14.101 +
  14.102 +# To add cron jobs, uncomment this line and make a crontab file named 
  14.103 +# debian/cron.d, and it will be installed in /etc/cron.d/
  14.104 +#	dh_installcron
  14.105 +
  14.106 +#	dh_installinfo
  14.107 +	dh_installman
  14.108 +	dh_link
  14.109 +#	dh_strip
  14.110 +	dh_compress
  14.111 +#	dh_fixperms
  14.112 +#	dh_perl
  14.113 +#	dh_makeshlibs
  14.114 +	dh_installdeb
  14.115 +#	dh_shlibdeps
  14.116 +	dh_gencontrol
  14.117 +	dh_md5sums
  14.118 +	dh_builddeb
  14.119 +
  14.120 +binary: binary-indep binary-arch
  14.121 +.PHONY: build clean binary-indep binary-arch binary install configure
    15.1 --- a/doc/contributions.txt	Thu May 02 19:12:59 2013 -0400
    15.2 +++ b/doc/contributions.txt	Thu May 30 21:28:02 2013 +0000
    15.3 @@ -299,6 +299,7 @@
    15.4  Christopher  Organiser
    15.5  Ciaran Laval
    15.6  Cinder Roxley
    15.7 +    BUG-2326
    15.8      STORM-1703
    15.9  Clara Young
   15.10  Coaldust Numbers
   15.11 @@ -898,6 +899,8 @@
   15.12  Nicky Dasmijn
   15.13  	VWR-29228
   15.14  	MAINT-873
   15.15 +	SUN-72
   15.16 +	BUG-2432
   15.17  Nicky Perian
   15.18  	OPEN-1
   15.19  	STORM-1087
   15.20 @@ -1067,10 +1070,12 @@
   15.21  Shnurui Troughton
   15.22  Shyotl Kuhr
   15.23  	MAINT-1138
   15.24 +	MAINT-2334
   15.25  Siana Gearz
   15.26  	STORM-960
   15.27  	STORM-1088
   15.28  	MAINT-1138
   15.29 +	MAINT-2334
   15.30  sicarius Thorne
   15.31  Sicarius Toxx
   15.32  SignpostMarv Martin
   15.33 @@ -1088,6 +1093,8 @@
   15.34  Slee Mayo
   15.35      SEC-1075
   15.36  snowy Sidran
   15.37 +Sovereign Engineer
   15.38 +    MAINT-2334
   15.39  SpacedOut Frye
   15.40  	VWR-34
   15.41  	VWR-45
   15.42 @@ -1341,3 +1348,4 @@
   15.43  
   15.44  
   15.45  
   15.46 +
    16.1 --- a/indra/CMakeLists.txt	Thu May 02 19:12:59 2013 -0400
    16.2 +++ b/indra/CMakeLists.txt	Thu May 30 21:28:02 2013 +0000
    16.3 @@ -3,14 +3,8 @@
    16.4  # cmake_minimum_required should appear before any
    16.5  # other commands to guarantee full compatibility
    16.6  # with the version specified
    16.7 -
    16.8 -# The "cmake -E touch" command was released with 2.4.8.
    16.9 -cmake_minimum_required(VERSION 2.4.8 FATAL_ERROR)
   16.10 -
   16.11 -# This makes cmake 2.6 not complain about version 2.4 compatibility.
   16.12 -if (COMMAND cmake_policy)
   16.13 -  cmake_policy(SET CMP0003 OLD)
   16.14 -endif (COMMAND cmake_policy)
   16.15 +## prior to 2.8, the add_custom_target commands used in setting the version did not work correctly
   16.16 +cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
   16.17  
   16.18  set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING
   16.19      "The root project/makefile/solution name. Defaults to SecondLife.")
   16.20 @@ -19,13 +13,7 @@
   16.21  set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
   16.22  
   16.23  include(Variables)
   16.24 -
   16.25 -if (DARWIN)
   16.26 -  # 2.6.4 fixes a Mac bug in get_target_property(... "SLPlugin" LOCATION):
   16.27 -  # before that version it returns "pathname/SLPlugin", whereas the correct
   16.28 -  # answer is "pathname/SLPlugin.app/Contents/MacOS/SLPlugin".
   16.29 -  cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
   16.30 -endif (DARWIN)
   16.31 +include(BuildVersion)
   16.32  
   16.33  if (NOT CMAKE_BUILD_TYPE)
   16.34    set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
   16.35 @@ -41,6 +29,7 @@
   16.36  add_subdirectory(cmake)
   16.37  
   16.38  add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
   16.39 +add_subdirectory(${LIBS_OPEN_PREFIX}llappearance)
   16.40  add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter)
   16.41  add_subdirectory(${LIBS_OPEN_PREFIX}llcommon)
   16.42  add_subdirectory(${LIBS_OPEN_PREFIX}llcorehttp)
   16.43 @@ -63,71 +52,52 @@
   16.44  endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
   16.45  
   16.46  add_custom_target(viewer)
   16.47 -if (VIEWER)
   16.48 -  add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger)
   16.49 -  add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
   16.50 -  add_subdirectory(${LIBS_OPEN_PREFIX}llui)
   16.51 -  add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
   16.52 +add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger)
   16.53 +add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
   16.54 +add_subdirectory(${LIBS_OPEN_PREFIX}llui)
   16.55 +add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
   16.56  
   16.57 -  # Legacy C++ tests. Build always, run if LL_TESTS is true.
   16.58 -  add_subdirectory(${VIEWER_PREFIX}test)
   16.59 +# Legacy C++ tests. Build always, run if LL_TESTS is true.
   16.60 +add_subdirectory(${VIEWER_PREFIX}test)
   16.61  
   16.62 -  # viewer media plugins
   16.63 -  add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
   16.64 +# viewer media plugins
   16.65 +add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
   16.66  
   16.67 -  # llplugin testbed code (is this the right way to include it?)
   16.68 -  if (LL_TESTS AND NOT LINUX)
   16.69 -    add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
   16.70 -  endif (LL_TESTS AND NOT LINUX)
   16.71 +# llplugin testbed code (is this the right way to include it?)
   16.72 +if (LL_TESTS AND NOT LINUX)
   16.73 +  add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
   16.74 +endif (LL_TESTS AND NOT LINUX)
   16.75  
   16.76 -  if (LINUX)
   16.77 -    add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
   16.78 -    add_dependencies(viewer linux-crash-logger-strip-target)
   16.79 -  elseif (DARWIN)
   16.80 -    add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
   16.81 -    add_subdirectory(${VIEWER_PREFIX}mac_updater)
   16.82 -    add_dependencies(viewer mac-updater mac-crash-logger)
   16.83 -  elseif (WINDOWS)
   16.84 -    add_subdirectory(${VIEWER_PREFIX}win_crash_logger)
   16.85 -    # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake
   16.86 -    if (EXISTS ${VIEWER_DIR}win_setup)
   16.87 -      add_subdirectory(${VIEWER_DIR}win_setup)
   16.88 -    endif (EXISTS ${VIEWER_DIR}win_setup)
   16.89 -    add_subdirectory(${VIEWER_PREFIX}win_updater)
   16.90 -    # add_dependencies(viewer windows-updater windows-setup windows-crash-logger)
   16.91 -    add_dependencies(viewer windows-updater windows-crash-logger)
   16.92 -  elseif (SOLARIS)
   16.93 -    add_subdirectory(solaris_crash_logger)
   16.94 -    add_dependencies(viewer solaris-crash-logger)
   16.95 -  endif (LINUX)
   16.96 +if (LINUX)
   16.97 +  add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
   16.98 +  add_subdirectory(${VIEWER_PREFIX}linux_updater)
   16.99 +  if (INSTALL_PROPRIETARY)
  16.100 +      include(LLAppearanceUtility)
  16.101 +      add_subdirectory(${LLAPPEARANCEUTILITY_SRC_DIR} ${LLAPPEARANCEUTILITY_BIN_DIR})
  16.102 +  endif (INSTALL_PROPRIETARY)
  16.103 +  add_dependencies(viewer linux-crash-logger-strip-target linux-updater)
  16.104 +elseif (DARWIN)
  16.105 +  add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
  16.106 +  add_dependencies(viewer mac-crash-logger)
  16.107 +elseif (WINDOWS)
  16.108 +  add_subdirectory(${VIEWER_PREFIX}win_crash_logger)
  16.109 +  # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake
  16.110 +  if (EXISTS ${VIEWER_DIR}win_setup)
  16.111 +    add_subdirectory(${VIEWER_DIR}win_setup)
  16.112 +  endif (EXISTS ${VIEWER_DIR}win_setup)
  16.113 +  add_subdirectory(${VIEWER_PREFIX}win_updater)
  16.114 +  # add_dependencies(viewer windows-updater windows-setup windows-crash-logger)
  16.115 +  add_dependencies(viewer windows-updater windows-crash-logger)
  16.116 +elseif (SOLARIS)
  16.117 +  add_subdirectory(solaris_crash_logger)
  16.118 +  add_dependencies(viewer solaris-crash-logger)
  16.119 +endif (LINUX)
  16.120  
  16.121 -  add_subdirectory(${VIEWER_PREFIX}newview)
  16.122 -  add_dependencies(viewer secondlife-bin)
  16.123 -endif (VIEWER)
  16.124 -
  16.125 -# Linux builds the viewer and server in 2 separate projects
  16.126 -# In order for build server to work on linux, 
  16.127 -# the viewer project needs a server target.
  16.128 -# This is not true for mac and windows.
  16.129 -if (LINUX) 
  16.130 -  add_custom_target(server)
  16.131 -endif (LINUX)
  16.132 -if (SERVER)
  16.133 -  if (NOT LINUX)
  16.134 -    add_custom_target(server)
  16.135 -  endif (NOT LINUX)
  16.136 -  include(${SERVER_PREFIX}Server.cmake)
  16.137 -endif (SERVER)
  16.138 -
  16.139 -# Windows builds include tools like VFS tool
  16.140 -if (SERVER)
  16.141 -  if (WINDOWS)
  16.142 -    add_subdirectory(${SERVER_PREFIX}tools)
  16.143 -  endif (WINDOWS)
  16.144 -endif (SERVER)
  16.145 +add_subdirectory(${VIEWER_PREFIX}newview)
  16.146 +add_dependencies(viewer secondlife-bin)
  16.147  
  16.148  if (LL_TESTS)
  16.149 -  # Define after the custom viewer and server targets are created so
  16.150 +  # Define after the custom targets are created so
  16.151    # individual apps can add themselves as dependencies
  16.152    add_subdirectory(${INTEGRATION_TESTS_PREFIX}integration_tests)
  16.153  endif (LL_TESTS)
    17.1 --- a/indra/cmake/00-Common.cmake	Thu May 02 19:12:59 2013 -0400
    17.2 +++ b/indra/cmake/00-Common.cmake	Thu May 30 21:28:02 2013 +0000
    17.3 @@ -2,6 +2,9 @@
    17.4  #
    17.5  # Compilation options shared by all Second Life components.
    17.6  
    17.7 +if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
    17.8 +set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
    17.9 +
   17.10  include(Variables)
   17.11  
   17.12  # Portable compilation flags.
   17.13 @@ -150,41 +153,21 @@
   17.14        -pthread
   17.15        )
   17.16  
   17.17 -  if (SERVER)
   17.18 -    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-60")
   17.19 -    if (EXISTS /etc/debian_version)
   17.20 -      FILE(READ /etc/debian_version DEBIAN_VERSION)
   17.21 -    else (EXISTS /etc/debian_version)
   17.22 -      set(DEBIAN_VERSION "")
   17.23 -    endif (EXISTS /etc/debian_version)
   17.24 -
   17.25 -    if (NOT DEBIAN_VERSION STREQUAL "3.1")
   17.26 -      add_definitions(-DCTYPE_WORKAROUND)
   17.27 -    endif (NOT DEBIAN_VERSION STREQUAL "3.1")
   17.28 -
   17.29 -    if (EXISTS /usr/lib/mysql4/mysql)
   17.30 -      link_directories(/usr/lib/mysql4/mysql)
   17.31 -    endif (EXISTS /usr/lib/mysql4/mysql)
   17.32 -
   17.33 -  endif (SERVER)
   17.34 -
   17.35 -  if (VIEWER)
   17.36 -    add_definitions(-DAPPID=secondlife)
   17.37 -    add_definitions(-fvisibility=hidden)
   17.38 -    # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work.  Sigh!  The viewer doesn't need to catch SIGCHLD anyway.
   17.39 -    add_definitions(-DLL_IGNORE_SIGCHLD)
   17.40 -    if (WORD_SIZE EQUAL 32)
   17.41 -      add_definitions(-march=pentium4)
   17.42 -    endif (WORD_SIZE EQUAL 32)
   17.43 -    add_definitions(-mfpmath=sse)
   17.44 -    #add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2
   17.45 -    if (NOT STANDALONE)
   17.46 -      # this stops us requiring a really recent glibc at runtime
   17.47 -      add_definitions(-fno-stack-protector)
   17.48 -      # linking can be very memory-hungry, especially the final viewer link
   17.49 -      set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory")
   17.50 -    endif (NOT STANDALONE)
   17.51 -  endif (VIEWER)
   17.52 +  add_definitions(-DAPPID=secondlife)
   17.53 +  add_definitions(-fvisibility=hidden)
   17.54 +  # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work.  Sigh!  The viewer doesn't need to catch SIGCHLD anyway.
   17.55 +  add_definitions(-DLL_IGNORE_SIGCHLD)
   17.56 +  if (WORD_SIZE EQUAL 32)
   17.57 +    add_definitions(-march=pentium4)
   17.58 +  endif (WORD_SIZE EQUAL 32)
   17.59 +  add_definitions(-mfpmath=sse)
   17.60 +  #add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2
   17.61 +  if (NOT STANDALONE)
   17.62 +    # this stops us requiring a really recent glibc at runtime
   17.63 +    add_definitions(-fno-stack-protector)
   17.64 +    # linking can be very memory-hungry, especially the final viewer link
   17.65 +    set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory")
   17.66 +  endif (NOT STANDALONE)
   17.67  
   17.68    set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}")
   17.69    set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}")
   17.70 @@ -192,13 +175,8 @@
   17.71  
   17.72  
   17.73  if (DARWIN)
   17.74 -  # NOTE (per http://lists.apple.com/archives/darwin-dev/2008/Jan/msg00232.html):
   17.75 -  # > Why the bus error? What am I doing wrong? 
   17.76 -  # This is a known issue where getcontext(3) is writing past the end of the
   17.77 -  # ucontext_t struct when _XOPEN_SOURCE is not defined (rdar://problem/5578699 ).
   17.78 -  # As a workaround, define _XOPEN_SOURCE before including ucontext.h.
   17.79 -  add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE)
   17.80 -  set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
   17.81 +  add_definitions(-DLL_DARWIN=1)
   17.82 +  set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first")
   17.83    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
   17.84    set(DARWIN_extra_cstar_flags "-mlong-branch -g")
   17.85    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
   17.86 @@ -254,6 +232,4 @@
   17.87        )
   17.88  endif (STANDALONE)
   17.89  
   17.90 -if(SERVER)
   17.91 -  include_directories(${LIBS_PREBUILT_DIR}/include/havok)
   17.92 -endif(SERVER)
   17.93 +endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
    18.1 --- a/indra/cmake/APR.cmake	Thu May 02 19:12:59 2013 -0400
    18.2 +++ b/indra/cmake/APR.cmake	Thu May 30 21:28:02 2013 +0000
    18.3 @@ -49,9 +49,7 @@
    18.4    set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/apr-1)
    18.5  
    18.6    if (LINUX)
    18.7 -    if (VIEWER)
    18.8 -      list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} uuid)
    18.9 -    endif (VIEWER)
   18.10 +    list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} uuid)
   18.11      list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} rt)
   18.12    endif (LINUX)
   18.13  endif (STANDALONE)
    19.1 --- a/indra/cmake/Boost.cmake	Thu May 02 19:12:59 2013 -0400
    19.2 +++ b/indra/cmake/Boost.cmake	Thu May 30 21:28:02 2013 +0000
    19.3 @@ -7,11 +7,12 @@
    19.4  if (STANDALONE)
    19.5    include(FindBoost)
    19.6  
    19.7 +  set(BOOST_CONTEXT_LIBRARY boost_context-mt)
    19.8 +  set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
    19.9    set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
   19.10    set(BOOST_REGEX_LIBRARY boost_regex-mt)
   19.11    set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
   19.12    set(BOOST_SYSTEM_LIBRARY boost_system-mt)
   19.13 -  set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
   19.14    set(BOOST_THREAD_LIBRARY boost_thread-mt)
   19.15  else (STANDALONE)
   19.16    use_prebuilt_binary(boost)
   19.17 @@ -20,6 +21,12 @@
   19.18  
   19.19    if (WINDOWS)
   19.20      if(MSVC80)
   19.21 +      set(BOOST_CONTEXT_LIBRARY 
   19.22 +          optimized libboost_context-vc80-mt-${BOOST_VERSION}
   19.23 +          debug libboost_context-vc80-mt-gd-${BOOST_VERSION})
   19.24 +      set(BOOST_FILESYSTEM_LIBRARY 
   19.25 +          optimized libboost_filesystem-vc80-mt-${BOOST_VERSION}
   19.26 +          debug libboost_filesystem-vc80-mt-gd-${BOOST_VERSION})
   19.27        set(BOOST_PROGRAM_OPTIONS_LIBRARY 
   19.28            optimized libboost_program_options-vc80-mt-${BOOST_VERSION}
   19.29            debug libboost_program_options-vc80-mt-gd-${BOOST_VERSION})
   19.30 @@ -32,59 +39,74 @@
   19.31        set(BOOST_SYSTEM_LIBRARY 
   19.32            optimized libboost_system-vc80-mt-${BOOST_VERSION}
   19.33            debug libboost_system-vc80-mt-gd-${BOOST_VERSION})
   19.34 -      set(BOOST_FILESYSTEM_LIBRARY 
   19.35 -          optimized libboost_filesystem-vc80-mt-${BOOST_VERSION}
   19.36 -          debug libboost_filesystem-vc80-mt-gd-${BOOST_VERSION})
   19.37 +      set(BOOST_THREAD_LIBRARY 
   19.38 +          optimized libboost_thread-vc80-mt-${BOOST_VERSION}
   19.39 +          debug libboost_thread-vc80-mt-gd-${BOOST_VERSION})
   19.40      else(MSVC80)
   19.41        # MSVC 10.0 config
   19.42 +      set(BOOST_CONTEXT_LIBRARY 
   19.43 +          optimized libboost_context-mt
   19.44 +          debug libboost_context-mt-gd)
   19.45 +      set(BOOST_FILESYSTEM_LIBRARY 
   19.46 +          optimized libboost_filesystem-mt
   19.47 +          debug libboost_filesystem-mt-gd)
   19.48        set(BOOST_PROGRAM_OPTIONS_LIBRARY 
   19.49            optimized libboost_program_options-mt
   19.50            debug libboost_program_options-mt-gd)
   19.51        set(BOOST_REGEX_LIBRARY
   19.52            optimized libboost_regex-mt
   19.53            debug libboost_regex-mt-gd)
   19.54 +      set(BOOST_SIGNALS_LIBRARY 
   19.55 +          optimized libboost_signals-mt
   19.56 +          debug libboost_signals-mt-gd)
   19.57        set(BOOST_SYSTEM_LIBRARY 
   19.58            optimized libboost_system-mt
   19.59            debug libboost_system-mt-gd)
   19.60 -      set(BOOST_FILESYSTEM_LIBRARY 
   19.61 -          optimized libboost_filesystem-mt
   19.62 -          debug libboost_filesystem-mt-gd)
   19.63        set(BOOST_THREAD_LIBRARY 
   19.64            optimized libboost_thread-mt
   19.65            debug libboost_thread-mt-gd)
   19.66      endif (MSVC80)
   19.67    elseif (LINUX)
   19.68 +    set(BOOST_CONTEXT_LIBRARY
   19.69 +        optimized boost_context-mt
   19.70 +        debug boost_context-mt-d)
   19.71 +    set(BOOST_FILESYSTEM_LIBRARY
   19.72 +        optimized boost_filesystem-mt
   19.73 +        debug boost_filesystem-mt-d)
   19.74      set(BOOST_PROGRAM_OPTIONS_LIBRARY
   19.75          optimized boost_program_options-mt
   19.76          debug boost_program_options-mt-d)
   19.77      set(BOOST_REGEX_LIBRARY
   19.78          optimized boost_regex-mt
   19.79          debug boost_regex-mt-d)
   19.80 +    set(BOOST_SIGNALS_LIBRARY
   19.81 +        optimized boost_signals-mt
   19.82 +        debug boost_signals-mt-d)
   19.83      set(BOOST_SYSTEM_LIBRARY
   19.84          optimized boost_system-mt
   19.85          debug boost_system-mt-d)
   19.86 -    set(BOOST_FILESYSTEM_LIBRARY
   19.87 -        optimized boost_filesystem-mt
   19.88 -        debug boost_filesystem-mt-d)
   19.89      set(BOOST_THREAD_LIBRARY
   19.90          optimized boost_thread-mt
   19.91          debug boost_thread-mt-d)
   19.92    elseif (DARWIN)
   19.93 -    set(BOOST_PROGRAM_OPTIONS_LIBRARY
   19.94 -        optimized boost_program_options-mt
   19.95 -        debug boost_program_options-mt-d)
   19.96 +    set(BOOST_CONTEXT_LIBRARY
   19.97 +        optimized boost_context-mt
   19.98 +        debug boost_context-mt-d)
   19.99 +    set(BOOST_FILESYSTEM_LIBRARY
  19.100 +        optimized boost_filesystem-mt
  19.101 +        debug boost_filesystem-mt-d)
  19.102      set(BOOST_PROGRAM_OPTIONS_LIBRARY
  19.103          optimized boost_program_options-mt
  19.104          debug boost_program_options-mt-d)
  19.105      set(BOOST_REGEX_LIBRARY
  19.106          optimized boost_regex-mt
  19.107          debug boost_regex-mt-d)
  19.108 +    set(BOOST_SIGNALS_LIBRARY
  19.109 +        optimized boost_signals-mt
  19.110 +        debug boost_signals-mt-d)
  19.111      set(BOOST_SYSTEM_LIBRARY
  19.112          optimized boost_system-mt
  19.113          debug boost_system-mt-d)
  19.114 -    set(BOOST_FILESYSTEM_LIBRARY
  19.115 -        optimized boost_filesystem-mt
  19.116 -        debug boost_filesystem-mt-d)
  19.117      set(BOOST_THREAD_LIBRARY
  19.118          optimized boost_thread-mt
  19.119          debug boost_thread-mt-d)
    20.1 --- a/indra/cmake/BuildVersion.cmake	Thu May 02 19:12:59 2013 -0400
    20.2 +++ b/indra/cmake/BuildVersion.cmake	Thu May 30 21:28:02 2013 +0000
    20.3 @@ -1,18 +1,48 @@
    20.4  # -*- cmake -*-
    20.5 +# Construct the viewer version number based on the indra/VIEWER_VERSION file
    20.6  
    20.7 -include(Python)
    20.8 +if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/newview/
    20.9 +    set(VIEWER_VERSION_BASE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/newview/VIEWER_VERSION.txt")
   20.10  
   20.11 -macro (build_version _target)
   20.12 -  execute_process(
   20.13 -      COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/build_version.py
   20.14 -        llversion${_target}.h ${LLCOMMON_INCLUDE_DIRS}
   20.15 -      OUTPUT_VARIABLE ${_target}_VERSION
   20.16 -      OUTPUT_STRIP_TRAILING_WHITESPACE
   20.17 -      )
   20.18 +    if ( EXISTS ${VIEWER_VERSION_BASE_FILE} )
   20.19 +        file(STRINGS ${VIEWER_VERSION_BASE_FILE} VIEWER_SHORT_VERSION REGEX "^[0-9]+\\.[0-9]+\\.[0-9]+")
   20.20 +        string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" VIEWER_VERSION_MAJOR ${VIEWER_SHORT_VERSION})
   20.21 +        string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" VIEWER_VERSION_MINOR ${VIEWER_SHORT_VERSION})
   20.22 +        string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" VIEWER_VERSION_PATCH ${VIEWER_SHORT_VERSION})
   20.23  
   20.24 -  if (${_target}_VERSION)
   20.25 -    message(STATUS "Version of ${_target} is ${${_target}_VERSION}")
   20.26 -  else (${_target}_VERSION)
   20.27 -    message(SEND_ERROR "Could not determine ${_target} version")
   20.28 -  endif (${_target}_VERSION)
   20.29 -endmacro (build_version)
   20.30 +        if (DEFINED ENV{revision})
   20.31 +           set(VIEWER_VERSION_REVISION $ENV{revision})
   20.32 +           message("Revision (from environment): ${VIEWER_VERSION_REVISION}")
   20.33 +
   20.34 +        else (DEFINED ENV{revision})
   20.35 +           find_program(MERCURIAL hg)
   20.36 +           if (DEFINED MERCURIAL)
   20.37 +              execute_process(
   20.38 +                 COMMAND ${MERCURIAL} parents --template "{rev}"
   20.39 +                 OUTPUT_VARIABLE VIEWER_VERSION_REVISION
   20.40 +                 OUTPUT_STRIP_TRAILING_WHITESPACE
   20.41 +                 )
   20.42 +              if ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
   20.43 +                 message("Revision (from hg) ${VIEWER_VERSION_REVISION}")
   20.44 +              else ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
   20.45 +                 set(VIEWER_VERSION_REVISION 0 )
   20.46 +                 message("Revision not set, repository not found, using ${VIEWER_VERSION_REVISION}")
   20.47 +              endif ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
   20.48 +           else (DEFINED MERCURIAL)
   20.49 +              set(VIEWER_VERSION_REVISION 0)
   20.50 +              message("Revision not set, 'hg' not found (${MERCURIAL}), using ${VIEWER_VERSION_REVISION}")
   20.51 +           endif (DEFINED MERCURIAL)
   20.52 +        endif (DEFINED ENV{revision})
   20.53 +        message("Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
   20.54 +    else ( EXISTS ${VIEWER_VERSION_BASE_FILE} )
   20.55 +        message(SEND_ERROR "Cannot get viewer version from '${VIEWER_VERSION_BASE_FILE}'") 
   20.56 +    endif ( EXISTS ${VIEWER_VERSION_BASE_FILE} )
   20.57 +
   20.58 +    set(VIEWER_CHANNEL_VERSION_DEFINES
   20.59 +        "LL_VIEWER_CHANNEL=\"${VIEWER_CHANNEL}\""
   20.60 +        "LL_VIEWER_VERSION_MAJOR=${VIEWER_VERSION_MAJOR}"
   20.61 +        "LL_VIEWER_VERSION_MINOR=${VIEWER_VERSION_MINOR}"
   20.62 +        "LL_VIEWER_VERSION_PATCH=${VIEWER_VERSION_PATCH}"
   20.63 +        "LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}"
   20.64 +        )
   20.65 +endif (NOT DEFINED VIEWER_SHORT_VERSION)
    21.1 --- a/indra/cmake/CMakeLists.txt	Thu May 02 19:12:59 2013 -0400
    21.2 +++ b/indra/cmake/CMakeLists.txt	Thu May 30 21:28:02 2013 +0000
    21.3 @@ -12,50 +12,67 @@
    21.4      Audio.cmake
    21.5      BerkeleyDB.cmake
    21.6      Boost.cmake
    21.7 -    BuildVersion.cmake
    21.8      CARes.cmake
    21.9 +    CMakeCopyIfDifferent.cmake
   21.10 +    ConfigurePkgConfig.cmake
   21.11      CURL.cmake
   21.12 -    CMakeCopyIfDifferent.cmake
   21.13      Copy3rdPartyLibs.cmake
   21.14 -    CSharpMacros.cmake
   21.15      DBusGlib.cmake
   21.16 +    DeploySharedLibs.cmake
   21.17      DirectX.cmake
   21.18 +    DragDrop.cmake
   21.19      EXPAT.cmake
   21.20 +    ExamplePlugin.cmake
   21.21      FindAPR.cmake
   21.22 +    FindAutobuild.cmake
   21.23      FindBerkeleyDB.cmake
   21.24      FindCARes.cmake
   21.25 -    FindELFIO.cmake
   21.26 -    FindFMOD.cmake
   21.27 +    FindFMODEX.cmake
   21.28 +    FindGLH.cmake
   21.29 +    FindGoogleBreakpad.cmake
   21.30      FindGooglePerfTools.cmake
   21.31 -    FindMono.cmake
   21.32 -    FindMySQL.cmake
   21.33 +    FindHUNSPELL.cmake
   21.34 +    FindJsonCpp.cmake
   21.35 +    FindNDOF.cmake
   21.36      FindOpenJPEG.cmake
   21.37 +    FindSCP.cmake
   21.38      FindXmlRpcEpi.cmake
   21.39      FindZLIB.cmake
   21.40 -    FMOD.cmake
   21.41 +    FMODEX.cmake
   21.42      FreeType.cmake
   21.43 +    GLEXT.cmake
   21.44 +    GLH.cmake
   21.45      GLOD.cmake
   21.46      GStreamer010Plugin.cmake
   21.47 +    GetPrerequisites_2_8.cmake
   21.48 +    Glui.cmake
   21.49 +    Glut.cmake
   21.50 +    GoogleBreakpad.cmake
   21.51 +    GoogleMock.cmake
   21.52      GooglePerfTools.cmake
   21.53 +    Havok.cmake
   21.54      Hunspell.cmake
   21.55      JPEG.cmake
   21.56 +    JsonCpp.cmake
   21.57      LLAddBuildTest.cmake
   21.58 +    LLAppearance.cmake
   21.59 +    LLAppearanceUtility.cmake
   21.60      LLAudio.cmake
   21.61      LLCharacter.cmake
   21.62      LLCommon.cmake
   21.63      LLCrashLogger.cmake
   21.64 -    LLDatabase.cmake
   21.65      LLImage.cmake
   21.66      LLImageJ2COJ.cmake
   21.67      LLInventory.cmake
   21.68      LLKDU.cmake
   21.69 +    LLLogin.cmake
   21.70      LLMath.cmake
   21.71      LLMessage.cmake
   21.72 +    LLPhysicsExtensions.cmake
   21.73      LLPlugin.cmake
   21.74      LLPrimitive.cmake
   21.75 -    LLPhysicsExtensions.cmake
   21.76      LLRender.cmake
   21.77 -    LLScene.cmake
   21.78 +    LLSharedLibs.cmake
   21.79      LLTestCommand.cmake
   21.80      LLUI.cmake
   21.81      LLVFS.cmake
   21.82 @@ -63,21 +80,26 @@
   21.83      LLXML.cmake
   21.84      LScript.cmake
   21.85      Linking.cmake
   21.86 -    MonoEmbed.cmake
   21.87 -    MySQL.cmake
   21.88 +    MediaPluginBase.cmake
   21.89      NDOF.cmake
   21.90      OPENAL.cmake
   21.91      OpenGL.cmake
   21.92      OpenJPEG.cmake
   21.93      OpenSSL.cmake
   21.94      PNG.cmake
   21.95 +    PluginAPI.cmake
   21.96 +    Prebuilt.cmake
   21.97 +    PulseAudio.cmake
   21.98      Python.cmake
   21.99 -    Prebuilt.cmake
  21.100 +    QuickTimePlugin.cmake
  21.101      TemplateCheck.cmake
  21.102      Tut.cmake
  21.103      UI.cmake
  21.104      UnixInstall.cmake
  21.105      Variables.cmake
  21.106 +    ViewerMiscLibs.cmake
  21.107 +    VisualLeakDetector.cmake
  21.108 +    WebKitLibPlugin.cmake
  21.109      XmlRpcEpi.cmake
  21.110      ZLIB.cmake
  21.111      )
  21.112 @@ -88,10 +110,6 @@
  21.113      ../CMakeLists.txt
  21.114      )
  21.115  
  21.116 -if (SERVER)
  21.117 -  list(APPEND master_SOURCE_FILES ../Server.cmake)
  21.118 -endif (SERVER)
  21.119 -
  21.120  source_group("Master Rules" FILES ${master_SOURCE_FILES})
  21.121  
  21.122  set_source_files_properties(${cmake_SOURCE_FILES} ${master_SOURCE_FILES}
    22.1 --- a/indra/cmake/CSharpMacros.cmake	Thu May 02 19:12:59 2013 -0400
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,142 +0,0 @@
    22.4 -# - This is a support module for easy Mono/C# handling with CMake
    22.5 -# It defines the following macros:
    22.6 -#
    22.7 -# ADD_CS_LIBRARY (<target> <source>)
    22.8 -# ADD_CS_EXECUTABLE (<target> <source>)
    22.9 -# INSTALL_GAC (<target>)
   22.10 -#
   22.11 -# Note that the order of the arguments is important.
   22.12 -#
   22.13 -# You can optionally set the variable CS_FLAGS to tell the macros whether
   22.14 -# to pass additional flags to the compiler. This is particularly useful to
   22.15 -# set assembly references, unsafe code, etc... These flags are always reset
   22.16 -# after the target was added so you don't have to care about that.
   22.17 -#
   22.18 -# copyright (c) 2007 Arno Rehn arno@arnorehn.de
   22.19 -#
   22.20 -# Redistribution and use is allowed according to the terms of the GPL license.
   22.21 -
   22.22 -
   22.23 -# ----- support macros -----
   22.24 -MACRO(GET_CS_LIBRARY_TARGET_DIR)
   22.25 -        IF (NOT LIBRARY_OUTPUT_PATH)
   22.26 -                SET(CS_LIBRARY_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
   22.27 -        ELSE (NOT LIBRARY_OUTPUT_PATH)
   22.28 -                SET(CS_LIBRARY_TARGET_DIR ${LIBRARY_OUTPUT_PATH})
   22.29 -        ENDIF (NOT LIBRARY_OUTPUT_PATH)
   22.30 -ENDMACRO(GET_CS_LIBRARY_TARGET_DIR)
   22.31 -
   22.32 -MACRO(GET_CS_EXECUTABLE_TARGET_DIR)
   22.33 -        IF (NOT EXECUTABLE_OUTPUT_PATH)
   22.34 -                SET(CS_EXECUTABLE_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
   22.35 -        ELSE (NOT EXECUTABLE_OUTPUT_PATH)
   22.36 -                SET(CS_EXECUTABLE_TARGET_DIR ${EXECUTABLE_OUTPUT_PATH})
   22.37 -        ENDIF (NOT EXECUTABLE_OUTPUT_PATH)
   22.38 -ENDMACRO(GET_CS_EXECUTABLE_TARGET_DIR)
   22.39 -
   22.40 -MACRO(MAKE_PROPER_FILE_LIST)
   22.41 -        FOREACH(file ${ARGN})
   22.42 -                # first assume it's a relative path
   22.43 -                FILE(GLOB globbed ${CMAKE_CURRENT_SOURCE_DIR}/${file})
   22.44 -                IF(globbed)
   22.45 -                        FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${file} native)
   22.46 -                ELSE(globbed)
   22.47 -                        FILE(TO_NATIVE_PATH ${file} native)
   22.48 -                ENDIF(globbed)
   22.49 -                SET(proper_file_list ${proper_file_list} ${native})
   22.50 -                SET(native "")
   22.51 -        ENDFOREACH(file)
   22.52 -ENDMACRO(MAKE_PROPER_FILE_LIST)
   22.53 -# ----- end support macros -----
   22.54 -
   22.55 -MACRO(ADD_CS_LIBRARY target)
   22.56 -        GET_CS_LIBRARY_TARGET_DIR()
   22.57 -        
   22.58 -        SET(target_DLL "${CS_LIBRARY_TARGET_DIR}/${target}.dll")
   22.59 -        MAKE_PROPER_FILE_LIST(${ARGN})
   22.60 -        FILE(RELATIVE_PATH relative_path ${CMAKE_BINARY_DIR} ${target_DLL})
   22.61 -        
   22.62 -        SET(target_KEY "${CMAKE_CURRENT_SOURCE_DIR}/${target}.key")
   22.63 -        SET(target_CS_FLAGS "${CS_FLAGS}")
   22.64 -        IF(${target}_CS_FLAGS)
   22.65 -                LIST(APPEND target_CS_FLAGS ${${target}_CS_FLAGS})
   22.66 -        ENDIF(${target}_CS_FLAGS)
   22.67 -        IF(EXISTS ${target_KEY})
   22.68 -                LIST(APPEND target_CS_FLAGS -keyfile:${target_KEY})
   22.69 -        ENDIF(EXISTS ${target_KEY})
   22.70 -
   22.71 -        FOREACH(ref ${${target}_REFS})
   22.72 -                SET(ref_DLL ${CMAKE_CURRENT_BINARY_DIR}/${ref}.dll)
   22.73 -                IF(EXISTS ${ref_DLL})
   22.74 -                        LIST(APPEND target_CS_FLAGS -r:${ref_DLL})
   22.75 -                ELSE(EXISTS ${ref_DLL})
   22.76 -                        LIST(APPEND target_CS_FLAGS -r:${ref})
   22.77 -                ENDIF(EXISTS ${ref_DLL})
   22.78 -        ENDFOREACH(ref ${${target}_REFS})
   22.79 -
   22.80 -        ADD_CUSTOM_COMMAND (OUTPUT ${target_DLL}
   22.81 -                COMMAND ${MCS_EXECUTABLE} ${target_CS_FLAGS} -out:${target_DLL} -target:library ${proper_file_list}
   22.82 -                MAIN_DEPENDENCY ${proper_file_list}
   22.83 -                DEPENDS ${ARGN}
   22.84 -                COMMENT "Building ${relative_path}")
   22.85 -        ADD_CUSTOM_TARGET (${target} ALL DEPENDS ${target_DLL})
   22.86 -
   22.87 -        FOREACH(ref ${${target}_REFS})
   22.88 -                GET_TARGET_PROPERTY(is_target ${ref} TYPE)
   22.89 -                IF(is_target)
   22.90 -                        ADD_DEPENDENCIES(${target} ${ref})
   22.91 -                ENDIF(is_target)
   22.92 -        ENDFOREACH(ref ${${target}_REFS})
   22.93 -
   22.94 -        SET(relative_path "")
   22.95 -        SET(proper_file_list "")
   22.96 -ENDMACRO(ADD_CS_LIBRARY)
   22.97 -
   22.98 -MACRO(ADD_CS_EXECUTABLE target)
   22.99 -        GET_CS_EXECUTABLE_TARGET_DIR()
  22.100 -        
  22.101 -        # Seems like cmake doesn't like the ".exe" ending for custom commands.
  22.102 -        # If we call it ${target}.exe, 'make' will later complain about a missing rule.
  22.103 -        # Create a fake target instead.
  22.104 -        SET(target_EXE "${CS_EXECUTABLE_TARGET_DIR}/${target}.exe")
  22.105 -        SET(target_TOUCH "${CS_EXECUTABLE_TARGET_DIR}/${target}.exe-built")
  22.106 -        GET_DIRECTORY_PROPERTY(clean ADDITIONAL_MAKE_CLEAN_FILES)
  22.107 -        LIST(APPEND clean ${target}.exe)
  22.108 -        SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${clean}")
  22.109 -        MAKE_PROPER_FILE_LIST(${ARGN})
  22.110 -        FILE(RELATIVE_PATH relative_path ${CMAKE_BINARY_DIR} ${target_EXE})
  22.111 -        SET(target_CS_FLAGS "${CS_FLAGS}")
  22.112 -        
  22.113 -        FOREACH(ref ${${target}_REFS})
  22.114 -                SET(ref_DLL ${CMAKE_CURRENT_SOURCE_DIR}/${ref}.dll)
  22.115 -                IF(EXISTS ${ref_DLL})
  22.116 -                        LIST(APPEND target_CS_FLAGS -r:${ref_DLL})
  22.117 -                ELSE(EXISTS ${ref_DLL})
  22.118 -                        LIST(APPEND target_CS_FLAGS -r:${ref})
  22.119 -                ENDIF(EXISTS ${ref_DLL})
  22.120 -        ENDFOREACH(ref ${${target}_REFS})
  22.121 -
  22.122 -        ADD_CUSTOM_COMMAND (OUTPUT "${target_TOUCH}"
  22.123 -                COMMAND ${MCS_EXECUTABLE} ${target_CS_FLAGS} -out:${target_EXE} ${proper_file_list}
  22.124 -                COMMAND ${CMAKE_COMMAND} -E touch ${target_TOUCH}
  22.125 -                MAIN_DEPENDENCY ${ARGN}
  22.126 -                DEPENDS ${ARGN}
  22.127 -                COMMENT "Building ${relative_path}")
  22.128 -        ADD_CUSTOM_TARGET ("${target}" ALL DEPENDS "${target_TOUCH}")
  22.129 -
  22.130 -        FOREACH(ref ${${target}_REFS})
  22.131 -                GET_TARGET_PROPERTY(is_target ${ref} TYPE)
  22.132 -                IF(is_target)
  22.133 -                        ADD_DEPENDENCIES(${target} ${ref})
  22.134 -                ENDIF(is_target)
  22.135 -        ENDFOREACH(ref ${${target}_REFS})
  22.136 -
  22.137 -        SET(relative_path "")
  22.138 -        SET(proper_file_list "")
  22.139 -ENDMACRO(ADD_CS_EXECUTABLE)
  22.140 -
  22.141 -MACRO(INSTALL_GAC target)
  22.142 -        GET_CS_LIBRARY_TARGET_DIR()
  22.143 -        
  22.144 -        INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${GACUTIL_EXECUTABLE} -i ${CS_LIBRARY_TARGET_DIR}/${target}.dll -package 2.0)")
  22.145 -ENDMACRO(INSTALL_GAC target)
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/indra/cmake/ConfigurePkgConfig.cmake	Thu May 30 21:28:02 2013 +0000
    23.3 @@ -0,0 +1,74 @@
    23.4 +# -*- cmake -*-
    23.5 +
    23.6 +SET(DEBUG_PKG_CONFIG "YES")
    23.7 +
    23.8 +# Don't change this if manually set by user.
    23.9 +IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "")
   23.10 +
   23.11 +  # Guess at architecture-specific system library paths.
   23.12 +  if (WORD_SIZE EQUAL 32)
   23.13 +    SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib32 /usr/lib)
   23.14 +    SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib32 /usr/local/lib)
   23.15 +    SET(PKG_CONFIG_MULTI_GUESS /usr/lib/i386-linux-gnu)
   23.16 +    SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/i386-linux-gnu)
   23.17 +  else (WORD_SIZE EQUAL 32)
   23.18 +    SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib)
   23.19 +    SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib)
   23.20 +    SET(PKG_CONFIG_MULTI_GUESS /usr/local/lib/x86_64-linux-gnu)
   23.21 +    SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu)
   23.22 +  endif (WORD_SIZE EQUAL 32)
   23.23 +  
   23.24 +  # Use DPKG architecture, if available.
   23.25 +  IF (${DPKG_ARCH})
   23.26 +    SET(PKG_CONFIG_MULTI_GUESS /usr/lib/${DPKG_ARCH})
   23.27 +    SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usrlocal/lib/${DPKG_ARCH})
   23.28 +  ENDIF (${DPKG_ARCH})
   23.29 +  
   23.30 +  # Explicitly include anything listed in PKG_CONFIG_PATH
   23.31 +  string(REPLACE ":" ";" PKG_CONFIG_PATH_LIST "$ENV{PKG_CONFIG_PATH}")
   23.32 +  FOREACH(PKG_CONFIG_DIR ${PKG_CONFIG_PATH_LIST})
   23.33 +    SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_DIR}/pkgconfig")
   23.34 +  ENDFOREACH(PKG_CONFIG_DIR)
   23.35 +
   23.36 +  # Look for valid pkgconfig directories.
   23.37 +  FIND_PATH(PKG_CONFIG_ENV pkgconfig ENV LD_LIBRARY_PATH)
   23.38 +  FIND_PATH(PKG_CONFIG_MULTI pkgconfig HINT ${PKG_CONFIG_MULTI_GUESS})
   23.39 +  FIND_PATH(PKG_CONFIG_MULTI_LOCAL pkgconfig HINT ${PKG_CONFIG_MULTI_LOCAL_GUESS})
   23.40 +  FIND_PATH(PKG_CONFIG_NO_MULTI pkgconfig HINT ${PKG_CONFIG_NO_MULTI_GUESS})
   23.41 +  FIND_PATH(PKG_CONFIG_NO_MULTI_LOCAL pkgconfig HINT ${PKG_CONFIG_NO_MULTI_LOCAL_GUESS})
   23.42 +
   23.43 +  # Add anything we found to our list.
   23.44 +  IF(NOT PKG_CONFIG_ENV STREQUAL PKG_CONFIG_ENV-NOTFOUND) 
   23.45 +    SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_ENV}/pkgconfig")
   23.46 +  ENDIF(NOT PKG_CONFIG_ENV STREQUAL PKG_CONFIG_ENV-NOTFOUND) 
   23.47 +
   23.48 +  IF(NOT PKG_CONFIG_MULTI STREQUAL PKG_CONFIG_MULTI-NOTFOUND) 
   23.49 +    SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_MULTI}/pkgconfig")
   23.50 +  ENDIF(NOT PKG_CONFIG_MULTI STREQUAL PKG_CONFIG_MULTI-NOTFOUND) 
   23.51 +
   23.52 +  IF(NOT PKG_CONFIG_MULTI_LOCAL STREQUAL PKG_CONFIG_MULTI_LOCAL-NOTFOUND) 
   23.53 +    SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_MULTI_LOCAL}/pkgconfig")
   23.54 +  ENDIF(NOT PKG_CONFIG_MULTI_LOCAL STREQUAL PKG_CONFIG_MULTI_LOCAL-NOTFOUND) 
   23.55 +
   23.56 +  IF(NOT PKG_CONFIG_NO_MULTI STREQUAL PKG_CONFIG_NO_MULTI-NOTFOUND) 
   23.57 +    SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_NO_MULTI}/pkgconfig")
   23.58 +  ENDIF(NOT PKG_CONFIG_NO_MULTI STREQUAL PKG_CONFIG_NO_MULTI-NOTFOUND) 
   23.59 +
   23.60 +  IF(NOT PKG_CONFIG_NO_MULTI_LOCAL STREQUAL PKG_CONFIG_NO_MULTI_LOCAL-NOTFOUND) 
   23.61 +    SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_NO_MULTI_LOCAL}/pkgconfig")
   23.62 +  ENDIF(NOT PKG_CONFIG_NO_MULTI_LOCAL STREQUAL PKG_CONFIG_NO_MULTI_LOCAL-NOTFOUND) 
   23.63 +
   23.64 +  # Also add some non-architecture specific package locations.
   23.65 +  SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:/usr/share/pkgconfig:/usr/local/share/pkgconfig")
   23.66 +
   23.67 +  # Remove first unwanted ':'
   23.68 +  string(SUBSTRING ${VALID_PKG_LIBDIRS} 1 -1 VALID_PKG_LIBDIRS)
   23.69 +
   23.70 +  # Set PKG_CONFIG_LIBDIR environment.
   23.71 +  SET(ENV{PKG_CONFIG_LIBDIR} ${VALID_PKG_LIBDIRS})
   23.72 +ENDIF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "")
   23.73 +
   23.74 +IF(DEBUG_PKG_CONFIG)
   23.75 +  MESSAGE(STATUS "Using PKG_CONFIG_LIBDIR=$ENV{PKG_CONFIG_LIBDIR}")
   23.76 +ENDIF(DEBUG_PKG_CONFIG)
   23.77 +
    24.1 --- a/indra/cmake/Copy3rdPartyLibs.cmake	Thu May 02 19:12:59 2013 -0400
    24.2 +++ b/indra/cmake/Copy3rdPartyLibs.cmake	Thu May 30 21:28:02 2013 +0000
    24.3 @@ -62,10 +62,9 @@
    24.4        set(release_files ${release_files} libtcmalloc_minimal.dll)
    24.5      endif(USE_TCMALLOC)
    24.6  
    24.7 -    if (FMOD)
    24.8 -      set(debug_files ${debug_files} fmod.dll)
    24.9 -      set(release_files ${release_files} fmod.dll)
   24.10 -    endif (FMOD)
   24.11 +    if (FMODEX)
   24.12 +      set(release_files ${release_files} fmodex.dll)
   24.13 +    endif (FMODEX)
   24.14  
   24.15  #*******************************
   24.16  # Copy MS C runtime dlls, required for packaging.
   24.17 @@ -222,8 +221,10 @@
   24.18          libcollada14dom.dylib
   24.19         )
   24.20  
   24.21 -    # fmod is statically linked on darwin
   24.22 -    set(fmod_files "")
   24.23 +    if (FMODEX)
   24.24 +      set(debug_files ${debug_files} libfmodexL.dylib)
   24.25 +      set(release_files ${release_files} libfmodex.dylib)
   24.26 +    endif (FMODEX)
   24.27  
   24.28  elseif(LINUX)
   24.29      # linux is weird, multiple side by side configurations aren't supported
   24.30 @@ -254,19 +255,19 @@
   24.31          libapr-1.so.0
   24.32          libaprutil-1.so.0
   24.33          libatk-1.0.so
   24.34 +        libboost_context-mt.so.${BOOST_VERSION}.0
   24.35 +        libboost_filesystem-mt.so.${BOOST_VERSION}.0
   24.36          libboost_program_options-mt.so.${BOOST_VERSION}.0
   24.37          libboost_regex-mt.so.${BOOST_VERSION}.0
   24.38 -        libboost_thread-mt.so.${BOOST_VERSION}.0
   24.39 -        libboost_filesystem-mt.so.${BOOST_VERSION}.0
   24.40          libboost_signals-mt.so.${BOOST_VERSION}.0
   24.41          libboost_system-mt.so.${BOOST_VERSION}.0
   24.42 -        libbreakpad_client.so.0
   24.43 +        libboost_thread-mt.so.${BOOST_VERSION}.0
   24.44          libcollada14dom.so
   24.45          libcrypto.so.1.0.0
   24.46          libdb-5.1.so
   24.47          libexpat.so
   24.48          libexpat.so.1
   24.49 -        libglod.so
   24.50 +        libGLOD.so
   24.51          libgmock_main.so
   24.52          libgmock.so.0
   24.53          libgmodule-2.0.so
   24.54 @@ -288,9 +289,9 @@
   24.55        set(release_files ${release_files} "libtcmalloc_minimal.so")
   24.56      endif (USE_TCMALLOC)
   24.57  
   24.58 -    if (FMOD)
   24.59 -      set(release_files ${release_files} "libfmod-3.75.so")
   24.60 -    endif (FMOD)
   24.61 +    if (FMODEX)
   24.62 +      set(release_file ${release_files} "libfmodex.so")
   24.63 +    endif (FMODEX)
   24.64  
   24.65  else(WINDOWS)
   24.66      message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
   24.67 @@ -305,8 +306,6 @@
   24.68      set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
   24.69      set(release_files "")
   24.70  
   24.71 -    set(fmod_files "")
   24.72 -
   24.73      set(debug_llkdu_src "")
   24.74      set(debug_llkdu_dst "")
   24.75      set(release_llkdu_src "")
   24.76 @@ -369,30 +368,6 @@
   24.77      )
   24.78  set(third_party_targets ${third_party_targets} ${out_targets})
   24.79  
   24.80 -if (FMOD_SDK_DIR)
   24.81 -    copy_if_different(
   24.82 -        ${FMOD_SDK_DIR} 
   24.83 -        "${CMAKE_CURRENT_BINARY_DIR}/Debug"
   24.84 -        out_targets 
   24.85 -        ${fmod_files}
   24.86 -        )
   24.87 -    set(all_targets ${all_targets} ${out_targets})
   24.88 -    copy_if_different(
   24.89 -        ${FMOD_SDK_DIR} 
   24.90 -        "${CMAKE_CURRENT_BINARY_DIR}/Release"
   24.91 -        out_targets 
   24.92 -        ${fmod_files}
   24.93 -        )
   24.94 -    set(all_targets ${all_targets} ${out_targets})
   24.95 -    copy_if_different(
   24.96 -        ${FMOD_SDK_DIR} 
   24.97 -        "${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo"
   24.98 -        out_targets 
   24.99 -        ${fmod_files}
  24.100 -        )
  24.101 -    set(all_targets ${all_targets} ${out_targets})
  24.102 -endif (FMOD_SDK_DIR)
  24.103 -
  24.104  if(NOT STANDALONE)
  24.105    add_custom_target(
  24.106        stage_third_party_libs ALL
    25.1 --- a/indra/cmake/CopyBackToSource.cmake	Thu May 02 19:12:59 2013 -0400
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,16 +0,0 @@
    25.4 -# -*- cmake -*-
    25.5 -# Copies a binary back to the source directory
    25.6 -
    25.7 -MACRO(COPY_BACK_TO_SOURCE target)
    25.8 -   GET_TARGET_PROPERTY(FROM ${target} LOCATION)
    25.9 -   SET(TO ${CMAKE_CURRENT_SOURCE_DIR})
   25.10 -   #MESSAGE("TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}")
   25.11 -   ADD_CUSTOM_COMMAND(
   25.12 -        TARGET ${target} POST_BUILD
   25.13 -        COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}
   25.14 -        DEPENDS ${FROM}
   25.15 -        COMMENT "Copying ${target} to ${CMAKE_CURRENT_BINARY_DIR}"
   25.16 -        )
   25.17 -ENDMACRO(COPY_BACK_TO_SOURCE)
   25.18 -
   25.19 -
    26.1 --- a/indra/cmake/DirectX.cmake	Thu May 02 19:12:59 2013 -0400
    26.2 +++ b/indra/cmake/DirectX.cmake	Thu May 30 21:28:02 2013 +0000
    26.3 @@ -1,8 +1,9 @@
    26.4  # -*- cmake -*-
    26.5  
    26.6 -if (VIEWER AND WINDOWS)
    26.7 +if (WINDOWS)
    26.8    find_path(DIRECTX_INCLUDE_DIR dxdiag.h
    26.9              "$ENV{DXSDK_DIR}/Include"
   26.10 +            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Include"
   26.11              "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2009)/Include"
   26.12              "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Include"
   26.13              "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Include"
   26.14 @@ -25,6 +26,7 @@
   26.15  
   26.16    find_path(DIRECTX_LIBRARY_DIR dxguid.lib
   26.17              "$ENV{DXSDK_DIR}/Lib/x86"
   26.18 +            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Lib/x86"
   26.19              "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2009)/Lib/x86"
   26.20              "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Lib/x86"
   26.21              "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Lib/x86"
   26.22 @@ -43,4 +45,4 @@
   26.23      message(FATAL_ERROR "Could not find DirectX SDK Libraries")
   26.24    endif (DIRECTX_LIBRARY_DIR)
   26.25  
   26.26 -endif (VIEWER AND WINDOWS)
   26.27 +endif (WINDOWS)
    27.1 --- a/indra/cmake/DragDrop.cmake	Thu May 02 19:12:59 2013 -0400
    27.2 +++ b/indra/cmake/DragDrop.cmake	Thu May 30 21:28:02 2013 +0000
    27.3 @@ -1,23 +1,20 @@
    27.4  # -*- cmake -*-
    27.5  
    27.6 -if (VIEWER)
    27.7 +set(OS_DRAG_DROP ON CACHE BOOL "Build the viewer with OS level drag and drop turned on or off")
    27.8  
    27.9 -  set(OS_DRAG_DROP ON CACHE BOOL "Build the viewer with OS level drag and drop turned on or off")
   27.10 +if (OS_DRAG_DROP)
   27.11  
   27.12 -  if (OS_DRAG_DROP)
   27.13 +  if (WINDOWS)
   27.14 +    add_definitions(-DLL_OS_DRAGDROP_ENABLED=1)
   27.15 +  endif (WINDOWS)
   27.16  
   27.17 -    if (WINDOWS)
   27.18 -      add_definitions(-DLL_OS_DRAGDROP_ENABLED=1)
   27.19 -    endif (WINDOWS)
   27.20 +  if (DARWIN)
   27.21 +    add_definitions(-DLL_OS_DRAGDROP_ENABLED=1)
   27.22 +  endif (DARWIN)
   27.23  
   27.24 -    if (DARWIN)
   27.25 -      add_definitions(-DLL_OS_DRAGDROP_ENABLED=1)
   27.26 -    endif (DARWIN)
   27.27 +  if (LINUX)
   27.28 +    add_definitions(-DLL_OS_DRAGDROP_ENABLED=0)
   27.29 +  endif (LINUX)
   27.30  
   27.31 -    if (LINUX)
   27.32 -      add_definitions(-DLL_OS_DRAGDROP_ENABLED=0)
   27.33 -    endif (LINUX)
   27.34 +endif (OS_DRAG_DROP)
   27.35  
   27.36 -  endif (OS_DRAG_DROP)
   27.37 -
   27.38 -endif (VIEWER)
    28.1 --- a/indra/cmake/Externals.cmake	Thu May 02 19:12:59 2013 -0400
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,34 +0,0 @@
    28.4 -# -*- cmake -*-
    28.5 -
    28.6 -include(Python)
    28.7 -include(FindSVN)
    28.8 -
    28.9 -macro (use_svn_external _binary _path _url _rev)
   28.10 -  if (NOT STANDALONE)
   28.11 -    if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
   28.12 -      if(SVN_FOUND)
   28.13 -        if(DEBUG_EXTERNALS)
   28.14 -          message("cd ${_path} && ${SVN_EXECUTABLE} checkout -r ${_rev} ${_url} ${_binary}")
   28.15 -        endif(DEBUG_EXTERNALS)
   28.16 -        execute_process(COMMAND ${SVN_EXECUTABLE}
   28.17 -          checkout
   28.18 -          -r ${_rev}
   28.19 -          ${_url}
   28.20 -          ${_binary}
   28.21 -          WORKING_DIRECTORY ${_path}
   28.22 -          RESULT_VARIABLE ${_binary}_installed
   28.23 -          )
   28.24 -      else(SVN_FOUND)
   28.25 -        message(FATAL_ERROR "Failed to find SVN_EXECUTABLE")
   28.26 -      endif(SVN_FOUND)
   28.27 -      file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}")
   28.28 -    else(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
   28.29 -      set(${_binary}_installed 0)
   28.30 -    endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
   28.31 -    if(NOT ${_binary}_installed EQUAL 0)
   28.32 -      message(FATAL_ERROR
   28.33 -              "Failed to download or unpack prebuilt '${_binary}'."
   28.34 -              " Process returned ${${_binary}_installed}.")
   28.35 -    endif (NOT ${_binary}_installed EQUAL 0)
   28.36 -  endif (NOT STANDALONE)
   28.37 -endmacro (use_svn_external _binary _path _url _rev)
    29.1 --- a/indra/cmake/FMOD.cmake	Thu May 02 19:12:59 2013 -0400
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,39 +0,0 @@
    29.4 -# -*- cmake -*-
    29.5 -
    29.6 -# FMOD can be set when launching the make using the argument -DFMOD:BOOL=ON
    29.7 -# When building using proprietary binaries though (i.e. having access to LL private servers),
    29.8 -# we always build with FMOD.
    29.9 -# Open source devs should use the -DFMOD:BOOL=ON then if they want to build with FMOD, whether
   29.10 -# they are using STANDALONE or not.
   29.11 -if (INSTALL_PROPRIETARY)
   29.12 -  set(FMOD ON CACHE BOOL "Use FMOD sound library.")
   29.13 -endif (INSTALL_PROPRIETARY)
   29.14 -
   29.15 -if (FMOD)
   29.16 -  if (STANDALONE)
   29.17 -    # In that case, we use the version of the library installed on the system
   29.18 -    set(FMOD_FIND_REQUIRED ON)
   29.19 -    include(FindFMOD)
   29.20 -  else (STANDALONE)
   29.21 -    if (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
   29.22 -      # If the path have been specified in the arguments, use that
   29.23 -      set(FMOD_LIBRARIES ${FMOD_LIBRARY})
   29.24 -      MESSAGE(STATUS "Using FMOD path: ${FMOD_LIBRARIES}, ${FMOD_INCLUDE_DIR}")
   29.25 -    else (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
   29.26 -      # If not, we're going to try to get the package listed in autobuild.xml
   29.27 -      # Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL) 
   29.28 -      # as accessing the private LL location will fail if you don't have the credential
   29.29 -      include(Prebuilt)
   29.30 -      use_prebuilt_binary(fmod)    
   29.31 -      if (WINDOWS)
   29.32 -        set(FMOD_LIBRARY fmod)
   29.33 -      elseif (DARWIN)
   29.34 -        set(FMOD_LIBRARY fmod)
   29.35 -      elseif (LINUX)
   29.36 -        set(FMOD_LIBRARY fmod-3.75)
   29.37 -      endif (WINDOWS)
   29.38 -      set(FMOD_LIBRARIES ${FMOD_LIBRARY})
   29.39 -      set(FMOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
   29.40 -    endif (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
   29.41 -  endif (STANDALONE)
   29.42 -endif (FMOD)
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/indra/cmake/FMODEX.cmake	Thu May 30 21:28:02 2013 +0000
    30.3 @@ -0,0 +1,46 @@
    30.4 +# -*- cmake -*-
    30.5 +
    30.6 +# FMOD can be set when launching the make using the argument -DFMOD:BOOL=ON
    30.7 +# When building using proprietary binaries though (i.e. having access to LL private servers),
    30.8 +# we always build with FMODEX.
    30.9 +# Open source devs should use the -DFMODEX:BOOL=ON then if they want to build with FMOD, whether
   30.10 +# they are using STANDALONE or not.
   30.11 +if (INSTALL_PROPRIETARY)
   30.12 +  set(FMODEX ON CACHE BOOL "Using FMOD Ex sound library.")
   30.13 +endif (INSTALL_PROPRIETARY)
   30.14 +
   30.15 +if (FMODEX)
   30.16 +  if (STANDALONE)
   30.17 +    # In that case, we use the version of the library installed on the system
   30.18 +    set(FMODEX_FIND_REQUIRED ON)
   30.19 +    include(FindFMODEX)
   30.20 +  else (STANDALONE)
   30.21 +    if (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
   30.22 +      # If the path have been specified in the arguments, use that
   30.23 +      set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
   30.24 +      MESSAGE(STATUS "Using FMODEX path: ${FMODEX_LIBRARIES}, ${FMODEX_INCLUDE_DIR}")
   30.25 +    else (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
   30.26 +      # If not, we're going to try to get the package listed in autobuild.xml
   30.27 +      # Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL) 
   30.28 +      # as accessing the private LL location will fail if you don't have the credential
   30.29 +      include(Prebuilt)
   30.30 +      use_prebuilt_binary(fmodex)    
   30.31 +      if (WINDOWS)
   30.32 +        set(FMODEX_LIBRARY 
   30.33 +            debug fmodexL_vc
   30.34 +            optimized fmodex_vc)
   30.35 +      elseif (DARWIN)
   30.36 +        set(FMODEX_LIBRARY 
   30.37 +            debug fmodexL
   30.38 +            optimized fmodex)
   30.39 +      elseif (LINUX)
   30.40 +        set(FMODEX_LIBRARY 
   30.41 +            debug fmodexL
   30.42 +            optimized fmodex)
   30.43 +      endif (WINDOWS)
   30.44 +      set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
   30.45 +      set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodex)
   30.46 +    endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
   30.47 +  endif (STANDALONE)
   30.48 +endif (FMODEX)
   30.49 +
    31.1 --- a/indra/cmake/FindELFIO.cmake	Thu May 02 19:12:59 2013 -0400
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,48 +0,0 @@
    31.4 -# -*- cmake -*-
    31.5 -
    31.6 -# - Find ELFIO
    31.7 -# Find the ELFIO includes and library
    31.8 -# This module defines
    31.9 -#  ELFIO_INCLUDE_DIR, where to find elfio.h, etc.
   31.10 -#  ELFIO_LIBRARIES, the libraries needed to use ELFIO.
   31.11 -#  ELFIO_FOUND, If false, do not try to use ELFIO.
   31.12 -# also defined, but not for general use are
   31.13 -#  ELFIO_LIBRARY, where to find the ELFIO library.
   31.14 -
   31.15 -FIND_PATH(ELFIO_INCLUDE_DIR ELFIO/ELFIO.h
   31.16 -/usr/local/include
   31.17 -/usr/include
   31.18 -)
   31.19 -
   31.20 -SET(ELFIO_NAMES ${ELFIO_NAMES} ELFIO)
   31.21 -FIND_LIBRARY(ELFIO_LIBRARY
   31.22 -  NAMES ${ELFIO_NAMES}
   31.23 -  PATHS /usr/lib /usr/local/lib
   31.24 -  )
   31.25 -
   31.26 -IF (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR)
   31.27 -    SET(ELFIO_LIBRARIES ${ELFIO_LIBRARY})
   31.28 -    SET(ELFIO_FOUND "YES")
   31.29 -ELSE (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR)
   31.30 -  SET(ELFIO_FOUND "NO")
   31.31 -ENDIF (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR)
   31.32 -
   31.33 -
   31.34 -IF (ELFIO_FOUND)
   31.35 -   IF (NOT ELFIO_FIND_QUIETLY)
   31.36 -      MESSAGE(STATUS "Found ELFIO: ${ELFIO_LIBRARIES}")
   31.37 -   ENDIF (NOT ELFIO_FIND_QUIETLY)
   31.38 -ELSE (ELFIO_FOUND)
   31.39 -   IF (ELFIO_FIND_REQUIRED)
   31.40 -      MESSAGE(FATAL_ERROR "Could not find ELFIO library")
   31.41 -   ENDIF (ELFIO_FIND_REQUIRED)
   31.42 -ENDIF (ELFIO_FOUND)
   31.43 -
   31.44 -# Deprecated declarations.
   31.45 -SET (NATIVE_ELFIO_INCLUDE_PATH ${ELFIO_INCLUDE_DIR} )
   31.46 -GET_FILENAME_COMPONENT (NATIVE_ELFIO_LIB_PATH ${ELFIO_LIBRARY} PATH)
   31.47 -
   31.48 -MARK_AS_ADVANCED(
   31.49 -  ELFIO_LIBRARY
   31.50 -  ELFIO_INCLUDE_DIR
   31.51 -  )
    32.1 --- a/indra/cmake/FindFMOD.cmake	Thu May 02 19:12:59 2013 -0400
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,44 +0,0 @@
    32.4 -# -*- cmake -*-
    32.5 -
    32.6 -# - Find FMOD
    32.7 -# Find the FMOD includes and library
    32.8 -# This module defines
    32.9 -#  FMOD_INCLUDE_DIR, where to find fmod.h and fmod_errors.h
   32.10 -#  FMOD_LIBRARIES, the libraries needed to use FMOD.
   32.11 -#  FMOD, If false, do not try to use FMOD.
   32.12 -# also defined, but not for general use are
   32.13 -#  FMOD_LIBRARY, where to find the FMOD library.
   32.14 -
   32.15 -FIND_PATH(FMOD_INCLUDE_DIR fmod.h PATH_SUFFIXES fmod)
   32.16 -
   32.17 -SET(FMOD_NAMES ${FMOD_NAMES} fmod fmodvc fmodex fmod-3.75)
   32.18 -FIND_LIBRARY(FMOD_LIBRARY
   32.19 -  NAMES ${FMOD_NAMES}
   32.20 -  PATH_SUFFIXES fmod
   32.21 -  )
   32.22 -
   32.23 -IF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
   32.24 -  SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
   32.25 -  SET(FMOD_FOUND "YES")
   32.26 -ELSE (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
   32.27 -  SET(FMOD_FOUND "NO")
   32.28 -ENDIF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
   32.29 -
   32.30 -IF (FMOD_FOUND)
   32.31 -  IF (NOT FMOD_FIND_QUIETLY)
   32.32 -    MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARIES}")
   32.33 -  ENDIF (NOT FMOD_FIND_QUIETLY)
   32.34 -ELSE (FMOD_FOUND)
   32.35 -  IF (FMOD_FIND_REQUIRED)
   32.36 -    MESSAGE(FATAL_ERROR "Could not find FMOD library")
   32.37 -  ENDIF (FMOD_FIND_REQUIRED)
   32.38 -ENDIF (FMOD_FOUND)
   32.39 -
   32.40 -# Deprecated declarations.
   32.41 -SET (NATIVE_FMOD_INCLUDE_PATH ${FMOD_INCLUDE_DIR} )
   32.42 -GET_FILENAME_COMPONENT (NATIVE_FMOD_LIB_PATH ${FMOD_LIBRARY} PATH)
   32.43 -
   32.44 -MARK_AS_ADVANCED(
   32.45 -  FMOD_LIBRARY
   32.46 -  FMOD_INCLUDE_DIR
   32.47 -  )
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/indra/cmake/FindFMODEX.cmake	Thu May 30 21:28:02 2013 +0000
    33.3 @@ -0,0 +1,65 @@
    33.4 +# -*- cmake -*-
    33.5 +
    33.6 +# - Find FMODEX
    33.7 +# Find the FMODEX includes and library
    33.8 +# This module defines
    33.9 +#  FMODEX_INCLUDE_DIR, where to find fmod.h and fmod_errors.h
   33.10 +#  FMODEX_LIBRARIES, the libraries needed to use FMODEX.
   33.11 +#  FMODEX, If false, do not try to use FMODEX.
   33.12 +# also defined, but not for general use are
   33.13 +#  FMODEX_LIBRARY, where to find the FMODEX library.
   33.14 +
   33.15 +FIND_PATH(FMODEX_INCLUDE_DIR fmod.h PATH_SUFFIXES fmod)
   33.16 +
   33.17 +SET(FMODEX_NAMES ${FMODEX_NAMES} fmodex fmodvc fmodexL_vc)
   33.18 +FIND_LIBRARY(FMODEX_LIBRARY
   33.19 +  NAMES ${FMODEX_NAMES}
   33.20 +  PATH_SUFFIXES fmodex
   33.21 +  )
   33.22 +
   33.23 +IF (FMODEX_SDK_DIR OR WINDOWS)
   33.24 +    if(WINDOWS)
   33.25 +        set(FMODEX_SDK_DIR "$ENV{PROGRAMFILES}/FMOD SoundSystem/FMOD Programmers API Windows" CACHE PATH "Path to FMODEX")
   33.26 +        STRING(REGEX REPLACE "\\\\" "/" FMODEX_SDK_DIR ${FMODEX_SDK_DIR}) 
   33.27 +    endif(WINDOWS)
   33.28 +    find_library(FMODEX_LIBRARY
   33.29 +             fmodex_vc fmodexL_vc 
   33.30 +             PATHS
   33.31 +             ${FMODEX_SDK_DIR}/api/lib
   33.32 +             ${FMODEX_SDK_DIR}/api
   33.33 +             ${FMODEX_SDK_DIR}
   33.34 +             )
   33.35 +    find_path(FMODEX_INCLUDE_DIR fmod.h
   33.36 +        ${FMODEX_SDK_DIR}/api/inc
   33.37 +        ${FMODEX_SDK_DIR}/api
   33.38 +        ${FMODEX_SDK_DIR}
   33.39 +      )
   33.40 +    find_path(FMODEX_INCLUDE_DIR fmod.h
   33.41 +        ${FMODEX_SDK_DIR}/api/inc
   33.42 +        ${FMODEX_SDK_DIR}/api
   33.43 +        ${FMODEX_SDK_DIR}
   33.44 +      )
   33.45 +    IF (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
   33.46 +      SET(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
   33.47 +      SET(FMODEX_FOUND "YES")
   33.48 +    endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
   33.49 +ENDIF (FMODEX_SDK_DIR OR WINDOWS)
   33.50 +
   33.51 +IF (FMODEX_FOUND)
   33.52 +  IF (NOT FMODEX_FIND_QUIETLY)
   33.53 +    MESSAGE(STATUS "Found FMODEX: ${FMODEX_LIBRARIES}")
   33.54 +  ENDIF (NOT FMODEX_FIND_QUIETLY)
   33.55 +ELSE (FMODEX_FOUND)
   33.56 +  IF (FMODEX_FIND_REQUIRED)
   33.57 +    MESSAGE(FATAL_ERROR "Could not find FMODEX library")
   33.58 +  ENDIF (FMODEX_FIND_REQUIRED)
   33.59 +ENDIF (FMODEX_FOUND)
   33.60 +
   33.61 +# Deprecated declarations.
   33.62 +SET (NATIVE_FMODEX_INCLUDE_PATH ${FMODEX_INCLUDE_DIR} )
   33.63 +GET_FILENAME_COMPONENT (NATIVE_FMODEX_LIB_PATH ${FMODEX_LIBRARY} PATH)
   33.64 +
   33.65 +MARK_AS_ADVANCED(
   33.66 +  FMODEX_LIBRARY
   33.67 +  FMODEX_INCLUDE_DIR
   33.68 +  )
    34.1 --- a/indra/cmake/FindLLQtWebkit.cmake	Thu May 02 19:12:59 2013 -0400
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,62 +0,0 @@
    34.4 -# -*- cmake -*-
    34.5 -
    34.6 -# - Find llqtwebkit
    34.7 -# Find the llqtwebkit includes and library
    34.8 -# This module defines
    34.9 -#  LLQTWEBKIT_INCLUDE_DIR, where to find llqtwebkit.h, etc.
   34.10 -#  LLQTWEBKIT_LIBRARY, the llqtwebkit library with full path.
   34.11 -#  LLQTWEBKIT_FOUND, If false, do not try to use llqtwebkit.
   34.12 -# also defined, but not for general use are
   34.13 -#  LLQTWEBKIT_LIBRARIES, the libraries needed to use llqtwebkit.
   34.14 -#  LLQTWEBKIT_LIBRARY_DIRS, where to find the llqtwebkit library.
   34.15 -#  LLQTWEBKIT_DEFINITIONS - You should add_definitions(${LLQTWEBKIT_DEFINITIONS})
   34.16 -#      before compiling code that includes llqtwebkit library files.
   34.17 -
   34.18 -# Try to use pkg-config first.
   34.19 -# This allows to have two different libllqtwebkit packages installed:
   34.20 -# one for viewer 2.x and one for viewer 1.x.
   34.21 -include(FindPkgConfig)
   34.22 -if (PKG_CONFIG_FOUND)
   34.23 -    if (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
   34.24 -        set(_PACKAGE_ARGS libllqtwebkit>=${LLQtWebkit_FIND_VERSION} REQUIRED)
   34.25 -    else (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
   34.26 -        set(_PACKAGE_ARGS libllqtwebkit)
   34.27 -    endif (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
   34.28 -    if (NOT "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.8.2")
   34.29 -      # As virtually nobody will have a pkg-config file for this, do this check always quiet.
   34.30 -      # Unfortunately cmake 2.8.2 or higher is required for pkg_check_modules to have a 'QUIET'.
   34.31 -      set(_PACKAGE_ARGS ${_PACKAGE_ARGS} QUIET)
   34.32 -    endif ()
   34.33 -    pkg_check_modules(LLQTWEBKIT ${_PACKAGE_ARGS})
   34.34 -endif (PKG_CONFIG_FOUND)
   34.35 -set(LLQTWEBKIT_DEFINITIONS ${LLQTWEBKIT_CFLAGS_OTHER})
   34.36 -
   34.37 -find_path(LLQTWEBKIT_INCLUDE_DIR llqtwebkit.h NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_INCLUDE_DIRS})
   34.38 -
   34.39 -find_library(LLQTWEBKIT_LIBRARY NAMES llqtwebkit NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_LIBRARY_DIRS})
   34.40 -
   34.41 -if (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND)   # If pkg-config couldn't find it, pretend we don't have pkg-config.
   34.42 -   set(LLQTWEBKIT_LIBRARIES llqtwebkit)
   34.43 -   get_filename_component(LLQTWEBKIT_LIBRARY_DIRS ${LLQTWEBKIT_LIBRARY} PATH)
   34.44 -endif (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND)
   34.45 -
   34.46 -# Handle the QUIETLY and REQUIRED arguments and set LLQTWEBKIT_FOUND
   34.47 -# to TRUE if all listed variables are TRUE.
   34.48 -include(FindPackageHandleStandardArgs)
   34.49 -find_package_handle_standard_args(
   34.50 -  LLQTWEBKIT
   34.51 -  DEFAULT_MSG
   34.52 -  LLQTWEBKIT_LIBRARY
   34.53 -  LLQTWEBKIT_INCLUDE_DIR
   34.54 -  LLQTWEBKIT_LIBRARIES
   34.55 -  LLQTWEBKIT_LIBRARY_DIRS
   34.56 -  )
   34.57 -
   34.58 -mark_as_advanced(
   34.59 -  LLQTWEBKIT_LIBRARY
   34.60 -  LLQTWEBKIT_INCLUDE_DIR
   34.61 -  LLQTWEBKIT_LIBRARIES
   34.62 -  LLQTWEBKIT_LIBRARY_DIRS
   34.63 -  LLQTWEBKIT_DEFINITIONS
   34.64 -  )
   34.65 -
    35.1 --- a/indra/cmake/FindMT.cmake	Thu May 02 19:12:59 2013 -0400
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,15 +0,0 @@
    35.4 -#Find the windows manifest tool.
    35.5 -
    35.6 -FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
    35.7 -                 PATHS
    35.8 -                 "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
    35.9 -                 "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
   35.10 -                 "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
   35.11 -IF(HAVE_MANIFEST_TOOL)
   35.12 -    MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.")
   35.13 -ELSE(HAVE_MANIFEST_TOOL)
   35.14 -    MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.")
   35.15 -ENDIF(HAVE_MANIFEST_TOOL)
   35.16 -
   35.17 -STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS 
   35.18 -      ${CMAKE_EXE_LINKER_FLAGS})
    36.1 --- a/indra/cmake/FindMono.cmake	Thu May 02 19:12:59 2013 -0400
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,68 +0,0 @@
    36.4 -# - Try to find the mono, mcs, gmcs and gacutil
    36.5 -#
    36.6 -# defines
    36.7 -#
    36.8 -# MONO_FOUND - system has mono, mcs, gmcs and gacutil
    36.9 -# MONO_PATH - where to find 'mono'
   36.10 -# MCS_PATH - where to find 'mcs'
   36.11 -# GMCS_PATH - where to find 'gmcs'
   36.12 -# GACUTIL_PATH - where to find 'gacutil'
   36.13 -#
   36.14 -# copyright (c) 2007 Arno Rehn arno@arnorehn.de
   36.15 -#
   36.16 -# Redistribution and use is allowed according to the terms of the GPL license.
   36.17 -# Removed the check for gmcs
   36.18 -
   36.19 -FIND_PROGRAM (MONO_EXECUTABLE mono
   36.20 -             "$ENV{PROGRAMFILES}/Mono-1.9.1/bin"
   36.21 -             "$ENV{PROGRAMFILES}/Mono-1.2.6/bin"
   36.22 -             /bin
   36.23 -             /usr/bin
   36.24 -             /usr/local/bin
   36.25 -)
   36.26 -FIND_PROGRAM (MCS_EXECUTABLE mcs
   36.27 -             "$ENV{PROGRAMFILES}/Mono-1.9.1/bin"
   36.28 -             "$ENV{PROGRAMFILES}/Mono-1.2.6/bin"
   36.29 -             /bin
   36.30 -             /usr/bin
   36.31 -             /usr/local/bin
   36.32 -)
   36.33 -FIND_PROGRAM (GMCS_EXECUTABLE gmcs
   36.34 -             "$ENV{PROGRAMFILES}/Mono-1.9.1/bin"
   36.35 -             "$ENV{PROGRAMFILES}/Mono-1.2.6/bin"
   36.36 -             /bin
   36.37 -             /usr/bin
   36.38 -             /usr/local/bin
   36.39 -)
   36.40 -FIND_PROGRAM (GACUTIL_EXECUTABLE gacutil
   36.41 -             "$ENV{PROGRAMFILES}/Mono-1.9.1/bin"
   36.42 -             "$ENV{PROGRAMFILES}/Mono-1.2.6/bin"
   36.43 -             /bin
   36.44 -             /usr/bin
   36.45 -             /usr/local/bin
   36.46 -)
   36.47 -FIND_PROGRAM (ILASM_EXECUTABLE
   36.48 -             NAMES ilasm.bat ilasm
   36.49 -             NO_DEFAULT_PATH
   36.50 -             PATHS "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" "$ENV{PROGRAMFILES}/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin
   36.51 -)
   36.52 -
   36.53 -SET (MONO_FOUND FALSE)
   36.54 -
   36.55 -IF (MONO_EXECUTABLE AND MCS_EXECUTABLE AND GACUTIL_EXECUTABLE)
   36.56 -        SET (MONO_FOUND TRUE)
   36.57 -ENDIF (MONO_EXECUTABLE AND MCS_EXECUTABLE AND GACUTIL_EXECUTABLE)
   36.58 -
   36.59 -IF (MONO_FOUND)
   36.60 -        IF (NOT Mono_FIND_QUIETLY)
   36.61 -                MESSAGE(STATUS "Found mono: ${MONO_EXECUTABLE}")
   36.62 -                MESSAGE(STATUS "Found mcs: ${MCS_EXECUTABLE}")
   36.63 -                MESSAGE(STATUS "Found gacutil: ${GACUTIL_EXECUTABLE}")
   36.64 -        ENDIF (NOT Mono_FIND_QUIETLY)
   36.65 -ELSE (MONO_FOUND)
   36.66 -        IF (Mono_FIND_REQUIRED)
   36.67 -                MESSAGE(FATAL_ERROR "Could not find one or more of the following programs: mono, mcs, gacutil")
   36.68 -        ENDIF (Mono_FIND_REQUIRED)
   36.69 -ENDIF (MONO_FOUND)
   36.70 -
   36.71 -MARK_AS_ADVANCED(MONO_EXECUTABLE MCS_EXECUTABLE GACUTIL_EXECUTABLE)
    37.1 --- a/indra/cmake/FindMySQL.cmake	Thu May 02 19:12:59 2013 -0400
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,48 +0,0 @@
    37.4 -# -*- cmake -*-
    37.5 -
    37.6 -# - Find MySQL
    37.7 -# Find the MySQL includes and library
    37.8 -# This module defines
    37.9 -#  MYSQL_INCLUDE_DIR, where to find mysql.h, etc.
   37.10 -#  MYSQL_LIBRARIES, the libraries needed to use Mysql.
   37.11 -#  MYSQL_FOUND, If false, do not try to use Mysql.
   37.12 -# also defined, but not for general use are
   37.13 -#  MYSQL_LIBRARY, where to find the Mysql library.
   37.14 -
   37.15 -FIND_PATH(MYSQL_INCLUDE_DIR mysql/mysql.h
   37.16 -/usr/local/include
   37.17 -/usr/include
   37.18 -)
   37.19 -
   37.20 -SET(MYSQL_NAMES ${MYSQL_NAMES} mysqlclient)
   37.21 -FIND_LIBRARY(MYSQL_LIBRARY
   37.22 -  NAMES ${MYSQL_NAMES}
   37.23 -  PATHS /usr/lib/mysql /usr/lib /usr/local/lib/mysql /usr/local/lib
   37.24 -  )
   37.25 -
   37.26 -IF (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
   37.27 -    SET(MYSQL_LIBRARIES ${MYSQL_LIBRARY})
   37.28 -    SET(MYSQL_FOUND "YES")
   37.29 -ELSE (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
   37.30 -  SET(MYSQL_FOUND "NO")
   37.31 -ENDIF (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
   37.32 -
   37.33 -
   37.34 -IF (MYSQL_FOUND)
   37.35 -   IF (NOT MYSQL_FIND_QUIETLY)
   37.36 -      MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARIES}")
   37.37 -   ENDIF (NOT MYSQL_FIND_QUIETLY)
   37.38 -ELSE (MYSQL_FOUND)
   37.39 -   IF (MYSQL_FIND_REQUIRED)
   37.40 -      MESSAGE(FATAL_ERROR "Could not find MySQL library")
   37.41 -   ENDIF (MYSQL_FIND_REQUIRED)
   37.42 -ENDIF (MYSQL_FOUND)
   37.43 -
   37.44 -# Deprecated declarations.
   37.45 -SET (NATIVE_MYSQL_INCLUDE_PATH ${MYSQL_INCLUDE_DIR} )
   37.46 -GET_FILENAME_COMPONENT (NATIVE_MYSQL_LIB_PATH ${MYSQL_LIBRARY} PATH)
   37.47 -
   37.48 -MARK_AS_ADVANCED(
   37.49 -  MYSQL_LIBRARY
   37.50 -  MYSQL_INCLUDE_DIR
   37.51 -  )
    38.1 --- a/indra/cmake/FindSVN.cmake	Thu May 02 19:12:59 2013 -0400
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,34 +0,0 @@
    38.4 -# -*- cmake -*-
    38.5 -#
    38.6 -# Find the svn executable for exporting old svn:externals.
    38.7 -#
    38.8 -# Input variables:
    38.9 -#   SVN_FIND_REQUIRED - set this if configuration should fail without scp
   38.10 -#
   38.11 -# Output variables:
   38.12 -#
   38.13 -#   SVN_FOUND - set if svn was found
   38.14 -#   SVN_EXECUTABLE - path to svn executable
   38.15 -#   SVN_BATCH_FLAG - how to put svn into batch mode
   38.16 -
   38.17 -
   38.18 -SET(SVN_EXECUTABLE)
   38.19 -FIND_PROGRAM(SVN_EXECUTABLE NAMES svn svn.exe)
   38.20 -
   38.21 -IF (SVN_EXECUTABLE)
   38.22 -  SET(SVN_FOUND ON)
   38.23 -ELSE (SVN_EXECUTABLE)
   38.24 -  SET(SVN_FOUND OFF)
   38.25 -ENDIF (SVN_EXECUTABLE)
   38.26 -
   38.27 -IF (SVN_FOUND)
   38.28 -  GET_FILENAME_COMPONENT(_svn_name ${SVN_EXECUTABLE} NAME_WE)
   38.29 -  SET(SVN_BATCH_FLAG --non-interactive)
   38.30 -ELSE (SVN_FOUND)
   38.31 -  IF (SVN_FIND_REQUIRED)
   38.32 -    MESSAGE(FATAL_ERROR "Could not find svn executable")
   38.33 -  ENDIF (SVN_FIND_REQUIRED)
   38.34 -ENDIF (SVN_FOUND)
   38.35 -
   38.36 -MARK_AS_ADVANCED(SVN_EXECUTABLE SVN_FOUND SVN_BATCH_FLAG)
   38.37 -
    39.1 --- a/indra/cmake/FreeType.cmake	Thu May 02 19:12:59 2013 -0400
    39.2 +++ b/indra/cmake/FreeType.cmake	Thu May 30 21:28:02 2013 +0000
    39.3 @@ -7,13 +7,7 @@
    39.4    pkg_check_modules(FREETYPE REQUIRED freetype2)
    39.5  else (STANDALONE)
    39.6    use_prebuilt_binary(freetype)
    39.7 -  if (LINUX)
    39.8 -    set(FREETYPE_INCLUDE_DIRS
    39.9 -        ${LIBS_PREBUILT_DIR}/include)
   39.10 -  else (LINUX)
   39.11      set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
   39.12 -  endif (LINUX)
   39.13 -
   39.14    set(FREETYPE_LIBRARIES freetype)
   39.15  endif (STANDALONE)
   39.16  
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/indra/cmake/GLEXT.cmake	Thu May 30 21:28:02 2013 +0000
    40.3 @@ -0,0 +1,8 @@
    40.4 +# -*- cmake -*-
    40.5 +include(Prebuilt)
    40.6 +
    40.7 +if (NOT STANDALONE)
    40.8 +  use_prebuilt_binary(glext)
    40.9 +  use_prebuilt_binary(glh_linear)
   40.10 +  set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
   40.11 +endif (NOT STANDALONE)
    41.1 --- a/indra/cmake/GLOD.cmake	Thu May 02 19:12:59 2013 -0400
    41.2 +++ b/indra/cmake/GLOD.cmake	Thu May 30 21:28:02 2013 +0000
    41.3 @@ -6,4 +6,4 @@
    41.4  endif (NOT STANDALONE)
    41.5  
    41.6  set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
    41.7 -set(GLOD_LIBRARIES glod)
    41.8 +set(GLOD_LIBRARIES GLOD)
    42.1 --- a/indra/cmake/GoogleBreakpad.cmake	Thu May 02 19:12:59 2013 -0400
    42.2 +++ b/indra/cmake/GoogleBreakpad.cmake	Thu May 30 21:28:02 2013 +0000
    42.3 @@ -15,5 +15,8 @@
    42.4    if (WINDOWS)
    42.5      set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common)
    42.6    endif (WINDOWS)
    42.7 +  # yes, this does look dumb, no, it's not incorrect
    42.8 +  #
    42.9 +  set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/include/google_breakpad/google_breakpad")
   42.10  endif (STANDALONE)
   42.11  
    43.1 --- a/indra/cmake/GooglePerfTools.cmake	Thu May 02 19:12:59 2013 -0400
    43.2 +++ b/indra/cmake/GooglePerfTools.cmake	Thu May 30 21:28:02 2013 +0000
    43.3 @@ -10,7 +10,7 @@
    43.4  else (STANDALONE)
    43.5    if (WINDOWS)
    43.6      if (USE_TCMALLOC)
    43.7 -       use_prebuilt_binary(tcmalloc)
    43.8 +       use_prebuilt_binary(gperftools)
    43.9         set(TCMALLOC_LIBRARIES 
   43.10           debug libtcmalloc_minimal-debug
   43.11           optimized libtcmalloc_minimal)
   43.12 @@ -23,7 +23,7 @@
   43.13    endif (WINDOWS)
   43.14    if (LINUX)
   43.15      if (USE_TCMALLOC)
   43.16 -      use_prebuilt_binary(tcmalloc)
   43.17 +      use_prebuilt_binary(gperftools)
   43.18        set(TCMALLOC_LIBRARIES 
   43.19          tcmalloc)
   43.20      else (USE_TCMALLOC)
    44.1 --- a/indra/cmake/Havok.cmake	Thu May 02 19:12:59 2013 -0400
    44.2 +++ b/indra/cmake/Havok.cmake	Thu May 30 21:28:02 2013 +0000
    44.3 @@ -1,6 +1,10 @@
    44.4  # -*- cmake -*-
    44.5  
    44.6 +if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
    44.7 +set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
    44.8 +
    44.9  use_prebuilt_binary(havok-source)
   44.10 +
   44.11  set(Havok_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/havok/Source)
   44.12  list(APPEND Havok_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/havok/Demo)
   44.13  
   44.14 @@ -8,14 +12,14 @@
   44.15  set(HAVOK_RELEASE_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release/havok)
   44.16  
   44.17  if (LL_DEBUG_HAVOK)
   44.18 -   if (WIN32)
   44.19 -      # Always link relwithdebinfo to havok-hybrid on windows.
   44.20 -      set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-hybrid)
   44.21 -   else (WIN32)
   44.22 -      set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-fulldebug)
   44.23 -   endif (WIN32)
   44.24 +  if (WIN32)
   44.25 +    # Always link relwithdebinfo to havok-hybrid on windows.
   44.26 +    set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-hybrid)
   44.27 +  else (WIN32)
   44.28 +    set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-fulldebug)
   44.29 +  endif (WIN32)
   44.30  else (LL_DEBUG_HAVOK)
   44.31 -   set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release/havok)
   44.32 +  set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release/havok)
   44.33  endif (LL_DEBUG_HAVOK)
   44.34  
   44.35  set(HAVOK_LIBS
   44.36 @@ -45,39 +49,89 @@
   44.37  unset(HK_RELEASE_LIBRARIES)
   44.38  unset(HK_RELWITHDEBINFO_LIBRARIES)
   44.39  
   44.40 +# *TODO: Figure out why we need to extract like this...
   44.41  foreach(HAVOK_LIB ${HAVOK_LIBS})
   44.42 -        find_library(HAVOK_DEBUG_LIB_${HAVOK_LIB}   ${HAVOK_LIB} PATHS ${HAVOK_DEBUG_LIBRARY_PATH})
   44.43 -        find_library(HAVOK_RELEASE_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELEASE_LIBRARY_PATH})
   44.44 -        find_library(HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH})
   44.45 -        
   44.46 -        if(LINUX)
   44.47 -            set(cmd "mkdir")
   44.48 -            set(debug_dir "${HAVOK_DEBUG_LIBRARY_PATH}/${HAVOK_LIB}")
   44.49 -            set(release_dir "${HAVOK_RELEASE_LIBRARY_PATH}/${HAVOK_LIB}")
   44.50 -            set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}")
   44.51 +  find_library(HAVOK_DEBUG_LIB_${HAVOK_LIB}   ${HAVOK_LIB} PATHS ${HAVOK_DEBUG_LIBRARY_PATH})
   44.52 +  find_library(HAVOK_RELEASE_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELEASE_LIBRARY_PATH})
   44.53 +  find_library(HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH})
   44.54 +  
   44.55 +  if(LINUX)
   44.56 +    set(debug_dir "${HAVOK_DEBUG_LIBRARY_PATH}/${HAVOK_LIB}")
   44.57 +    set(release_dir "${HAVOK_RELEASE_LIBRARY_PATH}/${HAVOK_LIB}")
   44.58 +    set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}")
   44.59  
   44.60 -            exec_program( ${cmd} ${HAVOK_DEBUG_LIBRARY_PATH} ARGS ${debug_dir} OUTPUT_VARIABLE rv)
   44.61 -            exec_program( ${cmd} ${HAVOK_RELEASE_LIBRARY_PATH} ARGS ${release_dir} OUTPUT_VARIABLE rv)
   44.62 -            exec_program( ${cmd} ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH} ARGS ${relwithdebinfo_dir} OUTPUT_VARIABLE rv)
   44.63 +    # Try to avoid extracting havok library each time we run cmake.
   44.64 +    if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted")
   44.65 +      file(READ ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted "havok_${HAVOK_LIB}_extracted")
   44.66 +      if(DEBUG_PREBUILT)
   44.67 +        message(STATUS "havok_${HAVOK_LIB}_extracted: \"${havok_${HAVOK_LIB}_extracted}\"")
   44.68 +      endif(DEBUG_PREBUILT)
   44.69 +    endif("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted")
   44.70  
   44.71 -            set(cmd "ar")
   44.72 -            set(arg " -xv")
   44.73 -            set(arg "${arg} ../lib${HAVOK_LIB}.a")
   44.74 -            exec_program( ${cmd} ${debug_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
   44.75 -            exec_program( ${cmd} ${release_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
   44.76 -            exec_program( ${cmd} ${relwithdebinfo_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
   44.77 +    if(${CMAKE_BINARY_DIR}/temp/havok-source_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
   44.78 +      if(DEBUG_PREBUILT)
   44.79 +        MESSAGE(STATUS "Extracting ${HAVOK_LIB}...")
   44.80 +      endif(DEBUG_PREBUILT)
   44.81 +      set(cmd "mkdir")
   44.82  
   44.83 -            file(GLOB extracted_debug "${debug_dir}/*.o")
   44.84 -            file(GLOB extracted_release "${release_dir}/*.o")
   44.85 -            file(GLOB extracted_relwithdebinfo "${relwithdebinfo_dir}/*.o")
   44.86 -            list(APPEND HK_DEBUG_LIBRARIES ${extracted_debug})
   44.87 -            list(APPEND HK_RELEASE_LIBRARIES ${extracted_release})
   44.88 -            list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_relwithdebinfo})
   44.89 -        else(LINUX)
   44.90 -        # Win32
   44.91 -            list(APPEND HK_DEBUG_LIBRARIES   ${HAVOK_DEBUG_LIB_${HAVOK_LIB}})
   44.92 -            list(APPEND HK_RELEASE_LIBRARIES ${HAVOK_RELEASE_LIB_${HAVOK_LIB}})
   44.93 -            list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB}})
   44.94 -        endif (LINUX)
   44.95 +      if(DEBUG_PREBUILT)
   44.96 +        MESSAGE(STATUS "${cmd} ${debug_dir}")
   44.97 +      endif(DEBUG_PREBUILT)
   44.98 +      exec_program( ${cmd} ${HAVOK_DEBUG_LIBRARY_PATH} ARGS ${debug_dir} OUTPUT_VARIABLE rv)
   44.99 +
  44.100 +      if(DEBUG_PREBUILT)
  44.101 +        MESSAGE(STATUS "${cmd} ${release_dir}")
  44.102 +      endif(DEBUG_PREBUILT)
  44.103 +      exec_program( ${cmd} ${HAVOK_RELEASE_LIBRARY_PATH} ARGS ${release_dir} OUTPUT_VARIABLE rv)
  44.104 +
  44.105 +      if(DEBUG_PREBUILT)
  44.106 +        MESSAGE(STATUS "${cmd} ${relwithdebinfo_dir}")
  44.107 +      endif(DEBUG_PREBUILT)
  44.108 +      exec_program( ${cmd} ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH} ARGS ${relwithdebinfo_dir} OUTPUT_VARIABLE rv)
  44.109 +
  44.110 +      set(cmd "ar")
  44.111 +      set(arg " -xv")
  44.112 +      set(arg "${arg} ../lib${HAVOK_LIB}.a")
  44.113 +      if(DEBUG_PREBUILT)
  44.114 +        MESSAGE(STATUS "cd ${debug_dir} && ${cmd} ${arg}")
  44.115 +      endif(DEBUG_PREBUILT)
  44.116 +      exec_program( ${cmd} ${debug_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
  44.117 +
  44.118 +      if(DEBUG_PREBUILT)
  44.119 +        MESSAGE(STATUS "cd ${release_dir} && ${cmd} ${arg}")
  44.120 +      endif(DEBUG_PREBUILT)
  44.121 +      exec_program( ${cmd} ${release_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
  44.122 +
  44.123 +      if(DEBUG_PREBUILT)
  44.124 +        MESSAGE(STATUS "cd ${relwithdebinfo_dir} && ${cmd} ${arg}")
  44.125 +      endif(DEBUG_PREBUILT)
  44.126 +      exec_program( ${cmd} ${relwithdebinfo_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
  44.127 +
  44.128 +      # Just assume success for now.
  44.129 +      set(havok_${HAVOK_LIB}_extracted 0)
  44.130 +      file(WRITE ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted "${havok_${HAVOK_LIB}_extracted}")
  44.131 +
  44.132 +    endif(${CMAKE_BINARY_DIR}/temp/havok-source_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
  44.133 +
  44.134 +    file(GLOB extracted_debug "${debug_dir}/*.o")
  44.135 +    file(GLOB extracted_release "${release_dir}/*.o")
  44.136 +    file(GLOB extracted_relwithdebinfo "${relwithdebinfo_dir}/*.o")
  44.137 +
  44.138 +    if(DEBUG_PREBUILT)
  44.139 +      MESSAGE(STATUS "extracted_debug ${debug_dir}/*.o")
  44.140 +      MESSAGE(STATUS "extracted_release ${release_dir}/*.o")
  44.141 +      MESSAGE(STATUS "extracted_relwithdebinfo ${relwithdebinfo_dir}/*.o")
  44.142 +    endif(DEBUG_PREBUILT)
  44.143 +
  44.144 +    list(APPEND HK_DEBUG_LIBRARIES ${extracted_debug})
  44.145 +    list(APPEND HK_RELEASE_LIBRARIES ${extracted_release})
  44.146 +    list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_relwithdebinfo})
  44.147 +  else(LINUX)
  44.148 +  # Win32
  44.149 +    list(APPEND HK_DEBUG_LIBRARIES   ${HAVOK_DEBUG_LIB_${HAVOK_LIB}})
  44.150 +    list(APPEND HK_RELEASE_LIBRARIES ${HAVOK_RELEASE_LIB_${HAVOK_LIB}})
  44.151 +    list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB}})
  44.152 +  endif (LINUX)
  44.153  endforeach(HAVOK_LIB)
  44.154  
  44.155 +endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/indra/cmake/LLAppearance.cmake	Thu May 30 21:28:02 2013 +0000
    45.3 @@ -0,0 +1,17 @@
    45.4 +# -*- cmake -*-
    45.5 +
    45.6 +include(Variables)
    45.7 +
    45.8 +set(LLAPPEARANCE_INCLUDE_DIRS
    45.9 +    ${LIBS_OPEN_DIR}/llappearance
   45.10 +    )
   45.11 +
   45.12 +if (BUILD_HEADLESS)
   45.13 +  set(LLAPPEARANCE_HEADLESS_LIBRARIES
   45.14 +    llappearanceheadless
   45.15 +    )
   45.16 +endif (BUILD_HEADLESS)
   45.17 +
   45.18 +set(LLAPPEARANCE_LIBRARIES llappearance)
   45.19 +
   45.20 +
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/indra/cmake/LLAppearanceUtility.cmake	Thu May 30 21:28:02 2013 +0000
    46.3 @@ -0,0 +1,12 @@
    46.4 +# -*- cmake -*-
    46.5 +include(Prebuilt)
    46.6 +
    46.7 +# Linux proprietary build only
    46.8 +if (INSTALL_PROPRIETARY)
    46.9 +    if(LINUX)
   46.10 +        use_prebuilt_binary(llappearanceutility-source)
   46.11 +        set(LLAPPEARANCEUTILITY_SRC_DIR ${LIBS_PREBUILT_DIR}/llappearanceutility/src)
   46.12 +        set(LLAPPEARANCEUTILITY_BIN_DIR ${CMAKE_BINARY_DIR}/llappearanceutility)
   46.13 +    endif (LINUX)
   46.14 +endif (INSTALL_PROPRIETARY)
   46.15 +
    47.1 --- a/indra/cmake/LLCommon.cmake	Thu May 02 19:12:59 2013 -0400
    47.2 +++ b/indra/cmake/LLCommon.cmake	Thu May 30 21:28:02 2013 +0000
    47.3 @@ -10,6 +10,8 @@
    47.4      ${LIBS_OPEN_DIR}/llcommon
    47.5      ${APRUTIL_INCLUDE_DIR}
    47.6      ${APR_INCLUDE_DIR}
    47.7 +    )
    47.8 +set(LLCOMMON_SYSTEM_INCLUDE_DIRS
    47.9      ${Boost_INCLUDE_DIRS}
   47.10      )
   47.11  
    48.1 --- a/indra/cmake/LLDatabase.cmake	Thu May 02 19:12:59 2013 -0400
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,10 +0,0 @@
    48.4 -# -*- cmake -*-
    48.5 -
    48.6 -include(MySQL)
    48.7 -
    48.8 -set(LLDATABASE_INCLUDE_DIRS
    48.9 -    ${LIBS_SERVER_DIR}/lldatabase
   48.10 -    ${MYSQL_INCLUDE_DIR}
   48.11 -    )
   48.12 -
   48.13 -set(LLDATABASE_LIBRARIES lldatabase)
    49.1 --- a/indra/cmake/LLRender.cmake	Thu May 02 19:12:59 2013 -0400
    49.2 +++ b/indra/cmake/LLRender.cmake	Thu May 30 21:28:02 2013 +0000
    49.3 @@ -1,5 +1,6 @@
    49.4  # -*- cmake -*-
    49.5  
    49.6 +include(Variables)
    49.7  include(FreeType)
    49.8  include(GLH)
    49.9  
   49.10 @@ -8,27 +9,12 @@
   49.11      ${GLH_INCLUDE_DIR}
   49.12      )
   49.13  
   49.14 -if (SERVER AND LINUX)
   49.15 -  set(LLRENDER_LIBRARIES
   49.16 -      llrenderheadless
   49.17 -      )
   49.18 -else (SERVER AND LINUX)
   49.19 +if (BUILD_HEADLESS)
   49.20 +  set(LLRENDER_HEADLESS_LIBRARIES
   49.21 +    llrenderheadless
   49.22 +    )
   49.23 +endif (BUILD_HEADLESS)
   49.24  set(LLRENDER_LIBRARIES
   49.25      llrender
   49.26      )
   49.27 -endif (SERVER AND LINUX)
   49.28  
   49.29 -# mapserver requires certain files to be copied so LL_MESA_HEADLESS can be set
   49.30 -# differently for different object files.
   49.31 -macro (copy_server_sources )
   49.32 -  foreach (PREFIX ${ARGV})
   49.33 -    add_custom_command(
   49.34 -        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}_server.cpp
   49.35 -        COMMAND ${CMAKE_COMMAND}
   49.36 -        ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}.cpp
   49.37 -             ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}_server.cpp
   49.38 -        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}.cpp
   49.39 -        )
   49.40 -    list(APPEND server_SOURCE_FILES ${PREFIX}_server.cpp)
   49.41 -  endforeach (PREFIX ${_copied_SOURCES})
   49.42 -endmacro (copy_server_sources _copied_SOURCES)
    50.1 --- a/indra/cmake/LLScene.cmake	Thu May 02 19:12:59 2013 -0400
    50.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.3 @@ -1,7 +0,0 @@
    50.4 -# -*- cmake -*-
    50.5 -
    50.6 -set(LLSCENE_INCLUDE_DIRS
    50.7 -    ${LIBS_SERVER_DIR}/llscene
    50.8 -    )
    50.9 -
   50.10 -set(LLSCENE_LIBRARIES llscene)
    51.1 --- a/indra/cmake/LLWindow.cmake	Thu May 02 19:12:59 2013 -0400
    51.2 +++ b/indra/cmake/LLWindow.cmake	Thu May 30 21:28:02 2013 +0000
    51.3 @@ -1,6 +1,7 @@
    51.4  # -*- cmake -*-
    51.5  
    51.6 -include(OpenGL)
    51.7 +include(Variables)
    51.8 +include(GLEXT)
    51.9  include(Prebuilt)
   51.10  
   51.11  if (STANDALONE)
   51.12 @@ -13,17 +14,15 @@
   51.13        SDL_LIBRARY
   51.14        )
   51.15  else (STANDALONE)
   51.16 -  use_prebuilt_binary(mesa)
   51.17 -  if (LINUX AND VIEWER)
   51.18 +  if (LINUX)
   51.19      use_prebuilt_binary(SDL)
   51.20      set (SDL_FOUND TRUE)
   51.21      set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux)
   51.22      set (SDL_LIBRARY SDL directfb fusion direct)
   51.23 -  endif (LINUX AND VIEWER)
   51.24 +  endif (LINUX)
   51.25  endif (STANDALONE)
   51.26  
   51.27  if (SDL_FOUND)
   51.28 -  add_definitions(-DLL_SDL=1)
   51.29    include_directories(${SDL_INCLUDE_DIR})
   51.30  endif (SDL_FOUND)
   51.31  
   51.32 @@ -32,12 +31,12 @@
   51.33      ${LIBS_OPEN_DIR}/llwindow
   51.34      )
   51.35  
   51.36 -if (SERVER AND LINUX)
   51.37 -  set(LLWINDOW_LIBRARIES
   51.38 -      llwindowheadless
   51.39 -      )
   51.40 -else (SERVER AND LINUX)
   51.41 -  set(LLWINDOW_LIBRARIES
   51.42 -      llwindow
   51.43 -      )
   51.44 -endif (SERVER AND LINUX)
   51.45 +if (BUILD_HEADLESS)
   51.46 +  set(LLWINDOW_HEADLESS_LIBRARIES
   51.47 +    llwindowheadless
   51.48 +    )
   51.49 +endif (BUILD_HEADLESS)
   51.50 +
   51.51 +set(LLWINDOW_LIBRARIES
   51.52 +    llwindow
   51.53 +    )
    52.1 --- a/indra/cmake/LLXML.cmake	Thu May 02 19:12:59 2013 -0400
    52.2 +++ b/indra/cmake/LLXML.cmake	Thu May 30 21:28:02 2013 +0000
    52.3 @@ -5,8 +5,10 @@
    52.4  
    52.5  set(LLXML_INCLUDE_DIRS
    52.6      ${LIBS_OPEN_DIR}/llxml
    52.7 +    ${EXPAT_INCLUDE_DIRS}
    52.8 +    )
    52.9 +set(LLXML_SYSTEM_INCLUDE_DIRS
   52.10      ${Boost_INCLUDE_DIRS}
   52.11 -    ${EXPAT_INCLUDE_DIRS}
   52.12      )
   52.13  
   52.14  set(LLXML_LIBRARIES llxml)
    53.1 --- a/indra/cmake/LLXUIXML.cmake	Thu May 02 19:12:59 2013 -0400
    53.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.3 @@ -1,7 +0,0 @@
    53.4 -# -*- cmake -*-
    53.5 -
    53.6 -set(LLXUIXML_INCLUDE_DIRS
    53.7 -    ${LIBS_OPEN_DIR}/llxuixml
    53.8 -    )
    53.9 -
   53.10 -set(LLXUIXML_LIBRARIES llxuixml)
    54.1 --- a/indra/cmake/Linking.cmake	Thu May 02 19:12:59 2013 -0400
    54.2 +++ b/indra/cmake/Linking.cmake	Thu May 30 21:28:02 2013 +0000
    54.3 @@ -1,5 +1,8 @@
    54.4  # -*- cmake -*-
    54.5  
    54.6 +if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
    54.7 +set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
    54.8 +
    54.9  include(Variables)
   54.10  
   54.11  set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib)
   54.12 @@ -69,3 +72,5 @@
   54.13  endif (WINDOWS)
   54.14      
   54.15  mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES)
   54.16 +
   54.17 +endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
    55.1 --- a/indra/cmake/MonoDeps.cmake	Thu May 02 19:12:59 2013 -0400
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,48 +0,0 @@
    55.4 -# -*- cmake -*-
    55.5 -
    55.6 -set(MONO_PREBUILT_LIBRARIES_DIR ${LIBS_PREBUILT_DIR}/mono/1.0)
    55.7 -
    55.8 -set(MONO_PREBUILT_LIBRARIES
    55.9 -     Iesi.Collections.dll
   55.10 -     Iesi.Collections.pdb
   55.11 -     Mono.CompilerServices.SymbolWriter.dll
   55.12 -     Mono.PEToolkit.dll
   55.13 -     Mono.PEToolkit.pdb
   55.14 -     Mono.Security.dll
   55.15 -     PEAPI.dll
   55.16 -     RAIL.dll
   55.17 -     RAIL.pdb
   55.18 -  )
   55.19 -  
   55.20 -  set(MONO_CORE_LIBRARIES
   55.21 -    System.dll
   55.22 -    System.Xml.dll
   55.23 -    mscorlib.dll)
   55.24 -    
   55.25 -if(WINDOWS)
   55.26 -    set(MONO_DEPENDENCIES
   55.27 -        DomainCreator
   55.28 -        DomainRegister
   55.29 -        LslLibrary
   55.30 -        LslUserScript
   55.31 -        Script
   55.32 -        ScriptTypes
   55.33 -        TestFormat
   55.34 -        UserScript
   55.35 -        UThread
   55.36 -        UThreadInjector
   55.37 -        )
   55.38 -else(WINDOWS)
   55.39 -    set(MONO_DEPENDENCIES
   55.40 -        DomainCreator_POST_BUILD
   55.41 -        DomainRegister_POST_BUILD
   55.42 -        LslLibrary_POST_BUILD
   55.43 -        LslUserScript_POST_BUILD
   55.44 -        Script_POST_BUILD
   55.45 -        ScriptTypes_POST_BUILD
   55.46 -        TestFormat_POST_BUILD
   55.47 -        UserScript_POST_BUILD
   55.48 -        UThread_POST_BUILD
   55.49 -        UThreadInjector_POST_BUILD
   55.50 -        )
   55.51 -endif(WINDOWS)
    56.1 --- a/indra/cmake/MonoEmbed.cmake	Thu May 02 19:12:59 2013 -0400
    56.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.3 @@ -1,57 +0,0 @@
    56.4 -# -*- cmake -*-
    56.5 -
    56.6 -include(Prebuilt)
    56.7 -use_prebuilt_binary(libmono)
    56.8 -
    56.9 -SET(GLIB_2_0 glib-2.0)
   56.10 -
   56.11 -if (WINDOWS)
   56.12 -    SET(MONO_LIB mono) 
   56.13 -else (WINDOWS)
   56.14 -    SET(MONO_LIB mono)
   56.15 -    SET(M_LIBRARIES m)
   56.16 -    SET(GTHREAD_2_0 gthread-2.0)
   56.17 -endif(WINDOWS)
   56.18 -
   56.19 -
   56.20 -IF (DARWIN)
   56.21 -
   56.22 -  FIND_LIBRARY(MONO_LIBRARY NAMES Mono)
   56.23 -  # Find_file doesnt work as expected. Hardcode relative to Mono.framework. 
   56.24 -  #FIND_FILE(GLIB_CONFIG glibconfig.h ${MONO_LIBRARY})
   56.25 -  #FIND_FILE(MONO_GLIB_LIBRARY glib.h ${MONO_LIBRARY})
   56.26 -  SET(MONO_GLIB_LIBRARY ${MONO_LIBRARY}/Headers/glib-2.0/)
   56.27 -  SET(GLIB_CONFIG ${MONO_LIBRARY}/Libraries/glib-2.0/include/)
   56.28 -  SET(MONO_LIB_DIRECTORY ${MONO_LIBRARY}/Libraries)
   56.29 -
   56.30 -  IF (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG)
   56.31 -    MESSAGE(STATUS "Found Mono for embedding")
   56.32 -    INCLUDE_DIRECTORIES(${MONO_GLIB_LIBRARY} ${GLIB_CONFIG})
   56.33 -    LINK_DIRECTORIES(${MONO_LIB_DIRECTORY})
   56.34 -  ELSE (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG)
   56.35 -    MESSAGE(FATAL_ERROR "Mono not found for embedding")   
   56.36 -    MESSAGE(${MONO_LIBRARY})
   56.37 -    MESSAGE(${MONO_GLIB_LIBRARY})
   56.38 -    MESSAGE(${GLIB_CONFIG})
   56.39 -  ENDIF (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG)
   56.40 -
   56.41 -ELSE (DARWIN)
   56.42 -
   56.43 -  SET(MONO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)  
   56.44 -  SET(GLIB_2_0_PLATFORM_INCLUDE_DIR
   56.45 -    ${LIBS_PREBUILT_DIR}/include/glib-2.0)
   56.46 -  SET(GLIB_2_0_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/glib-2.0)
   56.47 -
   56.48 -  INCLUDE_DIRECTORIES(
   56.49 -    ${MONO_INCLUDE_DIR} 
   56.50 -    ${GLIB_2_0_PLATFORM_INCLUDE_DIR} 
   56.51 -    ${GLIB_2_0_INCLUDE_DIR})
   56.52 -    
   56.53 -ENDIF (DARWIN) 
   56.54 -
   56.55 -SET(MONO_LIBRARIES 
   56.56 -    ${MONO_LIB} 
   56.57 -    ${M_LIBRARIES} 
   56.58 -    ${GLIB_2_0}
   56.59 -    ${GTHREAD_2_0} 
   56.60 -)
    57.1 --- a/indra/cmake/MySQL.cmake	Thu May 02 19:12:59 2013 -0400
    57.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.3 @@ -1,26 +0,0 @@
    57.4 -# -*- cmake -*-
    57.5 -include(Linking)
    57.6 -include(Prebuilt)
    57.7 -
    57.8 -use_prebuilt_binary(mysql)
    57.9 -
   57.10 -if (LINUX)
   57.11 -  if (WORD_SIZE EQUAL 32 OR DEBIAN_VERSION STREQUAL "3.1")
   57.12 -    set(MYSQL_LIBRARIES mysqlclient)
   57.13 -    set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
   57.14 -  else (WORD_SIZE EQUAL 32 OR DEBIAN_VERSION STREQUAL "3.1")
   57.15 -    # Use the native MySQL library on a 64-bit system.
   57.16 -    set(MYSQL_FIND_QUIETLY ON)
   57.17 -    set(MYSQL_FIND_REQUIRED ON)
   57.18 -    include(FindMySQL)
   57.19 -  endif (WORD_SIZE EQUAL 32 OR DEBIAN_VERSION STREQUAL "3.1")
   57.20 -elseif (WINDOWS)
   57.21 -  set(MYSQL_LIBRARIES mysqlclient)
   57.22 -  set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
   57.23 -elseif (DARWIN)
   57.24 -  set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
   57.25 -  set(MYSQL_LIBRARIES
   57.26 -    optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libmysqlclient.a
   57.27 -    debug ${ARCH_PREBUILT_DIRS_DEBUG}/libmysqlclient.a
   57.28 -    )
   57.29 -endif (LINUX)
    58.1 --- a/indra/cmake/OpenGL.cmake	Thu May 02 19:12:59 2013 -0400
    58.2 +++ b/indra/cmake/OpenGL.cmake	Thu May 30 21:28:02 2013 +0000
    58.3 @@ -1,8 +1,12 @@
    58.4  # -*- cmake -*-
    58.5 +
    58.6 +include(Variables)
    58.7  include(Prebuilt)
    58.8  
    58.9 -if (NOT STANDALONE)
   58.10 -  use_prebuilt_binary(glext)
   58.11 -  use_prebuilt_binary(glh_linear)
   58.12 -  set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
   58.13 -endif (NOT STANDALONE)
   58.14 +if (BUILD_HEADLESS)
   58.15 +  SET(OPENGL_glu_LIBRARY GLU)
   58.16 +  SET(OPENGL_HEADLESS_LIBRARIES OSMesa16 dl GLU)
   58.17 +endif (BUILD_HEADLESS)
   58.18 +
   58.19 +include(FindOpenGL)
   58.20 +
    59.1 --- a/indra/cmake/Prebuilt.cmake	Thu May 02 19:12:59 2013 -0400
    59.2 +++ b/indra/cmake/Prebuilt.cmake	Thu May 30 21:28:02 2013 +0000
    59.3 @@ -1,5 +1,8 @@
    59.4  # -*- cmake -*-
    59.5  
    59.6 +if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
    59.7 +set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
    59.8 +
    59.9  include(FindAutobuild)
   59.10  if(INSTALL_PROPRIETARY)
   59.11    include(FindSCP)
   59.12 @@ -51,3 +54,5 @@
   59.13      endif (NOT ${_binary}_installed EQUAL 0)
   59.14    endif (NOT STANDALONE_${_binary})
   59.15  endmacro (use_prebuilt_binary _binary)
   59.16 +
   59.17 +endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
    60.1 --- a/indra/cmake/Python.cmake	Thu May 02 19:12:59 2013 -0400
    60.2 +++ b/indra/cmake/Python.cmake	Thu May 30 21:28:02 2013 +0000
    60.3 @@ -23,7 +23,7 @@
    60.4  elseif (EXISTS /etc/debian_version)
    60.5    # On Debian and Ubuntu, avoid Python 2.4 if possible.
    60.6  
    60.7 -  find_program(PYTHON_EXECUTABLE python2.5 python2.3 python PATHS /usr/bin)
    60.8 +  find_program(PYTHON_EXECUTABLE python PATHS /usr/bin)
    60.9  
   60.10    if (PYTHON_EXECUTABLE)
   60.11      set(PYTHONINTERP_FOUND ON)
    61.1 --- a/indra/cmake/UI.cmake	Thu May 02 19:12:59 2013 -0400
    61.2 +++ b/indra/cmake/UI.cmake	Thu May 30 21:28:02 2013 +0000
    61.3 @@ -1,5 +1,6 @@
    61.4  # -*- cmake -*-
    61.5  include(Prebuilt)
    61.6 +include(FreeType)
    61.7  
    61.8  if (STANDALONE)
    61.9    include(FindPkgConfig)
   61.10 @@ -47,6 +48,7 @@
   61.11          pangoft2-1.0
   61.12          pangox-1.0
   61.13          pangoxft-1.0
   61.14 +        ${FREETYPE_LIBRARIES}
   61.15          )
   61.16    endif (LINUX)
   61.17  
    62.1 --- a/indra/cmake/Variables.cmake	Thu May 02 19:12:59 2013 -0400
    62.2 +++ b/indra/cmake/Variables.cmake	Thu May 30 21:28:02 2013 +0000
    62.3 @@ -8,24 +8,20 @@
    62.4  #   DARWIN  - Mac OS X
    62.5  #   LINUX   - Linux
    62.6  #   WINDOWS - Windows
    62.7 -#
    62.8 -# What to build:
    62.9 -#
   62.10 -#   VIEWER - viewer and other viewer-side components
   62.11 -#   SERVER - simulator and other server-side bits
   62.12  
   62.13  
   62.14  # Relative and absolute paths to subtrees.
   62.15  
   62.16 +if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
   62.17 +set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
   62.18 +
   62.19  if(NOT DEFINED COMMON_CMAKE_DIR)
   62.20      set(COMMON_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake")
   62.21  endif(NOT DEFINED COMMON_CMAKE_DIR)
   62.22  
   62.23  set(LIBS_CLOSED_PREFIX)
   62.24  set(LIBS_OPEN_PREFIX)
   62.25 -set(LIBS_SERVER_PREFIX)
   62.26  set(SCRIPTS_PREFIX ../scripts)
   62.27 -set(SERVER_PREFIX)
   62.28  set(VIEWER_PREFIX)
   62.29  set(INTEGRATION_TESTS_PREFIX)
   62.30  set(LL_TESTS ON CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation")
   62.31 @@ -43,9 +39,7 @@
   62.32  endif(LIBS_COMMON_DIR)
   62.33  set(LIBS_OPEN_DIR ${LIBS_COMMON_DIR})
   62.34  
   62.35 -set(LIBS_SERVER_DIR ${CMAKE_SOURCE_DIR}/${LIBS_SERVER_PREFIX})
   62.36  set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
   62.37 -set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX})
   62.38  set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
   62.39  
   62.40  set(AUTOBUILD_INSTALL_DIR ${CMAKE_BINARY_DIR}/packages)
   62.41 @@ -79,21 +73,57 @@
   62.42    # If someone has specified a word size, use that to determine the
   62.43    # architecture.  Otherwise, let the architecture specify the word size.
   62.44    if (WORD_SIZE EQUAL 32)
   62.45 +    #message(STATUS "WORD_SIZE is 32")
   62.46      set(ARCH i686)
   62.47    elseif (WORD_SIZE EQUAL 64)
   62.48 +    #message(STATUS "WORD_SIZE is 64")
   62.49      set(ARCH x86_64)
   62.50    else (WORD_SIZE EQUAL 32)
   62.51 +    #message(STATUS "WORD_SIZE is UNDEFINED")
   62.52      execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/
   62.53                      OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
   62.54      if (ARCH STREQUAL x86_64)
   62.55 +      #message(STATUS "ARCH is detected as 64; ARCH is ${ARCH}")
   62.56        set(WORD_SIZE 64)
   62.57      else (ARCH STREQUAL x86_64)
   62.58 +      #message(STATUS "ARCH is detected as 32; ARCH is ${ARCH}")
   62.59        set(WORD_SIZE 32)
   62.60      endif (ARCH STREQUAL x86_64)
   62.61    endif (WORD_SIZE EQUAL 32)
   62.62  
   62.63 +  if (WORD_SIZE EQUAL 32)
   62.64 +    set(DEB_ARCHITECTURE i386)
   62.65 +    set(FIND_LIBRARY_USE_LIB64_PATHS OFF)
   62.66 +    set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib32 ${CMAKE_SYSTEM_LIBRARY_PATH})
   62.67 +  else (WORD_SIZE EQUAL 32)
   62.68 +    set(DEB_ARCHITECTURE amd64)
   62.69 +    set(FIND_LIBRARY_USE_LIB64_PATHS ON)
   62.70 +  endif (WORD_SIZE EQUAL 32)
   62.71 +
   62.72 +  execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH 
   62.73 +      RESULT_VARIABLE DPKG_RESULT
   62.74 +      OUTPUT_VARIABLE DPKG_ARCH
   62.75 +      OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
   62.76 +  #message (STATUS "DPKG_RESULT ${DPKG_RESULT}, DPKG_ARCH ${DPKG_ARCH}")
   62.77 +  if (DPKG_RESULT EQUAL 0)
   62.78 +    set(CMAKE_LIBRARY_ARCHITECTURE ${DPKG_ARCH})
   62.79 +    set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/${DPKG_ARCH} /usr/local/lib/${DPKG_ARCH} ${CMAKE_SYSTEM_LIBRARY_PATH})
   62.80 +  endif (DPKG_RESULT EQUAL 0)
   62.81 +
   62.82 +  include(ConfigurePkgConfig)
   62.83 +
   62.84    set(LL_ARCH ${ARCH}_linux)
   62.85    set(LL_ARCH_DIR ${ARCH}-linux)
   62.86 +
   62.87 +  if (INSTALL_PROPRIETARY)
   62.88 +    # Only turn on headless if we can find osmesa libraries.
   62.89 +    include(FindPkgConfig)
   62.90 +    #pkg_check_modules(OSMESA osmesa)
   62.91 +    #if (OSMESA_FOUND)
   62.92 +    #  set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.")
   62.93 +    #endif (OSMESA_FOUND)
   62.94 +  endif (INSTALL_PROPRIETARY)
   62.95 +
   62.96  endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
   62.97  
   62.98  if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
   62.99 @@ -140,9 +170,7 @@
  62.100  # Default deploy grid
  62.101  set(GRID agni CACHE STRING "Target Grid")
  62.102  
  62.103 -set(VIEWER ON CACHE BOOL "Build Second Life viewer.")
  62.104 -set(VIEWER_CHANNEL "LindenDeveloper" CACHE STRING "Viewer Channel Name")
  62.105 -set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing")
  62.106 +set(VIEWER_CHANNEL "Second Life Test" CACHE STRING "Viewer Channel Name")
  62.107  
  62.108  if (XCODE_VERSION GREATER 4.2)
  62.109    set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer")
  62.110 @@ -153,21 +181,8 @@
  62.111  set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
  62.112  set(UNATTENDED OFF CACHE BOOL "Should be set to ON for building with VC Express editions.")
  62.113  
  62.114 -if (NOT STANDALONE AND EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
  62.115 -    set(SERVER ON CACHE BOOL "Build Second Life server software.")
  62.116 -endif (NOT STANDALONE AND EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
  62.117 -
  62.118 -if (LINUX AND SERVER AND VIEWER)
  62.119 -  MESSAGE(FATAL_ERROR "
  62.120 -The indra source does not currently support building SERVER and VIEWER at the same time.
  62.121 -Please set one of these values to OFF in your CMake cache file.
  62.122 -(either by running ccmake or by editing CMakeCache.txt by hand)
  62.123 -For more information, please see JIRA DEV-14943 - Cmake Linux cannot build both VIEWER and SERVER in one build environment
  62.124 -  ")
  62.125 -endif (LINUX AND SERVER AND VIEWER)
  62.126 -
  62.127 -
  62.128  set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.")
  62.129  
  62.130  source_group("CMake Rules" FILES CMakeLists.txt)
  62.131  
  62.132 +endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
    63.1 --- a/indra/cmake/VisualLeakDetector.cmake	Thu May 02 19:12:59 2013 -0400
    63.2 +++ b/indra/cmake/VisualLeakDetector.cmake	Thu May 30 21:28:02 2013 +0000
    63.3 @@ -1,15 +1,12 @@
    63.4  # -*- cmake -*-
    63.5  
    63.6 -if (VIEWER)
    63.7 +set(INCLUDE_VLD_CMAKE OFF CACHE BOOL "Build the Windows viewer with Visual Leak Detector turned on or off")
    63.8  
    63.9 -  set(INCLUDE_VLD_CMAKE OFF CACHE BOOL "Build the Windows viewer with Visual Leak Detector turned on or off")
   63.10 +if (INCLUDE_VLD_CMAKE)
   63.11  
   63.12 -  if (INCLUDE_VLD_CMAKE)
   63.13 +  if (WINDOWS)
   63.14 +    add_definitions(-DINCLUDE_VLD=1)
   63.15 +  endif (WINDOWS)
   63.16  
   63.17 -    if (WINDOWS)
   63.18 -      add_definitions(-DINCLUDE_VLD=1)
   63.19 -    endif (WINDOWS)
   63.20 +endif (INCLUDE_VLD_CMAKE)
   63.21  
   63.22 -  endif (INCLUDE_VLD_CMAKE)
   63.23 -
   63.24 -endif (VIEWER)
    64.1 --- a/indra/edit-me-to-trigger-new-build.txt	Thu May 02 19:12:59 2013 -0400
    64.2 +++ b/indra/edit-me-to-trigger-new-build.txt	Thu May 30 21:28:02 2013 +0000
    64.3 @@ -1,1 +1,5 @@
    64.4  Wed Nov  7 00:25:19 UTC 2012
    64.5 +
    64.6 +
    64.7 +
    64.8 +
    65.1 --- a/indra/integration_tests/llimage_libtest/CMakeLists.txt	Thu May 02 19:12:59 2013 -0400
    65.2 +++ b/indra/integration_tests/llimage_libtest/CMakeLists.txt	Thu May 30 21:28:02 2013 +0000
    65.3 @@ -16,6 +16,9 @@
    65.4      ${LLVFS_INCLUDE_DIRS}
    65.5      ${LLIMAGE_INCLUDE_DIRS}
    65.6      )
    65.7 +include_directories(SYSTEM
    65.8 +    ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
    65.9 +    )
   65.10  
   65.11  set(llimage_libtest_SOURCE_FILES
   65.12      llimage_libtest.cpp
    66.1 --- a/indra/integration_tests/llui_libtest/CMakeLists.txt	Thu May 02 19:12:59 2013 -0400
    66.2 +++ b/indra/integration_tests/llui_libtest/CMakeLists.txt	Thu May 30 21:28:02 2013 +0000
    66.3 @@ -34,6 +34,10 @@
    66.4      ${LLXML_INCLUDE_DIRS}
    66.5      ${LIBS_PREBUILD_DIR}/include/hunspell
    66.6      )
    66.7 +include_directories(SYSTEM
    66.8 +    ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
    66.9 +    ${LLXML_SYSTEM_INCLUDE_DIRS}
   66.10 +    )
   66.11  
   66.12  set(llui_libtest_SOURCE_FILES
   66.13      llui_libtest.cpp
    67.1 --- a/indra/lib/python/indra/util/llmanifest.py	Thu May 02 19:12:59 2013 -0400
    67.2 +++ b/indra/lib/python/indra/util/llmanifest.py	Thu May 30 21:28:02 2013 +0000
    67.3 @@ -84,30 +84,8 @@
    67.4              'darwin':'darwin'
    67.5              }[sys.platform]
    67.6  
    67.7 -def get_default_version(srctree):
    67.8 -    # look up llversion.h and parse out the version info
    67.9 -    paths = [os.path.join(srctree, x, 'llversionviewer.h') for x in ['llcommon', '../llcommon', '../../indra/llcommon.h']]
   67.10 -    for p in paths:
   67.11 -        if os.path.exists(p):
   67.12 -            contents = open(p, 'r').read()
   67.13 -            major = re.search("LL_VERSION_MAJOR\s=\s([0-9]+)", contents).group(1)
   67.14 -            minor = re.search("LL_VERSION_MINOR\s=\s([0-9]+)", contents).group(1)
   67.15 -            patch = re.search("LL_VERSION_PATCH\s=\s([0-9]+)", contents).group(1)
   67.16 -            build = re.search("LL_VERSION_BUILD\s=\s([0-9]+)", contents).group(1)
   67.17 -            return major, minor, patch, build
   67.18 -
   67.19 -def get_channel(srctree):
   67.20 -    # look up llversionserver.h and parse out the version info
   67.21 -    paths = [os.path.join(srctree, x, 'llversionviewer.h') for x in ['llcommon', '../llcommon', '../../indra/llcommon.h']]
   67.22 -    for p in paths:
   67.23 -        if os.path.exists(p):
   67.24 -            contents = open(p, 'r').read()
   67.25 -            channel = re.search("LL_CHANNEL\s=\s\"(.+)\";\s*$", contents, flags = re.M).group(1)
   67.26 -            return channel
   67.27 -    
   67.28 -
   67.29  DEFAULT_SRCTREE = os.path.dirname(sys.argv[0])
   67.30 -DEFAULT_CHANNEL = 'Second Life Release'
   67.31 +RELEASE_CHANNEL = 'Second Life Release'
   67.32  
   67.33  ARGUMENTS=[
   67.34      dict(name='actions',
   67.35 @@ -140,10 +118,7 @@
   67.36           default=""),
   67.37      dict(name='channel',
   67.38           description="""The channel to use for updates, packaging, settings name, etc.""",
   67.39 -         default=get_channel),
   67.40 -    dict(name='login_channel',
   67.41 -         description="""The channel to use for login handshake/updates only.""",
   67.42 -         default=None),
   67.43 +         default='CHANNEL UNSET'),
   67.44      dict(name='installer_name',
   67.45           description=""" The name of the file that the installer should be
   67.46          packaged up into. Only used on Linux at the moment.""",
   67.47 @@ -164,10 +139,8 @@
   67.48          contain the name of the final package in a form suitable
   67.49          for use by a .bat file.""",
   67.50           default=None),
   67.51 -    dict(name='version',
   67.52 -         description="""This specifies the version of Second Life that is
   67.53 -        being packaged up.""",
   67.54 -         default=get_default_version),
   67.55 +    dict(name='versionfile',
   67.56 +         description="""The name of a file containing the full version number."""),
   67.57      dict(name='signature',
   67.58           description="""This specifies an identity to sign the viewer with, if any.
   67.59          If no value is supplied, the default signature will be used, if any. Currently
   67.60 @@ -232,9 +205,14 @@
   67.61                  args[arg['name']] = default
   67.62  
   67.63      # fix up version
   67.64 -    if isinstance(args.get('version'), str):
   67.65 -        args['version'] = args['version'].split('.')
   67.66 -        
   67.67 +    if isinstance(args.get('versionfile'), str):
   67.68 +        try: # read in the version string
   67.69 +            vf = open(args['versionfile'], 'r')
   67.70 +            args['version'] = vf.read().strip().split('.')
   67.71 +        except:
   67.72 +            print "Unable to read versionfile '%s'" % args['versionfile']
   67.73 +            raise
   67.74 +
   67.75      # default and agni are default
   67.76      if args['grid'] in ['default', 'agni']:
   67.77          args['grid'] = ''
   67.78 @@ -291,7 +269,7 @@
   67.79      def default_grid(self):
   67.80          return self.args.get('grid', None) == ''
   67.81      def default_channel(self):
   67.82 -        return self.args.get('channel', None) == DEFAULT_CHANNEL
   67.83 +        return self.args.get('channel', None) == RELEASE_CHANNEL
   67.84  
   67.85      def construct(self):
   67.86          """ Meant to be overriden by LLManifest implementors with code that
    68.1 --- a/indra/linux_crash_logger/CMakeLists.txt	Thu May 02 19:12:59 2013 -0400
    68.2 +++ b/indra/linux_crash_logger/CMakeLists.txt	Thu May 30 21:28:02 2013 +0000
    68.3 @@ -12,6 +12,7 @@
    68.4  include(LLXML)
    68.5  include(Linking)
    68.6  include(UI)
    68.7 +include(FreeType)
    68.8  
    68.9  include_directories(
   68.10      ${LLCOMMON_INCLUDE_DIRS}
   68.11 @@ -19,6 +20,11 @@
   68.12      ${LLMATH_INCLUDE_DIRS}
   68.13      ${LLVFS_INCLUDE_DIRS}
   68.14      ${LLXML_INCLUDE_DIRS}
   68.15 +    ${FREETYPE_INCLUDE_DIRS}
   68.16 +    )
   68.17 +include_directories(SYSTEM
   68.18 +    ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
   68.19 +    ${LLXML_SYSTEM_INCLUDE_DIRS}
   68.20      )
   68.21  
   68.22  set(linux_crash_logger_SOURCE_FILES
   68.23 @@ -53,6 +59,7 @@
   68.24      ${LLCOMMON_LIBRARIES}
   68.25      ${UI_LIBRARIES}
   68.26      ${DB_LIBRARIES}
   68.27 +    ${FREETYPE_LIBRARIES}
   68.28      )
   68.29  
   68.30  add_custom_target(linux-crash-logger-target ALL
    69.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.2 +++ b/indra/linux_updater/CMakeLists.txt	Thu May 30 21:28:02 2013 +0000
    69.3 @@ -0,0 +1,57 @@
    69.4 +# -*- cmake -*-
    69.5 +
    69.6 +project(linux_updater)
    69.7 +
    69.8 +include(00-Common)
    69.9 +include(CURL)
   69.10 +include(CARes)
   69.11 +include(OpenSSL)
   69.12 +include(UI)
   69.13 +include(LLCommon)
   69.14 +include(LLMessage)
   69.15 +include(LLVFS)
   69.16 +include(LLXML)
   69.17 +include(LLUI)
   69.18 +include(Linking)
   69.19 +
   69.20 +include_directories(
   69.21 +    ${LLCOMMON_INCLUDE_DIRS}
   69.22 +    ${LLVFS_INCLUDE_DIRS}
   69.23 +    ${LLXML_INCLUDE_DIRS}
   69.24 +    ${LLUI_INCLUDE_DIRS}
   69.25 +    ${CURL_INCLUDE_DIRS}
   69.26 +    ${CARES_INCLUDE_DIRS}
   69.27 +    ${OPENSSL_INCLUDE_DIRS}
   69.28 +    ${UI_INCLUDE_DIRS}
   69.29 +    )
   69.30 +include_directories(SYSTEM
   69.31 +    ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
   69.32 +    ${LLXML_SYSTEM_INCLUDE_DIRS}
   69.33 +    )
   69.34 +
   69.35 +set(linux_updater_SOURCE_FILES linux_updater.cpp)
   69.36 +
   69.37 +set(linux_updater_HEADER_FILES CMakeLists.txt)
   69.38 +
   69.39 +set_source_files_properties(${linux_updater_HEADER_FILES}
   69.40 +                            PROPERTIES HEADER_FILES_ONLY TRUE)
   69.41 +
   69.42 +list(APPEND linux_updater_SOURCE_FILES ${linux_updater_HEADER_FILES})
   69.43 +
   69.44 +add_executable(linux-updater ${linux_updater_SOURCE_FILES})
   69.45 +
   69.46 +target_link_libraries(linux-updater
   69.47 +    ${CURL_LIBRARIES}
   69.48 +    ${CARES_LIBRARIES}
   69.49 +    ${OPENSSL_LIBRARIES}
   69.50 +    ${CRYPTO_LIBRARIES}
   69.51 +    ${LLMESSAGE_LIBRARIES}
   69.52 +    ${UI_LIBRARIES}
   69.53 +    ${LLXML_LIBRARIES}
   69.54 +    ${LLUI_LIBRARIES}
   69.55 +    ${LLVFS_LIBRARIES}
   69.56 +    ${LLCOMMON_LIBRARIES}
   69.57 +    )
   69.58 +
   69.59 +add_custom_target(linux-updater-target ALL
   69.60 +                  DEPENDS linux-updater)
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/indra/linux_updater/linux_updater.cpp	Thu May 30 21:28:02 2013 +0000
    70.3 @@ -0,0 +1,924 @@
    70.4 +/**
    70.5 + * @file linux_updater.cpp
    70.6 + * @author Kyle Ambroff <ambroff@lindenlab.com>, Tofu Linden
    70.7 + * @brief Viewer update program for unix platforms that support GTK+
    70.8 + *
    70.9 + * $LicenseInfo:firstyear=2008&license=viewerlgpl$
   70.10 + * Second Life Viewer Source Code
   70.11 + * Copyright (C) 2010, Linden Research, Inc.
   70.12 + *
   70.13 + * This library is free software; you can redistribute it and/or
   70.14 + * modify it under the terms of the GNU Lesser General Public
   70.15 + * License as published by the Free Software Foundation;
   70.16 + * version 2.1 of the License only.
   70.17 + *
   70.18 + * This library is distributed in the hope that it will be useful,
   70.19 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   70.20 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   70.21 + * Lesser General Public License for more details.
   70.22 + *
   70.23 + * You should have received a copy of the GNU Lesser General Public
   70.24 + * License along with this library; if not, write to the Free Software
   70.25 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
   70.26 + *
   70.27 + * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
   70.28 + * $/LicenseInfo$
   70.29 + */
   70.30 +
   70.31 +#include <unistd.h>
   70.32 +#include <signal.h>
   70.33 +#include <errno.h>
   70.34 +
   70.35 +#include "linden_common.h"
   70.36 +#include "llerrorcontrol.h"
   70.37 +#include "llfile.h"
   70.38 +#include "lldir.h"
   70.39 +#include "lldiriterator.h"
   70.40 +
   70.41 +/*==========================================================================*|
   70.42 +// IQA-490: Use of LLTrans -- by this program at least -- appears to be buggy.
   70.43 +// With it, the 3.3.2 beta 1 linux-updater.bin crashes; without it seems stable.
   70.44 +#include "llxmlnode.h"
   70.45 +#include "lltrans.h"
   70.46 +|*==========================================================================*/
   70.47 +
   70.48 +static class LLTrans
   70.49 +{
   70.50 +public:
   70.51 +	LLTrans();
   70.52 +	static std::string getString(const std::string& key);
   70.53 +
   70.54 +private:
   70.55 +	std::string _getString(const std::string& key) const;
   70.56 +
   70.57 +	typedef std::map<std::string, std::string> MessageMap;
   70.58 +	MessageMap mMessages;
   70.59 +} sLLTransInstance;
   70.60 +
   70.61 +#include <curl/curl.h>
   70.62 +#include <map>
   70.63 +#include <boost/foreach.hpp>
   70.64 +
   70.65 +extern "C" {
   70.66 +#include <gtk/gtk.h>
   70.67 +}
   70.68 +
   70.69 +const guint UPDATE_PROGRESS_TIMEOUT = 100;
   70.70 +const guint UPDATE_PROGRESS_TEXT_TIMEOUT = 1000;
   70.71 +const guint ROTATE_IMAGE_TIMEOUT = 8000;
   70.72 +
   70.73 +typedef struct _updater_app_state {
   70.74 +	std::string app_name;
   70.75 +	std::string url;
   70.76 +	std::string file;
   70.77 +	std::string image_dir;
   70.78 +	std::string dest_dir;
   70.79 +	std::string strings_dirs;
   70.80 +	std::string strings_file;
   70.81 +
   70.82 +	LLDirIterator *image_dir_iter;
   70.83 +
   70.84 +	GtkWidget *window;
   70.85 +	GtkWidget *progress_bar;
   70.86 +	GtkWidget *image;
   70.87 +
   70.88 +	double progress_value;
   70.89 +	bool activity_mode;
   70.90 +
   70.91 +	guint image_rotation_timeout_id;
   70.92 +	guint progress_update_timeout_id;
   70.93 +	guint update_progress_text_timeout_id;
   70.94 +
   70.95 +	bool failure;
   70.96 +} UpdaterAppState;
   70.97 +
   70.98 +// List of entries from strings.xml to always replace
   70.99 +static std::set<std::string> default_trans_args;
  70.100 +void init_default_trans_args()
  70.101 +{
  70.102 +        default_trans_args.insert("SECOND_LIFE"); // World
  70.103 +        default_trans_args.insert("APP_NAME");
  70.104 +        default_trans_args.insert("SECOND_LIFE_GRID");
  70.105 +        default_trans_args.insert("SUPPORT_SITE");
  70.106 +}
  70.107 +
  70.108 +bool translate_init(std::string comma_delim_path_list,
  70.109 +		    std::string base_xml_name)
  70.110 +{
  70.111 +	return true;
  70.112 +/*==========================================================================*|
  70.113 +	init_default_trans_args();
  70.114 +
  70.115 +	// extract paths string vector from comma-delimited flat string
  70.116 +	std::vector<std::string> paths;
  70.117 +	LLStringUtil::getTokens(comma_delim_path_list, paths, ","); // split over ','
  70.118 +
  70.119 +	for(std::vector<std::string>::iterator it = paths.begin(), end_it = paths.end();
  70.120 +		it != end_it;
  70.121 +		++it)
  70.122 +	{
  70.123 +		(*it) = gDirUtilp->findSkinnedFilename(*it, base_xml_name);
  70.124 +	}
  70.125 +
  70.126 +	// suck the translation xml files into memory
  70.127 +	LLXMLNodePtr root;
  70.128 +	bool success = LLXMLNode::getLayeredXMLNode(root, paths);
  70.129 +	if (!success)
  70.130 +	{
  70.131 +		// couldn't load string table XML
  70.132 +		return false;
  70.133 +	}
  70.134 +	else
  70.135 +	{
  70.136 +		// get those strings out of the XML
  70.137 +		LLTrans::parseStrings(root, default_trans_args);
  70.138 +		return true;
  70.139 +	}
  70.140 +|*==========================================================================*/
  70.141 +}
  70.142 +
  70.143 +
  70.144 +void updater_app_ui_init(void);
  70.145 +void updater_app_quit(UpdaterAppState *app_state);
  70.146 +void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state);
  70.147 +std::string next_image_filename(std::string& image_path, LLDirIterator& iter);
  70.148 +void display_error(GtkWidget *parent, std::string title, std::string message);
  70.149 +BOOL install_package(std::string package_file, std::string destination);
  70.150 +BOOL spawn_viewer(UpdaterAppState *app_state);
  70.151 +
  70.152 +extern "C" {
  70.153 +	void on_window_closed(GtkWidget *sender, GdkEvent *event, gpointer state);
  70.154 +	gpointer worker_thread_cb(gpointer *data);
  70.155 +	int download_progress_cb(gpointer data, double t, double d, double utotal, double ulnow);
  70.156 +	gboolean rotate_image_cb(gpointer data);
  70.157 +	gboolean progress_update_timeout(gpointer data);
  70.158 +	gboolean update_progress_text_timeout(gpointer data);
  70.159 +}
  70.160 +
  70.161 +void updater_app_ui_init(UpdaterAppState *app_state)
  70.162 +{
  70.163 +	GtkWidget *vbox;
  70.164 +	GtkWidget *summary_label;
  70.165 +	GtkWidget *description_label;
  70.166 +	GtkWidget *frame;
  70.167 +
  70.168 +	llassert(app_state != NULL);
  70.169 +
  70.170 +	// set up window and main container
  70.171 +	std::string window_title = LLTrans::getString("UpdaterWindowTitle");
  70.172 +	app_state->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  70.173 +	gtk_window_set_title(GTK_WINDOW(app_state->window),
  70.174 +			     window_title.c_str());
  70.175 +	gtk_window_set_resizable(GTK_WINDOW(app_state->window), FALSE);
  70.176 +	gtk_window_set_position(GTK_WINDOW(app_state->window),
  70.177 +				GTK_WIN_POS_CENTER_ALWAYS);
  70.178 +
  70.179 +	gtk_container_set_border_width(GTK_CONTAINER(app_state->window), 12);
  70.180 +	g_signal_connect(G_OBJECT(app_state->window), "delete-event",
  70.181 +			 G_CALLBACK(on_window_closed), app_state);
  70.182 +
  70.183 +	vbox = gtk_vbox_new(FALSE, 6);
  70.184 +	gtk_container_add(GTK_CONTAINER(app_state->window), vbox);
  70.185 +
  70.186 +	// set top label
  70.187 +	std::ostringstream label_ostr;
  70.188 +	label_ostr << "<big><b>"
  70.189 +		   << LLTrans::getString("UpdaterNowUpdating")
  70.190 +		   << "</b></big>";
  70.191 +
  70.192 +	summary_label = gtk_label_new(NULL);
  70.193 +	gtk_label_set_use_markup(GTK_LABEL(summary_label), TRUE);
  70.194 +	gtk_label_set_markup(GTK_LABEL(summary_label),
  70.195 +			     label_ostr.str().c_str());
  70.196 +	gtk_misc_set_alignment(GTK_MISC(summary_label), 0, 0.5);
  70.197 +	gtk_box_pack_start(GTK_BOX(vbox), summary_label, FALSE, FALSE, 0);
  70.198 +
  70.199 +	// create the description label
  70.200 +	description_label = gtk_label_new(LLTrans::getString("UpdaterUpdatingDescriptive").c_str());
  70.201 +	gtk_label_set_line_wrap(GTK_LABEL(description_label), TRUE);
  70.202 +	gtk_misc_set_alignment(GTK_MISC(description_label), 0, 0.5);
  70.203 +	gtk_box_pack_start(GTK_BOX(vbox), description_label, FALSE, FALSE, 0);
  70.204 +
  70.205 +	// If an image path has been set, load the background images
  70.206 +	if (!app_state->image_dir.empty()) {
  70.207 +		frame = gtk_frame_new(NULL);
  70.208 +		gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
  70.209 +		gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
  70.210 +
  70.211 +		// load the first image
  70.212 +		app_state->image = gtk_image_new_from_file
  70.213 +			(next_image_filename(app_state->image_dir, *app_state->image_dir_iter).c_str());
  70.214 +		gtk_widget_set_size_request(app_state->image, 340, 310);
  70.215 +		gtk_container_add(GTK_CONTAINER(frame), app_state->image);
  70.216 +
  70.217 +		// rotate the images every 5 seconds
  70.218 +		app_state->image_rotation_timeout_id = g_timeout_add
  70.219 +			(ROTATE_IMAGE_TIMEOUT, rotate_image_cb, app_state);
  70.220 +	}
  70.221 +
  70.222 +	// set up progress bar, and update it roughly every 1/10 of a second
  70.223 +	app_state->progress_bar = gtk_progress_bar_new();
  70.224 +	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(app_state->progress_bar),
  70.225 +				  LLTrans::getString("UpdaterProgressBarTextWithEllipses").c_str());
  70.226 +	gtk_box_pack_start(GTK_BOX(vbox),
  70.227 +			   app_state->progress_bar, FALSE, TRUE, 0);
  70.228 +	app_state->progress_update_timeout_id = g_timeout_add
  70.229 +		(UPDATE_PROGRESS_TIMEOUT, progress_update_timeout, app_state);
  70.230 +	app_state->update_progress_text_timeout_id = g_timeout_add
  70.231 +		(UPDATE_PROGRESS_TEXT_TIMEOUT, update_progress_text_timeout, app_state);
  70.232 +
  70.233 +	gtk_widget_show_all(app_state->window);
  70.234 +}
  70.235 +
  70.236 +gboolean rotate_image_cb(gpointer data)
  70.237 +{
  70.238 +	UpdaterAppState *app_state;
  70.239 +	std::string filename;
  70.240 +
  70.241 +	llassert(data != NULL);
  70.242 +	app_state = (UpdaterAppState *) data;
  70.243 +
  70.244 +	filename = next_image_filename(app_state->image_dir, *app_state->image_dir_iter);
  70.245 +
  70.246 +	gdk_threads_enter();
  70.247 +	gtk_image_set_from_file(GTK_IMAGE(app_state->image), filename.c_str());
  70.248 +	gdk_threads_leave();
  70.249 +
  70.250 +	return TRUE;
  70.251 +}
  70.252 +
  70.253 +std::string next_image_filename(std::string& image_path, LLDirIterator& iter)
  70.254 +{
  70.255 +	std::string image_filename;
  70.256 +	iter.next(image_filename);
  70.257 +	return gDirUtilp->add(image_path, image_filename);
  70.258 +}
  70.259 +
  70.260 +void on_window_closed(GtkWidget *sender, GdkEvent* event, gpointer data)
  70.261 +{
  70.262 +	UpdaterAppState *app_state;
  70.263 +
  70.264 +	llassert(data != NULL);
  70.265 +	app_state = (UpdaterAppState *) data;
  70.266 +
  70.267 +	updater_app_quit(app_state);
  70.268 +}
  70.269 +
  70.270 +void updater_app_quit(UpdaterAppState *app_state)
  70.271 +{
  70.272 +	if (app_state != NULL)
  70.273 +	{
  70.274 +		g_source_remove(app_state->progress_update_timeout_id);
  70.275 +
  70.276 +		if (!app_state->image_dir.empty())
  70.277 +		{
  70.278 +			g_source_remove(app_state->image_rotation_timeout_id);
  70.279 +		}
  70.280 +	}
  70.281 +
  70.282 +	gtk_main_quit();
  70.283 +}
  70.284 +
  70.285 +void display_error(GtkWidget *parent, std::string title, std::string message)
  70.286 +{
  70.287 +	GtkWidget *dialog;
  70.288 +
  70.289 +	dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
  70.290 +					GTK_DIALOG_DESTROY_WITH_PARENT,
  70.291 +					GTK_MESSAGE_ERROR,
  70.292 +					GTK_BUTTONS_OK,
  70.293 +					"%s", message.c_str());
  70.294 +	gtk_window_set_title(GTK_WINDOW(dialog), title.c_str());
  70.295 +	gtk_dialog_run(GTK_DIALOG(dialog));
  70.296 +	gtk_widget_destroy(dialog);
  70.297 +}
  70.298 +
  70.299 +gpointer worker_thread_cb(gpointer data)
  70.300 +{
  70.301 +	UpdaterAppState *app_state;
  70.302 +	CURL *curl;
  70.303 +	CURLcode result;
  70.304 +	FILE *package_file;
  70.305 +	GError *error = NULL;
  70.306 +	int fd;
  70.307 +
  70.308 +	//g_return_val_if_fail (data != NULL, NULL);
  70.309 +	app_state = (UpdaterAppState *) data;
  70.310 +
  70.311 +	try {
  70.312 +
  70.313 +		if(!app_state->url.empty())
  70.314 +		{
  70.315 +			char* tmp_local_filename = NULL;
  70.316 +			// create temporary file to store the package.
  70.317 +			fd = g_file_open_tmp
  70.318 +				("secondlife-update-XXXXXX", &tmp_local_filename, &error);
  70.319 +			if (error != NULL)
  70.320 +			{
  70.321 +				llerrs << "Unable to create temporary file: "
  70.322 +					   << error->message
  70.323 +					   << llendl;
  70.324 +
  70.325 +				g_error_free(error);
  70.326 +				throw 0;
  70.327 +			}
  70.328 +
  70.329 +			if(tmp_local_filename != NULL)
  70.330 +			{
  70.331 +				app_state->file = tmp_local_filename;
  70.332 +				g_free(tmp_local_filename);
  70.333 +			}
  70.334 +
  70.335 +			package_file = fdopen(fd, "wb");
  70.336 +			if (package_file == NULL)
  70.337 +			{
  70.338 +				llerrs << "Failed to create temporary file: "
  70.339 +					   << app_state->file.c_str()
  70.340 +					   << llendl;
  70.341 +
  70.342 +				gdk_threads_enter();
  70.343 +				display_error(app_state->window,
  70.344 +							  LLTrans::getString("UpdaterFailDownloadTitle"),
  70.345 +							  LLTrans::getString("UpdaterFailUpdateDescriptive"));
  70.346 +				gdk_threads_leave();
  70.347 +				throw 0;
  70.348 +			}
  70.349 +
  70.350 +			// initialize curl and start downloading the package
  70.351 +			llinfos << "Downloading package: " << app_state->url << llendl;
  70.352 +
  70.353 +			curl = curl_easy_init();
  70.354 +			if (curl == NULL)
  70.355 +			{
  70.356 +				llerrs << "Failed to initialize libcurl" << llendl;
  70.357 +
  70.358 +				gdk_threads_enter();
  70.359 +				display_error(app_state->window,
  70.360 +							  LLTrans::getString("UpdaterFailDownloadTitle"),
  70.361 +							  LLTrans::getString("UpdaterFailUpdateDescriptive"));
  70.362 +				gdk_threads_leave();
  70.363 +				throw 0;
  70.364 +			}
  70.365 +
  70.366 +			curl_easy_setopt(curl, CURLOPT_URL, app_state->url.c_str());
  70.367 +			curl_easy_setopt(curl, CURLOPT_NOSIGNAL, TRUE);
  70.368 +			curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, TRUE);
  70.369 +			curl_easy_setopt(curl, CURLOPT_WRITEDATA, package_file);
  70.370 +			curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
  70.371 +			curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,
  70.372 +							 &download_progress_cb);
  70.373 +			curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, app_state);
  70.374 +
  70.375 +			result = curl_easy_perform(curl);
  70.376 +			fclose(package_file);
  70.377 +			curl_easy_cleanup(curl);
  70.378 +
  70.379 +			if (result)
  70.380 +			{
  70.381 +				llerrs << "Failed to download update: "
  70.382 +					   << app_state->url
  70.383 +					   << llendl;
  70.384 +
  70.385 +				gdk_threads_enter();
  70.386 +				display_error(app_state->window,
  70.387 +							  LLTrans::getString("UpdaterFailDownloadTitle"),
  70.388 +							  LLTrans::getString("UpdaterFailUpdateDescriptive"));
  70.389 +				gdk_threads_leave();
  70.390 +
  70.391 +				throw 0;
  70.392 +			}
  70.393 +		}
  70.394 +
  70.395 +		// now pulse the progres bar back and forth while the package is
  70.396 +		// being unpacked
  70.397 +		gdk_threads_enter();
  70.398 +		std::string installing_msg = LLTrans::getString("UpdaterNowInstalling");
  70.399 +		gtk_progress_bar_set_text(
  70.400 +			GTK_PROGRESS_BAR(app_state->progress_bar),
  70.401 +			installing_msg.c_str());
  70.402 +		app_state->activity_mode = TRUE;
  70.403 +		gdk_threads_leave();
  70.404 +
  70.405 +		// *TODO: if the destination is not writable, terminate this
  70.406 +		// thread and show file chooser?
  70.407 +		if (!install_package(app_state->file.c_str(), app_state->dest_dir))
  70.408 +		{
  70.409 +			llwarns << "Failed to install package to destination: "
  70.410 +				<< app_state->dest_dir
  70.411 +				<< llendl;
  70.412 +
  70.413 +			gdk_threads_enter();
  70.414 +			display_error(app_state->window,
  70.415 +						  LLTrans::getString("UpdaterFailInstallTitle"),
  70.416 +						  LLTrans::getString("UpdaterFailUpdateDescriptive"));
  70.417 +			//"Failed to update " + app_state->app_name,
  70.418 +			gdk_threads_leave();
  70.419 +			throw 0;
  70.420 +		}
  70.421 +
  70.422 +		// try to spawn the new viewer
  70.423 +		if (!spawn_viewer(app_state))
  70.424 +		{
  70.425 +			llwarns << "Viewer was not installed properly in : "
  70.426 +				<< app_state->dest_dir
  70.427 +				<< llendl;
  70.428 +
  70.429 +			gdk_threads_enter();
  70.430 +			display_error(app_state->window,
  70.431 +						  LLTrans::getString("UpdaterFailStartTitle"),
  70.432 +						  LLTrans::getString("UpdaterFailUpdateDescriptive"));
  70.433 +			gdk_threads_leave();
  70.434 +			throw 0;
  70.435 +		}
  70.436 +	}
  70.437 +	catch (...)
  70.438 +	{
  70.439 +		app_state->failure = TRUE;
  70.440 +	}
  70.441 +
  70.442 +	gdk_threads_enter();
  70.443 +	updater_app_quit(app_state);
  70.444 +	gdk_threads_leave();
  70.445 +
  70.446 +	return NULL;
  70.447 +}
  70.448 +
  70.449 +
  70.450 +gboolean less_anal_gspawnsync(gchar **argv,
  70.451 +			      gchar **stderr_output,
  70.452 +			      gint *child_exit_status,
  70.453 +			      GError **spawn_error)
  70.454 +{
  70.455 +	// store current SIGCHLD handler if there is one, replace with default
  70.456 +	// handler to make glib happy
  70.457 +	struct sigaction sigchld_backup;
  70.458 +	struct sigaction sigchld_appease_glib;
  70.459 +	sigchld_appease_glib.sa_handler = SIG_DFL;
  70.460 +	sigemptyset(&sigchld_appease_glib.sa_mask);
  70.461 +	sigchld_appease_glib.sa_flags = 0;
  70.462 +	sigaction(SIGCHLD, &sigchld_appease_glib, &sigchld_backup);
  70.463 +
  70.464 +	gboolean rtn = g_spawn_sync(NULL,
  70.465 +				    argv,
  70.466 +				    NULL,
  70.467 +				    (GSpawnFlags) (G_SPAWN_STDOUT_TO_DEV_NULL),
  70.468 +				    NULL,
  70.469 +				    NULL,
  70.470 +				    NULL,
  70.471 +				    stderr_output,
  70.472 +				    child_exit_status,
  70.473 +				    spawn_error);
  70.474 +
  70.475 +	// restore SIGCHLD handler
  70.476 +	sigaction(SIGCHLD, &sigchld_backup, NULL);
  70.477 +
  70.478 +	return rtn;
  70.479 +}
  70.480 +
  70.481 +
  70.482 +// perform a rename, or perform a (prompted) root rename if that fails
  70.483 +int
  70.484 +rename_with_sudo_fallback(const std::string& filename, const std::string& newname)
  70.485 +{
  70.486 +	int rtncode = ::rename(filename.c_str(), newname.c_str());
  70.487 +	lldebugs << "rename result is: " << rtncode << " / " << errno << llendl;
  70.488 +	if (rtncode && (EACCES == errno || EPERM == errno || EXDEV == errno))
  70.489 +	{
  70.490 +		llinfos << "Permission problem in rename, or moving between different mount points.  Retrying as a mv under a sudo." << llendl;
  70.491 +		// failed due to permissions, try again as a gksudo or kdesu mv wrapper hack
  70.492 +		char *sudo_cmd = NULL;
  70.493 +		sudo_cmd = g_find_program_in_path("gksudo");
  70.494 +		if (!sudo_cmd)
  70.495 +		{
  70.496 +			sudo_cmd = g_find_program_in_path("kdesu");
  70.497 +		}
  70.498 +		if (sudo_cmd)
  70.499 +		{
  70.500 +			char *mv_cmd = NULL;
  70.501 +			mv_cmd = g_find_program_in_path("mv");
  70.502 +			if (mv_cmd)
  70.503 +			{
  70.504 +				char *src_string_copy = g_strdup(filename.c_str());
  70.505 +				char *dst_string_copy = g_strdup(newname.c_str());
  70.506 +				char* argv[] =
  70.507 +					{
  70.508 +						sudo_cmd,
  70.509 +						mv_cmd,
  70.510 +						src_string_copy,
  70.511 +						dst_string_copy,
  70.512 +						NULL
  70.513 +					};
  70.514 +
  70.515 +				gchar *stderr_output = NULL;
  70.516 +				gint child_exit_status = 0;
  70.517 +				GError *spawn_error = NULL;
  70.518 +				if (!less_anal_gspawnsync(argv, &stderr_output,
  70.519 +							  &child_exit_status, &spawn_error))
  70.520 +				{
  70.521 +					llwarns << "Failed to spawn child process: "
  70.522 +						<< spawn_error->message
  70.523 +						<< llendl;
  70.524 +				}
  70.525 +				else if (child_exit_status)
  70.526 +				{
  70.527 +					llwarns << "mv command failed: "
  70.528 +						<< (stderr_output ? stderr_output : "(no reason given)")
  70.529 +						<< llendl;
  70.530 +				}
  70.531 +				else
  70.532 +				{
  70.533 +					// everything looks good, clear the error code
  70.534 +					rtncode = 0;
  70.535 +				}
  70.536 +
  70.537 +				g_free(src_string_copy);
  70.538 +				g_free(dst_string_copy);
  70.539 +				if (spawn_error) g_error_free(spawn_error);
  70.540 +			}
  70.541 +		}
  70.542 +	}
  70.543 +	return rtncode;
  70.544 +}
  70.545 +
  70.546 +gboolean install_package(std::string package_file, std::string destination)
  70.547 +{
  70.548 +	char *tar_cmd = NULL;
  70.549 +	std::ostringstream command;
  70.550 +
  70.551 +	// Find the absolute path to the 'tar' command.
  70.552 +	tar_cmd = g_find_program_in_path("tar");
  70.553 +	if (!tar_cmd)
  70.554 +	{
  70.555 +		llerrs << "`tar' was not found in $PATH" << llendl;
  70.556 +		return FALSE;
  70.557 +	}
  70.558 +	llinfos << "Found tar command: " << tar_cmd << llendl;
  70.559 +
  70.560 +	// Unpack the tarball in a temporary place first, then move it to
  70.561 +	// its final destination
  70.562 +	std::string tmp_dest_dir = gDirUtilp->getTempFilename();
  70.563 +	if (LLFile::mkdir(tmp_dest_dir, 0744))
  70.564 +	{
  70.565 +		llerrs << "Failed to create directory: "
  70.566 +		       << destination
  70.567 +		       << llendl;
  70.568 +
  70.569 +		return FALSE;
  70.570 +	}
  70.571 +
  70.572 +	char *package_file_string_copy = g_strdup(package_file.c_str());
  70.573 +	char *tmp_dest_dir_string_copy = g_strdup(tmp_dest_dir.c_str());
  70.574 +	gchar *argv[8] = {
  70.575 +		tar_cmd,
  70.576 +		const_cast<gchar*>("--strip"), const_cast<gchar*>("1"),
  70.577 +		const_cast<gchar*>("-xjf"),
  70.578 +		package_file_string_copy,
  70.579 +		const_cast<gchar*>("-C"), tmp_dest_dir_string_copy,
  70.580 +		NULL,
  70.581 +	};
  70.582 +
  70.583 +	llinfos << "Untarring package: " << package_file << llendl;
  70.584 +
  70.585 +	// store current SIGCHLD handler if there is one, replace with default
  70.586 +	// handler to make glib happy
  70.587 +	struct sigaction sigchld_backup;
  70.588 +	struct sigaction sigchld_appease_glib;
  70.589 +	sigchld_appease_glib.sa_handler = SIG_DFL;
  70.590 +	sigemptyset(&sigchld_appease_glib.sa_mask);
  70.591 +	sigchld_appease_glib.sa_flags = 0;
  70.592 +	sigaction(SIGCHLD, &sigchld_appease_glib, &sigchld_backup);
  70.593 +
  70.594 +	gchar *stderr_output = NULL;
  70.595 +	gint child_exit_status = 0;
  70.596 +	GError *untar_error = NULL;
  70.597 +	if (!less_anal_gspawnsync(argv, &stderr_output,
  70.598 +				  &child_exit_status, &untar_error))
  70.599 +	{
  70.600 +		llwarns << "Failed to spawn child process: "
  70.601 +			<< untar_error->message
  70.602 +			<< llendl;
  70.603 +		return FALSE;
  70.604 +	}
  70.605 +
  70.606 +	if (child_exit_status)
  70.607 +	{
  70.608 +	 	llwarns << "Untar command failed: "
  70.609 +			<< (stderr_output ? stderr_output : "(no reason given)")
  70.610 +			<< llendl;
  70.611 +		return FALSE;
  70.612 +	}
  70.613 +
  70.614 +	g_free(tar_cmd);
  70.615 +	g_free(package_file_string_copy);
  70.616 +	g_free(tmp_dest_dir_string_copy);
  70.617 +	g_free(stderr_output);
  70.618 +	if (untar_error) g_error_free(untar_error);
  70.619 +
  70.620 +	// move the existing package out of the way if it exists
  70.621 +	if (gDirUtilp->fileExists(destination))
  70.622 +	{
  70.623 +		std::string backup_dir = destination + ".backup";
  70.624 +		int oldcounter = 1;
  70.625 +		while (gDirUtilp->fileExists(backup_dir))
  70.626 +		{
  70.627 +			// find a foo.backup.N folder name that isn't taken yet
  70.628 +			backup_dir = destination + ".backup." + llformat("%d", oldcounter);
  70.629 +			++oldcounter;
  70.630 +		}
  70.631 +
  70.632 +		if (rename_with_sudo_fallback(destination, backup_dir))
  70.633 +		{
  70.634 +			llwarns << "Failed to move directory: '"
  70.635 +				<< destination << "' -> '" << backup_dir
  70.636 +				<< llendl;
  70.637 +			return FALSE;
  70.638 +		}
  70.639 +	}
  70.640 +
  70.641 +	// The package has been unpacked in a staging directory, now we just
  70.642 +	// need to move it to its destination.
  70.643 +	if (rename_with_sudo_fallback(tmp_dest_dir, destination))
  70.644 +	{
  70.645 +		llwarns << "Failed to move installation to the destination: "
  70.646 +			<< destination
  70.647 +			<< llendl;
  70.648 +		return FALSE;
  70.649 +	}
  70.650 +
  70.651 +	// \0/ Success!
  70.652 +	return TRUE;
  70.653 +}
  70.654 +
  70.655 +gboolean progress_update_timeout(gpointer data)
  70.656 +{
  70.657 +	UpdaterAppState *app_state;
  70.658 +
  70.659 +	llassert(data != NULL);
  70.660 +
  70.661 +	app_state = (UpdaterAppState *) data;
  70.662 +
  70.663 +	gdk_threads_enter();
  70.664 +	if (app_state->activity_mode)
  70.665 +	{
  70.666 +		gtk_progress_bar_pulse
  70.667 +			(GTK_PROGRESS_BAR(app_state->progress_bar));
  70.668 +	}
  70.669 +	else
  70.670 +	{
  70.671 +		gtk_progress_set_value(GTK_PROGRESS(app_state->progress_bar),
  70.672 +				       app_state->progress_value);
  70.673 +	}
  70.674 +	gdk_threads_leave();
  70.675 +
  70.676 +	return TRUE;
  70.677 +}
  70.678 +
  70.679 +gboolean update_progress_text_timeout(gpointer data)
  70.680 +{
  70.681 +	UpdaterAppState *app_state;
  70.682 +
  70.683 +	llassert(data != NULL);
  70.684 +	app_state = (UpdaterAppState *) data;
  70.685 +
  70.686 +	if (app_state->activity_mode == TRUE)
  70.687 +	{
  70.688 +		// We no longer need this timeout, it will be removed.
  70.689 +		return FALSE;
  70.690 +	}
  70.691 +
  70.692 +	if (!app_state->progress_value)
  70.693 +	{
  70.694 +		return TRUE;
  70.695 +	}
  70.696 +
  70.697 +	std::string progress_text = llformat((LLTrans::getString("UpdaterProgressBarText")+" (%.0f%%)").c_str(), app_state->progress_value);
  70.698 +
  70.699 +	gdk_threads_enter();
  70.700 +	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(app_state->progress_bar),
  70.701 +				  progress_text.c_str());
  70.702 +	gdk_threads_leave();
  70.703 +
  70.704 +	return TRUE;
  70.705 +}
  70.706 +
  70.707 +int download_progress_cb(gpointer data,
  70.708 +			 double t,
  70.709 +			 double d,
  70.710 +			 double utotal,
  70.711 +			 double ulnow)
  70.712 +{
  70.713 +	UpdaterAppState *app_state;
  70.714 +
  70.715 +	llassert(data != NULL);
  70.716 +	app_state = (UpdaterAppState *) data;
  70.717 +
  70.718 +	if (t <= 0.0)
  70.719 +	{
  70.720 +		app_state->progress_value = 0;
  70.721 +	}
  70.722 +	else
  70.723 +	{
  70.724 +		app_state->progress_value = d * 100.0 / t;
  70.725 +	}
  70.726 +	return 0;
  70.727 +}
  70.728 +
  70.729 +BOOL spawn_viewer(UpdaterAppState *app_state)
  70.730 +{
  70.731 +	llassert(app_state != NULL);
  70.732 +
  70.733 +	std::string cmd = app_state->dest_dir + "/secondlife";
  70.734 +	GError *error = NULL;
  70.735 +
  70.736 +	// We want to spawn the Viewer on the same display as the updater app
  70.737 +	gboolean success = gdk_spawn_command_line_on_screen
  70.738 +		(gtk_widget_get_screen(app_state->window), cmd.c_str(), &error);
  70.739 +
  70.740 +	if (!success)
  70.741 +	{
  70.742 +		llwarns << "Failed to launch viewer: " << error->message
  70.743 +			<< llendl;
  70.744 +	}
  70.745 +
  70.746 +	if (error) g_error_free(error);
  70.747 +
  70.748 +	return success;
  70.749 +}
  70.750 +
  70.751 +void show_usage_and_exit()
  70.752 +{
  70.753 +	std::cout << "Usage: linux-updater <--url URL | --file FILE> --name NAME --dest PATH --stringsdir PATH1,PATH2 --stringsfile FILE"
  70.754 +		  << "[--image-dir PATH]"
  70.755 +		  << std::endl;
  70.756 +	exit(1);
  70.757 +}
  70.758 +
  70.759 +void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state)
  70.760 +{
  70.761 +	int i;
  70.762 +
  70.763 +	for (i = 1; i < argc; i++)
  70.764 +	{
  70.765 +		if ((!strcmp(argv[i], "--url")) && (++i < argc))
  70.766 +		{
  70.767 +			app_state->url = argv[i];
  70.768 +		}
  70.769 +		else if ((!strcmp(argv[i], "--file")) && (++i < argc))
  70.770 +		{
  70.771 +			app_state->file = argv[i];
  70.772 +		}
  70.773 +		else if ((!strcmp(argv[i], "--name")) && (++i < argc))
  70.774 +		{
  70.775 +			app_state->app_name = argv[i];
  70.776 +		}
  70.777 +		else if ((!strcmp(argv[i], "--image-dir")) && (++i < argc))
  70.778 +		{
  70.779 +			app_state->image_dir = argv[i];
  70.780 +			app_state->image_dir_iter = new LLDirIterator(argv[i], "*.jpg");
  70.781 +		}
  70.782 +		else if ((!strcmp(argv[i], "--dest")) && (++i < argc))
  70.783 +		{
  70.784 +			app_state->dest_dir = argv[i];
  70.785 +		}
  70.786 +		else if ((!strcmp(argv[i], "--stringsdir")) && (++i < argc))
  70.787 +		{
  70.788 +			app_state->strings_dirs = argv[i];
  70.789 +		}
  70.790 +		else if ((!strcmp(argv[i], "--stringsfile")) && (++i < argc))
  70.791 +		{
  70.792 +			app_state->strings_file = argv[i];
  70.793 +		}
  70.794 +		else
  70.795 +		{
  70.796 +			// show usage, an invalid option was given.
  70.797 +			show_usage_and_exit();
  70.798 +		}
  70.799 +	}
  70.800 +
  70.801 +	if (app_state->app_name.empty()
  70.802 +	    || (app_state->url.empty() && app_state->file.empty())
  70.803 +	    || app_state->dest_dir.empty())
  70.804 +	{
  70.805 +		show_usage_and_exit();
  70.806 +	}
  70.807 +
  70.808 +	app_state->progress_value = 0.0;
  70.809 +	app_state->activity_mode = FALSE;
  70.810 +	app_state->failure = FALSE;
  70.811 +
  70.812 +	translate_init(app_state->strings_dirs, app_state->strings_file);
  70.813 +}
  70.814 +
  70.815 +int main(int argc, char **argv)
  70.816 +{
  70.817 +	UpdaterAppState* app_state = new UpdaterAppState;
  70.818 +
  70.819 +	parse_args_and_init(argc, argv, app_state);
  70.820 +
  70.821 +	// Initialize logger, and rename old log file
  70.822 +	gDirUtilp->initAppDirs("SecondLife");
  70.823 +	LLError::initForApplication
  70.824 +		(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
  70.825 +	std::string old_log_file = gDirUtilp->getExpandedFilename
  70.826 +		(LL_PATH_LOGS, "updater.log.old");
  70.827 +	std::string log_file =
  70.828 +		gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log");
  70.829 +	LLFile::rename(log_file, old_log_file);
  70.830 +	LLError::logToFile(log_file);
  70.831 +
  70.832 +	// initialize gthreads and gtk+
  70.833 +	if (!g_thread_supported())
  70.834 +	{
  70.835 +		g_thread_init(NULL);
  70.836 +		gdk_threads_init();
  70.837 +	}
  70.838 +
  70.839 +	gtk_init(&argc, &argv);
  70.840 +
  70.841 +	// create UI
  70.842 +	updater_app_ui_init(app_state);
  70.843 +
  70.844 +	//llinfos << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << llendl;
  70.845 +
  70.846 +	// create download thread
  70.847 +	g_thread_create(GThreadFunc(worker_thread_cb), app_state, FALSE, NULL);
  70.848 +
  70.849 +	gdk_threads_enter();
  70.850 +	gtk_main();
  70.851 +	gdk_threads_leave();
  70.852 +
  70.853 +	// Delete the file only if created from url download.
  70.854 +	if(!app_state->url.empty() && !app_state->file.empty())
  70.855 +	{
  70.856 +		if (gDirUtilp->fileExists(app_state->file))
  70.857 +		{
  70.858 +			LLFile::remove(app_state->file);
  70.859 +		}
  70.860 +	}
  70.861 +
  70.862 +	bool success = !app_state->failure;
  70.863 +	delete app_state->image_dir_iter;
  70.864 +	delete app_state;
  70.865 +	return success ? 0 : 1;
  70.866 +}
  70.867 +
  70.868 +/*****************************************************************************
  70.869 +*   Dummy LLTrans implementation (IQA-490)
  70.870 +*****************************************************************************/
  70.871 +static LLTrans sStaticStrings;
  70.872 +
  70.873 +// lookup
  70.874 +std::string LLTrans::_getString(const std::string& key) const
  70.875 +{
  70.876 +	MessageMap::const_iterator found = mMessages.find(key);
  70.877 +	if (found != mMessages.end())
  70.878 +	{
  70.879 +		return found->second;
  70.880 +	}
  70.881 +	LL_WARNS("linux_updater") << "No message for key '" << key
  70.882 +							  << "' -- add to LLTrans::LLTrans() in linux_updater.cpp"
  70.883 +							  << LL_ENDL;
  70.884 +	return key;
  70.885 +}
  70.886 +
  70.887 +// static lookup
  70.888 +std::string LLTrans::getString(const std::string& key)
  70.889 +{
  70.890 +    return sLLTransInstance._getString(key);
  70.891 +}
  70.892 +
  70.893 +// initialization
  70.894 +LLTrans::LLTrans()
  70.895 +{
  70.896 +	typedef std::pair<const char*, const char*> Pair;
  70.897 +	static const Pair data[] =
  70.898 +	{
  70.899 +		Pair("UpdaterFailDownloadTitle",
  70.900 +			 "Failed to download update"),
  70.901 +		Pair("UpdaterFailInstallTitle",
  70.902 +			 "Failed to install update"),
  70.903 +		Pair("UpdaterFailStartTitle",
  70.904 +			 "Failed to start viewer"),
  70.905 +		Pair("UpdaterFailUpdateDescriptive",
  70.906 +			 "An error occurred while updating Second Life. "
  70.907 +			 "Please download the latest version from www.secondlife.com."),
  70.908 +		Pair("UpdaterNowInstalling",
  70.909 +			 "Installing Second Life..."),
  70.910 +		Pair("UpdaterNowUpdating",
  70.911 +			 "Now updating Second Life..."),
  70.912 +		Pair("UpdaterProgressBarText",
  70.913 +			 "Downloading update"),
  70.914 +		Pair("UpdaterProgressBarTextWithEllipses",
  70.915 +			 "Downloading update..."),
  70.916 +		Pair("UpdaterUpdatingDescriptive",
  70.917 +			 "Your Second Life Viewer is being updated to the latest release. "
  70.918 +			 "This may take some time, so please be patient."),
  70.919 +		Pair("UpdaterWindowTitle",
  70.920 +			 "Second Life Update")
  70.921 +	};
  70.922 +
  70.923 +	BOOST_FOREACH(Pair pair, data)
  70.924 +	{
  70.925 +		mMessages[pair.first] = pair.second;
  70.926 +	}
  70.927 +}
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/indra/llappearance/CMakeLists.txt	Thu May 30 21:28:02 2013 +0000
    71.3 @@ -0,0 +1,118 @@
    71.4 +# -*- cmake -*-
    71.5 +
    71.6 +project(llappearance)
    71.7 +
    71.8 +include(00-Common)
    71.9 +include(LLCommon)
   71.10 +include(LLCharacter)
   71.11 +include(LLImage)
   71.12 +include(LLInventory)
   71.13 +include(LLMath)
   71.14 +include(LLMessage)
   71.15 +include(LLRender)
   71.16 +include(LLVFS)
   71.17 +include(LLWindow)
   71.18 +include(LLXML)
   71.19 +include(Linking)
   71.20 +
   71.21 +include_directories(
   71.22 +    ${LLCOMMON_INCLUDE_DIRS}
   71.23 +    ${LLCHARACTER_INCLUDE_DIRS}
   71.24 +    ${LLIMAGE_INCLUDE_DIRS}
   71.25 +    ${LLINVENTORY_INCLUDE_DIRS}
   71.26 +    ${LLMATH_INCLUDE_DIRS}
   71.27 +    ${LLRENDER_INCLUDE_DIRS}
   71.28 +    ${LLVFS_INCLUDE_DIRS}
   71.29 +    ${LLWINDOW_INCLUDE_DIRS}
   71.30 +    ${LLXML_INCLUDE_DIRS}
   71.31 +    )
   71.32 +
   71.33 +set(llappearance_SOURCE_FILES
   71.34 +    llavatarappearance.cpp
   71.35 +    llavatarjoint.cpp
   71.36 +    llavatarjointmesh.cpp
   71.37 +    lldriverparam.cpp
   71.38 +    lllocaltextureobject.cpp
   71.39 +    llpolyskeletaldistortion.cpp
   71.40 +    llpolymesh.cpp
   71.41 +    llpolymorph.cpp
   71.42 +    lltexglobalcolor.cpp
   71.43 +    lltexlayer.cpp
   71.44 +    lltexlayerparams.cpp
   71.45 +    lltexturemanagerbridge.cpp
   71.46 +    llwearable.cpp
   71.47 +    llwearabledata.cpp
   71.48 +    llwearabletype.cpp
   71.49 +    llviewervisualparam.cpp
   71.50 +    llavatarappearancedefines.cpp
   71.51 +    )
   71.52 +    
   71.53 +set(llappearance_HEADER_FILES
   71.54 +    CMakeLists.txt
   71.55 +
   71.56 +    llavatarappearance.h
   71.57 +    llavatarjoint.h
   71.58 +    llavatarjointmesh.h
   71.59 +    lldriverparam.h
   71.60 +    lljointpickname.h
   71.61 +    lllocaltextureobject.h
   71.62 +    llpolyskeletaldistortion.h
   71.63 +    llpolymesh.h
   71.64 +    llpolymorph.h
   71.65 +    lltexglobalcolor.h
   71.66 +    lltexlayer.h
   71.67 +    lltexlayerparams.h
   71.68 +    lltexturemanagerbridge.h
   71.69 +    llwearable.h
   71.70 +    llwearabledata.h
   71.71 +    llwearabletype.h
   71.72 +    llviewervisualparam.h
   71.73 +    llavatarappearancedefines.h
   71.74 +    )
   71.75 +
   71.76 +set_source_files_properties(${llappearance_HEADER_FILES}
   71.77 +                            PROPERTIES HEADER_FILE_ONLY TRUE)
   71.78 +
   71.79 +list(APPEND llappearance_SOURCE_FILES ${llappearance_HEADER_FILES})
   71.80 +
   71.81 +add_library (llappearance ${llappearance_SOURCE_FILES})
   71.82 +
   71.83 +target_link_libraries(llappearance
   71.84 +    ${LLCHARACTER_LIBRARIES}
   71.85 +    ${LLINVENTORY_LIBRARIES}
   71.86 +    ${LLIMAGE_LIBRARIES}
   71.87 +    ${LLRENDER_LIBRARIES}
   71.88 +    ${LLVFS_LIBRARIES}
   71.89 +    ${LLMATH_LIBRARIES}
   71.90 +    ${LLXML_LIBRARIES}
   71.91 +    ${LLMATH_LIBRARIES}
   71.92 +    ${LLCOMMON_LIBRARIES}
   71.93 +    )
   71.94 +
   71.95 +if (BUILD_HEADLESS)
   71.96 +  add_library (llappearanceheadless ${llappearance_SOURCE_FILES})
   71.97 +  
   71.98 +  target_link_libraries(llappearanceheadless
   71.99 +      ${LLCHARACTER_LIBRARIES}
  71.100 +      ${LLINVENTORY_LIBRARIES}
  71.101 +      ${LLIMAGE_LIBRARIES}
  71.102 +      ${LLRENDERHEADLESS_LIBRARIES}
  71.103 +      ${LLVFS_LIBRARIES}
  71.104 +      ${LLMATH_LIBRARIES}
  71.105 +      ${LLXML_LIBRARIES}
  71.106 +      ${LLMATH_LIBRARIES}
  71.107 +      ${LLCOMMON_LIBRARIES}
  71.108 +      )
  71.109 +endif (BUILD_HEADLESS)
  71.110 +
  71.111 +#add unit tests
  71.112 +#if (LL_TESTS)
  71.113 +#    INCLUDE(LLAddBuildTest)
  71.114 +#    SET(llappearance_TEST_SOURCE_FILES
  71.115 +#      # no real unit tests yet!
  71.116 +#      )
  71.117 +#    LL_ADD_PROJECT_UNIT_TESTS(llappearance "${llappearance_TEST_SOURCE_FILES}")
  71.118 +
  71.119 +    #set(TEST_DEBUG on)
  71.120 +#    set(test_libs llappearance ${LLCOMMON_LIBRARIES})
  71.121 +#endif (LL_TESTS)
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/indra/llappearance/llavatarappearance.cpp	Thu May 30 21:28:02 2013 +0000
    72.3 @@ -0,0 +1,1953 @@
    72.4 +/** 
    72.5 + * @File llavatarappearance.cpp
    72.6 + * @brief Implementation of LLAvatarAppearance class
    72.7 + *
    72.8 + * $LicenseInfo:firstyear=2012&license=viewerlgpl$
    72.9 + * Second Life Viewer Source Code
   72.10 + * Copyright (C) 2010, Linden Research, Inc.
   72.11 + * 
   72.12 + * This library is free software; you can redistribute it and/or
   72.13 + * modify it under the terms of the GNU Lesser General Public
   72.14 + * License as published by the Free Software Foundation;
   72.15 + * version 2.1 of the License only.
   72.16 + * 
   72.17 + * This library is distributed in the hope that it will be useful,
   72.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   72.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   72.20 + * Lesser General Public License for more details.
   72.21 + * 
   72.22 + * You should have received a copy of the GNU Lesser General Public
   72.23 + * License along with this library; if not, write to the Free Software
   72.24 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
   72.25 + * 
   72.26 + * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
   72.27 + * $/LicenseInfo$
   72.28 + */
   72.29 +
   72.30 +#if LL_MSVC
   72.31 +// disable warning about boost::lexical_cast returning uninitialized data
   72.32 +// when it fails to parse the string
   72.33 +#pragma warning (disable:4701)
   72.34 +#endif
   72.35 +
   72.36 +#include "linden_common.h"
   72.37 +
   72.38 +#include "llavatarappearance.h"
   72.39 +#include "llavatarappearancedefines.h"
   72.40 +#include "llavatarjointmesh.h"
   72.41 +#include "imageids.h"
   72.42 +#include "lldir.h"
   72.43 +#include "lldeleteutils.h"
   72.44 +#include "llpolymorph.h"
   72.45 +#include "llpolymesh.h"
   72.46 +#include "llpolyskeletaldistortion.h"
   72.47 +#include "llstl.h"
   72.48 +#include "lltexglobalcolor.h"
   72.49 +#include "llwearabledata.h"
   72.50 +
   72.51 +
   72.52 +#if LL_MSVC
   72.53 +// disable boost::lexical_cast warning
   72.54 +#pragma warning (disable:4702)
   72.55 +#endif
   72.56 +
   72.57 +#include <boost/lexical_cast.hpp>
   72.58 +
   72.59 +using namespace LLAvatarAppearanceDefines;
   72.60 +
   72.61 +//-----------------------------------------------------------------------------
   72.62 +// Constants
   72.63 +//-----------------------------------------------------------------------------
   72.64 +
   72.65 +const std::string AVATAR_DEFAULT_CHAR = "avatar";
   72.66 +const LLColor4 DUMMY_COLOR = LLColor4(0.5,0.5,0.5,1.0);
   72.67 +
   72.68 +/*********************************************************************************
   72.69 + **                                                                             **
   72.70 + ** Begin private LLAvatarAppearance Support classes
   72.71 + **
   72.72 + **/
   72.73 +
   72.74 +//------------------------------------------------------------------------
   72.75 +// LLAvatarBoneInfo
   72.76 +// Trans/Scale/Rot etc. info about each avatar bone.  Used by LLVOAvatarSkeleton.
   72.77 +//------------------------------------------------------------------------
   72.78 +class LLAvatarBoneInfo
   72.79 +{
   72.80 +	friend class LLAvatarAppearance;
   72.81 +	friend class LLAvatarSkeletonInfo;
   72.82 +public:
   72.83 +	LLAvatarBoneInfo() : mIsJoint(FALSE) {}
   72.84 +	~LLAvatarBoneInfo()
   72.85 +	{
   72.86 +		std::for_each(mChildList.begin(), mChildList.end(), DeletePointer());
   72.87 +	}
   72.88 +	BOOL parseXml(LLXmlTreeNode* node);
   72.89 +	
   72.90 +private:
   72.91 +	std::string mName;
   72.92 +	BOOL mIsJoint;
   72.93 +	LLVector3 mPos;
   72.94 +	LLVector3 mRot;
   72.95 +	LLVector3 mScale;
   72.96 +	LLVector3 mPivot;
   72.97 +	typedef std::vector<LLAvatarBoneInfo*> child_list_t;
   72.98 +	child_list_t mChildList;
   72.99 +};
  72.100 +
  72.101 +//------------------------------------------------------------------------
  72.102 +// LLAvatarSkeletonInfo
  72.103 +// Overall avatar skeleton
  72.104 +//------------------------------------------------------------------------
  72.105 +class LLAvatarSkeletonInfo
  72.106 +{
  72.107 +	friend class LLAvatarAppearance;
  72.108 +public:
  72.109 +	LLAvatarSkeletonInfo() :
  72.110 +		mNumBones(0), mNumCollisionVolumes(0) {}
  72.111 +	~LLAvatarSkeletonInfo()
  72.112 +	{
  72.113 +		std::for_each(mBoneInfoList.begin(), mBoneInfoList.end(), DeletePointer());
  72.114 +	}
  72.115 +	BOOL parseXml(LLXmlTreeNode* node);
  72.116 +	S32 getNumBones() const { return mNumBones; }
  72.117 +	S32 getNumCollisionVolumes() const { return mNumCollisionVolumes; }
  72.118 +	
  72.119 +private:
  72.120 +	S32 mNumBones;
  72.121 +	S32 mNumCollisionVolumes;
  72.122 +	typedef std::vector<LLAvatarBoneInfo*> bone_info_list_t;
  72.123 +	bone_info_list_t mBoneInfoList;
  72.124 +};
  72.125 +
  72.126 +//-----------------------------------------------------------------------------
  72.127 +// LLAvatarXmlInfo
  72.128 +//-----------------------------------------------------------------------------
  72.129 +
  72.130 +LLAvatarAppearance::LLAvatarXmlInfo::LLAvatarXmlInfo()
  72.131 +	: mTexSkinColorInfo(0), mTexHairColorInfo(0), mTexEyeColorInfo(0)
  72.132 +{
  72.133 +}
  72.134 +
  72.135 +LLAvatarAppearance::LLAvatarXmlInfo::~LLAvatarXmlInfo()
  72.136 +{
  72.137 +	std::for_each(mMeshInfoList.begin(), mMeshInfoList.end(), DeletePointer());
  72.138 +	std::for_each(mSkeletalDistortionInfoList.begin(), mSkeletalDistortionInfoList.end(), DeletePointer());		
  72.139 +	std::for_each(mAttachmentInfoList.begin(), mAttachmentInfoList.end(), DeletePointer());
  72.140 +	deleteAndClear(mTexSkinColorInfo);
  72.141 +	deleteAndClear(mTexHairColorInfo);
  72.142 +	deleteAndClear(mTexEyeColorInfo);
  72.143 +	std::for_each(mLayerInfoList.begin(), mLayerInfoList.end(), DeletePointer());		
  72.144 +	std::for_each(mDriverInfoList.begin(), mDriverInfoList.end(), DeletePointer());
  72.145 +	std::for_each(mMorphMaskInfoList.begin(), mMorphMaskInfoList.end(), DeletePointer());
  72.146 +}
  72.147 +
  72.148 +
  72.149 +/**
  72.150 + **
  72.151 + ** End LLAvatarAppearance Support classes
  72.152 + **                                                                             **
  72.153 + *********************************************************************************/
  72.154 +
  72.155 +//-----------------------------------------------------------------------------
  72.156 +// Static Data
  72.157 +//-----------------------------------------------------------------------------
  72.158 +LLXmlTree LLAvatarAppearance::sXMLTree;
  72.159 +LLXmlTree LLAvatarAppearance::sSkeletonXMLTree;
  72.160 +LLAvatarSkeletonInfo* LLAvatarAppearance::sAvatarSkeletonInfo = NULL;
  72.161 +LLAvatarAppearance::LLAvatarXmlInfo* LLAvatarAppearance::sAvatarXmlInfo = NULL;
  72.162 +
  72.163 +
  72.164 +LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
  72.165 +	LLCharacter(),
  72.166 +	mIsDummy(FALSE),
  72.167 +	mTexSkinColor( NULL ),
  72.168 +	mTexHairColor( NULL ),
  72.169 +	mTexEyeColor( NULL ),
  72.170 +	mPelvisToFoot(0.f),
  72.171 +	mHeadOffset(),
  72.172 +	mRoot(NULL),
  72.173 +	mWearableData(wearable_data)
  72.174 +{
  72.175 +	llassert_always(mWearableData);
  72.176 +	mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
  72.177 +	for (U32 i = 0; i < mBakedTextureDatas.size(); i++ )
  72.178 +	{
  72.179 +		mBakedTextureDatas[i].mLastTextureID = IMG_DEFAULT_AVATAR;
  72.180 +		mBakedTextureDatas[i].mTexLayerSet = NULL;
  72.181 +		mBakedTextureDatas[i].mIsLoaded = false;
  72.182 +		mBakedTextureDatas[i].mIsUsed = false;
  72.183 +		mBakedTextureDatas[i].mMaskTexName = 0;
  72.184 +		mBakedTextureDatas[i].mTextureIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((LLAvatarAppearanceDefines::EBakedTextureIndex)i);
  72.185 +	}
  72.186 +
  72.187 +	mIsBuilt = FALSE;
  72.188 +
  72.189 +	mNumCollisionVolumes = 0;
  72.190 +	mCollisionVolumes = NULL;
  72.191 +}
  72.192 +
  72.193 +// virtual
  72.194 +void LLAvatarAppearance::initInstance()
  72.195 +{
  72.196 +	//-------------------------------------------------------------------------
  72.197 +	// initialize joint, mesh and shape members
  72.198 +	//-------------------------------------------------------------------------
  72.199 +	mRoot = createAvatarJoint();
  72.200 +	mRoot->setName( "mRoot" );
  72.201 +
  72.202 +	for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().begin();
  72.203 +		 iter != LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().end();
  72.204 +		 ++iter)
  72.205 +	{
  72.206 +		const EMeshIndex mesh_index = iter->first;
  72.207 +		const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = iter->second;
  72.208 +		LLAvatarJoint* joint = createAvatarJoint();
  72.209 +		joint->setName(mesh_dict->mName);
  72.210 +		joint->setMeshID(mesh_index);
  72.211 +		mMeshLOD.push_back(joint);
  72.212 +		
  72.213 +		/* mHairLOD.setName("mHairLOD");
  72.214 +		   mHairMesh0.setName("mHairMesh0");
  72.215 +		   mHairMesh0.setMeshID(MESH_ID_HAIR);
  72.216 +		   mHairMesh1.setName("mHairMesh1"); */
  72.217 +		for (U32 lod = 0; lod < mesh_dict->mLOD; lod++)
  72.218 +		{
  72.219 +			LLAvatarJointMesh* mesh = createAvatarJointMesh();
  72.220 +			std::string mesh_name = "m" + mesh_dict->mName + boost::lexical_cast<std::string>(lod);
  72.221 +			// We pre-pended an m - need to capitalize first character for camelCase
  72.222 +			mesh_name[1] = toupper(mesh_name[1]);
  72.223 +			mesh->setName(mesh_name);
  72.224 +			mesh->setMeshID(mesh_index);
  72.225 +			mesh->setPickName(mesh_dict->mPickName);
  72.226 +			mesh->setIsTransparent(FALSE);
  72.227 +			switch((int)mesh_index)
  72.228 +			{
  72.229 +				case MESH_ID_HAIR:
  72.230 +					mesh->setIsTransparent(TRUE);
  72.231 +					break;
  72.232 +				case MESH_ID_SKIRT:
  72.233 +					mesh->setIsTransparent(TRUE);
  72.234 +					break;
  72.235 +				case MESH_ID_EYEBALL_LEFT:
  72.236 +				case MESH_ID_EYEBALL_RIGHT:
  72.237 +					mesh->setSpecular( LLColor4( 1.0f, 1.0f, 1.0f, 1.0f ), 1.f );
  72.238 +					break;
  72.239 +			}
  72.240 +			
  72.241 +			joint->mMeshParts.push_back(mesh);
  72.242 +		}
  72.243 +	}
  72.244 +
  72.245 +	//-------------------------------------------------------------------------
  72.246 +	// associate baked textures with meshes
  72.247 +	//-------------------------------------------------------------------------
  72.248 +	for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().begin();
  72.249 +		 iter != LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().end();
  72.250 +		 ++iter)
  72.251 +	{
  72.252 +		const EMeshIndex mesh_index = iter->first;
  72.253 +		const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = iter->second;
  72.254 +		const EBakedTextureIndex baked_texture_index = mesh_dict->mBakedID;
  72.255 +		// Skip it if there's no associated baked texture.
  72.256 +		if (baked_texture_index == BAKED_NUM_INDICES) continue;
  72.257 +		
  72.258 +		for (avatar_joint_mesh_list_t::iterator iter = mMeshLOD[mesh_index]->mMeshParts.begin();
  72.259 +			 iter != mMeshLOD[mesh_index]->mMeshParts.end(); 
  72.260 +			 ++iter)
  72.261 +		{
  72.262 +			LLAvatarJointMesh* mesh = (*iter);
  72.263 +			mBakedTextureDatas[(int)baked_texture_index].mJointMeshes.push_back(mesh);
  72.264 +		}
  72.265 +	}
  72.266 +
  72.267 +	buildCharacter();
  72.268 +
  72.269 +}
  72.270 +
  72.271 +// virtual
  72.272 +LLAvatarAppearance::~LLAvatarAppearance()
  72.273 +{
  72.274 +	deleteAndClear(mTexSkinColor);
  72.275 +	deleteAndClear(mTexHairColor);
  72.276 +	deleteAndClear(mTexEyeColor);
  72.277 +
  72.278 +	for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
  72.279 +	{
  72.280 +		deleteAndClear(mBakedTextureDatas[i].mTexLayerSet);
  72.281 +		mBakedTextureDatas[i].mJointMeshes.clear();
  72.282 +
  72.283 +		for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin();
  72.284 +			 iter2 != mBakedTextureDatas[i].mMaskedMorphs.end(); iter2++)
  72.285 +		{
  72.286 +			LLMaskedMorph* masked_morph = (*iter2);
  72.287 +			delete masked_morph;
  72.288 +		}
  72.289 +	}
  72.290 +
  72.291 +	if (mRoot) mRoot->removeAllChildren();
  72.292 +	mJointMap.clear();
  72.293 +
  72.294 +	clearSkeleton();
  72.295 +	deleteAndClearArray(mCollisionVolumes);
  72.296 +
  72.297 +	deleteAndClear(mTexSkinColor);
  72.298 +	deleteAndClear(mTexHairColor);
  72.299 +	deleteAndClear(mTexEyeColor);
  72.300 +
  72.301 +	std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer());
  72.302 +	mPolyMeshes.clear();
  72.303 +
  72.304 +	for (avatar_joint_list_t::iterator jointIter = mMeshLOD.begin();
  72.305 +		 jointIter != mMeshLOD.end(); 
  72.306 +		 ++jointIter)
  72.307 +	{
  72.308 +		LLAvatarJoint* joint = *jointIter;
  72.309 +		std::for_each(joint->mMeshParts.begin(), joint->mMeshParts.end(), DeletePointer());
  72.310 +		joint->mMeshParts.clear();
  72.311 +	}
  72.312 +	std::for_each(mMeshLOD.begin(), mMeshLOD.end(), DeletePointer());
  72.313 +	mMeshLOD.clear();
  72.314 +}
  72.315 +
  72.316 +//static
  72.317 +void LLAvatarAppearance::initClass()
  72.318 +{
  72.319 +	std::string xmlFile;
  72.320 +
  72.321 +	xmlFile = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR) + "_lad.xml";
  72.322 +	BOOL success = sXMLTree.parseFile( xmlFile, FALSE );
  72.323 +	if (!success)
  72.324 +	{
  72.325 +		llerrs << "Problem reading avatar configuration file:" << xmlFile << llendl;
  72.326 +	}
  72.327 +
  72.328 +	// now sanity check xml file
  72.329 +	LLXmlTreeNode* root = sXMLTree.getRoot();
  72.330 +	if (!root) 
  72.331 +	{
  72.332 +		llerrs << "No root node found in avatar configuration file: " << xmlFile << llendl;
  72.333 +		return;
  72.334 +	}
  72.335 +
  72.336 +	//-------------------------------------------------------------------------
  72.337 +	// <linden_avatar version="1.0"> (root)
  72.338 +	//-------------------------------------------------------------------------
  72.339 +	if( !root->hasName( "linden_avatar" ) )
  72.340 +	{
  72.341 +		llerrs << "Invalid avatar file header: " << xmlFile << llendl;
  72.342 +	}
  72.343 +	
  72.344 +	std::string version;
  72.345 +	static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
  72.346 +	if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
  72.347 +	{
  72.348 +		llerrs << "Invalid avatar file version: " << version << " in file: " << xmlFile << llendl;
  72.349 +	}
  72.350 +
  72.351 +	S32 wearable_def_version = 1;
  72.352 +	static LLStdStringHandle wearable_definition_version_string = LLXmlTree::addAttributeString("wearable_definition_version");
  72.353 +	root->getFastAttributeS32( wearable_definition_version_string, wearable_def_version );
  72.354 +	LLWearable::setCurrentDefinitionVersion( wearable_def_version );
  72.355 +
  72.356 +	std::string mesh_file_name;
  72.357 +
  72.358 +	LLXmlTreeNode* skeleton_node = root->getChildByName( "skeleton" );
  72.359 +	if (!skeleton_node)
  72.360 +	{
  72.361 +		llerrs << "No skeleton in avatar configuration file: " << xmlFile << llendl;
  72.362 +		return;
  72.363 +	}
  72.364 +	
  72.365 +	std::string skeleton_file_name;
  72.366 +	static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
  72.367 +	if (!skeleton_node->getFastAttributeString(file_name_string, skeleton_file_name))
  72.368 +	{
  72.369 +		llerrs << "No file name in skeleton node in avatar config file: " << xmlFile << llendl;
  72.370 +	}
  72.371 +	
  72.372 +	std::string skeleton_path;
  72.373 +	skeleton_path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,skeleton_file_name);
  72.374 +	if (!parseSkeletonFile(skeleton_path))
  72.375 +	{
  72.376 +		llerrs << "Error parsing skeleton file: " << skeleton_path << llendl;
  72.377 +	}
  72.378 +
  72.379 +	// Process XML data
  72.380 +
  72.381 +	// avatar_skeleton.xml
  72.382 +	if (sAvatarSkeletonInfo)
  72.383 +	{ //this can happen if a login attempt failed
  72.384 +		delete sAvatarSkeletonInfo;
  72.385 +	}
  72.386 +	sAvatarSkeletonInfo = new LLAvatarSkeletonInfo;
  72.387 +	if (!sAvatarSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot()))
  72.388 +	{
  72.389 +		llerrs << "Error parsing skeleton XML file: " << skeleton_path << llendl;
  72.390 +	}
  72.391 +	// parse avatar_lad.xml
  72.392 +	if (sAvatarXmlInfo)
  72.393 +	{ //this can happen if a login attempt failed
  72.394 +		deleteAndClear(sAvatarXmlInfo);
  72.395 +	}
  72.396 +	sAvatarXmlInfo = new LLAvatarXmlInfo;
  72.397 +	if (!sAvatarXmlInfo->parseXmlSkeletonNode(root))
  72.398 +	{
  72.399 +		llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
  72.400 +	}
  72.401 +	if (!sAvatarXmlInfo->parseXmlMeshNodes(root))
  72.402 +	{
  72.403 +		llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
  72.404 +	}
  72.405 +	if (!sAvatarXmlInfo->parseXmlColorNodes(root))
  72.406 +	{
  72.407 +		llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
  72.408 +	}
  72.409 +	if (!sAvatarXmlInfo->parseXmlLayerNodes(root))
  72.410 +	{
  72.411 +		llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
  72.412 +	}
  72.413 +	if (!sAvatarXmlInfo->parseXmlDriverNodes(root))
  72.414 +	{
  72.415 +		llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
  72.416 +	}
  72.417 +	if (!sAvatarXmlInfo->parseXmlMorphNodes(root))
  72.418 +	{
  72.419 +		llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
  72.420 +	}
  72.421 +}
  72.422 +
  72.423 +void LLAvatarAppearance::cleanupClass()
  72.424 +{
  72.425 +	deleteAndClear(sAvatarXmlInfo);
  72.426 +	// *TODO: What about sAvatarSkeletonInfo ???
  72.427 +	sSkeletonXMLTree.cleanup();
  72.428 +	sXMLTree.cleanup();
  72.429 +}
  72.430 +
  72.431 +using namespace LLAvatarAppearanceDefines;
  72.432 +
  72.433 +//------------------------------------------------------------------------
  72.434 +// The viewer can only suggest a good size for the agent,
  72.435 +// the simulator will keep it inside a reasonable range.
  72.436 +void LLAvatarAppearance::computeBodySize() 
  72.437 +{
  72.438 +	LLVector3 pelvis_scale = mPelvisp->getScale();
  72.439 +
  72.440 +	// some of the joints have not been cached
  72.441 +	LLVector3 skull = mSkullp->getPosition();
  72.442 +	//LLVector3 skull_scale = mSkullp->getScale();
  72.443 +
  72.444 +	LLVector3 neck = mNeckp->getPosition();
  72.445 +	LLVector3 neck_scale = mNeckp->getScale();
  72.446 +
  72.447 +	LLVector3 chest = mChestp->getPosition();
  72.448 +	LLVector3 chest_scale = mChestp->getScale();
  72.449 +
  72.450 +	// the rest of the joints have been cached
  72.451 +	LLVector3 head = mHeadp->getPosition();
  72.452 +	LLVector3 head_scale = mHeadp->getScale();
  72.453 +
  72.454 +	LLVector3 torso = mTorsop->getPosition();
  72.455 +	LLVector3 torso_scale = mTorsop->getScale();
  72.456 +
  72.457 +	LLVector3 hip = mHipLeftp->getPosition();
  72.458 +	LLVector3 hip_scale = mHipLeftp->getScale();
  72.459 +
  72.460 +	LLVector3 knee = mKneeLeftp->getPosition();
  72.461 +	LLVector3 knee_scale = mKneeLeftp->getScale();
  72.462 +
  72.463 +	LLVector3 ankle = mAnkleLeftp->getPosition();
  72.464 +	LLVector3 ankle_scale = mAnkleLeftp->getScale();
  72.465 +
  72.466 +	LLVector3 foot  = mFootLeftp->getPosition();
  72.467 +
  72.468 +	F32 old_offset = mAvatarOffset.mV[VZ];
  72.469 +
  72.470 +	mAvatarOffset.mV[VZ] = getVisualParamWeight(AVATAR_HOVER);
  72.471 +
  72.472 +	mPelvisToFoot = hip.mV[VZ] * pelvis_scale.mV[VZ] -
  72.473 +				 	knee.mV[VZ] * hip_scale.mV[VZ] -
  72.474 +				 	ankle.mV[VZ] * knee_scale.mV[VZ] -
  72.475 +				 	foot.mV[VZ] * ankle_scale.mV[VZ];
  72.476 +
  72.477 +	LLVector3 new_body_size;
  72.478 +	new_body_size.mV[VZ] = mPelvisToFoot +
  72.479 +					   // the sqrt(2) correction below is an approximate
  72.480 +					   // correction to get to the top of the head
  72.481 +					   F_SQRT2 * (skull.mV[VZ] * head_scale.mV[VZ]) + 
  72.482 +					   head.mV[VZ] * neck_scale.mV[VZ] + 
  72.483 +					   neck.mV[VZ] * chest_scale.mV[VZ] + 
  72.484 +					   chest.mV[VZ] * torso_scale.mV[VZ] + 
  72.485 +					   torso.mV[VZ] * pelvis_scale.mV[VZ]; 
  72.486 +
  72.487 +	// TODO -- measure the real depth and width
  72.488 +	new_body_size.mV[VX] = DEFAULT_AGENT_DEPTH;
  72.489 +	new_body_size.mV[VY] = DEFAULT_AGENT_WIDTH;
  72.490 +
  72.491 +	mAvatarOffset.mV[VX] = 0.0f;
  72.492 +	mAvatarOffset.mV[VY] = 0.0f;
  72.493 +
  72.494 +	// Certain configurations of avatars can force the overall height (with offset) to go negative.
  72.495 +	// Enforce a constraint to make sure we don't go below 0.1 meters.
  72.496 +	// Camera positioning and other things start to break down when your avatar is "walking" while being fully underground
  72.497 +	if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 0.1f) 
  72.498 +	{
  72.499 +		mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 0.11f); // avoid floating point rounding making the above check continue to fail.
  72.500 +
  72.501 +		llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 0.1f);
  72.502 +
  72.503 +		if (mWearableData && isSelf()) 
  72.504 +		{
  72.505 +			LLWearable* shape = mWearableData->getWearable(LLWearableType::WT_SHAPE, 0);
  72.506 +			if (shape) 
  72.507 +			{
  72.508 +				shape->setVisualParamWeight(AVATAR_HOVER, mAvatarOffset.mV[VZ], false);
  72.509 +			}
  72.510 +		}
  72.511 +	}
  72.512 +
  72.513 +	if (new_body_size != mBodySize || old_offset != mAvatarOffset.mV[VZ])
  72.514 +	{
  72.515 +		mBodySize = new_body_size;
  72.516 +		bodySizeChanged();
  72.517 +	}
  72.518 +}
  72.519 +
  72.520 +//-----------------------------------------------------------------------------
  72.521 +// parseSkeletonFile()
  72.522 +//-----------------------------------------------------------------------------
  72.523 +BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
  72.524 +{
  72.525 +	//-------------------------------------------------------------------------
  72.526 +	// parse the file
  72.527 +	//-------------------------------------------------------------------------
  72.528 +	BOOL parsesuccess = sSkeletonXMLTree.parseFile( filename, FALSE );
  72.529 +
  72.530 +	if (!parsesuccess)
  72.531 +	{
  72.532 +		llerrs << "Can't parse skeleton file: " << filename << llendl;
  72.533 +		return FALSE;
  72.534 +	}
  72.535 +
  72.536 +	// now sanity check xml file
  72.537 +	LLXmlTreeNode* root = sSkeletonXMLTree.getRoot();
  72.538 +	if (!root) 
  72.539 +	{
  72.540 +		llerrs << "No root node found in avatar skeleton file: " << filename << llendl;
  72.541 +		return FALSE;
  72.542 +	}
  72.543 +
  72.544 +	if( !root->hasName( "linden_skeleton" ) )
  72.545 +	{
  72.546 +		llerrs << "Invalid avatar skeleton file header: " << filename << llendl;
  72.547 +		return FALSE;
  72.548 +	}
  72.549 +
  72.550 +	std::string version;
  72.551 +	static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
  72.552 +	if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
  72.553 +	{
  72.554 +		llerrs << "Invalid avatar skeleton file version: " << version << " in file: " << filename << llendl;
  72.555 +		return FALSE;
  72.556 +	}
  72.557 +
  72.558 +	return TRUE;
  72.559 +}
  72.560 +
  72.561 +//-----------------------------------------------------------------------------
  72.562 +// setupBone()
  72.563 +//-----------------------------------------------------------------------------
  72.564 +BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 &volume_num, S32 &joint_num)
  72.565 +{
  72.566 +	LLJoint* joint = NULL;
  72.567 +
  72.568 +	if (info->mIsJoint)
  72.569 +	{
  72.570 +		joint = getCharacterJoint(joint_num);
  72.571 +		if (!joint)
  72.572 +		{
  72.573 +			llwarns << "Too many bones" << llendl;
  72.574 +			return FALSE;
  72.575 +		}
  72.576 +		joint->setName( info->mName );
  72.577 +	}
  72.578 +	else // collision volume
  72.579 +	{
  72.580 +		if (volume_num >= (S32)mNumCollisionVolumes)
  72.581 +		{
  72.582 +			llwarns << "Too many bones" << llendl;
  72.583 +			return FALSE;
  72.584 +		}
  72.585 +		joint = (&mCollisionVolumes[volume_num]);
  72.586 +		joint->setName( info->mName );
  72.587 +	}
  72.588 +
  72.589 +	// add to parent
  72.590 +	if (parent)
  72.591 +	{
  72.592 +		parent->addChild( joint );
  72.593 +	}
  72.594 +
  72.595 +	joint->setPosition(info->mPos);
  72.596 +	joint->setRotation(mayaQ(info->mRot.mV[VX], info->mRot.mV[VY],
  72.597 +							 info->mRot.mV[VZ], LLQuaternion::XYZ));
  72.598 +	joint->setScale(info->mScale);
  72.599 +
  72.600 +	joint->setDefaultFromCurrentXform();
  72.601 +	
  72.602 +	if (info->mIsJoint)
  72.603 +	{
  72.604 +		joint->setSkinOffset( info->mPivot );
  72.605 +		joint_num++;
  72.606 +	}
  72.607 +	else // collision volume
  72.608 +	{
  72.609 +		volume_num++;
  72.610 +	}
  72.611 +
  72.612 +	// setup children
  72.613 +	LLAvatarBoneInfo::child_list_t::const_iterator iter;
  72.614 +	for (iter = info->mChildList.begin(); iter != info->mChildList.end(); ++iter)
  72.615 +	{
  72.616 +		LLAvatarBoneInfo *child_info = *iter;
  72.617 +		if (!setupBone(child_info, joint, volume_num, joint_num))
  72.618 +		{
  72.619 +			return FALSE;
  72.620 +		}
  72.621 +	}
  72.622 +
  72.623 +	return TRUE;
  72.624 +}
  72.625 +
  72.626 +//-----------------------------------------------------------------------------
  72.627 +// allocateCharacterJoints()
  72.628 +//-----------------------------------------------------------------------------
  72.629 +BOOL LLAvatarAppearance::allocateCharacterJoints( U32 num )
  72.630 +{
  72.631 +	clearSkeleton();
  72.632 +
  72.633 +	for(S32 joint_num = 0; joint_num < (S32)num; joint_num++)
  72.634 +	{
  72.635 +		mSkeleton.push_back(createAvatarJoint(joint_num));
  72.636 +	}
  72.637 +
  72.638 +	return TRUE;
  72.639 +}
  72.640 +
  72.641 +
  72.642 +//-----------------------------------------------------------------------------
  72.643 +// buildSkeleton()
  72.644 +//-----------------------------------------------------------------------------
  72.645 +BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
  72.646 +{
  72.647 +	//-------------------------------------------------------------------------
  72.648 +	// allocate joints
  72.649 +	//-------------------------------------------------------------------------
  72.650 +	if (!allocateCharacterJoints(info->mNumBones))
  72.651 +	{
  72.652 +		llerrs << "Can't allocate " << info->mNumBones << " joints" << llendl;
  72.653 +		return FALSE;
  72.654 +	}
  72.655 +	
  72.656 +	//-------------------------------------------------------------------------
  72.657 +	// allocate volumes
  72.658 +	//-------------------------------------------------------------------------
  72.659 +	if (info->mNumCollisionVolumes)
  72.660 +	{
  72.661 +		if (!allocateCollisionVolumes(info->mNumCollisionVolumes))
  72.662 +		{
  72.663 +			llerrs << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << llendl;
  72.664 +			return FALSE;
  72.665 +		}
  72.666 +	}
  72.667 +
  72.668 +	S32 current_joint_num = 0;
  72.669 +	S32 current_volume_num = 0;
  72.670 +	LLAvatarSkeletonInfo::bone_info_list_t::const_iterator iter;
  72.671 +	for (iter = info->mBoneInfoList.begin(); iter != info->mBoneInfoList.end(); ++iter)
  72.672 +	{
  72.673 +		LLAvatarBoneInfo *info = *iter;
  72.674 +		if (!setupBone(info, NULL, current_volume_num, current_joint_num))
  72.675 +		{
  72.676 +			llerrs << "Error parsing bone in skeleton file" << llendl;
  72.677 +			return FALSE;
  72.678 +		}
  72.679 +	}
  72.680 +
  72.681 +	return TRUE;
  72.682 +}
  72.683 +
  72.684 +//-----------------------------------------------------------------------------
  72.685 +// clearSkeleton()
  72.686 +//-----------------------------------------------------------------------------
  72.687 +void LLAvatarAppearance::clearSkeleton()
  72.688 +{
  72.689 +	std::for_each(mSkeleton.begin(), mSkeleton.end(), DeletePointer());
  72.690 +	mSkeleton.clear();
  72.691 +}
  72.692 +
  72.693 +//-----------------------------------------------------------------------------
  72.694 +// LLAvatarAppearance::buildCharacter()
  72.695 +// Deferred initialization and rebuild of the avatar.
  72.696 +//-----------------------------------------------------------------------------
  72.697 +void LLAvatarAppearance::buildCharacter()
  72.698 +{
  72.699 +	//-------------------------------------------------------------------------
  72.700 +	// remove all references to our existing skeleton
  72.701 +	// so we can rebuild it
  72.702 +	//-------------------------------------------------------------------------
  72.703 +	flushAllMotions();
  72.704 +
  72.705 +	//-------------------------------------------------------------------------
  72.706 +	// remove all of mRoot's children
  72.707 +	//-------------------------------------------------------------------------
  72.708 +	mRoot->removeAllChildren();
  72.709 +	mJointMap.clear();
  72.710 +	mIsBuilt = FALSE;
  72.711 +
  72.712 +	//-------------------------------------------------------------------------
  72.713 +	// clear mesh data
  72.714 +	//-------------------------------------------------------------------------
  72.715 +	for (avatar_joint_list_t::iterator jointIter = mMeshLOD.begin();
  72.716 +		 jointIter != mMeshLOD.end(); ++jointIter)
  72.717 +	{
  72.718 +		LLAvatarJoint* joint = *jointIter;
  72.719 +		for (avatar_joint_mesh_list_t::iterator meshIter = joint->mMeshParts.begin();
  72.720 +			 meshIter != joint->mMeshParts.end(); ++meshIter)
  72.721 +		{
  72.722 +			LLAvatarJointMesh * mesh = *meshIter;
  72.723 +			mesh->setMesh(NULL);
  72.724 +		}
  72.725 +	}
  72.726 +
  72.727 +	//-------------------------------------------------------------------------
  72.728 +	// (re)load our skeleton and meshes
  72.729 +	//-------------------------------------------------------------------------
  72.730 +	LLTimer timer;
  72.731 +
  72.732 +	BOOL status = loadAvatar();
  72.733 +	stop_glerror();
  72.734 +
  72.735 +// 	gPrintMessagesThisFrame = TRUE;
  72.736 +	lldebugs << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << llendl;
  72.737 +
  72.738 +	if (!status)
  72.739 +	{
  72.740 +		if (isSelf())
  72.741 +		{
  72.742 +			llerrs << "Unable to load user's avatar" << llendl;
  72.743 +		}
  72.744 +		else
  72.745 +		{
  72.746 +			llwarns << "Unable to load other's avatar" << llendl;
  72.747 +		}
  72.748 +		return;
  72.749 +	}
  72.750 +
  72.751 +	//-------------------------------------------------------------------------
  72.752 +	// initialize "well known" joint pointers
  72.753 +	//-------------------------------------------------------------------------
  72.754 +	mPelvisp		= mRoot->findJoint("mPelvis");
  72.755 +	mTorsop			= mRoot->findJoint("mTorso");
  72.756 +	mChestp			= mRoot->findJoint("mChest");
  72.757 +	mNeckp			= mRoot->findJoint("mNeck");
  72.758 +	mHeadp			= mRoot->findJoint("mHead");
  72.759 +	mSkullp			= mRoot->findJoint("mSkull");
  72.760 +	mHipLeftp		= mRoot->findJoint("mHipLeft");
  72.761 +	mHipRightp		= mRoot->findJoint("mHipRight");
  72.762 +	mKneeLeftp		= mRoot->findJoint("mKneeLeft");
  72.763 +	mKneeRightp		= mRoot->findJoint("mKneeRight");
  72.764 +	mAnkleLeftp		= mRoot->findJoint("mAnkleLeft");
  72.765 +	mAnkleRightp	= mRoot->findJoint("mAnkleRight");
  72.766 +	mFootLeftp		= mRoot->findJoint("mFootLeft");
  72.767 +	mFootRightp		= mRoot->findJoint("mFootRight");
  72.768 +	mWristLeftp		= mRoot->findJoint("mWristLeft");
  72.769 +	mWristRightp	= mRoot->findJoint("mWristRight");
  72.770 +	mEyeLeftp		= mRoot->findJoint("mEyeLeft");
  72.771 +	mEyeRightp		= mRoot->findJoint("mEyeRight");
  72.772 +
  72.773 +	//-------------------------------------------------------------------------
  72.774 +	// Make sure "well known" pointers exist
  72.775 +	//-------------------------------------------------------------------------
  72.776 +	if (!(mPelvisp && 
  72.777 +		  mTorsop &&
  72.778 +		  mChestp &&
  72.779 +		  mNeckp &&
  72.780 +		  mHeadp &&
  72.781 +		  mSkullp &&
  72.782 +		  mHipLeftp &&
  72.783 +		  mHipRightp &&
  72.784 +		  mKneeLeftp &&
  72.785 +		  mKneeRightp &&
  72.786 +		  mAnkleLeftp &&
  72.787 +		  mAnkleRightp &&
  72.788 +		  mFootLeftp &&
  72.789 +		  mFootRightp &&
  72.790 +		  mWristLeftp &&
  72.791 +		  mWristRightp &&
  72.792 +		  mEyeLeftp &&
  72.793 +		  mEyeRightp))
  72.794 +	{
  72.795 +		llerrs << "Failed to create avatar." << llendl;
  72.796 +		return;
  72.797 +	}
  72.798 +
  72.799 +	//-------------------------------------------------------------------------
  72.800 +	// initialize the pelvis
  72.801 +	//-------------------------------------------------------------------------
  72.802 +	mPelvisp->setPosition( LLVector3(0.0f, 0.0f, 0.0f) );
  72.803 +
  72.804 +	mIsBuilt = TRUE;
  72.805 +	stop_glerror();
  72.806 +
  72.807 +}
  72.808 +
  72.809 +BOOL LLAvatarAppearance::loadAvatar()
  72.810 +{
  72.811 +// 	LLFastTimer t(FTM_LOAD_AVATAR);
  72.812 +	
  72.813 +	// avatar_skeleton.xml
  72.814 +	if( !buildSkeleton(sAvatarSkeletonInfo) )
  72.815 +	{
  72.816 +		llwarns << "avatar file: buildSkeleton() failed" << llendl;
  72.817 +		return FALSE;
  72.818 +	}
  72.819 +
  72.820 +	// avatar_lad.xml : <skeleton>
  72.821 +	if( !loadSkeletonNode() )
  72.822 +	{
  72.823 +		llwarns << "avatar file: loadNodeSkeleton() failed" << llendl;
  72.824 +		return FALSE;
  72.825 +	}
  72.826 +	
  72.827 +	// avatar_lad.xml : <mesh>
  72.828 +	if( !loadMeshNodes() )
  72.829 +	{
  72.830 +		llwarns << "avatar file: loadNodeMesh() failed" << llendl;
  72.831 +		return FALSE;
  72.832 +	}
  72.833 +	
  72.834 +	// avatar_lad.xml : <global_color>
  72.835 +	if( sAvatarXmlInfo->mTexSkinColorInfo )
  72.836 +	{
  72.837 +		mTexSkinColor = new LLTexGlobalColor( this );
  72.838 +		if( !mTexSkinColor->setInfo( sAvatarXmlInfo->mTexSkinColorInfo ) )
  72.839 +		{
  72.840 +			llwarns << "avatar file: mTexSkinColor->setInfo() failed" << llendl;
  72.841 +			return FALSE;
  72.842 +		}
  72.843 +	}
  72.844 +	else
  72.845 +	{
  72.846 +		llwarns << "<global_color> name=\"skin_color\" not found" << llendl;
  72.847 +		return FALSE;
  72.848 +	}
  72.849 +	if( sAvatarXmlInfo->mTexHairColorInfo )
  72.850 +	{
  72.851 +		mTexHairColor = new LLTexGlobalColor( this );
  72.852 +		if( !mTexHairColor->setInfo( sAvatarXmlInfo->mTexHairColorInfo ) )
  72.853 +		{
  72.854 +			llwarns << "avatar file: mTexHairColor->setInfo() failed" << llendl;
  72.855 +			return FALSE;
  72.856 +		}
  72.857 +	}
  72.858 +	else
  72.859 +	{
  72.860 +		llwarns << "<global_color> name=\"hair_color\" not found" << llendl;
  72.861 +		return FALSE;
  72.862 +	}
  72.863 +	if( sAvatarXmlInfo->mTexEyeColorInfo )
  72.864 +	{
  72.865 +		mTexEyeColor = new LLTexGlobalColor( this );
  72.866 +		if( !mTexEyeColor->setInfo( sAvatarXmlInfo->mTexEyeColorInfo ) )
  72.867 +		{
  72.868 +			llwarns << "avatar file: mTexEyeColor->setInfo() failed" << llendl;
  72.869 +			return FALSE;
  72.870 +		}
  72.871 +	}
  72.872 +	else
  72.873 +	{
  72.874 +		llwarns << "<global_color> name=\"eye_color\" not found" << llendl;
  72.875 +		return FALSE;
  72.876 +	}
  72.877 +	
  72.878 +	// avatar_lad.xml : <layer_set>
  72.879 +	if (sAvatarXmlInfo->mLayerInfoList.empty())
  72.880 +	{
  72.881 +		llwarns << "avatar file: missing <layer_set> node" << llendl;
  72.882 +		return FALSE;
  72.883 +	}
  72.884 +
  72.885 +	if (sAvatarXmlInfo->mMorphMaskInfoList.empty())
  72.886 +	{
  72.887 +		llwarns << "avatar file: missing <morph_masks> node" << llendl;
  72.888 +		return FALSE;
  72.889 +	}
  72.890 +
  72.891 +	// avatar_lad.xml : <morph_masks>
  72.892 +	for (LLAvatarXmlInfo::morph_info_list_t::iterator iter = sAvatarXmlInfo->mMorphMaskInfoList.begin();
  72.893 +		 iter != sAvatarXmlInfo->mMorphMaskInfoList.end();
  72.894 +		 ++iter)
  72.895 +	{
  72.896 +		LLAvatarXmlInfo::LLAvatarMorphInfo *info = *iter;
  72.897 +
  72.898 +		EBakedTextureIndex baked = LLAvatarAppearanceDictionary::findBakedByRegionName(info->mRegion); 
  72.899 +		if (baked != BAKED_NUM_INDICES)
  72.900 +		{
  72.901 +			LLVisualParam* morph_param;
  72.902 +			const std::string *name = &info->mName;
  72.903 +			morph_param = getVisualParam(name->c_str());
  72.904 +			if (morph_param)
  72.905 +			{
  72.906 +				BOOL invert = info->mInvert;
  72.907 +				addMaskedMorph(baked, morph_param, invert, info->mLayer);
  72.908 +			}
  72.909 +		}
  72.910 +
  72.911 +	}
  72.912 +
  72.913 +	loadLayersets();
  72.914 +	
  72.915 +	// avatar_lad.xml : <driver_parameters>
  72.916 +	for (LLAvatarXmlInfo::driver_info_list_t::iterator iter = sAvatarXmlInfo->mDriverInfoList.begin();
  72.917 +		 iter != sAvatarXmlInfo->mDriverInfoList.end(); 
  72.918 +		 ++iter)
  72.919 +	{
  72.920 +		LLDriverParamInfo *info = *iter;
  72.921 +		LLDriverParam* driver_param = new LLDriverParam( this );
  72.922 +		if (driver_param->setInfo(info))
  72.923 +		{
  72.924 +			addVisualParam( driver_param );
  72.925 +			driver_param->setParamLocation(isSelf() ? LOC_AV_SELF : LOC_AV_OTHER);
  72.926 +			LLVisualParam*(LLAvatarAppearance::*avatar_function)(S32)const = &LLAvatarAppearance::getVisualParam; 
  72.927 +			if( !driver_param->linkDrivenParams(boost::bind(avatar_function,(LLAvatarAppearance*)this,_1 ), false))
  72.928 +			{
  72.929 +				llwarns << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << llendl;
  72.930 +				continue;
  72.931 +			}
  72.932 +		}
  72.933 +		else
  72.934 +		{
  72.935 +			delete driver_param;
  72.936 +			llwarns << "avatar file: driver_param->parseData() failed" << llendl;
  72.937 +			return FALSE;
  72.938 +		}
  72.939 +	}
  72.940 +
  72.941 +	
  72.942 +	return TRUE;
  72.943 +}
  72.944 +
  72.945 +//-----------------------------------------------------------------------------
  72.946 +// loadSkeletonNode(): loads <skeleton> node from XML tree
  72.947 +//-----------------------------------------------------------------------------
  72.948 +BOOL LLAvatarAppearance::loadSkeletonNode ()
  72.949 +{
  72.950 +	mRoot->addChild( mSkeleton[0] );
  72.951 +
  72.952 +	// make meshes children before calling parent version of the function
  72.953 +	for (avatar_joint_list_t::iterator iter = mMeshLOD.begin();
  72.954 +		 iter != mMeshLOD.end(); 
  72.955 +		 ++iter)
  72.956 +	{
  72.957 +		LLAvatarJoint *joint = *iter;
  72.958 +		joint->mUpdateXform = FALSE;
  72.959 +		joint->setMeshesToChildren();
  72.960 +	}
  72.961 +
  72.962 +	mRoot->addChild(mMeshLOD[MESH_ID_HEAD]);
  72.963 +	mRoot->addChild(mMeshLOD[MESH_ID_EYELASH]);
  72.964 +	mRoot->addChild(mMeshLOD[MESH_ID_UPPER_BODY]);
  72.965 +	mRoot->addChild(mMeshLOD[MESH_ID_LOWER_BODY]);
  72.966 +	mRoot->addChild(mMeshLOD[MESH_ID_SKIRT]);
  72.967 +	mRoot->addChild(mMeshLOD[MESH_ID_HEAD]);
  72.968 +
  72.969 +	LLAvatarJoint *skull = (LLAvatarJoint*)mRoot->findJoint("mSkull");
  72.970 +	if (skull)
  72.971 +	{
  72.972 +		skull->addChild(mMeshLOD[MESH_ID_HAIR] );
  72.973 +	}
  72.974 +
  72.975 +	LLAvatarJoint *eyeL = (LLAvatarJoint*)mRoot->findJoint("mEyeLeft");
  72.976 +	if (eyeL)
  72.977 +	{
  72.978 +		eyeL->addChild( mMeshLOD[MESH_ID_EYEBALL_LEFT] );
  72.979 +	}
  72.980 +
  72.981 +	LLAvatarJoint *eyeR = (LLAvatarJoint*)mRoot->findJoint("mEyeRight");
  72.982 +	if (eyeR)
  72.983 +	{
  72.984 +		eyeR->addChild( mMeshLOD[MESH_ID_EYEBALL_RIGHT] );
  72.985 +	}
  72.986 +
  72.987 +	// SKELETAL DISTORTIONS
  72.988 +	{
  72.989 +		LLAvatarXmlInfo::skeletal_distortion_info_list_t::iterator iter;
  72.990 +		for (iter = sAvatarXmlInfo->mSkeletalDistortionInfoList.begin();
  72.991 +			 iter != sAvatarXmlInfo->mSkeletalDistortionInfoList.end(); 
  72.992 +			 ++iter)
  72.993 +		{
  72.994 +			LLPolySkeletalDistortionInfo *info = (LLPolySkeletalDistortionInfo*)*iter;
  72.995 +			LLPolySkeletalDistortion *param = new LLPolySkeletalDistortion(this);
  72.996 +			if (!param->setInfo(info))
  72.997 +			{
  72.998 +				delete param;
  72.999 +				return FALSE;
 72.1000 +			}
 72.1001 +			else
 72.1002 +			{
 72.1003 +				addVisualParam(param);
 72.1004 +				param->setParamLocation(isSelf() ? LOC_AV_SELF : LOC_AV_OTHER);
 72.1005 +			}				
 72.1006 +		}
 72.1007 +	}
 72.1008 +
 72.1009 +
 72.1010 +	return TRUE;
 72.1011 +}
 72.1012 +
 72.1013 +//-----------------------------------------------------------------------------
 72.1014 +// loadMeshNodes(): loads <mesh> nodes from XML tree
 72.1015 +//-----------------------------------------------------------------------------
 72.1016 +BOOL LLAvatarAppearance::loadMeshNodes()
 72.1017 +{
 72.1018 +	for (LLAvatarXmlInfo::mesh_info_list_t::const_iterator meshinfo_iter = sAvatarXmlInfo->mMeshInfoList.begin();
 72.1019 +		 meshinfo_iter != sAvatarXmlInfo->mMeshInfoList.end(); 
 72.1020 +		 ++meshinfo_iter)
 72.1021 +	{
 72.1022 +		const LLAvatarXmlInfo::LLAvatarMeshInfo *info = *meshinfo_iter;
 72.1023 +		const std::string &type = info->mType;
 72.1024 +		S32 lod = info->mLOD;
 72.1025 +
 72.1026 +		LLAvatarJointMesh* mesh = NULL;
 72.1027 +		U8 mesh_id = 0;
 72.1028 +		BOOL found_mesh_id = FALSE;
 72.1029 +
 72.1030 +		/* if (type == "hairMesh")
 72.1031 +			switch(lod)
 72.1032 +			  case 0:
 72.1033 +				mesh = &mHairMesh0; */
 72.1034 +		for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator mesh_iter = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().begin();
 72.1035 +			 mesh_iter != LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().end();
 72.1036 +			 ++mesh_iter)
 72.1037 +		{
 72.1038 +			const EMeshIndex mesh_index = mesh_iter->first;
 72.1039 +			const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = mesh_iter->second;
 72.1040 +			if (type.compare(mesh_dict->mName) == 0)
 72.1041 +			{
 72.1042 +				mesh_id = mesh_index;
 72.1043 +				found_mesh_id = TRUE;
 72.1044 +				break;
 72.1045 +			}
 72.1046 +		}
 72.1047 +
 72.1048 +		if (found_mesh_id)
 72.1049 +		{
 72.1050 +			if (lod < (S32)mMeshLOD[mesh_id]->mMeshParts.size())
 72.1051 +			{
 72.1052 +				mesh = mMeshLOD[mesh_id]->mMeshParts[lod];
 72.1053 +			}
 72.1054 +			else
 72.1055 +			{
 72.1056 +				llwarns << "Avatar file: <mesh> has invalid lod setting " << lod << llendl;
 72.1057 +				return FALSE;
 72.1058 +			}
 72.1059 +		}
 72.1060 +		else 
 72.1061 +		{
 72.1062 +			llwarns << "Ignoring unrecognized mesh type: " << type << llendl;
 72.1063 +			return FALSE;
 72.1064 +		}
 72.1065 +
 72.1066 +		//	llinfos << "Parsing mesh data for " << type << "..." << llendl;
 72.1067 +
 72.1068 +		// If this isn't set to white (1.0), avatars will *ALWAYS* be darker than their surroundings.
 72.1069 +		// Do not touch!!!
 72.1070 +		mesh->setColor( LLColor4::white );
 72.1071 +
 72.1072 +		LLPolyMesh *poly_mesh = NULL;
 72.1073 +
 72.1074 +		if (!info->mReferenceMeshName.empty())
 72.1075 +		{
 72.1076 +			polymesh_map_t::const_iterator polymesh_iter = mPolyMeshes.find(info->mReferenceMeshName);
 72.1077 +			if (polymesh_iter != mPolyMeshes.end())
 72.1078 +			{
 72.1079 +				poly_mesh = LLPolyMesh::getMesh(info->mMeshFileName, polymesh_iter->second);
 72.1080 +				poly_mesh->setAvatar(this);
 72.1081 +			}
 72.1082 +			else
 72.1083 +			{
 72.1084 +				// This should never happen
 72.1085 +				LL_WARNS("Avatar") << "Could not find avatar mesh: " << info->mReferenceMeshName << LL_ENDL;
 72.1086 +			}
 72.1087 +		}
 72.1088 +		else
 72.1089 +		{
 72.1090 +			poly_mesh = LLPolyMesh::getMesh(info->mMeshFileName);
 72.1091 +			poly_mesh->setAvatar(this);
 72.1092 +		}
 72.1093 +
 72.1094 +		if( !poly_mesh )
 72.1095 +		{
 72.1096 +			llwarns << "Failed to load mesh of type " << type << llendl;
 72.1097 +			return FALSE;
 72.1098 +		}
 72.1099 +
 72.1100 +		// Multimap insert
 72.1101 +		mPolyMeshes.insert(std::make_pair(info->mMeshFileName, poly_mesh));
 72.1102 +	
 72.1103 +		mesh->setMesh( poly_mesh );
 72.1104 +		mesh->setLOD( info->mMinPixelArea );
 72.1105 +
 72.1106 +		for (LLAvatarXmlInfo::LLAvatarMeshInfo::morph_info_list_t::const_iterator xmlinfo_iter = info->mPolyMorphTargetInfoList.begin();
 72.1107 +			 xmlinfo_iter != info->mPolyMorphTargetInfoList.end(); 
 72.1108 +			 ++xmlinfo_iter)
 72.1109 +		{
 72.1110 +			const LLAvatarXmlInfo::LLAvatarMeshInfo::morph_info_pair_t *info_pair = &(*xmlinfo_iter);
 72.1111 +			LLPolyMorphTarget *param = new LLPolyMorphTarget(mesh->getMesh());
 72.1112 +			if (!param->setInfo((LLPolyMorphTargetInfo*)info_pair->first))
 72.1113 +			{
 72.1114 +				delete param;
 72.1115 +				return FALSE;
 72.1116 +			}
 72.1117 +			else
 72.1118 +			{
 72.1119 +				if (info_pair->second)
 72.1120 +				{
 72.1121 +					addSharedVisualParam(param);
 72.1122 +					param->setParamLocation(isSelf() ? LOC_AV_SELF : LOC_AV_OTHER);
 72.1123 +				}
 72.1124 +				else
 72.1125 +				{
 72.1126 +					addVisualParam(param);
 72.1127 +					param->setParamLocation(isSelf() ? LOC_AV_SELF : LOC_AV_OTHER);
 72.1128 +				}
 72.1129 +			}				
 72.1130 +		}
 72.1131 +	}
 72.1132 +
 72.1133 +	return TRUE;
 72.1134 +}
 72.1135 +
 72.1136 +//-----------------------------------------------------------------------------
 72.1137 +// loadLayerSets()
 72.1138 +//-----------------------------------------------------------------------------
 72.1139 +BOOL LLAvatarAppearance::loadLayersets()
 72.1140 +{
 72.1141 +	BOOL success = TRUE;
 72.1142 +	for (LLAvatarXmlInfo::layer_info_list_t::const_iterator layerset_iter = sAvatarXmlInfo->mLayerInfoList.begin();
 72.1143 +		 layerset_iter != sAvatarXmlInfo->mLayerInfoList.end(); 
 72.1144 +		 ++layerset_iter)
 72.1145 +	{
 72.1146 +		LLTexLayerSetInfo *layerset_info = *layerset_iter;
 72.1147 +		if (isSelf())
 72.1148 +		{
 72.1149 +			// Construct a layerset for each one specified in avatar_lad.xml and initialize it as such.
 72.1150 +			LLTexLayerSet* layer_set = createTexLayerSet();
 72.1151 +			
 72.1152 +			if (!layer_set->setInfo(layerset_info))
 72.1153 +			{
 72.1154 +				stop_glerror();
 72.1155 +				delete layer_set;
 72.1156 +				llwarns << "avatar file: layer_set->setInfo() failed" << llendl;
 72.1157 +				return FALSE;
 72.1158 +			}
 72.1159 +
 72.1160 +			// scan baked textures and associate the layerset with the appropriate one
 72.1161 +			EBakedTextureIndex baked_index = BAKED_NUM_INDICES;
 72.1162 +			for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin();
 72.1163 +				 baked_iter != LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end();
 72.1164 +				 ++baked_iter)
 72.1165 +			{
 72.1166 +				const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_iter->second;
 72.1167 +				if (layer_set->isBodyRegion(baked_dict->mName))
 72.1168 +				{
 72.1169 +					baked_index = baked_iter->first;
 72.1170 +					// ensure both structures are aware of each other
 72.1171 +					mBakedTextureDatas[baked_index].mTexLayerSet = layer_set;
 72.1172 +					layer_set->setBakedTexIndex(baked_index);
 72.1173 +					break;
 72.1174 +				}
 72.1175 +			}
 72.1176 +			// if no baked texture was found, warn and cleanup
 72.1177 +			if (baked_index == BAKED_NUM_INDICES)
 72.1178 +			{
 72.1179 +				llwarns << "<layer_set> has invalid body_region attribute" << llendl;
 72.1180 +				delete layer_set;
 72.1181 +				return FALSE;
 72.1182 +			}
 72.1183 +
 72.1184 +			// scan morph masks and let any affected layers know they have an associated morph
 72.1185 +			for (LLAvatarAppearance::morph_list_t::const_iterator morph_iter = mBakedTextureDatas[baked_index].mMaskedMorphs.begin();
 72.1186 +				morph_iter != mBakedTextureDatas[baked_index].mMaskedMorphs.end();
 72.1187 +				 ++morph_iter)
 72.1188 +			{
 72.1189 +				LLMaskedMorph *morph = *morph_iter;
 72.1190 +				LLTexLayerInterface* layer = layer_set->findLayerByName(morph->mLayer);
 72.1191 +				if (layer)
 72.1192 +				{
 72.1193 +					layer->setHasMorph(TRUE);
 72.1194 +				}
 72.1195 +				else
 72.1196 +				{
 72.1197 +					llwarns << "Could not find layer named " << morph->mLayer << " to set morph flag" << llendl;
 72.1198 +					success = FALSE;
 72.1199 +				}
 72.1200 +			}
 72.1201 +		}
 72.1202 +		else // !isSelf()
 72.1203 +		{
 72.1204 +			// Construct a layerset for each one specified in avatar_lad.xml and initialize it as such.
 72.1205 +			LLTexLayerSetInfo *layerset_info = *layerset_iter;
 72.1206 +			layerset_info->createVisualParams(this);
 72.1207 +		}
 72.1208 +	}
 72.1209 +	return success;
 72.1210 +}
 72.1211 +
 72.1212 +//-----------------------------------------------------------------------------
 72.1213 +// getCharacterJoint()
 72.1214 +//-----------------------------------------------------------------------------
 72.1215 +LLJoint *LLAvatarAppearance::getCharacterJoint( U32 num )
 72.1216 +{
 72.1217 +	if ((S32)num >= mSkeleton.size()
 72.1218 +	    || (S32)num < 0)
 72.1219 +	{
 72.1220 +		return NULL;
 72.1221 +	}
 72.1222 +	return mSkeleton[num];
 72.1223 +}
 72.1224 +
 72.1225 +
 72.1226 +//-----------------------------------------------------------------------------
 72.1227 +// getVolumePos()
 72.1228 +//-----------------------------------------------------------------------------
 72.1229 +LLVector3 LLAvatarAppearance::getVolumePos(S32 joint_index, LLVector3& volume_offset)
 72.1230 +{
 72.1231 +	if (joint_index > mNumCollisionVolumes)
 72.1232 +	{
 72.1233 +		return LLVector3::zero;
 72.1234 +	}
 72.1235 +
 72.1236 +	return mCollisionVolumes[joint_index].getVolumePos(volume_offset);
 72.1237 +}
 72.1238 +
 72.1239 +//-----------------------------------------------------------------------------
 72.1240 +// findCollisionVolume()
 72.1241 +//-----------------------------------------------------------------------------
 72.1242 +LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id)
 72.1243 +{
 72.1244 +	if ((S32)volume_id > mNumCollisionVolumes)
 72.1245 +	{
 72.1246 +		return NULL;
 72.1247 +	}
 72.1248 +	
 72.1249 +	return &mCollisionVolumes[volume_id];
 72.1250 +}
 72.1251 +
 72.1252 +//-----------------------------------------------------------------------------
 72.1253 +// findCollisionVolume()
 72.1254 +//-----------------------------------------------------------------------------
 72.1255 +S32 LLAvatarAppearance::getCollisionVolumeID(std::string &name)
 72.1256 +{
 72.1257 +	for (S32 i = 0; i < mNumCollisionVolumes; i++)
 72.1258 +	{
 72.1259 +		if (mCollisionVolumes[i].getName() == name)
 72.1260 +		{
 72.1261 +			return i;
 72.1262 +		}
 72.1263 +	}
 72.1264 +
 72.1265 +	return -1;
 72.1266 +}
 72.1267 +
 72.1268 +//-----------------------------------------------------------------------------
 72.1269 +// LLAvatarAppearance::getHeadMesh()
 72.1270 +//-----------------------------------------------------------------------------
 72.1271 +LLPolyMesh*	LLAvatarAppearance::getHeadMesh()
 72.1272 +{
 72.1273 +	return mMeshLOD[MESH_ID_HEAD]->mMeshParts[0]->getMesh();
 72.1274 +}
 72.1275 +
 72.1276 +
 72.1277 +//-----------------------------------------------------------------------------
 72.1278 +// LLAvatarAppearance::getUpperBodyMesh()
 72.1279 +//-----------------------------------------------------------------------------
 72.1280 +LLPolyMesh*	LLAvatarAppearance::getUpperBodyMesh()
 72.1281 +{
 72.1282 +	return mMeshLOD[MESH_ID_UPPER_BODY]->mMeshParts[0]->getMesh();
 72.1283 +}
 72.1284 +
 72.1285 +
 72.1286 +
 72.1287 +// virtual
 72.1288 +BOOL LLAvatarAppearance::isValid() const
 72.1289 +{
 72.1290 +	// This should only be called on ourself.
 72.1291 +	if (!isSelf())
 72.1292 +	{
 72.1293 +		llerrs << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << llendl;
 72.1294 +	}
 72.1295 +	return TRUE;
 72.1296 +}
 72.1297 +
 72.1298 +
 72.1299 +// adds a morph mask to the appropriate baked texture structure
 72.1300 +void LLAvatarAppearance::addMaskedMorph(EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer)
 72.1301 +{
 72.1302 +	if (index < BAKED_NUM_INDICES)
 72.1303 +	{
 72.1304 +		LLMaskedMorph *morph = new LLMaskedMorph(morph_target, invert, layer);
 72.1305 +		mBakedTextureDatas[index].mMaskedMorphs.push_front(morph);
 72.1306 +	}
 72.1307 +}
 72.1308 +
 72.1309 +
 72.1310 +//static
 72.1311 +BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
 72.1312 +{
 72.1313 +	switch( te )
 72.1314 +	{
 72.1315 +		case TEX_UPPER_SHIRT:
 72.1316 +			param_name[0] = 803; //"shirt_red";
 72.1317 +			param_name[1] = 804; //"shirt_green";
 72.1318 +			param_name[2] = 805; //"shirt_blue";
 72.1319 +			break;
 72.1320 +
 72.1321 +		case TEX_LOWER_PANTS:
 72.1322 +			param_name[0] = 806; //"pants_red";
 72.1323 +			param_name[1] = 807; //"pants_green";
 72.1324 +			param_name[2] = 808; //"pants_blue";
 72.1325 +			break;
 72.1326 +
 72.1327 +		case TEX_LOWER_SHOES:
 72.1328 +			param_name[0] = 812; //"shoes_red";
 72.1329 +			param_name[1] = 813; //"shoes_green";
 72.1330 +			param_name[2] = 817; //"shoes_blue";
 72.1331 +			break;
 72.1332 +
 72.1333 +		case TEX_LOWER_SOCKS:
 72.1334 +			param_name[0] = 818; //"socks_red";
 72.1335 +			param_name[1] = 819; //"socks_green";
 72.1336 +			param_name[2] = 820; //"socks_blue";
 72.1337 +			break;
 72.1338 +
 72.1339 +		case TEX_UPPER_JACKET:
 72.1340 +		case TEX_LOWER_JACKET:
 72.1341 +			param_name[0] = 834; //"jacket_red";
 72.1342 +			param_name[1] = 835; //"jacket_green";
 72.1343 +			param_name[2] = 836; //"jacket_blue";
 72.1344 +			break;
 72.1345 +
 72.1346 +		case TEX_UPPER_GLOVES:
 72.1347 +			param_name[0] = 827; //"gloves_red";
 72.1348 +			param_name[1] = 829; //"gloves_green";
 72.1349 +			param_name[2] = 830; //"gloves_blue";
 72.1350 +			break;
 72.1351 +
 72.1352 +		case TEX_UPPER_UNDERSHIRT:
 72.1353 +			param_name[0] = 821; //"undershirt_red";
 72.1354 +			param_name[1] = 822; //"undershirt_green";
 72.1355 +			param_name[2] = 823; //"undershirt_blue";
 72.1356 +			break;
 72.1357 +	
 72.1358 +		case TEX_LOWER_UNDERPANTS:
 72.1359 +			param_name[0] = 824; //"underpants_red";
 72.1360 +			param_name[1] = 825; //"underpants_green";
 72.1361 +			param_name[2] = 826; //"underpants_blue";
 72.1362 +			break;
 72.1363 +
 72.1364 +		case TEX_SKIRT:
 72.1365 +			param_name[0] = 921; //"skirt_red";
 72.1366 +			param_name[1] = 922; //"skirt_green";
 72.1367 +			param_name[2] = 923; //"skirt_blue";
 72.1368 +			break;
 72.1369 +
 72.1370 +		case TEX_HEAD_TATTOO:
 72.1371 +		case TEX_LOWER_TATTOO:
 72.1372 +		case TEX_UPPER_TATTOO:
 72.1373 +			param_name[0] = 1071; //"tattoo_red";
 72.1374 +			param_name[1] = 1072; //"tattoo_green";
 72.1375 +			param_name[2] = 1073; //"tattoo_blue";
 72.1376 +			break;	
 72.1377 +
 72.1378 +		default:
 72.1379 +			llassert(0);
 72.1380 +			return FALSE;
 72.1381 +	}
 72.1382 +
 72.1383 +	return TRUE;
 72.1384 +}
 72.1385 +
 72.1386 +void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, BOOL upload_bake )
 72.1387 +{
 72.1388 +	U32 param_name[3];
 72.1389 +	if( teToColorParams( te, param_name ) )
 72.1390 +	{
 72.1391 +		setVisualParamWeight( param_name[0], new_color.mV[VX], upload_bake );
 72.1392 +		setVisualParamWeight( param_name[1], new_color.mV[VY], upload_bake );
 72.1393 +		setVisualParamWeight( param_name[2], new_color.mV[VZ], upload_bake );
 72.1394 +	}
 72.1395 +}
 72.1396 +
 72.1397 +LLColor4 LLAvatarAppearance::getClothesColor( ETextureIndex te )
 72.1398 +{
 72.1399 +	LLColor4 color;
 72.1400 +	U32 param_name[3];
 72.1401 +	if( teToColorParams( te, param_name ) )
 72.1402 +	{
 72.1403 +		color.mV[VX] = getVisualParamWeight( param_name[0] );
 72.1404 +		color.mV[VY] = getVisualParamWeight( param_name[1] );
 72.1405 +		color.mV[VZ] = getVisualParamWeight( param_name[2] );
 72.1406 +	}
 72.1407 +	return color;
 72.1408 +}
 72.1409 +
 72.1410 +// static
 72.1411 +LLColor4 LLAvatarAppearance::getDummyColor()
 72.1412 +{
 72.1413 +	return DUMMY_COLOR;
 72.1414 +}
 72.1415 +
 72.1416 +LLColor4 LLAvatarAppearance::getGlobalColor( const std::string& color_name ) const
 72.1417 +{
 72.1418 +	if (color_name=="skin_color" && mTexSkinColor)
 72.1419 +	{
 72.1420 +		return mTexSkinColor->getColor();
 72.1421 +	}
 72.1422 +	else if(color_name=="hair_color" && mTexHairColor)
 72.1423 +	{
 72.1424 +		return mTexHairColor->getColor();
 72.1425 +	}
 72.1426 +	if(color_name=="eye_color" && mTexEyeColor)
 72.1427 +	{
 72.1428 +		return mTexEyeColor->getColor();
 72.1429 +	}
 72.1430 +	else
 72.1431 +	{
 72.1432 +//		return LLColor4( .5f, .5f, .5f, .5f );
 72.1433 +		return LLColor4( 0.f, 1.f, 1.f, 1.f ); // good debugging color
 72.1434 +	}
 72.1435 +}
 72.1436 +
 72.1437 +// Unlike most wearable functions, this works for both self and other.
 72.1438 +// virtual
 72.1439 +BOOL LLAvatarAppearance::isWearingWearableType(LLWearableType::EType type) const
 72.1440 +{
 72.1441 +	return mWearableData->getWearableCount(type) > 0;
 72.1442 +}
 72.1443 +
 72.1444 +LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_index) const
 72.1445 +{
 72.1446 +	/* switch(index)
 72.1447 +		case TEX_HEAD_BAKED:
 72.1448 +		case TEX_HEAD_BODYPAINT:
 72.1449 +			return mHeadLayerSet; */
 72.1450 +	return mBakedTextureDatas[baked_index].mTexLayerSet;
 72.1451 +}
 72.1452 +
 72.1453 +//-----------------------------------------------------------------------------
 72.1454 +// allocateCollisionVolumes()
 72.1455 +//-----------------------------------------------------------------------------
 72.1456 +BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
 72.1457 +{
 72.1458 +	deleteAndClearArray(mCollisionVolumes);
 72.1459 +	mNumCollisionVolumes = 0;
 72.1460 +
 72.1461 +	mCollisionVolumes = new LLAvatarJointCollisionVolume[num];
 72.1462 +	if (!mCollisionVolumes)
 72.1463 +	{
 72.1464 +		return FALSE;
 72.1465 +	}
 72.1466 +
 72.1467 +	mNumCollisionVolumes = num;
 72.1468 +	return TRUE;
 72.1469 +}
 72.1470 +
 72.1471 +//-----------------------------------------------------------------------------
 72.1472 +// LLAvatarBoneInfo::parseXml()
 72.1473 +//-----------------------------------------------------------------------------
 72.1474 +BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
 72.1475 +{
 72.1476 +	if (node->hasName("bone"))
 72.1477 +	{
 72.1478 +		mIsJoint = TRUE;
 72.1479 +		static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
 72.1480 +		if (!node->getFastAttributeString(name_string, mName))
 72.1481 +		{
 72.1482 +			llwarns << "Bone without name" << llendl;
 72.1483 +			return FALSE;
 72.1484 +		}
 72.1485 +	}
 72.1486 +	else if (node->hasName("collision_volume"))
 72.1487 +	{
 72.1488 +		mIsJoint = FALSE;
 72.1489 +		static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
 72.1490 +		if (!node->getFastAttributeString(name_string, mName))
 72.1491 +		{
 72.1492 +			mName = "Collision Volume";
 72.1493 +		}
 72.1494 +	}
 72.1495 +	else
 72.1496 +	{
 72.1497 +		llwarns << "Invalid node " << node->getName() << llendl;
 72.1498 +		return FALSE;
 72.1499 +	}
 72.1500 +
 72.1501 +	static LLStdStringHandle pos_string = LLXmlTree::addAttributeString("pos");
 72.1502 +	if (!node->getFastAttributeVector3(pos_string, mPos))
 72.1503 +	{
 72.1504 +		llwarns << "Bone without position" << llendl;
 72.1505 +		return FALSE;
 72.1506 +	}
 72.1507 +
 72.1508 +	static LLStdStringHandle rot_string = LLXmlTree::addAttributeString("rot");
 72.1509 +	if (!node->getFastAttributeVector3(rot_string, mRot))
 72.1510 +	{
 72.1511 +		llwarns << "Bone without rotation" << llendl;
 72.1512 +		return FALSE;
 72.1513 +	}
 72.1514 +	
 72.1515 +	static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
 72.1516 +	if (!node->getFastAttributeVector3(scale_string, mScale))
 72.1517 +	{
 72.1518 +		llwarns << "Bone without scale" << llendl;
 72.1519 +		return FALSE;
 72.1520 +	}
 72.1521 +
 72.1522 +	if (mIsJoint)
 72.1523 +	{
 72.1524 +		static LLStdStringHandle pivot_string = LLXmlTree::addAttributeString("pivot");
 72.1525 +		if (!node->getFastAttributeVector3(pivot_string, mPivot))
 72.1526 +		{
 72.1527 +			llwarns << "Bone without pivot" << llendl;
 72.1528 +			return FALSE;
 72.1529 +		}
 72.1530 +	}
 72.1531 +
 72.1532 +	// parse children
 72.1533 +	LLXmlTreeNode* child;
 72.1534 +	for( child = node->getFirstChild(); child; child = node->getNextChild() )
 72.1535 +	{
 72.1536 +		LLAvatarBoneInfo *child_info = new LLAvatarBoneInfo;
 72.1537 +		if (!child_info->parseXml(child))
 72.1538 +		{
 72.1539 +			delete child_info;
 72.1540 +			return FALSE;
 72.1541 +		}
 72.1542 +		mChildList.push_back(child_info);
 72.1543 +	}
 72.1544 +	return TRUE;
 72.1545 +}
 72.1546 +
 72.1547 +//-----------------------------------------------------------------------------
 72.1548 +// LLAvatarSkeletonInfo::parseXml()
 72.1549 +//-----------------------------------------------------------------------------
 72.1550 +BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
 72.1551 +{
 72.1552 +	static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones");
 72.1553 +	if (!node->getFastAttributeS32(num_bones_string, mNumBones))
 72.1554 +	{
 72.1555 +		llwarns << "Couldn't find number of bones." << llendl;
 72.1556 +		return FALSE;
 72.1557 +	}
 72.1558 +
 72.1559 +	static LLStdStringHandle num_collision_volumes_string = LLXmlTree::addAttributeString("num_collision_volumes");
 72.1560 +	node->getFastAttributeS32(num_collision_volumes_string, mNumCollisionVolumes);
 72.1561 +
 72.1562 +	LLXmlTreeNode* child;
 72.1563 +	for( child = node->getFirstChild(); child; child = node->getNextChild() )
 72.1564 +	{
 72.1565 +		LLAvatarBoneInfo *info = new LLAvatarBoneInfo;
 72.1566 +		if (!info->parseXml(child))
 72.1567 +		{
 72.1568 +			delete info;
 72.1569 +			llwarns << "Error parsing bone in skeleton file" << llendl;
 72.1570 +			return FALSE;
 72.1571 +		}
 72.1572 +		mBoneInfoList.push_back(info);
 72.1573 +	}
 72.1574 +	return TRUE;
 72.1575 +}
 72.1576 +
 72.1577 +
 72.1578 +//-----------------------------------------------------------------------------
 72.1579 +// parseXmlSkeletonNode(): parses <skeleton> nodes from XML tree
 72.1580 +//-----------------------------------------------------------------------------
 72.1581 +BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* root)
 72.1582 +{
 72.1583 +	LLXmlTreeNode* node = root->getChildByName( "skeleton" );
 72.1584 +	if( !node )
 72.1585 +	{
 72.1586 +		llwarns << "avatar file: missing <skeleton>" << llendl;
 72.1587 +		return FALSE;
 72.1588 +	}
 72.1589 +
 72.1590 +	LLXmlTreeNode* child;
 72.1591 +
 72.1592 +	// SKELETON DISTORTIONS
 72.1593 +	for (child = node->getChildByName( "param" );
 72.1594 +		 child;
 72.1595 +		 child = node->getNextNamedChild())
 72.1596 +	{
 72.1597 +		if (!child->getChildByName("param_skeleton"))
 72.1598 +		{
 72.1599 +			if (child->getChildByName("param_morph"))
 72.1600 +			{
 72.1601 +				llwarns << "Can't specify morph param in skeleton definition." << llendl;
 72.1602 +			}
 72.1603 +			else
 72.1604 +			{
 72.1605 +				llwarns << "Unknown param type." << llendl;
 72.1606 +			}
 72.1607 +			continue;
 72.1608 +		}
 72.1609 +		
 72.1610 +		LLPolySkeletalDistortionInfo *info = new LLPolySkeletalDistortionInfo;
 72.1611 +		if (!info->parseXml(child))
 72.1612 +		{
 72.1613 +			delete info;
 72.1614 +			return FALSE;
 72.1615 +		}
 72.1616 +
 72.1617 +		mSkeletalDistortionInfoList.push_back(info);
 72.1618 +	}
 72.1619 +
 72.1620 +	// ATTACHMENT POINTS
 72.1621 +	for (child = node->getChildByName( "attachment_point" );
 72.1622 +		 child;
 72.1623 +		 child = node->getNextNamedChild())
 72.1624 +	{
 72.1625 +		LLAvatarAttachmentInfo* info = new LLAvatarAttachmentInfo();
 72.1626 +
 72.1627 +		static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
 72.1628 +		if (!child->getFastAttributeString(name_string, info->mName))
 72.1629 +		{
 72.1630 +			llwarns << "No name supplied for attachment point." << llendl;
 72.1631 +			delete info;
 72.1632 +			continue;
 72.1633 +		}
 72.1634 +
 72.1635 +		static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint");
 72.1636 +		if (!child->getFastAttributeString(joint_string, info->mJointName))
 72.1637 +		{
 72.1638 +			llwarns << "No bone declared in attachment point " << info->mName << llendl;
 72.1639 +			delete info;
 72.1640 +			continue;
 72.1641 +		}
 72.1642 +
 72.1643 +		static LLStdStringHandle position_string = LLXmlTree::addAttributeString("position");
 72.1644 +		if (child->getFastAttributeVector3(position_string, info->mPosition))
 72.1645 +		{
 72.1646 +			info->mHasPosition = TRUE;
 72.1647 +		}
 72.1648 +
 72.1649 +		static LLStdStringHandle rotation_string = LLXmlTree::addAttributeString("rotation");
 72.1650 +		if (child->getFastAttributeVector3(rotation_string, info->mRotationEuler))
 72.1651 +		{
 72.1652 +			info->mHasRotation = TRUE;
 72.1653 +		}
 72.1654 +		 static LLStdStringHandle group_string = LLXmlTree::addAttributeString("group");
 72.1655 +		if (child->getFastAttributeS32(group_string, info->mGroup))
 72.1656 +		{
 72.1657 +			if (info->mGroup == -1)
 72.1658 +				info->mGroup = -1111; // -1 = none parsed, < -1 = bad value
 72.1659 +		}
 72.1660 +
 72.1661 +		static LLStdStringHandle id_string = LLXmlTree::addAttributeString("id");
 72.1662 +		if (!child->getFastAttributeS32(id_string, info->mAttachmentID))
 72.1663 +		{
 72.1664 +			llwarns << "No id supplied for attachment point " << info->mName << llendl;
 72.1665 +			delete info;
 72.1666 +			continue;
 72.1667 +		}
 72.1668 +
 72.1669 +		static LLStdStringHandle slot_string = LLXmlTree::addAttributeString("pie_slice");
 72.1670 +		child->getFastAttributeS32(slot_string, info->mPieMenuSlice);
 72.1671 +			
 72.1672 +		static LLStdStringHandle visible_in_first_person_string = LLXmlTree::addAttributeString("visible_in_first_person");
 72.1673 +		child->getFastAttributeBOOL(visible_in_first_person_string, info->mVisibleFirstPerson);
 72.1674 +
 72.1675 +		static LLStdStringHandle hud_attachment_string = LLXmlTree::addAttributeString("hud");
 72.1676 +		child->getFastAttributeBOOL(hud_attachment_string, info->mIsHUDAttachment);
 72.1677 +
 72.1678 +		mAttachmentInfoList.push_back(info);
 72.1679 +	}
 72.1680 +
 72.1681 +	return TRUE;
 72.1682 +}
 72.1683 +
 72.1684 +//-----------------------------------------------------------------------------
 72.1685 +// parseXmlMeshNodes(): parses <mesh> nodes from XML tree
 72.1686 +//-----------------------------------------------------------------------------
 72.1687 +BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
 72.1688 +{
 72.1689 +	for (LLXmlTreeNode* node = root->getChildByName( "mesh" );
 72.1690 +		 node;
 72.1691 +		 node = root->getNextNamedChild())
 72.1692 +	{
 72.1693 +		LLAvatarMeshInfo *info = new LLAvatarMeshInfo;
 72.1694 +
 72.1695 +		// attribute: type
 72.1696 +		static LLStdStringHandle type_string = LLXmlTree::addAttributeString("type");
 72.1697 +		if( !node->getFastAttributeString( type_string, info->mType ) )
 72.1698 +		{
 72.1699 +			llwarns << "Avatar file: <mesh> is missing type attribute.  Ignoring element. " << llendl;
 72.1700 +			delete info;
 72.1701 +			return FALSE;  // Ignore this element
 72.1702 +		}
 72.1703 +		
 72.1704 +		static LLStdStringHandle lod_string = LLXmlTree::addAttributeString("lod");
 72.1705 +		if (!node->getFastAttributeS32( lod_string, info->mLOD ))
 72.1706 +		{
 72.1707 +			llwarns << "Avatar file: <mesh> is missing lod attribute.  Ignoring element. " << llendl;
 72.1708 +			delete info;
 72.1709 +			return FALSE;  // Ignore this element
 72.1710 +		}
 72.1711 +
 72.1712 +		static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
 72.1713 +		if( !node->getFastAttributeString( file_name_string, info->mMeshFileName ) )
 72.1714 +		{
 72.1715 +			llwarns << "Avatar file: <mesh> is missing file_name attribute.  Ignoring: " << info->mType << llendl;
 72.1716 +			delete info;
 72.1717 +			return FALSE;  // Ignore this element
 72.1718 +		}
 72.1719 +
 72.1720 +		static LLStdStringHandle reference_string = LLXmlTree::addAttributeString("reference");
 72.1721 +		node->getFastAttributeString( reference_string, info->mReferenceMeshName );
 72.1722 +		
 72.1723 +		// attribute: min_pixel_area
 72.1724 +		static LLStdStringHandle min_pixel_area_string = LLXmlTree::addAttributeString("min_pixel_area");
 72.1725 +		static LLStdStringHandle min_pixel_width_string = LLXmlTree::addAttributeString("min_pixel_width");
 72.1726 +		if (!node->getFastAttributeF32( min_pixel_area_string, info->mMinPixelArea ))
 72.1727 +		{
 72.1728 +			F32 min_pixel_area = 0.1f;
 72.1729 +			if (node->getFastAttributeF32( min_pixel_width_string, min_pixel_area ))
 72.1730 +			{
 72.1731 +				// this is square root of pixel area (sensible to use linear space in defining lods)
 72.1732 +				min_pixel_area = min_pixel_area * min_pixel_area;
 72.1733 +			}
 72.1734 +			info->mMinPixelArea = min_pixel_area;
 72.1735 +		}
 72.1736 +		
 72.1737 +		// Parse visual params for this node only if we haven't already
 72.1738 +		for (LLXmlTreeNode* child = node->getChildByName( "param" );
 72.1739 +			 child;
 72.1740 +			 child = node->getNextNamedChild())
 72.1741 +		{
 72.1742 +			if (!child->getChildByName("param_morph"))
 72.1743 +			{
 72.1744 +				if (child->getChildByName("param_skeleton"))
 72.1745 +				{
 72.1746 +					llwarns << "Can't specify skeleton param in a mesh definition." << llendl;
 72.1747 +				}
 72.1748 +				else
 72.1749 +				{
 72.1750 +					llwarns << "Unknown param type." << llendl;
 72.1751 +				}
 72.1752 +				continue;
 72.1753 +			}
 72.1754 +
 72.1755 +			LLPolyMorphTargetInfo *morphinfo = new LLPolyMorphTargetInfo();
 72.1756 +			if (!morphinfo->parseXml(child))
 72.1757 +			{
 72.1758 +				delete morphinfo;
 72.1759 +				delete info;
 72.1760 +				return -1;
 72.1761 +			}
 72.1762 +			BOOL shared = FALSE;
 72.1763 +			static LLStdStringHandle shared_string = LLXmlTree::addAttributeString("shared");
 72.1764 +			child->getFastAttributeBOOL(shared_string, shared);
 72.1765 +
 72.1766 +			info->mPolyMorphTargetInfoList.push_back(LLAvatarMeshInfo::morph_info_pair_t(morphinfo, shared));
 72.1767 +		}
 72.1768 +
 72.1769 +		mMeshInfoList.push_back(info);
 72.1770 +	}
 72.1771 +	return TRUE;
 72.1772 +}
 72.1773 +
 72.1774 +//-----------------------------------------------------------------------------
 72.1775 +// parseXmlColorNodes(): parses <global_color> nodes from XML tree
 72.1776 +//-----------------------------------------------------------------------------
 72.1777 +BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root)
 72.1778 +{
 72.1779 +	for (LLXmlTreeNode* color_node = root->getChildByName( "global_color" );
 72.1780 +		 color_node;
 72.1781 +		 color_node = root->getNextNamedChild())
 72.1782 +	{
 72.1783 +		std::string global_color_name;
 72.1784 +		static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
 72.1785 +		if (color_node->getFastAttributeString( name_string, global_color_name ) )
 72.1786 +		{
 72.1787 +			if( global_color_name == "skin_color" )
 72.1788 +			{
 72.1789 +				if (mTexSkinColorInfo)
 72.1790 +				{
 72.1791 +					llwarns << "avatar file: multiple instances of skin_color" << llendl;
 72.1792 +					return FALSE;
 72.1793 +				}
 72.1794 +				mTexSkinColorInfo = new LLTexGlobalColorInfo;
 72.1795 +				if( !mTexSkinColorInfo->parseXml( color_node ) )
 72.1796 +				{
 72.1797 +					deleteAndClear(mTexSkinColorInfo);
 72.1798 +					llwarns << "avatar file: mTexSkinColor->parseXml() failed" << llendl;
 72.1799 +					return FALSE;
 72.1800 +				}
 72.1801 +			}
 72.1802 +			else if( global_color_name == "hair_color" )
 72.1803 +			{
 72.1804 +				if (mTexHairColorInfo)
 72.1805 +				{
 72.1806 +					llwarns << "avatar file: multiple instances of hair_color" << llendl;
 72.1807 +					return FALSE;
 72.1808 +				}
 72.1809 +				mTexHairColorInfo = new LLTexGlobalColorInfo;
 72.1810 +				if( !mTexHairColorInfo->parseXml( color_node ) )
 72.1811 +				{
 72.1812 +					deleteAndClear(mTexHairColorInfo);
 72.1813 +					llwarns << "avatar file: mTexHairColor->parseXml() failed" << llendl;
 72.1814 +					return FALSE;
 72.1815 +				}
 72.1816 +			}
 72.1817 +			else if( global_color_name == "eye_color" )
 72.1818 +			{
 72.1819 +				if (mTexEyeColorInfo)
 72.1820 +				{
 72.1821 +					llwarns << "avatar file: multiple instances of eye_color" << llendl;
 72.1822 +					return FALSE;
 72.1823 +				}
 72.1824 +				mTexEyeColorInfo = new LLTexGlobalColorInfo;
 72.1825 +				if( !mTexEyeColorInfo->parseXml( color_node ) )
 72.1826 +				{
 72.1827 +					llwarns << "avatar file: mTexEyeColor->parseXml() failed" << llendl;
 72.1828 +					return FALSE;
 72.1829 +				}
 72.1830 +			}
 72.1831 +		}
 72.1832 +	}
 72.1833 +	return TRUE;
 72.1834 +}
 72.1835 +
 72.1836 +//-----------------------------------------------------------------------------
 72.1837 +// parseXmlLayerNodes(): parses <layer_set> nodes from XML tree
 72.1838 +//-----------------------------------------------------------------------------
 72.1839 +BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root)
 72.1840 +{
 72.1841 +	for (LLXmlTreeNode* layer_node = root->getChildByName( "layer_set" );
 72.1842 +		 layer_node;
 72.1843 +		 layer_node = root->getNextNamedChild())
 72.1844 +	{
 72.1845 +		LLTexLayerSetInfo* layer_info = new LLTexLayerSetInfo();
 72.1846 +		if( layer_info->parseXml( layer_node ) )
 72.1847 +		{
 72.1848 +			mLayerInfoList.push_back(layer_info);
 72.1849 +		}
 72.1850 +		else
 72.1851 +		{
 72.1852 +			delete layer_info;
 72.1853 +			llwarns << "avatar file: layer_set->parseXml() failed" << llendl;
 72.1854 +			return FALSE;
 72.1855 +		}
 72.1856 +	}
 72.1857 +	return TRUE;
 72.1858 +}
 72.1859 +
 72.1860 +//-----------------------------------------------------------------------------
 72.1861 +// parseXmlDriverNodes(): parses <driver_parameters> nodes from XML tree
 72.1862 +//-----------------------------------------------------------------------------
 72.1863 +BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* root)
 72.1864 +{
 72.1865 +	LLXmlTreeNode* driver = root->getChildByName( "driver_parameters" );
 72.1866 +	if( driver )
 72.1867 +	{
 72.1868 +		for (LLXmlTreeNode* grand_child = driver->getChildByName( "param" );
 72.1869 +			 grand_child;
 72.1870 +			 grand_child = driver->getNextNamedChild())
 72.1871 +		{
 72.1872 +			if( grand_child->getChildByName( "param_driver" ) )
 72.1873 +			{
 72.1874 +				LLDriverParamInfo* driver_info = new LLDriverParamInfo();
 72.1875 +				if( driver_info->parseXml( grand_child ) )
 72.1876 +				{
 72.1877 +					mDriverInfoList.push_back(driver_info);
 72.1878 +				}
 72.1879 +				else
 72.1880 +				{
 72.1881 +					delete driver_info;
 72.1882 +					llwarns << "avatar file: driver_param->parseXml() failed" << llendl;
 72.1883 +					return FALSE;
 72.1884 +				}
 72.1885 +			}
 72.1886 +		}
 72.1887 +	}
 72.1888 +	return TRUE;
 72.1889 +}
 72.1890 +
 72.1891 +//-----------------------------------------------------------------------------
 72.1892 +// parseXmlDriverNodes(): parses <driver_parameters> nodes from XML tree
 72.1893 +//-----------------------------------------------------------------------------
 72.1894 +BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root)
 72.1895 +{
 72.1896 +	LLXmlTreeNode* masks = root->getChildByName( "morph_masks" );
 72.1897 +	if( !masks )
 72.1898 +	{
 72.1899 +		return FALSE;
 72.1900 +	}
 72.1901 +
 72.1902 +	for (LLXmlTreeNode* grand_child = masks->getChildByName( "mask" );
 72.1903 +		 grand_child;
 72.1904 +		 grand_child = masks->getNextNamedChild())
 72.1905 +	{
 72.1906 +		LLAvatarMorphInfo* info = new LLAvatarMorphInfo();
 72.1907 +
 72.1908 +		static LLStdStringHandle name_string = LLXmlTree::addAttributeString("morph_name");
 72.1909 +		if (!grand_child->getFastAttributeString(name_string, info->mName))
 72.1910 +		{
 72.1911 +			llwarns << "No name supplied for morph mask." << llendl;
 72.1912 +			delete info;
 72.1913 +			continue;
 72.1914 +		}
 72.1915 +
 72.1916 +		static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region");
 72.1917 +		if (!grand_child->getFastAttributeString(region_string, info->mRegion))
 72.1918 +		{
 72.1919 +			llwarns << "No region supplied for morph mask." << llendl;
 72.1920 +			delete info;
 72.1921 +			continue;
 72.1922 +		}
 72.1923 +
 72.1924 +		static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer");
 72.1925 +		if (!grand_child->getFastAttributeString(layer_string, info->mLayer))
 72.1926 +		{
 72.1927 +			llwarns << "No layer supplied for morph mask." << llendl;
 72.1928 +			delete info;
 72.1929 +			continue;
 72.1930 +		}
 72.1931 +
 72.1932 +		// optional parameter. don't throw a warning if not present.
 72.1933 +		static LLStdStringHandle invert_string = LLXmlTree::addAttributeString("invert");
 72.1934 +		grand_child->getFastAttributeBOOL(invert_string, info->mInvert);
 72.1935 +
 72.1936 +		mMorphMaskInfoList.push_back(info);
 72.1937 +	}
 72.1938 +
 72.1939 +	return TRUE;
 72.1940 +}
 72.1941 +
 72.1942 +//virtual 
 72.1943 +LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer) :
 72.1944 +			mMorphTarget(morph_target), 
 72.1945 +			mInvert(invert),
 72.1946 +			mLayer(layer)
 72.1947 +{
 72.1948 +	LLPolyMorphTarget *target = dynamic_cast<LLPolyMorphTarget*>(morph_target);
 72.1949 +	if (target)
 72.1950 +	{
 72.1951 +		target->addPendingMorphMask();
 72.1952 +	}
 72.1953 +}
 72.1954 +
 72.1955 +
 72.1956 +
    73.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.2 +++ b/indra/llappearance/llavatarappearance.h	Thu May 30 21:28:02 2013 +0000
    73.3 @@ -0,0 +1,448 @@
    73.4 +/**
    73.5 + * @file llavatarappearance.h
    73.6 + * @brief Declaration of LLAvatarAppearance class
    73.7 + *
    73.8 + * $LicenseInfo:firstyear=2012&license=viewerlgpl$
    73.9 + * Second Life Viewer Source Code
   73.10 + * Copyright (C) 2010, Linden Research, Inc.
   73.11 + * 
   73.12 + * This library is free software; you can redistribute it and/or
   73.13 + * modify it under the terms of the GNU Lesser General Public
   73.14 + * License as published by the Free Software Foundation;
   73.15 + * version 2.1 of the License only.
   73.16 + * 
   73.17 + * This library is distributed in the hope that it will be useful,
   73.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   73.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   73.20 + * Lesser General Public License for more details.
   73.21 + * 
   73.22 + * You should have received a copy of the GNU Lesser General Public
   73.23 + * License along with this library; if not, write to the Free Software
   73.24 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
   73.25 + * 
   73.26 + * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
   73.27 + * $/LicenseInfo$
   73.28 + */
   73.29 +
   73.30 +#ifndef LL_AVATAR_APPEARANCE_H
   73.31 +#define LL_AVATAR_APPEARANCE_H
   73.32 +
   73.33 +#include "llcharacter.h"
   73.34 +#include "llavatarappearancedefines.h"
   73.35 +#include "llavatarjointmesh.h"
   73.36 +#include "lldriverparam.h"
   73.37 +#include "lltexlayer.h"
   73.38 +#include "llviewervisualparam.h"
   73.39 +#include "llxmltree.h"
   73.40 +
   73.41 +class LLTexLayerSet;
   73.42 +class LLTexGlobalColor;
   73.43 +class LLTexGlobalColorInfo;
   73.44 +class LLWearableData;
   73.45 +class LLAvatarBoneInfo;
   73.46 +class LLAvatarSkeletonInfo;
   73.47 +
   73.48 +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   73.49 +// LLAvatarAppearance
   73.50 +// 
   73.51 +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   73.52 +
   73.53 +class LLAvatarAppearance : public LLCharacter
   73.54 +{
   73.55 +	LOG_CLASS(LLAvatarAppearance);
   73.56 +
   73.57 +protected:
   73.58 +	struct LLAvatarXmlInfo;
   73.59 +
   73.60 +/********************************************************************************
   73.61 + **                                                                            **
   73.62 + **                    INITIALIZATION
   73.63 + **/
   73.64 +private:
   73.65 +	// Hide default constructor.
   73.66 +	LLAvatarAppearance() {}
   73.67 +
   73.68 +public:
   73.69 +	LLAvatarAppearance(LLWearableData* wearable_data);
   73.70 +	virtual ~LLAvatarAppearance();
   73.71 +
   73.72 +	static void			initClass(); // initializes static members
   73.73 +	static void			cleanupClass();	// Cleanup data that's only init'd once per class.
   73.74 +	virtual void 		initInstance(); // Called after construction to initialize the instance.
   73.75 +	virtual BOOL		loadSkeletonNode();
   73.76 +	BOOL				loadMeshNodes();
   73.77 +	BOOL				loadLayersets();
   73.78 +
   73.79 +
   73.80 +/**                    Initialization
   73.81 + **                                                                            **
   73.82 + *******************************************************************************/
   73.83 +
   73.84 +/********************************************************************************
   73.85 + **                                                                            **
   73.86 + **                    INHERITED
   73.87 + **/
   73.88 +
   73.89 +	//--------------------------------------------------------------------
   73.90 +	// LLCharacter interface and related
   73.91 +	//--------------------------------------------------------------------
   73.92 +public:
   73.93 +	/*virtual*/ LLJoint*		getCharacterJoint(U32 num);
   73.94 +
   73.95 +	/*virtual*/ const char*		getAnimationPrefix() { return "avatar"; }
   73.96 +	/*virtual*/ LLVector3		getVolumePos(S32 joint_index, LLVector3& volume_offset);
   73.97 +	/*virtual*/ LLJoint*		findCollisionVolume(U32 volume_id);
   73.98 +	/*virtual*/ S32				getCollisionVolumeID(std::string &name);
   73.99 +	/*virtual*/ LLPolyMesh*		getHeadMesh();
  73.100 +	/*virtual*/ LLPolyMesh*		getUpperBodyMesh();
  73.101 +
  73.102 +/**                    Inherited
  73.103 + **                                                                            **
  73.104 + *******************************************************************************/
  73.105 +
  73.106 +/********************************************************************************
  73.107 + **                                                                            **
  73.108 + **                    STATE
  73.109 + **/
  73.110 +public:
  73.111 +	virtual bool 	isSelf() const { return false; } // True if this avatar is for this viewer's agent
  73.112 +	virtual BOOL	isValid() const;
  73.113 +	virtual BOOL	isUsingServerBakes() const = 0;
  73.114 +	virtual BOOL	isUsingLocalAppearance() const = 0;
  73.115 +	virtual BOOL	isEditingAppearance() const = 0;
  73.116 +
  73.117 +	bool isBuilt() const { return mIsBuilt; }
  73.118 +
  73.119 +	
  73.120 +/**                    State
  73.121 + **                                                                            **
  73.122 + *******************************************************************************/
  73.123 +
  73.124 +/********************************************************************************
  73.125 + **                                                                            **
  73.126 + **                    SKELETON
  73.127 + **/
  73.128 +
  73.129 +protected:
  73.130 +	virtual LLAvatarJoint*	createAvatarJoint() = 0;
  73.131 +	virtual LLAvatarJoint*	createAvatarJoint(S32 joint_num) = 0;
  73.132 +	virtual LLAvatarJointMesh*	createAvatarJointMesh() = 0;
  73.133 +public:
  73.134 +	F32					getPelvisToFoot() const { return mPelvisToFoot; }
  73.135 +	/*virtual*/ LLJoint*	getRootJoint() { return mRoot; }
  73.136 +
  73.137 +	LLVector3			mHeadOffset; // current head position
  73.138 +	LLAvatarJoint		*mRoot;
  73.139 +
  73.140 +	typedef std::map<std::string, LLJoint*> joint_map_t;
  73.141 +	joint_map_t			mJointMap;
  73.142 +	
  73.143 +	void				computeBodySize();
  73.144 +
  73.145 +
  73.146 +protected:
  73.147 +	static BOOL			parseSkeletonFile(const std::string& filename);
  73.148 +	virtual void		buildCharacter();
  73.149 +	virtual BOOL		loadAvatar();
  73.150 +	virtual void		bodySizeChanged() = 0;
  73.151 +
  73.152 +	BOOL				setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 &current_volume_num, S32 &current_joint_num);
  73.153 +	BOOL				allocateCharacterJoints(U32 num);
  73.154 +	BOOL				buildSkeleton(const LLAvatarSkeletonInfo *info);
  73.155 +protected:
  73.156 +	void				clearSkeleton();
  73.157 +	BOOL				mIsBuilt; // state of deferred character building
  73.158 +	typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
  73.159 +	avatar_joint_list_t	mSkeleton;
  73.160 +	
  73.161 +	//--------------------------------------------------------------------
  73.162 +	// Pelvis height adjustment members.
  73.163 +	//--------------------------------------------------------------------
  73.164 +public:
  73.165 +	LLVector3			mBodySize;
  73.166 +	LLVector3			mAvatarOffset;
  73.167 +protected:
  73.168 +	F32					mPelvisToFoot;
  73.169 +
  73.170 +	//--------------------------------------------------------------------
  73.171 +	// Cached pointers to well known joints
  73.172 +	//--------------------------------------------------------------------
  73.173 +public:
  73.174 +	LLJoint* 		mPelvisp;
  73.175 +	LLJoint* 		mTorsop;
  73.176 +	LLJoint* 		mChestp;
  73.177 +	LLJoint* 		mNeckp;
  73.178 +	LLJoint* 		mHeadp;
  73.179 +	LLJoint* 		mSkullp;
  73.180 +	LLJoint* 		mEyeLeftp;
  73.181 +	LLJoint* 		mEyeRightp;
  73.182 +	LLJoint* 		mHipLeftp;
  73.183 +	LLJoint* 		mHipRightp;
  73.184 +	LLJoint* 		mKneeLeftp;
  73.185 +	LLJoint* 		mKneeRightp;
  73.186 +	LLJoint* 		mAnkleLeftp;
  73.187 +	LLJoint* 		mAnkleRightp;
  73.188 +	LLJoint* 		mFootLeftp;
  73.189 +	LLJoint* 		mFootRightp;
  73.190 +	LLJoint* 		mWristLeftp;
  73.191 +	LLJoint* 		mWristRightp;
  73.192 +
  73.193 +	//--------------------------------------------------------------------
  73.194 +	// XML parse tree
  73.195 +	//--------------------------------------------------------------------
  73.196 +protected:
  73.197 +	static LLXmlTree 	sXMLTree; // avatar config file
  73.198 +	static LLXmlTree 	sSkeletonXMLTree; // avatar skeleton file
  73.199 +
  73.200 +	static LLAvatarSkeletonInfo* 					sAvatarSkeletonInfo;
  73.201 +	static LLAvatarXmlInfo* 						sAvatarXmlInfo;
  73.202 +
  73.203 +
  73.204 +/**                    Skeleton
  73.205 + **                                                                            **
  73.206 + *******************************************************************************/
  73.207 +
  73.208 +
  73.209 +/********************************************************************************
  73.210 + **                                                                            **
  73.211 + **                    RENDERING
  73.212 + **/
  73.213 +public:
  73.214 +	BOOL		mIsDummy; // for special views
  73.215 +
  73.216 +	//--------------------------------------------------------------------
  73.217 +	// Morph masks
  73.218 +	//--------------------------------------------------------------------
  73.219 +public:
  73.220 +	void 	addMaskedMorph(LLAvatarAppearanceDefines::EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer);
  73.221 +	virtual void	applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES) = 0;
  73.222 +
  73.223 +/**                    Rendering
  73.224 + **                                                                            **
  73.225 + *******************************************************************************/
  73.226 +
  73.227 +	//--------------------------------------------------------------------
  73.228 +	// Composites
  73.229 +	//--------------------------------------------------------------------
  73.230 +public:
  73.231 +	virtual void	invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result) = 0;
  73.232 +
  73.233 +/********************************************************************************
  73.234 + **                                                                            **
  73.235 + **                    MESHES
  73.236 + **/
  73.237 +
  73.238 +public:
  73.239 +	virtual void	updateMeshTextures() = 0;
  73.240 +	virtual void	dirtyMesh() = 0; // Dirty the avatar mesh
  73.241 +protected:
  73.242 +	virtual void	dirtyMesh(S32 priority) = 0; // Dirty the avatar mesh, with priority
  73.243 +
  73.244 +protected:
  73.245 +	typedef std::multimap<std::string, LLPolyMesh*> polymesh_map_t;
  73.246 +	polymesh_map_t 									mPolyMeshes;
  73.247 +	avatar_joint_list_t								mMeshLOD;
  73.248 +
  73.249 +/**                    Meshes
  73.250 + **                                                                            **
  73.251 + *******************************************************************************/
  73.252 +
  73.253 +/********************************************************************************
  73.254 + **                                                                            **
  73.255 + **                    APPEARANCE
  73.256 + **/
  73.257 +
  73.258 +	//--------------------------------------------------------------------
  73.259 +	// Clothing colors (convenience functions to access visual parameters)
  73.260 +	//--------------------------------------------------------------------
  73.261 +public:
  73.262 +	void			setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake);
  73.263 +	LLColor4		getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te);
  73.264 +	static BOOL		teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name);
  73.265 +
  73.266 +	//--------------------------------------------------------------------
  73.267 +	// Global colors
  73.268 +	//--------------------------------------------------------------------
  73.269 +public:
  73.270 +	LLColor4		getGlobalColor(const std::string& color_name ) const;
  73.271 +	virtual void	onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0;
  73.272 +protected:
  73.273 +	LLTexGlobalColor* mTexSkinColor;
  73.274 +	LLTexGlobalColor* mTexHairColor;
  73.275 +	LLTexGlobalColor* mTexEyeColor;
  73.276 +
  73.277 +	//--------------------------------------------------------------------
  73.278 +	// Visibility
  73.279 +	//--------------------------------------------------------------------
  73.280 +public:
  73.281 +	static LLColor4 getDummyColor();
  73.282 +/**                    Appearance
  73.283 + **                                                                            **
  73.284 + *******************************************************************************/
  73.285 +
  73.286 +/********************************************************************************
  73.287 + **                                                                            **
  73.288 + **                    WEARABLES
  73.289 + **/
  73.290 +
  73.291 +public:
  73.292 +	LLWearableData*			getWearableData() { return mWearableData; }
  73.293 +	const LLWearableData*	getWearableData() const { return mWearableData; }
  73.294 +	virtual BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U32 index = 0 ) const = 0;
  73.295 +	virtual BOOL			isWearingWearableType(LLWearableType::EType type ) const;
  73.296 +
  73.297 +private:
  73.298 +	LLWearableData* mWearableData;
  73.299 +
  73.300 +/********************************************************************************
  73.301 + **                                                                            **
  73.302 + **                    BAKED TEXTURES
  73.303 + **/
  73.304 +public:
  73.305 +	LLTexLayerSet*		getAvatarLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const;
  73.306 +
  73.307 +protected:
  73.308 +	virtual LLTexLayerSet*	createTexLayerSet() = 0;
  73.309 +
  73.310 +protected:
  73.311 +	class LLMaskedMorph;
  73.312 +	typedef std::deque<LLMaskedMorph *> 	morph_list_t;
  73.313 +	struct BakedTextureData
  73.314 +	{
  73.315 +		LLUUID								mLastTextureID;
  73.316 +		LLTexLayerSet*		 				mTexLayerSet; // Only exists for self
  73.317 +		bool								mIsLoaded;
  73.318 +		bool								mIsUsed;
  73.319 +		LLAvatarAppearanceDefines::ETextureIndex 	mTextureIndex;
  73.320 +		U32									mMaskTexName;
  73.321 +		// Stores pointers to the joint meshes that this baked texture deals with
  73.322 +		avatar_joint_mesh_list_t			mJointMeshes;
  73.323 +		morph_list_t						mMaskedMorphs;
  73.324 +	};
  73.325 +	typedef std::vector<BakedTextureData> 	bakedtexturedata_vec_t;
  73.326 +	bakedtexturedata_vec_t 					mBakedTextureDatas;
  73.327 +
  73.328 +/********************************************************************************
  73.329 + **                                                                            **
  73.330 + **                    PHYSICS
  73.331 + **/
  73.332 +
  73.333 +	//--------------------------------------------------------------------
  73.334 +	// Collision volumes
  73.335 +	//--------------------------------------------------------------------
  73.336 +public:
  73.337 +  	S32			mNumCollisionVolumes;
  73.338 +	LLAvatarJointCollisionVolume* mCollisionVolumes;
  73.339 +protected:
  73.340 +	BOOL		allocateCollisionVolumes(U32 num);
  73.341 +
  73.342 +/**                    Physics
  73.343 + **                                                                            **
  73.344 + *******************************************************************************/
  73.345 +
  73.346 +/********************************************************************************
  73.347 + **                                                                            **
  73.348 + **                    SUPPORT CLASSES
  73.349 + **/
  73.350 +
  73.351 +	struct LLAvatarXmlInfo
  73.352 +	{
  73.353 +		LLAvatarXmlInfo();
  73.354 +		~LLAvatarXmlInfo();
  73.355 +
  73.356 +		BOOL 	parseXmlSkeletonNode(LLXmlTreeNode* root);
  73.357 +		BOOL 	parseXmlMeshNodes(LLXmlTreeNode* root);
  73.358 +		BOOL 	parseXmlColorNodes(LLXmlTreeNode* root);
  73.359 +		BOOL 	parseXmlLayerNodes(LLXmlTreeNode* root);
  73.360 +		BOOL 	parseXmlDriverNodes(LLXmlTreeNode* root);
  73.361 +		BOOL	parseXmlMorphNodes(LLXmlTreeNode* root);
  73.362 +
  73.363 +		struct LLAvatarMeshInfo
  73.364 +		{
  73.365 +			typedef std::pair<LLViewerVisualParamInfo*,BOOL> morph_info_pair_t; // LLPolyMorphTargetInfo stored here
  73.366 +			typedef std::vector<morph_info_pair_t> morph_info_list_t;
  73.367 +
  73.368 +			LLAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {}
  73.369 +			~LLAvatarMeshInfo()
  73.370 +			{
  73.371 +				morph_info_list_t::iterator iter;
  73.372 +				for (iter = mPolyMorphTargetInfoList.begin(); iter != mPolyMorphTargetInfoList.end(); iter++)
  73.373 +				{
  73.374 +					delete iter->first;
  73.375 +				}
  73.376 +				mPolyMorphTargetInfoList.clear();
  73.377 +			}
  73.378 +
  73.379 +			std::string mType;
  73.380 +			S32			mLOD;
  73.381 +			std::string	mMeshFileName;
  73.382 +			std::string	mReferenceMeshName;
  73.383 +			F32			mMinPixelArea;
  73.384 +			morph_info_list_t mPolyMorphTargetInfoList;
  73.385 +		};
  73.386 +		typedef std::vector<LLAvatarMeshInfo*> mesh_info_list_t;
  73.387 +		mesh_info_list_t mMeshInfoList;
  73.388 +
  73.389 +		typedef std::vector<LLViewerVisualParamInfo*> skeletal_distortion_info_list_t; // LLPolySkeletalDistortionInfo stored here
  73.390 +		skeletal_distortion_info_list_t mSkeletalDistortionInfoList;
  73.391 +
  73.392 +		struct LLAvatarAttachmentInfo
  73.393 +		{
  73.394 +			LLAvatarAttachmentInfo()
  73.395 +				: mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(FALSE),
  73.396 +				  mIsHUDAttachment(FALSE), mHasPosition(FALSE), mHasRotation(FALSE) {}
  73.397 +			std::string mName;
  73.398 +			std::string mJointName;
  73.399 +			LLVector3 mPosition;
  73.400 +			LLVector3 mRotationEuler;
  73.401 +			S32 mGroup;
  73.402 +			S32 mAttachmentID;
  73.403 +			S32 mPieMenuSlice;
  73.404 +			BOOL mVisibleFirstPerson;
  73.405 +			BOOL mIsHUDAttachment;
  73.406 +			BOOL mHasPosition;
  73.407 +			BOOL mHasRotation;
  73.408 +		};
  73.409 +		typedef std::vector<LLAvatarAttachmentInfo*> attachment_info_list_t;
  73.410 +		attachment_info_list_t mAttachmentInfoList;
  73.411 +
  73.412 +		LLTexGlobalColorInfo *mTexSkinColorInfo;
  73.413 +		LLTexGlobalColorInfo *mTexHairColorInfo;
  73.414 +		LLTexGlobalColorInfo *mTexEyeColorInfo;
  73.415 +
  73.416 +		typedef std::vector<LLTexLayerSetInfo*> layer_info_list_t;
  73.417 +		layer_info_list_t mLayerInfoList;
  73.418 +
  73.419 +		typedef std::vector<LLDriverParamInfo*> driver_info_list_t;
  73.420 +		driver_info_list_t mDriverInfoList;
  73.421 +
  73.422 +		struct LLAvatarMorphInfo
  73.423 +		{
  73.424 +			LLAvatarMorphInfo()
  73.425 +				: mInvert(FALSE) {}
  73.426 +			std::string mName;
  73.427 +			std::string mRegion;
  73.428 +			std::string mLayer;
  73.429 +			BOOL mInvert;
  73.430 +		};
  73.431 +
  73.432 +		typedef std::vector<LLAvatarMorphInfo*> morph_info_list_t;
  73.433 +		morph_info_list_t	mMorphMaskInfoList;
  73.434 +	};
  73.435 +
  73.436 +
  73.437 +	class LLMaskedMorph
  73.438 +	{
  73.439 +	public:
  73.440 +		LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer);
  73.441 +
  73.442 +		LLVisualParam	*mMorphTarget;
  73.443 +		BOOL				mInvert;
  73.444 +		std::string			mLayer;
  73.445 +	};
  73.446 +/**                    Support Classes
  73.447 + **                                                                            **
  73.448 + *******************************************************************************/
  73.449 +};
  73.450 +
  73.451 +#endif // LL_AVATAR_APPEARANCE_H
    74.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.2 +++ b/indra/llappearance/llavatarappearancedefines.cpp	Thu May 30 21:28:02 2013 +0000
    74.3 @@ -0,0 +1,268 @@
    74.4 +/** 
    74.5 + * @file llavatarappearancedefines.cpp
    74.6 + * @brief Implementation of LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary 
    74.7 + *
    74.8 + * $LicenseInfo:firstyear=2001&license=viewerlgpl$
    74.9 + * Second Life Viewer Source Code
   74.10 + * Copyright (C) 2010, Linden Research, Inc.
   74.11 + * 
   74.12 + * This library is free software; you can redistribute it and/or
   74.13 + * modify it under the terms of the GNU Lesser General Public
   74.14 + * License as published by the Free Software Foundation;
   74.15 + * version 2.1 of the License only.
   74.16 + * 
   74.17 + * This library is distributed in the hope that it will be useful,
   74.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   74.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   74.20 + * Lesser General Public License for more details.
   74.21 + * 
   74.22 + * You should have received a copy of the GNU Lesser General Public
   74.23 + * License along with this library; if not, write to the Free Software
   74.24 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
   74.25 + * 
   74.26 + * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
   74.27 + * $/LicenseInfo$
   74.28 + */
   74.29 +
   74.30 +#include "linden_common.h"
   74.31 +#include "llavatarappearancedefines.h"
   74.32 +
   74.33 +const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 512;
   74.34 +const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 512;
   74.35 +const S32 LLAvatarAppearanceDefines::IMPOSTOR_PERIOD = 2;
   74.36 +
   74.37 +using namespace LLAvatarAppearanceDefines;
   74.38 +
   74.39 +/*********************************************************************************
   74.40 + * Edit this function to add/remove/change textures and mesh definitions for avatars.
   74.41 + */
   74.42 +
   74.43 +LLAvatarAppearanceDictionary::Textures::Textures()
   74.44 +{
   74.45 +	addEntry(TEX_HEAD_BODYPAINT,              new TextureEntry("head_bodypaint",   TRUE,  BAKED_NUM_INDICES, "",                          LLWearableType::WT_SKIN));
   74.46 +	addEntry(TEX_UPPER_SHIRT,                 new TextureEntry("upper_shirt",      TRUE,  BAKED_NUM_INDICES, "UIImgDefaultShirtUUID",     LLWearableType::WT_SHIRT));
   74.47 +	addEntry(TEX_LOWER_PANTS,                 new TextureEntry("lower_pants",      TRUE,  BAKED_NUM_INDICES, "UIImgDefaultPantsUUID",     LLWearableType::WT_PANTS));
   74.48 +	addEntry(TEX_EYES_IRIS,                   new TextureEntry("eyes_iris",        TRUE,  BAKED_NUM_INDICES, "UIImgDefaultEyesUUID",      LLWearableType::WT_EYES));
   74.49 +	addEntry(TEX_HAIR,                        new TextureEntry("hair_grain",       TRUE,  BAKED_NUM_INDICES, "UIImgDefaultHairUUID",      LLWearableType::WT_HAIR));
   74.50 +	addEntry(TEX_UPPER_BODYPAINT,             new TextureEntry("upper_bodypaint",  TRUE,  BAKED_NUM_INDICES, "",                          LLWearableType::WT_SKIN));
   74.51 +	addEntry(TEX_LOWER_BODYPAINT,             new TextureEntry("lower_bodypaint",  TRUE,  BAKED_NUM_INDICES, "",                          LLWearableType::WT_SKIN));
   74.52 +	addEntry(TEX_LOWER_SHOES,                 new TextureEntry("lower_shoes",      TRUE,  BAKED_NUM_INDICES, "UIImgDefaultShoesUUID",     LLWearableType::WT_SHOES));
   74.53 +	addEntry(TEX_LOWER_SOCKS,                 new TextureEntry("lower_socks",      TRUE,  BAKED_NUM_INDICES, "UIImgDefaultSocksUUID",     LLWearableType::WT_SOCKS));
   74.54 +	addEntry(TEX_UPPER_JACKET,                new TextureEntry("upper_jacket",     TRUE,  BAKED_NUM_INDICES, "UIImgDefaultJacketUUID",    LLWearableType::WT_JACKET));
   74.55 +	addEntry(TEX_LOWER_JACKET,                new TextureEntry("lower_jacket",     TRUE,  BAKED_NUM_INDICES, "UIImgDefaultJacketUUID",    LLWearableType::WT_JACKET));
   74.56 +	addEntry(TEX_UPPER_GLOVES,                new TextureEntry("upper_gloves",     TRUE,  BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID",    LLWearableType::WT_GLOVES));
   74.57 +	addEntry(TEX_UPPER_UNDERSHIRT,            new TextureEntry("upper_undershirt", TRUE,  BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERSHIRT));
   74.58 +	addEntry(TEX_LOWER_UNDERPANTS,            new TextureEntry("lower_underpants", TRUE,  BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERPANTS));
   74.59 +	addEntry(TEX_SKIRT,                       new TextureEntry("skirt",            TRUE,  BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID",     LLWearableType::WT_SKIRT));
   74.60 +
   74.61 +	addEntry(TEX_LOWER_ALPHA,                 new TextureEntry("lower_alpha",      TRUE,  BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",     LLWearableType::WT_ALPHA));
   74.62 +	addEntry(TEX_UPPER_ALPHA,                 new TextureEntry("upper_alpha",      TRUE,  BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",     LLWearableType::WT_ALPHA));
   74.63 +	addEntry(TEX_HEAD_ALPHA,                  new TextureEntry("head_alpha",       TRUE,  BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",     LLWearableType::WT_ALPHA));
   74.64 +	addEntry(TEX_EYES_ALPHA,                  new TextureEntry("eyes_alpha",       TRUE,  BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",     LLWearableType::WT_ALPHA));
   74.65 +	addEntry(TEX_HAIR_ALPHA,                  new TextureEntry("hair_alpha",       TRUE,  BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",     LLWearableType::WT_ALPHA));
   74.66 +
   74.67 +	addEntry(TEX_HEAD_TATTOO,                 new TextureEntry("head_tattoo",      TRUE,  BAKED_NUM_INDICES, "",     LLWearableType::WT_TATTOO));
   74.68 +	addEntry(TEX_UPPER_TATTOO,                new TextureEntry("upper_tattoo",     TRUE,  BAKED_NUM_INDICES, "",     LLWearableType::WT_TATTOO));
   74.69 +	addEntry(TEX_LOWER_TATTOO,                new TextureEntry("lower_tattoo",     TRUE,  BAKED_NUM_INDICES, "",     LLWearableType::WT_TATTOO));
   74.70 +
   74.71 +	addEntry(TEX_HEAD_BAKED,                  new TextureEntry("head-baked",       FALSE, BAKED_HEAD, "head"));
   74.72 +	addEntry(TEX_UPPER_BAKED,                 new TextureEntry("upper-baked",      FALSE, BAKED_UPPER, "upper"));
   74.73 +	addEntry(TEX_LOWER_BAKED,                 new TextureEntry("lower-baked",      FALSE, BAKED_LOWER, "lower"));
   74.74 +	addEntry(TEX_EYES_BAKED,                  new TextureEntry("eyes-baked",       FALSE, BAKED_EYES, "eyes"));
   74.75 +	addEntry(TEX_HAIR_BAKED,                  new TextureEntry("hair-baked",       FALSE, BAKED_HAIR, "hair"));
   74.76 +	addEntry(TEX_SKIRT_BAKED,                 new TextureEntry("skirt-baked",      FALSE, BAKED_SKIRT, "skirt"));
   74.77 +}
   74.78 +
   74.79 +LLAvatarAppearanceDictionary::BakedTextures::BakedTextures()
   74.80 +{
   74.81 +	// Baked textures
   74.82 +	addEntry(BAKED_HEAD,       new BakedEntry(TEX_HEAD_BAKED,  
   74.83 +											  "head", "a4b9dc38-e13b-4df9-b284-751efb0566ff", 
   74.84 +											  3, TEX_HEAD_BODYPAINT, TEX_HEAD_TATTOO, TEX_HEAD_ALPHA,
   74.85 +											  5, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_HAIR, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA));
   74.86 +
   74.87 +	addEntry(BAKED_UPPER,      new BakedEntry(TEX_UPPER_BAKED, 
   74.88 +											  "upper_body", "5943ff64-d26c-4a90-a8c0-d61f56bd98d4", 
   74.89 +											  7, TEX_UPPER_SHIRT,TEX_UPPER_BODYPAINT, TEX_UPPER_JACKET,
   74.90 +											  TEX_UPPER_GLOVES, TEX_UPPER_UNDERSHIRT, TEX_UPPER_TATTOO, TEX_UPPER_ALPHA,
   74.91 +											  8, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN,	LLWearableType::WT_SHIRT, LLWearableType::WT_JACKET, LLWearableType::WT_GLOVES, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA));											  
   74.92 +
   74.93 +	addEntry(BAKED_LOWER,      new BakedEntry(TEX_LOWER_BAKED, 
   74.94 +											  "lower_body", "2944ee70-90a7-425d-a5fb-d749c782ed7d",
   74.95 +											  8, TEX_LOWER_PANTS,TEX_LOWER_BODYPAINT,TEX_LOWER_SHOES, TEX_LOWER_SOCKS,
   74.96 +											  TEX_LOWER_JACKET, TEX_LOWER_UNDERPANTS, TEX_LOWER_TATTOO, TEX_LOWER_ALPHA,
   74.97 +											  9, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN,	LLWearableType::WT_PANTS, LLWearableType::WT_SHOES,	 LLWearableType::WT_SOCKS,  LLWearableType::WT_JACKET, LLWearableType::WT_UNDERPANTS, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA));
   74.98 +
   74.99 +	addEntry(BAKED_EYES,       new BakedEntry(TEX_EYES_BAKED,  
  74.100 +											  "eyes", "27b1bc0f-979f-4b13-95fe-b981c2ba9788",
  74.101 +											  2, TEX_EYES_IRIS, TEX_EYES_ALPHA,
  74.102 +											  2, LLWearableType::WT_EYES, LLWearableType::WT_ALPHA));
  74.103 +
  74.104 +	addEntry(BAKED_SKIRT,      new BakedEntry(TEX_SKIRT_BAKED,
  74.105 +											  "skirt", "03e7e8cb-1368-483b-b6f3-74850838ba63", 
  74.106 +											  1, TEX_SKIRT,
  74.107 +											  1, LLWearableType::WT_SKIRT));
  74.108 +
  74.109 +	addEntry(BAKED_HAIR,       new BakedEntry(TEX_HAIR_BAKED,
  74.110 +											  "hair", "a60e85a9-74e8-48d8-8a2d-8129f28d9b61", 
  74.111 +											  2, TEX_HAIR, TEX_HAIR_ALPHA,
  74.112 +											  2, LLWearableType::WT_HAIR, LLWearableType::WT_ALPHA));
  74.113 +}
  74.114 +
  74.115 +LLAvatarAppearanceDictionary::MeshEntries::MeshEntries()
  74.116 +{
  74.117 +	// MeshEntries
  74.118 +	addEntry(MESH_ID_HAIR,             new MeshEntry(BAKED_HAIR,  "hairMesh",         6, PN_4));
  74.119 +	addEntry(MESH_ID_HEAD,             new MeshEntry(BAKED_HEAD,  "headMesh",         5, PN_5));
  74.120 +	addEntry(MESH_ID_EYELASH,          new MeshEntry(BAKED_HEAD,  "eyelashMesh",      1, PN_0)); // no baked mesh associated currently
  74.121 +	addEntry(MESH_ID_UPPER_BODY,       new MeshEntry(BAKED_UPPER, "upperBodyMesh",    5, PN_1));
  74.122 +	addEntry(MESH_ID_LOWER_BODY,       new MeshEntry(BAKED_LOWER, "lowerBodyMesh",    5, PN_2));
  74.123 +	addEntry(MESH_ID_EYEBALL_LEFT,     new MeshEntry(BAKED_EYES,  "eyeBallLeftMesh",  2, PN_3));
  74.124 +	addEntry(MESH_ID_EYEBALL_RIGHT,    new MeshEntry(BAKED_EYES,  "eyeBallRightMesh", 2, PN_3));
  74.125 +	addEntry(MESH_ID_SKIRT,            new MeshEntry(BAKED_SKIRT, "skirtMesh",        5, PN_5));
  74.126 +}
  74.127 +
  74.128 +/*
  74.129 + *
  74.130 + *********************************************************************************/
  74.131 +
  74.132 +LLAvatarAppearanceDictionary::LLAvatarAppearanceDictionary()
  74.133 +{
  74.134 +	createAssociations();
  74.135 +}
  74.136 +
  74.137 +//virtual 
  74.138 +LLAvatarAppearanceDictionary::~LLAvatarAppearanceDictionary()
  74.139 +{
  74.140 +}
  74.141 +
  74.142 +// Baked textures are composites of textures; for each such composited texture,
  74.143 +// map it to the baked texture.
  74.144 +void LLAvatarAppearanceDictionary::createAssociations()
  74.145 +{
  74.146 +	for (BakedTextures::const_iterator iter = mBakedTextures.begin(); iter != mBakedTextures.end(); iter++)
  74.147 +	{
  74.148 +		const EBakedTextureIndex baked_index = (iter->first);
  74.149 +		const BakedEntry *dict = (iter->second);
  74.150 +
  74.151 +		// For each texture that this baked texture index affects, associate those textures
  74.152 +		// with this baked texture index.
  74.153 +		for (texture_vec_t::const_iterator local_texture_iter = dict->mLocalTextures.begin();
  74.154 +			 local_texture_iter != dict->mLocalTextures.end();
  74.155 +			 local_texture_iter++)
  74.156 +		{
  74.157 +			const ETextureIndex local_texture_index = (ETextureIndex) *local_texture_iter;
  74.158 +			mTextures[local_texture_index]->mIsUsedByBakedTexture = true;
  74.159 +			mTextures[local_texture_index]->mBakedTextureIndex = baked_index;
  74.160 +		}
  74.161 +	}
  74.162 +		
  74.163 +}
  74.164 +
  74.165 +LLAvatarAppearanceDictionary::TextureEntry::TextureEntry(const std::string &name,
  74.166 +												 bool is_local_texture, 
  74.167 +												 EBakedTextureIndex baked_texture_index,
  74.168 +												 const std::string &default_image_name,
  74.169 +												 LLWearableType::EType wearable_type) :
  74.170 +	LLDictionaryEntry(name),
  74.171 +	mIsLocalTexture(is_local_texture),
  74.172 +	mIsBakedTexture(!is_local_texture),
  74.173 +	mIsUsedByBakedTexture(baked_texture_index != BAKED_NUM_INDICES),
  74.174 +	mBakedTextureIndex(baked_texture_index),
  74.175 +	mDefaultImageName(default_image_name),
  74.176 +	mWearableType(wearable_type)
  74.177 +{
  74.178 +}
  74.179 +
  74.180 +LLAvatarAppearanceDictionary::MeshEntry::MeshEntry(EBakedTextureIndex baked_index, 
  74.181 +										   const std::string &name, 
  74.182 +										   U8 level,
  74.183 +										   LLJointPickName pick) :
  74.184 +	LLDictionaryEntry(name),
  74.185 +	mBakedID(baked_index),
  74.186 +	mLOD(level),
  74.187 +	mPickName(pick)
  74.188 +{
  74.189 +}
  74.190 +LLAvatarAppearanceDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index, 
  74.191 +											 const std::string &name, 
  74.192 +											 const std::string &hash_name,
  74.193 +											 U32 num_local_textures,
  74.194 +											 ... ) :
  74.195 +	LLDictionaryEntry(name),
  74.196 +	mWearablesHashID(LLUUID(hash_name)),
  74.197 +	mTextureIndex(tex_index)
  74.198 +{
  74.199 +	va_list argp;
  74.200 +
  74.201 +	va_start(argp, num_local_textures);
  74.202 +
  74.203 +	// Read in local textures
  74.204 +	for (U8 i=0; i < num_local_textures; i++)
  74.205 +	{
  74.206 +		ETextureIndex t = (ETextureIndex)va_arg(argp,int);
  74.207 +		mLocalTextures.push_back(t);
  74.208 +	}
  74.209 +
  74.210 +	// Read in number of wearables
  74.211 +	const U32 num_wearables = (U32)va_arg(argp,int);
  74.212 +	// Read in wearables
  74.213 +	for (U8 i=0; i < num_wearables; i++)
  74.214 +	{
  74.215 +		LLWearableType::EType t = (LLWearableType::EType)va_arg(argp,int);
  74.216 +		mWearables.push_back(t);
  74.217 +	}
  74.218 +}
  74.219 +
  74.220 +// static
  74.221 +ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextureIndex index)
  74.222 +{
  74.223 +	return LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(index)->mTextureIndex;
  74.224 +}
  74.225 +
  74.226 +// static
  74.227 +EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::string name)
  74.228 +{
  74.229 +	U8 index = 0;
  74.230 +	while (index < BAKED_NUM_INDICES)
  74.231 +	{
  74.232 +		const BakedEntry *be = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex) index);
  74.233 +		if (be && be->mName.compare(name) == 0)
  74.234 +		{
  74.235 +			// baked texture found
  74.236 +			return (EBakedTextureIndex) index;
  74.237 +		}
  74.238 +		index++;
  74.239 +	}
  74.240 +	// baked texture could not be found
  74.241 +	return BAKED_NUM_INDICES;
  74.242 +}
  74.243 +
  74.244 +// static 
  74.245 +EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::string name)
  74.246 +{
  74.247 +	U8 index = 0;
  74.248 +	while (index < BAKED_NUM_INDICES)
  74.249 +	{
  74.250 +		const BakedEntry *be = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex) index);
  74.251 +		if (be)
  74.252 +		{
  74.253 +			const TextureEntry *te = LLAvatarAppearanceDictionary::getInstance()->getTexture(be->mTextureIndex);
  74.254 +			if (te && te->mDefaultImageName.compare(name) == 0)
  74.255 +			{
  74.256 +				// baked texture found
  74.257 +				return (EBakedTextureIndex) index;
  74.258 +			}
  74.259 +		}
  74.260 +		index++;
  74.261 +	}
  74.262 +	// baked texture could not be found
  74.263 +	return BAKED_NUM_INDICES;
  74.264 +}
  74.265 +
  74.266 +// static
  74.267 +LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIndex index )
  74.268 +{
  74.269 +	return getInstance()->getTexture(index)->mWearableType;
  74.270 +}
  74.271 +
    75.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.2 +++ b/indra/llappearance/llavatarappearancedefines.h	Thu May 30 21:28:02 2013 +0000
    75.3 @@ -0,0 +1,231 @@
    75.4 +/** 
    75.5 + * @file llavatarappearancedefines.h
    75.6 + * @brief Various LLAvatarAppearance related definitions
    75.7 + * LLViewerObject
    75.8 + *
    75.9 + * $LicenseInfo:firstyear=2001&license=viewerlgpl$
   75.10 + * Second Life Viewer Source Code
   75.11 + * Copyright (C) 2010, Linden Research, Inc.
   75.12 + * 
   75.13 + * This library is free software; you can redistribute it and/or
   75.14 + * modify it under the terms of the GNU Lesser General Public
   75.15 + * License as published by the Free Software Foundation;
   75.16 + * version 2.1 of the License only.
   75.17 + * 
   75.18 + * This library is distributed in the hope that it will be useful,
   75.19 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   75.20 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   75.21 + * Lesser General Public License for more details.
   75.22 + * 
   75.23 + * You should have received a copy of the GNU Lesser General Public
   75.24 + * License along with this library; if not, write to the Free Software
   75.25 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
   75.26 + * 
   75.27 + * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
   75.28 + * $/LicenseInfo$
   75.29 + */
   75.30 +
   75.31 +#ifndef LL_AVATARAPPEARANCE_DEFINES_H
   75.32 +#define LL_AVATARAPPEARANCE_DEFINES_H
   75.33 +
   75.34 +#include <vector>
   75.35 +#include "lljointpickname.h"
   75.36 +#include "lldictionary.h"
   75.37 +#include "llwearabletype.h"
   75.38 +#include "lluuid.h"
   75.39 +
   75.40 +namespace LLAvatarAppearanceDefines
   75.41 +{
   75.42 +
   75.43 +extern const S32 SCRATCH_TEX_WIDTH;
   75.44 +extern const S32 SCRATCH_TEX_HEIGHT;
   75.45 +extern const S32 IMPOSTOR_PERIOD;
   75.46 +
   75.47 +static const U32 AVATAR_HOVER = 11001;
   75.48 +
   75.49 +//--------------------------------------------------------------------
   75.50 +// Enums
   75.51 +//--------------------------------------------------------------------
   75.52 +enum ETextureIndex
   75.53 +{
   75.54 +	TEX_INVALID = -1,
   75.55 +	TEX_HEAD_BODYPAINT = 0,
   75.56 +	TEX_UPPER_SHIRT,
   75.57 +	TEX_LOWER_PANTS,
   75.58 +	TEX_EYES_IRIS,
   75.59 +	TEX_HAIR,
   75.60 +	TEX_UPPER_BODYPAINT,
   75.61 +	TEX_LOWER_BODYPAINT,
   75.62 +	TEX_LOWER_SHOES,
   75.63 +	TEX_HEAD_BAKED,		// Pre-composited
   75.64 +	TEX_UPPER_BAKED,	// Pre-composited
   75.65 +	TEX_LOWER_BAKED,	// Pre-composited
   75.66 +	TEX_EYES_BAKED,		// Pre-composited
   75.67 +	TEX_LOWER_SOCKS,
   75.68 +	TEX_UPPER_JACKET,
   75.69 +	TEX_LOWER_JACKET,
   75.70 +	TEX_UPPER_GLOVES,
   75.71 +	TEX_UPPER_UNDERSHIRT,
   75.72 +	TEX_LOWER_UNDERPANTS,
   75.73 +	TEX_SKIRT,
   75.74 +	TEX_SKIRT_BAKED,	// Pre-composited
   75.75 +	TEX_HAIR_BAKED,     // Pre-composited
   75.76 +	TEX_LOWER_ALPHA,
   75.77 +	TEX_UPPER_ALPHA,
   75.78 +	TEX_HEAD_ALPHA,
   75.79 +	TEX_EYES_ALPHA,
   75.80 +	TEX_HAIR_ALPHA,
   75.81 +	TEX_HEAD_TATTOO,
   75.82 +	TEX_UPPER_TATTOO,
   75.83 +	TEX_LOWER_TATTOO,
   75.84 +	TEX_NUM_INDICES
   75.85 +}; 
   75.86 +
   75.87 +enum EBakedTextureIndex
   75.88 +{
   75.89 +	BAKED_HEAD = 0,
   75.90 +	BAKED_UPPER,
   75.91 +	BAKED_LOWER,
   75.92 +	BAKED_EYES,
   75.93 +	BAKED_SKIRT,
   75.94 +	BAKED_HAIR,
   75.95 +	BAKED_NUM_INDICES
   75.96 +};
   75.97 +
   75.98 +// Reference IDs for each mesh. Used as indices for vector of joints
   75.99 +enum EMeshIndex
  75.100 +{
  75.101 +	MESH_ID_HAIR = 0,
  75.102 +	MESH_ID_HEAD,
  75.103 +	MESH_ID_EYELASH,
  75.104 +	MESH_ID_UPPER_BODY,
  75.105 +	MESH_ID_LOWER_BODY,
  75.106 +	MESH_ID_EYEBALL_LEFT,
  75.107 +	MESH_ID_EYEBALL_RIGHT,
  75.108 +	MESH_ID_SKIRT,
  75.109 +	MESH_ID_NUM_INDICES
  75.110 +};
  75.111 +
  75.112 +//--------------------------------------------------------------------
  75.113 +// Vector Types
  75.114 +//--------------------------------------------------------------------
  75.115 +typedef std::vector<ETextureIndex> texture_vec_t;
  75.116 +typedef std::vector<EBakedTextureIndex> bakedtexture_vec_t;
  75.117 +typedef std::vector<EMeshIndex> mesh_vec_t;
  75.118 +typedef std::vector<LLWearableType::EType> wearables_vec_t;
  75.119 +
  75.120 +//------------------------------------------------------------------------
  75.121 +// LLAvatarAppearanceDictionary
  75.122 +// 
  75.123 +// Holds dictionary static entries for textures, baked textures, meshes, etc.; i.e.
  75.124 +// information that is common to all avatars.
  75.125 +// 
  75.126 +// This holds const data - it is initialized once and the contents never change after that.
  75.127 +//------------------------------------------------------------------------
  75.128 +class LLAvatarAppearanceDictionary : public LLSingleton<LLAvatarAppearanceDictionary>
  75.129 +{
  75.130 +	//--------------------------------------------------------------------
  75.131 +	// Constructors and Destructors
  75.132 +	//--------------------------------------------------------------------
  75.133 +public:
  75.134 +	LLAvatarAppearanceDictionary();
  75.135 +	virtual ~LLAvatarAppearanceDictionary();
  75.136 +private:
  75.137 +	void createAssociations();
  75.138 +	
  75.139 +	//--------------------------------------------------------------------
  75.140 +	// Local and baked textures
  75.141 +	//--------------------------------------------------------------------
  75.142 +public:
  75.143 +	struct TextureEntry : public LLDictionaryEntry
  75.144 +	{
  75.145 +		TextureEntry(const std::string &name, // this must match the xml name used by LLTexLayerInfo::parseXml
  75.146 +					 bool is_local_texture, 
  75.147 +					 EBakedTextureIndex baked_texture_index = BAKED_NUM_INDICES,
  75.148 +					 const std::string& default_image_name = "",
  75.149 +					 LLWearableType::EType wearable_type = LLWearableType::WT_INVALID);
  75.150 +		const std::string 	mDefaultImageName;
  75.151 +		const LLWearableType::EType mWearableType;
  75.152 +		// It's either a local texture xor baked
  75.153 +		BOOL 				mIsLocalTexture;
  75.154 +		BOOL 				mIsBakedTexture;
  75.155 +		// If it's a local texture, it may be used by a baked texture
  75.156 +		BOOL 				mIsUsedByBakedTexture;
  75.157 +		EBakedTextureIndex 	mBakedTextureIndex;
  75.158 +	};
  75.159 +
  75.160 +	struct Textures : public LLDictionary<ETextureIndex, TextureEntry>
  75.161 +	{
  75.162 +		Textures();
  75.163 +	} mTextures;
  75.164 +	const TextureEntry*		getTexture(ETextureIndex index) const { return mTextures.lookup(index); }
  75.165 +	const Textures&			getTextures() const { return mTextures; }
  75.166 +	
  75.167 +	//--------------------------------------------------------------------
  75.168 +	// Meshes
  75.169 +	//--------------------------------------------------------------------
  75.170 +public:
  75.171 +	struct MeshEntry : public LLDictionaryEntry
  75.172 +	{
  75.173 +		MeshEntry(EBakedTextureIndex baked_index, 
  75.174 +				  const std::string &name, // names of mesh types as they are used in avatar_lad.xml
  75.175 +				  U8 level,
  75.176 +				  LLJointPickName pick);
  75.177 +		// Levels of Detail for each mesh.  Must match levels of detail present in avatar_lad.xml
  75.178 +        // Otherwise meshes will be unable to be found, or levels of detail will be ignored
  75.179 +		const U8 						mLOD;
  75.180 +		const EBakedTextureIndex 		mBakedID;
  75.181 +		const LLJointPickName 	mPickName;
  75.182 +	};
  75.183 +
  75.184 +	struct MeshEntries : public LLDictionary<EMeshIndex, MeshEntry>
  75.185 +	{
  75.186 +		MeshEntries();
  75.187 +	} mMeshEntries;
  75.188 +	const MeshEntry*		getMeshEntry(EMeshIndex index) const { return mMeshEntries.lookup(index); }
  75.189 +	const MeshEntries&		getMeshEntries() const { return mMeshEntries; }
  75.190 +
  75.191 +	//--------------------------------------------------------------------
  75.192 +	// Baked Textures
  75.193 +	//--------------------------------------------------------------------
  75.194 +public:
  75.195 +	struct BakedEntry : public LLDictionaryEntry
  75.196 +	{
  75.197 +		BakedEntry(ETextureIndex tex_index, 
  75.198 +				   const std::string &name, // unused, but necessary for templating.
  75.199 +				   const std::string &hash_name,
  75.200 +				   U32 num_local_textures, ... ); // # local textures, local texture list, # wearables, wearable list
  75.201 +		// Local Textures
  75.202 +		const ETextureIndex mTextureIndex;
  75.203 +		texture_vec_t 		mLocalTextures;
  75.204 +		// Wearables
  75.205 +		const LLUUID 		mWearablesHashID;
  75.206 +		wearables_vec_t 	mWearables;
  75.207 +	};
  75.208 +
  75.209 +	struct BakedTextures: public LLDictionary<EBakedTextureIndex, BakedEntry>
  75.210 +	{
  75.211 +		BakedTextures();
  75.212 +	} mBakedTextures;
  75.213 +	const BakedEntry*		getBakedTexture(EBakedTextureIndex index) const { return mBakedTextures.lookup(index); }
  75.214 +	const BakedTextures&	getBakedTextures() const { return mBakedTextures; }
  75.215 +	
  75.216 +	//--------------------------------------------------------------------
  75.217 +	// Convenience Functions
  75.218 +	//--------------------------------------------------------------------
  75.219 +public:
  75.220 +	// Convert from baked texture to associated texture; e.g. BAKED_HEAD -> TEX_HEAD_BAKED
  75.221 +	static ETextureIndex 		bakedToLocalTextureIndex(EBakedTextureIndex t);
  75.222 +
  75.223 +	// find a baked texture index based on its name
  75.224 +	static EBakedTextureIndex 	findBakedByRegionName(std::string name);
  75.225 +	static EBakedTextureIndex 	findBakedByImageName(std::string name);
  75.226 +
  75.227 +	// Given a texture entry, determine which wearable type owns it.
  75.228 +	static LLWearableType::EType 		getTEWearableType(ETextureIndex index);
  75.229 +
  75.230 +}; // End LLAvatarAppearanceDictionary
  75.231 +
  75.232 +} // End namespace LLAvatarAppearanceDefines
  75.233 +
  75.234 +#endif //LL_AVATARAPPEARANCE_DEFINES_H
    76.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.2 +++ b/indra/llappearance/llavatarjoint.cpp	Thu May 30 21:28:02 2013 +0000
    76.3 @@ -0,0 +1,326 @@
    76.4 +/** 
    76.5 + * @file llavatarjoint.cpp
    76.6 + * @brief Implementation of LLAvatarJoint class
    76.7 + *
    76.8 + * $LicenseInfo:firstyear=2001&license=viewerlgpl$
    76.9 + * Second Life Viewer Source Code
   76.10 + * Copyright (C) 2010, Linden Research, Inc.
   76.11 + * 
   76.12 + * This library is free software; you can redistribute it and/or
   76.13 + * modify it under the terms of the GNU Lesser General Public
   76.14 + * License as published by the Free Software Foundation;
   76.15 + * version 2.1 of the License only.
   76.16 + * 
   76.17 + * This library is distributed in the hope that it will be useful,
   76.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   76.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   76.20 + * Lesser General Public License for more details.
   76.21 + * 
   76.22 + * You should have received a copy of the GNU Lesser General Public
   76.23 + * License along with this library; if not, write to the Free Software
   76.24 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
   76.25 + * 
   76.26 + * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
   76.27 + * $/LicenseInfo$
   76.28 + */
   76.29 +
   76.30 +//-----------------------------------------------------------------------------
   76.31 +// Header Files
   76.32 +//-----------------------------------------------------------------------------
   76.33 +#include "llavatarjoint.h"
   76.34 +
   76.35 +#include "llgl.h"
   76.36 +#include "llrender.h"
   76.37 +#include "llmath.h"
   76.38 +#include "llglheaders.h"
   76.39 +#include "llavatarappearance.h"
   76.40 +
   76.41 +const F32 DEFAULT_AVATAR_JOINT_LOD = 0.0f;
   76.42 +
   76.43 +//-----------------------------------------------------------------------------
   76.44 +// Static Data
   76.45 +//-----------------------------------------------------------------------------
   76.46 +BOOL					LLAvatarJoint::sDisableLOD = FALSE;
   76.47 +
   76.48 +//-----------------------------------------------------------------------------
   76.49 +// LLAvatarJoint()
   76.50 +// Class Constructors
   76.51 +//-----------------------------------------------------------------------------
   76.52 +LLAvatarJoint::LLAvatarJoint() :
   76.53 +	LLJoint()
   76.54 +{
   76.55 +	init();
   76.56 +}
   76.57 +
   76.58 +LLAvatarJoint::LLAvatarJoint(const std::string &name, LLJoint *parent) :
   76.59 +	LLJoint(name, parent)
   76.60 +{
   76.61 +	init();
   76.62 +}
   76.63 +
   76.64 +LLAvatarJoint::LLAvatarJoint(S32 joint_num) :
   76.65 +	LLJoint(joint_num)
   76.66 +{
   76.67 +	init();
   76.68 +}
   76.69 +
   76.70 +
   76.71 +void LLAvatarJoint::init()
   76.72 +{
   76.73 +	mValid = FALSE;
   76.74 +	mComponents = SC_JOINT | SC_BONE | SC_AXES;
   76.75 +	mMinPixelArea = DEFAULT_AVATAR_JOINT_LOD;
   76.76 +	mPickName = PN_DEFAULT;
   76.77 +	mVisible = TRUE;
   76.78 +	mMeshID = 0;
   76.79 +	mIsTransparent = FALSE;
   76.80 +}
   76.81 +
   76.82 +
   76.83 +//-----------------------------------------------------------------------------
   76.84 +// ~LLAvatarJoint()
   76.85 +// Class Destructor
   76.86 +//-----------------------------------------------------------------------------
   76.87 +LLAvatarJoint::~LLAvatarJoint()
   76.88 +{
   76.89 +}
   76.90 +
   76.91 +
   76.92 +//--------------------------------------------------------------------
   76.93 +// setValid()
   76.94 +//--------------------------------------------------------------------
   76.95 +void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
   76.96 +{
   76.97 +	//----------------------------------------------------------------
   76.98 +	// set visibility for this joint
   76.99 +	//----------------------------------------------------------------
  76.100 +	mValid = valid;
  76.101 +	
  76.102 +	//----------------------------------------------------------------
  76.103 +	// set visibility for children
  76.104 +	//----------------------------------------------------------------
  76.105 +	if (recursive)
  76.106 +	{
  76.107 +		for (child_list_t::iterator iter = mChildren.begin();
  76.108 +			 iter != mChildren.end(); ++iter)
  76.109 +		{
  76.110 +			LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
  76.111 +			joint->setValid(valid, TRUE);
  76.112 +		}
  76.113 +	}
  76.114 +
  76.115 +}
  76.116 +
  76.117 +//--------------------------------------------------------------------
  76.118 +// setSkeletonComponents()
  76.119 +//--------------------------------------------------------------------
  76.120 +void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive )
  76.121 +{
  76.122 +	mComponents = comp;
  76.123 +	if (recursive)
  76.124 +	{
  76.125 +		for (child_list_t::iterator iter = mChildren.begin();
  76.126 +			 iter != mChildren.end(); ++iter)
  76.127 +		{
  76.128 +			LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
  76.129 +			joint->setSkeletonComponents(comp, recursive);
  76.130 +		}
  76.131 +	}
  76.132 +}
  76.133 +
  76.134 +void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive)
  76.135 +{
  76.136 +	mVisible = visible;
  76.137 +
  76.138 +	if (recursive)
  76.139 +	{
  76.140 +		for (child_list_t::iterator iter = mChildren.begin();
  76.141 +			 iter != mChildren.end(); ++iter)
  76.142 +		{
  76.143 +			LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
  76.144 +			joint->setVisible(visible, recursive);
  76.145 +		}
  76.146 +	}
  76.147 +}
  76.148 +
  76.149 +void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area)
  76.150 +{
  76.151 +	for (child_list_t::iterator iter = mChildren.begin();
  76.152 +		 iter != mChildren.end(); ++iter)
  76.153 +	{
  76.154 +		LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
  76.155 +		joint->updateFaceSizes(num_vertices, num_indices, pixel_area);
  76.156 +	}
  76.157 +}
  76.158 +
  76.159 +void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update)
  76.160 +{
  76.161 +	for (child_list_t::iterator iter = mChildren.begin();
  76.162 +		 iter != mChildren.end(); ++iter)
  76.163 +	{
  76.164 +		LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
  76.165 +		joint->updateFaceData(face, pixel_area, damp_wind, terse_update);
  76.166 +	}
  76.167 +}
  76.168 +
  76.169 +void LLAvatarJoint::updateJointGeometry()
  76.170 +{
  76.171 +	for (child_list_t::iterator iter = mChildren.begin();
  76.172 +		 iter != mChildren.end(); ++iter)
  76.173 +	{
  76.174 +		LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
  76.175 +		joint->updateJointGeometry();
  76.176 +	}
  76.177 +}
  76.178 +
  76.179 +
  76.180 +BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
  76.181 +{
  76.182 +	BOOL lod_changed = FALSE;
  76.183 +	BOOL found_lod = FALSE;
  76.184 +
  76.185 +	for (child_list_t::iterator iter = mChildren.begin();
  76.186 +		 iter != mChildren.end(); ++iter)
  76.187 +	{
  76.188 +		L