blob: af63edb8e9fdaa7dc8e0754e24471ee11dd998b3 [file] [log] [blame]
The Android Open Source Project700ccfc2009-03-18 22:20:25 -07001page.title=Android - Source Setup Guide
2pdk.version=.4
3
4@jd:body
5
6<p>This section provides instructions on how to configure your host system to build Android for mobile devices. While Android is designed as host-environment agnostic, it has been tested and is known to work on the following Linux operating system; Ubuntu 6.06 (Dapper), 7.10 (Gutsy), and 8.04. Cygwin is not recommended.</p>
7
8<a name="androidSourceSetupBuildSystemSetupPackages"></a>
9<h2>Installing Packages</h2>
10<h4>Required Packages</h4>
11
12<p>Android requires the following system packages:</p>
13<p><ul>
14<li>flex: This lexical analyzer generator is used to read a given input file for a description of a scanner to generate.</li>
15<li>bison: This is a general-purpose parser generator.</li>
16<li>gperf: This is a perfect hash function generator.</li>
17<li>libesd0-dev: This enlightened sound daemon (dev files) is used to mix digitized audio streams for playback by a single device.</li>
18<li>libwxgtk2.6-dev: This package provides GUI components and other facilities for many different platforms.</li>
19<li>build-essential: This package contains a list of packages considered fundamental to building Debian packages.</li>
20</ul></p>
21
22<h4>Ubuntu 6.06 (Dapper)</h4>
23
24<p>On a clean Dapper system, type the following:</p>
25<pre class="prettyprint">
26% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev
27 build-essential
28</pre>
29<p>This snippet includes an artificial line break to maintain a print-friendly document.</p>
30
31<h4>Ubuntu 7.10</h4>
32
33<ol><li>The libwxgtk2.6-dev package will only work if the following code is included in your /etc/apt/source file.
34<p><pre class="prettyprint">
35## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
36## team, and may not be under a free license. Please satisfy yourself as to
37## your rights to use the software. Also, please note that software in
38## universe WILL NOT receive any review or updates from the Ubuntu security
39## team.
40# Line commented out by installer because it failed to verify:
41deb http://us.archive.ubuntu.com/ubuntu/ gutsy universe
42# Line commented out by installer because it failed to verify:
43deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy universe
44# Line commented out by installer because it failed to verify:
45deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe
46# Line commented out by installer because it failed to verify:
47deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe
48</pre></p></li>
49<li>Install required packages with the following command:
50<p><pre class="prettyprint">
51% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev
52 build-essential
53</pre></p>
54This snippet includes an artificial line break to maintain a print-friendly document.
55</li>
56<li>
57<p>Install the X11 development environment with the following commands:</p>
58<p><pre class="prettyprint">
59% sudo apt-get install x-dev
60% sudo apt-get install libx11-dev
61% sudo apt-get install libncurses5-dev
62</pre></p>
63</li>
64</ol>
65
66
67<h4>Ubuntu 8.04</h4>
68
69<p>On a clean system, type the following:</p>
70<pre class="prettify">
71% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev
72zlib1g-dev build-essential
73% sudo apt-get install x-dev
74% sudo apt-get install libx11-dev
75% sudo apt-get install libncurses5-dev
76% sudo apt-get install sun-java5-jdk
77</pre>
78
79<a name="androidSourceSetupBuildSystemSetupJavaIntro"></a><h2>Installing Java</h2>
80
81<p>Android source code includes a hard dependency on the Java Developer Kit (JDK) 5.0 Update 12 or greater. The specific file name of the Update 12 package is <code>jdk-1_5_0_12-linux-i586.bin</code>. To download this version of the Java JDK:</p>
82<p><ol>
83<li>Navigate to: <a href="http://java.sun.com/products/archive/">http://java.sun.com/products/archive/</a>.</li>
84<li>Select '5.0 Update 12' from the 'Java 2 Platform Standard Edition (J2SE)' -> 'JDK/JRE - 5.0' field and click 'Go.'</li>
85<li>Click 'Download JDK.'</li>
86<li>In the 'Linux Platform' section, click 'Linux self-extracting file' associated with the jdk-1_5_0_12-linux-i586.bin package.</li>
87<li>Follow the installation instructions.</li>
88</ol>
89</p>
90
91<p>Once you have cleanly installed the JDK, modify your PATH environment variable to include <code>&lt;jdk-install-dir&gt;/jdk1.5.0_12/bin</code> at its beginning so that Dapper will use the correct installation. </p>
92<p><b>Ubuntu 7.10</b></p>
93<p>An alternative method to quickly install Java is to enable multiverse repo in <code>/etc/apt/sources.list</code> and then execute:</p>
94<pre class="prettyprint">
95% sudo apt-get install sun-java5-jdk
96</pre>
97