docs/cookbook/c/allconfig.do: avoid need for '&' backgrounding.
Instead of running a bunch of separate rc_include statements in the background, which causes unpredictable ordering of log output and prevents -j from controlling parallelism, let's do a single redo-ifchange for all of them (the slow part) followed by sequentially checking the results (the fast part).
This commit is contained in:
parent
1574b11598
commit
e036e2522d
1 changed files with 26 additions and 15 deletions
|
|
@ -8,24 +8,35 @@ config() {
|
||||||
(
|
(
|
||||||
cd "$dir" &&
|
cd "$dir" &&
|
||||||
../configure --host="$arch" "$@" &&
|
../configure --host="$arch" "$@" &&
|
||||||
( set --;
|
|
||||||
. ./redoconf.rc &&
|
|
||||||
rc_include rc/CC.rc &&
|
|
||||||
[ -n "$HAVE_CC" ]
|
|
||||||
) &&
|
|
||||||
echo "$dir"
|
echo "$dir"
|
||||||
) || (echo "Skipping arch '$arch' $*" >&2)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
for d in $(cat arches); do
|
dirs=$(
|
||||||
if [ "$d" = "native" ]; then
|
for d in $(cat arches); do
|
||||||
arch=""
|
if [ "$d" = "native" ]; then
|
||||||
else
|
arch=""
|
||||||
arch="$d"
|
else
|
||||||
fi
|
arch="$d"
|
||||||
config "out.$d" "$arch" &
|
fi
|
||||||
config "out.$d.static" "$arch" "--enable-static" &
|
config "out.$d" "$arch"
|
||||||
config "out.$d.opt" "$arch" "--enable-optimization" &
|
config "out.$d.static" "$arch" "--enable-static"
|
||||||
|
config "out.$d.opt" "$arch" "--enable-optimization"
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
|
for dir in $dirs; do
|
||||||
|
echo "$dir/rc/CC.rc"
|
||||||
|
done | xargs redo-ifchange
|
||||||
|
|
||||||
|
for dir in $dirs; do
|
||||||
|
( cd "$dir" &&
|
||||||
|
set --;
|
||||||
|
. ./redoconf.rc &&
|
||||||
|
rc_include rc/CC.rc &&
|
||||||
|
[ -n "$HAVE_CC" ] &&
|
||||||
|
echo "$dir"
|
||||||
|
) || (echo "Skipping $dir' - no working C compiler." >&2)
|
||||||
done >$3
|
done >$3
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue