lantern-avian
Objective
lantern-avian is a utility project that supports building compact standalone executables of Lantern and related projects, using a combination of Avian, OpenJDK and ProGuard.
The build file used by lantern-avian is based on the one provided by avian-swt-examples.
Prerequisites
Note - all projects should be checked out to the same base folder
lantern-avian
git clone https://github.com/getlantern/lantern-avian.git
Avian (Lantern Fork)
We're using a fork right now to work around a bug in the Avian makefile. The fix has been pull requested to Avian.
git clone https://github.com/getlantern/avian.git
UPX (on Ubuntu)
sudo apt-get install upx
OpenJDK 7
On Windows
-
Set up Cygwin as described by the avian README.
-
Install openjdk7 update 45 installer and source from Alex Kasko's Unofficial Builds.
-
Install openjdk7 to c:\opt\openjdk7-image and the soruce to c:\opt\openjdk7-source
On OS X
The Mac OS X build uses the unofficial OpenJDK builds from Alex Kasko
- Download OpenJDK 7 update 40 build 43 from
here
and put it at
/opt/openjdk7-image
- Download the corresponding source from here
and put it at
/opt/openjdk7-source
- In
/opt/openjdk7-source/jdk/src/solaris/native/java/net/net_util_md.c
, change lines 117 and 119 to sayCHECK_NULL_RETURN(c, NULL)
instead ofCHECK_NULL(c)
On Ubuntu
sudo apt-get install openjdk-7-jdk
sudo apt-get source openjdk-7-jdk
sudo apt-get build-dep openjdk-7-jdk
(cd openjdk-7-7u25-2.3.10 && dpkg-buildpackage)
make openjdk=/usr/lib/jvm/java-7-openjdk \
openjdk-src=$(pwd)/openjdk-7-7~b147-2.0/build/openjdk/jdk/src \
test
cd ..
sudo mv openjdk-7-7u25-2.3.10 /usr/lib/jvm/java-7-openjdk-amd64-source/build/openjdk/jdk/src
Usage
Add a new target to makefile
. You can pattern this after the target
LittleProxy.
make full-platform=<platform> <target_name>
is one of:
platform |
---|
linux-x86_64 |
darwin-x86_64-cocoa |
windows-i386 |
For a debug build:
make mode=debug <target_name>
Note - the builds use project-specific ProGuard configurations like
LittleProxy.pro
. These configurations may be auto-generated as a result of
running the project's tests, in which case you'll want to make sure to run the
tests before building a standalone executable with lantern-avian.