Sunday, December 5, 2010

Building Firefox from source

Building Firefox was a lot easier than I thought it would be. When we were initially given the assignment I felt pretty lost because I had no idea what building the code would entail. After doing the research I found that the steps involved are actually quite simple:

Step 1 - Installing Mercurial:

Download Mercurial here and run the setup. The installation will create c:\mozilla-build by default. When the installation is done navigate to the mozilla-build folder and depending what version of visual studio you have you'll run one of:

  • start-msvc8.bat  (VS 2005)
  • start-msvc9.bat  (VS 2008)
  • start-msvc10.bat (VS 2010) 
Step 2 - Downloading the source code:

Run these commands to download the source code and move to the folder:

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

cd src

Step 3 - Building:

Create the config file and build the code by running these commands:

echo '. $topsrcdir/browser/config/mozconfig' > .mozconfig
echo 'mk_add_options AUTOCONF=autoconf2.13' >> .mozconfig
make -f client.mk build

Step 4 - Running you build

Navigate to ~/src/obj/dist/bin/firefox.exe to run your new build

No comments:

Post a Comment