Building Mozilla Firefox (from source)

Mozilla’s Firefox source is available through their site and you can get it via Mercurial, CVS or HTTP/FTP repositories. Some of the features that distinguish Firefox’s build from other applications is that is cross-platform like all the other Mozilla’s project, which means that you can build it on different platform. I choose Ubuntu (Lucid 10.04) Linux because of the ease of use it offers (and other open-source oriented reasons!). One site that you must have in mind is TinderBox in order to make sure that the product you are working with is currently compiling in your environment.

At first, I should mention some problems I encountered during my first contact with Firefox building. I got the code from the HTTP/FTP repository but I encountered a problem with the options on .mozconfig file. This file is important for passing all the appropriate parameters in order to compile source and you put it in your Home folder. In order for the Makefile to identify which application would you compile (in our case Firefox which is a browser) the option ac_add_options --enable-application=browser is needed. But with the previous source code everything got wrong. So, I decided to get the more updated source from Mercurial’s repositories and finally I got something working. After my first try that failed, the main problem was that I couldn’t figure out how to use more than one options in .mozconfig file. The error that I continuously get (till now) is: configure: warning: –enable-debug: invalid host type .

After removing all the options (using only the important in order the compile to complete) I got the following build:

mozilla firefox build

Mozilla Firefox successful build

The simple .mozconfig file that used is:

. $topsrcdir/browser/config/mozconfig
ac_add_options --enable-application=browser
mk_add_options AUTOCONF=autoconf2.13

Using in your mozconfig file option mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@ each time you build source a new objdir folder is made where all the created code/files are being put.

firefox build code

Firefox's build source code

The act of using an objdir means that every file in your source tree will be turned into a Makefile in the objdir. The parent directories of the will be the same parent directories in objdir. So you can throw away this objdir and build source from scratch without the need to get another copy of source code.

What’s coming up next? Try to figure out the reason that I can’t use more option without conflicting each other.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s