#!/bin/sh
echo "bootstrap: checking installation..."
+BGJOB=false
+if [ "${1}" == "-j" ] ; then
+ BGJOB=true
+fi
+
BASEDIR=`pwd`;
LIBDIR=${BASEDIR}/libs;
SUBDIRS="ilbc curl iksemel js js/nsprpub libdingaling libedit libsndfile pcre sofia-sip \
echo "Creating include/arch/unix/apr_private.h.in ..."
${AUTOHEADER:-autoheader}
-
-# Remove autoconf 2.5x's cache directory
-rm -rf autom4te*.cache
-
-echo "Entering directory ${LIBDIR}/apr-util"
-cd ${LIBDIR}/apr-util
-./buildconf
-
-for i in ${SUBDIRS}
-do
+# Libs automake automation function
+libbootstrap()
+{
+ i=$1
echo "Entering directory ${LIBDIR}/${i}"
cd ${LIBDIR}/${i}
rm -f aclocal.m4
fi
rm -rf autom4te*.cache
fi
+}
+
+
+# Remove autoconf 2.5x's cache directory
+rm -rf autom4te*.cache
+
+echo "Entering directory ${LIBDIR}/apr-util"
+cd ${LIBDIR}/apr-util
+if [ "${BGJOB}" == "false" ] ; then
+ ./buildconf
+else
+ ./buildconf &
+fi
+
+
+for i in ${SUBDIRS}
+do
+ if [ "${BGJOB}" == "false" ] ; then
+ libbootstrap ${i}
+ else
+ libbootstrap ${i} &
+ fi
done
+if [ "${BGJOB}" == "true" ] ; then
+ wait
+fi
cd ${BASEDIR}
rm -f aclocal.m4