The Mozilla
Organization
Our Mission
Who We Are
Getting Involved
Community
Editorials
What's New
Development
Roadmap
Module Owners
Blue Sky
Projects
Status
Tools
Products
Source Code
Binaries
Documentation
License Terms
Bug Reports
Search
Feedback


Building the Mozilla client on Unix platforms

Daniel Nunes, leaf@mozilla.org

Last modified: Tue Feb 16 12:03:19 PST 1999

1. Introduction
2. Other Unix Build pages
3. Requirements
4. Get the Code
5. Build the Lizard
6. After the Build
7. Common Problems


1. Introduction

Perhaps you are interested in building classic Mozilla, before the fall of the old layout engine, and the rise of the new. If so, the Classic Mozilla Build document is what you're looking for.

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 sample set of commands to build Mozilla using the Autoconf build system.

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. Other Unix Build pages


3. Requirements

Your hardware should be equal to, or better than:
    32 MB RAM, 128 MB swap (64 MB RAM recommended)

The following software should be installed:

  • egcs version ? 1.0.3 (recommended), gcc version 2.7.2.x (2.8.x still has some bugs),
    or your platform's native C/C++ compiler.
  • Perl 5
  • GNU make 3.74 or higher.
    3.77 seems to have shipped a ($wildcard) bug which you'll need to build NSPR;
    revert to 3.76.1 until this is fixed.
  • Autoconf 2.12 (which requires GNU m4).

  • CVS 1.9 or higher.
    Anonymous cvs checkout from mozilla.org:
    setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot

    Log in to the server with: cvs login, using the password anonymous. You only need to do this once.

  • GTK+ and GLib 1.1.13 or higher. Earlier versions may cause startup crashes or other odd behavior.
    • For Debian Packages, try looking in:

    • Red Hat: RPMs for 1.1.13 for intel can be found at the official gtk site, or at http://www.productivity.org/~bryner/
      Remove any old glib-devel and gtk+-devel packages already installed on your machine.
        rpm -e glib-devel
        rpm -e gtk+-devel
      Download new glib, glib-devel, gtk+, and gtk+-devel packages into the same directory and install them with one commmand.
        rpm -i *.rpm

    • CVS: Download the glib & gtk+ source from gnome.org:
        setenv CVSROOT :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome
        cvs -z3 co glib gtk+

    • Solaris:
      • You currently have to configure with "--enable-xim=no" (see bug #2128)
      • GTK+ requires X11R6. Solaris 2.6 has X11R6. Some versions of 2.5.1 have it. Otherwise, you may be able to get a patch or install your own.

  • NSPR Library (Netscape Portable Runtime)
    There are several ways to get NSPR onto your system:

    • NSPR rpms , get both the rpms prefixed with 'nspr'.

    • Manually pull the NSPR source and build it.

      # Get NSPR code
      setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
      cvs co NSPR

      # Then build it:
      # See the NSPR docs for thread support for your particular platform.
      # Redhat Linux seems to be working well with USE_PTHREADS=1 here,
      # and a corresponding --with-pthreads options to configure.
      cd mozilla
      gmake -C nsprpub DIST=/usr/local/nspr NSDISTMODE=copy NS_USE_GCC=1 \
      MOZILLA_CLIENT=1 NO_MDUPDATE=1 NS_USE_NATIVE= USE_PTHREADS=1 export

      Your LD_LIBRARY_PATH must include the path to the NSPR shared objects. For the above DIST specification, this means adding /usr/local/nspr/lib to LD_LIBRARY_PATH (either:
      setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/nspr/lib
      or
      export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/nspr/lib .
      If you get an error like "No such variable" then omit the ${LD_LIBRARY_PATH}: part )

    • Use client.mk. This automates the manual step described above.
      Note: client.mk seems to be falling behind, try the manual steps first.

      # Pull NSPR source and build it
      gmake -f mozilla/client.mk nspr

4. Get the Code

There are two principal ways of manually 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 on some machine, somewhere.

# Manually pull the right source
setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
cvs co SeaMonkeyEditor

or

# Automagically do the pull; this will pull branches if needed.
setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
cvs co mozilla/client.mk
gmake -f mozilla/client.mk checkout


This should pull all the right source for building the viewer and apprunner.


5. Build the Lizard

5.1 Manually drive the build

    cd mozilla

    # Configure the build, putting objects in the source tree.
    #
    # For configure options, run "./configure --help".
    # The level of nspr and thread support will depend on the OS.
    # If you specified USE_PTHREADS when building NSPR, you'll
    # need to add "--with-pthreads"; we continue with the
    # Redhat/Linux example below:

    ./configure --with-nspr=/usr/local/nspr --with-pthreads --enable-editor --enable-debug

    # Building on more than one OS? Create an external object tree:
    #
    # mkdir obj-`./build/autoconf/config.guess`
    # cd obj-`./build/autoconf/config.guess`
    #
    # ../configure --with-nspr=/usr/local/nspr --with-pthreads --enable-editor --enable-debug

    gmake depend
    gmake

Once you have configured, you only have to run configure if you add or remove Makefile.in files (cvs update can do this! beware!). The list of makefiles is in mozilla/allmakefiles.sh

If a Makefile.in file is changed (not added or deleted), you only have to run ./config.status.

If you change configure.in, cd to mozilla, and run autoconf. This generates a new configure script. (When you checkin configure.in, cvs will run autoconf and check in a new configure script for you).

5.2 Automated build

# (this should find the client.mk-built NSPR libraries).
# One-liner for the above manual step.
# Note: client.mk seems to be falling behind, try manual steps above first.

gmake -f mozilla/client.mk build


6. After the build

  • cd obj*/dist/bin and you should see links to the objects you need to run: viewer and apprunner.
  • On most unixen LD_LIBRARY_PATH must be set to wherever the necessary libraries are (the same directory as the executables, in this case).
    • On HP-UX, the equivalent environment variable is SHLIB_PATH.
    • On AIX, the equivalent environment variable is LIBPATH.
  • Set MOZILLA_HOME to the directory the binary resides in (the absolute, not relative, path) as well.
  • Update your tree by re-checking out the source, e.g. repeating the initial checkout process.

7. Common Sticking Points

  • Make sure $LD_LIBRARY_PATH includes the paths to your NSPR and GTK libraries. (For instance, you might set it to .:../../nspr/lib).

  • Having more than one installation of gtk can cause problems (i.e. if you compile one version yourself and upgrade by installing an rpm). You'll probably need to remove the older libraries and gtk-config script.

  • Not setting MOZILLA_HOME causes a crash upon startup. If you run the executables from anywhere other than obj*/dist/bin, you must set the environment variable MOZILLA_HOME to point to the absolute path of the dist/bin directory.

  • I'm sure there are bound to be others. Send me mail.



Copyright © 1998 The Mozilla Organization.