Monday, December 7, 2009

Rebuilding Firefox with " –enable-system-cairo "

I'm not using Iceweasel, but always downloaded the latest stable version of Firefox from their site.

Now with using patched libfreetype6, libcairo2 and libxft2 I had the problem that the Firefox binary from Mozilla is statically linked. The solution is to rebuild them to be dynamically linked against your system libraries (particularly Cairo).

The first thing you need to do is get the source code. Move it to a directory e.g "src" on your Desktop.
tar xf firefox-3.5.5.source.tar.bz2 will extract it. You will get a directory "/src/ mozilla-1.9.1/ ".
You need to patch the source file ’cause it has a bug when you compile with the ‘–enable-system-cairo’ .  Get the patch from here: .
Save the patch file in your ‘mozilla-1.9.1′ directory. Patch the source: patch -p1 < patch-filename.
Before we go any further you need to install a lot of building dependencies, sudo apt-get build-dep iceweasel .
When building you will get errors, take a note of them and see what else you need.

Next step will be to make a textfile .mozconfig in your  "/src/ mozilla-1.9.1/ ".
Put the following inside the .mozconfig file:

mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ff-opt
ac_add_options --enable-application=browser
ac_add_options --disable-tests
ac_add_options --enable-optimize --disable-debug
ac_add_options --enable-default-toolkit=cairo-gtk2 --enable-system-cairo
ac_add_options --disable-crashreporter

For the make script to be able to find your .mozconfig do :
export MOZCONFIG=/home/username/Desktop/src/mozilla-1.9.1/.mozconfig

Now in your "/src/ mozilla-1.9.1/ " directory, start a terminal and issue the build command:
make -f build
Now be patient, this is taking some time !
When its is all done, cd into the directory ‘mozilla-1.9.1/ff-opt/dist/bin’ and run the executable ‘firefox’.

cd mozilla-1.9.1/ff-opt/dist/bin  and start your brandnew firefox :
./firefox -P -no-remote
-P  will start the profilemanager, -no-remote will let you run firefox with a new choosen profile even when other firefox windows are already open.

To package the build:
cd mozilla-1.9.1/ff-opt/
make package

The new package will be located in ‘ff-opt/dist/’

Move your firefox folder in e.g your home directory, and make a link on your Desktop, taskbar, menu :   /home/username/firefox/firefox -P "profile-name" -no-remote

Downloads :

Already built packages :
firefox-3.5.5.en-US.langpack.xpi ( save link as )

Type in " about:buildconfig " in the adress bar :

No comments:

Post a Comment