firefox 编译麻烦的是,每一个版本编译方式都有一点不一样,而且喜欢用新版本vs来编译,这里总结一下46和52的编译:
46版本,需要工具:
MozillaBuildSetup-2.2.0.exe
VS2013
52版本,工具:
MozillaBuildSetup-3.0.exe
VS2015,
nsis 3.02
编译52时,需要修改MozillaBuild tool start-shell.bat 处理文件,path路径添加上nsis3.02的安装路径:
IF NOT DEFINED MOZ_NO_RESET_PATH (
SET PATH=C:\mozilla-build\nsis-3.01;%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\Wbem
)
编译命令都一样:
mach build
mozconfig 文件:
# This file specifies the build flags for Firefox. You can use it by adding:
# . $topsrcdir/browser/config/mozconfig
# to the top of your mozconfig file.
# mk_add_options MOZ_CO_PROJECT=xulrunner
# ac_add_options --enable-application=xulrunner
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_MAKE_FLAGS="-j5"
mk_add_options MOZ_PACKAGE_NSIS=1
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-bin-firefox
ac_add_options --enable-application=browser
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --disable-javaxpcom
ac_add_options --enable-tests