blob: de2f57f8ef15be94b94336a63d9af00a94a62226 [file] [log] [blame]
Vignesh Venkatasubramanianaaa31952023-04-25 12:37:09 -07001#!/bin/bash
2
3# This script will build dav1d for the default ABI targets supported by android.
4# This script only works on linux. You must pass the path to the android NDK as
5# a parameter to this script.
6#
7# Android NDK: https://developer.android.com/ndk/downloads
8#
9# The git tag below is known to work, and will occasionally be updated. Feel
10# free to use a more recent commit.
11
James Zern41ed9142023-07-14 16:45:33 -070012set -e
13
Vignesh Venkatasubramanianaaa31952023-04-25 12:37:09 -070014if [ $# -ne 1 ]; then
15 echo "Usage: ${0} <path_to_android_ndk>"
16 exit 1
17fi
Wan-Teh Chang6d64a8c2024-06-12 08:21:39 -070018git clone -b 1.4.3 --depth 1 https://code.videolan.org/videolan/dav1d.git
Vignesh Venkatasubramanianaaa31952023-04-25 12:37:09 -070019cd dav1d
Vignesh Venkatasubramanianaaa31952023-04-25 12:37:09 -070020mkdir build
21cd build
22
Vignesh Venkatasubramanianb2314102023-09-20 14:27:47 -070023# This only works on linux and mac.
24if [ "$(uname)" == "Darwin" ]; then
25 HOST_TAG="darwin"
26else
27 HOST_TAG="linux"
28fi
29android_bin="${1}/toolchains/llvm/prebuilt/${HOST_TAG}-x86_64/bin"
Vignesh Venkatasubramanianaaa31952023-04-25 12:37:09 -070030
31ABI_LIST=("armeabi-v7a" "arm64-v8a" "x86" "x86_64")
32ARCH_LIST=("arm" "aarch64" "x86" "x86_64")
33for i in "${!ABI_LIST[@]}"; do
34 abi="${ABI_LIST[i]}"
35 mkdir "${abi}"
36 cd "${abi}"
Wan-Teh Changddd24142023-05-17 11:33:41 -070037 PATH=$PATH:${android_bin} meson setup --default-library=static --buildtype release \
Vignesh Venkatasubramanianaaa31952023-04-25 12:37:09 -070038 --cross-file="../../package/crossfiles/${ARCH_LIST[i]}-android.meson" \
39 -Denable_tools=false -Denable_tests=false ../..
40 PATH=$PATH:${android_bin} ninja
41 cd ..
42done
43
44cd ../..