diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-03-04 13:03:45 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-03-04 13:03:45 -0500 |
commit | d06e79cb18849df48e3e2b431c8b5fe6a32d3b6c (patch) | |
tree | 3abe3a70bb3ee61c606c3ddf5227aa0f164d8afd | |
parent | 978a32cec48ee55ed3717d2de4d78184755edbdf (diff) |
improve configure
-rwxr-xr-x | configure | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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@") } |