|resources:||Home Mailing List Installation Source Code Members Mini Forum Mozilla with cygwin HOWTO Screenshots|
BUILDING MOZILLA ON WIN32 WITH CYGWIN MINI HOWTO
This document reports how I built Mozilla on Win32 using the GNU compilers. I hope it can be of some help for you. THIS IS NOT AN OFFICIAL GUIDE NOR THE INFORMATION CONTAINED HERE ARE SUPPORTED OR ENDORSED BY THE MOZILLA FOUNDATION
My objective was to build Mozilla version 1.7.3 with cygwin. I decided to write this HOWTO because this task has revealed to be really difficult (I performed the same task on Linux with no trouble).
The main information source I used to perform the build is http://www.mozilla.org/build/win32.html, so this document could be a mere repetition of information already available there but here I expose the step-by-step what I did to get the build done.
The builder machine is the notebook Toshiba Portege 3500 with 512MB RAM, 1.33GHz CPU, and 4GB free disk. I strongly suggest to have at least 4GB free, in fact the build used more than 3GB in my disk (this amount could change depending on how you file system is fragmented). This is for the (default) full debug build. An optimized build only needs ¼ of that space.
Windows XP Tablet Edition
GETTING THE CODE
I got the code of Mozilla version 1.7.3 from http://www.mozilla.org/download-mozilla.html
I downloaded the bzipped2 tarball because is more compact. Then I created a new folder in my Win machine
To extract the files from the archive I used the cygwin shell (so if you don't have cygwin installed on your machine I strongly suggest to install it from http://www.cygwin.com/. It is compulsory to go on with this build)
I installed cygwin in:
Opening the cygwin shell you have a Unix view of the filesystem: for instance, the file
C:\cygwin1.5.11\home\davide\foois viewed in the shell as (notice the slashes)
/home/davide/fooAny path outside the cygwin root can be referenced too because the Windows directory
C:\is mapped in cygwin as
/cygdrive/cThus the installation directory of my codebase
C:\mozilla-src-1.7.3is visible in the cygwin shell under
/cygdrive/c/mozilla-src-1.7.3EXTRACTING MOZILLA SOURCE FILES
In the cygwin shell type:
cd /cygdrive/c/mozilla-src-1.7.3You can optionally remove the option 'v' which means verbose
tar -xvjf mozilla-source-1.7.3.tar.bz2
IMPORTANT: do not extract the code under /home/... The build fails!! (Although it is clearly stated in http://www.mozilla.org/build/win32.html I had stupidly ignored this reccomendation and I had troubles)
At this point you should have the complete tree.
INSTALLING DEVELOPMENT PACKAGES IN CYGWIN
The standard Cygwin setup is not sufficient to build Mozilla. As stated in http://www.mozilla.org/build/win32.html you must install also
- ash -- UNIX-like command line interpreter shell
- diffutils -- file comparison utility
- dos2unix (contained in
- gawk -- pattern matching language (Devel category)
- grep -- text search tool
- make -- dependency analyzer for software builds (Devel category)
- perl -- a scripting language used to control parts of the build (Interpreters category)
- sed -- a search and replace language
- unzip -- zip file extraction (Archive category)
- zip -- zip file creation (Archive category)
- gcc >= 3.2.2 (20030208)
- binutils >= 2.14.90 (20030807)
- w32api >= 2.4
- mingw-runtime >= 2.4
Get them from http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip . I unzipped this archive and run the install.bat setting the MOZ_TOOLS variable to c:\moztools. Then I run from the cygwin shell the commands:
cd /cygdrive/c/moztools/includeThis is needed to convert DOS line ending to Unix line ending
SETUP SOME ENVIRONMENTAL VARIABLES
To set variables I modified the file
bash --login -i
The file .mozconfig is used during the build and it must be stored in your home directory (actually you can also put it in your mozilla/ directory). In my case I created the file:
/home/davide/.mozconfigThe contents of my .mozconfig file are:
# basic mozconfig file with minimum requirements for MinGW gcc build
# the following options don't yet work under gcc-on-win32
LAUNCH THE BUILD
cd /cygdrive/c/mozilla-src-1.7.3/mozillaAt this point you should succeed and after a good amount of CPU cycles you have your build done.
make -f client.mk build_all_depend
PROBLEMS WITH THE NSINSTALL TOOL
My first attempt to build failed with a message like:
sh /home/default/mozilla/nsprpub/build/cygwin-wrapper nsinstall -m 444The problem here seems to be in the position of the tree. I moved the tree from /home/davide/... to /cygdrive/c/... and it worked.
nsinstall: \home\davide\mozilla\nsprpub\pr\include\md\_win95.cfg: No such
file or directory make: *** [export] Error 3
PROBLEMS WITH BINUTILS PACKAGE
The build seems to fail if you are using the last version of binutils (2.15.91). You have two options:
- applying a patch to the code:
- downgrading to 2.15.90
Although I applied the patch the build continued to fail. So I decided to downgrade binutils from 2.15.91 to version 2.15.90
with the cygwin setup and then the build succeeded.
To verify which version of binutils you have installed run the command:
also reported in https://bugzilla.mozilla.org/attachment.cgi?id=160885&action=diff
The patch is (lines which starts with '-' are removed, lines with '+' are added)
RCS file: /cvsroot/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp,v
retrieving revision 1.9
diff -u -r1.9 xptcinvoke_gcc_x86_unix.cpp
--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp 18 Apr 2004 14:18:18 -0000 1.9
+++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp 3 Oct 2004 02:08:49 -0000
@@ -134,7 +134,6 @@
".globl " SYMBOL_UNDERSCORE "_XPTC_InvokeByIndex\n\t"
- ".type " SYMBOL_UNDERSCORE "_XPTC_InvokeByIndex,@function\n"
".globl " SYMBOL_UNDERSCORE "XPTC_InvokeByIndex\n\t"
@@ -193,9 +192,7 @@
"movl %ebp, %esp\n\t"
- ".size " SYMBOL_UNDERSCORE "_XPTC_InvokeByIndex, . -" SYMBOL_UNDERSCORE "_XPTC_InvokeByIndex\n\t"
".size " SYMBOL_UNDERSCORE "XPTC_InvokeByIndex, . -" SYMBOL_UNDERSCORE "XPTC_InvokeByIndex\n\t"
Thanks to Neil for his comments.
Created by Davide Carboni (dcarboni AT (REMOVE) crs4 DOT it) on 21/10/2004
Sierra Trading Post