[cofface]配置CyanogenMod 11.0~13.0编译环境


环境:Ubuntu14.04 64bit
硬盘:100G
1、安装必备工具合集:(以下工具一个一个安装)
1)[email protected]:~$ sudo apt-get update
2)[email protected]:~$ sudo apt-get install git-core gnupg flex bison gperf build-essential
3)[email protected]:~$ sudo apt-get install zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs 
4)[email protected]:~$ sudo apt-get install  x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev 
5) [email protected]:~$ sudo apt-get install  libgl1-mesa-dev g++-multilib mingw32 tofrodos
6) [email protected]:~$  sudo apt-get install  git libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev openjdk-6-jdk openjdk-6-jre 
7) [email protected]:~$  sudo apt-get install  pngcrush schedtool squashfs-tools xsltproc gcc-multilib lib32readline-gplv2-dev lib32z1-dev
8) [email protected]:~$ sudo apt-get install bc imagemagick liblz4-tool libssl-dev  libxml2 libxml2-utils lzop rsync
2、创建bin目录
[email protected]:~$ mkdir ~/bin
3、下载和安装repo:
[email protected]:~$  curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo 
4、repo赋予权限:
[email protected]:~$ chmod a+x ~/bin/repo
5、配置环境变量:
[email protected]:~$ sudo gedit ~/.bashrc
最后一行增加如下内容:
# set PATH so it includes user’s private bin if it exists
if [ -d “$HOME/bin” ] ; then
    PATH=”$HOME/bin:$PATH”
fi
6、生效环境变量:
[email protected]:~$ source ~/.bashrc
7、创建一个目录来存放CM代码(以cm-13.0为例):
[email protected]:~$  mkdir -p ~/android_source/cyanogenmod/cm-13.0

8、配置git email,name:
[email protected]:~$ git config –global user.email “[email protected]
[email protected]:~$ git config –global user.name “Your Name”
9、进入cm-13.0目录并进行同步源码:
[email protected]:~$ cd ~/android_source/cyanogenmod/cm-13.0
[email protected]:~$ repo init -u git://github.com/LineageOS/android.git -b cm-13.0
10、下载同步脚本:链接:http://pan.baidu.com/s/1i5Dm0vV 密码:3bw6
11、下载完后放到android_source/cyanogenmod/cm-13.0目录下,然后执行如下命令进行同步代码:
[email protected]:~$ chmod 755 ~/android_source/cyanogenmod/cm-13.0/sync.sh
[email protected]:~$ cd ~/android_source/cyanogenmod/cm-13.0
[email protected]:~/android_source/cyanogenMod/cm-13.0$  ./sync.sh
耐心等待源码同步。
源代码同步完后进行如下环境配置:
配置jdk环境:其中cm 11.0~13.0: OpenJDK 1.7 (安装openjdk-7-jdk),cm 14.0~14.1: OpenJDK 1.8 (安装openjdk-8-jdk)
可以同时安装2个版本,可以到 ~/.bashrc 进行配置切换即可。
1、openjdk 1.7安装教程http://blog.cofface.com/archives/2305.html
2、openjdk 1.8安装教程http://blog.cofface.com/archives/2346.html

注:参考来源:

1、http://wiki.lineageos.org/devices/mako/build#put-the-bin-directory-in-your-path-of-execution

2、https://github.com/LineageOS/android/tree/cm-13.0

转载请注明来源:Cofface Blog » [cofface]配置CyanogenMod 11.0~13.0编译环境

赞 (11) 打赏

感谢您的支持,我会继续努力的!

支付宝扫一扫打赏

微信扫一扫打赏