配置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都也可以編譯通過,沒有影響