This document is a guide to the prerequisite software for building Mozilla on Windows platforms on the 1.7 branch (Mozilla 1.7.*), the aviary branch (Firefox 1.0.*), the 1.8.0 branch (Firefox 1.5.0.*), and the 1.8 branch (Firefox 2). The build prerequisites for the Mozilla trunk are here.
Required packages:
If you plan to modify the build system's configure.in files, you will need to install an editor (xemacs, vim, etc.) and the autoconf-2.13 (don't use autoconf-2.5x or 2.60) package as well.
It is hightly recommended to choose "DOS" style line endings from the cygwin installer.
You may use ActivePerl from ActiveState instead of the perl package in cygwin if you prefer.
make 3.80 is no longer available in the cygwin installer (version 3.81 will not work), so get it from paracoda and place the included make.exe in your %cygwin%\bin\ directory, e.g. by starting a cygwin bash shell and executing
cd / tar xjf /cygdrive/c/where-your-download-is/make-3.80-1.tar.bz2 bin/make.exe --version
If you are building the 1.8 branch or trunk (not 1.8.0 or any earlier branches, see below), you should use the special moztools-static package which has a static version of the moztools, glib, and libIDL for all MSVC versions.
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.)
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.
If you are building the 1.8.0 branch or earlier, Netscape's wintools.zip contains pre-built libraries and tools which are needed to build Mozilla. When building with MSVC++ 7, you must install additional glib and libidl libraries, see below.
If you are building 1.8.0 or any earlier branch, you will have to download wintools as well as possibly an appropriate version for MSVC++ 7.
Unpack the zip file into a temporary directory, open a Windows command window, and set MOZ_TOOLS to the directory you want the build tools installed to, for example:
set MOZ_TOOLS=C:\moztools
The MOZ_TOOLS directory should not be inside your cygwin installation directory, nor in a subdirectory of cygwin. This will cause your build to fail.
Run the wintools install script. This batch script will install the files into %MOZ_TOOLS%/bin.
cd buildtools\windows install.bat
When building with MSVC++ 7 or 7.1, you must install pre-built versions of the glib & libIDL libraries. The static moztools package includes these libraries, so you if you're using that, you don't need to do anything more to obtain them. Otherwise, you can find the prebuilt versions of these libraries on the mozilla.org FTP servers. Do NOT install these libraries over your existing moztools directory; instead, pick a separate location and set GLIB_PREFIX, LIBIDL_PREFIX, and PATH appropriately in your environment (see below).
To pull Mozilla sources, cvs version 1.11 or higher is required. Cygwin CVS is recommended. When installing CVS, you should also install an editor such as emacs.
The standard compiler for Mozilla on Windows is Microsoft Visual C++, version 6. You must use either the Professional or Enterprise edition (the Visual C++ Processor Pack will not install with Visual C++ Standard). The GUI tools of the MSVC environment are not used, only the command-line tools CL (C/C++ compiler), LINK (linker), RC (resource compiler), and ML (assembler). Visual C++ Service Pack 5 and Visual C++ Processor Pack are required. Service Pack 6 is not supported. MSVC version 5 is not supported.
The environment must be configured to include the MSVC tools. This is typically with the vcvars32.bat script, see below for details.
It is also possible to compile these branches using newer Microsoft visual C++ compilers such as edition 2002 (VC7.0), 2003 (VC7.1). Using version 2005 (VC8) is not possible.
It is also possible (but not recommended) to compile Mozilla using the mingw gcc compiler: see Compiling Mozilla with mingw.
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, you need to download SDKs from Microsoft to have the GDI+ headers and library.
When using Visual C++ 6, you need to get either the october 2002 or the february 2003 version of the platform SDK. The latest versions can not be used with Visual C++ 6 at all, and some intermediate versions have incompatible debug information, allowing only the release mode to work properly. In fact, even the version of february 2003 has one debug file that is incompatible with Visual C++ 6, but this does not impact mozilla.
The Platform SDK can be obtained from the Microsoft Download Center. You must install the "Windows Core SDK" (Tools, Build Environment, and Redistributable Components) and the "Web Workshop SDK" or (in the Feb. 2003 version) the "Internet Development SDK" (Build Environment).
Those who need an old version can find the february 2003 PSDK here. It is also possible to order CD version of several old version of the PDSK here [1].
The build environment must be altered to pick up the SDK paths, see the examples below.
Some applications built from the Mozilla 1.8 branch use NSIS for their installer, notably the toolkit apps Firefox & Thunderbird 2, and Sunbird 0.3. If you will need to build the installer then setup NSIS and ensure it is on the PATH. Version 2.17 or greater is recommended.
If you want to make the highly compressed installer used by Firefox and Thunderbird, you need to install the 7-zip and UPX utilities, make sure they are in your path, and export MOZ_INSTALLER_USE_7ZIP in your environment.
The UPX package is available in Cygwin setup under the Utils category. Do not use the DOS version, as it will not work.
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 edit 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 6\VC98\Bin\VCVARS32.BAT rem --- Set MSSDK to wherever the MS SDK is installed rem --- The separate SDK is only required for MSVC6 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 rem --- Do not use CYGWIN or else cygserver, cygrunsrv, and other cygwin services will not function properly. rem --- The CYGWIN variable is also used to sort of change the behaviour of Cygwin. set CYGWINBASE=C:\cygwin rem --- Make sure Cygwin does not print out a DOS style path warning set CYGWIN=nodosfilewarning rem --- If you are using VC7 or VC7.1, you must set GLIB_PREFIX and LIBIDL_PREFIX set GLIB_PREFIX=C:\moztools_vc71 set LIBIDL_PREFIX=C:\moztools_vc71 rem --- Prepend Cygwin path rem --- This is necessary so that cygwin find is ahead of windows find.exe in the PATH, but cygwin link is after MSVC link.exe. rem PATH=%CYGWINBASE%\bin;%PATH% rem --- Set MSVC environment vars call "%VCVARS%" rem --- Prepend SDK paths rem --- Only required for MSVC6 set PATH=%MSSDK%\bin;%PATH% set INCLUDE=%MSSDK%\include;%INCLUDE% set LIB=%MSSDK%\lib;%LIB% rem --- Add glib/libidl to build environment rem --- Only needed for VC7 or 7.1 set PATH=%PATH%;%GLIB_PREFIX%;%GLIB_PREFIX%\bin set INCLUDE=%GLIB_PREFIX%\include;%INCLUDE% set LIB=%GLIB_PREFIX%\lib;%LIB% rem -- moztools comes last after glib/libIDL 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 --- WARNING: This may reset your carefully setup path! Check your /etc/profile and ~/.profile files. bash --login -i
Before building, be sure to rename %CYGWINBASE%\bin\link.exe to another name, for example glink.exe. If you don't, you might come up with error (in configure)
configure: error: The incremental linker version, , does not match the compiler suite version, 7.1. Fix above errors and restart with "make -f client.mk build"
Page last modified 21:28, 17 Oct 2007 by Edburns@acm.org?