Setting Up A Compile Environment

From MoKee Open Source Wiki
Revision as of 12:53, 6 September 2017 by Martincz (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Other languages:
English • ‎日本語 • ‎中文(中国大陆)‎

You must have a 64-bit environment.

A Linux computer should have 8 GB RAM or more, otherwise build errors may occur.

Ubuntu 16.04

These instructions should work for other version of Ubuntu and most other Debian-based systems.

Install build packages

Open a terminal (ctrl + alt + t). First install the necessary packages; copy paste the code below and hit enter.

$ sudo apt-get update && sudo apt-get install git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven bc pngquant imagemagick yasm libssl-dev

Check your java version (it must be 1.8)

 javac -version

If it is 1.7, you MUST change it to 1.8

 sudo apt-get install openjdk-8-jdk

Get the MoKee Open Source code

~/mokee will be our build directory.

 mkdir -p ~/bin
 mkdir -p ~/mokee
 curl > ~/bin/repo
 chmod a+x ~/bin/repo

Add bin to PATH

 echo "export PATH=~/bin:$PATH" >> ~/.bashrc

Configure git:

 git config --global "your@email.address"
 git config --global "Your Name"

Move to build directory and sync the source code:

 cd ~/mokee
 repo init -u -b mkn-mr1
 repo sync -j4 -f --no-clone-bundle

(If the repo command is still not available, exit the terminal and start a new one so that your new PATH is registered.)

Let's configure ccache too. It will reduce the build time to 40% after first build

 echo "export USE_CCACHE=1" >> ~/.bashrc
 ~/mokee/prebuilts/misc/linux-x86/ccache/ccache -M 25G

25G means it will use upto 25 gb of disk space for ccaching. Atleast 10 gb is recommended. But if you want to compile for more devices, use more space for ccache.