diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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 |