You can attempt running our system bootstrapping script to install all system dependencies:
wget --no-check-certificate https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py && python bootstrap.py
If this works, great! If not, see the appropriate section below. If you encounter an error, consider filing a bug saying that the bootstrapper didn't work. Please include output and relevant operating system details.
Common Bootstrapper Failures
wget: command not found
If you see the above, you don't have wget installed. Try curl:
curl https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py > bootstrap.py && python bootstrap.py
If you don't have curl, download the file in your browser and run it by hand:
The above bootstrap scripts supports popular Linux distributions. If it doesn't work for you, see Linux build prerequisites for more.
The above bootstrap script should work on OS X 10.6 and newer. If it doesn't, see Mac OS X build prerequisites.
Now you are ready to get the Firefox source and build, continue on from Simple Firefox build (Get_the_source).