#!/usr/bin/env bash # Optional: build third-party codecs for Android and point Gradle/CMake at the outputs. # # Prerequisites: # git submodule update --init --recursive third-party/libvpx third-party/opus third-party/speex # Android NDK (same as used by the app, see local.properties or ndk.dir) # # Usage: # ./scripts/build-native-codecs.sh arm64-v8a # ANDROIDCAST_LIBVPX_LIB=$PWD/build/native/arm64-v8a/libvpx.a ./gradlew assembleDebug # set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" ABI="${1:-arm64-v8a}" OUT="$ROOT/build/native/$ABI" mkdir -p "$OUT" echo "Native codec build scaffold — ABI=$ABI" echo "Output directory: $OUT" echo "" echo "libvpx Android cross-compile is project-specific. After you produce libvpx.a, rebuild with:" echo " export ANDROIDCAST_LIBVPX_LIB=$OUT/libvpx.a" echo " ./gradlew assembleDebug" echo "" if [[ ! -d "$ROOT/third-party/libvpx" ]]; then echo "WARN: third-party/libvpx missing. Run: git submodule update --init third-party/libvpx" exit 1 fi echo "libvpx sources present at third-party/libvpx — add your configure/make steps here." touch "$OUT/.placeholder" echo "Done (placeholder). See ndk/README.md for integration notes."