From d074999dd061d94a487d63b9f66aa57cb64ae50c Mon Sep 17 00:00:00 2001 From: Konsta Date: Fri, 11 Apr 2025 16:52:33 +0300 Subject: [PATCH] android: add configure script --- configure-android | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 configure-android diff --git a/configure-android b/configure-android new file mode 100755 index 00000000..469b609e --- /dev/null +++ b/configure-android @@ -0,0 +1,62 @@ +#!/bin/bash + +# +# Copyright (C) 2025 KonstaKANG +# +# SPDX-License-Identifier: LGPL-2.1-or-later +# + +if [ ! -d "$ANDROID_NDK_HOME" ]; then + echo "ANDROID_NDK_HOME environment variable is not properly set!" + exit 1 +fi + +export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64 + +export TARGET=aarch64-linux-android +export API=35 +export CC="$TOOLCHAIN/bin/clang --target=$TARGET$API" +export CXX="$TOOLCHAIN/bin/clang++ --target=$TARGET$API" +export AR=$TOOLCHAIN/bin/llvm-ar +export AS=$CC +export LD=$TOOLCHAIN/bin/ld +export RANLIB=$TOOLCHAIN/bin/llvm-ranlib +export STRIP=$TOOLCHAIN/bin/llvm-strip + +echo "Running autoconf..." +touch ltconfig +libtoolize --force --copy --automake +aclocal +autoheader +automake --foreign --copy --add-missing +touch depcomp +autoconf + +ALSA_CONFIG=" \ +--disable-aload \ +--host=aarch64-linux \ +--with-configdir=/vendor/etc/alsa \ +--with-plugindir=/vendor/etc/alsa/lib/alsa-lib \ +--with-versioned=false" + +echo "Generating configuration..." +echo "./configure $ALSA_CONFIG $TARGET" +./configure $ALSA_CONFIG $TARGET + +cat > include/version.h <