summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-03-04 01:07:34 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-03-04 01:07:34 -0500
commit978a32cec48ee55ed3717d2de4d78184755edbdf (patch)
treee26a3fc3215ea76eb997cd9fe23a844b77f24584 /configure
parent4f5ce5854f478cfa38024b74d9c2849b794e979e (diff)
fix mistakes
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure14
1 files changed, 10 insertions, 4 deletions
diff --git a/configure b/configure
index 9683b68..ef9a41f 100755
--- a/configure
+++ b/configure
@@ -25,11 +25,17 @@ error() {
exit 1
}
-edit=(sed -E -e '')
+topsrcdir=$(realpath -ms --relative-to=. -- "$srcdir")
+if [ "$topsrcdir" = . ]; then
+ topsrcdir=
+else
+ topsrcdir=/$topsrcdir
+fi
+
+edit=(sed -E -e "s|^topsrcdir := .*|&$topsrcdir|")
setvar() {
edit+=(-e "s@^(\s*$1\s*:?=).*@\1 $2@")
}
-setvar topsrcdir "$srcdir"
vars=($(<"$srcdir/config.mk.in" sed -n 's/^\([ a-z_-]*\)=.*/\1/p'))
@@ -53,11 +59,11 @@ done
"${edit[@]}" < "$srcdir/config.mk.in" > "$outdir/config.mk"
-Makefiles=($(find "$srcdir/" -name 'Makefile') "$srcdir"/*.mk "$srcdir"/modules/module.mk "$srcdir"/modules/*/Makefile.inc.mk)
+Makefiles=($(find "$srcdir/" -name 'Makefile') "$srcdir"/modules/module.mk "$srcdir"/modules/*/Makefile.inc.mk)
for src in "${Makefiles[@]}"; do
out="$outdir/${src#$srcdir/}"
mkdir -p -- $(dirname -- "$out")
if ! test "$src" -ef "$out"; then
- cp -fTv -- "$src" "$out"
+ cp -fT -- "$src" "$out"
fi
done