下载最新的firefox源码并编译

1.准备MozillaBuild
在下面地址下载最新的MozillaBuild
http://ftp.mozilla.org/pub/mozilla/libraries/win32/
目前最新的是
http://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-1.4.exe
推荐安装到c:\mozilla-build,我安装到了其他目录,也成功了
运行下面的命令,得到一个MinGW shell,下面的编译都要在这个shell中运行
start-msvc6.bat
start-msvc71.bat (VS 2003)
start-msvc8.bat  (VS 2005)
start-msvc9.bat  (VS 2008)
注意firefox 3以后的版本不能用msvc6编译

2.准备firefox源码
firefox的源码在
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/
找到最新的或自己需要的下载一个即可,最新的在
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.5.5/source/firefox-3.5.5.source.tar.bz2

如果需要从Mercurial下载最新的代码,则需要通过start-msvc[x].bat进入MinGW shell,然后执行
hg clone http://hg.mozilla.org/mozilla-central/ firefox-src
如果需要签出其它版本的代码可以参考这里
https://developer.mozilla.org/En/Developer_Guide/Source_Code/Mercurial

3.编写配置文件.mozconfig
在源码目录下编写.mozconfig文件,内容类似如下
——————————————————–
#以下两行表示编译browser,即firefox
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options –enable-application=browser
#最终编译的结果放在这里
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-Release
ac_add_options –disable-installer
#不编译测试
ac_add_options –disable-tests
ac_add_options –disable-mochitest
#不使用vista sdk,实在懒的安装这个
ac_add_options –with-windows-version=502
#debug/release
ac_add_options –disable-static –enable-shared
#如果想调试改成–enable-debug即可
ac_add_options –enable-optimize –disable-debug
具体配置内容经常变化,可以参考
https://developer.mozilla.org/en/Configuring_Build_Options

4.make编译
make -f client.mk build

0 0 投票数
文章评分
订阅评论
提醒
guest

7 评论
最旧
最新 最多投票
内联反馈
查看所有评论
劳保鞋品牌
2012年2月17日 15:39

配置文件对我来说有点难度

百谷
2012年2月18日 00:12

不错,找了好久了!

Louis Han
2012年2月18日 20:53

配置稍微差点的电脑都完不成这任务啊

Blog Link
2013年4月10日 11:43

Spot on with this write-up, I seriously believe this
site needs a great deal more attention. I’ll probably be back again to read more, thanks for the info!

7
0
希望看到您的想法,请您发表评论x