summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-15 19:00:14 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-15 19:00:14 (EDT)
commit6829e042baf0bcd4f86a472daa86839c60fb272c (patch)
tree6ad5fad7b5a740a6125724a2ac2f852ef71801bc /src
parentcc0e8e3abf50b991f6df879d32f58e6526a1d3fd (diff)
prokit: New "in_place" and "srcdir" global vars
Diffstat (limited to 'src')
-rw-r--r--src/prokit.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/prokit.sh b/src/prokit.sh
index 5679e33..272c64c 100644
--- a/src/prokit.sh
+++ b/src/prokit.sh
@@ -30,14 +30,22 @@ PACKAGE_VERSION='@PACKAGE_VERSION@'
PKGDATADIR='@pkgdatadir@'
OPTSTRING='hV'
+if [ -f "${0%/*}/../.builddirstamp" ]; then
+ in_place=true
+ srcdir="${0%/*}/.."
+else
+ in_place=false
+ srcdir=''
+fi
+
# use() must be defined inline so it can be used to load other modules.
use()
{
local module="${1}"
local dir=
- if [ -f "${0%/*}/../lib/output.sm" ]; then
- dir="${0%/*}/../lib"
+ if ${in_place}; then
+ dir="${srcdir}/lib"
else
dir="${PKGDATADIR}"
fi