Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1642101
  • 博文数量: 268
  • 博客积分: 8708
  • 博客等级: 中将
  • 技术积分: 3764
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-06 15:58
文章分类

全部博文(268)

文章存档

2014年(1)

2013年(15)

2012年(23)

2011年(60)

2010年(51)

2009年(12)

2008年(59)

2007年(47)

分类: LINUX

2007-07-20 10:57:55

Build Prerequisites

http://developer.mozilla.org/cn/docs/

Firefox源代码下载

windosw版本:
tools
[vs.net2003+cygwin+moztools-static+vc71-glib-1.2.10+vc71-libIDL-0.6.8]
A.如果以前有装有低版本的VC,最好完全卸载,还有环境变量
B.cygwin如果是第一次玩的话,推荐把pack全部安上,必须的pack list:Coreutils,CVS,diffutils,findutils,gawk,grep,libiconv,make 3.80,patchutils,perl,sed,unzip,zip //bin/link.exe要弄一下,会和VC的link冲突
c.moztools就用static的 最好不要和cygmin装在一起
d.glib&libIDL用vc7.1的
e.make用3.80的
f.修改一下cygwin.bat
我把的我贴下面:
@echo off
e:
chdir e:\cygwin\bin
set VCVARS=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat
set MSSDK=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK
set MOZ_TOOLS=C:\moztools
set CYGWINBASE=E:\cygwin
set GLIB_PREFIX=C:\vc71-glib-1.2.10\vc71
set LIBIDL_PREFIX=C:\vc71-libIDL-0.6.8\vc71
set PATH=%CYGWINBASE%\bin;%PATH%
call "%VCVARS%"
set PATH=%MSSDK%\bin;%PATH%
set INCLUDE=%MSSDK%\include;%INCLUDE%
set LIB=%MSSDK%\lib;%LIB%
set PATH=%PATH%;%GLIB_PREFIX%;%GLIB_PREFIX%\bin
set INCLUDE=%GLIB_PREFIX%\include;%INCLUDE%
set LIB=%GLIB_PREFIX%\lib;%LIB%
set PATH=%PATH%;%LIBIDL_PREFIX%;%LIBIDL_PREFIX%\bin
set INCLUDE=%LIBIDL_PREFIX%\include;%INCLUDE%
set LIB=%LIBIDL_PREFIX%\lib;%LIB%
set PATH=%PATH%;%MOZ_TOOLS%\bin
bash --login -i
g.
在源码目录下写一个.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=browser
ac_add_options --enable-application=browser
ac_add_options --disable-debug
ac_add_options --disable-installer
#ac_add_options --enable-extensions=default,pref
h.
到cygwin下make -f client.mk build开始编绎,ok=== 生成的文件在digest
 
 
linux版本:

 

  • A recent POSIX Shell
  • A C++ compiler. or higher is recommended, or your platform's native C/C++ compiler.
  • 5.6 or higher Older perl versions may work if you upgrade to version 0.8
  • 3.79.1 or higher. Other varieties of "make" will not work.
  • 1.11 or higher
  • A widget toolkit. is the "standard" toolkit, and GTK (1.2.0 or higher) is also well-tested. QT and plain xlib configure options are available, but they not well tested or supported.
  • libXt-devel for X11/Intrinsic.h, X11/Shell.h
  • libIDL 0.6.3 or higher Source snapshots are available from Mozilla via . If using the RPMs, you'll need both the regular rpm and the -devel rpm. If you already have installed, then you do not need to install libIDL as ORBit bundles libIDL. You may need to install the ORBit-devel package if you use packages.
  • 2.3 (or higher)
  • 2.1.0 (or higher)
  • 0.9.0 (or higher) (在redhat 第3张盘下找下包)

[edit] Optional Software

  • (which requires ) is necessary if you want to hack on configure.in. If you have no idea what this means, then don't worry about it. It's optional. Autoconf 2.5x will not work. See for details.

[edit] Additional Information

  • The default /bin/sh that comes with some older unices (notably OSF/1) is known to be deficient. In that case, you should use 'gmake SHELL=ksh'.
  • If you're using a glibc 2.07 system, you need
  • gcc 2.95.2 (or higher) will also work, but has a different C++ ABI, which means that many extensions and plugins will be incompatible and may cause crashes
  • Redhat 7.0 users, the compiler distributed with RH 7.0 is buggy, and it is recommended that you upgrade to the latest gcc 2.9x compiler (2.96-77 or later). You need the packages named gcc-c++, gcc, and cpp.
  • If you're using GCC 3.3.x with gnome-vfs2 2.2.5 (the latter is included in RHEL3, but RHEL3 ships with GCC 3.2.x), you may run into ; the will fix it.
  • If a build on Fedora Core 6 fails because bfd.h can't be found, install the binutils-devel package.
言归正传,要编译Firefox首先需要下载它的源代码。你可以在这一页方便地下载到当前的正式版的源代码:
如果你需要比较老旧版本的,或者是测试版的源代码,你可以去 看看,这里有你需要的几乎一切资源。

具体到本文的 1.1Alpha 1,你可以在这里找到:


其次你需要建立起编译Firefox所需要的软件环境。编译Linux版本所需环境可以在 查询到,一般都是Linux常用组件。只有一点:它要求的libIDL的版本是 0.6.3 - 0.6.8 ,并且注明libIDL 0.8.x 不能正常工作,实际上从我编译的情况来看,这是指的1.0正式版,大概从1.0.2开始,Firefox对libIDL的要求就从0.6.x转移到了0.8.x

建立好环境后,解压你所下载的源代码,打开 mozilla/browser/config/mozconfig ,在这里加入你的编译条件,具体条件可以在 mozilla 目录下运行./configure --help来获得,或者在这里查询:
你需要根据自己的情况作出取舍选择,下面是偶的GCC编译条件,仅供参考。

CODE
# 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=browser
ac_add_options --enable-application=browser

ac_add_options --disable-debug
ac_add_options '--enable-optimize=-O2 -g -pipe -mcpu=pentium4'
ac_add_options --disable-tests
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --enable-single-profile
ac_add_options --enable-xft
ac_add_options --disable-freetype2
ac_add_options --enable-svg
ac_add_options --enable-canvas
ac_add_options --enable-static
ac_add_options --disable-shared

修改完毕后将文件另存为 .mozconfig 到顶级的 mozilla目录下。
然后启动终端,进入 mozilla目录:
./configure --prefix=PREFIX
make
make install
其中--prefix=PREFIX是指定安装目录,你需要将PREFIX替换为你的目录。而所需时间最长的步骤是在make
执行完毕后,你就可以在你指定的bin目录下找到可执行的firefox文件,双击即可运行。出错信息
checking for pkg-config... /usr/bin/pkg-config
checking for gtk+-2.0 >= 1.3.7... Package gtk+-2.0 was not found in the

pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found

configure: error: Library requirements (gtk+-2.0 >= 1.3.7) not met;

consider adjusting the PKG_CONFIG_PATH environment variable if your

libraries are in a nonstandard prefix so pkg-config can find them.

---------------------------------------------------------------
我设置了PKG_CONFIG_PATH环境后还是出上面的问题
# echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig:/usr/lib/pkgconfig


[root@tube mozilla]# echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
4.
如果你没有安装在/usr下你得初始化一些变量。如上面的安装可把这些写入/etc/profile里:如下
export PATH="${PATH}:/opt/firefox-2.0.0.1/bin"
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}/opt/firefox-2.0.0.1/lib/pkgconfig"


阅读(2293) | 评论(0) | 转发(0) |
0

上一篇:Linux 脚本编写基础

下一篇:linux的proflie

给主人留下些什么吧!~~