原文出处:http://blog.chinaunix.net/uid-20783399-id-1845033.html
10.04下编译Android源码时需要的安装包如下:
sudo apt-get install flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-devbuild-essential python valgrind curl git-core git-daemon-run
此外还需要:
gcc-4.3
g++-4.3
sun-java5-jdk
安装gcc,g++,jdk的步骤如下:
1、 备份/etc/apt/sources.list
运行:sudo mv /etc/apt/sources.list/etc/apt/sources.list.bak
2、 编辑新的source.list(否则无法找到jdk5等安装包)
运行:sudo gedit /etc/apt/sources.list
增加
deb http://cz.archive.ubuntu.com/ubuntudapper main multiverse
deb http://cz.archive.ubuntu.com/ubuntulucid main universe
或 也可以增加163的源(速度较快)
163的ubuntu8.04源
deb http://mirrors.163.com/ubuntu/ hardymain restricted universe multiverse
163的ubuntu10.04源
deb http://mirrors.163.com/ubuntu/ lucidmain universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/lucid main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/lucid-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/lucid-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/lucid-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/lucid-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/lucid-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/lucid-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/lucid-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/lucid-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ hardymain restricted universe multiverse
3、 运行sudo apt-get update
然后在新立得里面输入gcc-4.3 , g++-4.3,和 sun-java5-就可以看到自己需要的版本了。在下载完成之后,删除高版本的gcc和g++,重新建立链接就可以了。
4、 sudo rm /usr/bin/gcc
sudo rm /usr/bin/g++
5、 sudo ln -s /usr/bin/gcc-4.3/usr/bin/gcc
sudo ln -s /usr/bin/g++-4.3/usr/bin/g++
关于JDK版本的切换参考:
参考:http://blog.csdn.net/skywalkzf/archive/2010/02/08/5297898.aspx