歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> 學習Linux

CentOS7上編譯Android系統

CentOS7上編譯Android系統

CentOS7上編譯Android系統


下載 repo 工具

$ mkdir ~/bin$ PATH=~/bin:$PATH$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo$ chmod a+x ~/bin/repo

編輯~/bin/repo文件,將REPO_URL由

https://gerrit.googlesource.com/git-repo改為https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

下載Android源代碼

# 下載源碼包$ wget https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar$ tar xf aosp-latest.tar

同步代碼

$ cd aosp$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest$ repo sync

也可以同步指定branch的代碼

$ cd aosp$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-6.0.1_r1$ repo sync

准備編譯環境

安裝需要的庫

$ sudo yum install -y gcc make libstdc++.i686 libstdc++-devel.i686 zlib-devel openssl-devel perl cpio expat-devel gettext-devel autoconf glibc.i686 glibc-devel.i686 zlib-devel.i686 libstdc++.i686 libX11-devel.i686 ncurses-devel.i686 ncurses-libs.i686 gperf flex gcc-c++ bison patch

安裝java庫

$ sudo yum install -y java-1.7.0-openjdk.x86_64 java-1.7.0-openjdk-devel.x86_64 java-1.7.0-openjdk-headless.x86_64或者$ sudo yum install -y java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64 java-1.8.0-openjdk-headless.x86_64

編譯

# source 環境$ . build/envsetup.sh# 選擇編譯項目$ lunch 2# 編譯,可以使用-j選項設置並行編譯的數量$ make -j8

參考:

  • https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/

轉載請以鏈接形式標明本文鏈接 本文鏈接:http://blog.csdn.net/kongxx/article/details/53513212

http://xxxxxx/Linuxjc/1184791.html TechArticle

Copyright © Linux教程網 All Rights Reserved