출처: https://developer.mozilla.org/en/Windows_Build_Prerequisites

Windows Build Prerequisites

The Mozilla build process requires many tools that are not installed on most Windows systems. In addition to Visual Studio, you must install MozillaBuild, a bundle of software including just the right versions of bash, GNU make, autoconf, Mercurial, and much more.

This document is a guide to the MozillaBuild environment, which works with the following versions of the Mozilla codebase:

  • Builds from Mercurial code repositories
    • mozilla-central (1.9.2/Firefox 3.next), tracemonkey
    • mozilla-1.9.1 (1.9.1/Firefox 3.5/Thunderbird 3)
  • Builds from CVS code repository
    • HEAD (1.9.0.x/Firefox 3.0.x)
    • MOZILLA_1_8_BRANCH (1.8.1.2/Firefox 2.0.0.2 or higher)
    • MOZILLA_1_8_0_BRANCH (1.8.0.12/Firefox 1.5.0.10 or higher)

It works with the following compilers ("Official" means this is what we use for the builds we release as the Firefox product):

  Mercurial CVS
  mozilla-central/tracemonkey/mozilla-1.9.1
Gecko 1.9.1 & later
Firefox 3.5 & later
HEAD
Gecko 1.9.0
Firefox 3.0
MOZILLA_1_8_BRANCH
Gecko 1.8.1
Firefox 2.0
MOZILLA_1_8_0_BRANCH
Gecko 1.8.0
Firefox 1.5
VC6 No No Yes (Official) Yes (Official)
VC7.1 (Visual Studio 2003) Yes Yes Yes No
VC8 (Visual Studio 2005) Yes (Official) Yes (Official) No No
VC9 (Visual Studio 2008) Yes Yes No No

For building older versions of the codebase, see the Windows build prerequisites using cygwin. If you are building very old versions of the Mozilla source code, from the 1.0 branch and earlier, follow the nmake build instructions.

Hardware Requirements

Mozilla takes time to build. You need a development-class system:

  • Pentium III or equivalent processor, 1GHz or better
  • 512 MB RAM, 1 GB or more recommended
  • 1.5 GB NTFS or 3 GB FAT disk space, or more
  • Windows 2000SP4 or greater (Windows XP or above recommended, so that you can install the Windows Vista SDK)

Software Requirements

The following software needs to be installed for a standard Windows build:

  • Microsoft Visual C++ Tools
  • Microsoft Windows SDK(s)
  • MozillaBuild

Mozilla may not build if some tools are installed at a path that contains spaces or other breaking characters such as pluses, quotation marks, or meta characters. The Visual C++ tools may be installed in a directory which contains spaces (the default install location is preferred).

Microsoft Visual C++ (MSVC)

Depending on what you're building, you will need to use one of several available versions of Microsoft Visual C++ (MSVC) and/or Microsoft Visual Studio. See the chart at the top of this page to ensure that the version you've selected is compatible with the branch you wish to build.

Building Gecko 1.8.1 or earlier
Projects that are built on Gecko 1.8.1 or earlier (such as Firefox 2) require that you use either Visual C++ 6 or Visual C++ 7.1 (Visual Studio 2003). You must install both the command line tools and the GUI development environment.
Building Gecko 1.9.0 or later
Projects that are built on Gecko 1.9.0 (such as Firefox 3.0) require that you use Visual C++ 7.1 (Visual Studio 2003), Visual C++ 8 (Visual Studio 2005) or Visual C++ 9 (Visual Studio 2008). If you wish to enable jemalloc you must be using Visual Studio 2005 SP1 (service pack 1), or Visual Studio 2005 Express SP1,  no other version of Visual Studio will work.
  • Visual C++ 9 is available free from Microsoft as part of the free Visual C++ 2008 Express Edition. You do not need to install the Silverlight runtime or the SQL Server 2008 Express Edition when offered.
  • The Visual C++ 8 command-line compiler is included with the Vista SDK, but this does not include a debugger. If you do not want to download the Express Edition debugger you can alternatively use the WinDbg debugger instead.
Note: Trying to do parallel builds using Visual C++ 7.1 (from Visual Studio 2003) using make -jN will not work for Firefox 3 and later.

Microsoft Windows SDK

See Windows SDK versions.

MozillaBuild

The MozillaBuild package contains the other software prerequisites necessary for building Mozilla. This includes the MSYS build environment, Mercurial, CVS, Python, NSIS, and UPX, as well as optional/useful tools such as wget, autoconf-2.13, xemacs.

Download the current MozillaBuild 1.3 package.

By default, the package installs to c:\mozilla-build. It is recommended to use the default path. The installer does not modify the Windows registry.

Getting a command prompt for building

After the prerequisites are installed, launch one of the following batch files from the c:\mozilla-build directory:

  • start-msvc6.bat
  • start-msvc71.bat (VS 2003)
  • start-msvc8.bat  (VS 2005)
  • start-msvc9.bat  (VS 2008)

The batch file will automatically display an MSYS command prompt window with all the appropriate environment variables set, provided the software requirements are met. On Windows, the msys window does not look like the default msys window, but rather like the default Windows command shell. All further commands should be executed in this environment.

Common Problems, Hints and Restrictions

  • Debugging Mozilla on Windows FAQ: Tips on how to debug Mozilla on Windows.
  • The build may fail if your PATH environment variable contains quotes ("). Quotes are not properly translated when passed down to MozillaBuild sub-shells. Quotes are usually not needed so they can be removed.
  • Building with versions of NSIS other than the version that comes with the latest supported version of MozillaBuild is not supported and will likely fail.
  • If you are using Windows 7 Beta, you can use the Vista SDK, Visual C++ 2008 Express Edition and the latest version of MozillaBuild. You will need to type "export SKIP_CHK=1" at the mingw prompt before building due to a problem running mt.exe on Windows 7 Beta- this skips some NSS tests which would otherwise fail. The Windows 7 Release Candidate does not have this bug.
  • If you are using Windows and get frequent or constant access violation crashes in sh.exe when compiling or configuring, you may be able to work around this problem by replacing the mozilla-build\msys\bin\msys-1.0.dll file included with MozBuild 1.3 with the one available from the official MinGW SourceForge.net page, specifically the one available in this file.

Warning: If you follow the below advice, your computer will not be protected against attacks that exploit this vulnerability. Make sure you take adequate precautions.
  • If you still get random crashes when running MAKE, you may be encountering interference from a Windows Security Update that prevents proper operation of the Bash shell on some Windows systems.  In this case, if you're on Windows XP, you will need to uninstall Windows XP Security Update KB933729 using Add or Remove Programs from the Control Panel.  This Security Update is also incorporated into Windows XP Service Pack 3 (KB936929), so if you have already installed SP3 you'll need to uninstall it and then make sure that Service Pack 2, including all Windows updates (EXCEPT KB933729 and KB936929) get installed.  To prevent these two updates from being installed automatically, select "Notify me but don't automatically download or install them" in the Control Panel's "Automatic Updates" dialog.  Then de-select them when either of these two items appear in the list of recommended updates, and when asked, indicate that you don't want to be asked about these de-selected updates in the future.

Return to the Build Documentation

AND