Am 27.04.2020 um 13:38 schrieb Mgr. Janusz Chmiel via fpc-other:
Dear specialists,
My long term dream is to develop simple Android IDE which will be able to
compile Pascal app based on PPCJVM to The fully functional .apk package. The
first what I would like to plea you is to give Me direct link to download
PPCJVM for ARM64. So PPCJVM, which can compile Pascal sources to .class
Unfortunately, I do not know, who have developed Android build tools for
Android, not for Windows or for Linux and if those build tools can be
legally downloaded from somewhere.

We do not provide a compiler that can run on Android, but you can compile it yourself. Please note that I have not fully tested the following steps, but please feel free to ask back if you have problems.

You'll need the following:
- a FPC 3.2 RC1 installation (at least for now until we've released the final version); you can find it here: (just to avoid confusion: the aarch64-android mentioned there is *not* what you want right now)
- the sources for FPC 3.2 RC1 also available on that site
- the, if you don't have it already; it's available here:
- the NDK for the Android version you want to target

For this example I'll assume that you installed FPC 3.2 RC1 on a Linux in /opt/fpc. Thus the fpc binary will be available in /opt/fpc/bin/fpc and the units will be in /opt/fpc/lib/fpc/3.2.0rc1/units. The sources I assume to be in ~/sources/fpc/3.2.0 and the NDK (the directory containing "as" and "ld") as well as the fpcjvmutiltities I assume to be available in $PATH, otherwise you'll need to specify their paths using CROSSBINDIR for their corresponding steps.

First we create the Java compatible units and class files.

For this go to the directory with the FPC sources and execute the following (here you need to specify the fpcjvmutilties using CROSSBINDIR if you don't have them in PATH):

make crossall FPC=/opt/fpc/bin/fpc OS_TARGET=android CPU_TARGET=jvm

If this was successful do the following (the INSTALL_PREFIX will be the same directory you installed FPC in, in our example /opt/fpc):

make crossinstall FPC=/opt/fpc/bin/fpc OS_TARGET=android CPU_TARGET=jvm INSTALL_PREFIX=/opt/fpc

As next step you need to create a cross compiler for aarch64-android (here you need to specify the NDK using CROSSBINDIR if you don't have them in PATH):

make crossall FPC=/opt/fpc/bin/fpc OS_TARGET=android CPU_TARGET=aarch64

If this was successful you do a

make crossinstall FPC=/opt/fpc/bin/fpc OS_TARGET=android CPU_TARGET=aarch64 INSTALL_PREFIX=/opt/fpc

As the last step we need to cross compile the JVM compiler for aarch64-android. For this change into the compiler directory and execute:

make all FPC=/opt/fpc/bin/ppcrossa64 JVM=1

This will create a ppcjvm that you can run on an Android device. Additionally you will need all the files that were copied to the /opt/fpc/lib/3.2.0rc1/units/jvm-android directory. Now you only need to supply a suitable fpc.cfg file to the compiler and hope that the jasmin.jar assembler can run on Android.

I hope this helps you.

fpc-other maillist  -

Reply via email to