From 6829e042baf0bcd4f86a472daa86839c60fb272c Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 15 Aug 2014 19:00:14 -0400 Subject: prokit: New "in_place" and "srcdir" global vars --- 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 -- cgit v0.9.1