summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-06-06 01:18:53 +0200
committerCarl Hetherington <cth@carlh.net>2020-06-06 01:18:53 +0200
commit4c798e9ec122b8e8fcdfa4e12adb718a277329b1 (patch)
tree2dd6a6ff0a1322acdaf30673be28f71861ad9fbe
parentcc6c991ddd53e2f151140cbadef2da660cd7d6a3 (diff)
Make run script work when called from a different directory; some cleanup.
-rwxr-xr-xrun/dcpomatic22
1 files changed, 12 insertions, 10 deletions
diff --git a/run/dcpomatic b/run/dcpomatic
index ee509fcbd..7e8f923a3 100755
--- a/run/dcpomatic
+++ b/run/dcpomatic
@@ -1,30 +1,32 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-export LD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:/home/c.hetherington/lib:$LD_LIBRARY_PATH
-export DYLD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:/Users/c.hetherington/osx-environment/64/lib
+build=$DIR/../build
+export LD_LIBRARY_PATH=$build/src/lib:$build/src/wx:$build/src/asdcplib/src:$LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH=$build/src/lib:$build/src/wx:$build/src/asdcplib/src:/Users/c.hetherington/osx-environment/64/lib
export DCPOMATIC_GRAPHICS=$DIR/../graphics
+binary=$build/src/tools/dcpomatic2
if [ "$1" == "--debug" ]; then
shift
- gdb --args build/src/tools/dcpomatic2 $*
+ gdb --args $binary $*
elif [ "$1" == "--valgrind" ]; then
shift
- valgrind --tool="memcheck" --suppressions=suppressions --track-fds=yes --show-leak-kinds=all --leak-check=full build/src/tools/dcpomatic2 $*
+ valgrind --tool="memcheck" --suppressions=suppressions --track-fds=yes --show-leak-kinds=all --leak-check=full $binary $*
elif [ "$1" == "--callgrind" ]; then
shift
- valgrind --tool="callgrind" build/src/tools/dcpomatic2 $*
+ valgrind --tool="callgrind" $binary $*
elif [ "$1" == "--massif" ]; then
shift
- valgrind --tool="massif" build/src/tools/dcpomatic2 $*
+ valgrind --tool="massif" $binary $*
elif [ "$1" == "--i18n" ]; then
shift
- LANGUAGE=de_DE.UTF8 LANG=de_DE.UTF8 LC_ALL=de_DE.UTF8 build/src/tools/dcpomatic2 "$*"
+ LANGUAGE=de_DE.UTF8 LANG=de_DE.UTF8 LC_ALL=de_DE.UTF8 $binary "$*"
elif [ "$1" == "--perf" ]; then
shift
- perf record build/src/tools/dcpomatic2 $*
+ perf record $binary $*
elif [ "$1" == "--scaled" ]; then
shift
- ~/src/run_scaled/run_scaled --sleep=5 --scale=0.5 build/src/tools/dcpomatic2 $*
+ ~/src/run_scaled/run_scaled --sleep=5 --scale=0.5 $binary $*
else
- build/src/tools/dcpomatic2 $*
+ $binary $*
fi