Clone of mesa.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/bash
  2. # Copyright (C) 2006 Thomas Sondergaard
  3. # All Rights Reserved.
  4. #
  5. # Permission is hereby granted, free of charge, to any person obtaining a
  6. # copy of this software and associated documentation files (the "Software"),
  7. # to deal in the Software without restriction, including without limitation
  8. # on the rights to use, copy, modify, merge, publish, distribute, sub
  9. # license, and/or sell copies of the Software, and to permit persons to whom
  10. # the Software is furnished to do so, subject to the following conditions:
  11. #
  12. # The above copyright notice and this permission notice (including the next
  13. # paragraph) shall be included in all copies or substantial portions of the
  14. # Software.
  15. #
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  19. # IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  21. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  22. # IN THE SOFTWARE.
  23. #
  24. # Authors:
  25. # Thomas Sondergaard <ts@medical-insight.com>
  26. usage="usage: $0 [ -hctev ] [-l LOGFILE] program [args...]\n\t-h\t\thelp (this text)\n\t-c\t\tlog gl calls\n\t-t\t\ttime stamp log entries\n\t-e\t\tcheck for and log errors. errors occurring between\n\t\t\tglBegin() and glEnd() are checked at glEnd()\n\t-v\t\tverbose. Shows configuration settings passed to\n\t\t\tgltrace.so\n\t-l LOGFILE\tlogfile. Default is stderr"
  27. # Path to gltrace.so - must not be relative
  28. #GLTRACE_SO=/home/ts/Mesa_gltrace/src/mesa/glapi/gltrace.so
  29. # This seems to work:
  30. GLTRACE_SO=./gltrace.so
  31. # Set options from command line
  32. VERBOSE=0
  33. GLTRACE_LOG_CALLS=0
  34. GLTRACE_LOG_TIME=0
  35. GLTRACE_CHECK_ERRORS=0
  36. export GLTRACE_LOG_CALLS GLTRACE_LOG_TIME GLTRACE_CHECK_ERRORS
  37. if [ $# -eq 0 ]; then
  38. echo -e $usage
  39. exit
  40. fi
  41. while getopts "hctevl:" options; do
  42. case $options in
  43. h) echo -e $usage
  44. exit 1;;
  45. c) GLTRACE_LOG_CALLS=1;;
  46. t) GLTRACE_LOG_TIME=1;;
  47. e) GLTRACE_CHECK_ERRORS=1;;
  48. l) GLTRACE_LOGFILE=$OPTARG
  49. export GLTRACE_LOGFILE;;
  50. v) VERBOSE=1;;
  51. *) echo -e $usage
  52. exit 1;;
  53. esac
  54. done
  55. # Remove the parsed args
  56. shift $(($OPTIND-1))
  57. if [ ! -r $GLTRACE_SO ]; then
  58. echo "Error: The gltrace.so file '$GLTRACE_SO' is missing!"
  59. exit 1
  60. fi
  61. export LD_PRELOAD=$GLTRACE_SO
  62. if [ $VERBOSE -eq 1 ]; then
  63. echo GLTRACE_LOG_CALLS=$GLTRACE_LOG_CALLS
  64. echo GLTRACE_LOG_TIME=$GLTRACE_LOG_TIME
  65. echo GLTRACE_CHECK_ERRORS=$GLTRACE_CHECK_ERRORS
  66. echo GLTRACE_LOGFILE=$GLTRACE_LOGFILE
  67. echo LD_PRELOAD=$LD_PRELOAD
  68. echo command=$*
  69. fi
  70. exec $*