[Android] [PATCH 2/2] build: build extras/tools before pollute PATH

Zhao quinkblack at foxmail.com
Mon Oct 29 09:45:16 CET 2018


From: Zhao Zhili <quinkblack at foxmail.com>

Build extras/tools/protobuf failed as it tried to pick up clang under
NDK_TOOLCHAIN_PATH.
---
 compile-libvlc.sh | 52 +++++++++++++++++++++++------------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index 85d4794a7..ec257616b 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -62,6 +62,32 @@ if [ -z "$ANDROID_ABI" ]; then
     exit 1
 fi
 
+# Make in //
+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 #
+###########################
+
+export PATH="`pwd`/vlc/extras/tools/build/bin:$PATH"
+echo "Building tools"
+cd vlc/extras/tools
+./bootstrap
+checkfail "buildsystem tools: bootstrap failed"
+make $MAKEFLAGS
+checkfail "buildsystem tools: make failed"
+make $MAKEFLAGS .buildgas
+checkfail "buildsystem tools: make failed"
+cd ../../..
+
 ###########################
 # VLC BOOTSTRAP ARGUMENTS #
 ###########################
@@ -339,17 +365,6 @@ echo "ABI:        $ANDROID_ABI"
 echo "API:        $ANDROID_API"
 echo "PATH:       $PATH"
 
-# Make in //
-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
-
 ##########
 # CFLAGS #
 ##########
@@ -423,21 +438,6 @@ echo "VLC_CXXFLAGS:      ${VLC_CXXFLAGS}"
 
 cd vlc
 
-###########################
-# Build buildsystem tools #
-###########################
-
-export PATH="`pwd`/extras/tools/build/bin:$PATH"
-echo "Building tools"
-cd extras/tools
-./bootstrap
-checkfail "buildsystem tools: bootstrap failed"
-make $MAKEFLAGS
-checkfail "buildsystem tools: make failed"
-make $MAKEFLAGS .gas
-checkfail "buildsystem tools: make failed"
-cd ../..
-
 #############
 # BOOTSTRAP #
 #############
-- 
2.19.1



More information about the Android mailing list