Visit Mozilla.org

Windows Build Prerequisites

From MDC

(Redirected from Building with VC8 Express)


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

  • Trunk (1.9/Firefox 3/Thunderbird 3)
  • MOZILLA_1_8_BRANCH (1.8.1.2/Firefox 2.0.0.2 or higher)
  • MOZILLA_1_8_0_BRANCH (1.8.0.10/Firefox 1.5.0.10 or higher)

It works with the following compilers:

Branch HEAD
Gecko 1.9
Firefox 3/Thunderbird 3
MOZILLA_1_8_BRANCH
Gecko 1.8.1
Firefox 2
MOZILLA_1_8_0_BRANCH
Gecko 1.8
Firefox 1.5.0.x
VC6 No Yes (Official) Yes (Official)
VC7.1 (Visual Studio 2003) Yes Yes No
VC8 (Visual Studio 2005) Yes (Official) No No
VC9 (Visual Studio 2008) Yes (Experimental) 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.

Contents

[edit] 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

[edit] 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).

[edit] 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 (trunk)
Projects that are built on Gecko 1.9 (such as Firefox 3) 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), no other version of Visual Studio will work.

[edit] Microsoft Windows SDK

All versions of Visual Studio now require installing the Microsoft Windows Vista SDK:

  • You may choose not to install the Sample Code and Documentation to save space and download time
  • If you are using Windows XP, you must have Windows XP Service Pack 2 and .NET Framework 2.0 installed before installing the Vista SDK.

If you are using Visual C++ 7.1, the free Visual C++ 8 (Visual C++ 2005 Express), or the free Visual C++ 9 (Visual C++ 2008 Express), then you will also need to install the Microsoft Windows Server 2003 R2 Platform SDK in order to include some libraries (see bug 427765 for details):

  • You need to install at least the "Windows Core SDK", "Web Workshop (IE) SDK", and the "Data Access Services (MDAC) SDK".
  • For all SDKs, you may choose not to install Sample Code and Documentation to save space and download time

A workaround is to build using only the Windows XP or Server 2003 Platform SDK by configuring using the --disable-vista-sdk-requirements option. (This option is also necessary if you are building using the MinGW compiler.) However this will disable some features such as parental controls.

The Windows SDK for Windows Server 2008 is not supported, and has been found to cause the following problems:

  • breaks the vcvars32.bat file from Visual Studio 2008
  • no longer sets the correct PATH for the .NET framework
  • causes an invalid PATH which breaks the Mozilla build

Possible workarounds:

  • use another SDK (the one shipped with Visual Studio 9)
  • delete the vcvars32.bat file and repair your Visual Studio installation with the setup program
  • edit vcvars32.bat to correct the problem (see http://blogs.msdn.com/windowssdk/ "Workaround: Repair the VS2008 command line build environment by editing c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat manually").

[edit] 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.

[edit] 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
  • start-msvc8.bat
  • start-msvc9.bat

The batch file will automatically display an MSYS command prompt window with all the appropriate environment variables set, provided the software requirements are met. All further commands should be executed in this environment.

[edit] Common Problems, Hints and Restrictions

  • 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.
  • Debugging Mozilla on Windows FAQ: Tips on how to debug Mozilla on Windows.
  • You can build on Vista with Visual Studio 2008 Express - see bug 419665