From: "Luke A. Guest" <[email protected]>
Subject: Re: Can GNAT Community projects be compiled to the Android platform?
Date: Fri, 9 Sep 2022 07:52:43 +0100 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: 6230d0eb-d62d-4a54-92f3-75f9cccd4282n@googlegroups.com
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
prev parent reply other threads:[~2022-09-09 6:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-08 22:28 Can GNAT Community projects be compiled to the Android platform? 梅煜
2022-09-09 6:52 ` Luke A. Guest [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox