Friday, January 21, 2011

OSD600 - Building Firefox 4 (Minefield)

Okay, I got this to work but I'm not sure if it works correctly. I mean, it runs but it runs weird. Let me explain: (*Note: If you use this as a guide to try this yourself, don't follow it step by step. In fact, follow this blog or the official Simple ff build. Also, I am running Windows 7 x86*)

What You Will Need

I followed someone else's blog through most of this (). Basically you will need the Mozilla Build tools and TortoiseHg (the one that suits your OS).

Let's Get Started

Allow the build tools to install to it's default directory: C:/mozilla-build. Next, make a directory in your C:/ directory for the source code (mine is C:/OSD600. It is important to not include spaces in this path name!). For this directory, we will use TortoiseHg to clone the source code from this url: http://hg.mozilla.org/mozilla-central/. This takes a while...

Now we must make a mozconfig file. Seeing as Windows 7 won't allow you to make files without an extension, open the command line and execute these commands (this is what's in my mozconfig. Here is Mozilla's help page for mozconfig files):

echo ". $topsrcdir/browser/config/mozconfig" > mozconfig
echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-debug" >> mozconfig
echo "ac_add_options --enable-debug"
>> mozconfig
echo "ac_add_options --disable-optimize" >> mozconfig

You'll also want to open it in notepad and remove the quotes. Better yet, just do echo "d" > mozconfig to make the file and do the rest in notepad. When you're done, this file should be placed in the root folder (in my case, C:/OSD600).

Now for the fun part (this is the part where the problems arise, naturally). Go to C:/mozilla-build and run one of the start-msvc.bat files. If you has Visual Studio 2010, run start-msvc10.bat. And yes, I am assuming you have Visual Studio and the required Microsoft SDKs. This .bat file should open a command window.

Now execute these commands:
cd /c/osd600 make -f client.mk build

If it works, it will build for about an hour.











When it finishes building the executable can be found in the following directory:
Depending on what directory you put in your mozconfig (at this line : mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-debug) it can be found at C:/OSD600/objdir-ff-debug/dist/bin/firefox.exe.













P
roblems

What, you think it's THAT easy? HA! This took me days!

The first error I got was this one:
--enable-application=APP was not specified

I looked online for a fix to this error but now I'm thinking that the fix was unnecessary. I think if I specified an additional option in the mozconfig, I would have fixed this error. Anyways, the fix I found was to do this:
-Make a new directory
- Go to that directory
- execute these commands:
../configure --enable-application=browser
make -f ../client.mk

This however caused more problems. So the next day I went to the original directory (OSD600) and ran the regular command: "make -f client.mk build" and for some reason it worked! ... Or so I thought. It works but I get this error message.













When I run the firefox.exe, a command line window pops up, it write a bunch of warnings, and this error window appears. If you choose "Abort" and try again or "Ignore", the error message doesn't pop up. It's just odd.

No comments:

Post a Comment