Tuesday, December 12, 2006

Building Firefox on Windows

Building Firefox on Windows is a bit tricky. Though, the instructions on Mozilla developer site:
http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites_on_the_1.7_and_1.8_Branches
are clear; there are more steps that you need to follow to build Firefox successfully. Make sure you
1. Use make 3.80 and not 3.81. If you install cygwin it will install make 3.81 by default which will break the build. You can get make 3.80 here.
2. Rename /cygwin/bin/link.exe so that correct linker is used.
3. Delete all "config.cache" files. Why? Explained below.
4. Have source under directory strictly named as "mozilla". Click here for more discussion on this.
5. If you get error like this:
client.mk:359: source: No such file or directory
client.mk:359: code/mozilla/build/unix/modules.mk: No such file or directory
make: ** No rule to make target `code/mozilla/build/unix/modules.mk'. Stop here.
then, make sure that the mozilla source code is in a directory that doesn't have a space in the name i.e. it should be like this 'Firefox source code'. The directory name should not contains spaces.

If you have build Firefox before and you have changed your configuration i.e. the location of tools that you used to build Firefox, make sure you clear all "config.cache" files. These files caches the location from where the tools are used; so when you rebuild the Firefox, instead of fetching the location from your config file it uses the location in "config.cache" file, which may contain stale location.

So to summarize:
1. Use make 3.80
2. Clean all "config.cache" files.
3. Rename cygwin link.exe
4. Have source inside directory strictly named as "mozilla"
5. The name of the directory containing source code should not have spaces in it.

No comments: