43703fe68d0ee49d7119a7c358c208b0e18fda63
[dcpomatic.git] / run / dcpomatic
1 #!/bin/bash
2
3 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4 build=$DIR/../build
5 export LD_LIBRARY_PATH=$build/src/lib:$build/src/wx:$build/src/asdcplib/src:$LD_LIBRARY_PATH
6 export DYLD_LIBRARY_PATH=$build/src/lib:$build/src/wx:$build/src/asdcplib/src:/Users/c.hetherington/osx-environment/64/lib
7 export DCPOMATIC_GRAPHICS=$DIR/../graphics
8 export DCPOMATIC_SHARE_PREFIX=.
9 binary=$build/src/tools/dcpomatic2
10 if [ "$1" == "--debug" ]; then
11     shift
12     gdb --args $binary $*
13 elif [ "$1" == "--valgrind" ]; then
14     shift
15     valgrind --tool="memcheck" --suppressions=suppressions --track-fds=yes --show-leak-kinds=all --leak-check=full $binary $*
16 elif [ "$1" == "--callgrind" ]; then
17     shift
18     valgrind --tool="callgrind" $binary $*
19 elif [ "$1" == "--massif" ]; then
20     shift
21     valgrind --tool="massif" $binary $*
22 elif [ "$1" == "--i18n" ]; then
23     shift
24     LANGUAGE=de_DE.UTF8 LANG=de_DE.UTF8 LC_ALL=de_DE.UTF8 $binary "$*"
25 elif [ "$1" == "--perf" ]; then
26     shift
27     perf record $binary $*
28 elif [ "$1" == "--scaled" ]; then
29     shift
30     ~/src/run_scaled/run_scaled --sleep=5 --scale=0.5 $binary $*
31 elif [ "$1" == "--screenshot" ]; then
32     shift
33     GTK_PATH=/usr/local/lib/gtk-3.0 GTK_MODULES=gtk-vector-screenshot $binary "$*"
34 else
35     $binary $*
36 fi