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" &&
|
||||
../configure --host="$arch" "$@" &&
|
||||
( set --;
|
||||
. ./redoconf.rc &&
|
||||
rc_include rc/CC.rc &&
|
||||
[ -n "$HAVE_CC" ]
|
||||
) &&
|
||||
echo "$dir"
|
||||
) || (echo "Skipping arch '$arch' $*" >&2)
|
||||
)
|
||||
}
|
||||
|
||||
for d in $(cat arches); do
|
||||
dirs=$(
|
||||
for d in $(cat arches); do
|
||||
if [ "$d" = "native" ]; then
|
||||
arch=""
|
||||
else
|
||||
arch="$d"
|
||||
fi
|
||||
config "out.$d" "$arch" &
|
||||
config "out.$d.static" "$arch" "--enable-static" &
|
||||
config "out.$d.opt" "$arch" "--enable-optimization" &
|
||||
config "out.$d" "$arch"
|
||||
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
|
||||
|
||||
wait
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue