mazilla mozilla
Introduction
What's mozilla
Purpose of this page
Characteristics of mozilla
Survey of mozilla
Module
Web tool
Technology of mozilla
Other resource
Building mozilla
Construction of environment
for building
Checkout of source
Procedure for building
Image of after-building
Execute mozilla
Embedding
What's embedding
Concept of embedding
Structure of PPBrowser
Analysis of PPBrowser
Structure of embedding
Structure of marbrow
Analysis of marbrow
Fizzilla
What's fizzilla
Build fizzilla
Embedding of fizzilla
FAQ
Talk with Mr. Yatsugi

Building Mozilla

Let's build mozilla !!


Before trying embedding, first of all, it's essential to download the whole source code of mozilla and to build it.

Mozilla is divided into modules according to their functions. But, because their actions depends on the interaction between each module, essentially quite a many modules are neccesary.

Especially, in regard to embedding, almost all modules are neccesary. (editor or mailnews may be omitted somehow.)

Therefore, whatever way you use mozilla in, it's important to build mozilla as it is, in the first place.

On 21. January 2001, there is a suggestion to shift the whole build of mac mozilla over to Carbonized build. The strategy is that, exporting the build projects as XML, and we can build them on CodeWarrior 5.0 or 6.0 whichever you like. If this would be done, the way of building shown below will change significantly.


Construction of environment for building

There are many tools neccesary for "download of mozilla source" & "building of mozilla".

Because "download of mozilla source" is done by CVS, to be exact, it's called "checkout of mozilla source".

On Macintosh, this checkout & building is written in Perl script, and processed in batch.

Because this processes of checkout & building are intertwined, the first step is to download & install the tools necessary for the processes and to construct the environment for checkout & building.

Some of neccesary tools are shown below.

CodeWarrior Pro 5

As compiler linker for building, Metrowerks CodeWarrior Pro 5 is used. Among tools for mozilla building, this is the only one you must buy.

Codewarrior Pro 5.3 updates [#]

Download & install CodeWarrior Pro 5.3 update. And rebuild MacOS precompiled header, runtime library and MSL library. Then change memory allocation of IDE to 24 M bytes.

CodeWarrior Plugin SDK [#]

Install this into MacOS Support folder. This is necessary because xpidl compiler is built as CW Plugin in the way of building process.

Universal Interfaces 3.3.2 [#]

To make a transition to Carbon easier, Apple's system header 3.3.2 will be used. Download diskimage file, mount it by DiskCopy and copy Universal folder to Mac OS Support folder of CodeWarrior. Rename OpenTransport folder to (OpenTransport).

Menu Sharing Toolkit 1.4 [#]

This is used for adding menus to mozilla's menu bar. Download and extract this, then copy Menu Sharing Toolkit 4.1 folder to Mac OS Support folder of CodeWarrior.

ToolServer [#]

If CodeWarrior MPW has been installed, this should already been installed in MPW folder. If not installed yet, please install this. In building process, MakeStub will use this.

MacPerl distribution [#]

Download, extract and install this. Change memory partition size of MacPerl to16 M bytes. It's better to check "Run Scripts opened from Finder" in Script tab of Preferences... . By doing this, you can kick MacPerl by double clicking a perl script.

cpan-mac distribution [#] (Now v0.50 on 26 Mar 2002)

This is a set of tools to make installation of a new Perl module easier. Download and extract it. Create site_perl folder in MacPerl application folder. At Libraries tab of preferences, add site_perl folder to library path. Now kick INSTALL.plx in cpan-mac distribution, and it will install lots of files into the site_perl folder. When you are asked if you install the droplets or not, select "Yes" .

Perl AppleEvents module [#] (v1.01 on 26 Mar 2002)
Perl Launch module [#]
Compress:Zlib module [#] (placed here on 26 Mar 2002)
Archive::Zip module [#] (v0.11 on 26 Mar 2002)

All of these are additional Perl modules. The installation procedure for each module is the same. Drop the downloaded tar-gz file onto the installme.plx.

MacCVS Pro 2.5b2 [#]

CVS client used for checkout of CVS. See Checkout of source for more details.

You can download an example of session file for mozilla checkout from here.

For more details of methods to get and install each tool,


Checkout of source

About CVS

Source code of mozilla is managed by CVS.

In simple terms, CVS (Concurrent Versions System) is a tool which can manage versions of sources and resources, and can support for co-development of programs by plural persons.

On the server in mozilla.org, there is the entity of mozilla source (called "repository"). And by CVS client program, individual PC gets its copy (called "working copy"). To get the working copy is called "checkout" in CVS terms. On the contrary, it is called "checkin" or "commit" in CVS terms to upload some modified working copy into repository.

For download of mozilla source, it is neccesary to check out it by using the CVS client program.

[For reference]
In fact, there is a tarball (a ball that is the set of whole sources compressed by tar-gz), and you could download this file at a stroke by ftp and use it. But, as far as Macintosh is concerned, this method is unavailable. By a tarball, it is impossible to restore the data of resource fork correctly. On Macintosh, it's always neccesary to checkout the sources by CVS.

On mozilla for Macintosh, the most widely used CVS client is MacCVS Pro. (The latest version is MacCVS Pro 2.5b2. )

Procedure of checkout

Build script has the old version & the new version.

  • Old version - mozilla/build/mac/*
  • New version - mozilla/build/mac/build_scripts/*

Procedure for old version

  1. Open the session file of MacCVS Pro for mozilla by double click. By Action/Check Out Default Module, checkout the latest build script.
  2. Start mozilla/build/mac/PullNGlayout.pl by MacPerl, and checkout the whole source.

Procedure for new version

  1. Open the session file of MacCVS Pro for mozilla by double click. By Action/Check Out Default Module, checkout the latest build script.
  2. Start mozilla/build/mac/build_scripts/PullMozilla.pl by MacPerl, and checkout the whole source.

For more details of CVS, MacCVS Pro,


Procedure for building

Procedure of building

For old version

  1. For debug building, start mozilla/build/mac/BuildNGLayoutDebug.pl by MacPerl. And for release building, start mozilla/build/mac/BuildNGLayout.pl by MacPerl.

For new version

  1. For debug building, start mozilla/build/mac/build_scripts/BuildMozillaDebug.pl by MacPerl. And for release building, start mozilla/build/mac/build_scripts/BuildMozilla.pl by MacPerl.

Control of building

There is the method of controlling the building process for both versions.

Especially, in BuildMozilla(Debug).pl of new version, it will starts PullMozilla.pl by default, and checks out the latest source before building. Therefore, in the cases such as you hope to release/debug build from the same source exactly, it's essential to control the building process.

And in both versions, release/debug build script clobbers the whole contents of mozilla/dist/* in default. So, it's also essential to control the building process in the cases such as you hope to release build after debug building but you don't want to delete the result of debug building (maybe you hope so).

When controlling the building process in old version, directly edit the control variables in the head of BuildNGLayout(Debug).pl file.

The building process in new version is controlled by SystemFolder/Preferences/Mozilla opt build prefs and by SystemFolder/Preferences/Mozilla debug build prefs.

I show my Mozilla debug build prefs & Mozilla opt build prefs below.

[Mozilla debug build prefs]

# You can use this file to customize the Mozilla build system.
# The following kinds of lines are allowable:
# Comment lines, which start with a '#' in the first column
# Lines which modify the default build settings. For the list of flags,
# see MozBuildFlags.pm. Examples are:
#
# build pull 0 # don't pull
# options mng 1 # turn mng on
#
# Line containing the special 'buildfrom' flag, which specifies
# where to start the build. Example:
#
# buildfrom nglayout # where to start the build
#
# Lines which specify the location of the files used to store paths
# to the CodeWarrior IDE, and the MacCVS Pro session file. Note quoting
# of paths containing whitespace. Examples:
#
# filepath idepath ::codewarrior.txt
# filepath sessionpath ":Some folder:MacCVS session path.txt"
#
# Lines which modify the build settings like #main::DEBUG.
# Any lines which do not match either of the above are assumed
# to set variables on $main::. Examples:
#
# CARBON 1
# MOZILLA_OFFICIAL 1
#
build pull 0
CLOBBER_LIBS 0
CLOBBER_DIST_ALL 0
CLOBBER_DIST_LIBS 0
CLOBBER_IDL_PROJECTS 0
#CARBON 1
#buildfrom nglayout
#options svg 1
#options mathml 1
#options transformiix 1

[Mozilla opt build prefs]

# You can use this file to customize the Mozilla build system.
# The following kinds of lines are allowable:
# Comment lines, which start with a '#' in the first column
# Lines which modify the default build settings. For the list of flags,
# see MozBuildFlags.pm. Examples are:
#
# build pull 0 # don't pull
# options mng 1 # turn mng on
#
# Line containing the special 'buildfrom' flag, which specifies
# where to start the build. Example:
#
# buildfrom nglayout # where to start the build
#
# Lines which specify the location of the files used to store paths
# to the CodeWarrior IDE, and the MacCVS Pro session file. Note quoting
# of paths containing whitespace. Examples:
#
# filepath idepath ::codewarrior.txt
# filepath sessionpath ":Some folder:MacCVS session path.txt"
#
# Lines which modify the build settings like #main::DEBUG.
# Any lines which do not match either of the above are assumed
# to set variables on $main::. Examples:
#
# CARBON 1
# MOZILLA_OFFICIAL 1
#
build pull 0
CLOBBER_LIBS 0
CLOBBER_DIST_ALL 0
CLOBBER_DIST_LIBS 0
CLOBBER_IDL_PROJECTS 0
#CARBON 1
#buildfrom runtime
#RUNTIME 1
#options svg 1
#options mathml 1
#options transformiix 1


Image of after-building

After mozilla itself has been built, mozilla/dist/ directory is created and many kinds of building results are collected there.

The contents of this mozilla/dist/ directory are generally divided into 2 categories.

  • resource necessary to build mozilla
  • resource necessary to execute mozilla

"resource necessary to build mozilla" mainly consists of header files and so on.
And it's the file group that each module Exports (Manifests) itself, to make itself can be used from other modules. These files exist under dist/xxxx directories, in which xxxx has the same names as each module's.

"resource necessary to execute mozilla" consists of executable files, shared libraries, resources used for execution and so on. They are so called execution environment of mozilla. They exist under dist/viewser/ or dist/viewser_debug/.

[mozilla/dist/]

mozilla/
+ dist/
+ dom/ - Manifest files for dom
+ editor/ - Manifest files for editor
+ embedding/ - Manifest files for embedding
| .
| .
+ viewer - Execution environment for Release
| + Mozilla - Application of mozilla
| + viewer.app - Application of viewser(Simple browser for test)
| |
| + Chrome/ - Chrome files
| + Components/ - Shared libraries as components
| + Defaults/ - Default files
| + Essential Files/ - Essential Shared libraries
| + Plug-ins/ - Plug-in files
| + res/ - Resources
|
+ viewer_debug - Execution environment for Debug
| + MozillaDebug - Application of mozilla
| + viewerDebug.app - Application of viewser(Simple browser for test)
| |
| + Chrome/ - Chrome files
| + Components/ - Shared libraries as components
| + Defaults/ - Default files
| + Essential Files/ - Essential Shared libraries
| + Plug-ins/ - lug-in files
| + res/ - Resources
| .
| .
+ widget/ - Manifest files for widget
+ xpfe/ - Manifest files for xpfe

The structure under dist/viewser/ & dist/viewser_debug/ is

Executable files in dist/
Mozilla (executable of mozilla itself), viewer.app (test program of simple browser).
executable of PPBrowser and so on will be created here after building.

Shared libraries ( Shlb ) in dist/Essential Files/, dist/Components/
Each is housed divided into what is essential to mozilla and what is optional.

Chrome files in dist/Chrome
They are files defining the chrome of mozilla. Files such as XUL, CSS, DTD, JS, RDF are housed in the directory structure, according to the mozilla specified way. Recently, these files are assembled into Jar files in each categories.

and so on.

And most of files under mozilla/dist/ directories are not actual files, but aliases linked to actual files under each module's directory (that is mozilla/xxxx).


Execute mozilla

Thank you for long reading. If your building is finished, now let's execute mozilla.

Executables of mozilla is

  • mozilla/dist/viewer/Mozilla (release building)
  • mozilla/dist/viewer/MozillaDebug (debug building)

    c_o_n_t_a_c_t
    Copyright (C) 2000-2002 Symphony, Inc. All Rights Reserved.
    Japanese