firemail

标题: thunderbird17.0.8编译 [打印本页]

作者: firemail    时间: 2017-1-18 20:10
标题: thunderbird17.0.8编译
1.下载:


ftp://ftp.mozilla.org/pub/thunderbird/releases/17.0.8esr/source/thunderbird-17.0.8esr.source.tar.bz2

2.安装准备
June 2010 DirectX SDK   DXSDK_Jun10.exe
MozillaBuild 构造工具包 (mingw)  MozillaBuildSetup-Latest.exe


3.解压源码
在mingw下用 tar -xjvf thunderbird-17.0.8.source.tar.bz2解压,尽量不要用windows下的rar

4.编译
a.32位编译
从mingw下进入解压目录..\ comm-esr17
运行: make –f client.mk build
第一次编译时间大概在2-3个小时左右
b.64位编译
进入MozillaBuild工具包的解压目录 启动 start-msvc10-x64.bat (VS 2010)
进入对应的源码解压目录,创建.mozconfig文件
cd  comm-esr17
touch .mozconfig
然后向.mozconfig文件写入
echo ac_add_options --target=x86_64-pc-mingw32 >> .mozconfig
echo ac_add_options --host=x86_64-pc-mingw32 >> .mozconfig
   运行: make –f client.mk build
5.增量编译
由于全部编译用时过长,故后续只对修改的部分进行增量编译,如下
编译完成后,会生成如下基于目标机器平台的目录:
…\comm-esr17\obj-i686-pc-mingw32
这里以修改程序的关于对话框中的某个超链接为例:
到源码目录中找到如下文件:
..\comm-esr17\mail\base\content\ aboutDialog.xul进行一些修改
然后针对此项的修改进行编译
进入如下目录
..\comm-esr17\obj-i686-pc-mingw32\mail\base
直接运行make命令即可,再运行前面编译生成的程序,看是否已经修改成功。
更多编译功能选项

6.程序的开发相关工具及调试

说明:为了后面开发方便,最好保存下面几个源码运行目录
a.thunderbird源码,即下面要说的,注意最好生成debug版本,即.mozconfig文件中加入下面的配置
创建.mozconfig文件
cd  comm-esr17
touch .mozconfig
然后向.mozconfig文件写入
echo mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/tb_debug >> .mozconfig
echo ac_add_options --disable-optimize >> .mozconfig
echo ac_add_options --enable-debug >> .mozconfig
   运行: make –f client.mk build -j4
b.svn源码目录,基于上面修改验证没问题后,可合入


作者: firemail    时间: 2017-1-18 20:11

python下可以开启-j的编译开关。测试了一下在64位win7下编译耗时52分。

1 在".mozconfig"添加一项 mk_add_options MOZ_MAKE_FLAGS="-j4" ;
2.在mingw32进入源码目录,输入 python ./build/pymake/make.py -f client.mk build.
作者: firemail    时间: 2017-1-18 20:13
下载地址:
ftp://ftp.mozilla.org/pub/thunderbird/releases/24.0.1/
http://releases.mozilla.org/pub/ ... ases/24.0.1/source/

在mingw下用 tar -xjvf thunderbird-24.0.1.source.tar.bz2  解压,不要用windows下的rar

tar解压出现如下问题:
tar: comm-esr24/mozilla/toolkit/crashreporter/google-breakpad/autotools/compile:
Cannot create symlink to `/usr/share/automake-1.11/compile': No such file or directory
tar: Error exit delayed from previous errors

进入源码目录如:
\code\thunderbird24.0.1  (注:这里把comm-esr24重命名为thunderbird24.0.1)

写配置文件:
//python编译的release版本输出目录
echo mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/tb_rel_py >> .mozconfig
//make编译的release版本输出目录
echo mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/tb_rel_mk >> .mozconfig

编译:
-------python编译---
直接使用python的方法
[python] build/pymake/make.py -f client.mk  build
通过别名定义引用python的方法
alias pymake=build/pymake/make.py
pymake -f client.mk build


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





欢迎光临 firemail (http://firemail.wang:8088/) Powered by Discuz! X3