PageRenderTime 17ms CodeModel.GetById 2ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 1ms

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