Mobile/Build/Windows Mobile PrepForBuild
- 1 Preparing To Build XULRunner and Fennec For Windows Mobile
Preparing To Build XULRunner and Fennec For Windows Mobile
Here is a big-picture view of the steps needed to prepare a new PC for building the Windows Mobile Fennec and/or a Windows Mobile XULRunner application.
XULRunner is a cross-platform, general execution environment which can be customized for creating web browsers and other software. FireFox and Thunderbird both use the XULRunner executable on Windows desktops.
Fennec is a scaled-down browser intended for mobile devices, such as Windows Mobile handsets.
These steps need be done only once per PC:
- Install Visual Studio
- Install Windows Mobile 6 Professional SDK
- Install Windows Mobile 6.1 Localized Emulator Images
- Install Mozilla Build Tools
- Turn On Mercurial Patch Queue Extension
- OPTIONAL Download and Install Latest Mercurial
Install Visual Studio
As of February 2009, only Visual Studio 2005 (also known as Visual Studio 8, or VS8) and Visual Studio 2008 (also known as Visual Studio 9, or VS9) are supported for building Windows Mobile versions of XULRunner and Fennec.
Visual Studio 2008 Express Edition does NOT work for building XULRunner or Fennec for Windows Mobile. The Windows Mobile SDK Installer fails with only Visual Studio 2008 Express installed.
You will need to install one of these two Visual Studio Professional editions before installing any Windows Mobile specific software.
You can get the Microsoft Visual Studio Professional software from the Microsoft Developer Network.
Extra Note - the main developers for Windows Mobile all use VS9 Pro, so you can decide which Visual Studio version gets used the most.
Install Windows Mobile 6 Professional SDK
Then you need to install the Windows Mobile 6 Professional SDK (WM6 Pro SDK).
To resolve dependencies in the installation of the Windows Mobile 6 Professional SDK, you might need to install some extra software.
In this case, the WM6 Pro SDK Installation program will tell you what software you need to install.
Install Windows Mobile 6.1 Localized Emulator Images
Download and install the Windows Mobile 6.1 Professional Localized Emulator Images.
You NEED to install the WM6.1 Emulator Images, because Microsoft fixed something in between 6.0 and 6.1 - so now the specification of memory size via the Emulator Options dialog box works.
Also, the Emulator built into Visual Studio 2005 / VS8 does not work for mapping a local directory on your PC into the Emulator's \Storage Card (or \Storage Card2).
The Emulator built into Visual Studio 2008 / VS9 works better, but still has intermittent problems with mapping a local directory.
The WM6.1 Emulator Images install fixes BOTH VS8's and VS9's mapping of a local directory into your Emulator as a Shared Directory.
SO - If you want to debug via Emulator, you NEED the Windows Mobile 6.1 Emulator Images.
Bottom Line - use VS8 Pro or VS9 Pro AND WM6.1 Emulator Images and do not worry about whether you are going to debug in an Emulator or on a device.
Install Mozilla Build Tools
Download and install the latest version of Windows Mozilla Build Setup.
The Mozilla Build package for Windows 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.
Here are a number of interesting links to learn more about Mercurial (or, hg as everyone calls it).
Mercurial Basics - read every word of this document!
Turn On Mercurial Patch Queue Extension
Summary: Because Mercurial Patch Queues (MQ) is implemented as an extension, you must explicitly enable before you can use it. You don’t need to download anything; MQ ships with the standard Mercurial distribution.
This can be accomplished by adding a .hgrc file to your home directory.
You can find your home directory by running the c:\mozilla-build\start-msvc9.bat (or start-msvc8.bat) batch file, and issuing these commands:
$ cd ~ $ pwd Your home directory is also set into an environment variable $HOME. To find your home directory you could also issue the command $ echo $HOME
The contents of your .hgrc file should be as follows:
[ui] username = Your Real Name <firstname.lastname@example.org> merge = internal:merge [extensions] hgext.mq = [defaults] commit = -v [diff] git = 1 showfunc = 1 unified = 8
This $HOME\.hgrc (or $HOME\Mercurial.ini) file does several things:
(1) Sets up your username for Mercurial
(2) Sets up your merge to use the Mercurial built-in merge
(3) Gives verbose information on any HG COMMIT operations you do
(4) Sets the DIFF options to be GIT unified format, with 8 lines of context, and each block lists the function name closest to the modification spot.
This is a very strongly suggested practice for developing in the Mozilla ecosphere.
Mercurial patch queues make it very easy to try out changes, save the changes in a series of patches, then remove and/or apply those changes quickly.
While the learning curve can be tough on both Mercurial and Mercurial Patch Queues, the tools do help development by distributing repository control.
OPTIONAL Download and Install Latest Mercurial
NOTE: Mozilla Build Setup version 1.3 includes a slightly stale version of Mercurial (version 1.0.1+20080525).
The latest Mercurial has a version number of 1.1.1.
You can try updating to the latest version of Mercurial if you have troubles with hg.exe
The latest Mercurial is downloadable directly from Selenic's Web Site.
In order to use the latest Mercurial, you have two basic choices:
(1) Remove the c:/mozilla-build/hg directory, and replace it with the contents of C:/Program Files/Mercurial after you have installed the latest download from Selenic.
(2) Go into c:/mozilla-build/msys/etc/profiles.d/profile-extrapaths.sh and modify the /c/mozilla-build/hg directory to say /c/Program Files/Mercurial