Difference between revisions of "Assignment 1 paul"
(34 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | |||
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. | 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. | ||
Line 6: | Line 7: | ||
Here are the steps that I took to build Firefox under Windows with Visual Studio 2005. | Here are the steps that I took to build Firefox under Windows with Visual Studio 2005. | ||
− | |||
− | |||
− | |||
− | Step 2: Install | + | <b><font style="font-size:120%"> Step 1: </font></b> |
+ | Install Visual Studio .NET Professional 2005 by default. | ||
+ | |||
+ | <b><font style="font-size:120%"> Step 2: </font></b> | ||
+ | Install | ||
[http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 GNU Tools for Microsoft Windows (Cygwin)] | [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 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 | + | . 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 [http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/moztools-static.zip | + | <b><font style="font-size:120%"> Step 3: </font></b> |
+ | Download and Extract the [http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/moztools-static.zip Static moztools libraries] for Visual C++ to directory “C:\proj\moztools”. | ||
− | Step 4: Create a build script called | + | <b><font style="font-size:120%"> Step 4: </font></b> |
+ | Create a build script called '''buildenv.bat''' containing following content in folder '''”C:\proj\”''' to setup the appropriate environment variables and paths. | ||
+ | |||
+ | {| style="background:black; color:white" width="600" | ||
+ | |- | ||
+ | | C:\> cd c:\proj | ||
+ | |- | ||
+ | | C:\proj > copy con buildenv.bat | ||
+ | |} | ||
<pre> | <pre> | ||
Line 50: | Line 61: | ||
</pre> | </pre> | ||
− | |||
− | C:\proj\mozilla> copy con . mozconfig | + | <b><font style="font-size:120%"> Step 5: </font></b> |
+ | Create a text file named .mozconfig containing following content in “C:\proj\mozilla” from command line. | ||
+ | |||
+ | {| style="background:black; color:white" width="600" | ||
+ | |- | ||
+ | | C:\> cd c:\proj | ||
+ | |- | ||
+ | | C:\proj> md mozilla | ||
+ | |- | ||
+ | | C:\proj> cd mozilla | ||
+ | |- | ||
+ | | C:\proj\mozilla> copy con .mozconfig | ||
+ | |} | ||
<pre> | <pre> | ||
Line 67: | Line 89: | ||
ac_add_options --enable-debug | ac_add_options --enable-debug | ||
− | # | + | # Disable build Windows installation file |
− | |||
− | |||
ac_add_options --disable-installer | ac_add_options --disable-installer | ||
</pre> | </pre> | ||
− | Step 6: Login to the mozilla CVS repository, using the password anonymous. | + | <b><font style="font-size:120%"> Step 6: </font></b> |
+ | Login to the mozilla CVS repository, using the password anonymous. | ||
− | C:\> cd c:\proj | + | {| style="background:black; color:white" width="600" |
− | C:\proj> buildenv.bat | + | |- |
− | C:\proj> cvs login | + | | C:\> cd c:\proj |
+ | |- style="background:black; color:white" width="600" | ||
+ | | C:\proj> buildenv.bat | ||
+ | |- | ||
+ | | C:\proj> cvs login | ||
+ | |} | ||
− | Step 7: Checkout the build script. | + | <b><font style="font-size:120%"> Step 7: </font></b> |
+ | Checkout the build script. | ||
− | C:\proj> cvs co mozilla/browser/config mozilla/client.mk | + | {| style="background:black; color:white" width="600" |
+ | |- | ||
+ | | C:\proj> cvs co mozilla/browser/config mozilla/client.mk | ||
+ | |} | ||
− | Step 8: | + | <b><font style="font-size:120%"> Step 8: </font></b> |
+ | Download the source file from CVS. | ||
− | C:\proj> cd mozilla | + | {| style="background:black; color:white" width="600" |
− | C:\proj\mozilla> make -f client.mk checkout | + | |- |
+ | | C:\proj> cd mozilla | ||
+ | |- | ||
+ | | C:\proj\mozilla> make -f client.mk checkout | ||
+ | |} | ||
− | Step 9: Build the Firefox from source | + | <b><font style="font-size:120%"> Step 9: </font></b> |
+ | Build the Firefox from source. | ||
− | C:\proj\ mozilla> make -f client.mk build | + | {| style="background:black; color:white" width="600" |
+ | |- | ||
+ | | C:\proj\ mozilla> make -f client.mk build | ||
+ | |} | ||
Line 110: | Line 149: | ||
== Resources == | == Resources == | ||
− | * [http://cs.senecac.on.ca/~david.humphrey/writing/firefox-win32-build.html | + | * [http://cs.senecac.on.ca/~david.humphrey/writing/firefox-win32-build.html Building Firefox on Win32 using Visual Studio .NET 2005] |
− | |||
− | |||
* [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 GNU Tools for Microsoft Windows (Cygwin)] | * [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 GNU Tools for Microsoft Windows (Cygwin)] | ||
− | * [http://gemal.dk/mozilla/build.html | + | * [http://gemal.dk/mozilla/build.html Build Mozilla Thunderbird/Firefox/Sunbird on Microsoft Windows] |
* [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites Windows Build Prerequisites] | * [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites Windows Build Prerequisites] |
Latest revision as of 22:12, 19 September 2006
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.
Contents
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:\> 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.