分类: LINUX
2006-11-26 16:38:09
源码编译firefox2.0
By uid500
本人想学好c,热爱开源,更爱linux!
本人花了大约有两周的时间,从源码编译了firefox!以下是我编译的过程供大家参考!
首先:系统环境,我的是colinux/Debain,在windows下虚拟的,colinux是什么,请看我的前一篇文章http://www.cublog.cn/u/25352/
colinux的安装心得!刚刚学习很多东西还没有什么概念!所以用了很久,源码编译有很多麻烦的地方!
第一 编辑/etc/apt/sourse.list目录
deb
stable main contrib non-free
deb
testing main contrib non-free
deb
unstable main contrib non-free
deb-src
stable main contrib non-free
deb-src
testing main contrib non-free
deb-src
unstable main contrib non-free
deb-src
stable main contrib non-free
然后用apt
这个工具下载必要的依赖包:gcc
libxrender-dev
下好一这些东西我们几可以开始了!
下带有-dev的是因为我们要自己编译firefox!所以要用这些软件包!
0,把firefox的源码下下来!参考 http://developer.mozilla.org/en/docs/Configuring_Build_Options,我们在firefox的目录下编写一个. mozconfig文件,
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ff-opt-static
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --enable-static
ac_add_options --disable-shared
ac_add_options --disable-tests
mk_add_options MOZ_CO_PROJECT=browser
最后一项一定要加不然会出现
-I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include
checking MOZ_GTK2_LIBS... -L/usr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lXext -lXinerama -lXi -lXrandr -lXcursor
-lXfixes -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
-lfreetype -lz -lfontconfig -lpng12 -lXrender -lX11
configure: error: --enable-application=APP is required
这些错误!
把这个文件放进你的源码文件夹中!
这个文件就是告诉./configure和make 我们的option 就不用每一次都要打option了!接着我们就可以了./configure最好是另建一个文件夹(这是我哥哥给我的建议)!
我们就可以make的参考
http://developer.mozilla.org/en/docs/Configuring_Build_Options
我们只要安装客户端,所以
export MOZCONFIG=/path/to/mozilla/mozconfig-firefox
make -f client.mk build
path就是自己的路径mozconfig-firefox就是mozconfig!在我的机器中!大概用了两个小时!
现在就大功告成了!
接着我们就来
make -f client.mk install 一下!
用不了多少时间的!
现在就好了!把firefox2.0装入你的系统中了!呵呵!最新的啊!
我编译的时候用的一些命令!供大家参考!
tar -xvjf
firefox-2.0-source.tar >tar
chmod
7700 configure
chmod
7700 build/autoconf/mozconfig-find
chmod
7700 build/autoconf/mozconfig2client-mk
chmod
7700 build/autoconf/mozconfig2configure
/path/tol/mozilla/configure
&>configureout
export
MOZCONFIG=/path/to/mozilla/mozconfig-firefox
make -f
client.mk install
make -f
client.mk build
总结:其实源码编译也没有什么难的,只不过开始会感到有很多困难,但是当你编译完了以后你就会感觉其实也没有什么的!无非是一些依赖包啊!还有你的系统设置啊!你的编译器的版本啊!只要不多试,有不会的就上google找,找不到的就问!就是这样的,没有什么解决不了的问题!
特别感谢我的哥哥,对我细心的指导!感谢CU的朋友们!