Mobile/Build/Fennec: Difference between revisions
m (→Build) |
|||
Line 106: | Line 106: | ||
===Install libxul SDK=== | ===Install libxul SDK=== | ||
If you're not building a xulrunner objdir, but are rather using a downloaded Gecko SDK, you'll want to *install* your SDK prior to hacking fennec (especially if you intend to do 'performance' stuff) because some build features are only triggered are package-time. The easiest way to achieve this is throught system installation of your downloaded Gecko SDK : | |||
<pre> | <pre> | ||
make -f client.mk install | make -f client.mk install | ||
</pre> | </pre> | ||
Revision as of 19:57, 23 February 2009
Building Fennec and XULRunner
If you want to cross-compile Fennec and XULRunner for ARM devices, you should first set up scratchbox.
Pulling the code from hg
hg clone http://hg.mozilla.org/mozilla-central cd mozilla-central hg clone http://hg.mozilla.org/mobile-browser mobile
Creating a mozconfig
Here's an example mozconfig for building in scratchbox. The LDFLAGS, with-arm-kuser, and disable-tests options should be removed if you're building outside of scratchbox (for x86).
# 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" # Options for client.mk. mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile" mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../mobilebase # Global options #ac_add_options --enable-debug #ac_add_options --disable-optimize # XULRunner options ac_add_app_options xulrunner --enable-application=xulrunner ac_add_app_options xulrunner --disable-javaxpcom # Enabling --with-arm-kuser implies Linux on ARM and enables kernel # optimizations for that platform ac_add_app_options xulrunner --with-arm-kuser # Disabling tests due to bug 454881 ac_add_options --disable-tests # mobile options ac_add_app_options mobile --enable-application=mobile ac_add_app_options mobile --with-libxul-sdk=../xulrunner/dist
libIDL
libIDL is required.
- I think the latest scratchbox instructions include a step to obtain libIDL, so building it yourself shouldn't be necessary. If that's wrong, there are instructions for building libIDL in scratchbox here. If you follow those steps you must also set the PKG_CONFIG_PATH environment variable. GavinSharp
Start the build
make -f client.mk build
Running Fennec on 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, some package-related features (e.g. xptlinking) will not work unless you *package* or *install* your SDK. To turn them on, add the following line to your mozconfig ...
ac_add_options --with-system-libxul
... And install your SDK as described in the following section :
Install libxul SDK
If you're not building a xulrunner objdir, but are rather using a downloaded Gecko SDK, you'll want to *install* your SDK prior to hacking fennec (especially if you intend to do 'performance' stuff) because some build features are only triggered are package-time. The easiest way to achieve this is throught system installation of your downloaded Gecko SDK :
make -f client.mk install
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.