Mobile/Build/Fennec

< Mobile‎ | BuildRedirect page

Building Fennec

Look here for the Android build instructions

[[https://wiki.mozilla.org/Mobile/Fennec/Android ]]


Install and run Scratchbox (Maemo only)

If you want to cross-compile Fennec and XULRunner for Maemo, you should first set up scratchbox. Scratchbox is a cross-compilation environment that you will run before compiling Fennec.

NOTE: All the following instructions assume that you are logged in to scratchbox by typing this:

/scratchbox/login

NOTE 2: When you are logged in to scratchbox, you are chroot'ed. This means that /scratchbox/users/YOUR_NAME/home/YOUR_NAME matches to your home directory inside of scratchbox which is /home/YOUR_NAME

Install build dependencies (non-Maemo)

If you are not building for Maemo/Scratchbox, follow the "Installing build tools" instructions for your platform.

Pull the code from Mercurial

hg clone http://hg.mozilla.org/mozilla-central

Create a mozconfig

Create a file named "mozconfig" in the mozilla-central directory. Here's an example mozconfig. The LDFLAGS, with-arm-kuser, and with-maemo-version options should be removed if you're building outside of scratchbox (for x86).

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../objdir
ac_add_options --enable-application=mobile

# For improved compile speeds, all optional.
#mk_add_options MOZ_MAKE_FLAGS=-j4
#export CCACHE_HARDLINK=1
#ac_add_options --with-ccache=ccache

# Make a debug build, optional.
#export MOZ_DEBUG_SYMBOLS=1
#ac_add_options --enable-debug
#ac_add_options --disable-optimize

# Needed on Win32 to fix problem with Windows Vista SDK
#ac_add_options --disable-accessibility

####################################################
# SCRATCHBOX ONLY: Remove everything below this line
# if you are not building in Scratchbox for Maemo. 

ac_add_options --with-maemo-version=5

# Enabling --with-arm-kuser implies Linux on ARM and enables kernel
# optimizations for that platform
ac_add_options --with-arm-kuser

# cs2007q3 gcc 4.2 is busted, we think, and doesn't
# look in the expected places. --dougt.
# $PWD/... was added due to bug 463076
export LDFLAGS="-Wl,-rpath-link,$PWD/dist/bin/:/usr/lib:/lib"

See Configuring Build Options for more information about customizing your build settings.

Build

In the mozilla-central directory:

make -f client.mk build

The build will appear in ../objdir (or whatever MOZ_OBJDIR is set to in your mozconfig).

Running Fennec

Desktop

cd ../objdir/dist/bin
./fennec

You may want to add the $MOZ_OBJDIR/dist/bin directory to your shell's $PATH so you can just type "fennec" anywhere.

Maemo

If you did the above in a Maemo Scratchbox for the CHINOOK_ARMEL target, you can run the build on the N800/N810 device.

Create a Fennec tarball:

cd ../objdir
make package

You'll now have a tarball in objdir/dist/ named fennec-1.1b2pre.en-US.linux-arm.tar.bz2. (you'll probably want to run bunzip2 on it first, since Maemo doesn't include it):

cd dist
bunzip2 fennec-*.tar.bz2

Connect your N900 to your computer in USB Mass Storage mode and copy the tarball to it, then unmount it and disconnect (note: you must actually disconnect the USB cable; also, be sure to close an open terminal on your N900 if you have one). The file will appear in ~/MyDocs. You can drag it in the file manager, or run something like this command:

cp fennec-*.tar "/media/Nokia N900"
umount "/media/Nokia N900"

Extract and launch from a command line (X Terminal) on the device:

# Run this outside of the MyDocs directory, which is mounted noexec:
tar xvf MyDocs/fennec-*.tar 
./fennec/fennec

Building Win32

Start by setting up your system with the needed SDKs. This means Visual Studio 2008 and the Vista SDK.

Check out the source and create a mozconfig following the instructions above. Be sure to add or uncomment this line:

ac_add_options --disable-accessibility

Then use the commands

configure
make -f client.mk build

Don't panic if configure fails; the make will rerun it with the right options to allow this to work.