On 10/07/2014 11:36 PM, Mikhail Zemlyanukha wrote:
> OK, I have found that
> info:
http://www.swi-prolog.org/build/linuxonandroid.txt
>
> I'd like to call SWIPL from Java code via JNI, and I think SWIPL should
> be compiled with NDK, Linux-On-Android solutions won't do. Am I correct?
I'm not an Android expert, but I think you are right. Compiling with
NDK is probably quite feasible though. I assume it is mainly fiddling
with the build environment. I'm don't know what C library is present
for NDK. A quick search reveals
http://en.wikipedia.org/wiki/Bionic_%28software%29,
which contains a few alarming remarks:
- "Bionic does not include wide character support"
- "Some functions within Bionic's POSIX and system call headers are stubs
or wrappers for Android-specific behavior, causing unintended behavior
in some instances."
I think you can get away with a few stubs to get enough wide character
support to make the system compile. SWI-Prolog has its own support for
UTF-8. It uses the wide-character copy, compare, strlen, etc. routines,
but it is easy to provide these. It uses multibyte<->unicode routines
for dealing with the current locale and the character classification
routines for char_type/2. The parser is based on internal classification
tables.
I don't know what the second point is. SWI-Prolog doesn't use anything
fancy from the C library. The only critical area is the thread support,
notably the interaction between threads and signals is sometimes a bummer
(happened on NetBSD. Don't know the current status).
That said, JPL (the Java interface) is also problematic on many platforms,
both to get configured right and to avoid signal interaction issues. It
is often possible to get a specific JVM on a specific OS configured
correctly, but it requires some work.
Cheers --- Jan