assaultcube.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/sh
  2. # CUBE_DIR should refer to the directory in which AssaultCube is placed.
  3. #CUBE_DIR=~/assaultcube
  4. #CUBE_DIR=/usr/local/assaultcube
  5. #CUBE_DIR=.
  6. CUBE_DIR=$(dirname "$(readlink -f "${0}")")
  7. # CUBE_OPTIONS starts AssaultCube with any command line options you choose.
  8. #CUBE_OPTIONS="-f"
  9. CUBE_OPTIONS="--home=${HOME}/.assaultcube/v1.3 --init"
  10. # SYSTEM_NAME should be set to the name of your operating system.
  11. #SYSTEM_NAME=Linux
  12. SYSTEM_NAME=`uname -s`
  13. # MACHINE_NAME should be set to the architecture of your processor.
  14. #MACHINE_NAME=i686
  15. MACHINE_NAME=`uname -m`
  16. case ${SYSTEM_NAME} in
  17. Linux)
  18. SYSTEM_NAME=linux_
  19. ;;
  20. *)
  21. SYSTEM_NAME=unknown_
  22. ;;
  23. esac
  24. case ${MACHINE_NAME} in
  25. i486|i586|i686)
  26. MACHINE_NAME=
  27. ;;
  28. x86_64)
  29. MACHINE_NAME=64_
  30. ;;
  31. *)
  32. if [ ${SYSTEM_NAME} != native_ ]
  33. then
  34. SYSTEM_NAME=native_
  35. fi
  36. MACHINE_NAME=
  37. ;;
  38. esac
  39. if [ -x "${CUBE_DIR}/bin_unix/native_client" ]
  40. then
  41. SYSTEM_NAME=native_
  42. MACHINE_NAME=
  43. fi
  44. BINARYPATH="${CUBE_DIR}/bin_unix/${SYSTEM_NAME}${MACHINE_NAME}client"
  45. if [ "$1" = "--outputbinarypath" ]; then
  46. echo "${BINARYPATH}"
  47. exit 0
  48. elif [ -x "${BINARYPATH}" ]; then
  49. cd "${CUBE_DIR}"
  50. exec "${BINARYPATH}" ${CUBE_OPTIONS} "$@"
  51. else
  52. echo "Your platform does not have a pre-compiled AssaultCube client."
  53. echo "Please follow the following steps to build a native client:"
  54. echo "1) Ensure you have the following DEVELOPMENT libraries installed:"
  55. echo " OpenGL, SDL, SDL_image, zlib, libogg, libvorbis, OpenAL Soft"
  56. echo "2) Ensure clang++ and any other required build tools are installed."
  57. echo "3) Change directory to ./source/src/ and type \"make install\"."
  58. echo "4) If the compile succeeds, return to this directory and re-run this script."
  59. exit 1
  60. fi