]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
bootstrap.sh: wait better
authorTravis Cross <tc@traviscross.com>
Tue, 8 May 2012 19:40:43 +0000 (19:40 +0000)
committerTravis Cross <tc@traviscross.com>
Tue, 8 May 2012 20:08:26 +0000 (20:08 +0000)
Be more explicit about what we're waiting for, among other changes.
This appears to fully correct the wait issues.

bootstrap.sh

index b8f1dcd843a8ed9078fa035008b2d833675bcb13..5aaed673c54543f01d03d5e8de975464ffd25ca0 100755 (executable)
@@ -438,10 +438,16 @@ bootstrap_libs_post() {
 }
 
 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
         ;;
@@ -450,10 +456,16 @@ bootstrap_libs() {
     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() {
@@ -468,7 +480,6 @@ run() {
   check_libtoolize
   print_autotools_vers
   bootstrap_libs
-  ${BGJOB} && wait
   return 0
 }