forked from umlaeute/Gem
-
Notifications
You must be signed in to change notification settings - Fork 1
/
devgem.sh.in
executable file
·50 lines (40 loc) · 1.19 KB
/
devgem.sh.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
## simple script to run Gem from the build
# local configuration
conffile="./devgem.conf"
if [ -e "${conffile}" ]; then . "${conffile}"; fi
## Pd binary can be overriden by setting the PD environment
if [ "x${PD}" = "x" ]; then
PD="@PD_EXE@"
if [ "x${PD#@}" != "x${PD}" ]; then
PD=""
fi
fi
if [ "x${PD}" = "x" ]; then
PD=pd
fi
## for running Pd through some external application (e.g. gdb, valgrind, wine,...)
# set the LAUNCHER variable.
: ${LAUNCHER:-}
## provide replacement for realpath
which realpath >/dev/null 2>&1 || realpath() { [ "x${1#/}" != "x$1" ] && echo "$1" || echo "$PWD/${1#.}"; }
## search abstractions (both static ones and built ones)
srcdir=$(realpath @abs_top_srcdir@)
builddir=$(realpath @abs_top_builddir@)
gempath=
if [ -d "${srcdir}/abstractions" ]; then
gempath=${srcdir}/abstractions:${gempath}
fi
if [ -d "${builddir}" ]; then
if [ "x${srcdir}" != "x${builddir}" ]; then
gempath=${builddir}/abstractions:${gempath}
fi
gempath=${builddir}:${gempath}
else
builddir=${0%/*}
fi
gempath=${gempath%:}
if [ "x${gempath}" = "x" ]; then
gempath=${builddir}
fi
${LAUNCHER} ${PD} -stderr -nrt -oss -nosound -path "${gempath}" -lib ${builddir}/Gem "$@"