LLQtWebKit Mac OSX Build Instructions

From Second Life Wiki
Revision as of 01:50, 2 September 2009 by Callum Linden (talk | contribs) (Created page with '<<< [https://wiki.secondlife.com/wiki/LLQtWebKit Back to LLQtWebKit main page] == Introduction == These are instructions for building the Qt/WebKit library (LLQtWebKit) on Mac O...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<<< Back to LLQtWebKit main page

Introduction

These are instructions for building the Qt/WebKit library (LLQtWebKit) on Mac OS X as well as the test applications (testGL, uBrowser, QtTestApp). They have been tested using XCode 3.1.2 on Mac OS X 10.5.8.

Set up

Create a directory you'll use for the build. This can be anywhere you like, but for the purposes of the example I'll use ~/llqtwebkit.

Acquire LLQtWebKit source code

  • In a Web browser, navigate to http://hg.secondlife.com/llqtwebkit/
  • Select "get source->zip" from menu
  • A zip file of the source code will be downloaded
  • Extract the files in the zip into ~/llqtwebkit (this should create the directory ~/llqtwebkit/llqtwebkit
  • Do not build anything yet - some of the files that were just downloaded will be used to modify the Qt source code

Build the open source version of Qt 4.5.2 using XCode

Downloading and patching the Qt source

  • Download the Qt 4.5.2 source from ftp://ftp.qtsoftware.com/qt/source/qt-all-opensource-src-4.5.2.tar.gz (Approximately 125MB)
  • Extract the tarball into ~/llqtwebkit
  • This may take some as the archive contains a lot of files
  • You should now have a directory ~/llqtwebkit/qt-all-opensource-src-4.5.2
  • Review the file ~/llqtwebkit/llqtwebkit/qt_patches/merged_into_qt to determine which patches need to be applied. Some patches are no longer needed with Qt 4.5.2.
  • Open a terminal window and cd to ~/llqtwebkit/qt-all-opensource-src-4.5.2 directory
  • run the following commands (we'll use the QTDIR variable in later steps)
export QTDIR=`pwd`
export PATH=$PATH:$QTDIR/bin
  • For each .patch file, run the following command:
patch -p1 < ../llqtwebkit/qt_patches/$PATCH_NAME
  • where $PATCH_NAME is the filename of the patch file

Configure Qt

  • In the terminal window, make sure you're still in the directory ~/llqtwebkit/qt-all-opensource-src-4.5.2
  • Run the following command:
./configure -no-framework -fast -no-qt3support -prefix $PWD -static -release -no-xmlpatterns -no-phonon -universal -sdk /Developer/SDKs/MacOSX10.4u.sdk/
  • When you are asked if you want to use the Commercial or Open Source version type o to select Open Source and press <enter>
  • When the license agreement appears, if you agree type yes <enter>
  • This operation takes around 10-15 minutes on a typical development system

Build Qt

  • In the terminal window, make sure you're still in the directory ~/llqtwebkit/qt-all-opensource-src-4.5.2
  • Run this command:
make
  • If you're on a multicore machine, you can speed up the build substantially by using the '-j' argument to make, which will cause it to build files in parallel. For example, on a 4-core system, I use:
make -j4
  • This takes a little over an hour on a 4-core Mac Pro.
  • After building Qt the built libraries will be in ~/llqtwebkit/qt-all-opensource-src-4.5.2/lib
  • For some reason, this doesn't build one of the libraries we need. I also had to do the following:
cd $QTDIR/src/3rdparty/webkit/JavaScriptCore
make

Build LLQtWebKit

  • In the terminal window, change to the directory ~/llqtwebkit/llqtwebkit
  • Create a symlink to QTDIR in this directory (this allows the xcode project to find it easily):
ln -s $QTDIR QTDIR
  • Open the llqtwebkit.xcodeproj project with Xcode
  • Build the "Release" configuration of the "llqtwebkit" target
  • Now LLQtWebKit is built and can be used in the Second Life viewer.