Skip to content
Anton edited this page Mar 23, 2015 · 3 revisions

How to build FPC crosscompiler for arm-android

(adapted http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Building_the_compiler_yourself_in_Windows)

1 you should have the latest trunk version of FPC. It is easy to check out it by svn from http://svn.freepascal.org/svn/fpc/trunk;

2 you should have installed Android NDK (take it from https://developer.android.com/tools/sdk/ndk/index.html)

3 create a batch-file in the root of FPC trunk with the following contents:

set NDK=d:\adt32\ndk10
make crossinstall CPU_TARGET=arm OS_TARGET=android CROSSBINDIR=%NDK%\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin OPT=-dFPC_ARMEL BINUTILSPREFIX=arm-linux-androideabi- CROSSOPT="-Fl%NDK%\platforms\android-14\arch-arm\usr\lib" INSTALL_PREFIX=

where NDK should be set to where NDK was installed. INSTALL_PREFIX should be specified, otherwise compiled units and binaries will be in the "PP" folder in root of the drive. At the end simply run the batch.