Skip to content

Replace hardcoded "-jX" for make #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion distribute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ case $OSTYPE in
;;
esac

if [ -f /proc/cpuinfo ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should check if MAKE_JOBS is already set, so you can tell it how many jobs to use? Like if [ -z "$MAKE_JOBS" -a -f /proc/cpuinfo ]; then ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't think about this situation. I'm not so good in bash just found a variation of this on the web and rewritten it.
Would it be a problem to merge the PR and you could make this tweak?

export MAKE_JOBS=($(grep -c ^processor /proc/cpuinfo) +1 )
else
export MAKE_JOBS=1
fi

# Internals
CRED="\x1b[31;01m"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions recipes/c_igraph/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion recipes/freetype/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion recipes/harfbuzz/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion recipes/hostpython/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion recipes/libevent/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion recipes/libpq/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion recipes/libsodium/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions recipes/libtorrent/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion recipes/libxml2/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion recipes/libxslt/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion recipes/libyaml/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion recipes/opencv/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion recipes/openssl/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions recipes/python/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down