Ubuntu 13.04 编译环境配置及Android 2.3 源代码编译时

配置Android在Linux Ubuntu 13.04 32位下的编译环境

安装编译所需的软件包:

1  $ sudo apt-get install git-core gnupg flex bison gperf build-essential  zip curl libc6-dev libncurses5-dev x11proto-core-dev    libx11-dev libreadline6-dev libgl1-mesa-glx  libgl1-mesa-dev g++-multilib mingw32 tofrodos    python-markdown libxml2-utils xsltproc zlib1g-dev libreadline6-dev gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib

2 $ sudoln -s /usr/lib/i386-linux-gnu/libX11.so.1 /usr/lib/i386-linux-gnu/libX11.so

如果你系统默认的gcc g++是4.7不是4.4的,会产生很多莫名其妙的编译失败,可能是你的gcc使用的比较高,gcc --version 查看下,不是4.4的话修改如下:3 $cd /usr/bin/

$sudo mv gcc gcc.bak

$sudo ln -s gcc-4.4 gcc

$sudo mv g++ g++.bak

$sudo ln -s g++-4.4 g++

4.java python 等
【Android源代码编译】Ubuntu 13.04 编译android 2.3源代码时出现了以下错误dalvik/vm/native/dalvik_system_Zygote.c:In function ‘setrlimitsFromArray’:
dalvik/vm/native/dalvik_system_Zygote.c:192: error: storage size of ‘rlim’isn’t known
dalvik/vm/native/dalvik_system_Zygote.c:215: warning: implicit declaration offunction ‘setrlimit’
dalvik/vm/native/dalvik_system_Zygote.c:192: warning: unused variable ‘rlim’

This error is because 2 header filesare needed while calling setrlimit function:
#include <sys/time.h>
#include <sys/resource.h>

You can check by typing "mansetrlimit":

GETRLIMIT(2) Linux Programmer'sManual GETRLIMIT(2)

NAME
getrlimit, setrlimit, prlimit - get/set resource limits

SYNOPSIS
#include <sys/time.h>
#include <sys/resource.h>

Anyway, I raise this issue to modifydalvik/vm/native/dalvik_system_Zygote.c file with the following include file:

$vi android/dalvik/vm/native/dalvik_system_Zygote.c

#include <sys/time.h>

#include <sys/resource.h>

修改后可以在ubantu13.04上可以编译通过,并且 ubuntu10.04 和 ubuntu12.04都也可以编译通过,没有影响

推荐阅读

Android ROM开发之Android源码搭建与编译

Ubuntu 12.04 编译Android 4.0.3 的环境配置

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/4f24b8e3e6d9c8d38ba54afb5ce33505.html