Building Firefox on Lion
Contents
Summary
Firefox trunk builds fine against Lion build 11A30 (the one that was seeded to developers in february). Not all tests pass though and I have simply disabled those for now.
It builds against the MacOSX10.7.sdk with the GCC shipped with Xcode 4.1, which is marked as "gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.9)".
The only problem I had was with the dependencies that we require. Other build instructions say to install libidl, autoconf and yasm through MacPorts. That did not work on Lion because some dependencies of those ports fail to compile. As a workaround I simply copied a complete /opt directory from a Snow Leopard system and used that.
Homebrew also fails to install the tools that we need. This will probably just be a matter of time before they catch up.
Instructions
These instructions are really not that different than the ones on https://developer.mozilla.org/en/Mac_OS_X_Build_Prerequisites
Setup build dependencies
- This needs to be done on a Snow Leopard machine. Building these ports currently does not work on Lion*
Boot into Snow Leopard and setup MacPorts as described on http://www.macports.org/install.php
Then install the following ports:
$ sudo port install libidl autoconf213 yasm mercurial $ sudo port install autoconf213 $ sudo port install yasm $ sudo port install mercurial
Tar or zip your whole /opt directery and move it over to your Lion install.
Grab the Source
$ hg clone http://hg.mozilla.org/mozilla-central/ mozilla $ cd mozilla
Setup a ~/.mozconfig
I am using the following:
. $topsrcdir/browser/config/mozconfig mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg mk_add_options MOZ_MAKE_FLAGS="-s -j4" ac_add_options --enable-debug ac_add_options --disable-optimize ac_add_options --disable-tests ac_add_options --disable-crashreporter
You might want to change the -j4 if you have a different number of CPUs.
Compile
make -f client.mk build
Run It
open obj-ff-dbg/dist/MinefieldDebug.app