* Can GNAT Community projects be compiled to the Android platform?
@ 2022-09-08 22:28 梅煜
2022-09-09 6:52 ` Luke A. Guest
0 siblings, 1 reply; 2+ messages in thread
From: 梅煜 @ 2022-09-08 22:28 UTC (permalink / raw)
Can GNAT Community projects be compiled to the Android platform? or NDK?
If so, how should it be done?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Can GNAT Community projects be compiled to the Android platform?
2022-09-08 22:28 Can GNAT Community projects be compiled to the Android platform? 梅煜
@ 2022-09-09 6:52 ` Luke A. Guest
0 siblings, 0 replies; 2+ messages in thread
From: Luke A. Guest @ 2022-09-09 6:52 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-09 6:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-08 22:28 Can GNAT Community projects be compiled to the Android platform? 梅煜
2022-09-09 6:52 ` Luke A. Guest
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox