You are currently viewing a snapshot of taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to, please file a bug.

Building Mozilla on Unix platforms

Daniel Nunes,

v 1.1, June 1998

How to build Mozilla on a Unix 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 Technical Documents or Library 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 once per month, and are known to compile.

2.2 Requirements

    The following should be installed:
    • Motif 1.2
    • The native C/C++ compiler (or GNU C/C++ compiler 2.7.2 in lieu of the native compiler)
    • GNU make 3.74 or better
    • Perl (or, if you have no Perl, then set PERL=/bin/echo)

    Your hardware should be equal to, or better than:

      32 MB RAM, 128 MB swap (64 MB RAM recommended)

2.3 Setup the Build Environment

    The following environment variables need to be set:
    Optionally, you can set BUILD_OPT=1 if you don't want a debug build.

    If your Motif libraries are installed in a non-standard place, you can tell the Mozilla makefiles where to look by setting MOZILLA_MOTIF_SEARCH_PATH to point to the directory in which your Motif installation resides.

    Environment variables are set by the shell, and there are two common ways of setting them.
    Type setenv VARIABLE value or export VARIABLE=value.

2.4 Run the build

    Change to the directory you copied the source into (for example, cd /builds). If this directory was empty before you installed the source, there should be two directories here: README and mozilla.
    cd mozilla

2.5 After the build

    You may notice that if you try running mozilla-export right after the build, you'll run into a problem. You need to set LD_LIBRARY_PATH to ${LD_LIBRARY_PATH}:/PATH_TO_SOURCE/mozilla/dist/Linux2.0.32_x86_OPT.OBJ/bin (where PATH_TO_SOURCE is the full path to your source tree) before the dynamically linked binary will run.

    This varies by platform:
    • On HP-UX, the equivalent environment variable is SHLIB_PATH.
    • On AIX, the equivalent environment variable is LIBPATH.

3. Common Sticking Points

  • My linker dies with this error: undefined reference to `_Xsetlocale'
      If this error occurs, you might have to recompile with the -DX_LOCALE flag (thanks to Scott Lampert,