Open main menu

CDOT Wiki β

Assignment 1 paul

Revision as of 22:09, 19 September 2006 by Paul (talk | contribs)

This is my first experience in building such a big application. It took me a lot of time to do the research, I went to Google, went to ChatZilla, and went to blog, tried to get help. The following are my steps to build FireFox.


Steps to build Mozilla Firefox

Here are the steps that I took to build Firefox under Windows with Visual Studio 2005.

Step 1: Install Visual Studio .NET Professional 2005 by default.

Step 2: Install GNU Tools for Microsoft Windows (Cygwin) . Cywin is a Linux-like environment for Windows. It includes many utilities that are used to build firefox, such as gawk, perl, zip, and make.

Step 3: Download and Extract the Static moztools libraries for Visual C++ to directory “c:\proj\moztools”.

Step 4: Create a build script called buildenv.bat containing following content in folder ”C:\proj\” to setup the appropriate environment variables and paths.

C:\> md proj
C:\> cd c:\proj
C:\proj > copy con buildenv.bat
@echo off

rem --- CVS Setup
SET CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
SET CVS_RSH=ssh

rem --- Setup the paths to the moztools build libraries
set MOZ_TOOLS=C:\proj\moztools
set GLIB_PREFIX=%MOZ_TOOLS%
set LIBIDL_PREFIX=%MOZ_TOOLS%

rem --- Scrub these variables first
SET INCLUDE=
SET LIB=
SET PATH=C:\;C:\windows\system32;C:\windows\system32\wbem

rem --- Prepend cygwin
SET PATH=C:\cygwin\bin;%PATH%

rem --- Setup VC8 compiler environment vars
CALL "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86

rem --- Add glib/libidl to build environment
SET PATH=%PATH%;%GLIB_PREFIX%;%GLIB_PREFIX%\bin
SET INCLUDE=%GLIB_PREFIX%\include;%INCLUDE%
SET LIB=%GLIB_PREFIX%\lib;%LIB%

rem --- moztools comes last after glib/libIDL
SET PATH=%PATH%;%MOZ_TOOLS%\bin

Step 5: Create a text file named .mozconfig containing following content in “c:\proj\mozilla” from command line.

C:\> cd c:\proj
C:\proj> md mozilla
C:\proj> cd mozilla
C:\proj\mozilla> copy con .mozconfig
# Building Firefox Trunk with Debugging
. $topsrcdir/browser/config/mozconfig

# Put all obj files in one place, not in src tree
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-objdir
ac_add_options --disable-static
ac_add_options --enable-shared

# Debug Build Setup Options
ac_add_options --disable-optimize
ac_add_options --enable-debug

# Disable build Windows installation file
ac_add_options --disable-installer

Step 6: Login to the mozilla CVS repository, using the password anonymous.

C:\> cd c:\proj
C:\proj> buildenv.bat
C:\proj> cvs login

Step 7: Checkout the build script.

C:\proj> cvs co mozilla/browser/config mozilla/client.mk

Step 8: Download the source file from CVS.

C:\proj> cd mozilla
C:\proj\mozilla> make -f client.mk checkout

Step 9: Build the Firefox from source.

C:\proj\ mozilla> make -f client.mk build


Problems Encountered

Firstly, I thought I should have the source code in order to build the application. So I went to Mozilla website and tried to download the Firefox source code, and follow the steps that on this website, which is David’s instruction about how to build Firefox on windows with Visual Studio 2005.

But soon, I got stuck. The compiling process stopped after 10 minutes. The system displayed an error saying xxx.h file is not compatible. I put the error message in Google and tried to find the solution, but none of them worked for me.

Finally, I went to ChatZilla to get help, luckily I got Dave figure out my problem. After I talked to Dave, I found my steps were ok, but I shouldn’t download the source code. This source code that I downloaded won’t work under Visual Studio 2005.

Following Dave’s instruction on his website, I did step by step, it worked great. However, my system crashed after 30 minutes compiling. The Windows said out of memory, this is my problem that I had disabled virtual memory on Windows.

I enabled the virtual memory on Windows and reboot the system, after another 15 minutes compiling, the new Firefox is built.


Resources

Screenshot

This is the screen shot of new FireFox.

 


Conclusion

This is a great experience in learning how to build a big project and involving so many software and configuration. I learned knowledge and lessons from my problems that I encountered. The most important is, we can get any help, and also we can help each other in open source community.