Commit f0306a1b authored by Thomas Guillem's avatar Thomas Guillem

build: unsplit build-common

parent 4b8fac7d
#!/bin/sh
# 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
echo "MAKEFLAGS: ${MAKEFLAGS}"
#########
# FLAGS #
#########
if [ "${ANDROID_ABI}" = "arm" ] ; then
ANDROID_ABI="armeabi-v7a"
elif [ "${ANDROID_ABI}" = "arm64" ] ; then
ANDROID_ABI="arm64-v8a"
fi
# Set up ABI variables
if [ "${ANDROID_ABI}" = "x86" ] ; then
TARGET_TUPLE="i686-linux-android"
PLATFORM_SHORT_ARCH="x86"
elif [ "${ANDROID_ABI}" = "x86_64" ] ; then
TARGET_TUPLE="x86_64-linux-android"
PLATFORM_SHORT_ARCH="x86_64"
HAVE_64=1
elif [ "${ANDROID_ABI}" = "arm64-v8a" ] ; then
TARGET_TUPLE="aarch64-linux-android"
HAVE_ARM=1
HAVE_64=1
PLATFORM_SHORT_ARCH="arm64"
elif [ "${ANDROID_ABI}" = "armeabi-v7a" ] ; then
TARGET_TUPLE="arm-linux-androideabi"
HAVE_ARM=1
PLATFORM_SHORT_ARCH="arm"
else
echo "Unknown ABI: '${ANDROID_ABI}'. Die, die, die!"
exit 2
fi
# try to detect NDK version
REL=$(grep -o '^Pkg.Revision.*[0-9]*.*' $ANDROID_NDK/source.properties |cut -d " " -f 3 | cut -d "." -f 1)
if [ "$REL" -eq 18 ]; then
if [ "${HAVE_64}" = 1 ]; then
ANDROID_API=21
else
ANDROID_API=17
fi
else
echo "NDK v18 needed, cf. https://developer.android.com/ndk/downloads/"
exit 1
fi
NDK_FORCE_ARG=
NDK_TOOLCHAIN_DIR=${PWD}/toolchains/${PLATFORM_SHORT_ARCH}
NDK_TOOLCHAIN_PROPS=${NDK_TOOLCHAIN_DIR}/source.properties
NDK_TOOLCHAIN_PATH=${NDK_TOOLCHAIN_DIR}/bin
if [ "`cat \"${NDK_TOOLCHAIN_PROPS}\" 2>/dev/null`" != "`cat \"${ANDROID_NDK}/source.properties\"`" ];then
echo "NDK changed, making new toolchain"
NDK_FORCE_ARG="--force"
fi
$ANDROID_NDK/build/tools/make_standalone_toolchain.py \
--arch ${PLATFORM_SHORT_ARCH} \
--api ${ANDROID_API} \
--stl libc++ \
${NDK_FORCE_ARG} \
--install-dir ${NDK_TOOLCHAIN_DIR} 2> /dev/null
if [ ! -d ${NDK_TOOLCHAIN_PATH} ];
then
echo "make_standalone_toolchain.py failed"
exit 1
fi
if [ ! -z "${NDK_FORCE_ARG}" ];then
# Don't mess up nl_langinfo() detection since this symbol is not present for 64
# bits
if [ "${HAVE_64}" = 1 ];then
rm ${NDK_TOOLCHAIN_DIR}/sysroot/usr/local/include/langinfo.h
fi
fi
if [ ! -z "${NDK_FORCE_ARG}" ];then
cp "$ANDROID_NDK/source.properties" "${NDK_TOOLCHAIN_PROPS}"
fi
# Add the NDK toolchain to the PATH, needed both for contribs and for building
# stub libraries
CROSS_TOOLS=${NDK_TOOLCHAIN_PATH}/${TARGET_TUPLE}-
export PATH="${NDK_TOOLCHAIN_PATH}:${PATH}"
ON_WINDOWS=0
if [ ! -z "$MSYSTEM_PREFIX" ] ; then
# The make.exe and awk.exe from the toolchain don't work in msys
export PATH="$MSYSTEM_PREFIX/bin:/usr/bin:${NDK_TOOLCHAIN_PATH}:${PATH}"
ON_WINDOWS=1
fi
##########
# CFLAGS #
##########
VLC_CFLAGS="-std=gnu11"
VLC_CXXFLAGS="-std=gnu++11"
if [ "$NO_OPTIM" = "1" ];
then
VLC_CFLAGS="${VLC_CFLAGS} -g -O0"
VLC_CXXFLAGS="${VLC_CXXFLAGS} -g -O0"
else
VLC_CFLAGS="${VLC_CFLAGS} -g -O2"
VLC_CXXFLAGS="${VLC_CXXFLAGS} -g -O2"
fi
VLC_CFLAGS="${VLC_CFLAGS} -fstrict-aliasing -funsafe-math-optimizations"
VLC_CXXFLAGS="${VLC_CXXFLAGS} -fstrict-aliasing -funsafe-math-optimizations"
# Setup CFLAGS per ABI
if [ "${ANDROID_ABI}" = "armeabi-v7a" ] ; then
EXTRA_CFLAGS="-march=armv7-a -mfpu=neon -mcpu=cortex-a8"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -mthumb -mfloat-abi=softfp"
elif [ "${ANDROID_ABI}" = "x86" ] ; then
EXTRA_CFLAGS="-mtune=atom -msse3 -mfpmath=sse -m32"
fi
EXTRA_CFLAGS="${EXTRA_CFLAGS} -MMD -MP -fpic -ffunction-sections -funwind-tables \
-fstack-protector-strong -Wno-invalid-command-line-argument -Wno-unused-command-line-argument \
-no-canonical-prefixes -fno-integrated-as"
EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS} -fexceptions -frtti"
EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS} -D__STDC_FORMAT_MACROS=1 -D__STDC_CONSTANT_MACROS=1 -D__STDC_LIMIT_MACROS=1"
#################
# Setup LDFLAGS #
#################
EXTRA_LDFLAGS="${VLC_LDFLAGS}"
if [ ${ANDROID_ABI} = "armeabi-v7a" ]; then
EXTRA_PARAMS=" --enable-neon"
EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -Wl,--fix-cortex-a8"
fi
NDK_LIB_DIR="${NDK_TOOLCHAIN_DIR}/${TARGET_TUPLE}/lib"
if [ "${PLATFORM_SHORT_ARCH}" = "x86_64" ];then
NDK_LIB_DIR="${NDK_LIB_DIR}64"
elif [ "${PLATFORM_SHORT_ARCH}" = "arm" ]; then
NDK_LIB_DIR="${NDK_LIB_DIR}/armv7-a"
fi
EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -L${NDK_LIB_DIR} -lc++abi"
VLC_LDFLAGS="${EXTRA_LDFLAGS}"
# Release or not?
if [ "$RELEASE" = 1 ]; then
OPTS=""
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DNDEBUG "
NDK_DEBUG=0
else
OPTS="--enable-debug"
NDK_DEBUG=1
fi
###############
# DISPLAY ABI #
###############
echo "ABI: $ANDROID_ABI"
echo "API: $ANDROID_API"
echo "PATH: $PATH"
echo "EXTRA_CFLAGS: ${EXTRA_CFLAGS}"
echo "VLC_CFLAGS: ${VLC_CFLAGS}"
echo "VLC_CXXFLAGS: ${VLC_CXXFLAGS}"
echo ok
#!/bin/sh
#############
# FUNCTIONS #
#############
checkfail()
{
if [ ! $? -eq 0 ];then
echo "$1"
exit 1
fi
}
#############
# ARGUMENTS #
#############
RELEASE=0
AVLC_RELEASE=$RELEASE
while [ $# -gt 0 ]; do
case $1 in
help|--help)
......@@ -29,12 +17,164 @@ while [ $# -gt 0 ]; do
shift
;;
release|--release)
RELEASE=1
AVLC_RELEASE=1
;;
esac
shift
done
# 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
echo "MAKEFLAGS: ${MAKEFLAGS}"
#########
# FLAGS #
#########
if [ "${ANDROID_ABI}" = "arm" ] ; then
ANDROID_ABI="armeabi-v7a"
elif [ "${ANDROID_ABI}" = "arm64" ] ; then
ANDROID_ABI="arm64-v8a"
fi
# Set up ABI variables
if [ "${ANDROID_ABI}" = "x86" ] ; then
TARGET_TUPLE="i686-linux-android"
PLATFORM_SHORT_ARCH="x86"
elif [ "${ANDROID_ABI}" = "x86_64" ] ; then
TARGET_TUPLE="x86_64-linux-android"
PLATFORM_SHORT_ARCH="x86_64"
HAVE_64=1
elif [ "${ANDROID_ABI}" = "arm64-v8a" ] ; then
TARGET_TUPLE="aarch64-linux-android"
HAVE_ARM=1
HAVE_64=1
PLATFORM_SHORT_ARCH="arm64"
elif [ "${ANDROID_ABI}" = "armeabi-v7a" ] ; then
TARGET_TUPLE="arm-linux-androideabi"
HAVE_ARM=1
PLATFORM_SHORT_ARCH="arm"
else
echo "Unknown ABI: '${ANDROID_ABI}'. Die, die, die!"
exit 2
fi
# try to detect NDK version
REL=$(grep -o '^Pkg.Revision.*[0-9]*.*' $ANDROID_NDK/source.properties |cut -d " " -f 3 | cut -d "." -f 1)
if [ "$REL" -eq 18 ]; then
if [ "${HAVE_64}" = 1 ]; then
ANDROID_API=21
else
ANDROID_API=17
fi
else
echo "NDK v18 needed, cf. https://developer.android.com/ndk/downloads/"
exit 1
fi
NDK_TOOLCHAIN_DIR=${PWD}/toolchains/${PLATFORM_SHORT_ARCH}
NDK_TOOLCHAIN_PATH=${NDK_TOOLCHAIN_DIR}/bin
# Add the NDK toolchain to the PATH, needed both for contribs and for building
# stub libraries
CROSS_TOOLS=${NDK_TOOLCHAIN_PATH}/${TARGET_TUPLE}-
export PATH="${NDK_TOOLCHAIN_PATH}:${PATH}"
ON_WINDOWS=0
if [ ! -z "$MSYSTEM_PREFIX" ] ; then
# The make.exe and awk.exe from the toolchain don't work in msys
export PATH="$MSYSTEM_PREFIX/bin:/usr/bin:${NDK_TOOLCHAIN_PATH}:${PATH}"
ON_WINDOWS=1
fi
##########
# CFLAGS #
##########
VLC_CFLAGS="-std=gnu11"
VLC_CXXFLAGS="-std=gnu++11"
if [ "$NO_OPTIM" = "1" ];
then
VLC_CFLAGS="${VLC_CFLAGS} -g -O0"
VLC_CXXFLAGS="${VLC_CXXFLAGS} -g -O0"
else
VLC_CFLAGS="${VLC_CFLAGS} -g -O2"
VLC_CXXFLAGS="${VLC_CXXFLAGS} -g -O2"
fi
VLC_CFLAGS="${VLC_CFLAGS} -fstrict-aliasing -funsafe-math-optimizations"
VLC_CXXFLAGS="${VLC_CXXFLAGS} -fstrict-aliasing -funsafe-math-optimizations"
# Setup CFLAGS per ABI
if [ "${ANDROID_ABI}" = "armeabi-v7a" ] ; then
EXTRA_CFLAGS="-march=armv7-a -mfpu=neon -mcpu=cortex-a8"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -mthumb -mfloat-abi=softfp"
elif [ "${ANDROID_ABI}" = "x86" ] ; then
EXTRA_CFLAGS="-mtune=atom -msse3 -mfpmath=sse -m32"
fi
EXTRA_CFLAGS="${EXTRA_CFLAGS} -MMD -MP -fpic -ffunction-sections -funwind-tables \
-fstack-protector-strong -Wno-invalid-command-line-argument -Wno-unused-command-line-argument \
-no-canonical-prefixes -fno-integrated-as"
EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS} -fexceptions -frtti"
EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS} -D__STDC_FORMAT_MACROS=1 -D__STDC_CONSTANT_MACROS=1 -D__STDC_LIMIT_MACROS=1"
#################
# Setup LDFLAGS #
#################
EXTRA_LDFLAGS="${VLC_LDFLAGS}"
if [ ${ANDROID_ABI} = "armeabi-v7a" ]; then
EXTRA_PARAMS=" --enable-neon"
EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -Wl,--fix-cortex-a8"
fi
NDK_LIB_DIR="${NDK_TOOLCHAIN_DIR}/${TARGET_TUPLE}/lib"
if [ "${PLATFORM_SHORT_ARCH}" = "x86_64" ];then
NDK_LIB_DIR="${NDK_LIB_DIR}64"
elif [ "${PLATFORM_SHORT_ARCH}" = "arm" ]; then
NDK_LIB_DIR="${NDK_LIB_DIR}/armv7-a"
fi
EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -L${NDK_LIB_DIR} -lc++abi"
VLC_LDFLAGS="${EXTRA_LDFLAGS}"
# Release or not?
if [ "$AVLC_RELEASE" = 1 ]; then
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DNDEBUG "
NDK_DEBUG=0
else
NDK_DEBUG=1
fi
avlc_checkfail()
{
if [ ! $? -eq 0 ];then
echo "$1"
exit 1
fi
}
###############
# DISPLAY ABI #
###############
echo "ABI: $ANDROID_ABI"
echo "API: $ANDROID_API"
echo "PATH: $PATH"
echo "EXTRA_CFLAGS: ${EXTRA_CFLAGS}"
echo "VLC_CFLAGS: ${VLC_CFLAGS}"
echo "VLC_CXXFLAGS: ${VLC_CXXFLAGS}"
if [ -z "$ANDROID_NDK" ]; then
echo "Please set the ANDROID_NDK environment variable with its path."
exit 1
......@@ -49,6 +189,66 @@ if [ -z "$ANDROID_ABI" ]; then
exit 1
fi
avlc_make_toolchain()
{
NDK_TOOLCHAIN_PROPS=${NDK_TOOLCHAIN_DIR}/source.properties
NDK_FORCE_ARG=
if [ "`cat \"${NDK_TOOLCHAIN_PROPS}\" 2>/dev/null`" != "`cat \"${ANDROID_NDK}/source.properties\"`" ];then
echo "NDK changed, making new toolchain"
NDK_FORCE_ARG="--force"
fi
if [ ! -d ${NDK_TOOLCHAIN_DIR} ]; then
$ANDROID_NDK/build/tools/make_standalone_toolchain.py \
--arch ${PLATFORM_SHORT_ARCH} \
--api ${ANDROID_API} \
--stl libc++ \
${NDK_FORCE_ARG} \
--install-dir ${NDK_TOOLCHAIN_DIR}
fi
if [ ! -d ${NDK_TOOLCHAIN_PATH} ];
then
echo "make_standalone_toolchain.py failed"
exit 1
fi
if [ ! -z "${NDK_FORCE_ARG}" ];then
# Don't mess up nl_langinfo() detection since this symbol is not present for 64
# bits
if [ "${HAVE_64}" = 1 ];then
rm ${NDK_TOOLCHAIN_DIR}/sysroot/usr/local/include/langinfo.h
fi
fi
if [ ! -z "${NDK_FORCE_ARG}" ];then
cp "$ANDROID_NDK/source.properties" "${NDK_TOOLCHAIN_PROPS}"
fi
} # avlc_make_toolchain()
avlc_find_modules()
{
echo "`find $1 -name 'lib*plugin.a' | grep -vE "lib(${blacklist_regexp})_plugin.a" | tr '\n' ' '`"
}
avlc_get_symbol()
{
echo "$1" | grep vlc_entry_$2|cut -d" " -f 3
}
avlc_gen_pc_file()
{
echo "Generating $1 pkg-config file"
echo "Name: $1
Description: $1
Version: $2
Libs: -l$1
Cflags:" > contrib/${TARGET_TUPLE}/lib/pkgconfig/`echo $1|tr 'A-Z' 'a-z'`.pc
}
avlc_build()
{
avlc_make_toolchain
###########################
# VLC BOOTSTRAP ARGUMENTS #
###########################
......@@ -225,8 +425,6 @@ VLC_MODULE_BLACKLIST="
SRC_DIR=$PWD
. ./build-common
###########################
# Build buildsystem tools #
###########################
......@@ -235,11 +433,11 @@ export PATH="`pwd`/vlc/extras/tools/build/bin:$PATH"
echo "Building tools"
cd vlc/extras/tools
./bootstrap
checkfail "buildsystem tools: bootstrap failed"
avlc_checkfail "buildsystem tools: bootstrap failed"
make $MAKEFLAGS
checkfail "buildsystem tools: make failed"
avlc_checkfail "buildsystem tools: make failed"
make $MAKEFLAGS .gas || make $MAKEFLAGS .buildgas
checkfail "buildsystem tools: make failed"
avlc_checkfail "buildsystem tools: make failed"
cd ../../..
VLC_SRC_DIR="$SRC_DIR/vlc"
......@@ -254,7 +452,7 @@ cd vlc
if [ ! -f configure ]; then
echo "Bootstraping"
./bootstrap
checkfail "vlc: bootstrap failed"
avlc_checkfail "vlc: bootstrap failed"
fi
############
......@@ -264,25 +462,16 @@ fi
echo "Building the contribs"
mkdir -p contrib/contrib-android-${TARGET_TUPLE}
gen_pc_file() {
echo "Generating $1 pkg-config file"
echo "Name: $1
Description: $1
Version: $2
Libs: -l$1
Cflags:" > contrib/${TARGET_TUPLE}/lib/pkgconfig/`echo $1|tr 'A-Z' 'a-z'`.pc
}
mkdir -p contrib/${TARGET_TUPLE}/lib/pkgconfig
gen_pc_file EGL 1.1
gen_pc_file GLESv2 2
avlc_gen_pc_file EGL 1.1
avlc_gen_pc_file GLESv2 2
cd contrib/contrib-android-${TARGET_TUPLE}
export USE_FFMPEG=1
ANDROID_ABI=${ANDROID_ABI} ANDROID_API=${ANDROID_API} \
../bootstrap --host=${TARGET_TUPLE} ${VLC_BOOTSTRAP_ARGS}
checkfail "contribs: bootstrap failed"
avlc_checkfail "contribs: bootstrap failed"
# Some libraries have arm assembly which won't build in thumb mode
# We append -marm to the CFLAGS of these libs to disable thumb mode
......@@ -301,14 +490,14 @@ echo "LD=${NDK_TOOLCHAIN_PATH}/${TARGET_TUPLE}-ld" >> config.mak
export ac_cv_c_bigendian=no
make $MAKEFLAGS fetch
checkfail "contribs: make fetch failed"
avlc_checkfail "contribs: make fetch failed"
# gettext
which autopoint >/dev/null || make $MAKEFLAGS .gettext
#export the PATH
# Make
make $MAKEFLAGS
checkfail "contribs: make failed"
avlc_checkfail "contribs: make failed"
cd ../../
......@@ -347,7 +536,12 @@ export ac_cv_header_search_h=no
export ac_cv_func_tdestroy=no
export ac_cv_func_tfind=no
if [ ! -e ./config.h -o "$RELEASE" = 1 ]; then
if [ ! -e ./config.h -o "$AVLC_RELEASE" = 1 ]; then
VLC_CONFIGURE_DEBUG=""
if [ ! "$AVLC_RELEASE" = 1 ]; then
VLC_CONFIGURE_DEBUG="--enable-debug"
fi
CFLAGS="${VLC_CFLAGS} ${EXTRA_CFLAGS}" \
CXXFLAGS="${VLC_CXXFLAGS} ${EXTRA_CFLAGS} ${EXTRA_CXXFLAGS}" \
CC="${CROSS_TOOLS}clang" \
......@@ -362,8 +556,8 @@ PATH=../contrib/bin:$PATH \
sh ../configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux \
--with-contrib=${VLC_SRC_DIR}/contrib/${TARGET_TUPLE} \
--prefix=${VLC_BUILD_DIR}/install/ \
${EXTRA_PARAMS} ${VLC_CONFIGURE_ARGS} ${OPTS}
checkfail "vlc: configure failed"
${EXTRA_PARAMS} ${VLC_CONFIGURE_ARGS} ${VLC_CONFIGURE_DEBUG}
avlc_checkfail "vlc: configure failed"
fi
############
......@@ -372,9 +566,9 @@ fi
echo "Building"
make $MAKEFLAGS
checkfail "vlc: make failed"
avlc_checkfail "vlc: make failed"
make install
checkfail "vlc: make install failed"
avlc_checkfail "vlc: make install failed"
cd $SRC_DIR
......@@ -401,17 +595,7 @@ do
fi
done
find_modules()
{
echo "`find $1 -name 'lib*plugin.a' | grep -vE "lib(${blacklist_regexp})_plugin.a" | tr '\n' ' '`"
}
get_symbol()
{
echo "$1" | grep vlc_entry_$2|cut -d" " -f 3
}
VLC_MODULES=$(find_modules ${VLC_BUILD_DIR}/modules)
VLC_MODULES=$(avlc_find_modules ${VLC_BUILD_DIR}/modules)
DEFINITION="";
BUILTINS="const void *vlc_static_modules[] = {\n";
for file in $VLC_MODULES; do
......@@ -420,9 +604,9 @@ for file in $VLC_MODULES; do
symbols=$("${CROSS_TOOLS}nm" -g $file)
# assure that all modules have differents symbol names
entry=$(get_symbol "$symbols" _)
copyright=$(get_symbol "$symbols" copyright)
license=$(get_symbol "$symbols" license)
entry=$(avlc_get_symbol "$symbols" _)
copyright=$(avlc_get_symbol "$symbols" copyright)
license=$(avlc_get_symbol "$symbols" license)
cat <<EOF > ${REDEFINED_VLC_MODULES_DIR}/syms
AccessOpen AccessOpen__$name
AccessClose AccessClose__$name
......@@ -441,7 +625,7 @@ $copyright vlc_entry_copyright__$name
$license vlc_entry_license__$name
EOF
${CROSS_TOOLS}objcopy --redefine-syms ${REDEFINED_VLC_MODULES_DIR}/syms $file $outfile
checkfail "objcopy failed"
avlc_checkfail "objcopy failed"
DEFINITION=$DEFINITION"int vlc_entry__$name (int (*)(void *, void *, int, ...), void *);\n";
BUILTINS="$BUILTINS vlc_entry__$name,\n";
......@@ -465,7 +649,7 @@ rm ${REDEFINED_VLC_MODULES_DIR}/syms
# NDK-Build for libvlc.so and libvlcjni.so #
############################################
VLC_MODULES=$(find_modules ${REDEFINED_VLC_MODULES_DIR})
VLC_MODULES=$(avlc_find_modules ${REDEFINED_VLC_MODULES_DIR})
VLC_CONTRIB_LDFLAGS=`for i in $(/bin/ls $VLC_CONTRIB/lib/pkgconfig/*.pc); do PKG_CONFIG_PATH="$VLC_CONTRIB/lib/pkgconfig/" pkg-config --libs $i; done |xargs`
echo -e "ndk-build vlc"
......@@ -485,7 +669,7 @@ $ANDROID_NDK/ndk-build$OSCMD -C libvlc \
NDK_TOOLCHAIN_VERSION=clang \
NDK_DEBUG=${NDK_DEBUG}
checkfail "ndk-build libvlc failed"
avlc_checkfail "ndk-build libvlc failed"
cd ${SRC_DIR}
OUT_DBG_DIR=.dbg/${ANDROID_ABI}
......@@ -493,3 +677,8 @@ echo "Dumping dbg symbols info ${OUT_DBG_DIR}"
mkdir -p $OUT_DBG_DIR
cp -a libvlc/jni/obj/local/${ANDROID_ABI}/*.so ${OUT_DBG_DIR}
} # avlc_build()
if [ "$AVLC_SOURCED" != "1" ]; then
avlc_build
fi
#!/bin/sh
#############
# FUNCTIONS #
#############
checkfail()
{
if [ ! $? -eq 0 ];then
echo "$1"
exit 1
fi
}
#############
# ARGUMENTS #
#############
......@@ -53,8 +41,8 @@ fi
SRC_DIR=$PWD
. ./build-common
AVLC_SOURCED=1 . ./compile-libvlc.sh
avlc_make_toolchain
################
# MEDIALIBRARY #
......@@ -107,7 +95,7 @@ fi
make $MAKEFLAGS
cd ${SRC_DIR}
checkfail "sqlite build failed"
avlc_checkfail "sqlite build failed"
##############################
# FETCH MEDIALIBRARY SOURCES #
......@@ -116,7 +104,7 @@ checkfail "sqlite build failed"
if [ ! -d "${MEDIALIBRARY_MODULE_DIR}/medialibrary" ]; then
echo -e "\e[1m\e[32mmedialibrary source not found, cloning\e[0m"
git clone http://code.videolan.org/videolan/medialibrary.git "${SRC_DIR}/medialibrary/medialibrary"
checkfail "medialibrary source: git clone failed"
avlc_checkfail "medialibrary source: git clone failed"
cd ${MEDIALIBRARY_MODULE_DIR}/medialibrary
git submodule update --init libvlcpp
else
......@@ -172,7 +160,7 @@ if [ ! -e ./config.h -o "$RELEASE" = 1 ]; then
SQLITE_LIBS="-L$MEDIALIBRARY_MODULE_DIR/$SQLITE_RELEASE/build-$ANDROID_ABI/.libs -lsqlite3" \
SQLITE_CFLAGS="-I$MEDIALIBRARY_MODULE_DIR/$SQLITE_RELEASE" \
AR="${CROSS_TOOLS}ar"
checkfail "medialibrary: autoconf failed"
avlc_checkfail "medialibrary: autoconf failed"
fi
############
......@@ -182,7 +170,7 @@ fi
echo -e "\e[1m\e[32mBuilding medialibrary\e[0m"
make $MAKEFLAGS
checkfail "medialibrary: make failed"
avlc_checkfail "medialibrary: make failed"
cd ${SRC_DIR}
......@@ -208,7 +196,7 @@ $ANDROID_NDK/ndk-build$OSCMD -C medialibrary \
MEDIALIBRARY_INCLUDE_DIR=${MEDIALIBRARY_BUILD_DIR}/include \
NDK_DEBUG=${NDK_DEBUG}
checkfail "nkd-build medialibrary failed"
avlc_checkfail "nkd-build medialibrary failed"
echo "Dumping dbg symbols info ${OUT_DBG_DIR}"
......
......@@ -22,6 +22,7 @@ checkfail()
# Setup all that stuff correctly.
# Get the latest Android SDK Platform or modify numbers in configure.sh and libvlc/default.properties.
RELEASE=0
while [ $# -gt 0 ]; do
case $1 in
help|--help|-h)
......@@ -271,7 +272,8 @@ compile() {
# Build LibVLC if asked for it, or needed by medialibrary
if [ "$BUILD_MEDIALIB" != 1 -o ! -d "libvlc/jni/libs/$1" ]; then
./compile-libvlc.sh $OPTS
AVLC_SOURCED=1 . ./compile-libvlc.sh
avlc_build
fi
if [ "$NO_ML" != 1 ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment