Mobile/Build/Windows Mobile Build Instructions: Difference between revisions

From MozillaWiki
< Mobile‎ | Build
Jump to navigation Jump to search
No edit summary
(New Instructions For Building HG WinCE XULRunner)
Line 1: Line 1:
Setup:
Windows Mobile Build Instructions


You will only have to do this once.


Follow the instructions [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites here] to setup a window development environment.  Only VC8 is supported.
==Overview==
This page describes the commands for building the latest version of the Windows Mobile XULRunner application using Visual Studio 2005, Mercurial HG, and MingW32.


You must also [http://www.selenic.com/mercurial/wiki/index.cgi/BinaryPackages install] hg and [http://hgbook.red-bean.com/hgbookch12.html#x16-26700012 turn on] the mercurial queues extension.  hg.exe needs to be in your path.


Then you need to [http://www.microsoft.com/downloads/details.aspx?familyid=06111A3A-A651-4745-88EF-3D48091A390B&displaylang=en install] the Windows Mobile 6 Standard SDK.  You might to install some extra software to resolve dependencies.
==Setup==


You will only have to do this setup once.


----
Follow the instructions [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#MozillaBuild here] to setup a window development environment. 


directions:
Only Visual Studio 8 (also known as Visual Studio 2005) is currently supported. 


hg clone http://hg.mozilla.org/users/blassey_mozilla.com/unicode/
Builds are currently done inside a MINGW32 window.


cd unicode/.hg
You must also [http://www.selenic.com/mercurial/wiki/index.cgi/BinaryPackages install hg] and [http://hgbook.red-bean.com/hgbookch12.html#x16-26700012 turn on the mercurial queues extension].  hg.exe needs to be in your path.


hg clone http://hg.mozilla.org/users/blassey_mozilla.com/unicode-patches/ patches
Then you need to [http://www.microsoft.com/downloads/details.aspx?familyid=06111A3A-A651-4745-88EF-3D48091A390B&displaylang=en install] the Windows Mobile 6 Standard SDK.  You might need to install some extra software to resolve dependencies.


cd ../


wget http://people.mozilla.org/~blassey/mozconfig
==Downloading and Building==


python client.py checkout
These directions assume you have a '''c:\mozilla-build''' directory:


hg qpush -a
Run the batch file '''C:\mozilla-build\start-msvc8.bat'''
    NOTE: This will setup and open a MingW32 command prompt.
          All further commands are to be run inside MingW32.
$ '''cd /c/mozilla'''
$ '''hg clone http://hg.mozilla.org/users/blassey_mozilla.com/unicode'''
$ '''cd unicode'''
$ '''wget http://people.mozilla.org/~blassey/mozconfig'''
$ '''export PATH=$PATH:/c/mozilla/unicode/build/wince/tools/vs8ppc2003arm'''


export PATH=$PATH:<path-to-unicode>/build/wince/tools/vs8ppc2003arm
Make sure the WCE_* defines in
/c/mozilla/unicode/build/wince/tools/vs8ppc2003arm/toolspath.h
reflect your Visual Studio and Windows Mobile installation paths


Make sure the WCE_* defines in <path-to-unicode>/build/wince/tools/vs8ppc2003arm/toolspath.h reflect your Visual Studio and Windows Mobile installation paths
$ '''python client.py checkout'''
$ '''rm -rf nsprpub'''
$ '''hg clone http://hg.mozilla.org/users/blassey_mozilla.com/index.cgi/nspr-wm nsprpub'''
$ '''make -f client.mk build'''


wget http://people.mozilla.org/~blassey/nspr_patch


cat nspr_patch | patch -p0
This will build a debug version of XULRunner.exe.  As of now, this debug version of xulrunner.exe experiences two exceptions in XPCONNECT upon starting MyBrowser.


make -f client.mk build


----
==Setting Up MyBrowser==


This will build xulrunner.  As of now, it crashes on start up.
A simple XULRunner application, MyBrowser, is used to test the XULRunner code.
 
[http://benjamin.smedbergs.us/xulrunner/mybrowser-0.2.2.xulapp Download the MyBrowser Application using this link.]
 
The XULApp file is a ZIP file with a number of files and directoriesFurther explanation of XULRunner and the XULApp format can be found [http://developer.mozilla.org/en/docs/Getting_started_with_XULRunner here.]
 
'''rename mybrowser-0.2.2.xulapp mybrowser-0.2.2.xulapp.zip'''
Unzip mybrowser-0.2.2.xulapp.zip into its own subdirectory,  
  while preserving it's ZIP file directory structure. 
'''rename mybrowser-0.2.2.xulapp mybrowser'''
'''copy -r mybrowser c:\mozilla\unicode\objdir-smartphone-debug-noopt\dist\bin'''
 
 
==Setting Up For Debugging MyBrowser==
 
You can debug the MyBrowser XULapp from within Visual Studio by using the WinCE shunt Visual Studio Project, and adjusting the deployment device and executable to be run.
 
1. Open Visual Studio 2005 (Visual Studio 8) Integrated Development Environment (IDE)
2. Open the solution c:\mozilla\unicode\build\wince\shunt\build\vs8\mozce_shunt_static.sln
3. In the Solution Explorer, '''right mouse click on the mozce_shunt_static project'''
4. Select the '''Properties''' pop-up menu item
5. Under the configuration properties, highlight the '''Debugging''' section
6. Make the selected '''Deployment Device''' be '''"Windows Mobile 6 Standard Emulator"'''
7. Press the '''Apply''' button if necessary to save your new selection
8. Under the configuration properties, highlight the '''Debugging''' section
9. For '''Remote Executable''', enter '''\Storage Card\bin\xulrunner.exe'''
10. For '''Command Arguments''', enter '''mybrowser\application.ini'''
11. Press the '''Apply''' button if necessary to save your new selection
12. Close the Project Properties dialog box
 
 
==Debugging MyBrowser==
 
You are now ready to begin debugging your XULRunner build.
 
1. From the Visual Studio 2005 '''Build''' menu, select the '''Deploy Solution''' menu item
2. Wait for the Windows Mobile 6 Standard Emulator has start
3. In the Emulator's '''File''' menu, select the '''Configure...''' menu item
4. Press the '''...''' button for the Shared Folder edit box
5. Select the '''c:\mozilla\unicode\objdir-smartphone-debug-noopt\dist''' directory
6. Close the Emulator Properties dialog box by pressing the '''OK''' key
7. In the Visual Studio 2005's '''Debug''' menu, select the '''Start Debugging''' menu item
You should now see the Visual Studio begin a debugging session of XULRunner loading the MyBrowser XULApp.
 
 
==Other Tips==
 
'''1. Color scheme for MingW32 Command Line Prompt'''
 
I hated the default color scheme for the command prompt under MingW32 - so I changed it.  Find the file c:\mozilla-build\msys\etc\profile, and edit the lines (toward the bottom) which export PS1, and make them say:
 
export PS1='\[\033]0;$MSYSTEM:\w\007
\033[34m\]\u@\h \[\033[31m\w\033[0m\]
$ '
 
This changed the directory color to something I could actually see against a white background.
 
 
'''2. MingW32 Handling Spaces In Full Filename'''
 
MingW32 profile-sshagent.sh does not handle "C:\Documents and Settings" as a base for my $HOME directory (WinXP's default). 
 
I fixed that trouble by changing c:\mozilla-build\msys\etc\profile.d\profile-sshagent.sh to read this:
 
export SSH_ENV="$HOME/.ssh/environment"
export SSH_ENV_1=`echo $SSH_ENV | sed 's/ /\\\\ /g'`
function start_agent {
  ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV"
  chmod 600 "$SSH_ENV"
  . "$SSH_ENV" > /dev/null
  ssh-add;
}
if [ -f "${SSH_ENV_1}" ]; then
  . ${SSH_ENV} > /dev/null
  ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
    start_agent;
  }
else
  start_agent;
fi
 
I am certain there is a more elegant way of accomplishing this hack - I just know that these lines work for me.
 
 
'''3. Further Setting Up MingW32 Path'''
 
I get annoyed with continually adding the path to the Mercurial HG.EXE, as well as continually adding the path to the build's wince tools directory. 
 
So I created a c:\mozilla-build\msys\etc\profile.d\profile-setup-hg.sh file, containing:
 
#!/bin/sh
export PATH="$PATH:/c/progra~1/Mercurial"
# This is an addition to get the shim cross-compile build tools into
# our path. - jvw  24-Apr-08
export PATH="$PATH:/c/mozilla/unicode/build/wince/tools/vs8ppc2003arm"
 
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)

Revision as of 01:51, 21 May 2008

Windows Mobile Build Instructions


Overview

This page describes the commands for building the latest version of the Windows Mobile XULRunner application using Visual Studio 2005, Mercurial HG, and MingW32.


Setup

You will only have to do this setup once.

Follow the instructions here to setup a window development environment.

Only Visual Studio 8 (also known as Visual Studio 2005) is currently supported.

Builds are currently done inside a MINGW32 window.

You must also install hg and turn on the mercurial queues extension. hg.exe needs to be in your path.

Then you need to install the Windows Mobile 6 Standard SDK. You might need to install some extra software to resolve dependencies.


Downloading and Building

These directions assume you have a c:\mozilla-build directory:

Run the batch file C:\mozilla-build\start-msvc8.bat
   NOTE: This will setup and open a MingW32 command prompt.
          All further commands are to be run inside MingW32.

$ cd /c/mozilla

$ hg clone http://hg.mozilla.org/users/blassey_mozilla.com/unicode

$ cd unicode

$ wget http://people.mozilla.org/~blassey/mozconfig

$ export PATH=$PATH:/c/mozilla/unicode/build/wince/tools/vs8ppc2003arm

Make sure the WCE_* defines in /c/mozilla/unicode/build/wince/tools/vs8ppc2003arm/toolspath.h reflect your Visual Studio and Windows Mobile installation paths

$ python client.py checkout

$ rm -rf nsprpub

$ hg clone http://hg.mozilla.org/users/blassey_mozilla.com/index.cgi/nspr-wm nsprpub

$ make -f client.mk build


This will build a debug version of XULRunner.exe. As of now, this debug version of xulrunner.exe experiences two exceptions in XPCONNECT upon starting MyBrowser.


Setting Up MyBrowser

A simple XULRunner application, MyBrowser, is used to test the XULRunner code.

Download the MyBrowser Application using this link.

The XULApp file is a ZIP file with a number of files and directories. Further explanation of XULRunner and the XULApp format can be found here.

rename mybrowser-0.2.2.xulapp mybrowser-0.2.2.xulapp.zip

Unzip mybrowser-0.2.2.xulapp.zip into its own subdirectory, 
  while preserving it's ZIP file directory structure.  

rename mybrowser-0.2.2.xulapp mybrowser

copy -r mybrowser c:\mozilla\unicode\objdir-smartphone-debug-noopt\dist\bin


Setting Up For Debugging MyBrowser

You can debug the MyBrowser XULapp from within Visual Studio by using the WinCE shunt Visual Studio Project, and adjusting the deployment device and executable to be run.

1. Open Visual Studio 2005 (Visual Studio 8) Integrated Development Environment (IDE)

2. Open the solution c:\mozilla\unicode\build\wince\shunt\build\vs8\mozce_shunt_static.sln

3. In the Solution Explorer, right mouse click on the mozce_shunt_static project

4. Select the Properties pop-up menu item

5. Under the configuration properties, highlight the Debugging section

6. Make the selected Deployment Device be "Windows Mobile 6 Standard Emulator"

7. Press the Apply button if necessary to save your new selection

8. Under the configuration properties, highlight the Debugging section

9. For Remote Executable, enter \Storage Card\bin\xulrunner.exe

10. For Command Arguments, enter mybrowser\application.ini

11. Press the Apply button if necessary to save your new selection

12. Close the Project Properties dialog box


Debugging MyBrowser

You are now ready to begin debugging your XULRunner build.

1. From the Visual Studio 2005 Build menu, select the Deploy Solution menu item

2. Wait for the Windows Mobile 6 Standard Emulator has start

3. In the Emulator's File menu, select the Configure... menu item

4. Press the ... button for the Shared Folder edit box

5. Select the c:\mozilla\unicode\objdir-smartphone-debug-noopt\dist directory

6. Close the Emulator Properties dialog box by pressing the OK key

7. In the Visual Studio 2005's Debug menu, select the Start Debugging menu item

You should now see the Visual Studio begin a debugging session of XULRunner loading the MyBrowser XULApp.


Other Tips

1. Color scheme for MingW32 Command Line Prompt

I hated the default color scheme for the command prompt under MingW32 - so I changed it. Find the file c:\mozilla-build\msys\etc\profile, and edit the lines (toward the bottom) which export PS1, and make them say:

export PS1='\[\033]0;$MSYSTEM:\w\007
\033[34m\]\u@\h \[\033[31m\w\033[0m\]
$ '

This changed the directory color to something I could actually see against a white background.


2. MingW32 Handling Spaces In Full Filename

MingW32 profile-sshagent.sh does not handle "C:\Documents and Settings" as a base for my $HOME directory (WinXP's default).

I fixed that trouble by changing c:\mozilla-build\msys\etc\profile.d\profile-sshagent.sh to read this:

export SSH_ENV="$HOME/.ssh/environment"

export SSH_ENV_1=`echo $SSH_ENV | sed 's/ /\\\\ /g'`


function start_agent {
  ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV"
  chmod 600 "$SSH_ENV"
  . "$SSH_ENV" > /dev/null
  ssh-add;
}


if [ -f "${SSH_ENV_1}" ]; then
  . ${SSH_ENV} > /dev/null
  ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
    start_agent;
  }
else
  start_agent;
fi

I am certain there is a more elegant way of accomplishing this hack - I just know that these lines work for me.


3. Further Setting Up MingW32 Path

I get annoyed with continually adding the path to the Mercurial HG.EXE, as well as continually adding the path to the build's wince tools directory.

So I created a c:\mozilla-build\msys\etc\profile.d\profile-setup-hg.sh file, containing:

#!/bin/sh

export PATH="$PATH:/c/progra~1/Mercurial"

# This is an addition to get the shim cross-compile build tools into
# our path. - jvw  24-Apr-08
export PATH="$PATH:/c/mozilla/unicode/build/wince/tools/vs8ppc2003arm"

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)