[Android] [PATCH] build: use MAKEFLAGS env if already set

Thomas Guillem tom at gllm.fr
Fri Oct 10 10:49:23 CEST 2014


---
 compile.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/compile.sh b/compile.sh
index ca07811..9895d4d 100755
--- a/compile.sh
+++ b/compile.sh
@@ -202,14 +202,14 @@ EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CX
 EXTRA_LDFLAGS="-l${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI}/libgnustl_static.a"
 
 # Make in //
-UNAMES=$(uname -s)
-MAKEFLAGS=
-if which nproc >/dev/null
-then
-MAKEFLAGS=-j`nproc`
-elif [ "$UNAMES" == "Darwin" ] && which sysctl >/dev/null
-then
-MAKEFLAGS=-j`sysctl -n machdep.cpu.thread_count`
+if [ -z "$MAKEFLAGS" ]; then
+    UNAMES=$(uname -s)
+    MAKEFLAGS=
+    if which nproc >/dev/null; then
+        MAKEFLAGS=-j`nproc`
+    elif [ "$UNAMES" == "Darwin" ] && which sysctl >/dev/null; then
+        MAKEFLAGS=-j`sysctl -n machdep.cpu.thread_count`
+    fi
 fi
 
 # Build buildsystem tools
-- 
2.1.0



More information about the Android mailing list