2016-02-01 22:22:10 +08:00
|
|
|
#!/bin/bash
|
2021-11-26 12:52:18 +08:00
|
|
|
SCM_URL=https://github.com/cisco/openh264/archive
|
2022-10-10 15:49:28 +08:00
|
|
|
SCM_TAG=v2.3.1
|
|
|
|
SCM_HASH=453afa66dacb560bc5fd0468aabee90c483741571bca820a39a1c07f0362dc32
|
2016-02-01 22:22:10 +08:00
|
|
|
|
|
|
|
source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh
|
|
|
|
|
|
|
|
function build {
|
|
|
|
echo "Building architecture $1..."
|
|
|
|
BASE=$(pwd)
|
|
|
|
common_run cd $BUILD_SRC
|
2016-02-04 23:09:49 +08:00
|
|
|
PATH=$ANDROID_NDK:$PATH
|
2022-05-13 16:19:54 +08:00
|
|
|
MAKE="make PATH=$PATH ENABLEPIC=Yes OS=android NDKROOT=$ANDROID_NDK NDK_TOOLCHAIN_VERSION=clang TARGET=android-$2 NDKLEVEL=$2 ARCH=$1 -j libraries"
|
|
|
|
|
2017-01-25 23:00:29 +08:00
|
|
|
common_run export QUIET_AR="$CCACHE "
|
|
|
|
common_run export QUIET_ASM="$CCACHE "
|
|
|
|
common_run export QUIET_CC="$CCACHE "
|
|
|
|
common_run export QUIET_CCAR="$CCACHE "
|
|
|
|
common_run export QUIET_CXX="$CCACHE "
|
|
|
|
|
2020-04-08 18:37:36 +08:00
|
|
|
common_run $MAKE -j
|
2016-02-01 22:22:10 +08:00
|
|
|
# Install creates a non optimal directory layout, fix that
|
|
|
|
common_run $MAKE PREFIX=$BUILD_SRC/libs/$1 install
|
|
|
|
common_run cd $BASE
|
|
|
|
}
|
|
|
|
|
|
|
|
# Run the main program.
|
|
|
|
common_parse_arguments $@
|
|
|
|
common_check_requirements
|
2022-10-10 15:49:28 +08:00
|
|
|
common_update $SCM_URL $SCM_TAG $BUILD_SRC $SCM_HASH
|
2018-11-09 10:20:52 +08:00
|
|
|
|
2016-02-01 22:22:10 +08:00
|
|
|
|
|
|
|
for ARCH in $BUILD_ARCH
|
|
|
|
do
|
|
|
|
case $ARCH in
|
|
|
|
"armeabi")
|
|
|
|
OARCH="arm"
|
|
|
|
;;
|
|
|
|
"armeabi-v7a")
|
|
|
|
OARCH="arm"
|
|
|
|
;;
|
|
|
|
"arm64-v8a")
|
|
|
|
OARCH="arm64"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
OARCH=$ARCH
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "$ARCH=$OARCH"
|
|
|
|
|
|
|
|
build $OARCH $NDK_TARGET
|
|
|
|
|
2017-03-09 16:30:38 +08:00
|
|
|
if [ ! -d $BUILD_DST/$ARCH/include ];
|
2016-02-01 22:22:10 +08:00
|
|
|
then
|
2017-03-09 16:30:38 +08:00
|
|
|
common_run mkdir -p $BUILD_DST/$ARCH/include
|
2016-02-01 22:22:10 +08:00
|
|
|
fi
|
|
|
|
|
2017-03-09 16:30:38 +08:00
|
|
|
common_run cp -L -r $BUILD_SRC/libs/$OARCH/include/ $BUILD_DST/$ARCH/
|
2016-02-01 22:22:10 +08:00
|
|
|
if [ ! -d $BUILD_DST/$ARCH ];
|
|
|
|
then
|
|
|
|
common_run mkdir -p $BUILD_DST/$ARCH
|
|
|
|
fi
|
|
|
|
common_run cp -L $BUILD_SRC/libs/$OARCH/lib/*.so $BUILD_DST/$ARCH/
|
|
|
|
done
|