I’m going to attempt to build a firefox on my windows machine. I’m going to follow “simple firefox build” doc in MDC.
First of all, I’m going to get Mozilla build tools for windows. I’m running windows 7 and VS2008, so I do not need to worry about .NET Framework. But I will most likely need some of the windows SDKs.
Mozilla build tools is going to install lots of stuff to “drive:\mozilla-build” (by default). Next thing I’m going to do is to set environment to use VS2008. In cmd under mozilla-build folder execute start-msvc9.bat.
C:\mozilla-build>start-msvc9.bat
"Mozilla tools directory: C:\mozilla-build\"
Windows SDK directory: C:\Program Files\Microsoft SDKs\Windows\v6.0A\
Windows SDK version: 6.0A
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
Mozilla build environment: MSVC version 9.
I guess, it worked.
Next step is to get the source code. Mozilla uses HG to manage source code (you can get HG here). I’m going to get the code from the main tree:
hg clone http://hg.mozilla.org/mozilla-central/
I’m doing it over my college wireless. It’s probably not the best idea, because there is 1GB of source code data.
C:\Program Files (x86)\Mercurial>hg clone http://hg.mozilla.org/mozilla-central/
destination directory: mozilla-central
requesting all changes
adding changesets
adding manifests
transaction abort!
rollback completed
abort: connection ended unexpectedly
Thought so… So, first step should have been “look for a lan cable”.
Here is a “haiku”:
Found a LAN cable
Broadband connection is nice
Very Cold outside
Before I build I have to make sure that there is no spaces in the path to “make”. And I have to have a mozconfig file in the build directory.
mozconfig should containt the following lines:
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-release
mk_add_options MOZ_MAKE_FLAGS="-j4"
So now when I have the source code all I have to do is “make -f client.mk”. Spirits of my ancestors tell me that “make” is a unix program. Here is where MozillaBuild comes into play. Under “drive:\mozilla-build”, I’m going to execute “start-msvc9.bat” to get a build console. Inside the console I’m going to execute “make -f client.mk” to start compiling firefox.
And SDK version check fails:
checking for Windows SDK being recent enough... no
configure: error: You are targeting Windows version 0x06010000, but your SDK only supports up to version 0x06000000.
It basically requires windows 7 SDK, that can be downloaded here. 3 ISO files, 1500 mb each. I will reduce the world carbon dioxide emissions by not downloading those files. Instead, I’m going to add “ac_add_options –with-windows-version=600” to mozconfig and see if it works.
I will see you after the brea… after it builds.
It failed with the following error:
cl : Command line error D8027 : cannot execute ‘c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\c2.dll’
I have another “haiku”:
Building Firefox
Installing Visual Studio SP1
Not good at all
I let VS2008 SP1 install first and re-started “make”. Now, I just need to wait for it to finish.
An hour later the build is finished. Time to test.
drive:\mozilla-build\mozilla-central\objdir-ff-release\dist\bin\firefox.exe
Welcome to Minefield
Minefield installed
It has not crashed on me
Broken Promises
Overall, it wasn’t too difficult to do “simple firefox build”. The main requirements are keyboard, monitor, and patience… and a lan cable.