Firefox/Tegra/Build Notes: Difference between revisions

 
(10 intermediate revisions by the same user not shown)
Line 6: Line 6:
** the mozilla-build environment
** the mozilla-build environment
** Visual Studio 2008 (2005 ought to work, but this guide has been written with 2008 in mind), with Smart Device support
** Visual Studio 2008 (2005 ought to work, but this guide has been written with 2008 in mind), with Smart Device support
* To reduce pain, grab an updated Mercurial from http://mercurial.berkwood.com/ -- install it in C:\mozilla-build\hg (overwriting the hg install that's there).


* Install the [http://www.microsoft.com/DownLoads/details.aspx?familyid=FA1A3D66-3F61-4DDC-9510-AE450E2318C3&displaylang=en Windows CE 5.00 Standard SDK].  If you have a SDK provided by a Windows CE 6 device manufacturer, it ought to work as well; this has only been tested with the CE 5.00 SDK.
* Install the [http://www.microsoft.com/DownLoads/details.aspx?familyid=FA1A3D66-3F61-4DDC-9510-AE450E2318C3&displaylang=en Windows CE 5.00 Standard SDK].  If you have a SDK provided by a Windows CE 6 device manufacturer, it ought to work as well; this has only been tested with the CE 5.00 SDK.


* To take advantage of the DirectDraw backend for Windows CE, you'll need to replace ddraw.h and ddraw.lib in the CE5 SDK with those from the Windows Mobile 6 SDK.  This will require installing the WM6 SDK, and then, assuming the SDKs are installed in the default locations, copying:
* The DirectDraw backend for Windows CEneeds the ddraw.h and ddraw.lib in the CE5 SDK replaced with those from the Windows Mobile 6 SDK (you'll get an error saying "Cairo was not compiled with support for the directdraw backend" if you skip this step).  This will require installing the WM6 SDK, and then, assuming the SDKs are installed in the default locations, copying:
** '''/c/Program Files/Windows Mobile 6 SDK/PocketPC/Include/Armv4i/ddraw.h''' to '''/c/Program Files/Windows CE Tools/wce500/STANDARDSDK_500/Include/Armv4i'''
** '''/c/Program Files/Windows Mobile 6 SDK/PocketPC/Include/Armv4i/ddraw.h''' to '''/c/Program Files/Windows CE Tools/wce500/STANDARDSDK_500/Include/Armv4i'''
** '''/c/Program Files/Windows Mobile 6 SDK/PocketPC/Lib/Armv4i/ddraw.lib''' to '''/c/Program Files/Windows CE Tools/wce500/STANDARDSDK_500/Lib/Armv4i'''
** '''/c/Program Files/Windows Mobile 6 SDK/PocketPC/Lib/Armv4i/ddraw.lib''' to '''/c/Program Files/Windows CE Tools/wce500/STANDARDSDK_500/Lib/Armv4i'''
Line 17: Line 15:
= Downloading the Source =
= Downloading the Source =


I tend to use 'c:\proj' as the root for most of my work; replace that path as appropriate for your usage. I would suggest a path without spaces, though.
The process for creating a source tree and  build is basically the same as for building Firefox for Windows XP/Vista. See [https://developer.mozilla.org/En/Simple_build this simplified guide] for the general process.


Mozilla uses the Mercurial version control systemFor more detailed information, see [https://developer.mozilla.org/en/Mercurial this page]. For creating your own patches and/or maintaining local changes, I'd suggest using the [https://developer.mozilla.org/en/Mercurial_Queues Mercurial Queues] extension.
In 'C:\mozilla-build', there will be a few batch files -- fire up '''start-msvc9.bat''' to obtain a console window with paths set up for buildingAll commands are assumed to be executed within the new window. Note that one Windows Vista/7 you may need to right-click the .bat and Run As Administrator, or else the build quickly fails with an "nsinstall: bad file number" error.


In 'C:\mozilla-build', there will be a few batch files -- fire up '''start-msvc9.bat''' to obtain a console window with paths set up for building. All commands are assumed to be executed within such a window.
# '''mkdir /c/proj''' (or any path without spaces!)
# '''cd /c/proj'''
# '''<nowiki>hg clone http://hg.mozilla.org/mozilla-central</nowiki>'''


* First, create some directories:
Mozilla uses the Mercurial version control system. The "hg clone" command will create a mozilla-central directory in /c/proj containing the Mozilla source.  For more detailed information, see [https://developer.mozilla.org/en/Mercurial this page].  For creating your own patches and/or maintaining local changes, I'd suggest using the [https://developer.mozilla.org/en/Mercurial_Queues Mercurial Queues] extension.
** '''mkdir /c/proj'''
** '''cd /c/proj'''
 
* Then check out the current source tree; this will grab a copy of the source in a directory called mozilla-central in /c/proj:
** '''hg clone http://hg.mozilla.org/mozilla-central'''
 
* To update to the latest source, from the mozilla-central directory:
** '''hg pull'''
** '''hg update'''


'''NOTE''': the MSYS environment that drives the build uses Unix-style forward slashes for path separators.  Drive letters are also treated as directories, so "C:\proj" becomes "/c/proj".  Note that MSYS will automatically translate "/c/proj" into "C:\proj" from the command line; this sometimes causes problems when trying ot pass arguments that start with "/" to programs.  To get around this, use "//" -- for example, "dumpbin //exports".  Or, use the - form of arguments if supported.
'''NOTE''': the MSYS environment that drives the build uses Unix-style forward slashes for path separators.  Drive letters are also treated as directories, so "C:\proj" becomes "/c/proj".  Note that MSYS will automatically translate "/c/proj" into "C:\proj" from the command line; this sometimes causes problems when trying ot pass arguments that start with "/" to programs.  To get around this, use "//" -- for example, "dumpbin //exports".  Or, use the - form of arguments if supported.
= Run autoconf to generate the configure scripts =
You'll need to repeat this step if configure.in or js/src/configure.in change; it doesn't hurt to do it too often, so I usually do this whenever I update the source tree.
* From /c/proj/mozilla-central:
** '''autoconf2.13'''
** '''cd js/src; autoconf2.13'''


= Set up a mozconfig =
= Set up a mozconfig =


The mozilla build system uses a mozconfig file to avoid having to pass many options to configure on the command line. Here's a sample mozconfig that I use for building:
The mozilla build system uses a "mozconfig" file to store various build-time options. Here's a sample mozconfig for Windows CE builds. Copy & paste the below into a file named "mozconfig" inside your mozilla-central directory.


mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff
mk_add_options MOZ_MAKE_FLAGS="-s"
  ac_add_options --enable-application=browser
  ac_add_options --enable-application=browser
   
   
Line 58: Line 43:
  ac_add_options --enable-debugger-info-modules
  ac_add_options --enable-debugger-info-modules
   
   
# Have to do libxul builds, or else the linker complains (it's buggy?)
  ac_add_options --enable-libxul
  ac_add_options --enable-libxul
   
   
Line 67: Line 53:
  ac_add_options --disable-ogg
  ac_add_options --disable-ogg
   
   
  # enable these if you have the activex flash patch, otherwise leave disabled
  # for ActiveX shim
  #ac_add_options --enable-activex
export MOZ_FLASH_ACTIVEX_PATCH=1
  #ac_add_options --enable-activex-scripting
ac_add_options --enable-activex
  ac_add_options --enable-activex-scripting
  ac_add_options --enable-xpconnect-idispatch
   
   
  ac_add_options --disable-windows-mobile-components
  ac_add_options --disable-windows-mobile-components
Line 87: Line 75:
  ac_add_options --disable-oji
  ac_add_options --disable-oji
  ac_add_options --disable-vista-sdk-requirements
  ac_add_options --disable-vista-sdk-requirements
ac_add_options --disable-updater
  ac_add_options --disable-installer
  ac_add_options --disable-installer
  ac_add_options --disable-dbm
  ac_add_options --disable-dbm
Line 96: Line 83:
  ac_add_options --target=arm-wince
  ac_add_options --target=arm-wince
  ac_add_options --enable-win32-target=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 ce tools/wce500/standardsdk_500"
  ac_add_options --with-wince-sdk="c:/program files/windows ce tools/wce500/standardsdk_500"
Copy & paste the above into a file in /c/proj, I'll call mine "mc-firefox-wince-opt".


= Start a Build =
= Start a Build =


'''NOTE''': See "Patches" at the end of this to see if there are any outstanding bugs/patches that you should apply that aren't in the upstream tree yet.
In the location where you cloned mozilla-central, just run "make -f client.mk build". If all goes well, you should have a complete build/install dir in "dist/bin" inside your obj-ff dir.
 
* First, create a directory to hold the build tree.  From /c/proj:
** '''mkdir firefox-wince-opt'''
 
* Enter that directory, and run configure (note: you must specify the absolute path to the configure script; a relative path should work, but doesn't currently):
** '''cd firefox-wince-opt'''
** '''MOZCONFIG=../mc-firefox-wince-opt /c/proj/mozilla-central/configure'''
 
* Fire off the build (the -s prevents a whole bunch of unnecessary spew from make)
** '''make -s'''
 
* If all goes well, you should have a complete build/install dir in "dist/bin" inside your firefox-wince-opt dir.


= Running the Build =
= Running the Build =


Copy the entire bin directory to the device, and run firefox.exe.
Copy the entire bin directory to the device, and run firefox.exe.
= Patches =
This section should ideally be empty, but it might contain things that fix performance or otherwise do useful things that aren't quite ready for getting checked in.
There are some patches that enable the ActiveX build in embedding/browser/activex/src/plugin .  This uses the ATL that comes with VC9, which seems to work.
* [http://people.mozilla.com/~vladimir/ce/activex-flash.patch activex-flash.patch]
* Due to some reason that I haven't tracked down yet, MozActiveX.res might fail to build in embedding/browser/activex/src/plugin.  Build it manually -- at the start of the build is fine -- with the following (replace the .rc dir appropriately for your source location):
C:\proj\firefox-wince-opt\embedding\browser\activex\src\plugin>rc -I"C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\atlmfc\include" -r -Fo MozActiveX.res c:/proj/mozilla-central/embedding/browser/activex/src/plugin/MozActiveX.rc
= Outstanding Issues =
These are bugs specifically affecting Windows CE; they should all have bug #'s associated with them:
* <strike>Need to fix toplevel windows on CE</strike> -- largely fixed, but we need to figure out what the right window styles really should be.
canmove, Confirmed users
432

edits