81 lines
2.1 KiB
Bash
81 lines
2.1 KiB
Bash
|
#!/bin/bash
|
||
|
|
||
|
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
|
||
|
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [[ -z ${ARCH} ]]; then
|
||
|
echo -e "\n(*) ARCH not defined\n"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [[ -z ${API} ]]; then
|
||
|
echo -e "\n(*) API not defined\n"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [[ -z ${BASEDIR} ]]; then
|
||
|
echo -e "\n(*) BASEDIR not defined\n"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
# ENABLE COMMON FUNCTIONS
|
||
|
. ${BASEDIR}/build/android-common.sh
|
||
|
|
||
|
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
|
||
|
LIB_NAME="libvidstab"
|
||
|
set_toolchain_paths ${LIB_NAME}
|
||
|
|
||
|
# PREPARING FLAGS
|
||
|
BUILD_HOST=$(get_build_host)
|
||
|
CFLAGS=$(get_cflags ${LIB_NAME})
|
||
|
CXXFLAGS=$(get_cxxflags ${LIB_NAME})
|
||
|
LDFLAGS=$(get_ldflags ${LIB_NAME})
|
||
|
|
||
|
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
|
||
|
|
||
|
if [ -d "build" ]; then
|
||
|
rm -rf build
|
||
|
fi
|
||
|
|
||
|
mkdir build;
|
||
|
cd build
|
||
|
|
||
|
ASM_FLAGS=""
|
||
|
case ${ARCH} in
|
||
|
arm-v7a | arm-v7a-neon | arm64-v8a)
|
||
|
ASM_FLAGS="-DSSE2_FOUND=0 -DSSE3_FOUND=0 -DSSSE3_FOUND=0 -DSSE4_1_FOUND=0"
|
||
|
;;
|
||
|
*)
|
||
|
ASM_FLAGS=""
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
cmake -Wno-dev \
|
||
|
-DCMAKE_VERBOSE_MAKEFILE=0 \
|
||
|
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||
|
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||
|
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
|
||
|
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||
|
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||
|
-DCMAKE_BUILD_TYPE=Release \
|
||
|
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
|
||
|
-DCMAKE_SYSTEM_NAME=Generic \
|
||
|
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
|
||
|
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
|
||
|
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
|
||
|
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
|
||
|
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
|
||
|
-DUSE_OMP=0 \
|
||
|
${ASM_FLAGS} \
|
||
|
-DCMAKE_SYSTEM_PROCESSOR=$(get_cmake_target_processor) \
|
||
|
-DBUILD_SHARED_LIBS=0 .. || exit 1
|
||
|
|
||
|
make -j$(get_cpu_count) || exit 1
|
||
|
|
||
|
# MANUALLY COPY PKG-CONFIG FILES
|
||
|
cp vidstab.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
|
||
|
|
||
|
make install || exit 1
|