Easy Firefox-on-xulrunner builds

A lot of GNU/Linux distributions prefer to build Firefox as a xulrunner application, which works most of the time, except for a few breakages now and then, most usually because of the misuse of resource:/// urls instead of resource://gre/.

While building distributions packages to check how Firefox-on-xulrunner goes can be complicated, it’s actually pretty straightforward using the Mozilla build system.

Just use the following .mozconfig, and start a build the usual way:

mk_add_options MOZ_BUILD_PROJECTS="xulrunner browser" mk_add_options MOZ_MAKE_FLAGS=-j ac_add_options --with-ccache ac_add_app_options browser --enable-application=browser ac_add_app_options browser --enable-default-toolkit=cairo-gtk2 ac_add_app_options browser --with-libxul-sdk=../xulrunner/dist ac_add_app_options browser --enable-chrome-format=jar ac_add_app_options xulrunner --enable-application=xulrunner ac_add_app_options xulrunner --enable-url-classifier

A few notes about some of the options:

  • You may adjust MOZ_MAKE_FLAGS and remove --with-ccache
  • --enable-default-toolkit=cairo-gtk2 is obviously a GNU/Linux option. It may be replaced by the adequate toolkit for the platform you want to build for. It’s only there to work around some shortcomings of the configure script and SDK (both of which should eventually be fixed).
  • --enable-chrome-format=jar is to be used because xulrunner doesn’t support omni.jar yet (but will soon).
  • --enable-url-classifier is necessary because xulrunner doesn’t include it by default, though Firefox does require it.

Once your build is finished, you just run the Firefox executable in $objdir/browser/dist/bin.

PS: Maybe I should add that to the MDN page about build options, or some other place (?).

2010-12-20 18:35:56+0900


You can leave a response, or trackback from your own site.

One Response to “Easy Firefox-on-xulrunner builds”

  1. Standard8 Says:

    If you’re going to add it to a MDN page, then I strongly suggest not adding it to the existing MDN page – that is already overly complex.

    Rather I suggest you do a clone of this page:


    and link to it appropriately.

Leave a Reply