Be more explicit about what we're waiting for, among other changes.
This appears to fully correct the wait issues.
}
bootstrap_libs() {
+ local jobs=""
for i in ${SUBDIRS}; do
case "$i" in
apr|fs|libzrtp)
- ${BGJOB} && wait
+ if ${BGJOB}; then
+ for x in $jobs; do
+ wait $jobs
+ done
+ fi
+ jobs=""
bootstrap_$i
continue
;;
if ! ${BGJOB}; then
libbootstrap ${i} ; bootstrap_libs_post ${i}
else
- ((libbootstrap ${i} ; bootstrap_libs_post ${i}) &)
+ (libbootstrap ${i} ; bootstrap_libs_post ${i}) &
+ local x=$!
+ jobs="$jobs $x"
fi
done
- ${BGJOB} && wait
+ if ${BGJOB}; then
+ for x in $jobs; do
+ wait $x
+ done
+ fi
}
run() {
check_libtoolize
print_autotools_vers
bootstrap_libs
- ${BGJOB} && wait
return 0
}