summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-03-04 13:03:45 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-03-04 13:03:45 -0500
commitd06e79cb18849df48e3e2b431c8b5fe6a32d3b6c (patch)
tree3abe3a70bb3ee61c606c3ddf5227aa0f164d8afd
parent978a32cec48ee55ed3717d2de4d78184755edbdf (diff)
improve configure
-rwxr-xr-xconfigure10
1 files changed, 5 insertions, 5 deletions
diff --git a/configure b/configure
index ef9a41f..5e99fa6 100755
--- a/configure
+++ b/configure
@@ -25,14 +25,14 @@ error() {
exit 1
}
-topsrcdir=$(realpath -ms --relative-to=. -- "$srcdir")
-if [ "$topsrcdir" = . ]; then
- topsrcdir=
+if [ "${srcdir:0:1}" = / ]; then
+ topsrcdir=$srcdir
else
- topsrcdir=/$topsrcdir
+ topsrcdir="&/$srcdir"
fi
+topsrcdir="${topsrcdir%/.}"
-edit=(sed -E -e "s|^topsrcdir := .*|&$topsrcdir|")
+edit=(sed -E -e "s|^topsrcdir := .*|$topsrcdir|")
setvar() {
edit+=(-e "s@^(\s*$1\s*:?=).*@\1 $2@")
}