コンパイル環境を構築する

From MoKee Open Source Wiki
Jump to: navigation, search
This page is a translated version of the page Setting Up A Compile Environment and the translation is 10% complete.

Other languages:
English • ‎日本語 • ‎中文(中国大陆)‎

64bit 環境を用意する必要があります。

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

Ubuntu 14.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-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jre openjdk-6-jdk pngcrush schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib

Check your java version (it must be 1.7)

 javac -version

If it is 1.6, you MUST change it to 1.7

 sudo add-apt-repository ppa:webupd8team/java
 sudo apt-get update
 sudo apt-get install oracle-java7-installer

Get the MoKee OpenSource code

~/mokee will be our build directory.

 mkdir -p ~/bin
 mkdir -p ~/mokee
 curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
 chmod a+x ~/bin/repo

Add bin to PATH

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

Configure git:

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

Move to build directory and sync the source code:

 cd ~/mokee
 repo init -u https://github.com/MoKee/android -b kk_mkt
 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.