Building MozPETs from source

In addition to the information here, please check the file README-build.txt thaIn addition to the information here, please check the file README-build.txt that is included in the source tree.
The MozPETs build system has four steps:

  1. A full build of Mozilla
  2. Packaging of the MozPETs extensions as XPIs
  3. Installation of the XPIs within the browser dist/ directory
  4. Packaging an archive for distribution
Step 2 can be done independently if you just want create the XPI archives. In this case, you don't need all of the build tools described below.

Build requirements

You should have some experience using the shell and standard build tools like make and gcc. If you want to do a full build, you need everything as described in the official Mozilla build instructions for your platform: http://www.mozilla.org/build/ Additionaly, you need the following tools: rsync sed unzip wget zip

Obtaining the source code

Either download a milestone source archive from the download page and extract it or checkout the latest source code via anonymous CVS:
cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/mozpets login 
cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/mozpets co -P mozpets
Warning: The checkout will include the full Mozilla Suite source code. A web interface to CVS and more info is available here.

Build configuration

Edit the file mozpets-config to select the build platform (unix, cygwin, w32msvc, macosx), the Mozilla Extensions (MOZ_EXTENSIONS) and the MozPETs features (FEATURES) you want to have included within your build.
The default is platform autodetection by the script tools/detect-platform (Windows defaults to cygwin) and to have all extensions and features enabled.

If you want to change any other Mozilla build options, go to your platform build directory (e.g. build-unix) and edit the file mozconfig.in to suit your needs.

Building and Testing

Open a shell and change to the mozpets directory. Most build problems are likely to occur during the rebuild of Mozilla. Therefore, try

make build-moz
first. If you experience problems, please check the Mozilla development archives (googling for "mozilla build my error message" is often sufficient) if your problem has been seen before. Try to rebuild Mozilla from the original sources from Mozilla.org to see if our modifications are the cause of the problem. Please contact the mozpets-discuss mailing list if you cannot fix your build problem. Do not file a bug on Mozilla.org unless you can reproduce your problem with an unpatched official source tarball from Mozilla.org!

If the above step was succesful, a

make mozpets
will build the full MozPETs prototype. Check the Makefile for additional targets if want to do partial rebuilds. After that, a
make run
allows you to run the prototype directly from the build directory. Use
make zipdist
to build a binary archive for distribution.

Building standalone XPIs

You need to have make, sed, rsync and zip installed. To build standalone XPIs just type:

make xpi-features
You will find the XPI archives in the directory stage/xpis/

Platform specific remarks

Debian Linux

The following apt-get should be sufficient to get all required packages for compiling:

apt-get update
apt-get install ccache gcc g++ make rsync sed unzip wget zip libgtk2-dev libidl-dev

Windows

Do NOT unpack the source to your cygwin homedir, use a path like C:\mozpets !

Install all required tools from Cygwin. The file buildcyg.bat is a wrapper that tries to set the required variables for a Cygwin build as described by the Mozilla build instructions for Windows. It should called from a Cygwin bash shell and expects a MozPETs makefile target, e.g.:

./buildcyg.bat mozpets
should be equivalent to do a
make mozpets
if you have configured all tools and variables manually.
There is also a file buildw32.bat that should do the same for a build with the free MSVC tools, but we could never get this to work on our own machines so far (patches welcome!).

MacOS X

Apart from the developer tools available from Apple, the Fink project provides packages for the required tools:

apt-get update
apt-get install ccache ccache-default make rsync unzip wget zip
All the tools are available from Darwinports too.




MozPETs is hosted on SourceForge.net Logo