mozilla

Revision 32265 of Windows build prerequisites

  • Revision slug: Developer_Guide/Build_Instructions/Windows_Prerequisites
  • Revision title: Windows build prerequisites
  • Revision id: 32265
  • Created:
  • Creator: Ispiked
  • Is current revision? No
  • Comment Incorporating table from bsmedberg's blog post

Revision Content

NOTE: Do not make substantive changes to this document without consulting Benjamin Smedberg <benjamin@smedbergs.us> or one of the build-config peers.

{{wiki.template(':en/Build_Documentation/TOC')}}

Historical Information

This document is a guide to the build prerequisites for building the trunk Mozilla codebase, which requires MSVC7 or higher (MSVC8 recommended).

I rephrased this paragraph in hopes that people will more easily notice that "historic" includes FF 2 Please see the {{mediawiki.internal('Windows Build Prerequisites on the 1.7 and 1.8 Branches|historical build prerequisites', "en")}} for information about building older branches of the mozilla codebase including the 1.7 branch (mozilla 1.7.x), aviary branch (Firefox and Thunderbird 1.0.x), 1.8.0 branch (Firefox and Thunderbird 1.5.0.x), or 1.8 branch (Firefox 2). I weant think that we should just get rid of the word historical and use the page title For building Firefox 2, Firefox 1.5, and other Mozilla products based on pre-1.9 branches, see the {{mediawiki.internal('Windows Build Prerequisites on the 1.7 and 1.8 Branches|historical build prerequisites', "en")}}. For building Firefox 2, Firefox 1.5, and other Mozilla products based on pre-1.9 branches, see the Windows Build Prerequisites on the 1.7 and 1.8 Branches.

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, 1.5+GHz recommended
  • 512 MB RAM, 1 GB recommended
  • 1.5 GB NTFS or 3 GB FAT disk space, or more
  • Windows NT-class operating system (NT4.0, Win2k, Windows XP Professional and XP Home Edition)

Software Requirements

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

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).

GNU Tools for Microsoft Windows (Cygwin)

Cygwin is a Linux-like environment with GNU tools for Windows. Mozilla uses a developer set of GNU packages, which must be installed. These include gawk, make and zip utilities. GCC is not used and does not need to be installed. You must have Cygwin 1.1.6 or higher. You can have only one cygwin version installed on your operating system; concurrent installations may interfere with each other and cause errors.

Click here to run setup.exe and follow the installation instructions. The Cygwin installer wizard runs as a Windows program. One page of the wizard presents an outline view of categories and packages. You must add packages beyond the default set.

If you'll be using Cygwin only to build Mozilla, then install only the default packages and the packages needed by Mozilla. In the version of the installer current at this writing (version 2.510.2.2), the non-default packages are found under the categories Devel, Interpreters, and Archive:

  • patchutils, make 3.80 (not 3.81!) (under Devel)
  • perl (under Interpreters)
  • zip, unzip (under Archive).

If you will be downloading the source using cvs instead of using a tarball you will also need:

  • cvs (under Devel)

If you may be using Cygwin's GNU tools for additional development, then install the editors, developer tools and interpreters, as well as anything else that looks interesting. Make sure you get all the packages Mozilla needs too, such as unzip and zip!

Here is the complete cygwin package list for building Mozilla. You can use it to double-check your packages, or to understand and customize the build process:

  • ash -- UNIX-like command line interpreter shell (Base category)
  • coreutils -- GNU core utilities (includes fileutils, install, sh-utils, and textutils) (Base category)
  • cvs -- concurrent versions system (Devel category)
  • diffutils -- file comparison utility (Base category)
  • findutils (Base category)
  • gawk -- pattern matching language (Base and Interpretors categories)
  • grep -- text search tool (Base category)
  • libiconv -- character set conversion (Devel category)
  • make 3.80 (not 3.81!) -- dependency analyzer for software builds (Devel category)
  • patchutils -- a small collection of programs that operate on patch files (Devel category)
  • perl -- a scripting language used to control parts of the build (Interpreters category)
  • sed -- a search and replace language (Base category)
  • unzip -- zip file extraction (Archive category)
  • zip -- zip file creation (Archive category)

If you plan to modify the build system's configure.in files, you will need to install an editor (such as xemacs or joe) and the autoconf-2.13 (autoconf-2.5 doesn't work) packages as well.

You may use ActivePerl from ActiveState instead of the perl package in Cygwin if you prefer.

moztools

The moztools package contains binaries and libraries necessary to build Mozilla. A single zip file containing all moztools which works with all versions of MSVC is available at moztools-static.zip.

If you want, you can download Visual C++ version specific moztools files:

The zip file contains a single folder named moztools that you should preserve. Unpack the zip file wherever you want the tools to be installed; however, Mozilla may not build if you install the moztools directory inside the cygwin directory. The MOZ_TOOLS environment variable should be set to point to this moztools folder. (You may rename the folder, as long as you update $MOZ_TOOLS accordingly.)

Note: The 1.8.1 branch (Firefox 2) is compatible with the moztools-static package. Older branches (including the 1.8.0 branch) are not; see the historical build prerequisites for details.

The moztools zip file does not contain the source for the components; if you are interested in building them from scratch, you can obtain the source here. The ooo-build system for building OpenOffice.org builds the tools from scratch using this code and contains some relevant patches for anyone who doesn't want to use the binaries provided.

cvs

CVS is the source control system used by Mozilla. You do not need cvs if you are only going to build from source tarballs downloaded via FTP. If so, you may skip this step.

To pull Mozilla sources, cvs version 1.11 or higher is required. Cygwin CVS is recommended. WinCVS is also compatible. When installing CVS, you should also install an editor such as emacs or Xemacs.

Compiler & Linker

For doing development on the CVS trunk (Mozilla 1.9 or higher), the standard compiler is Microsoft Visual C++, version 8. The free Express edition of Microsoft Visual C++ 8 (aka Visual C++ 2005 Express Edition) will work with some extra tools and configure options. Visual C++ 7.1 will also work. VC++ 7 is not recommended, and VC6 is not supported and will produce unusable builds.

The build may occur from within either a Windows command line shell or from a cygwin shell; if you use the Windows shell, you need to set up the compiler environment variables using the vcvars32.bat script that is installed along with Visual Studio (selecting "Visual C++ Command Prompt" from the Start menu entries for VS will execute this script for you in a new shell).

It is also possible (but not recommended) to compile Mozilla using the MinGW gcc compiler: see Compiling Mozilla with MinGW.

Table of supported Visual Studio compilers
Branch HEAD
Gecko 1.9
Firefox 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 (Visual Studio 2002) Not really Yes Yes
VC7.1 (Visual Studio 2003) Yes Yes Yes
VC8 (Visual Studio 2005) Yes (Official) No No

Platform SDK

If you are using at least Visual Studio .NET 2003, you already have all the necessary SDKs for building mozilla and can skip this requirement step. For older compilers, as well as for the free Vistual Studio Express Editions, you need to download SDKs from Microsoft to have the GDI+ headers and library.

You can download the Windows Server 2003 SP1 Platform SDK, or the Windows Server 2003 R2 Platform SDK. You must install the "Windows Core SDK" (Tools, Build Environment, and Redistributable Components) and the "Web Workshop SDK" (Build Environment).

In order for the build environment to pick up this SDK, the SDK must be added to the build environment (see below).

NSIS

Some applications built from the Mozilla codebase now use NSIS for their installer, notably the toolkit apps Firefox, Thunderbird and Sunbird. If you will need to build the installer then setup NSIS and ensure it is on the PATH. Version 3.17 or greater is recommended.

Configure the Environment

The build environment must be configured so that the mozilla build system can find the proper compiler and libraries. This is best done with a DOS batch script. Your build may fail if your paths have spaces or other special characters. Make sure that you did not install software into locations with such paths, except Visual C++.

The following is a batch script (run with cmd.exe or modify the cygwin.bat file) which should be used to configure environment variables:

rem --- Set HOME so that cvs and ssh work correctly
rem --- cvs uses HOME to locate your .cvspass file, and ssh to locate your .ssh file
rem --- if you are using ssh, your HOME should match the home directory specified in /etc/passwd. See http://www.cygwin.com/faq/faq0.html.
set HOME=C:\home

rem --- Set VCVARS to wherever the MSVC vcvars.bat file is found
set VCVARS=C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat

rem --- Set MSSDK to wherever the MS SDK is installed
rem --- Only required for MSVC7 or the Free MSVC editions that don't come with an SDK
set MSSDK=C:\Program Files\Microsoft Platform SDK

rem --- Set MOZ_TOOLS to wherever you have the moztools packaged installed
set MOZ_TOOLS=C:\moztools

rem --- Set CYGWINBASE to wherever cygwin is installed
set CYGWINBASE=C:\cygwin

rem --- Prepend Cygwin path
rem --- This is necessary so that cygwin <tt>find</tt> is ahead of windows <tt>find.exe</tt> in the PATH, but cgywin <tt>link</tt> is after MSVC <tt>link.exe</tt>.
set PATH=%CYGWINBASE%\bin;%PATH%

rem --- Set MSVC environment vars
call "%VCVARS%"
 
rem --- Prepend SDK paths
rem --- Only required for MSVC7 or the Free MSVC editions that don't come with an SDK
set PATH=%MSSDK%\bin;%PATH%
set INCLUDE=%MSSDK%\include;%INCLUDE%
set LIB=%MSSDK%\lib;%LIB%

rem --- moztools comes last
set PATH=%PATH%;%MOZ_TOOLS%\bin

rem --- Now the PATH variable contains:
rem MS-SDK; MSVC; Cygwin; Windows; glib/libIDL; Moztools

rem --- Typically the last thing the script does is launch a cygwin shell
rem --- watch for your ~/.profile and /etc/profile which may overwrite your carefully setup PATH!
bash --login -i

Before compiling, be sure to rename %CYGWINBASE%\bin\link.exe to something else, like glink.exe. If you don't, you might get an error like this (in configure)

configure: error: The incremental linker version, , does not match the compiler suite version, 8.
Fix above errors and restart with "make -f client.mk"

Common Problems and Hints

  • Check the Mozilla Build Frequently Asked Questions
  • Your source tree must be located at a /cygdrive/<c> mount point. It must not be located within your /home.
  • Mozilla may not build if you install the moztools directory inside the cygwin directory.
  • If the configure or build fails due to a missing w32api, add the mingw32's /include directory to the end of your INCLUDE environment variable. Mingw32 libraries or binaries should not be needed, only the headers.
  • The build may fail if your PATH environment variable contains quotes ("). Quotes are not properly translated when passed down to the cygwin sub-shells. Quotes are usually not needed so they can be removed.
  • Double-check to make sure that you have the complete cygwin package list. If not, launch the cygwin installer and add the missing packages.
  • Currently the build system is incompatible with make 3.81, so make sure you're using make 3.80. This issue is being tracked in bug 325148 where a partial patch exists.
  • Debugging Mozilla on Windows FAQ: Tips on how to debug Mozilla on Windows.
  • Upgrading a Windows build system from VC6 to VC7?
{{ wiki.languages( { "fr": "fr/Pr\u00e9alables_\u00e0_la_compilation_sous_Windows", "ja": "ja/Windows_Build_Prerequisites" } ) }}

Revision Source

<p>
<span class="comment">NOTE: Do not make substantive changes to this document   without consulting Benjamin Smedberg &lt;benjamin@smedbergs.us&gt;   or one of the build-config peers.</span>
</p><p>{{wiki.template(':en/Build_Documentation/TOC')}}
</p>
<h3 name="Historical_Information"> Historical Information </h3>
<p>This document is a guide to the build prerequisites for building the trunk Mozilla codebase, which requires MSVC7 or higher (MSVC8 recommended).
</p><p><span class="comment">I rephrased this paragraph in hopes that people will more easily notice that "historic" includes FF 2 Please see the {{mediawiki.internal('Windows Build Prerequisites on the 1.7 and 1.8 Branches|historical build prerequisites', "en")}} for information about building older branches of the mozilla codebase including the 1.7 branch (mozilla 1.7.x), aviary branch (Firefox and Thunderbird 1.0.x), 1.8.0 branch (Firefox and Thunderbird 1.5.0.x), or 1.8 branch (Firefox 2).</span>
<span class="comment">I weant think that we should just get rid of the word historical and use the page title For building Firefox 2, Firefox 1.5, and other Mozilla products based on pre-1.9 branches, see the {{mediawiki.internal('Windows Build Prerequisites on the 1.7 and 1.8 Branches|historical build prerequisites', "en")}}.</span>
For building Firefox 2, Firefox 1.5, and other Mozilla products based on pre-1.9 branches, see the <a href="en/Windows_Build_Prerequisites_on_the_1.7_and_1.8_Branches">Windows Build Prerequisites on the 1.7 and 1.8 Branches</a>.
</p><p>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>
<h3 name="Hardware_Requirements"> Hardware Requirements </h3>
<p>Mozilla takes time to build. You need a development-class system:
</p>
<ul><li> Pentium III or equivalent processor, 1GHz or better, 1.5+GHz recommended
</li><li> 512 MB RAM, 1 GB recommended
</li><li> 1.5 GB NTFS or 3 GB FAT disk space, or more
</li><li> Windows NT-class operating system (NT4.0, Win2k, Windows XP Professional and XP Home Edition)
</li></ul>
<h3 name="Software_Requirements"> Software Requirements </h3>
<p>The following software needs to be installed for a standard Windows build.
</p><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>
<h4 name="GNU_Tools_for_Microsoft_Windows_.28Cygwin.29"> GNU Tools for Microsoft Windows (Cygwin) </h4>
<p>Cygwin is a Linux-like environment with GNU tools for Windows. Mozilla uses a developer set of GNU packages, which must be installed. These include gawk, make and zip utilities. GCC is not used and does not need to be installed. You must have Cygwin 1.1.6 or higher. You can have only one cygwin version installed on your operating system; concurrent installations may interfere with each other and cause errors.
</p><p>Click here to run <a class="external" href="ftp://ftp.cygwin.com/pub/cygwin/setup.exe">setup.exe</a> and follow the installation instructions. The Cygwin installer wizard runs as a Windows program. One page of the wizard presents an outline view of categories and packages. You must add packages beyond the default set.
</p><p>If you'll be using Cygwin only to build Mozilla, then install only the default packages and the packages needed by Mozilla. In the version of the installer current at this writing (version 2.510.2.2), the <b>non-default</b> packages are found under the categories Devel, Interpreters, and Archive:
</p>
<ul><li> patchutils, make 3.80 (not 3.81!) (under Devel)
</li><li> perl (under Interpreters)
</li><li> zip, unzip (under Archive).
</li></ul>
<p>If you will be downloading the source using cvs instead of using a tarball you will also need:
</p>
<ul><li> cvs (under Devel)
</li></ul>
<p>If you may be using Cygwin's GNU tools for additional development, then install the editors, developer tools and interpreters, as well as anything else that looks interesting. Make sure you get all the packages Mozilla needs too, such as unzip and zip!
</p><p>Here is the <b>complete</b> cygwin package list for building Mozilla. You can use it to double-check your packages, or to understand and customize the build process:
</p>
<ul><li> ash -- UNIX-like command line interpreter shell (Base category)
</li><li> coreutils -- GNU core utilities (includes fileutils, install, sh-utils, and textutils) (Base category)
</li><li> cvs -- concurrent versions system (Devel category)
</li><li> diffutils -- file comparison utility (Base category)
</li><li> findutils (Base category)
</li><li> gawk -- pattern matching language (Base and Interpretors categories)
</li><li> grep -- text search tool (Base category)
</li><li> libiconv -- character set conversion (Devel category)
</li><li> make 3.80 (not 3.81!) -- dependency analyzer for software builds (Devel category)
</li><li> patchutils -- a small collection of programs that operate on patch files (Devel category)
</li><li> perl -- a scripting language used to control parts of the build (Interpreters category)
</li><li> sed -- a search and replace language (Base category)
</li><li> unzip -- zip file extraction (Archive category)
</li><li> zip -- zip file creation (Archive category)
</li></ul>
<p>If you plan to modify the build system's configure.in files, you will need to install an editor (such as xemacs or joe) and the autoconf-2.13 (autoconf-2.5 doesn't work) packages as well.
</p><p>You may use <a class="external" href="http://activestate.com/Products/ActivePerl/">ActivePerl from ActiveState</a> instead of the perl package in Cygwin if you prefer.
</p>
<h4 name="moztools"> moztools </h4>
<p>The moztools package contains binaries and libraries necessary to build Mozilla. A single zip file containing all moztools which works with all versions of MSVC is available at <a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/moztools-static.zip">moztools-static.zip</a>.
</p><p>If you want, you can download Visual C++ version specific moztools files:
</p>
<ul><li> Visual C++ 7: two files:
<ul><li> <a class="external" href="ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc7/vc7-glib-1.2.10-bin.zip">vc7-glib-1.2.10-bin.zip</a>
</li><li> <a class="external" href="ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc7/vc7-libIDL-0.6.8-bin.zip">vc7-libIDL-0.6.8-bin.zip</a>
</li></ul>
</li><li> Visual C++ 7.1: two files:
<ul><li> <a class="external" href="ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc71/vc71-glib-1.2.10-bin.zip">vc71-glib-1.2.10-bin.zip</a>
</li><li> <a class="external" href="ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc71/vc71-libIDL-0.6.8-bin.zip">vc71-libIDL-0.6.8-bin.zip</a>
</li></ul>
</li><li> Visual C++ 8: one file:
<ul><li> <a class="external" href="ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/vc8-moztools.zip">vc8-moztools.zip</a>
</li></ul>
</li></ul>
<p>The zip file contains a single folder named <i>moztools</i> that you should preserve. Unpack the zip file wherever you want the tools to be installed; however, Mozilla may not build if you install the moztools directory inside the cygwin directory.  The MOZ_TOOLS environment variable should be set to point to this moztools folder.  (You may rename the folder, as long as you update $MOZ_TOOLS accordingly.)
</p><p>Note: The 1.8.1 branch (Firefox 2) is compatible with the moztools-static package. Older branches (including the 1.8.0 branch) are not; see the <a href="en/Windows_Build_Prerequisites_on_the_1.7_and_1.8_Branches">historical build prerequisites</a> for details.
</p><p>The moztools zip file does not contain the source for the components; if you are interested in building them from scratch, you can obtain the source <a class="external" href="ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/src/">here</a>.  The <a class="external" href="http://www.go-oo.org/">ooo-build</a> system for building OpenOffice.org builds the tools from scratch using this code and contains some relevant <a class="external" href="http://go-oo.org/ooo-build/patches/src680/">patches</a> for anyone who doesn't want to use the binaries provided.
</p>
<h4 name="cvs"> cvs </h4>
<p>CVS is the source control system used by Mozilla. You do not need cvs if you are only going to build from source tarballs downloaded via FTP. If so, you may skip this step.
</p><p>To <a href="en/Mozilla_Source_Code_Via_CVS">pull Mozilla sources</a>, cvs version 1.11 or higher is required. Cygwin CVS is recommended. WinCVS is also compatible. When installing CVS, you should also install an editor such as emacs or Xemacs.
</p>
<h4 name="Compiler_&amp;_Linker"> Compiler &amp; Linker </h4>
<p>For doing development on the CVS trunk (Mozilla 1.9 or higher), the standard compiler is Microsoft Visual C++, version 8. The free Express edition of Microsoft Visual C++ 8 (aka Visual C++ 2005 Express Edition) will work with some <a href="en/Building_with_VC8_Express">extra tools and configure options</a>. Visual C++ 7.1 will also work.  VC++ 7 is not recommended, and VC6 is not supported and will produce unusable builds.
</p><p>The build may occur from within either a Windows command line shell or from a cygwin shell; if you use the Windows shell, you need to set up the compiler environment variables using the vcvars32.bat script that is installed along with Visual Studio (selecting "Visual C++ Command Prompt" from the Start menu entries for VS will execute this script for you in a new shell).
</p><p>It is also possible (but not recommended) to compile Mozilla using the MinGW gcc compiler: see <a class="external" href="http://gemal.dk/mozilla/build.html">Compiling Mozilla with MinGW</a>.
</p>
<h5 name="Table_of_supported_Visual_Studio_compilers"> Table of supported Visual Studio compilers </h5>
<table border="1" cellpadding="2" cellspacing="0">

<tbody><tr>
<th>Branch</th>
<th>HEAD<br>Gecko 1.9<br>Firefox 3</th>
<th>MOZILLA_1_8_BRANCH<br>Gecko 1.8.1<br>Firefox 2</th>
<th>MOZILLA_1_8_0_BRANCH<br>Gecko 1.8<br>Firefox 1.5.0.x</th>
</tr>
<tr>
<th>VC6
</th><td bgcolor="#ff0000">No
</td><td bgcolor="#66ff66">Yes (Official)
</td><td bgcolor="#66ff66">Yes (Official)
</td></tr><tr>
<th>VC7 (Visual Studio 2002)
</th><td bgcolor="#ffcc66">Not really
</td><td bgcolor="#66ff66">Yes
</td><td bgcolor="#66ff66">Yes
</td></tr><tr>
<th>VC7.1 (Visual Studio 2003)
</th><td bgcolor="#66ff66">Yes
</td><td bgcolor="#66ff66">Yes
</td><td bgcolor="#66ff66">Yes
</td></tr><tr>
<th>VC8 (Visual Studio 2005)
</th><td bgcolor="#66ff66">Yes (Official)
</td><td bgcolor="#ff0000">No
</td><td bgcolor="#ff0000">No<br>
</td></tr></tbody></table>
<h4 name="Platform_SDK"> Platform SDK </h4>
<p>If you are using at least Visual Studio .NET 2003, you already have all the necessary SDKs for building mozilla and can skip this requirement step. For older compilers, as well as for the free Vistual Studio Express Editions, you need to download SDKs from Microsoft to have the GDI+ headers and library.
</p><p>You can download the <a class="external" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&amp;displaylang=en">Windows Server 2003 SP1 Platform SDK</a>, or the <a class="external" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0baf2b35-c656-4969-ace8-e4c0c0716adb&amp;DisplayLang=en">Windows Server 2003 R2 Platform SDK</a>. You must install the "Windows Core SDK" (Tools, Build Environment, and Redistributable Components) and the "Web Workshop SDK" (Build Environment).
</p><p>In order for the build environment to pick up this SDK, the SDK must be added to the build environment (see below).
</p>
<h4 name="NSIS"> NSIS </h4>
<p>Some applications built from the Mozilla codebase now use NSIS for their installer, notably the toolkit apps Firefox, Thunderbird and Sunbird. If you will need to build the installer then setup <a class="external" href="http://nsis.sf.net">NSIS</a> and ensure it is on the PATH. Version 3.17 or greater is recommended.
</p>
<h3 name="Configure_the_Environment"> Configure the Environment </h3>
<p>The build environment must be configured so that the mozilla build system can find the proper compiler and libraries. This is best done with a DOS batch script. Your build may fail if your paths have spaces or other special  characters. Make sure that you did not install software into locations with such paths, except Visual C++.
</p><p>The following is a batch script (run with cmd.exe or modify the cygwin.bat file) which should be used to configure environment variables:
</p>
<pre class="eval">rem --- Set HOME so that cvs and ssh work correctly
rem --- cvs uses HOME to locate your .cvspass file, and ssh to locate your .ssh file
rem --- if you are using ssh, your HOME should match the home directory specified in /etc/passwd. See http://www.cygwin.com/faq/faq0.html.
set HOME=C:\home

rem --- Set VCVARS to wherever the MSVC vcvars.bat file is found
set VCVARS=<var>C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat</var>

rem --- Set MSSDK to wherever the MS SDK is installed
rem --- <strong>Only required for MSVC7 or the Free MSVC editions that don't come with an SDK</strong>
set MSSDK=<var>C:\Program Files\Microsoft Platform SDK</var>

rem --- Set MOZ_TOOLS to wherever you have the moztools packaged installed
set MOZ_TOOLS=<var>C:\moztools</var>

rem --- Set CYGWINBASE to wherever cygwin is installed
set CYGWINBASE=<var>C:\cygwin</var>

rem --- Prepend Cygwin path
rem --- This is necessary so that cygwin <tt>find</tt> is ahead of windows <tt>find.exe</tt> in the PATH, but cgywin <tt>link</tt> is after MSVC <tt>link.exe</tt>.
set PATH=%CYGWINBASE%\bin;%PATH%

rem --- Set MSVC environment vars
call "%VCVARS%"
 
rem --- Prepend SDK paths
rem --- <strong>Only required for MSVC7 or the Free MSVC editions that don't come with an SDK</strong>
set PATH=%MSSDK%\bin;%PATH%
set INCLUDE=%MSSDK%\include;%INCLUDE%
set LIB=%MSSDK%\lib;%LIB%

rem --- moztools comes last
set PATH=%PATH%;%MOZ_TOOLS%\bin

rem --- Now the PATH variable contains:
rem MS-SDK; MSVC; Cygwin; Windows; glib/libIDL; Moztools

rem --- Typically the last thing the script does is launch a cygwin shell
rem --- watch for your ~/.profile and /etc/profile which may overwrite your carefully setup PATH!
bash --login -i
</pre>
<p>Before compiling, be sure to rename %CYGWINBASE%\bin\link.exe to something else, like glink.exe.  If you don't, you might get an error like this (in configure)
</p>
<pre class="eval">configure: error: The incremental linker version, , does not match the compiler suite version, 8.
Fix above errors and restart with "make -f client.mk"
</pre>
<h3 name="Common_Problems_and_Hints"> Common Problems and Hints </h3>
<ul><li> Check the <a href="en/Mozilla_Build_FAQ">Mozilla Build Frequently Asked Questions</a>
</li><li> Your source tree must be located at a /cygdrive/&lt;c&gt; mount point. It must not be located within your /home.
</li><li> Mozilla may not build if you install the moztools directory inside the cygwin directory.
</li><li> If the configure or build fails due to a missing w32api, add the mingw32's /include directory to the end of your INCLUDE environment variable. Mingw32 libraries or binaries should not be needed, only the headers.
</li><li> The build may fail if your PATH environment variable contains quotes ("). Quotes are not properly translated when passed down to the cygwin sub-shells. Quotes are usually not needed so they can be removed.
</li><li> Double-check to make sure that you have the complete cygwin package list. If not, launch the cygwin installer and add the missing packages.
</li><li> Currently the build system is incompatible with make 3.81, so make sure you're using make 3.80. This issue is being tracked in <a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=325148">bug 325148</a> where a partial patch exists.
</li><li> <a href="en/Debugging_Mozilla_on_Windows_FAQ">Debugging Mozilla on Windows FAQ</a>: Tips on how to debug Mozilla on Windows.
</li><li> <a href="en/Upgrading_to_VC7">Upgrading a Windows build system from VC6 to VC7?</a>
</li></ul>
{{ wiki.languages( { "fr": "fr/Pr\u00e9alables_\u00e0_la_compilation_sous_Windows", "ja": "ja/Windows_Build_Prerequisites" } ) }}
Revert to this revision