Mobile/Build/Fennec: Difference between revisions

From MozillaWiki
< Mobile‎ | Build
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
==Building Fennec and XULRunner==
== Building [[Fennec]] and [[XULRunner]] ==


=== Install and run Scratchbox (Maemo only) ===
=== Install and run Scratchbox (Maemo only) ===
Line 9: Line 9:
'''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
'''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 ===
=== Install build dependencies (non-Maemo) ===


If you are *not* building for Maemo/Scratchbox, follow the [https://developer.mozilla.org/En/Simple_Firefox_build "Installing build tools" instructions] for your platform.
If you are ''not'' building for Maemo/Scratchbox, follow the [https://developer.mozilla.org/En/Simple_Firefox_build "Installing build tools" instructions] for your platform.


=== Pull the code from Mercurial ===
=== Pull the code from Mercurial ===
Line 55: Line 55:
See [https://developer.mozilla.org/en/Configuring_Build_Options Configuring Build Options] for more information about customizing your build settings.
See [https://developer.mozilla.org/en/Configuring_Build_Options Configuring Build Options] for more information about customizing your build settings.


=== Start the build ===
=== Build Fennec and XULRunner ===
In the mozilla-central directory:
In the mozilla-central directory:
<pre>
<pre>
Line 62: Line 62:
The build will appear in ../mobilebase (or whatever MOZ_OBJDIR is set to in your mozconfig).
The build will appear in ../mobilebase (or whatever MOZ_OBJDIR is set to in your mozconfig).


== Running Fennec on Maemo ==
 
== Running Fennec ==
 
=== Desktop ===
 
<pre>
cd ../mobilebase/mobile/dist/bin
./fennec
</pre>
You may want to add the $MOZ_OBJDIR/mobile/dist/bin directory to your shell's $PATH so you can just type "fennec" anywhere.
 
=== Maemo ===
If you did the above in a [[Mobile/Build/cs2007q3|Maemo Scratchbox]] for the CHINOOK_ARMEL target, you can run the build on the N800/N810 device.
If you did the above in a [[Mobile/Build/cs2007q3|Maemo Scratchbox]] for the CHINOOK_ARMEL target, you can run the build on the N800/N810 device.


Create a Fennec tarball:
Create a Fennec tarball:


<code><pre>
<pre>
cd ../mobilebase/mobile/
cd ../mobilebase/mobile/
make package
make package
</pre></code>
</pre>


You'll now have a tarball in mobilebase/mobile/dist/ named fennec-0.3.en-US.linux-arm.tar.bz2. Copy it to your device (you'll probably want to run bunzip2 on it first, since Maemo doesn't include it).
You'll now have a tarball in mobilebase/mobile/dist/ named fennec-0.3.en-US.linux-arm.tar.bz2. Copy it to your device (you'll probably want to run bunzip2 on it first, since Maemo doesn't include it).
Line 76: Line 87:
Extract and launch from a command line (X Terminal) on the device:
Extract and launch from a command line (X Terminal) on the device:


<code><pre>
<pre>
$ tar xf fennec-0.3.en-US.linux-arm.tar  
tar xf fennec-0.3.en-US.linux-arm.tar  
$ cd fennec
cd fennec
$ ./fennec
./fennec
</pre></code>
</pre>


==Building Fennec with the Gecko SDK==
==Building Fennec with the Gecko SDK==

Revision as of 18:06, 30 April 2010

Building Fennec and XULRunner

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
cd mozilla-central
hg clone http://hg.mozilla.org/mobile-browser mobile

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

# Options for client.mk.
mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../mobilebase

# XULRunner options
ac_add_app_options xulrunner --enable-application=xulrunner
ac_add_app_options xulrunner --disable-javaxpcom

# mobile options
ac_add_app_options mobile --enable-application=mobile
ac_add_app_options mobile --with-libxul-sdk=../xulrunner/dist

####################################################
# 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_app_options xulrunner --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 Fennec and XULRunner

In the mozilla-central directory:

make -f client.mk build

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


Running Fennec

Desktop

cd ../mobilebase/mobile/dist/bin
./fennec

You may want to add the $MOZ_OBJDIR/mobile/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 ../mobilebase/mobile/
make package

You'll now have a tarball in mobilebase/mobile/dist/ named fennec-0.3.en-US.linux-arm.tar.bz2. Copy it to your device (you'll probably want to run bunzip2 on it first, since Maemo doesn't include it).

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

tar xf fennec-0.3.en-US.linux-arm.tar 
cd fennec
./fennec

Building Fennec with the Gecko SDK

Download SDK

First download the appropriate Gecko SDK from ftp.mozilla.org

Get the source

Follow the steps from #Pulling the code from hg

Creating a mozconfig

# Options for client.mk.
mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../mobilebase

ac_add_options  --enable-application=mobile
ac_add_options  --with-libxul-sdk=<path to the SDK you downloaded and extracted>

Note: if you are building for x86 ubuntu, you might want to add "ac_add_options --disable-dbus" to your mozconfig, or obtain the necessary dbus libraries.

Build

make -f client.mk build

Note: At this point, you should be able to run and/or debug fennec, as your downloaded Gecko SDK is properly found by your app. However, since you're not using a xulrunner objdir, the package-related features will not work unless you inform the Mozilla build system of this SDK, by adding the following line to your mozconfig file :

ac_add_options  --with-system-libxul

Building Win32

Start by setting up your system with the needed SDKs. This means Visual Studio 2008 and the Vista SDK. You can install the Windows Mobile 6 SDK also, but it's not needed for the Win32-only build.

Check out the hg repo listed above. Create a .mozconfig file in the mozilla-central directory. This looks similar to the above, but with some ARM/Linux specific lines removed:

# Options for client.mk.
mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../mobilebase

# XULRunner options
ac_add_app_options xulrunner --enable-application=xulrunner
ac_add_app_options xulrunner --disable-javaxpcom

# mobile options
ac_add_app_options mobile --enable-application=mobile
ac_add_app_options mobile --with-libxul-sdk=../xulrunner/dist

# Global options -- uncomment these lines for debug version
#ac_add_options --enable-debug
#ac_add_options --disable-optimize

# needed to fix problem with Vista SDK
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.