Windows Build Voraussetzungen

  • Adressname der Version: Entwicklerhandbuch/Build_Anweisungen/Windows_Build_Voraussetzungen
  • Titel der Version: Windows Build Voraussetzungen
  • ID der Version: 104982
  • Erstellt:
  • Autor: fscholz
  • Aktuelle Version? Nein
  • Kommentar import English contents; 1880 words added, 137 words removed

Inhalt der Version

{{ :en/Build_Documentation/TOC() }}

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.3/Firefox 3.next)
    • mozilla-1.9.2 (1.9.2/Firefox 3.6)
    • tracemonkey
    • mozilla-1.9.1 (1.9.1/Firefox 3.5)
    • comm-central (Thunderbird 3/SeaMonkey 2)
  • 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/Thunderbird 2.0.0.*/SeaMonkey 1.1.*)
    • 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.2/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) Yes1 Yes Yes No
VC8 (Visual Studio 2005) Yes (Official) Yes (Official) No No
VC9 (Visual Studio 2008) Yes Yes No No
VC10 (Visual Studio 2010) Sorta (bug 530093)2 No 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.

1VC7.1 cannot correctly compile the SSE2 code in libpixman. Either turn on optimisations or disable SSE2 in the Makefile.

2Building with VC10 currently requires the trunk version of mozilla-build.

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 2008 SP1.  Other versions of Visual Studio will not 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.4 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.

Expectation setting: Note that the "UNIX-like" environment provided by MozillaBuild is only really useful for building and committing to the Mozilla source. Most command line tools you would expect in a modern Linux distribution are not present, and those tools that are provided can be as much as a decade or so old (especially those provided by MSYS). It's the old tools in particular that can cause problems, since they often don't behave as expected, are buggy, or don't support command line arguments that have been taken for granted for years. For example, copying a source tree using cp -rf src1 src2 does not work correctly because of an old version of cp (it gives "cp: will not create hard link" errors for some files). In short, MozillaBuild supports essential developer interactions with the Mozilla code, but beyond that don't be surprised if it trips you up in all sorts of exciting and unexpected ways.

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)

Even if you're on 64-bit Windows, do not use the start-msvcX-x64.bat files (unless you know what you're doing). Those files are experimental and unsupported. See the Build:MozillaBuild For x64 wiki page

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.  To paste into this window, you must right-click on the window's title bar.

If you have cygwin installed, make sure that the MozillaBuild directories come before any cygwin directories in the search path (echo $PATH).

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.
  • The build may fail if you have cygwin installed. Make sure that the MozillaBuild directories (c:\mozilla-build and subdirectories) come before any cygwin directories in your PATH environment variable. If this does not help, remove the cygwin directories from PATH, or try building on a clean PC with no cygwin.
  • 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 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.
  • If you intend to distribute your build to others, and you have not built with --enable-jemalloc, you will need to set WIN32_REDIST_DIR=$VCINSTALLDIR\redist\x86\Microsoft.VC80.CRT in your mozconfig to get the Microsoft CRT DLLs packaged along with the application.

{{ 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 Windows Security Updates that prevent 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 Updates KB933729 and KB970238 using Add or Remove Programs from the Control Panel.  The first of these Security Updates 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, KB936929 and KB970238) get installed.  To prevent these 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 any of these 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

{{ languages( {"en": "en/Windows_Build_Prerequisites", "es": "es/Requerimientos_para_la_compilaci\u00f3n_en_Windows", "fr": "fr/Pr\u00e9alables_\u00e0_la_compilation_sous_Windows", "ja": "ja/Windows_Build_Prerequisites", "zh-cn": "cn/Windows_Build_Prerequisites" } ) }}

Quelltext der Version

<p>{{ :en/Build_Documentation/TOC() }}</p>
<p>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.</p>
<p>This document is a guide to the MozillaBuild environment, which works with the following versions of the Mozilla codebase:</p>
<ul> <li>Builds from Mercurial code repositories <ul> <li><a class="internal" href="/en/mozilla-central" title="en/mozilla-central">mozilla-central</a> (1.9.3/Firefox 3.next)</li> <li>mozilla-1.9.2 (1.9.2/Firefox 3.6)</li> <li>tracemonkey</li> <li>mozilla-1.9.1 (1.9.1/Firefox 3.5)</li> <li><a class="internal" href="/en/comm-central" title="en/comm-central">comm-central</a> (Thunderbird 3/SeaMonkey 2)</li> </ul> </li> <li>Builds from CVS code repository<br> <ul> <li>HEAD (1.9.0.x/Firefox 3.0.x)</li> <li>MOZILLA_1_8_BRANCH (1.8.1.2/Firefox 2.0.0.2 or higher/Thunderbird 2.0.0.*/SeaMonkey 1.1.*)</li> <li>MOZILLA_1_8_0_BRANCH (1.8.0.12/Firefox 1.5.0.10 or higher)</li> </ul> </li>
</ul>
<p>It works with the following compilers ("Official" means this is what we use for the builds we release as the Firefox product):</p>
<table class="standard-table"> <tbody> <tr> <th> </th> <th style="text-align: center;">Mercurial</th> <th colspan="3" style="text-align: center;">CVS</th> </tr> <tr> <th> </th> <th>mozilla-central/tracemonkey/mozilla-1.9.2/mozilla-1.9.1<br> Gecko 1.9.1 &amp; later<br> Firefox 3.5 &amp; later</th> <th>HEAD<br> Gecko 1.9.0<br> Firefox 3.0</th> <th>MOZILLA_1_8_BRANCH<br> Gecko 1.8.1<br> Firefox 2.0</th> <th>MOZILLA_1_8_0_BRANCH<br> Gecko 1.8.0<br> Firefox 1.5</th> </tr> <tr> <th>VC6</th> <td style="background-color: rgb(255, 153, 153);">No</td> <td style="background-color: rgb(255, 153, 153);"><a href="/en/VC6_Build_Instructions" title="en/VC6_Build_Instructions">No</a></td> <td style="background-color: rgb(102, 255, 102);">Yes <span style="font-size: smaller;">(Official)</span></td> <td style="background-color: rgb(102, 255, 102);">Yes <span style="font-size: smaller;">(Official)</span></td> </tr> <tr> <th>VC7.1 <span style="font-size: smaller;">(Visual Studio 2003)</span></th> <td style="background-color: rgb(102, 255, 102);">Yes<sup>1</sup></td> <td style="background-color: rgb(102, 255, 102);">Yes</td> <td style="background-color: rgb(102, 255, 102);">Yes</td> <td style="background-color: rgb(255, 153, 153);">No</td> </tr> <tr> <th>VC8 <span style="font-size: smaller;">(Visual Studio 2005)</span></th> <td style="background-color: rgb(102, 255, 102);">Yes <span style="font-size: smaller;">(Official)</span></td> <td style="background-color: rgb(102, 255, 102);">Yes <span style="font-size: smaller;">(Official)</span></td> <td style="background-color: rgb(255, 153, 153);">No</td> <td style="background-color: rgb(255, 153, 153);">No</td> </tr> <tr> <th>VC9 <span style="font-size: smaller;">(Visual Studio 2008)</span></th> <td style="background-color: rgb(102, 255, 102);">Yes</td> <td style="background-color: rgb(102, 255, 102);">Yes</td> <td style="background-color: rgb(255, 153, 153);">No</td> <td style="background-color: rgb(255, 153, 153);">No</td> </tr> <tr> <th>VC10 <span style="font-size: smaller;">(Visual Studio 2010)</span></th> <td style="background-color: rgb(255, 153, 153);">Sorta (<a class=" link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=530093">bug 530093</a>)<sup>2</sup></td> <td style="background-color: rgb(255, 153, 153);">No</td> <td style="background-color: rgb(255, 153, 153);">No</td> <td style="background-color: rgb(255, 153, 153);">No</td> </tr> </tbody>
</table>
<p>For building older versions of the codebase, see the <a href="/en/Windows_build_prerequisites_using_cygwin" title="en/Windows_build_prerequisites_using_cygwin">Windows build prerequisites using cygwin</a>. If you are building very old versions of the Mozilla source code, from the 1.0 branch and earlier, follow the <a class="external" href="http://www.mozilla.org/build/win32-nmake.html">nmake build instructions</a>.</p>
<p><sup>1</sup>VC7.1 cannot correctly compile the SSE2 code in libpixman. Either turn on optimisations or disable SSE2 in the Makefile.</p>
<p><sup>2</sup>Building with VC10 currently requires the trunk version of mozilla-build.</p>
<h2>Hardware Requirements</h2>
<p>Mozilla takes time to build. You need a development-class system:</p>
<ul> <li>Pentium III or equivalent processor, 1GHz or better</li> <li>512 MB RAM, 1 GB or more recommended</li> <li>1.5 GB NTFS or 3 GB FAT disk space, or more</li> <li>Windows 2000SP4 or greater (Windows XP or above recommended, so that you can install the Windows Vista SDK)</li>
</ul>
<h2>Software Requirements</h2>
<p>The following software needs to be installed for a standard Windows build:</p>
<ul> <li>Microsoft Visual C++ Tools</li> <li>Microsoft Windows SDK(s)</li> <li>MozillaBuild</li>
</ul>
<p>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).</p>
<h3>Microsoft Visual C++ (MSVC)</h3>
<p>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.</p>
<dl> <dt>Building Gecko 1.8.1 or earlier</dt> <dd>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.</dd>
</dl>
<ul> <li>To use Visual C++ 6, you must be sure that you have applied <a class="external" href="http://msdn.microsoft.com/en-us/vstudio/aa718363.aspx">Visual Studio Service Pack 5</a> and the <a class="external" href="http://msdn.microsoft.com/en-us/vs2005/aa718349.aspx">Visual C++ 6.0 Processor Pack</a>. (The processor pack is not available for Visual Studio Service Pack 6)</li>
</ul>
<dl> <dt>Building Gecko 1.9.0 or later</dt> <dd>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).</dd> <div class="warning">If you wish to enable jemalloc you must be using <a class="external" href="http://www.microsoft.com/downloads/details.aspx?familyid=bb4a75ab-e2d4-4c96-b39d-37baf6b5b1dc&amp;displaylang=en">Visual Studio 2005 SP1 (service pack 1)</a> or Visual Studio 2008 SP1.  Other versions of Visual Studio will not work.</div>
</dl>
<ul> <li>Visual C++ 9 is available free from Microsoft as part of the free <a class="external" href="http://www.microsoft.com/express/download/">Visual C++ 2008 Express Edition</a>. You do not need to install the Silverlight runtime or the SQL Server 2008 Express Edition when offered.</li> <li>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.</li>
</ul>
<div class="note"><strong>Note:</strong> Trying to do parallel builds using Visual C++ 7.1 (from Visual Studio 2003) using <code>make -jN</code> will not work for Firefox 3 and later.</div>
<h3>Microsoft Windows SDK</h3>
<p>See <a class="internal" href="/En/Windows_SDK_versions" title="En/Windows SDK versions">Windows SDK versions</a>.</p>
<h3>MozillaBuild</h3>
<p>The MozillaBuild package contains the other software prerequisites necessary for building Mozilla. This includes the MSYS build environment, <a href="/en/Mercurial" title="en/Mercurial">Mercurial</a>, CVS, Python, NSIS, and UPX, as well as optional/useful tools such as wget, autoconf-2.13, xemacs.</p>
<p><a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.4.exe" title="http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.4.exe">Download the current MozillaBuild 1.4 package.</a></p>
<p>By default, the package installs to <code>c:\mozilla-build</code>. It is recommended to use the default path. The installer does not modify the Windows registry.</p>
<p><strong>Expectation setting:</strong> Note that the "UNIX-like" environment provided by MozillaBuild is only really useful for building and committing to the Mozilla source. Most command line tools you would expect in a modern Linux distribution are not present, and those tools that are provided can be as much as a decade or so old (especially those provided by MSYS). It's the old tools in particular that can cause problems, since they often don't behave as expected, are buggy, or don't support command line arguments that have been taken for granted for years. For example, copying a source tree using <code>cp -rf src1 src2</code> does not work correctly because of an old version of cp (it gives "cp: will not create hard link" errors for some files). In short, MozillaBuild supports essential developer interactions with the Mozilla code, but beyond that don't be surprised if it trips you up in all sorts of exciting and unexpected ways.</p>
<h2>Getting a command prompt for building</h2>
<p>After the prerequisites are installed, launch one of the following batch files from the <code>c:\mozilla-build</code> directory:</p>
<ul> <li><code>start-msvc6.bat</code></li> <li><code>start-msvc71.bat (VS 2003)<br> </code></li> <li><code>start-msvc8.bat  (VS 2005)<br> </code></li> <li><code>start-msvc9.bat  (VS 2008)<br> </code></li>
</ul>
<p><strong>Even if you're on 64-bit Windows, do not use the <code>start-msvcX-x64.bat</code> files </strong>(unless you know what you're doing). Those files are <strong>experimental</strong> and <strong>unsupported</strong>. See the <a class=" external" href="http://wiki.mozilla-x86-64.com/How_To_Build_Windows_x64_Build" title="http://wiki.mozilla-x86-64.com/How_To_Build_Windows_x64_Build">Build:MozillaBuild For x64 wiki page</a>. </p>
<p>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.  To paste into this window, you must right-click on the window's title bar.</p>
<p>If you have cygwin installed, make sure that the MozillaBuild directories come before any cygwin directories in the search path (<code>echo $PATH).</code></p>
<h2>Common Problems, Hints and Restrictions</h2>
<ul> <li><a href="/en/Debugging_Mozilla_on_Windows_FAQ" title="en/Debugging_Mozilla_on_Windows_FAQ">Debugging Mozilla on Windows FAQ</a>: Tips on how to debug Mozilla on Windows.</li> <li>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.</li> <li>The build may fail if you have cygwin installed. Make sure that the MozillaBuild directories (<code>c:\mozilla-build</code> and subdirectories) come before any cygwin directories in your PATH environment variable. If this does not help, remove the cygwin directories from PATH, or try building on a clean PC with no cygwin.</li> <li>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.</li> <li>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 <a class="external" href="http://sourceforge.net/project/showfiles.php?group_id=2435&amp;package_id=24963&amp;release_id=46827" title="http://sourceforge.net/project/showfiles.php?group_id=2435&amp;package_id=24963&amp;release_id=46827">official MinGW SourceForge.net page</a>, specifically the one available in <a class="external" href="http://downloads.sourceforge.net/mingw/MSYS-1.0.11-20090120-dll.tar.gz" title="http://downloads.sourceforge.net/mingw/MSYS-1.0.11-20090120-dll.tar.gz">this file</a>.</li> <li>If you intend to distribute your build to others, and you have not built with <code>--enable-jemalloc</code>, you will need to set <code>WIN32_REDIST_DIR=$VCINSTALLDIR\redist\x86\Microsoft.VC80.CRT</code> in your mozconfig to get the Microsoft CRT DLLs packaged along with the application.</li>
</ul>
<p>{{ Warning("If you follow the below advice, your computer will <strong>not </strong>be protected against attacks that exploit this vulnerability. <span style="font-size: small;"><strong>Make sure you take adequate precautions.</strong> }}</span>")</span></p>
<ul> <li>If you still get random crashes when running MAKE, you may be encountering interference from Windows Security Updates that prevent 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 Updates KB933729 and KB970238 using Add or Remove Programs from the Control Panel.  The first of these Security Updates 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, KB936929 and KB970238) get installed.  To prevent these 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 any of these 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.</li>
</ul>
<p><em><a href="/En/Developer_Guide/Build_Instructions" title="en/Build_Documentation">Return to the Build Documentation </a></em></p>
<p>{{ languages( {"en": "en/Windows_Build_Prerequisites", "es": "es/Requerimientos_para_la_compilaci\u00f3n_en_Windows", "fr": "fr/Pr\u00e9alables_\u00e0_la_compilation_sous_Windows", "ja": "ja/Windows_Build_Prerequisites", "zh-cn": "cn/Windows_Build_Prerequisites" } ) }}</p>
Zu dieser Version zurücksetzen