Difference between revisions of "User:Mckwan/Assignment1"

From CDOT Wiki
Jump to: navigation, search
(Problems)
 
(11 intermediate revisions by the same user not shown)
Line 12: Line 12:
  
 
==Software Requirements==
 
==Software Requirements==
# Install Visual Studio.NET 2005 using the default paths. Download it from ACS.
+
* Install Visual Studio.NET 2005 using the default paths. Download it from ACS.
 
+
* Install Cygwin following the instructions in http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites and install the require packages.
# Install Cygwin following the instructions in http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites and install the require packages.
 
 
<pre>
 
<pre>
 
ash -- UNIX-like command line interpreter shell (Base category)  
 
ash -- UNIX-like command line interpreter shell (Base category)  
Line 31: Line 30:
 
zip -- zip file creation (Archive category)  
 
zip -- zip file creation (Archive category)  
 
</pre>
 
</pre>
Create a directory C:\assignment1
+
* Create a directory C:\assignment1
Download and Extract Moztools to C:\assignment1\moztools  
+
* Download and Extract Moztools to C:\assignment1\moztools  
  
 
==Steps to Build Firefox==
 
==Steps to Build Firefox==
Configure environment variables by create a script called buildsetup.bat in C:\assignment1. (the following code from David's website)
+
* Configure environment variables by create a script called buildsetup.bat in C:\assignment1. (the following code from David's website)
@echo off
+
<pre>
 +
        @echo off
 +
 
 +
        rem --- CVS Setup
 +
        SET CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
 +
        SET CVS_RSH=ssh
  
rem --- CVS Setup
+
        rem --- Setup the paths to the moztools build libraries
SET CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
+
        set MOZ_TOOLS=C:\assignment1\moztools
SET CVS_RSH=ssh
+
        set GLIB_PREFIX=%MOZ_TOOLS%
 +
        set LIBIDL_PREFIX=%MOZ_TOOLS%
  
rem --- Setup the paths to the moztools build libraries
+
        rem --- Scrub these variables first
set MOZ_TOOLS=C:\assignment1\moztools
+
        SET INCLUDE=
set GLIB_PREFIX=%MOZ_TOOLS%
+
        SET LIB=
set LIBIDL_PREFIX=%MOZ_TOOLS%
+
        SET PATH=C:\;C:\windows\system32;C:\windows\system32\wbem
  
rem --- Scrub these variables first
+
        rem --- Prepend cygwin
SET INCLUDE=
+
        SET PATH=C:\cygwin\bin;%PATH%
SET LIB=
 
SET PATH=C:\;C:\windows\system32;C:\windows\system32\wbem
 
  
rem --- Prepend cygwin
+
        rem --- Setup VC8 compiler environment vars
SET PATH=C:\cygwin\bin;%PATH%
+
        CALL "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86
  
rem --- Setup VC8 compiler environment vars
+
        rem --- Add glib/libidl to build environment
CALL "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86
+
        SET PATH=%PATH%;%GLIB_PREFIX%;%GLIB_PREFIX%\bin
 +
        SET INCLUDE=%GLIB_PREFIX%\include;%INCLUDE%
 +
        SET LIB=%GLIB_PREFIX%\lib;%LIB%
  
rem --- Add glib/libidl to build environment
+
        rem --- moztools comes last after glib/libIDL
SET PATH=%PATH%;%GLIB_PREFIX%;%GLIB_PREFIX%\bin
+
        SET PATH=%PATH%;%MOZ_TOOLS%\bin
SET INCLUDE=%GLIB_PREFIX%\include;%INCLUDE%
+
</pre>
SET LIB=%GLIB_PREFIX%\lib;%LIB%
+
* Run buildsetup.bat in C:\assignment1.
 +
<pre> c:\assignment1> buildsetup </pre>
  
rem --- moztools comes last after glib/libIDL
+
* Login to the mozilla CVS repository in C:\assignment1, type anonymous as password when prompted.
SET PATH=%PATH%;%MOZ_TOOLS%\bin
+
<pre> C:\assignment1> cvs login </pre>
• Run buildsetup.bat in C:\assignment1.
+
* Check out the build script  
Login to the mozilla CVS repository in C:\assignment1, type anonymous as password when prompted.
+
<pre> C:\assignment1> cvs co mozilla/browser/config mozilla/client.mk
C:\assignment1> cvs login
 
Check out the build script  
 
C:\assignment1> cvs co mozilla/browser/config mozilla/client.mk
 
 
 
 
this will create mozilla directory within C:\assignment1
 
this will create mozilla directory within C:\assignment1
 +
</pre>
 +
* create a text file .mozconfig in mozilla (the following code from David's website)
 +
<pre>
 +
    # Building Firefox Trunk with Debugging
 +
    $topsrcdir/browser/config/mozconfig
  
• create a text file .mozconfig in mozilla (the following code from David's website)
+
    # Put all obj files in one place, not in src tree
# Building Firefox Trunk with Debugging
+
    mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-objdir
. $topsrcdir/browser/config/mozconfig
+
    ac_add_options --disable-static
 
+
    ac_add_options --enable-shared
# 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
+
    # Debug Build Setup Options
ac_add_options --disable-optimize
+
    ac_add_options --disable-optimize
ac_add_options --enable-debug
+
    ac_add_options --enable-debug
  
# I'm using Canvas for my work
+
    # I'm using Canvas for my work
ac_add_options --enable-canvas
+
    ac_add_options --enable-canvas
 +
</pre>
 
• Check out the source code from cvs
 
• Check out the source code from cvs
c:\assignment1\mozilla> make -f client.mk checkout
+
<pre>c:\assignment1\mozilla> make -f client.mk checkout </pre>
 
• Finally do the build
 
• Finally do the build
c:\assignment1\mozilla> make –f client.mk build
+
<pre>c:\assignment1\mozilla> make –f client.mk build
 
Once the build is successful, firefox 3.0 will be in c:\assignment1\mozilla\firefox-objdir\dist\bin
 
Once the build is successful, firefox 3.0 will be in c:\assignment1\mozilla\firefox-objdir\dist\bin
 +
</pre>
 
==Problems==
 
==Problems==
 +
My problem was failing to use the right verison of make to build firefox.
 +
<pre>    make[6]: *** [_xpidlgen/nsIContextMenuListener.h] Error 1
 +
    make[6]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir/embedding/browser/webBrowser'
 +
    make[5]: *** [export] Error 2
 +
    make[5]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir/embedding/browser'
 +
    make[4]: *** [export] Error 2
 +
    make[4]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir/embedding'
 +
    make[3]: *** [export_tier_gecko] Error 2
 +
    make[3]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir'
 +
    make[2]: *** [tier_gecko] Error 2
 +
    make[2]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir'
 +
    make[1]: *** [default] Error 2
 +
    make[1]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir'
 +
    make: *** [build] Error 2
 +
</pre>
 +
 +
[[User:elichak|elichak]] told me the site that has an older verison of cygwin.
 +
Download cygwinBasic [http://ptolemy.berkeley.edu/ptolemyII/ptII4.0/cygwinBasic.exe here] and install it to a temp directory. Then copy make from the temp directory and paste it into the Cygwin dirctory.
  
 
==Screenshot==
 
==Screenshot==
Coming soon
+
Screenshot of Mozilla Firefox 3.0 (Minefield) Help > About window:
 +
 
 +
[[Image:Minefield_help_about_windows_mckwan.JPG|Screenshot of Mozilla Firefox 3.0 (Minefield) Help > About window]]
  
 
==Conclusion==
 
==Conclusion==
I was expecting a lot of problems with the Mozilla Firefox build. This turned out to be better then I expected as building on Windows XP professional proved to be very easy and straight forward as long as you follow the instruction closely and make sure all the version are correct. The build problems I encountered allowed me to understand more about the build system and how the slightest version change can break the build.
+
I was expecting a lot of problems with the Mozilla Firefox build. It turned out to be better then I expected as building on Windows XP professional sp2 proved to be very easy and straight forward as long as you follow the instruction closely and make sure all the version are correct. The problem I encountered allowed me to understand that the slightest version change can break the build.

Latest revision as of 21:03, 19 September 2006

Introduction

The following are the steps I took to build Firefox on Windows XP SP2 using Visual Studio.NET 2005. My first step is to read the build prerequisites for Windows in the Mozilla developer site. Then search “how to build firefox on Windows” on Google. I follow the instructions on David Humphrey's website.

Hardware Configuration

Intel Pentium 4 Processor-M 1.8 MHz
1 GB RAM
60 gig Hard Drive
Windows XP sp2

Software Requirements

	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) 
  • Create a directory C:\assignment1
  • Download and Extract Moztools to C:\assignment1\moztools

Steps to Build Firefox

  • Configure environment variables by create a script called buildsetup.bat in C:\assignment1. (the following code from David's website)
        @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:\assignment1\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
  • Run buildsetup.bat in C:\assignment1.
 c:\assignment1> buildsetup 
  • Login to the mozilla CVS repository in C:\assignment1, type anonymous as password when prompted.
 C:\assignment1> cvs login 
  • Check out the build script
 C:\assignment1> cvs co mozilla/browser/config mozilla/client.mk
	
	this will create mozilla directory within C:\assignment1
  • create a text file .mozconfig in mozilla (the following code from David's website)
 
     # 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

     # I'm using Canvas for my work
     ac_add_options --enable-canvas

• Check out the source code from cvs

c:\assignment1\mozilla> make -f client.mk checkout 

• Finally do the build

c:\assignment1\mozilla> make –f client.mk build
Once the build is successful, firefox 3.0 will be in c:\assignment1\mozilla\firefox-objdir\dist\bin

Problems

My problem was failing to use the right verison of make to build firefox.

     make[6]: *** [_xpidlgen/nsIContextMenuListener.h] Error 1
     make[6]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir/embedding/browser/webBrowser'
     make[5]: *** [export] Error 2
     make[5]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir/embedding/browser'
     make[4]: *** [export] Error 2
     make[4]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir/embedding'
     make[3]: *** [export_tier_gecko] Error 2
     make[3]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir'
     make[2]: *** [tier_gecko] Error 2
     make[2]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir'
     make[1]: *** [default] Error 2
     make[1]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir'
     make: *** [build] Error 2

elichak told me the site that has an older verison of cygwin. Download cygwinBasic here and install it to a temp directory. Then copy make from the temp directory and paste it into the Cygwin dirctory.

Screenshot

Screenshot of Mozilla Firefox 3.0 (Minefield) Help > About window:

Screenshot of Mozilla Firefox 3.0 (Minefield) Help > About window

Conclusion

I was expecting a lot of problems with the Mozilla Firefox build. It turned out to be better then I expected as building on Windows XP professional sp2 proved to be very easy and straight forward as long as you follow the instruction closely and make sure all the version are correct. The problem I encountered allowed me to understand that the slightest version change can break the build.