User:Pjohnsen/MozillaQtBuild

From MozillaWiki
Jump to: navigation, search

Install prerequisites

if you haven't installed these packages, please do so:

sudo apt-get install build-essential autoconf2.13 libdbus-glib-1-dev

Checkout from hg

Qt support is now available from mozilla-central

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

Install Qt 4 (desktop Ubuntu)

Note Qt 4.4 is now available for ubuntu 8.04 if you enable backports in software sources.

sudo apt-get install libqt4-core libqt4-gui libqt4-dev

Install Qt 4.4 (maemo device/scratchbox)

Note: These instructions are for the Chinook (N800) build system, which is what we currently use - if you are building with the more recent Fremantle (N910) build system you should instead follow the Desktop Ubuntu instructions above (except you don't need the "sudo" in front of the command).

echo "deb http://repository.maemo.org/extras-devel diablo free non-free" >> /etc/apt/sources.list
apt-get update
apt-get install libqtcore4 libqtgui4 libqt4-network

For building in scratchbox you also need

apt-get install libqt4-dev

Install additional headers (desktop Ubuntu)

You might need some more development packages installed for configure to succeed.

sudo apt-get install libasound-dev libglib1.2-dev libidl-dev

mozconfig

Here is a sample mozconfig

mk_add_options MOZ_CO_PROJECT=browser,xulrunner

ac_add_options --enable-application=browser

ac_add_options --enable-default-toolkit=cairo-qt
ac_add_options --enable-debug="-g3"
ac_add_options --disable-optimize
ac_add_options --enable-tests

ac_add_options --disable-installer
ac_add_options --disable-crashreporter
ac_add_options --disable-javaxpcom
ac_add_options --disable-printing
ac_add_options --disable-embedding-tests
ac_add_options --disable-elf-dynstr-gc

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj-qt
mk_add_options MOZ_MAKE_FLAGS=-j4

For arm you may need to disable jemalloc as the compiler doesn't seem to like it

ac_add_options --disable-jemalloc

Build

Build as normal with

make -f client.mk build

I had a build error on Kubuntu 8.10 with Qt4.5 with an #include "qcms.h" not found. I solved it with this patch:

ubu8:~/development/mozilla-central$ hg diff
diff -r 96746395df4f gfx/thebes/public/gfxPlatform.h
--- a/gfx/thebes/public/gfxPlatform.h   Wed Apr 08 10:45:32 2009 +0200
+++ b/gfx/thebes/public/gfxPlatform.h   Wed Apr 08 12:42:17 2009 +0200
@@ -48,7 +48,7 @@
 #include "gfxASurface.h"
 #include "gfxColor.h"

-#include "qcms.h"
+#include "qcms/qcms.h"
 #ifdef XP_OS2
 #undef OS2EMX_PLAIN_CHAR
 #endif

Custom Qt build

If your are using your own build of Qt you will need to add a line like this to our mozconfig:

ac_add_options --with-qtdir="/usr/local/Trollteh/Qt-4.4.0-rc1"

and set environment vars like this:

export PKG_CONFIG_PATH=/usr/local/Trolltech/Qt-4.4.0-rc1/lib/pkgconfig/
export LD_LIBRARY_PATH=/usr/local/Trolltech/Qt-4.4.0-rc1/lib/
export PATH=/usr/local/Trolltech/Qt-4.4.0-rc1/bin:$PATH