On 08/09/2022 23:28, 梅煜 wrote:
Can GNAT Community projects be compiled to the Android platform? or NDK?
If so, how should it be done?
Since google moved to clang, you'd need to check to see if they do what
apple does which prohibits gpl components being used.
It's not been done for a while afaik, I've not compiled the compiler for
a long time and I'm rusty on the details. You basically need an arm (--target=<your target triple> you should get this from the equivalent
c/c++ compiler in the ndk for the version you are targetting) cross
compiler.
You then need either a Java startup activity which calls into Ada code
or an Ada NativeActivity which binds the C version in the ndk, that will
call AdaInit and AdaFinal (think that's the right name).
If you need to call into any lib on Android which requires a binding,
you need to generate that, so either a C binding or a JNI binding. I
have a JNI package on my github which you can use as a start, a tool to
get generate the bindings to Java would be required as JNI is really
tedious.
https://github.com/Lucretia/jni https://github.com/Lucretia/jni/blob/master/tests/test.adb
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)