User:RichardChu/Assignment 01: Building Firefox

From CDOT Wiki
Jump to: navigation, search

Abstract

This article details my experience with building Mozilla Firefox. The article outlines the build environment that was used, the prerequisite software that was installed, and the steps that were followed to successfully build Mozilla Firefox 3.0 (Minefield). This article also details the problems that were encountered, how the problems were solved, as well as the resources that were referenced.

Build Environment

The environment I used to build Mozilla Firefox 3.0 (Minefield) contains the following relevant hardware:

  • Pentium D CPU @ 3.00 GHz
  • 250GB Hard Drive (208GB of free space)
  • 2.0GB RAM

and relevant software:

  • Microsoft Windows XP w/ Service Pack 2
  • Microsoft Visual Studio 2005
  • Visual C++ version 8

Prerequisites

Hardware

According to the Windows Build Prerequisites, the build environment used obviously met the recommended hardware requirements. However, The build system did not meet the software requirements.

Software

The software required to build Firefox include:

  • The platform SDK (which is included in Visual Studio version 7 and later)
  • Compiler and linker (also included in Visual Studio)
  • Cygwin (GNU tools for Microsoft Windows)
  • CVS (included in Cygwin)
  • moztools (package of binaries and libraries required to build Mozilla Firefox)

The build environment already had Microsoft Visual Studio 2005 installed. However, it did not have Cygwin, or the moztools package installed. Thus, before attempting to build Firefox, the tools were downloaded and installed.

Installing Cygwin

  1. Cygwin was downloaded from http://www.cygwin.com. Once downloaded, the setup icon was double-clicked to start the installation process.
  2. The first screen is the Cygwin Setup screen. If you are really bored, you may read the contents of the screen. Otherwise, click Next.
  3. The next screen is the Choose Installation Type screen. In this screen, you may select an installation type, with the default being Install from Internet. Keep it as the default and click Next.
  4. The next screen is the Choose Installation Directory screen. In this screen, you may change where you want to install Cygwin. it is recommended to keep the default settings (as noted by the uppercase RECOMMENDED text in the screen). If you have trouble falling asleep, click on the Read more about file modes... link and read it. If you are still awake, click Next to proceed.
  5. The next screen is the Select Local Package Directory screen. This screen allows you to indicate where to store the installation files that it downloads. Keep it as the default or select another directory. Either way, click Next to proceed.
  6. The next screen is the Select Connection Type screen. The options are via direct connection, using IE5 settings, or via HTTP/FTP proxy. I suspect that for the majority of users, the Direct Connection option should be selected. Once the proper connection type is selected, Click Next.
  7. The next screen is the Choose Download Site(s) screen. From the list of available download sites, select one or more. Then click Next.
  8. The next screen is the Select Packages screen. This is the most important screen. This screen allows you to select the packages to install. I was tempted to select all of the packages to install but I was able to restrain myself and only select the packages required to build Mozilla, then click Next. The required packages are:
    • ash
    • coreutils
    • cvs
    • diffutils
    • findutils
    • gawk
    • grep
    • libiconv
    • make 3.80 (only version 3.81 is available so 3.80 will have to be downloaded and installed separately)
    • patchutils
    • perl
    • sed
    • unzip
    • zip
  9. The next screen may be the Resolve Dependencies screen. In this screen, you may see a list of packages that depend on other packages that were not selected for installation. If it is not already checked, check the Install these packages to meet dependencies (RECOMMENDED) checkbox. Then click Next.
  10. The next screen is the Cygwin Setup screen where you can watch some progress meters as the packages are downloaded and installed. Watching the progress meters may be as fun as watching paint dry so you may want to do something else in the meantime.
  11. Once the packages have been downloaded and installed, the Create Icons screen appears. In this screen, you may check or uncheck some options to create icons on your desktop and start menu. Once done, click Finish.

Installing GNU Make 3.80

According to the Windows Build Prerequisites page, the version of GNU Make that Cygwin offers (3.81) is incompatible with the current Mozilla build system. Therefore, after Cygwin was installed, GNU Make 3.80 was downloaded and installed.

Since the file was a bzip2-compressed tar file, it is not recognized by Windows native zip utility. Thus, to uncompress and unpack the file, a Cygwin shell prompt was started and the present working directory (pwd) was changed to the location of the tar file. Once there, this command was issued at the prompt:

tar -xjf make-3.80-1.tar.bz2

Once uncompressed and unpacked, one should see a folder hierarchy similar to this:

usr/
 |-bin/
 |-info/
 |-man/
   |-man1/
 |-share/
   |-locale/

The make.exe file located in the usr/bin directory was copied to the C:\cygwin\bin directory and the usr folder and all of its subdirectories were then moved to the C:\cygwin directory.

Installing the moztools

moztools is a package of binaries and libraries necessary to build Mozilla. Before downloading the moztools, the C:\proj directory was created. Then, the moztools package was downloaded and unzipped to the C:\proj directory.

The Build

coming soon...

Problems Encountered and Solutions

During the build process, only one error occurred. The error message outputted was:

configure: error: To build the installer makensis is required in your path. 
To build without the installer reconfigure using --disable-installer.

The error message was clear and concise. After some self-deliberation, I decided to follow the latter option of building without the installer. Therefore, the error was solved by adding the following option to the .mozconfig file:

ac_add_options --disable-installer

If I had read the MDC: Windows Build Prerequisites document more carefully, the error could have been avoided as NSIS would have been downloaded and installed or the above configuration option would have been added earlier.

Resources

Screenshot

Screenshot of Mozilla Firefox 3.0 (Minefield) Help > About window:

Screenshot of Mozilla Firefox 3.0 (Minefield) Help > About window

Conclusion

As long as you can carefully read, understand, and follow the build documentation, one should have minimal problems with building Mozilla Firefox 3.0 (Minefield).