[Android] build: find vlc dir in more places

Thomas Guillem git at videolan.org
Tue May 14 16:47:31 CEST 2019


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue May 14 08:50:29 2019 +0200| [95a767fda50d498256a8edd8b5df9ae284cdaafb] | committer: Thomas Guillem

build: find vlc dir in more places

This script can now be called from VLC directory

> https://code.videolan.org/videolan/vlc-android/commit/95a767fda50d498256a8edd8b5df9ae284cdaafb
---

 compile-libvlc.sh | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index e34c41893..d6825fe94 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -160,7 +160,15 @@ else
 fi
 
 SRC_DIR=$PWD
-VLC_SRC_DIR="$SRC_DIR/vlc"
+if [ -f $SRC_DIR/src/libvlc.h ];then
+    VLC_SRC_DIR="$SRC_DIR"
+elif [ -d $SRC_DIR/vlc ];then
+    VLC_SRC_DIR=$SRC_DIR/vlc
+else
+    echo "Could not find vlc sources"
+    exit 1
+fi
+
 VLC_BUILD_DIR=`realpath $VLC_SRC_DIR/build-android-${TARGET_TUPLE}`
 VLC_OUT_PATH="$SRC_DIR/build/ndk"
 VLC_OUT_LDLIBS="-L$VLC_OUT_PATH/libs/${ANDROID_ABI} -lvlc"
@@ -429,9 +437,9 @@ VLC_MODULE_BLACKLIST="
 # Build buildsystem tools #
 ###########################
 
-export PATH="`pwd`/vlc/extras/tools/build/bin:$PATH"
+export PATH="$VLC_SRC_DIR/extras/tools/build/bin:$PATH"
 echo "Building tools"
-cd vlc/extras/tools
+cd $VLC_SRC_DIR/extras/tools
 ./bootstrap
 avlc_checkfail "buildsystem tools: bootstrap failed"
 make $MAKEFLAGS
@@ -442,7 +450,7 @@ cd ../../..
 
 VLC_CONTRIB="$VLC_SRC_DIR/contrib/$TARGET_TUPLE"
 
-cd vlc
+cd $VLC_SRC_DIR
 
 #############
 # BOOTSTRAP #
@@ -627,7 +635,7 @@ printf "/* Autogenerated from the list of modules */\n#include <unistd.h>\n$DEFI
 
 DEFINITION=""
 BUILTINS="const void *libvlc_functions[] = {\n";
-for func in `cat vlc/lib/libvlc.sym`
+for func in `cat $VLC_SRC_DIR/lib/libvlc.sym`
 do
     DEFINITION=$DEFINITION"int $func(void);\n";
     BUILTINS="$BUILTINS $func,\n";



More information about the Android mailing list