建立編譯環境

1.        Setup Linux Environment

For Linux PCs, it is recommended to use recent versions of Ubuntu (above or equal to 11.04), as these have been more thoroughly tested with the Android SDK build. After installing Linux, you need check whether you have all the necessary packages installed for the Android build. Refer to "Setting up your machine" on the Android website for details.

1.1.    Install Required Packages

After setting up a Linux(Ubuntu) host PC, some essential packages will be missing as they are not installed by default. You need to manually install these packages.

sudo apt-get install bc git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos libsdl-dev libesd0-dev libwxgtk2.6-dev libglib2.0-dev uuid-dev uboot-mkimage lzop expect python-software-properties python-markdown libxml2-utils.

1.2.    Install JDK 6

The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, you need to add the appropriate repository and indicate to the system which JDK should be used.

sudo add-apt-repository "deb  http://archive.canonical.com/ lucid partner"

sudo apt-get update

sudo apt-get install sun-java6-jdk

 

安裝git和curl 在終端窗口敲下面的命令:

sudo apt-get install git-core curl 


安裝repo腳本

curl http://android.git.kernel.org/repo >~/repo 


給repo可執行權限

chmod a+x ~/repo 


repo init -u gerrit_DH:platform/manifest.git --repo-url=gerrit_DH:repo.git -b lenovo_s52_120416


vi .repo/manifests.git/config

安裝JDK6

手動加入源的方法

vi /etc/apt/source.list
 
deb http://archive.canonical.com/Ubuntu maverick partner

deb-src http://archive.canonical.com/Ubuntu maverick partner

安裝Java JDK

apt-get update
apt-get install sun-java6-jdk
本篇文章來源於 Linux公社網站(www.linuxidc.com)  原文鏈接:http://www.linuxidc.com/Linux/2011-08/40787.htm

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章