ubuntu compile b2g

安装软件

sudo apt-get install git  ccache bison flex libx11-dev libgl1-mesa-dev make curl bzip2 ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib

配置libX11\libGL

cd /usr/lib/i386-linux-gnu
sudo ln -s libX11.so.6 libX11.so
sudo ln -s mesa/libGL.so.1 libGL.so

 

 

复制源码仓库(实际是下载一些配置类的脚本)

git clone https://github.com/mozilla-b2g/B2G.git

进入目录,配置模拟器(会自动从源码库中同步代码,与Android里repo init之后的repo sync一样)

cd B2G
./config.sh emulator 

如果有B2G支持的手机,也可以通过config.sh来配置,目前支持的类型可以通过下面的命令列出来


~/B2G$ ./config.sh 
Usage: ./config.sh (device name)

Valid devices to configure are:
- galaxy-s2
- galaxy-nexus
- nexus-s
- otoro
- pandaboard
- emulator
- emulator-x86

 

在编译代码之前,可以更新源码到最新

git pull
./repo sync

如果想更新指定的源码仓库,可以使用下面的命令

./repo sync gaia


编译

./build.sh -j4

-j4表示为使用4个线程进行编译,一般与CPU个数一致

相关命令

./build.sh modules  #可以单独编译的模块列表
./build.sh gecko #编译gecko模块

 

运行模拟器

./run-emulator.sh

 

相关链接

https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/B2G_build_prerequisites

https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Preparing_for_your_first_B2G_build

https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Building_Boot_to_Gecko

https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Using_the_B2G_emulators


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值