summaryrefslogtreecommitdiff
path: root/src/unix/setup/ioq3demo.sh
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-12-10 03:19:05 +0000
committerTim Angus <tim@ngus.net>2005-12-10 03:19:05 +0000
commit22f322884cf7715c01500ef0b4579b87b1cb1973 (patch)
tree99c255a82574e8337a8a26bc877d65f13e87b9cd /src/unix/setup/ioq3demo.sh
parente136e3aea478f1406ff304b8ed9e563a4b170f37 (diff)
* Copied ioq3 src to trunk
Diffstat (limited to 'src/unix/setup/ioq3demo.sh')
-rw-r--r--src/unix/setup/ioq3demo.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/unix/setup/ioq3demo.sh b/src/unix/setup/ioq3demo.sh
new file mode 100644
index 00000000..e022afed
--- /dev/null
+++ b/src/unix/setup/ioq3demo.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+readlink() {
+ local path=$1 ll
+
+ if [ -L "$path" ]; then
+ ll="$(LC_ALL=C ls -l "$path" 2> /dev/null)" &&
+ echo "${ll/* -> }"
+ else
+ return 1
+ fi
+}
+
+script=$0
+count=0
+while [ -L "$script" ]
+do
+ script=$(readlink "$script")
+ count=`expr $count + 1`
+ if [ $count -gt 100 ]
+ then
+ echo "Too many symbolic links"
+ exit 1
+ fi
+done
+cd "`dirname $script`"
+
+
+lib=lib
+test -e lib64 && lib=lib64
+
+if test "x$LD_LIBRARY_PATH" = x; then
+ LD_LIBRARY_PATH="`pwd`/$lib"
+else
+ LD_LIBRARY_PATH="`pwd`/$lib:$LD_LIBRARY_PATH"
+fi
+export LD_LIBRARY_PATH
+
+arch=`uname -m`
+case "$arch" in
+ i?86) arch=i386 ;;
+esac
+
+exec ./ioquake3.$arch +set sv_pure 0 +set vm_cgame 0 +set vm_game 0 +set vm_ui 0 +set fs_game demoq3 "$@"