Firefox/Tegra/Build Notes

From MozillaWiki
Jump to: navigation, search

This is a work in progress; pieces of the Windows Mobile Build Instructions might also be relevant and/or informative. However, they are targeted towards building Fennec/XULRunner for Windows Mobile.

Initial Setup

  • Follow the instructions in Windows Build Prerequisites, installing at a minimum:
    • 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
  • Install the 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.
  • 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/Lib/Armv4i/ddraw.lib to /c/Program Files/Windows CE Tools/wce500/STANDARDSDK_500/Lib/Armv4i

Downloading the Source

The process for creating a source tree and build is basically the same as for building Firefox for Windows XP/Vista. See this simplified guide for the general process.

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 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.

  1. mkdir /c/proj (or any path without spaces!)
  2. cd /c/proj
  3. hg clone

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 this page. For creating your own patches and/or maintaining local changes, I'd suggest using the Mercurial Queues extension.

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.

Set up a mozconfig

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

# Either --enable-debug or --enable-optimize should be specified;
# --enable-debugger-info-mobules ensures that debugging symbols are available
# even with an optimized build.

#ac_add_options --enable-debug
ac_add_options --enable-optimize
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-jemalloc
ac_add_options --enable-splashscreen
ac_add_options --enable-faststripe

# buggy for ARM at the moment
ac_add_options --disable-ogg

# for ActiveX shim
ac_add_options --enable-activex
ac_add_options --enable-activex-scripting
ac_add_options --enable-xpconnect-idispatch

ac_add_options --disable-windows-mobile-components

# Note that you need to give both CFLAGS and CXXFLAGS
export CFLAGS="-QRarch6 -QRfpe-"
export CXXFLAGS="-QRarch6 -QRfpe-"

# No need to build the tests for now
ac_add_options --disable-tests

# Disable some things that aren't necessary right now;
# these might or might not actually work should they be needed.
ac_add_options --disable-javaxpcom
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-installer
ac_add_options --disable-dbm
MIDL=/c/Program\ Files/Microsoft\ Visual\ Studio\ 9/VC/ce/bin/x86_arm/midl.exe

ac_add_options --target=arm-wince
ac_add_options --enable-win32-target=WINCE

ac_add_options --with-wince-sdk="c:/program files/windows ce tools/wce500/standardsdk_500"

Start a Build

In the location where you cloned mozilla-central, just run "make -f build". If all goes well, you should have a complete build/install dir in "dist/bin" inside your obj-ff dir.

Running the Build

Copy the entire bin directory to the device, and run firefox.exe.