|
|
第一次玩Android,弄来一点资源,碰到一些编译问题,为此,将搭建ubuntu 14.04 LTS版本的编译环境,做个记录。. N# @5 F0 d* j: Z# n0 Q
% ^/ f- v) z+ g4 a1 [, v
一、for MTK83828 S0 k' M7 ]! I1 I( }
Z1 V: ?. H$ X2 O% J
1、安装完OS,保持网络畅通,安装ia32老的库和相应的开发工具及库,- sudo -i
i ]$ ]: K: O8 M3 e - cd /etc/apt/sources.list.d
e6 P3 A" A m, F- h - echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list: u- e) a- W* F6 \: F
- apt-get update- Z0 P0 @, U4 K7 Z# ^. d0 o
- apt-get install ia32-libs
: n3 h$ `/ X0 a2 X: Q - 1 d8 a' y( ~# J( T9 ^
- apt-get install dpkg-dev
; Y' ?# W5 o4 h+ r - / D' t3 U# k% k. @9 Q& h
- apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev:i386 g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i3864 T: K3 M0 z7 z
复制代码 2、安装JDK和SDK
) k! A$ v5 ? l% y6 R6 P
! V5 S4 M i1 Z, ^6 H @从Orace网站上找jdk-6u23-linux-x64.bin :http://www.oracle.com/technetwor ... javase6-419409.html- cp jdk-6u23-linux-x64.bin /opt/
- s2 l* q c! @% H3 O1 H! f - chmod a+x jdk-6u23-linux-x64.bin
% A/ w" {( J" C) Y ?0 { - ./jdk-6u23-linux-x64.bin
复制代码 google官网上下载adt-bundle-linux-x86_64-20140321.zip : https://dl.google.com/android/ad ... x86_64-20140321.zip( f; o8 @0 z, R5 l ]) F% }* Y/ F! i
如果下不到,可能需要翻墙,或者在网上搜相应的文件,找到下载即可- unzip adt-bundle-linux-x86_64-20140321.zip
# B V% Y" R8 F; h/ o0 e' } - cd adt-bundle-linux-x86_64-20140321. t9 g6 n7 d6 N! S3 V5 i
- sudo cp -r * /opt/
复制代码 3、改变shell环境变量增加如下内容- JAVA_HOME=/opt/jdk1.6.0_236 Q# U2 v/ E: Z4 m) k
- export JAVA_HOME
$ d K+ G5 B9 W - * D! b# I5 l" b, l& H# I4 K+ @
- ANDROID_JAVA_HOME=/opt/jdk1.6.0_23" O- [" J& V! f+ G5 U
- export ANDROID_JAVA_HOME2 E5 W' \' ]# ?( x- r4 V8 k: w
- export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
# v9 v9 E9 h' {. E: h% J - . k. s& t: y! U& O
- PATH=/opt/jdk1.6.0_23/bin:/opt/sdk/platform-tools:/opt/sdk/tools:$PATH
9 Y- n# J2 J4 o e; o, W - export PATH
复制代码 4、安装gcc 4.4,并使用此版本- sudo -s3 k- w* d8 ~ w; s+ B. [& @! {
- apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib/ A* R. n6 k H" q# q
- cd /usr/bin/7 g+ n4 a9 Z8 O( M9 w0 T- X' X
- mv gcc gcc.4.8+ f3 }& k- \2 D/ `' I; G
- mv g++ g++.4.8
" Z V8 g0 ?7 s( s) O - ln -s g++-4.4 g++
' {1 u/ k% q- v# u# ^ - ln -s gcc-4.4 gcc
复制代码 5、重新打开shell,编译时,发现log_err :- `mediatek/protect/frameworks/base/*/': No such file or directory
复制代码 以为android的编译错误只会放在log_err里,看了半天没找到原因,后面看log时才发现:- Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.. E B9 B# v" t$ H7 p3 U
- BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
复制代码 开打pl文件,并依据提示,少了libswitch-perl库。在此提示,请尽量检查log……安装相应的库文件。- sudo apt-get install libswitch-perl
复制代码 按以上顺序,编译即成功.6 x& n- i& y+ z# _7 e
|
|