<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Land of MrSeacow &#187; Mac OS X</title>
	<atom:link href="http://blog.mrseacow.org/tag/mac-os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mrseacow.org</link>
	<description>一只笨海牛的陆地生活</description>
	<lastBuildDate>Sun, 15 May 2011 15:37:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mac OS X下编译Android源码</title>
		<link>http://blog.mrseacow.org/2011-04/mac-os-x%e4%b8%8b%e7%bc%96%e8%af%91android%e6%ba%90%e7%a0%81/</link>
		<comments>http://blog.mrseacow.org/2011-04/mac-os-x%e4%b8%8b%e7%bc%96%e8%af%91android%e6%ba%90%e7%a0%81/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 00:38:51 +0000</pubDate>
		<dc:creator>mrseacow</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Android内核]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://blog.mrseacow.org/?p=97</guid>
		<description><![CDATA[不得不说在Mac下开发Android程序很蛋疼 ——那么就更蛋疼一点吧，少年！来编译Android源码⋯⋯ 在*nix甚至win下这都是非常简单的事情，但目前手边上只有iMac能用，只好移到Mac OS X来干了。 其实吧，这种事在哪里做都一样，只是前戏的步骤略微有点不同罢了⋯⋯（呃，又糟糕了么？） 所以一步步地做下来，顺便就又记了个流水账： 建立大小写敏感硬盘镜像 首先，Mac OS X的版本必须比Tiger新 (i.e., 版本号在10.4或以上)，而且必须是Intel处理器，PowerPC不行。 然后，由于Mac OS X使用的文件系统不是默认大小写敏感的，就需要创建一个大小写敏感的硬盘镜像。步骤如下： Disk Utility &#8211;&#62; New Image，随便取个名字，这里用AndroidDisk，30GB足够了，然后注意选成Mac OS Extended (Case-sensitive, Journaled), &#8211;&#62; Create 生成的硬盘镜像文件名就是AndroidDisk.dmg了。似乎创建完以后OS会自动把这个镜像加载上去，但如果不喜欢这种方式，还是起个名字吧，用： $ hdiutil attach /path-to-image/AndroidDisk.dmg -mountpoint /Volumes/AndroidDisk Google的官网上推荐把这行加到~/.bash_profile里，这样以后每次用mountAndroid命令就行了。 function mountAndroid { hdiutil attach /Users/elisa/Develop/AndroidDisk.dmg -mountpoint /Volumes/AndroidDisk; } 安装一堆库和包 2.1.  去Apple developer下载Xcode （要有Apple ID并注册成Developer）并安装。 * 如果你用的是Mac OS X 10.6+ [...]]]></description>
			<content:encoded><![CDATA[
<a href="http://blog.mrseacow.org/wp-content/gallery/android/dont_panic.png" title="" class="shutterset_singlepic28" >
	<img class="ngg-singlepic" src="http://blog.mrseacow.org/wp-content/gallery/cache/28__320x240_dont_panic.png" alt="dont_panic" title="dont_panic" />
</a>

<p>不得不说在Mac下开发Android程序很蛋疼</p>
<p>——那么就更蛋疼一点吧，少年！来编译Android源码⋯⋯ 在*nix甚至win下这都是非常简单的事情，但目前手边上只有iMac能用，只好移到Mac OS X来干了。</p>
<p>其实吧，这种事在哪里做都一样，只是前戏的步骤略微有点不同罢了⋯⋯（呃，又糟糕了么？） 所以一步步地做下来，顺便就又记了个流水账：</p>
<ol>
<li>
<h2>建立大小写敏感硬盘镜像</h2>
</li>
<p>首先，Mac OS X的版本必须比Tiger新 (i.e., 版本号在10.4或以上)，而且必须是Intel处理器，PowerPC不行。<br />
然后，由于Mac OS X使用的文件系统不是默认大小写敏感的，就需要创建一个大小写敏感的硬盘镜像。步骤如下：</p>
<p><span id="more-97"></span></p>
<p>Disk Utility &#8211;&gt; New Image，随便取个名字，这里用AndroidDisk，30GB足够了，然后注意选成Mac OS Extended (Case-sensitive, Journaled), &#8211;&gt; Create</p>

<a href="http://blog.mrseacow.org/wp-content/gallery/android/android_image.png" title="" class="shutterset_singlepic26" >
	<img class="ngg-singlepic" src="http://blog.mrseacow.org/wp-content/gallery/cache/26__480x320_android_image.png" alt="android_image" title="android_image" />
</a>

<p>生成的硬盘镜像文件名就是AndroidDisk.dmg了。似乎创建完以后OS会自动把这个镜像加载上去，但如果不喜欢这种方式，还是起个名字吧，用：</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
$ hdiutil attach /path-to-image/AndroidDisk.dmg -mountpoint /Volumes/AndroidDisk
</pre>
<p>Google的官网上推荐把这行加到~/.bash_profile里，这样以后每次用mountAndroid命令就行了。</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
function mountAndroid { hdiutil attach /Users/elisa/Develop/AndroidDisk.dmg -mountpoint /Volumes/AndroidDisk; }
</pre>
<li>
<h2>安装一堆库和包</h2>
</li>
<p>2.1.  去<a title="Apple Developer" href="http://developer.apple.com/" target="_blank">Apple developer</a>下载Xcode （要有Apple ID并注册成Developer）并安装。</p>
<p>* 如果你用的是Mac OS X 10.6+ (Snow Leopard)的话，可以安装XCode最新版本。</p>
<p>* 如果你用的是Mac OS X 10.5（Leopard）的话，可以在这样下载XCode 3.1.4：</p>
<pre class="brush: xml; auto-links: true; collapse: true; highlight: [1]; light: false; title: ; toolbar: true;">
打开Apple Developer Connection网站：　http://connect.apple.com/
以ADC会员登录
点右侧的Download
再点右侧下边一点的Developer Tools
</pre>
<p>2.2. 从<a href="http://www.macports.org/install.php">macports.org</a>.安装MacPorts</p>
<p>安装MacPorts之前需要确认环境变量PATH中，/opt/local/bin出现在/usr/bin之前，可以运行一下这行来确认：</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
$ echo $PATH
</pre>
<p>否则，就运行一下：</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
$ export PATH=/opt/local/bin:$PATH
</pre>
<p>并把上面那行加在~/.bash_profile里。</p>
<p>2.3. 从MacPorts安装make, git, and GPG packages：</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
$ POSIXLY_CORRECT=1 sudo port install gmake libsdl git-core gnupg
</pre>
<p>无聊顺手copy过来记录⋯⋯如果不手贱的话最好别点下面的那个+expand sources了！（其实这时你可以去小睡一觉⋯⋯）</p>
<pre class="brush: xml; auto-links: false; collapse: true; highlight: [1]; light: false; title: ; toolbar: true;">
$ POSIXLY_CORRECT=1 sudo port install gmake libsdl git-core gnupg
Password:
Warning: The installed version of Xcode (3.0) is known to cause problems. Version 3.1.4 or later is recommended on Mac OS X 10.5.
---&gt;  Computing dependencies for gmake
---&gt;  Dependencies to be installed: gettext expat libiconv gperf ncurses ncursesw
---&gt;  Fetching expat
---&gt;  Attempting to fetch expat-2.0.1.tar.gz from http://downloads.sourceforge.net/expat
---&gt;  Verifying checksum(s) for expat
---&gt;  Extracting expat
---&gt;  Configuring expat
---&gt;  Building expat
---&gt;  Staging expat into destroot
---&gt;  Installing expat @2.0.1_1
---&gt;  Activating expat @2.0.1_1
---&gt;  Cleaning expat
---&gt;  Fetching gperf
---&gt;  Attempting to fetch gperf-3.0.4.tar.gz from http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/gperf
---&gt;  Verifying checksum(s) for gperf
---&gt;  Extracting gperf
---&gt;  Configuring gperf
---&gt;  Building gperf
---&gt;  Staging gperf into destroot
---&gt;  Installing gperf @3.0.4_0
---&gt;  Activating gperf @3.0.4_0
---&gt;  Cleaning gperf
---&gt;  Fetching libiconv
---&gt;  Attempting to fetch libiconv-1.13.1.tar.gz from http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/libiconv
---&gt;  Verifying checksum(s) for libiconv
---&gt;  Extracting libiconv
---&gt;  Applying patches to libiconv
---&gt;  Configuring libiconv
---&gt;  Building libiconv
---&gt;  Staging libiconv into destroot
---&gt;  Installing libiconv @1.13.1_0
---&gt;  Activating libiconv @1.13.1_0
---&gt;  Cleaning libiconv
---&gt;  Fetching ncursesw
---&gt;  Verifying checksum(s) for ncursesw
---&gt;  Extracting ncursesw
---&gt;  Configuring ncursesw
---&gt;  Building ncursesw
---&gt;  Staging ncursesw into destroot
---&gt;  Installing ncursesw @5.8_0
---&gt;  Activating ncursesw @5.8_0
---&gt;  Cleaning ncursesw
---&gt;  Fetching ncurses
---&gt;  Attempting to fetch ncurses-5.9.tar.gz from http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/ncurses
---&gt;  Verifying checksum(s) for ncurses
---&gt;  Extracting ncurses
---&gt;  Applying patches to ncurses
---&gt;  Configuring ncurses
---&gt;  Building ncurses
---&gt;  Staging ncurses into destroot
---&gt;  Installing ncurses @5.9_0
---&gt;  Activating ncurses @5.9_0
---&gt;  Cleaning ncurses
---&gt;  Fetching gettext
---&gt;  Attempting to fetch gettext-0.18.1.1.tar.gz from http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/gettext
---&gt;  Verifying checksum(s) for gettext
---&gt;  Extracting gettext
---&gt;  Applying patches to gettext
---&gt;  Configuring gettext
---&gt;  Building gettext
---&gt;  Staging gettext into destroot
---&gt;  Installing gettext @0.18.1.1_2
---&gt;  Activating gettext @0.18.1.1_2
---&gt;  Cleaning gettext
---&gt;  Fetching gmake
---&gt;  Attempting to fetch make-3.82.tar.bz2 from http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/make
---&gt;  Verifying checksum(s) for gmake
---&gt;  Extracting gmake
---&gt;  Configuring gmake
---&gt;  Building gmake
---&gt;  Staging gmake into destroot
---&gt;  Installing gmake @3.82_0
---&gt;  Activating gmake @3.82_0
---&gt;  Cleaning gmake
Warning: The installed version of Xcode (3.0) is known to cause problems. Version 3.1.4 or later is recommended on Mac OS X 10.5.
---&gt;  Computing dependencies for libsdl
---&gt;  Dependencies to be installed: xorg-libXext pkgconfig xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-xproto xorg-libXdmcp xorg-libxcb python27 bzip2 db46 gdbm openssl zlib readline sqlite3 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXrandr xorg-randrproto xrender xorg-renderproto
---&gt;  Fetching pkgconfig
---&gt;  Attempting to fetch pkg-config-0.25.tar.gz from http://pkg-config.freedesktop.org/releases/
---&gt;  Verifying checksum(s) for pkgconfig
---&gt;  Extracting pkgconfig
---&gt;  Applying patches to pkgconfig
---&gt;  Configuring pkgconfig
---&gt;  Building pkgconfig
---&gt;  Staging pkgconfig into destroot
---&gt;  Installing pkgconfig @0.25_2
---&gt;  Activating pkgconfig @0.25_2
---&gt;  Cleaning pkgconfig
---&gt;  Fetching xorg-bigreqsproto
---&gt;  Attempting to fetch bigreqsproto-1.1.1.tar.bz2 from http://xorg.freedesktop.org/archive/individual/proto/
---&gt;  Verifying checksum(s) for xorg-bigreqsproto
---&gt;  Extracting xorg-bigreqsproto
---&gt;  Configuring xorg-bigreqsproto
---&gt;  Building xorg-bigreqsproto
---&gt;  Staging xorg-bigreqsproto into destroot
---&gt;  Installing xorg-bigreqsproto @1.1.1_0
---&gt;  Activating xorg-bigreqsproto @1.1.1_0
---&gt;  Cleaning xorg-bigreqsproto
---&gt;  Fetching xorg-inputproto
---&gt;  Attempting to fetch inputproto-2.0.1.tar.bz2 from http://xorg.freedesktop.org/archive/individual/proto/
---&gt;  Verifying checksum(s) for xorg-inputproto
---&gt;  Extracting xorg-inputproto
---&gt;  Configuring xorg-inputproto
---&gt;  Building xorg-inputproto
---&gt;  Staging xorg-inputproto into destroot
---&gt;  Installing xorg-inputproto @2.0.1_0
---&gt;  Activating xorg-inputproto @2.0.1_0
---&gt;  Cleaning xorg-inputproto
---&gt;  Fetching xorg-kbproto
---&gt;  Attempting to fetch kbproto-1.0.5.tar.bz2 from http://xorg.freedesktop.org/archive/individual/proto/
---&gt;  Verifying checksum(s) for xorg-kbproto
---&gt;  Extracting xorg-kbproto
---&gt;  Configuring xorg-kbproto
---&gt;  Building xorg-kbproto
---&gt;  Staging xorg-kbproto into destroot
---&gt;  Installing xorg-kbproto @1.0.5_0
---&gt;  Activating xorg-kbproto @1.0.5_0
---&gt;  Cleaning xorg-kbproto
---&gt;  Fetching xorg-xproto
---&gt;  Attempting to fetch xproto-7.0.21.tar.bz2 from http://xorg.freedesktop.org/archive/individual/proto
---&gt;  Verifying checksum(s) for xorg-xproto
---&gt;  Extracting xorg-xproto
---&gt;  Configuring xorg-xproto
---&gt;  Building xorg-xproto
---&gt;  Staging xorg-xproto into destroot
---&gt;  Installing xorg-xproto @7.0.21_0
---&gt;  Activating xorg-xproto @7.0.21_0
---&gt;  Cleaning xorg-xproto
---&gt;  Fetching xorg-libXau
---&gt;  Attempting to fetch libXau-1.0.6.tar.bz2 from http://xorg.freedesktop.org/archive/individual/lib/
---&gt;  Verifying checksum(s) for xorg-libXau
---&gt;  Extracting xorg-libXau
---&gt;  Configuring xorg-libXau
---&gt;  Building xorg-libXau
---&gt;  Staging xorg-libXau into destroot
---&gt;  Installing xorg-libXau @1.0.6_0
---&gt;  Activating xorg-libXau @1.0.6_0
---&gt;  Cleaning xorg-libXau
---&gt;  Fetching xorg-libXdmcp
---&gt;  Attempting to fetch libXdmcp-1.1.0.tar.bz2 from http://xorg.freedesktop.org/archive/individual/lib
---&gt;  Verifying checksum(s) for xorg-libXdmcp
---&gt;  Extracting xorg-libXdmcp
---&gt;  Configuring xorg-libXdmcp
---&gt;  Building xorg-libXdmcp
---&gt;  Staging xorg-libXdmcp into destroot
---&gt;  Installing xorg-libXdmcp @1.1.0_0
---&gt;  Activating xorg-libXdmcp @1.1.0_0
---&gt;  Cleaning xorg-libXdmcp
---&gt;  Fetching bzip2
---&gt;  Attempting to fetch bzip2-1.0.6.tar.gz from http://www.bzip.org/1.0.6
---&gt;  Verifying checksum(s) for bzip2
---&gt;  Extracting bzip2
---&gt;  Applying patches to bzip2
---&gt;  Configuring bzip2
---&gt;  Building bzip2
---&gt;  Staging bzip2 into destroot
---&gt;  Installing bzip2 @1.0.6_0
---&gt;  Activating bzip2 @1.0.6_0
---&gt;  Cleaning bzip2
---&gt;  Fetching db46
---&gt;  Attempting to fetch patch.4.6.21.1 from http://download.oracle.com/berkeley-db/patches/db/4.6.21/
---&gt;  Attempting to fetch patch.4.6.21.2 from http://download.oracle.com/berkeley-db/patches/db/4.6.21/
---&gt;  Attempting to fetch patch.4.6.21.3 from http://download.oracle.com/berkeley-db/patches/db/4.6.21/
---&gt;  Attempting to fetch patch.4.6.21.4 from http://download.oracle.com/berkeley-db/patches/db/4.6.21/
---&gt;  Attempting to fetch db-4.6.21.tar.gz from http://download-west.oracle.com/berkeley-db/
---&gt;  Verifying checksum(s) for db46
---&gt;  Extracting db46
---&gt;  Applying patches to db46
---&gt;  Configuring db46
---&gt;  Building db46
---&gt;  Staging db46 into destroot
---&gt;  Installing db46 @4.6.21_6
---&gt;  Activating db46 @4.6.21_6
---&gt;  Cleaning db46
---&gt;  Fetching gdbm
---&gt;  Attempting to fetch gdbm-1.8.3.tar.gz from http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/gdbm
---&gt;  Verifying checksum(s) for gdbm
---&gt;  Extracting gdbm
---&gt;  Configuring gdbm
---&gt;  Building gdbm
---&gt;  Staging gdbm into destroot
---&gt;  Installing gdbm @1.8.3_3
---&gt;  Activating gdbm @1.8.3_3
---&gt;  Cleaning gdbm
---&gt;  Fetching zlib
---&gt;  Attempting to fetch zlib-1.2.5.tar.bz2 from http://www.zlib.net/
---&gt;  Verifying checksum(s) for zlib
---&gt;  Extracting zlib
Error: On Mac OS X 10.5, zlib 1.2.5 requires Xcode 3.1 or later but you have Xcode 3.0.
Error: Target org.macports.extract returned: incompatible Xcode version
Error: Failed to install zlib
Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zlib/main.log
Error: The following dependencies were not installed: xorg-libXext xorg-libX11 xorg-libxcb python27 openssl zlib readline sqlite3 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXrandr xorg-randrproto xrender xorg-renderproto
Error: Status 1 encountered during processing.
To report a bug, see

$ POSIXLY_CORRECT=1 sudo port install gmake libsdl git-core gnupg
Password:
---&gt;  Computing dependencies for gmake
---&gt;  Cleaning gmake
---&gt;  Computing dependencies for libsdl
---&gt;  Dependencies to be installed: xorg-libXext xorg-libX11 xorg-libxcb python27 openssl zlib readline sqlite3 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXrandr xorg-randrproto xrender xorg-renderproto
---&gt;  Extracting zlib
---&gt;  Applying patches to zlib
---&gt;  Configuring zlib
---&gt;  Building zlib
---&gt;  Staging zlib into destroot
---&gt;  Installing zlib @1.2.5_0
---&gt;  Activating zlib @1.2.5_0
---&gt;  Cleaning zlib
---&gt;  Fetching openssl
---&gt;  Attempting to fetch openssl-1.0.0d.tar.gz from http://www.openssl.org/source/
---&gt;  Verifying checksum(s) for openssl
---&gt;  Extracting openssl
---&gt;  Applying patches to openssl
---&gt;  Configuring openssl
---&gt;  Building openssl
---&gt;  Staging openssl into destroot
---&gt;  Installing openssl @1.0.0d_0
---&gt;  Activating openssl @1.0.0d_0
---&gt;  Cleaning openssl
---&gt;  Fetching readline
---&gt;  Attempting to fetch readline-6.2.tar.gz from http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/readline
---&gt;  Verifying checksum(s) for readline
---&gt;  Extracting readline
---&gt;  Applying patches to readline
---&gt;  Configuring readline
---&gt;  Building readline
---&gt;  Staging readline into destroot
---&gt;  Installing readline @6.2.000_0
---&gt;  Activating readline @6.2.000_0
---&gt;  Cleaning readline
---&gt;  Fetching sqlite3
---&gt;  Attempting to fetch sqlite-autoconf-3070600.tar.gz from http://www.sqlite.org/
---&gt;  Verifying checksum(s) for sqlite3
---&gt;  Extracting sqlite3
---&gt;  Applying patches to sqlite3
---&gt;  Configuring sqlite3
---&gt;  Building sqlite3
---&gt;  Staging readline into destroot
---&gt;  Installing readline @6.2.000_0
---&gt;  Activating readline @6.2.000_0
---&gt;  Cleaning readline
---&gt;  Fetching sqlite3
---&gt;  Attempting to fetch sqlite-autoconf-3070600.tar.gz from http://www.sqlite.org/
---&gt;  Verifying checksum(s) for sqlite3
---&gt;  Extracting sqlite3
---&gt;  Applying patches to sqlite3
---&gt;  Configuring sqlite3
---&gt;  Building sqlite3
---&gt;  Staging sqlite3 into destroot
---&gt;  Installing sqlite3 @3.7.6_0
---&gt;  Activating sqlite3 @3.7.6_0
---&gt;  Cleaning sqlite3
---&gt;  Fetching python27
---&gt;  Attempting to fetch Python-2.7.1.tar.bz2 from http://www.python.org//ftp/python/2.7.1/
---&gt;  Verifying checksum(s) for python27
---&gt;  Extracting python27
---&gt;  Applying patches to python27
---&gt;  Configuring python27
---&gt;  Building python27
---&gt;  Staging python27 into destroot
---&gt;  Installing python27 @2.7.1_1
---&gt;  Activating python27 @2.7.1_1

To fully complete your installation and make python 2.7 the default,  please
run:
 	sudo port install python_select
 	sudo python_select python27

---&gt;  Cleaning python27
---&gt;  Fetching xorg-libpthread-stubs
---&gt;  Attempting to fetch libpthread-stubs-0.3.tar.bz2 from http://xcb.freedesktop.org/dist/
---&gt;  Verifying checksum(s) for xorg-libpthread-stubs
---&gt;  Extracting xorg-libpthread-stubs
---&gt;  Configuring xorg-libpthread-stubs
--&gt; ---&gt;  Building xorg-libpthread-stubs
---&gt;  Staging xorg-libpthread-stubs into destroot
---&gt;  Installing xorg-libpthread-stubs @0.3_0
---&gt;  Activating xorg-libpthread-stubs @0.3_0
---&gt;  Cleaning xorg-libpthread-stubs
---&gt;  Fetching libxml2
---&gt;  Attempting to fetch libxml2-2.7.8.tar.gz from ftp://fr.rpmfind.net/pub/libxml/
---&gt;  Verifying checksum(s) for libxml2
---&gt;  Extracting libxml2
---&gt;  Configuring libxml2
---&gt;  Building libxml2
---&gt;  Staging libxml2 into destroot
---&gt;  Installing libxml2 @2.7.8_0
---&gt;  Activating libxml2 @2.7.8_0
---&gt;  Cleaning libxml2
---&gt;  Fetching xorg-xcb-proto
---&gt;  Attempting to fetch xcb-proto-1.6.tar.bz2 from http://xcb.freedesktop.org/dist/
---&gt;  Verifying checksum(s) for xorg-xcb-proto
---&gt;  Extracting xorg-xcb-proto
---&gt;  Configuring xorg-xcb-proto
---&gt;  Building xorg-xcb-proto
---&gt;  Staging xorg-xcb-proto into destroot
---&gt;  Installing xorg-xcb-proto @1.6_0+python27
---&gt;  Activating xorg-xcb-proto @1.6_0+python27
---&gt;  Cleaning xorg-xcb-proto
---&gt;  Fetching xorg-libxcb
---&gt;  Attempting to fetch libxcb-1.7.tar.bz2 from http://xcb.freedesktop.org//dist/
---&gt;  Verifying checksum(s) for xorg-libxcb
---&gt;  Extracting xorg-libxcb
---&gt;  Configuring xorg-libxcb
---&gt;  Building xorg-libxcb
---&gt;  Staging xorg-libxcb into destroot
---&gt;  Installing xorg-libxcb @1.7_0+python27
---&gt;  Activating xorg-libxcb @1.7_0+python27
---&gt;  Cleaning xorg-libxcb
---&gt;  Fetching xorg-util-macros
---&gt;  Attempting to fetch util-macros-1.13.0.tar.bz2 from http://xorg.freedesktop.org/archive/individual/util/
---&gt;  Verifying checksum(s) for xorg-util-macros
---&gt;  Extracting xorg-util-macros
---&gt;  Configuring xorg-util-macros
---&gt;  Building xorg-util-macros
---&gt;  Staging xorg-util-macros into destroot
---&gt;  Installing xorg-util-macros @1.13.0_0
---&gt;  Activating xorg-util-macros @1.13.0_0
---&gt;  Cleaning xorg-util-macros
---&gt;  Fetching xorg-xcmiscproto
---&gt;  Attempting to fetch xcmiscproto-1.2.1.tar.bz2 from http://xorg.freedesktop.org/archive/individual/proto/
---&gt;  Verifying checksum(s) for xorg-xcmiscproto
---&gt;  Extracting xorg-xcmiscproto
---&gt;  Configuring xorg-xcmiscproto
---&gt;  Building xorg-xcmiscproto
---&gt;  Staging xorg-xcmiscproto into destroot
---&gt;  Installing xorg-xcmiscproto @1.2.1_0
---&gt;  Activating xorg-xcmiscproto @1.2.1_0
---&gt;  Cleaning xorg-xcmiscproto
---&gt;  Fetching xorg-xextproto
---&gt;  Attempting to fetch xextproto-7.2.0.tar.bz2 from http://xorg.freedesktop.org/archive/individual/proto
---&gt;  Verifying checksum(s) for xorg-xextproto
---&gt;  Extracting xorg-xextproto
---&gt;  Configuring xorg-xextproto
---&gt;  Building xorg-xextproto
---&gt;  Staging xorg-xextproto into destroot
---&gt;  Installing xorg-xextproto @7.2.0_0
---&gt;  Activating xorg-xextproto @7.2.0_0
---&gt;  Cleaning xorg-xextproto
---&gt;  Fetching xorg-xf86bigfontproto
---&gt;  Attempting to fetch xf86bigfontproto-1.2.0.tar.bz2 from http://xorg.freedesktop.org/archive/individual/proto/
---&gt;  Verifying checksum(s) for xorg-xf86bigfontproto
---&gt;  Extracting xorg-xf86bigfontproto
---&gt;  Configuring xorg-xf86bigfontproto
---&gt;  Building xorg-xf86bigfontproto
---&gt;  Staging xorg-xf86bigfontproto into destroot
---&gt;  Installing xorg-xf86bigfontproto @1.2.0_0
---&gt;  Activating xorg-xf86bigfontproto @1.2.0_0
---&gt;  Cleaning xorg-xf86bigfontproto
---&gt;  Fetching xorg-xtrans
---&gt;  Attempting to fetch xtrans-1.2.6.tar.bz2 from http://xorg.freedesktop.org/archive/individual/lib/
---&gt;  Verifying checksum(s) for xorg-xtrans
---&gt;  Extracting xorg-xtrans
---&gt;  Configuring xorg-xtrans
---&gt;  Building xorg-xtrans
---&gt;  Staging xorg-xtrans into destroot
---&gt;  Installing xorg-xtrans @1.2.6_0
---&gt;  Activating xorg-xtrans @1.2.6_0
---&gt;  Cleaning xorg-xtrans
---&gt;  Fetching xorg-libX11
---&gt;  Attempting to fetch libX11-1.4.3.tar.bz2 from http://xorg.freedesktop.org/archive/individual/lib/
---&gt;  Verifying checksum(s) for xorg-libX11
---&gt;  Extracting xorg-libX11
---&gt;  Configuring xorg-libX11
---&gt;  Building xorg-libX11
---&gt;  Staging xorg-libX11 into destroot
---&gt;  Installing xorg-libX11 @1.4.3_0
---&gt;  Activating xorg-libX11 @1.4.3_0
---&gt;  Cleaning xorg-libX11
---&gt;  Fetching xorg-libXext
---&gt;  Attempting to fetch libXext-1.2.0.tar.bz2 from http://xorg.freedesktop.org/archive/individual/lib
---&gt;  Verifying checksum(s) for xorg-libXext
---&gt;  Extracting xorg-libXext
---&gt;  Configuring xorg-libXext
---&gt;  Building xorg-libXext
---&gt;  Staging xorg-libXext into destroot
---&gt;  Installing xorg-libXext @1.2.0_0
---&gt;  Activating xorg-libXext @1.2.0_0
---&gt;  Cleaning xorg-libXext
---&gt;  Fetching xorg-randrproto
---&gt;  Attempting to fetch randrproto-1.3.2.tar.bz2 from http://xorg.freedesktop.org/archive/individual/proto/
---&gt;  Verifying checksum(s) for xorg-randrproto
---&gt;  Extracting xorg-randrproto
---&gt;  Configuring xorg-randrproto
---&gt;  Building xorg-randrproto
---&gt;  Staging xorg-randrproto into destroot
---&gt;  Installing xorg-randrproto @1.3.2_0
---&gt;  Activating xorg-randrproto @1.3.2_0
---&gt;  Cleaning xorg-randrproto
---&gt;  Fetching xorg-renderproto
---&gt;  Attempting to fetch renderproto-0.11.1.tar.bz2 from http://xorg.freedesktop.org/archive/individual/proto/
---&gt;  Verifying checksum(s) for xorg-renderproto
---&gt;  Extracting xorg-renderproto
---&gt;  Configuring xorg-renderproto
---&gt;  Building xorg-renderproto
---&gt;  Staging xorg-renderproto into destroot
---&gt;  Installing xorg-renderproto @0.11.1_0
---&gt;  Activating xorg-renderproto @0.11.1_0
---&gt;  Cleaning xorg-renderproto
---&gt;  Fetching xrender
---&gt;  Attempting to fetch libXrender-0.9.6.tar.bz2 from http://www.x.org/archive/individual/lib/
---&gt;  Verifying checksum(s) for xrender
---&gt;  Extracting xrender
---&gt;  Configuring xrender
---&gt;  Building xrender
---&gt;  Staging xrender into destroot
---&gt;  Installing xrender @0.9.6_0
---&gt;  Activating xrender @0.9.6_0
---&gt;  Cleaning xrender
---&gt;  Fetching xorg-libXrandr
---&gt;  Attempting to fetch libXrandr-1.3.1.tar.bz2 from http://xorg.freedesktop.org/archive/individual/lib/
---&gt;  Verifying checksum(s) for xorg-libXrandr
---&gt;  Extracting xorg-libXrandr
---&gt;  Configuring xorg-libXrandr
---&gt;  Building xorg-libXrandr
---&gt;  Staging xorg-libXrandr into destroot
---&gt;  Installing xorg-libXrandr @1.3.1_0
---&gt;  Activating xorg-libXrandr @1.3.1_0
---&gt;  Cleaning xorg-libXrandr
---&gt;  Fetching libsdl
---&gt;  Attempting to fetch SDL-1.2.14.tar.gz from http://www.libsdl.org/release/
---&gt;  Verifying checksum(s) for libsdl
---&gt;  Extracting libsdl
---&gt;  Applying patches to libsdl
---&gt;  Configuring libsdl
---&gt;  Building libsdl
---&gt;  Staging libsdl into destroot
---&gt;  Installing libsdl @1.2.14_9
---&gt;  Activating libsdl @1.2.14_9
---&gt;  Cleaning libsdl
---&gt;  Computing dependencies for git-core
---&gt;  Dependencies to be installed: curl curl-ca-bundle perl5 perl5.12 libidn p5-error rsync popt
---&gt;  Fetching perl5.12
---&gt;  Attempting to fetch perl-5.12.3.tar.bz2 from http://www.cpan.org/src/5.0/
---&gt;  Verifying checksum(s) for perl5.12
---&gt;  Extracting perl5.12
---&gt;  Applying patches to perl5.12
---&gt;  Configuring perl5.12
---&gt;  Building perl5.12
---&gt;  Staging perl5.12 into destroot
---&gt;  Installing perl5.12 @5.12.3_1
---&gt;  Activating perl5.12 @5.12.3_1
---&gt;  Cleaning perl5.12
---&gt;  Fetching perl5
---&gt;  Verifying checksum(s) for perl5
---&gt;  Extracting perl5
---&gt;  Configuring perl5
---&gt;  Building perl5
---&gt;  Staging perl5 into destroot
---&gt;  Installing perl5 @5.12.3_1+perl5_12
---&gt;  Activating perl5 @5.12.3_1+perl5_12
---&gt;  Cleaning perl5
---&gt;  Fetching curl-ca-bundle
---&gt;  Attempting to fetch curl-7.21.5.tar.bz2 from http://curl.haxx.se/download/
---&gt;  Attempting to fetch certdata-1.74.txt from http://distfiles.macports.org/curl/
---&gt;  Verifying checksum(s) for curl-ca-bundle
---&gt;  Extracting curl-ca-bundle
---&gt;  Applying patches to curl-ca-bundle
---&gt;  Configuring curl-ca-bundle
---&gt;  Building curl-ca-bundle
---&gt;  Staging curl-ca-bundle into destroot
---&gt;  Installing curl-ca-bundle @7.21.5_0
---&gt;  Activating curl-ca-bundle @7.21.5_0
---&gt;  Cleaning curl-ca-bundle
---&gt;  Fetching libidn
---&gt;  Attempting to fetch libidn-1.20.tar.gz from http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/libidn
---&gt;  Verifying checksum(s) for libidn
---&gt;  Extracting libidn
---&gt;  Configuring libidn
---&gt;  Building libidn
---&gt;  Staging libidn into destroot
---&gt;  Installing libidn @1.20_0
---&gt;  Activating libidn @1.20_0
---&gt;  Cleaning libidn
---&gt;  Fetching curl
---&gt;  Verifying checksum(s) for curl
---&gt;  Extracting curl
---&gt;  Applying patches to curl
---&gt;  Configuring curl
---&gt;  Building curl
---&gt;  Staging curl into destroot
---&gt;  Installing curl @7.21.5_1+ssl
---&gt;  Activating curl @7.21.5_1+ssl
---&gt;  Cleaning curl
---&gt;  Fetching p5-error
---&gt;  Attempting to fetch Error-0.17016.tar.gz from http://mirrors.ibiblio.org/pub/mirrors/CPAN/modules/by-module/Error
---&gt;  Verifying checksum(s) for p5-error
---&gt;  Extracting p5-error
---&gt;  Configuring p5-error
---&gt;  Building p5-error
---&gt;  Staging p5-error into destroot
---&gt;  Installing p5-error @0.17016_1
---&gt;  Activating p5-error @0.17016_1
---&gt;  Cleaning p5-error
---&gt;  Fetching popt
---&gt;  Attempting to fetch popt-1.16.tar.gz from http://rpm5.org/files/popt/
---&gt;  Attempting to fetch popt-1.16.tar.gz from http://distfiles.macports.org/popt
---&gt;  Verifying checksum(s) for popt
---&gt;  Extracting popt
---&gt;  Configuring popt
---&gt;  Building popt
---&gt;  Staging popt into destroot
---&gt;  Installing popt @1.16_0
---&gt;  Activating popt @1.16_0
---&gt;  Cleaning popt
---&gt;  Fetching rsync
---&gt;  Attempting to fetch rsync-3.0.7.tar.gz from http://rsync.samba.org/ftp/rsync/
---&gt;  Attempting to fetch rsync-3.0.7.tar.gz from http://rsync.samba.org/ftp/rsync/src/
---&gt;  Verifying checksum(s) for rsync
---&gt;  Extracting rsync
---&gt;  Applying patches to rsync
---&gt;  Configuring rsync
---&gt;  Building rsync
---&gt;  Staging rsync into destroot
---&gt;  Installing rsync @3.0.7_1
---&gt;  Activating rsync @3.0.7_1
---&gt;  Cleaning rsync
---&gt;  Fetching git-core
---&gt;  Attempting to fetch git-1.7.4.4.tar.bz2 from http://www.kernel.org/pub/software/scm/git/
---&gt;  Attempting to fetch git-manpages-1.7.4.4.tar.bz2 from http://www.kernel.org/pub/software/scm/git/
---&gt;  Attempting to fetch git-htmldocs-1.7.4.4.tar.bz2 from http://www.kernel.org/pub/software/scm/git/
---&gt;  Verifying checksum(s) for git-core
---&gt;  Extracting git-core
---&gt;  Applying patches to git-core
---&gt;  Configuring git-core
---&gt;  Building git-core
---&gt;  Staging git-core into destroot
---&gt;  Installing git-core @1.7.4.4_0+doc+python27
---&gt;  Activating git-core @1.7.4.4_0+doc+python27
---&gt;  Cleaning git-core
---&gt;  Computing dependencies for gnupg
---&gt;  Dependencies to be installed: libusb-compat libusb
---&gt;  Fetching libusb
---&gt;  Attempting to fetch libusb-1.0.8.tar.bz2 from http://downloads.sourceforge.net/libusb
---&gt;  Verifying checksum(s) for libusb
---&gt;  Extracting libusb
---&gt;  Configuring libusb
---&gt;  Building libusb
---&gt;  Staging libusb into destroot
---&gt;  Installing libusb @1.0.8_0
---&gt;  Activating libusb @1.0.8_0
---&gt;  Cleaning libusb
---&gt;  Fetching libusb-compat
---&gt;  Attempting to fetch libusb-compat-0.1.3.tar.bz2 from http://downloads.sourceforge.net/libusb
---&gt;  Verifying checksum(s) for libusb-compat
---&gt;  Extracting libusb-compat
---&gt;  Configuring libusb-compat
---&gt;  Building libusb-compat
---&gt;  Staging libusb-compat into destroot
---&gt;  Installing libusb-compat @0.1.3_0
---&gt;  Activating libusb-compat @0.1.3_0
---&gt;  Cleaning libusb-compat
---&gt;  Fetching gnupg
---&gt;  Attempting to fetch gnupg-1.4.11.tar.bz2 from ftp://gd.tuwien.ac.at/privacy/gnupg/gnupg
---&gt;  Verifying checksum(s) for gnupg
---&gt;  Extracting gnupg
---&gt;  Configuring gnupg
---&gt;  Building gnupg
---&gt;  Staging gnupg into destroot
---&gt;  Installing gnupg @1.4.11_0
---&gt;  Activating gnupg @1.4.11_0
---&gt;  Cleaning gnupg
居然！！你真的手贱点开了，于是可能被你发现了。。。开始装的XCode3.0不行。。。
只好装了XCode3.1.4再来过。。。
</pre>
<p>如果你是Mac OS X 10.4版本的话，还要安装个bison</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
% POSIXLY_CORRECT=1 sudo port install bison
</pre>
<p>下面要把gmake 3.82还原到3.81，否则之后编译源码会出错：</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
$ sudo vim /opt/local/etc/macports/sources.conf
</pre>
<p>然后在rsync那行的上面一行加上</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
file:///Users/Shared/dports
</pre>
<p>之后按这个步骤来就行了：</p>
<pre class="brush: xml; auto-links: false; highlight: [1,2,3,6,15]; title: ;">
$ mkdir /Users/Shared/dports
$ cd /Users/Shared/dports/
$ svn co --revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/ devel/gmake/
A    devel/gmake/Portfile
Checked out revision 50980.
$ portindex /Users/Shared/dports
Creating port index in /Users/Shared/dports
Adding port devel/gmake

Total number of ports parsed:	1
Ports successfully parsed:	1
Ports failed:			0
Up-to-date ports skipped:	0

$ sudo port install gmake @3.81
---&gt;  Computing dependencies for gmake
---&gt;  Fetching gmake
---&gt;  Attempting to fetch make-3.81.tar.bz2 from http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/make
---&gt;  Verifying checksum(s) for gmake
---&gt;  Extracting gmake
---&gt;  Configuring gmake
---&gt;  Building gmake
---&gt;  Staging gmake into destroot
---&gt;  Installing gmake @3.81_0
---&gt;  Deactivating gmake @3.82_0
---&gt;  Activating gmake @3.81_0
---&gt;  Cleaning gmake
</pre>
<p>检查一下gmake版本，看到版本号是3.81就对了：</p>
<pre class="brush: xml; auto-links: false; highlight: [1]; title: ;">
$ gmake --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin9.8.0
</pre>
<p>于是最后下载Android源码前的最后一步就是，修改文件标识符限制：<br />
由于Mac OS 默认将同时打开的文件标识符数量限制得太小，并行编译处理时可能会超出这个限制。<br />
所以在　~/.bash_profile　里加上这么一段：</p>
<pre class="brush: xml; auto-links: false; gutter: false; title: ;">
# set the number of open files to be 1024
ulimit -S -n 1024
</pre>
<li>
<h2>下载Android源码</h2>
</li>
<p>3.1. 安装Git Repo</p>
<pre class="brush: xml; auto-links: false; highlight: [1,2,3,7]; title: ;">
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl http://android.git.kernel.org/repo &gt; ~/bin/repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17451  100 17451    0     0  39190      0 --:--:-- --:--:-- --:--:-- 57029
$ chmod a+x ~/bin/repo
</pre>
<p>3.2. 初始化Git Repo<br />
进入开始时挂载的镜像硬盘，建立一个工作目录：</p>
<pre class="brush: xml; auto-links: false; highlight: [1,2,3,7]; title: ;">
$cd /Volumes/AndroidDisk
$makedir WorkingSpace/
$cd Working Space/
</pre>
<p>在此目录下初始化repo，其间会提示你输入自己的名字和google account邮箱地址：</p>
<pre class="brush: xml; auto-links: false; highlight: [1]; title: ;">
$ repo init -u git://android.git.kernel.org/platform/manifest.git
</pre>
<p>最后，</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
$ repo init -u git://android.git.kernel.org/platform/manifest.git
</pre>
<p>如果你对git比较熟悉的话，后面就不用啰嗦啦。比如，<br />
设定其它的branch （例如froyo）</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo
</pre>
<p>同步文件：</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
$ repo sync
</pre>
<p>（开始下载repo里的文件——源码。于是似乎睡一觉的时间又到了。。）<br />
再import一个GPG public key，</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
$ gpg --import
</pre>
<p>以下是官网给出的key，输入完按Ctrl+D结束：</p>
<pre class="brush: xml; auto-links: false; collapse: true; light: false; title: ; toolbar: true;">
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: GnuPG v1.4.2.2 (GNU/Linux)
    mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
    lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
    8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu5hOF9KXwCgkxMD
    u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEaUA6U90sEoVks0Z
    wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDyaTrkANjdYY7p2cq
    /HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJnuyvoizl9/I1S5
    jU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4
    MGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9
    b/aF/ygcR8mh5hgUfpF9IpXdknOsbKCvM9lSSfRciETykZc4wrRCVGhlIEFuZHJv
    aWQgT3BlbiBTb3VyY2UgUHJvamVjdCA8aW5pdGlhbC1jb250cmlidXRpb25AYW5k
    cm9pZC5jb20+iGAEExECACAFAknnWD4CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX
    gAAKCRDorT+BmrEOeNr+AJ42Xy6tEW7r3KzrJxnRX8mij9z8tgCdFfQYiHpYngkI
    2t09Ed+9Bm4gmEO5Ag0ESedYRBAIAKVW1JcMBWvV/0Bo9WiByJ9WJ5swMN36/vAl
    QN4mWRhfzDOk/Rosdb0csAO/l8Kz0gKQPOfObtyYjvI8JMC3rmi+LIvSUT9806Up
    hisyEmmHv6U8gUb/xHLIanXGxwhYzjgeuAXVCsv+EvoPIHbY4L/KvP5x+oCJIDbk
    C2b1TvVk9PryzmE4BPIQL/NtgR1oLWm/uWR9zRUFtBnE411aMAN3qnAHBBMZzKMX
    LWBGWE0znfRrnczI5p49i2YZJAjyX1P2WzmScK49CV82dzLo71MnrF6fj+Udtb5+
    OgTg7Cow+8PRaTkJEW5Y2JIZpnRUq0CYxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M
    pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDgpqt7Y7s
    KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb
    N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior6b8LrZrAhkqDjA
    vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmUtkBszwo
    G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
    hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+BmrEOeCUOAJ9qmR0l
    EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
    =Wi5D
    -----END PGP PUBLIC KEY BLOCK-----
</pre>
<p>如果你愿意的话还可以验证一下随便哪个Tag：</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1]; title: ;">
$ git tag -v TAG_NAME
</pre>
<li>
<h2>终于开始编译了</h2>
</li>
<p>小配置一下，用模拟器就行了。</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1,2]; title: ;">
$ . build/envsetup.sh
$ lunch generic-eng
</pre>
<p>开始编译，留log吧！</p>
<pre class="brush: xml; auto-links: false; highlight: [1]; title: ;">
$ make -j2 2&gt;&amp;1 | tee buildlog.txt
</pre>
<p>j后面的那个数字，官方解释是所用硬件线程数的1-2倍。<br />
然后就可以慢慢等了。。。留图纪念，千万Don&#8217;t Panic哦～</p>

<a href="http://blog.mrseacow.org/wp-content/gallery/android/building_dont_panic.png" title="" class="shutterset_singlepic27" >
	<img class="ngg-singlepic" src="http://blog.mrseacow.org/wp-content/gallery/cache/27__480x240_building_dont_panic.png" alt="building_dont_panic" title="building_dont_panic" />
</a>

<li>
<h2>要不要运行个模拟器试试？</h2>
</li>
<p>临时试一下的话，就临时配个环境变量：</p>
<pre class="brush: xml; auto-links: false; gutter: false; highlight: [1,2]; title: ;">
$ export PATH=$PATH:/Volumes/AndroidDisk/WorkingSpace/out/host/darwin-x86/bin/
$ export ANDROID_PRODUCT_OUT=/Volumes/AndroidDisk/WorkingSpace/out/target/product/generic/
</pre>
<p>运行模拟器：</p>
<pre class="brush: xml; auto-links: false; highlight: [1]; title: ;">
$ emulator
</pre>
<p>哎，终于出现了模拟的Android系统！好累。。（电脑酱：你累个毛，人家才累呢！）</p>
<p>
<a href="http://blog.mrseacow.org/wp-content/gallery/android/android_emulator.png" title="" class="shutterset_singlepic29" >
	<img class="ngg-singlepic" src="http://blog.mrseacow.org/wp-content/gallery/cache/29__480x320_android_emulator.png" alt="android_emulator" title="android_emulator" />
</a>
</ol>
<p>下次再写个Android源码分析吧。不过好像写的人挺多了已经，不知能不能弄出点什么新意来⋯⋯</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mrseacow.org/2011-04/mac-os-x%e4%b8%8b%e7%bc%96%e8%af%91android%e6%ba%90%e7%a0%81/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

