The Mozilla
Organization
At A Glance
Feedback
Get Involved
Newsgroups
License Terms
Newsbot
Developer Docs
Roadmap
Projects
Ports
Module Owners
Hacking
Get the Source
Build It
Testing
Download
Bugzilla
Bug Writing
Tools
View Source
Tree Status
New Checkins
Submit A Bug
FAQ
Search

Building Mozilla on Microsoft Windows 32-bit platforms

Daniel Nunes, leaf@mozilla.org

$Id: win32.html,v 1.17 1999/10/27 18:21:38 leaf%mozilla.org Exp $


How to build Mozilla on a Microsoft Windows 32-bit System.

1. Introduction

2. Building Mozilla

3. Common Problems


1. Introduction

What this document is: A guide to building the Mozilla application.
This includes:

  1. A listing of the development tools you will need to build Mozilla.
  2. A list of environment variables you will need to set before building.

If you're looking for documentation on developing features or fixing bugs, the Mozilla Hacking Documents are probably what you're looking for.


2. Building Mozilla

    Each of the following subsections describes, or gives references to descriptions of, the steps necessary to build Mozilla.

    2.1 Get the Code

      There are two principal ways of getting the code, ftp and CVS. CVS will provide the most current code for building, but is slower than ftp. Ftp drops are generally produced daily, and are known to compile.

    2.2 Requirements

      The following need to be installed:
      • Microsoft Visual C++ version 5.0 or later
        (make sure you have set up the compiler using the vcvars32.bat script that came with it)
      • Service Pack 3
      • GNU Tools for Microsoft Windows (the Cygnus toolkit): Specifically, you'll need:
          cp.exe
          rm.exe
          date.exe
        Set MOZ_TOOLS such that %MOZ_TOOLS%\bin contains the executables listed above.. Netscape has internally modified versions of gmake, shmsdos, and uname that we use to get around some problems we were having keeping in sync with the Unix version of gmake. These versions can be found in the Windows Build Tools package, which can be ftp'd from ftp://ftp.mozilla.org/pub/mozilla/source/wintools.zip. Then, unpack the zip file, and run the handy install script:
          cd buildtools\windows
          install.bat
        This will overwrite the cygnus toolkit versions of three files with the modified versions you get from mozilla.org. This also installs required support libraries and dlls (such as libIDL and glib).
      • Perl5 for win32:

      Hardware/OS

      • Pentium 133 MHz or better
      • 64 MB RAM, 128 MB recommended
      • 250 MB NTFS or 500 MB FAT disk space
      • NT 4.0 is preferred
      • NT 3.51, Win95, and Win98 will also work.

    2.3 Setup the Build Environment

      The following environment variables need to be set:

        set BUILD_XPIDL=1
        (don't set this if you haven't installed the wintools.zip package in a while)
        set MOZ_BITS=32
        set MOZ_DEBUG=1
        (set this only if you want to build a debug build). to build optimized, undefine the variable by doing "set MOZ_DEBUG="
        set MOZ_NT=351
        (if running NT3.51)
        set MOZ_SRC=
        (top of your tree, for example: set MOZ_SRC=d:\mozilla_source if this is the directory where you checked out or unzipped the source into... don't end this line with a
        '\'... you'll be sorry if you do)
        set MOZ_TOOLS=
        (the parent directory of the GNU tools 'bin' directory. The build looks for MOZ_TOOLS\bin\gmake.exe, so make sure that the gmake.exe from the Windows Build Tools package resides there.)
        OS_TARGET=WINNT
        (or WIN95, or WIN98? Someone with one of these systems needs to verify this)
        set PATH=%PATH%;%MOZ_TOOLS%\bin
        set _MSC_VER=1100
        (if you are running VC++ 5.0) or 1200 (if you are running VC++ 6.0) - or - set MOZ_VCVER=42 (for version 4.2, though no reports of successful compilation have been reported with 4.2)

    2.4 Run the build

      Change to the directory you copied the source into (for example, cd d:\mozilla_source). If this directory was empty before you installed the source, there should be one directory here: mozilla.
      cd mozilla
      nmake /f client.mak build_all
      	

3. Common Sticking Points

  • nmake has a 'fatal error', listing one of the GNU commands and a hexadecimal return code.
      This will happen as a result of not having the GNU tools and Windows Build tools in your path. Add the directories with the appropriate binaries to your path.
  • It fails with the message "'.\WIN32' unexpected":
      You didn't properly set the environment variables -- you must not include a space at the end of the set statements (be careful if you are cut'n'pasting).
  • It fails to build, with directory-related errors:
      The full path to the source must not include any spaces. Additionally, the source must be extracted with an intact directory structure by a utility that understands long filenames. If in doubt, grab Info-Zip at ftp://ftp.cdrom.com/pub/infozip
  • It fails immediately with the message "Cannot find specified directory":
      You probably didn't properly set the environment variable MOZ_TOOLS; this needs to be set to the path up to, but not including, the final \bin directory in the path to the gnu tools. So, the path to the tool executables is '%MOZ_TOOLS%\bin\'.
  • I'm not running a 32-bit windows system, how do i build?
      Currently, the build process depends on a 32-bit operating system. Windows NT 4.0 is the recommended windows operating system.
  • I'm not using the standard cmd.exe, and my build fails...
      Problems have been encounted using the 4nt command shell. 4nt interprets charactes like ';' in the makefile.win files as targets, and since there are no rules for the target ';', the build fails.
  • I checked in something that builds on Windows, but it breaks other platforms ...

Copyright © 1998-1999 The Mozilla Organization.
Last modified October 27, 1999.