ReadyTalk / avian

[INACTIVE] Avian is a lightweight virtual machine and class library designed to provide a useful subset of Java's features, suitable for building self-contained applications.
https://readytalk.github.io/avian/
Other
1.22k stars 172 forks source link

Building embedded avian with openjdk class library without buliding the whole openjdk package #536

Closed AntonBikineev closed 7 years ago

AntonBikineev commented 7 years ago

Hi folks, and thanks for the nice project! It's been a real pleasure working with avian.

What I want to do is crosscompile an avian embedded project that uses openjdk. But first I need to crosscompile openjdk class library. There are instructions on how to do that in the main page for debian package and, of course, I can do that from tarball or from openjdk mercurial repository. The problem is that my system is very constrained and it's very hard to build the whole openjdk project, considering that for avian I only need class library, not hotspot and all the accompanying stuff.

So I wonder, given that I have openjdk installed on my host machine, is there a way to cross-compile only openjdk class library, skipping hotspot, javac and all the rest?

Thanks.

dicej commented 7 years ago

Hi Anton,

If you build Avian using the openjdk-src option, you should be able to use the host OpenJDK image, since all Avian needs from that are platform-independent files. Avian will build the native code from OpenJDK itself, so as long as Avian is using the correct cross compiler, it should work.

For example:

make openjdk=${OPENJDK_HOST_BUILD} openjdk-src=${OPENJDK_SOURCE_TREE}

See Avian's README.md for more info.

Hope that helps.

AntonBikineev commented 7 years ago

Hi Joel, Oh yeah, it works, and quiet smoothly! After reading these lines in README.md

$ apt-get source openjdk-7-jdk
$ apt-get build-dep openjdk-7-jdk
$ (cd openjdk-7-7~b147-2.0 && dpkg-buildpackage)

I had an impression that to use openjdk-classpath, I need to build it myself. But it turns out that avian buildsystem does all the work for me. Thanks!