|
http://source.android.com/source/initializing.html
Initializing a Build Environment빌드환경세팅하기
The "Getting Started" section describes how to set up your local work environment, how to use Repo to get the Android
"Getting started"섹션에서는 어떻게 너의 컴퓨터에 세팅을 하고, 안드로이드 소스를 얻고, 빌드하는지에 대해 설명하고 있다.
files, and how to build the files on your machine. To build the Android source files, you will need to use Linux or Mac OS.
Building under Windows is not currently supported.
안드로이드 소스파일을 빌드하기 위해서 , 너는 리눅스 또는 맥 OS가 필요할 것이다 현재 윈도우는 지원이 되지 않고 있다.
Note: The source is approximately 2.6GB in size. You will need 10GB free to complete the build.
참고:소스는 대략 2.6GB이다. 너는 10기가 바이트정도가 있어야 빌드까지 할수 있을것이다.
For an overview of the entire code-review and code-update process, see Life of a Patch.
전체의 코드리뷰와 코드 업데이트 프로세스에 대한 개요를 보려면 Life of a Patch.를 참조해라.
To see snapshots and histories of the files available in the public Android repositories, visit the GitWeb web interface.
공통 안드로이드 보존 용기(Android repositories)에 있는 이용가능한 파일의 역사와 스냅샷을 보려면 GitWeb 웹을 방문하라.(?)
Setting up a Linux build environment
리눅스 빌드화경 세팅하기
The Android build is routinely tested in house on recent versions of Ubuntu (10.04 and later), but most distributions should
안드로이드 빌드는 우분투 최신버전(10.04 이후)에서 테스트 되었다. 그러나 대부분의 필수 툴들을 배치했어야만 했었다.
have the required build tools available. Reports of successes or failures on other distributions are welcome.
다른 배치에 성공 또는 실패를 기록하는것은 환영한다.(?)
Note: It is also possible to build Android in a virtual machine. If you are running Linux in a virtual machine, you will need at
참고:그것은 또한 버츄얼머신에서도 안드로이드를 빌드할수 있다. 너가 가상 머신에서 리눅스를 사용한다면, 너는 최소한 8GB의
least 8GB of RAM/swap and 12GB or more of disk space in order to build the Android tree.
램 또는 스왑메모리 와 12GB이상의 빈 공간이 있어야 안드로이드 빌드를 자유롭게 할것이다.(우와 8GB나;;)
In general you will need:
일반적으로 너는 아래것들이 필요할것이다.
-
Python 2.4 -- 2.7, which you can download from python.org.
파이썬 2.4~2.7, 이것은 python.org.에서 다운로드 할수 있다. -
JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older. You can download both from java.sun.com.
진저브레드 이상빌드할거면 JDK6이 필요하고 프로요 이하라면 JDK5가 필요하다. 너는 java.sun.com.
에서 다운받을 수 있다. -
Git 1.5.4 or newer. You can find it at git-scm.com.
Git 1.5.4이상의 버전. 너는 git-scm.com.에서 찾을 수 있다. -
(optional) Valgrind, a tool that will help you find memory leaks, stack corruption, array bounds overflows, etc. Download from valgrind.org.
(선택사항)발그린드(?), 이 툴은 너가 메모리 누스등의 에러(stack overflows 등)를 찾는데 도와줄것이다.
valgrind.org.에서 다운로드 가능하다
Detailed instructions for Ubuntu 10.04+ follow.
우분투 10.04 이상의 버전을 위한 상세 설명:
Installing the JDK
JDK설치하기
The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, you need to add the appropriate
Sun JDK는 더이상 우분투의 메인 패키지로써 보관하고 있지 않다. 이것을 다운로드하기위해, 너는 적당한 저장소를
repository and indicate to the system which JDK should be used.
추가하는 것이 필요하고 JDK가 사용될 시스템을 예시해라.(? 그냥 아래 명령 치면 되던데; 뭔말인지 모르겠음; ㅋㅋ)
Java 6: for Gingerbread and newer
(여튼;;)Java 6은 진저 브레드 이상에서 사용되어집니다.
(아래 명령을 터미널을 이용해서 치시면 되요~ 오타있으면 이상한 파일 수정해야 하니깐 만들어지니깐 오타 없이 한번에 성공하도록 하세요.)
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo add-apt-repository "deb-src http://archive.canonical.com/ubuntu lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
Java 5: for Froyo and older
Java 5는 프로요 이하 버전에서~
(이 아래에 있는 명령은 프로요 이하 버전에서 치시면 jdk5를 설치 하실 수 있습니다.)
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu dapper main multiverse"
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu dapper-updates main multiverse"
$ sudo apt-get update
$ sudo apt-get install sun-java5-jdk
Installing required packages
필수 패키지 설치하기
To set up your development environment, install the following required packages:
당신의 개발 환경을 세팅하기위해, 필수 패키지들을 아래대로 설치하시오:
(또 터미널에서 명령 치시면 됨)
$ sudo apt-get install 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
For building Froyo or an older release on a 64-bit system, several other packages are necessary to establish a 32-bit build environment:
64비트 시스템에서 프로요 또는 그 이하버전을 빌드하기 위해서는 32 비트 빌드 환경을 구성하기 위한 몇몇의 다른 패키지들이 추가로 필요하다.
(아래 명령을 치시면 되요.)
$ sudo apt-get install gcc-multilib g++-multilib libc6-i386 libc6-dev-i386
Configuring USB Access
USB 접근 설정하기
Under GNU/linux systems (and specifically under Ubuntu systems), regular users can't directly access USB devices by default. The system needs to be configured to allow such access.
The recommended approach is to create a file /etc/udev/rules.d/51-android.rules
(as the root user) and to copy the following lines in it.
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
# adb protocol on crespo (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
Those new rules take effect the next time a device is plugged in. It might therefore be necessary to unplug the device and plug it back into the computer.
This is known to work on both Ubuntu Hardy Heron (8.04.x LTS) and Lucid Lynx (10.04.x LTS). Other versions of Ubuntu or other variants of GNU/linux might require different configurations.
Setting up a Mac OS X build environment
To build the Android files in a Mac OS environment, you need an Intel/x86 machine running MacOS 10.4 (Tiger), 10.5 (Leopard), or 10.6 (Snow Leopard). The Android build system and tools do not support the obsolete PowerPC architecture.
Android must be built on a case-sensitive file system because the sources contain files that differ only in case. We recommend that you build Android on a partition that has been formatted with the journaled file system HFS+. HFS+ is required to successfully build Mac OS applications such as the Android Emulator for OS X.
Creating a case sensitive disk image
If you want to avoid partitioning/formatting your hard drive, you can use a case-sensitive disk image instead. To create the image, launch Disk Utility and select "New Image". A size of 12 GB should be sufficient to complete the build. Be sure to select "case sensitive, journaled" as the volume format.
This will create a .dmg file which, once mounted, acts as a drive with the required formatting for Android development. For a disk image named "android.dmg" stored in your home directory, you can add the following to your ~/.bash_profile
to mount the image when you execute "mountAndroid":
# mount the android file image
function mountAndroid{ hdiutil attach ~/android.dmg-mountpoint /Volumes/android; }
Once mounted, you'll do all your work in the "android" volume. You can eject it (unmount it) just like you would with an external drive.
Installing required packages
-
Install XCode from the Apple developer site. We recommend version 3.0 or newer. If you are not already registered as an Apple developer, you will have to create an Apple ID in order to download.
-
Install MacPorts from macports.org.
Note: Make sure that
/opt/local/bin
appears in your path BEFORE/usr/bin
. If not, addexport PATH=/opt/local/bin:$PATH
to your
~/.bash_profile
. -
Get make, git, and GPG packages from MacPorts:
$ POSIXLY_CORRECT=1 sudo port install gmake libsdl git-core gnupg
If using Mac OS 10.4, also install bison:
$ POSIXLY_CORRECT=1 sudo port install bison
Reverting from make 3.82
There is a bug in gmake 3.82 that prevents android from building. You can install version 3.81 using MacPorts by taking the following steps:
-
Edit
/opt/local/etc/macports/sources.conf
and a line that saysfile:///Users/Shared/dports
above the rsync line. Then create this directory:
$ mkdir /Users/Shared/dports
-
In the new
dports
directory, run$ svn co --revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/ devel/gmake/
-
Create a port index for your new local repository:
$ portindex /Users/Shared/dports
-
Finally, install the old version of gmake with
$ sudo port install gmake @3.81
Setting a file descriptor limit
On MacOS the default limit on the number of simultaneous file descriptors open is too low and a highly parallel build process may exceed this limit.
To increase the cap, add the following lines to your ~/.bash_profile
:
# set the number of open files to be 1024
ulimit -S -n 1024
Next: Download the source
Your build environment is good to go! Proceed to downloading the source....