`
mineral
  • 浏览: 287446 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

build firefox 3.1 in Ubuntu/Linux

阅读更多

 

准备工作:

 

先准备好需要compile的依赖包。

 

Build Tools

  • A recent POSIX Shell
  • A C++ compiler. GCC 3.4 or higher is recommended, or your platform's native C/C++ compiler.
  • Perl 5.6 or higher. Older perl versions may work if you upgrade File::Spec to version 0.8
  • GNU make 3.79.1 or higher. Other varieties of "make" will not work.
  • CVS 1.11 or higher
  • the GTK2 widget toolkit, version 2.10 or higher
  • libXt-devel for X11/Intrinsic.h, X11/Shell.h
  • libIDL 0.6.3 or higher Source snapshots are available from Mozilla via ftp . If using the RPMs, you'll need both the regular rpm and the -devel rpm. If you already have ORBit 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.
  • zip 2.3 (or higher)
  • freetype 2.1.0 (or higher)
  • fontconfig
  • pkg-config 0.9.0 (or higher)
  • dbus-1-glib-devel (Developer package for D-Bus/GLib bindings)
  • libasound2-dev (needed for Ogg support)

If you're running a Debian- or Ubuntu-derived system, you may be able to use apt-get build-dep firefox OR apt-get build-dep iceweasel and sudo apt-get install libdbus-glib-1-dev curl to pull in most of the prerequisites. The libcurl-dev package is also needed if you're building the crashreporter (on Ubuntu it's provided by either libcurl4-openssl-dev or libcurl4-gnutls-dev ). Alternatively you can disable the crashreporter (option "--disable-crashreporter").

 

这里写的好多,有的可能已经装了,有的可能没有装,按情况sudo apt-get install , 最好是上面提到的包,如果下面make的时候提示Error, 把-dev的包都装上。

 

sudo apt-get install build-essential

sudo apt-get install pkg-config fontconfig autoconf2.13

 

 

 

先下载firefox源代码

http://hg.mozilla.org/mozilla-central

选定一个你想下载的版本,下载到本地。

 

tar -xjvf  xxxx.tar.bz2  #xxxx为你下载的firefox src包文件名

cd xxxx

 

配置一下自己的编译参数

 

vi .mozconfig

 

. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ff-opt
mk_add_options AUTOCONF=autoconf2.13

ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-installer
ac_add_options --disable-xprint
ac_add_options --disable-crashreporter
ac_add_options --disable-mochitest
ac_add_options --disable-mailnews
ac_add_options --disable-javaxpcom

ac_add_options --enable-xft
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-optimize="-O2 -g -pipe -march=i686"

 

看情况,作加减,不熟悉的不要加。

 

 

ac_add_options --enable-optimize="-O2 -g -pipe -march=i686"

 

 这行,特别根据系统和cpu做优化。

 

 

开始编译:

 

$ make -f client.mk build

 

 

漫长的等待,我的机器大概等了40分钟左右。E2180的cpu.

 

 

编译完了,打发布包:

$cd ff-opt
$make package
 

这会在ff-opt目录的dist下生成一个firefox-3.1b2pre.en-US.linux-i686.tar.bz2,这是个免install的包。

 

 

运行:

 

解决上面那个包到哪个目录,如 

$tar -xjvf  firefox-3.1b2pre.en-US.linux-i686.tar.bz2  -C /usr/local/firefox/nightly
$/usr/local/firefox/nightly/firefox/firefox 
 

就可以运行了。

 

为了不和原来的firefox3.0.3冲突,请先准备好两个Profile, 名字如nightly 然后使用

 

$/usr/local/firefox/nightly/firefox/firefox  -P  nightly

 

firefox --help

firefox -ProfileManager 创建profile

 

如果想用原来的的plugins和配置,创建完profile后,直接cp ,下面是我的,cp那行使用你们本机的名字。那是个随机的。

 

$cd ~/.mozilla/firefox

$cp -av  pztu7ehb.default  v224c2kl.nightly

 

 

http://developer.mozilla.org/en/Build_Documentation ,这里有英文的详细步骤。

http://developer.mozilla.org/en/mozilla-central

 

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics