Files
projectm/configure-ndk
Peter Malkin 87e16c14aa projectM Android native build (#191)
* configure script to build libprojectM with NDK

Allows to cross compile libprojectM library using
Android's toolchain for an arm target.
Tested on Ubuntu.

* Android-NDK: Build .so as well as .a

* Adjust CPPFLAGS to make the .so actually usable

* WIP: crashes in trying to link egl

* Add libEGL to linking flags, so that libprojectM.so depends on libEGL.so

* configure-ndk: set install paths

By setting prefix, libdir and datarootdir it's possible to simply do
$ ./autogen.sh
$ ./configure-ndk
$ make -j`nproc` && make install-strip

to build the library, copy it and headers to the right place, and install
all presets as Android assets for inclusion in the apk.

* Let gradle include libc++_shared.so

No need to include this manually, better to let gradle pull in the
version from the NDK toolchain in use.

* Load jniwrapper

Get boring UnsatisfiedLinkError otherwise.

* Extract and use embedded preset assets

Now ProjectM will cycle through all available presets
based on default settings.

* Add precompiled preset assets

* Don't leak existing instance when creating new one

* A few minor Android build changes: use GLESv3 instead, do not try to build SDL under NDK

* Mark GLESv3 as required.

On some rockchip devices I tested on - only v2 is supported.
projectM fails on glGetSampler calls, since those are not implemented.

* Make Activity full screen

* Android:
 - hook up basic audio
 - start on a random preset
 - switch presets on touch

* Android package rename

* Android: do not story a copy of all presets inside android app

After building the android app's dependecies using NDK,
`make install-strip` copies over the prebuilt libraries
as well as all the presets. Since they are stored in this
git repo, no need to store a copy.

I leave a few test presests in the app, in case someone
wants to try building the app without rebuilding the dependencies.
2019-04-11 16:58:30 +02:00

26 lines
944 B
Bash
Executable File

#!/bin/bash
if [ -z ${NDK+x} ]; then
export NDK=${HOME}/Android/Sdk/ndk-bundle;
fi
export HOST_TAG=linux-x86_64
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG
export TARGET=arm-linux-androideabi
export AR=$TOOLCHAIN/bin/$TARGET-ar
export AS=$TOOLCHAIN/bin/$TARGET-as
export LD=$TOOLCHAIN/bin/$TARGET-ld
export RANLIB=$TOOLCHAIN/bin/$TARGET-ranlib
export STRIP=$TOOLCHAIN/bin/$TARGET-strip
export CC=$TOOLCHAIN/bin/armv7a-linux-androideabi19-clang
export CXX=$TOOLCHAIN/bin/armv7a-linux-androideabi19-clang++
export LIBS_NDK=$NDK/sources/third_party/vulkan/src/libs/
export CPPFLAGS="-march=armv7-a -I$LIBS_NDK -fPIC"
export GL_LIBS="-lGLESv3 -lEGL"
./configure --host arm-linux-androideabi \
--enable-gles --disable-static --disable-sdl --disable-qt \
--prefix=`realpath src/projectm-android/app/jniLibs` \
--libdir='${exec_prefix}/armeabi-v7a' \
--datarootdir=`realpath src/projectm-android/app/src/main/assets`