Thursday, July 9, 2009

How to compile and run thunderbird source code on Windows

Compiling thunderbird
1. Download all the required software's

2. Install Microsoft Visual Studio 6

3. To use Visual C++ 6, you must be sure that you have applied Visual Studio Service Pack 5 (http://msdn.microsoft.com/en-us/vstudio/aa718363.aspx) and the Visual C++ 6.0 Processor Pack (http://msdn.microsoft.com/en-us/vs2005/aa718349.aspx). (The processor pack is not available for Visual Studio Service Pack 6)

4. Dowload and Install Mozilla Build 1.3
The MozillaBuild package contains the other software prerequisites necessary for building Mozilla. This includes the MSYS build environment, Mercurial, CVS, Python, NSIS, and UPX, as well as optional/useful tools such as wget, autoconf-2.13, xemacs.

http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.3.exe

By default, the package installs to c:\mozilla-build. It is recommended to use the default path. The installer does not modify the Windows registry.

5. Run start-msvc6.bat in the c:\mozilla-build directory which will open up an application window with MINGW32 (referred to as MSYS).

Note: MSYS is a collection of GNU utilities such as bash, make, gawk and grep to allow building of applications and programs which depend on traditionally UNIX tools to be present. It is intended to supplement MinGW and the deficiencies of the cmd shell.

5. Now that the MSYS window is open (it will look something like command prompt), navigate your way back to the root c:\ .Once you are in c:\ do the following in the MSYS console window:
i) Make a new directory called proj, using the below command.
mkdir proj

ii) Navigate into proj directory
cd proj
Izhar@izhar /c/proj

iii) Download the latest Thunderbird(http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/latest/source/) tarball and extract it to a convenient location. This will create a mozilla folder, which is the root of the build tree.

iv) Copy folder mozilla into c:\proj\

v) Navigate into mozilla directory
cd mozilla
Izhar@izhar /c/proj/mozilla

vi) Create MOZ file ".mozconfig" which contains all the build options
# Options for client.mk.
mk_add_options MOZ_CO_PROJECT=mail
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/THUNDERBIRD

# Options for 'configure' (same as command-line options).
ac_add_options --enable-application=mail
ac_add_options --enable-debug
ac_add_options --disable-static
ac_add_options --disable-optimize
ac_add_options --disable-vista-sdk-requirements

( Note: for windows XP wpcapi.h is not supporting to overcome this issue we need to addd additional parameter in .mozconfig file
ac_add_options --disable-vista-sdk-requirements )

vii) Paste ".mozconfig" file into c:\proj\mozilla\

viii) Build the source code
make -f client.mk build MOZ_CO_PROJECT=mail

iv) Once the source code is built, you should have directory THUNDERBIRD. To run Thunderbird, run Thunderbird.exe located in c:\proj\mozilla\THUNDERBIRD\dist\bin

Enjoy ubuntu... ;)

No comments:

kunkun-laptop .... ;)