recently we wanted to download compile Mozilla Thunderbird source on windows as we were planning to write a extension a small utility after a R&D we were able to compile the source code i thought of writing in my site so that others like me can get benefited from this post below are the steps on how to do it
Download all the required software's
--> Download and install Visual Studios 2005 (referred to as VC8 on Mozilla sites). you can also download visual studio express editon which is free which has limited tools
--> Then download and install the Mozilla Build Package 1.1 from the below mentioned link.
http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.1.exe
The package should install everything into c:\mozilla-build directory by default.
--> Once these two things are done, run the
start-msvc71.bat (if you have VC.NEt)
start-msvc8.bat (if you have VC 2005)
start-msvc9.bat (if you have VC 2008)
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.
Downloading source code and making ready to compile
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:
a. Make a new directory called proj, using the below command.
mkdir proj
b. Navigate into proj directory.
cd proj
c. Open a connection with mozilla cvs server, with the below mentioned command.
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk
d. Navigate into the new mozilla directory that was created by the cvs.
cd mozilla
e. Download the source code from CVS.
make -f client.mk checkout MOZ_CO_PROJECT=mail.
Note: Instead of “ mail”, we can give
browser( to download firefox source code )
suite( to download SeaMonkey source code)
calendar( to download sunbird source code)
minimo( to download source code of standalone browser for small devices)
camino( the native browser for macintosh)
all( check out source code for all the above projects ,plus some other utilities)
Create MOZ file ".mozconfig" which contains all the build options
Once all the source code is downloaded. Create a ".mozconfig" file in the c:\proj\mozilla directory and fill it with your build options.
# Options for client.mk.
mk_add_options MOZ_CO_PROJECT=mail
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
# 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
[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
]
Once the MOZ file is created and pasted in the thunderbird source code directory
--> make -f client.mk build MOZ_CO_PROJECT=mail
the above statements will build the source code
Final Step is to Creating the Installer
Once the source code is built, hopefully with no errors, you should have a directory called "obj-i686-pc-mingw32" or something similar. To run Thunderbird, run Thunderbird located in c:\proj\mozilla\obj-i686-pc-mingw32\dist\bin
If you would like to make an installer, you can type make installer in the c:\proj\mozilla\obj-i686-pc-mingw32 directory.
if any reader finds any mistake in the above steps or if there is still better way to achieve this please let us know

2 comments:
Hi,
this line might confuse people:
make -f client.mk checkout MOZ_CO_PROJECT=mail.
The period at the end is not part of the command.
Hi,
Thanks a lot for sharing your experience!!!
Post a Comment