Difference between revisions of "Assignment 1 Building FireFox"

From CDOT Wiki
Jump to: navigation, search
(Steps to Build FireFox)
(References)
 
(7 intermediate revisions by the same user not shown)
Line 96: Line 96:
  
 
== References ==
 
== References ==
 +
 +
 +
Windows Build Prerequisite page [ http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites]
 +
 +
FireFox Options Page at the Mozzilla.org developer Center[ http://developer.mozilla.org/en/docs/Configuring_Build_Options#Firefox_Optimized_Static]
 +
 +
[[User:David.humphrey|Humphrey, David]] -[http://cs.senecac.on.ca/~david.humphrey/writing/firefox-win32-build.html Building Firefox on Win32]<br />
 +
 +
[[User:Elichak|Chak, Liz]] - Whose page was very helpful when I encountered the compile errors.
 +
[[User:Sherman|Sherman Fernandes]] (sjfern) - His advice was invaluable whenever I got stuck with a problem.

Latest revision as of 09:58, 20 September 2006

Purpose

To boldly go where I have not gone before. In other words build the Firefox application by utilizing the necessary documentation provided by Mozilla and other resources.

Hardware

  • Intel® Core™2 Duo Processors @ 1.86GHz
  • 512 MB of RAM
  • 80 gig Samsung Hard Drive

Software

  • Windows XP Professional Service Pack 2
  • Visual Studio .Net 2003 with Visual C++ included
  • Cygwin installed with the following packages
    • ash -- UNIX-like command line interpreter shell (Base category)
    • coreutils -- GNU core utilities (includes fileutils, install, sh-utils, and textutils) (Base category) cvs -- concurrent versions system (Devel category)
    • diffutils -- file comparison utility (Base category)
    • findutils (Base category)
    • gawk -- pattern matching language (Base and Interpretors categories)
    • grep -- text search tool (Base category)
    • libiconv -- character set conversion (Devel category)
    • make 3.80 (not 3.81!) -- dependency analyzer for software builds (Devel category)
    • patchutils -- a small collection of programs that operate on patch files (Devel category)
    • perl -- a scripting language used to control parts of the build (Interpreters category)
    • sed -- a search and replace language (Base category)
    • unzip -- zip file extraction (Archive category)
    • zip -- zip file creation (Archive category)
  • moztools
    • package contains binaries and libraries necessary to build mozilla
  • CVS
    • source control system used by Mozilla. Downloading the tar balls from Mozilla’s FTP sites can be used also for obtaining the FireFox source code.
  • Windows Server 2003 SP1 Platform SDK
  • NSIS
  • make 3.80 tar package

Steps to Build FireFox

  1. Take time to read the Windows Build Prerequsites Web Page [ http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites]
  2. Download and installed Windows Server 2003 SP1 Platform SDK
  3. Make sure the Visual C++ module for Visual Studio 2003 or 2005 is installed if not download it from the acs.senecac.on.ca website.
  4. Install NSIS
  5. Install Cygwin(GNU Tools for Microsoft Windows) and download the packages( Please see the for the list
  6. Follow the link on the Windows Build Preq and download make-3.80-1.tar.bz2
  7. Extract the make.exe from the package and replace the make.exe that came with Cygwin
  8. Download and look at the Cygwin.bat file from the Windows Build Prerequsites web page.
    1. Change VCVARS=C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat to point to C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\bin\vcvars32.bat if you are using Visual Studio 2003
    2. Look at the MOZTOOLS variable and where it is pointing to
    3. Install the moztools package in that directory
    4. rename %CYGWINBASE%\bin\link.exe to glink.exe or any other name. This will prevent an error message "incremental linker version does not match the compiler suite version" at compile time.
    5. make the c:\proj folder. This will contain the source and object files that will be generated from the build and the checkout that will be executed later on.
    6. Execute the cygwin batch file (cygwin.bat) using cmd.exe. It successful a cygwin window will open with a prompt.
    7. Once at the prompt check to see that it can access the c:\proj folder. Type c: enter and then cd proj. If this directory
    8. Next type cvs logon
    9. You should see a prompt with your computer name.
    10. Type anonymous as the password.
    11. Before a build the code needs to be checked out to make sure that it has not been damaged in anyway.
    12. At the prompt enter: cvs co mozilla/browser/config mozilla/client.mk and a mozilla sub folder will be created inside the proj folder
    13. go to the mozilla folder: cd mozilla
    14. Create a file named .mozconfig using notepad or someother editor and place it in the mozilla directory. The contents for this file can be obtained from the Configure Build FireFox Options page at the Mozzilla.org developer center[ http://developer.mozilla.org/en/docs/Configuring_Build_Options#Firefox_Optimized_Static]. The last line of the .mozconfig file disables the installer which will makes NSIS unnecessary. If this line is missing or omitted then NSIS must be installed within it's own directory and not the bin directory. ## This must be added to the path.
    15. Download the source files by typing make -f client.mk checkout at the prompt
    16. To compile the source type make -f client.mk build

Problems I Encountered Along The Way

The first problem I had was trying to start the project. Normally I am use to the instructions being in one document. This time I had to look for multiple sources. In the Windows Build Prerequisite page [ http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites]I had a choice in using CVS or the tar files to build the firefox application. I first tried to download the tar files of the FireFox source. The problem was that I could not make heads or tails of it.

The next problem that I had was when I tried to log onto the CVS using Cygwin I got the error message telling me that the CVS root has not been specified. I followed the instructions when it came to issuing the command from the Mozilla build page which was cvs -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/browser/config/mozconfig

Solutions

The solution to this problem came in the form of Sherman who directed me to read Dave Humphries Guide to building FireFox and Elizabeth Chak's page involving the instructions. Apparently I was suppose to use CVS.

The solution to the root problem turned out to be I was missing a few lines in my batch file Cygwin.bat. I found this out while checking out Elizabeth's page. SET CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot SET CVS_RSH=ssh

With regards to the make checkout and the make buld commands I followed Sherman's advice and Liz's instructions from her page.

FireFox Build Screenshot

Firefox build about.PNG

Conclusion

The building of FireFox for me has been a rewarding experience. It has broadened my understanding of compiling in linux like envronments. It has exposed me to different software and many other resources I would not think to use in programming. I am looking forward to my next open source experience.


Lessons Learned

I learned how to use and edit a wiki. I learned about Cygwin and how to download packages using CVS

Contributors

Dave Humphrey (dave or humph)

Sherman Fernandes (sjfern)

Liz Chak (elichak)


References

Windows Build Prerequisite page [ http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites]

FireFox Options Page at the Mozzilla.org developer Center[ http://developer.mozilla.org/en/docs/Configuring_Build_Options#Firefox_Optimized_Static]

Humphrey, David -Building Firefox on Win32

Chak, Liz - Whose page was very helpful when I encountered the compile errors. Sherman Fernandes (sjfern) - His advice was invaluable whenever I got stuck with a problem.