130
edits
Line 16: | Line 16: | ||
Here is a big-picture view of the steps needed to prepare a new PC for debugging the Windows Mobile Fennec and/or a Windows Mobile ZULRunner application. | Here is a big-picture view of the steps needed to prepare a new PC for debugging the Windows Mobile Fennec and/or a Windows Mobile ZULRunner application. | ||
* Install Visual Studio 2008 Professional ( | * One-Time Setup, including: | ||
** Install Visual Studio 2008 Professional (VS9) or Visual Studio 2005 Professional (VS8) | |||
* Install Windows Mobile 6 Professional SDK | ** Install Windows Mobile 6 Professional SDK | ||
** Install Windows Mobile 6.1 Localized Emulator Images | |||
* Install Windows Mobile 6.1 Localized Emulator Images | ** Install Mozilla Build Tools | ||
** [Optional] Download and Install Latest Mercurial | |||
* Install Mozilla Build Tools | |||
* [Optional] Download and Install Latest Mercurial | |||
* Download Sources and Patch Queue | * Download Sources and Patch Queue | ||
Line 31: | Line 28: | ||
* Compile Everything | * Compile Everything | ||
* Prepare for Debugging | |||
* Start Debugging | |||
Still interested? OK, let's get started. | Still interested? OK, let's get started. | ||
==Setup== | |||
==One-Time Setup== | |||
You will only have to do this setup once. | You will only have to do this setup once. | ||
Line 53: | Line 55: | ||
===IMPORTANT NOTE=== | ===WM6.1 Emulator Images IMPORTANT NOTE=== | ||
(by wolfe in #wince) | (by wolfe in [irc://irc.mozilla.org/%23wince #wince IRC]) | ||
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. | |||
You | You will need to increase the amount of memory available in your chosen 6.1 Emulator (BEFORE you run the chosen 6.1 Emulator for the first time). Otherwise you'll receive "(e)", or "not enough storage is available to complete this operation". | ||
You can increase the amount of memory in your emulator by using the VS8 tools menu, options dialog box. | |||
Find the device tools | devices section, select your desired emulator, click on the properties... button, then press the Emulator Options... button | |||
Once you are looking at the Emulator Options dialog box, check the Specify RAM Size check box - and enter in 256 - the acceptable range for this number is from 1 to 256. | |||
BUT - BUT - BUT - 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). | |||
I have been told that 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. | |||
If you use VS9, you need a minimum of the Visual Studio 2008 Professional version, because the VS9 Express version does not allow the WinMobile 6 SDKs to be installed. | |||
Bottom Line - use VS8 Pro or VS9 Pro AND WM6.1 Emulator Images. | |||
==Downloading and Building== | ==Downloading and Building== | ||
These directions assume you have a '''c:\mozilla-build''' directory, | These directions assume you have created a '''c:\mozilla-build''' directory, | ||
created by downloading the | created by downloading and installing the | ||
[[http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.3.exe Windows Mozilla Build Setup version 1.3]]. | [[http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.3.exe Windows Mozilla Build Setup version 1.3]]. | ||
===Mercurial Version In Mozilla-Build version 1.3=== | ===Mercurial Version In Mozilla-Build version 1.3=== | ||
NOTE: As of 20-Nov-2008, Mozilla Build Setup version 1.3 includes a slightly stale version | NOTE: As of 20-Nov-2008, Mozilla Build Setup version 1.3 includes a slightly stale | ||
of Mercurial (version 1.0.1+20080525). The latest Mercurial has a version number of | version of Mercurial (version 1.0.1+20080525). The latest Mercurial has a version | ||
1. | number of 1.1+20081203. | ||
The latest Mercurial is downloadable directly from | The latest Mercurial is downloadable directly from [http://www.selenic.com/mercurial/wiki/index.cgi/Download Selenic's Web Site]. | ||
In order to use the latest Mercurial, you have two basic choices: | In order to use the latest Mercurial, you have two basic choices: | ||
Line 164: | Line 171: | ||
Thanks go out to Benjamin Smedbergs for this solution - [http://benjamin.smedbergs.us/blog/2008-06-05/getting-mozilla-central-with-limited-bandwidth/ Original Blog Posting Here] | Thanks go out to Benjamin Smedbergs for this solution - [http://benjamin.smedbergs.us/blog/2008-06-05/getting-mozilla-central-with-limited-bandwidth/ Original Blog Posting Here] | ||
===Setting Up Your MOZCONFIG File=== | ===Setting Up Your MOZCONFIG File=== | ||
Line 169: | Line 177: | ||
Building options are controlled by mozconfig, a master file within your top source directory (in our case, /c/hg/mozilla-central/mozconfig). | Building options are controlled by mozconfig, a master file within your top source directory (in our case, /c/hg/mozilla-central/mozconfig). | ||
'''Here is our current mozconfig for building a Debug XULRunner and Fennec for WinMobile:''' | ====VS9 Debug Build MOZCONFIG==== | ||
'''Here is our current VS9 mozconfig for building a Debug XULRunner and Fennec for WinMobile:''' | |||
''# Options for client.mk.'' | ''# Options for client.mk.'' | ||
''mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"'' | ''mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"'' | ||
''# Options for VS8 verses VS9 / Debug verses Release'' | |||
''# Debug/Non-Opt = ~28 MByte XUL.dll'' | |||
''# Debug/Opt = ~20 MByte XUL.dll'' | |||
''# Release/Opt = ~12 MByte XUL.dll'' | |||
''ac_add_options --enable-debug'' | |||
''#ac_add_options --disable-optimize'' | |||
''mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-wm6-dbg'' | ''mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-wm6-dbg'' | ||
''MIDL=/c/Program\ Files/Microsoft\ Visual\ Studio\ 9/VC/ce/bin/x86_arm/midl.exe'' | |||
''# mobile options'' | |||
''ac_add_app_options mobile --enable-application=mobile'' | |||
''ac_add_app_options mobile --with-libxul-sdk=../xulrunner/dist'' | |||
''# Disabling tests due to bug 454881'' | |||
''ac_add_options --disable-tests'' | |||
''#WINCE specific options'' | |||
''ac_add_options --disable-javaxpcom'' | |||
''ac_add_options --disable-plugins'' | |||
''ac_add_options --disable-accessibility'' | |||
''ac_add_options --disable-printing'' | |||
''ac_add_options --disable-oji'' | |||
''ac_add_options --disable-vista-sdk-requirements'' | |||
''ac_add_options --disable-updater'' | |||
''ac_add_options --disable-installer'' | |||
''ac_add_options --disable-xpinstall'' | |||
''ac_add_options --enable-image-decoders="png gif jpeg"'' | |||
''ac_add_options --disable-dbm'' | |||
''CROSS_COMPILE=1'' | |||
''CC=$topsrcdir/build/wince/tools/bin/arm-wince-gcc'' | |||
''CXX=$topsrcdir/build/wince/tools/bin/arm-wince-gcc '' | |||
''CPP=$topsrcdir/build/wince/tools/bin/arm-wince-gcc'' | |||
''LD=$topsrcdir/build/wince/tools/bin/arm-wince-link'' | |||
''AR=$topsrcdir/build/wince/tools/bin/arm-wince-lib'' | |||
''AS=$topsrcdir/build/wince/tools/bin/arm-wince-as'' | |||
''RC=$topsrcdir/build/wince/tools/bin/arm-wince-res'' | |||
''mk_add_options AR=@TOPSRCDIR@/build/wince/tools/bin/arm-wince-lib'' | |||
''ac_add_options --target=arm-wince'' | |||
''ac_add_options --enable-win32-target=WINCE'' | |||
''ac_add_options --enable-default-toolkit=cairo-windows'' | |||
''ac_add_options --with-wince-sdk="c:/program files/windows mobile 6 sdk/pocketpc/include/armv4i"'' | |||
====VS9 Release Build MOZCONFIG==== | |||
'''Here is our current VS9 mozconfig for building a non-debug XULRunner for WinMobile:''' | |||
''# Options for client.mk.'' | |||
''mk_add_options MOZ_BUILD_PROJECTS="xulrunner"'' | |||
''# Options for VS8 verses VS9 / Debug verses Release'' | |||
''# Debug/Non-Opt = ~28 MByte XUL.dll'' | |||
''# Debug/Opt = ~20 MByte XUL.dll'' | |||
''# Release/Opt = ~12 MByte XUL.dll'' | |||
''#ac_add_options --enable-debug'' | |||
''ac_add_options --enable-optimize'' | |||
''mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-wm6-rel'' | |||
''MIDL=/c/Program\ Files/Microsoft\ Visual\ Studio\ 9/VC/ce/bin/x86_arm/midl.exe'' | |||
''# Disabling tests due to bug 454881'' | |||
''ac_add_options --disable-tests'' | |||
''#WINCE specific options'' | |||
''ac_add_options --disable-javaxpcom'' | |||
''ac_add_options --disable-plugins'' | |||
''ac_add_options --disable-accessibility'' | |||
''ac_add_options --disable-printing'' | |||
''ac_add_options --disable-oji'' | |||
''ac_add_options --disable-vista-sdk-requirements'' | |||
''ac_add_options --disable-updater'' | |||
''ac_add_options --disable-installer'' | |||
''ac_add_options --disable-xpinstall'' | |||
''ac_add_options --enable-image-decoders="png gif jpeg"'' | |||
''ac_add_options --disable-dbm'' | |||
''CROSS_COMPILE=1'' | |||
''CC=$topsrcdir/build/wince/tools/bin/arm-wince-gcc'' | |||
''CXX=$topsrcdir/build/wince/tools/bin/arm-wince-gcc '' | |||
''CPP=$topsrcdir/build/wince/tools/bin/arm-wince-gcc'' | |||
''LD=$topsrcdir/build/wince/tools/bin/arm-wince-link'' | |||
''AR=$topsrcdir/build/wince/tools/bin/arm-wince-lib'' | |||
''AS=$topsrcdir/build/wince/tools/bin/arm-wince-as'' | |||
''RC=$topsrcdir/build/wince/tools/bin/arm-wince-res'' | |||
''mk_add_options AR=@TOPSRCDIR@/build/wince/tools/bin/arm-wince-lib'' | |||
''ac_add_options --target=arm-wince'' | |||
''ac_add_options --enable-win32-target=WINCE'' | |||
''ac_add_options --enable-default-toolkit=cairo-windows'' | |||
''ac_add_options --with-wince-sdk="c:/program files/windows mobile 6 sdk/pocketpc/include/armv4i"'' | |||
====VS8 Debug Build MOZCONFIG==== | |||
'''Here is our current VS8 mozconfig for building a Debug XULRunner and Fennec for WinMobile:''' | |||
''# Options for client.mk.'' | |||
''mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"'' | |||
''mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-wm6-dbg'' | |||
''# Options for VS8 verses VS9 / Debug verses Release'' | |||
''# Debug/Non-Opt = ~28 MByte XUL.dll'' | |||
''# Debug/Opt = ~20 MByte XUL.dll'' | |||
''# Release/Opt = ~12 MByte XUL.dll'' | |||
''ac_add_options --enable-debug'' | ''ac_add_options --enable-debug'' | ||
''ac_add_options --enable-optimize'' | ''#ac_add_options --enable-optimize'' | ||
''mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-wm6-dbg-vs8'' | |||
''MIDL=/c/Program\ Files/Microsoft\ Visual\ Studio\ 8/VC/ce/bin/x86_arm/midl.exe'' | |||
''# mobile options'' | ''# mobile options'' | ||
Line 205: | Line 323: | ||
''AR=$topsrcdir/build/wince/tools/bin/arm-wince-lib'' | ''AR=$topsrcdir/build/wince/tools/bin/arm-wince-lib'' | ||
''AS=$topsrcdir/build/wince/tools/bin/arm-wince-as'' | ''AS=$topsrcdir/build/wince/tools/bin/arm-wince-as'' | ||
''RC=$topsrcdir/build/wince/tools/bin/arm-wince-res'' | ''RC=$topsrcdir/build/wince/tools/bin/arm-wince-res'' | ||
''MIDL=/c/Program\ Files/Microsoft\ Visual\ Studio\ 8/VC/ce/bin/x86_arm/midl.exe'' | |||
''mk_add_options AR=@TOPSRCDIR@/build/wince/tools/bin/arm-wince-lib'' | ''mk_add_options AR=@TOPSRCDIR@/build/wince/tools/bin/arm-wince-lib'' | ||
Line 216: | Line 335: | ||
''ac_add_options --with-wince-sdk="c:/program files/windows mobile 6 sdk/pocketpc/include/armv4i"'' | ''ac_add_options --with-wince-sdk="c:/program files/windows mobile 6 sdk/pocketpc/include/armv4i"'' | ||
====VS8 Release Build MOZCONFIG==== | |||
'''Here is our current mozconfig for building a non-debug XULRunner for WinMobile:''' | '''Here is our current VS8 mozconfig for building a non-debug XULRunner for WinMobile:''' | ||
''# Options for client.mk.'' | ''# Options for client.mk.'' | ||
''mk_add_options MOZ_BUILD_PROJECTS="xulrunner"'' | ''mk_add_options MOZ_BUILD_PROJECTS="xulrunner"'' | ||
''mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-wm6'' | |||
''# Options for VS8 verses VS9 / Debug verses Release'' | |||
''# Debug/Non-Opt = ~28 MByte XUL.dll'' | |||
''# Debug/Opt = ~20 MByte XUL.dll'' | |||
''# Release/Opt = ~12 MByte XUL.dll'' | |||
''#ac_add_options --enable-debug'' | |||
''ac_add_options --enable-optimize'' | |||
''mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-wm6-rel-vs8'' | |||
''MIDL=/c/Program\ Files/Microsoft\ Visual\ Studio\ 8/VC/ce/bin/x86_arm/midl.exe'' | |||
''# Disabling tests due to bug 454881'' | ''# Disabling tests due to bug 454881'' | ||
Line 246: | Line 374: | ||
''AR=$topsrcdir/build/wince/tools/bin/arm-wince-lib'' | ''AR=$topsrcdir/build/wince/tools/bin/arm-wince-lib'' | ||
''AS=$topsrcdir/build/wince/tools/bin/arm-wince-as'' | ''AS=$topsrcdir/build/wince/tools/bin/arm-wince-as'' | ||
''RC=$topsrcdir/build/wince/tools/bin/arm-wince-res'' | ''RC=$topsrcdir/build/wince/tools/bin/arm-wince-res'' | ||
Line 256: | Line 383: | ||
''ac_add_options --with-wince-sdk="c:/program files/windows mobile 6 sdk/pocketpc/include/armv4i"'' | ''ac_add_options --with-wince-sdk="c:/program files/windows mobile 6 sdk/pocketpc/include/armv4i"'' | ||
Line 267: | Line 395: | ||
$ '''make -f client.mk build''' | $ '''make -f client.mk build''' | ||
==Notes After Building== | ==Notes After Building But Before Debugging== | ||
===Copy MOZCE_SHUNT.DLL=== | ===Copy MOZCE_SHUNT.DLL=== | ||
Line 310: | Line 438: | ||
* VS8 Emulator's shared-directory driver does not work properly. If you try to use the Emulator supplied with VS8, you will receive LOTS of random errors and faults. You might be able to eventually get a good run of the xulrunner application, but you will also get very frustrated at the same time. | * VS8 Emulator's shared-directory driver does not work properly. If you try to use the Emulator supplied with VS8, you will receive LOTS of random errors and faults. You might be able to eventually get a good run of the xulrunner application, but you will also get very frustrated at the same time. | ||
* To run / debug within a VS9 Emulator, you NEED to download and install the [[http://www.microsoft.com/downloads/details.aspx?familyid=3D6F581E-C093-4B15-AB0C-A2CE5BFFDB47&displaylang=en Microsoft Windows Mobile 6.1 Emulator Images]] | |||
* Installing Windows Mobile 6.1 Professional Localized Emulator Images fixes the issue with Emulator Shared Directory use, allowing you to point your Emulator at your BIN directory for running your executables without needing to copy the executables. | |||
* The WinMobile 6.1 Emulator Images installation also fixes a bug with setting the amount of memory within an Emulator Image. | |||
Line 319: | Line 454: | ||
* To run / debug within a VS9 Emulator, you NEED to download and install the [[http://www.microsoft.com/downloads/details.aspx?familyid=3D6F581E-C093-4B15-AB0C-A2CE5BFFDB47&displaylang=en Microsoft Windows Mobile 6.1 Emulator Images]] | * To run / debug within a VS9 Emulator, you NEED to download and install the [[http://www.microsoft.com/downloads/details.aspx?familyid=3D6F581E-C093-4B15-AB0C-A2CE5BFFDB47&displaylang=en Microsoft Windows Mobile 6.1 Emulator Images]] | ||
* The WinMobile 6.1 Emulator Images installation updates the Emulator, fixing a bug with setting the amount of memory within an Emulator Image. | * The WinMobile 6.1 Emulator Images installation updates the VS9 Emulator, fixing a bug with setting the amount of memory within an Emulator Image. | ||
* The main people working on WinMobile use VS9 to run / debug in the emulator / debug on-device. | |||
===Visual Studio Windows Mobile Emulator Images=== | |||
To run / debug xulrunner and fennec, you will need to increase the amount of memory available to the WinMobile 6.1 Emulator Image in which you are running. | |||
To increase the amount of memory available to your Windows Mobile 6.1 Localized Emulator Image, do the following within VS9: | |||
* Pull down the Tools menu | |||
* Select the Options... menu item | |||
* Find the Device Tools section in the list on the left hand side | |||
* Find and select the Devices sub-section | |||
* Find and select the desired Emulator Image | |||
* Press the Properties... button | |||
* Press the Emulator Options... button | |||
* Check the Specify RAM Size checkbox | |||
* Enter a number greater than 192 (and less than or equal to 256) into the edit box. | |||
* Press OK to close the Emulator Properties dialog box | |||
* Press OK to close the Emulator Image dialog box | |||
* Press OK to close the Options dialog box | |||
* When you start up your Emulator Image, verify that you have the RAM you specified in the Emulator Properties dialog box. | * When you start up your Emulator Image, verify that you have the RAM you specified in the Emulator Properties dialog box. | ||
Line 341: | Line 480: | ||
* If your Emulator Image does not have the RAM you specified, you may need to make a new copy of the Emulator in order to correctly specify the RAM size available to your Emulator Image. | * If your Emulator Image does not have the RAM you specified, you may need to make a new copy of the Emulator in order to correctly specify the RAM size available to your Emulator Image. | ||
==Setting Up MyBrowser== | ==Setting Up MyBrowser== | ||
Line 441: | Line 579: | ||
# This is an addition to get the shim cross-compile build tools into | # This is an addition to get the shim cross-compile build tools into | ||
# our path. - jvw 24-Apr-08 | # our path. - jvw 24-Apr-08 | ||
export PATH="$PATH:/c/mozilla | export PATH="$PATH:/c/hg/mozilla-central/build/wince/tools/bin" | ||
This sets up my HG.EXE path, as well as the path to my WinCE build tools (arm-wince-as.exe, arm-wince-gcc.exe, arm-wince-lib.exe, and arm-wince-link.exe) | This sets up my HG.EXE path, as well as the path to my WinCE build tools (arm-wince-as.exe, arm-wince-gcc.exe, arm-wince-lib.exe, and arm-wince-link.exe) |
edits