diff --git a/distribute.sh b/distribute.sh index dee95b7098..4f8adb5cc9 100755 --- a/distribute.sh +++ b/distribute.sh @@ -93,6 +93,11 @@ case $OSTYPE in ;; esac +if [ -f /proc/cpuinfo ]; then + export MAKE_JOBS=($(grep -c ^processor /proc/cpuinfo) +1 ) +else + export MAKE_JOBS=1 +fi # Internals CRED="\x1b[31;01m" @@ -214,7 +219,7 @@ function push_arm() { export RANLIB="$TOOLCHAIN_PREFIX-ranlib" export LD="$TOOLCHAIN_PREFIX-ld" export STRIP="$TOOLCHAIN_PREFIX-strip --strip-unneeded" - export MAKE="make -j5" + export MAKE="make" export READELF="$TOOLCHAIN_PREFIX-readelf" # This will need to be updated to support Python versions other than 2.7 diff --git a/recipes/c_igraph/recipe.sh b/recipes/c_igraph/recipe.sh index 854671a305..7ed4117dda 100644 --- a/recipes/c_igraph/recipe.sh +++ b/recipes/c_igraph/recipe.sh @@ -48,8 +48,8 @@ function build_c_igraph() { fi - try $MAKE - try $MAKE install + try $MAKE -j$MAKE_JOBS + try $MAKE -j$MAKE_JOBS install pop_arm touch .built diff --git a/recipes/freetype/recipe.sh b/recipes/freetype/recipe.sh index 84d666ae09..07adcf39aa 100644 --- a/recipes/freetype/recipe.sh +++ b/recipes/freetype/recipe.sh @@ -18,7 +18,7 @@ function build_freetype() { push_arm export LDFLAGS="$LDFLAGS -L$BUILD_harfbuzz/src/.libs/" try ./configure --host=arm-linux-androideabi --prefix=$BUILD_freetype --without-zlib --with-png=no --enable-shared - try make -j5 + try make -j$MAKE_JOBS pop_arm try cp $BUILD_freetype/objs/.libs/libfreetype.so $LIBS_PATH diff --git a/recipes/harfbuzz/recipe.sh b/recipes/harfbuzz/recipe.sh index a308f17327..92f8d35bce 100644 --- a/recipes/harfbuzz/recipe.sh +++ b/recipes/harfbuzz/recipe.sh @@ -27,7 +27,7 @@ function build_harfbuzz() { #try ./configure --build=i686-pc-linux-gnu --host=arm-linux-androideabi --prefix="$BUILD_PATH/python-install" --enable-shared --without-freetype --without-glib #~ try ./autogen.sh --build=i686-pc-linux-gnu --host=arm-linux-androideabi --prefix="$BUILD_PATH/python-install" --without-freetype --without-glib try ./configure --without-icu --host=arm-linux-androideabi --prefix="$BUILD_PATH/python-install" --without-freetype --without-glib - try make -j5 + try make -j$MAKE_JOBS pop_arm try cp -L $BUILD_harfbuzz/src/.libs/libharfbuzz.so $LIBS_PATH } diff --git a/recipes/hostpython/recipe.sh b/recipes/hostpython/recipe.sh index 5d7321e802..097c98f744 100644 --- a/recipes/hostpython/recipe.sh +++ b/recipes/hostpython/recipe.sh @@ -25,7 +25,7 @@ function build_hostpython() { cd $BUILD_hostpython try ./configure - try make -j5 + try make -j$MAKE_JOBS try mv Parser/pgen hostpgen if [ -f python.exe ]; then diff --git a/recipes/libevent/recipe.sh b/recipes/libevent/recipe.sh index 21ae8254fb..1a5fc32d3a 100644 --- a/recipes/libevent/recipe.sh +++ b/recipes/libevent/recipe.sh @@ -22,7 +22,7 @@ function build_libevent() { push_arm try ./configure --build=i686-pc-linux-gnu --host=arm-linux-eabi --prefix=$BUILD_libevent/build/ - try make install + try make -j$MAKE_JOBS install pop_arm } diff --git a/recipes/libpq/recipe.sh b/recipes/libpq/recipe.sh index 887a23c767..8092e87f5b 100644 --- a/recipes/libpq/recipe.sh +++ b/recipes/libpq/recipe.sh @@ -29,7 +29,7 @@ function build_libpq() { push_arm try ./configure --without-readline --host=arm-linux - try make submake-libpq + try make -j$MAKE_JOBS submake-libpq try cp -a $BUILD_libpq/src/interfaces/libpq/libpq.a $LIBS_PATH pop_arm diff --git a/recipes/libsodium/recipe.sh b/recipes/libsodium/recipe.sh index abe926b10f..23ad8ef8c5 100644 --- a/recipes/libsodium/recipe.sh +++ b/recipes/libsodium/recipe.sh @@ -23,7 +23,7 @@ function build_libsodium() { push_arm try ./configure --enable-minimal --disable-soname-versions --host="arm-linux-androideabi" --enable-shared - try make + try make -j$MAKE_JOBS try cp -L $BUILD_libsodium/src/libsodium/.libs/libsodium.so $LIBS_PATH diff --git a/recipes/libtorrent/recipe.sh b/recipes/libtorrent/recipe.sh index 379a7bec74..fcfe855296 100644 --- a/recipes/libtorrent/recipe.sh +++ b/recipes/libtorrent/recipe.sh @@ -28,8 +28,7 @@ function build_libtorrent() { # Build the Python bindings with Boost.Build and some dependencies recursively (libtorrent-rasterbar, Boost.*) # Also link to openssl - # Hardcoded on -j5 because P4A does it too - $BOOST_ROOT/b2 -q -j5 target-os=android link=static boost-link=static boost=source threading=multi toolset=gcc-android geoip=off encryption=tommath linkflags="$BOOSTSTUFF" release + $BOOST_ROOT/b2 -q -j$MAKE_JOBS target-os=android link=static boost-link=static boost=source threading=multi toolset=gcc-android geoip=off encryption=tommath linkflags="$BOOSTSTUFF" release # Copy the module try cp -L libtorrent.so $SITEPACKAGES_PATH diff --git a/recipes/libxml2/recipe.sh b/recipes/libxml2/recipe.sh index 8810b15710..05d261849b 100644 --- a/recipes/libxml2/recipe.sh +++ b/recipes/libxml2/recipe.sh @@ -26,7 +26,7 @@ function build_libxml2() { --without-modules --without-legacy --without-history --without-debug --without-docbook --without-python try $SED 's/ runtest\$(EXEEXT) \\/ \\/' Makefile try $SED 's/ testrecurse\$(EXEEXT)$//' Makefile - try make + try make -j$MAKE_JOBS pop_arm } diff --git a/recipes/libxslt/recipe.sh b/recipes/libxslt/recipe.sh index d690b07f26..93350e4c3b 100644 --- a/recipes/libxslt/recipe.sh +++ b/recipes/libxslt/recipe.sh @@ -30,7 +30,7 @@ function build_libxslt() { try ./configure --build=i686-pc-linux-gnu --host=arm-linux-eabi \ --without-plugins --without-debug --without-python --without-crypto \ --with-libxml-src=$BUILD_libxml2 - try make + try make -j$MAKE_JOBS pop_arm diff --git a/recipes/libyaml/recipe.sh b/recipes/libyaml/recipe.sh index 93626fbd29..d6049d24d1 100644 --- a/recipes/libyaml/recipe.sh +++ b/recipes/libyaml/recipe.sh @@ -23,7 +23,7 @@ function build_libyaml() { # using arm-linux-eabi does not create a shared library try ./configure --build=i686-pc-linux-gnu --host=arm-linux-androideabi - try make + try make -j$MAKE_JOBS try cp -L $BUILD_libyaml/src/.libs/libyaml.so $LIBS_PATH diff --git a/recipes/opencv/recipe.sh b/recipes/opencv/recipe.sh index eac728b88b..fe04650799 100644 --- a/recipes/opencv/recipe.sh +++ b/recipes/opencv/recipe.sh @@ -45,7 +45,7 @@ function build_opencv() { -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ANDROID_EXAMPLES=OFF \ -DPYTHON_PACKAGES_PATH=$SITEPACKAGES_PATH \ $_cvsrc - try make -j8 opencv_python + try make -j$MAKE_JOBS opencv_python try cmake -DCOMPONENT=python -P ./cmake_install.cmake try cp -a $_cvbuild/lib/$ARCH/lib*.so $LIBS_PATH diff --git a/recipes/openssl/recipe.sh b/recipes/openssl/recipe.sh index 830711cced..0aeb5e7455 100644 --- a/recipes/openssl/recipe.sh +++ b/recipes/openssl/recipe.sh @@ -23,7 +23,7 @@ function build_openssl() { push_arm try ./Configure no-dso no-krb5 linux-armv4 - try make build_libs + try make -j$MAKE_JOBS build_libs pop_arm } diff --git a/recipes/python/recipe.sh b/recipes/python/recipe.sh index 4516e9fb63..f80ffc52d0 100644 --- a/recipes/python/recipe.sh +++ b/recipes/python/recipe.sh @@ -102,7 +102,7 @@ function build_python() { try ./configure --host=$HOSTARCH --build=$BUILDARCH OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework echo ./configure --host=$HOSTARCH --build=$BUILDARCH OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework - echo $MAKE HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so + echo $MAKE -j$MAKE_JOBS HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so cp HOSTPYTHON=$BUILD_python/hostpython python # FIXME, the first time, we got a error at: @@ -112,10 +112,10 @@ function build_python() { # check if we can avoid this part. debug 'First install (failing..)' - $MAKE install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so + $MAKE -j$MAKE_JOBS install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so debug 'Second install.' touch python.exe python - $MAKE install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so + $MAKE -j$MAKE_JOBS install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so pop_arm system=$(uname -s)