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:
The simple .mozconfig file that used is:
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.
The act of using an objdir means that every Makefile.in file in your source tree will be turned into a Makefile in the objdir. The parent directories of the Makefile.in 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.