This document provides an overview of the changes that have been made to Robovm to build on Windows.
Fondamentally, there is no big changes for the end user apart the fact that Robovm now relies on an updated set of components. Which should be transparent to the end user.
The set up on Windows has the following steps:
- download
Robovm
(that now includes Windows binaries, Windows runtime dependencies and robovm-llvm runtime dependencies) - install
mingw
(without msys) - choose a way to notify Robovm about the mingw installation path. (There is no fixed installation path on Windows). It may be by setting a environment variable or passing an argument to robovm command line
- build their application
- package their application including the runtime dependencies (dll)
Robovm 0.0.13 | New branch | |
---|---|---|
Android | 4.1.1_r3 | 4.4_r0.7 |
icu4c | 4.8.0.0 | 51.1.0.0 |
openssl | 1.0.1c | 1.0.1e |
javasqlite | 20100727 | 20100727 |
sqlite | 3071100 | 3071100 |
zlib | 1.2.6 | 1.2.8 |
expat | 2.0.1 | 2.1.0 |
fdlibm | 5.3 | 5.3 |
This part is about building and maintaining Robovm on a Windows box (this does not cover cross compilation for Windows).
GCC linker works differently on Windows so the robovm compiler
must be adapted to work in two phases.
Once the java classes have been compiled to .o files, robovm compiler
calls gcc
to link the files and create the executable.
Not surprisingly, the linking process requires is specific on Windows requiring different options and different libraries.
At the moment the modifications to the linking process are implemented in the current code logic.
In the future, it would more convenient to have a pluggable linking sytem to ease the support of many platforms (IOS, Mac, Windows and Windows cross compilation).
Windows has no package manager for mingw compiled libraries. It means that each dependency not provided by mingw has to be downloaded and compiled separately.
Sometimes, it's straightforward as the library uses cmake. Some other times, the library may use shell/perl scripts that would require msys (msys is a lightweight shell environment for windows).
The code for those libraries is not included in robovm repository.
In the future it may be a good idea to add the code to those libraries in robovm repository
The following dependencies have been added :
- dlfcn
- gc (cmake fails to download and patch imvai gc on Windows)
- pthead
- a custom version of openssl is used (not the one in the Robovm repository)
The Windows specific dependencies can be found here.
The folder crypto
has been added to robovm/vm/rt/android
: the cryptographic code has changed with Android 4.4_r07.
We used a new version of libcore which is derived from libcore64 a 64bits Windows compliant version of libcore.
libcore64
is based on Android 4.4_r07 and uses Android.mk build system.
Our branch ported it to cmake.
While numerous functions have been port to Windows, there is still work left to do. At the moment, some code is still commented. The list of the most important issues is here.
Because we are using GPL compiler and components, some components have to be shipped as dll and thus cannot be statically linked.
It means that :
- librobovm-llvm.dll needs to find its runtime dependencies.
- any application needs its runtime dependencies (different from the librobovm-llvm.dll dependencies)
The Windows specific dependencies can be found here
At the moment, robovm on windows must be built with gcc (see this issue).
Also the following components must be compiled with fpermissive
flag:
- crypto
- libnativehelper
- libcore
As the external components have been updated, so have the compilation flags in the cmake files