Mozilla Build Prerequisites for Windows
http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites

License, Use, and Redistribution

This installer is a collection of many different software packages, each of which is licensed individually. You the user assume the responsibility for the use of the files, binary or text, and there is no guarantee or warranty, expressed or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. You assume all responsibility and agree to hold no entity, copyright holder or distributors liable for any loss of data or inaccurate representations of data as a result of using this package. You may redistribute this package in part or in whole as long as you follow the guidelines of redistribution of each license contained within. To be certain that you are being legally compliant, always distribute the source.

The necessary sources can be found in Mozilla CVS: http://lxr.mozilla.org/mozilla/source/tools/build-environment/win32/

In addition to this package, you will need to install the Microsoft Visual C++ compiler, and in some cases a platform SDK. Please see the Mozilla Developer Center (http://developer.mozilla.org/) for more details.