PageRenderTime 37ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/linux_tools/wrapper.sh

https://bitbucket.org/lindenlab/viewer-beta/
Shell | 147 lines | 45 code | 24 blank | 78 comment | 9 complexity | e92c11c589d55659d698f9d9634e5c40 MD5 | raw file
Possible License(s): LGPL-2.1
  1. #!/bin/bash
  2. ## Here are some configuration options for Linux Client Testers.
  3. ## These options are for self-assisted troubleshooting during this beta
  4. ## testing phase; you should not usually need to touch them.
  5. ## - Avoids using any OpenAL audio driver.
  6. #export LL_BAD_OPENAL_DRIVER=x
  7. ## - Avoids using any FMOD audio driver.
  8. #export LL_BAD_FMOD_DRIVER=x
  9. ## - Avoids using the FMOD ESD audio driver.
  10. #export LL_BAD_FMOD_ESD=x
  11. ## - Avoids using the FMOD OSS audio driver.
  12. #export LL_BAD_FMOD_OSS=x
  13. ## - Avoids using the FMOD ALSA audio driver.
  14. #export LL_BAD_FMOD_ALSA=x
  15. ## - Avoids the optional OpenGL extensions which have proven most problematic
  16. ## on some hardware. Disabling this option may cause BETTER PERFORMANCE but
  17. ## may also cause CRASHES and hangs on some unstable combinations of drivers
  18. ## and hardware.
  19. ## NOTE: This is now disabled by default.
  20. #export LL_GL_BASICEXT=x
  21. ## - Avoids *all* optional OpenGL extensions. This is the safest and least-
  22. ## exciting option. Enable this if you experience stability issues, and
  23. ## report whether it helps in the Linux Client Testers forum.
  24. #export LL_GL_NOEXT=x
  25. ## - For advanced troubleshooters, this lets you disable specific GL
  26. ## extensions, each of which is represented by a letter a-o. If you can
  27. ## narrow down a stability problem on your system to just one or two
  28. ## extensions then please post details of your hardware (and drivers) to
  29. ## the Linux Client Testers forum along with the minimal
  30. ## LL_GL_BLACKLIST which solves your problems.
  31. #export LL_GL_BLACKLIST=abcdefghijklmno
  32. ## - Some ATI/Radeon users report random X server crashes when the mouse
  33. ## cursor changes shape. If you suspect that you are a victim of this
  34. ## driver bug, try enabling this option and report whether it helps:
  35. #export LL_ATI_MOUSE_CURSOR_BUG=x
  36. if [ "`uname -m`" = "x86_64" ]; then
  37. echo '64-bit Linux detected.'
  38. fi
  39. ## Everything below this line is just for advanced troubleshooters.
  40. ##-------------------------------------------------------------------
  41. ## - For advanced debugging cases, you can run the viewer under the
  42. ## control of another program, such as strace, gdb, or valgrind. If
  43. ## you're building your own viewer, bear in mind that the executable
  44. ## in the bin directory will be stripped: you should replace it with
  45. ## an unstripped binary before you run.
  46. #export LL_WRAPPER='gdb --args'
  47. #export LL_WRAPPER='valgrind --smc-check=all --error-limit=no --log-file=secondlife.vg --leak-check=full --suppressions=/usr/lib/valgrind/glibc-2.5.supp --suppressions=secondlife-i686.supp'
  48. ## - Avoids an often-buggy X feature that doesn't really benefit us anyway.
  49. export SDL_VIDEO_X11_DGAMOUSE=0
  50. ## - Works around a problem with misconfigured 64-bit systems not finding GL
  51. export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH}":/usr/lib64/dri:/usr/lib32/dri:/usr/lib/dri
  52. ## - The 'scim' GTK IM module widely crashes the viewer. Avoid it.
  53. if [ "$GTK_IM_MODULE" = "scim" ]; then
  54. export GTK_IM_MODULE=xim
  55. fi
  56. ## - Automatically work around the ATI mouse cursor crash bug:
  57. ## (this workaround is disabled as most fglrx users do not see the bug)
  58. #if lsmod | grep fglrx &>/dev/null ; then
  59. # export LL_ATI_MOUSE_CURSOR_BUG=x
  60. #fi
  61. ## Nothing worth editing below this line.
  62. ##-------------------------------------------------------------------
  63. SCRIPTSRC=`readlink -f "$0" || echo "$0"`
  64. RUN_PATH=`dirname "${SCRIPTSRC}" || echo .`
  65. echo "Running from ${RUN_PATH}"
  66. cd "${RUN_PATH}"
  67. # Re-register the secondlife:// protocol handler every launch, for now.
  68. ./etc/register_secondlifeprotocol.sh
  69. # Re-register the application with the desktop system every launch, for now.
  70. ./etc/refresh_desktop_app_entry.sh
  71. ## Before we mess with LD_LIBRARY_PATH, save the old one to restore for
  72. ## subprocesses that care.
  73. export SAVED_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
  74. # if [ -n "$LL_TCMALLOC" ]; then
  75. # tcmalloc_libs='/usr/lib/libtcmalloc.so.0 /usr/lib/libstacktrace.so.0 /lib/libpthread.so.0'
  76. # all=1
  77. # for f in $tcmalloc_libs; do
  78. # if [ ! -f $f ]; then
  79. # all=0
  80. # fi
  81. # done
  82. # if [ $all != 1 ]; then
  83. # echo 'Cannot use tcmalloc libraries: components missing' 1>&2
  84. # else
  85. # export LD_PRELOAD=$(echo $tcmalloc_libs | tr ' ' :)
  86. # if [ -z "$HEAPCHECK" -a -z "$HEAPPROFILE" ]; then
  87. # export HEAPCHECK=${HEAPCHECK:-normal}
  88. # fi
  89. # fi
  90. #fi
  91. export SL_ENV='LD_LIBRARY_PATH="`pwd`"/lib:"${LD_LIBRARY_PATH}"'
  92. export SL_CMD='$LL_WRAPPER bin/do-not-directly-run-secondlife-bin'
  93. export SL_OPT="`cat etc/gridargs.dat` $@"
  94. # Run the program
  95. eval ${SL_ENV} ${SL_CMD} ${SL_OPT} || LL_RUN_ERR=runerr
  96. # Handle any resulting errors
  97. if [ -n "$LL_RUN_ERR" ]; then
  98. LL_RUN_ERR_MSG=""
  99. if [ "$LL_RUN_ERR" = "runerr" ]; then
  100. # generic error running the binary
  101. echo '*** Bad shutdown. ***'
  102. if [ "`uname -m`" = "x86_64" ]; then
  103. echo
  104. cat << EOFMARKER
  105. You are running the Second Life Viewer on a x86_64 platform. The
  106. most common problems when launching the Viewer (particularly
  107. 'bin/do-not-directly-run-secondlife-bin: not found' and 'error while
  108. loading shared libraries') may be solved by installing your Linux
  109. distribution's 32-bit compatibility packages.
  110. For example, on Ubuntu and other Debian-based Linuxes you might run:
  111. $ sudo apt-get install ia32-libs ia32-libs-gtk ia32-libs-kde ia32-libs-sdl
  112. EOFMARKER
  113. fi
  114. fi
  115. fi
  116. echo
  117. echo '*******************************************************'
  118. echo 'This is a BETA release of the Second Life linux client.'
  119. echo 'Thank you for testing!'
  120. echo 'Please see README-linux.txt before reporting problems.'
  121. echo