分类: LINUX
2010-05-12 09:56:43
10.04下编译Android源码时需要的安装包如下:
sudo apt-get install flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-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 dapper main multiverse
deb lucid main universe
或 也可以增加163的源(速度较快)
163的ubuntu8.04源
deb hardy main restricted universe multiverse
163的ubuntu10.04源
deb lucid main universe restricted multiverse
deb-src lucid main universe restricted multiverse
deb lucid-security universe main multiverse restricted
deb-src lucid-security universe main multiverse restricted
deb lucid-updates universe main multiverse restricted
deb lucid-proposed universe main multiverse restricted
deb-src lucid-proposed universe main multiverse restricted
deb lucid-backports universe main multiverse restricted
deb-src lucid-backports universe main multiverse restricted
deb-src lucid-updates universe main multiverse restricted
deb hardy main 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