croczilla.com 
 home   zap   svg   xtf   jssh   bits&pieces   blog   personal   
  home > zap > build

Zap checkout/build instructions

The zap code is checked into Mozilla CVS on minibranch ZAP_20050610_BRANCH. It consists of a patched version of xulrunner and a new directory mozilla/zap with most of the application code.

Getting the source

http://developer.mozilla.org/en/docs/Mozilla_Source_Code_Via_CVS contains generic Mozilla checkout instructions.
For zap, the MOZ_CO_PROJECT name is 'zap' and you need to checkout on branch ZAP_20050610_BRANCH:
  cvs -d... checkout -rZAP_20050610_BRANCH mozilla/client.mk
  cd mozilla
  make -f client.mk checkout MOZ_CO_PROJECT=zap

Build Requirements

Build requirements and generic Mozilla build instructions can be found at http://www.mozilla.org/build/.

In addition to the generic requirements, on Windows you will also need to have a DirectX SDK installed (any recent version should do) and add DirectX to your PATH, INCLUDE and LIB environment variables.

You need a .mozconfig file that (at least) sources the default zap mozconfig file:
 . $topsrcdir/zap/config/mozconfig
For building on Linux for 64bit processors with certain GCC versions you also need to add the following line to .mozconfig (see here for details):
ac_cv_visibility_pragma=no
For building a debug build, add the following to .mozconfig:
ac_add_options --enable-debug
ac_add_options --disable-optimize

If you don't want to clutter your source directory with object files you can add something like this to your .mozconfig:

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../build
All object files and the final dist/ directory will then be generated under mozilla/../build/.

Building

To build, run the following in your mozilla/ directory:
  make -f client.mk build
If all goes well you should now find the xulrunner executable in mozilla/dist/bin/ and the zap chrome and configuration files in mozilla/dist/xpi-stage/zap/. If you have specified a MOZ_OBJDIR=foo, the files will be in foo/dist/bin/ and foo/dist/xpi-stage/zap/.

For subsequent updates/builds you can run:

  make -f client.mk
This will perform both a CVS update and build.

Running

For the time being, to run zap do something like:
  cd mozilla/dist/bin/
  ./xulrunner ../xpi-stage/zap/application.ini
Or, if you have specified a MOZ_OBJDIR=foo in .mozconfig:
  cd foo/dist/bin/
  ./xulrunner ../xpi-stage/zap/application.ini

Making changes

Most of the zap code resides in the mozilla/zap/ directory. See here for an overview of the code. If you make changes under this directory it is sufficient to run make in the mozilla/zap/ objdir.

If you haven't specified a MOZ_OBJDIR in .mozconfig:

  cd mozilla/zap
  make

If you have specified MOZ_OBJDIR=foo:

  cd foo/zap
  make

Please submit patches to the zap developer list!

Troubleshooting

If your build fails, this is most likely because some recent changes from the trunk need to merged onto the branch.

The Zap branch is a 'mini-branch', which means that only a subset of files in the repository are branch-tagged. For files that are not tagged, Zap uses the current head revision from the trunk. Sometimes trunk changes lead to incompatibilities between tagged and non-tagged files: Zap 'sees' the changes in the non-tagged files, but not the tagged files. The trunk changes for the tagged files need to be merged in for the build to work again.

What to do when the branch needs merging?

1) Send me an email and I'll initiate a merge cycle.

and/or

2) One easy way of patching your local copy of branch automatically is to run 'make -f client.mk merge_zap'. In many cases this is all that needs to be done to get the branch to build again. If there are merge conflicts they will often be limited to 'mozilla/configure' which ca be regenerated with a simple 'autoconf' run in the mozilla/ directory.

Deployment / Installer

Soon...