UBUNTU12.04 编译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

原文地址:https://www.cnblogs.com/yondy/p/2614405.html