Difference between revisions of "Qt Webkit OSX Build Instructions"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with '1) Get Qt and set environment variables. Download Qt from trolltech.com Extract it somewhere such as $HOME/dev/qt-4.5/ Then set the environment variable QTDIR to point to that...')
 
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{KBcaution|For a more recent version of the Qt/WebKit rendering library (LLQtWebKit) please go to [https://wiki.secondlife.com/wiki/LLQtWebKit this] page }}
1) Get Qt and set environment variables.
1) Get Qt and set environment variables.


Line 7: Line 9:


Then set the environment variable QTDIR to point to that location.
Then set the environment variable QTDIR to point to that location.
cd $HOME/dev/qt-4.5/
cd $HOME/dev/qt-4.5/
export QTDIR=`pwd`
export QTDIR=`pwd`
export PATH=$PATH:$QTDIR/bin
export PATH=$PATH:$QTDIR/bin


2) Get llmozlib and checkout the qtwebkit branch
2) Get llmozlib and checkout the qtwebkit branch


cd $HOME/dev
cd $HOME/dev
# note if you hasve write access and want to make changes,  
# note if you hasve write access and want to make changes,  
# use git+ssh://git@code.staikos.net/srv/git/llmozlib
# use git+ssh://git@code.staikos.net/srv/git/llmozlib
git clone git://code.staikos.net/llmozlib
git clone git://code.staikos.net/llmozlib
git checkout -b qtwebkit origin/qtwebkit
git checkout -b qtwebkit origin/qtwebkit


3) Apply locally maintained Qt patches
3) Apply locally maintained Qt patches


cd $QTDIR
cd $QTDIR
 
# the patch files are numbered in the order they should be applied, so this should do the right thing
# the patch files are numbered in the order they should be applied, so this should do the right thing
for patchfile in /path/to/llmozlib/llmozlib2/qt_patches/[0-9]* /path/to/llmozlib/llmozlib2/qt_patches/qtwebkit-[0-9]* ; do
for patchfile in /path/to/llmozlib/llmozlib2/qt_patches/[0-9]* /path/to/llmozlib/llmozlib2/qt_patches/qtwebkit-[0-9]* ; do
echo applying "$patchfile"
echo applying "$patchfile"
patch -p1 <"$patchfile"
patch -p1 <"$patchfile"
done
done


4) Compile Qt
4) Compile Qt


cd $QTDIR
cd $QTDIR
./configure -no-framework -fast -no-qt3support -prefix $PWD -static -release -no-xmlpatterns -no-phonon -universal -sdk /Developer/SDKs/MacOSX10.4u.sdk/
./configure -opensource -no-framework -fast -no-qt3support -prefix $PWD -static -release -no-xmlpatterns -no-phonon -universal -sdk /Developer/SDKs/MacOSX10.4u.sdk/
make
make


If you have a multi-core machine, you can speed the make up substantially by using the '-j' argument.  On a 4-core machine, I use 'make -j4'.
If you have a multi-core machine, you can speed the make up substantially by using the '-j' argument.  On a 4-core machine, I use 'make -j4'.
Line 39: Line 41:
For some reason, this doesn't seem to build libJavaScriptCore.a.  I also had to do the following:
For some reason, this doesn't seem to build libJavaScriptCore.a.  I also had to do the following:


cd $QTDIR/src/3rdparty/webkit/JavaScriptCore
cd $QTDIR/src/3rdparty/webkit/JavaScriptCore
make
make


5)  build llmozlib2.dylib with XCode:
5)  build llmozlib2.dylib with XCode:


cd $HOME/dev/llmozlib/llmozlib2/
cd $HOME/dev/llmozlib/llmozlib2/


Create a symlink to QTDIR in the same directory as llmozlib2.xcodeproj (this allows the xcode project to find it easily):
Create a symlink to QTDIR in the same directory as llmozlib2.xcodeproj (this allows the xcode project to find it easily):


ln -s $QTDIR QTDIR
ln -s $QTDIR QTDIR


build the "llwebkitlib" configuration of the "llmozlib2" target
build the "llwebkitlib" configuration of the "llmozlib2" target
Line 54: Line 56:
to specify "llwebkitlib" as the configuration):
to specify "llwebkitlib" as the configuration):


xcodebuild -project llmozlib2.xcodeproj -target llmozlib2 -configuration llwebkitlib
xcodebuild -project llmozlib2.xcodeproj -target llmozlib2 -configuration llwebkitlib


6) build ubrowser with xcode:
6) build ubrowser with xcode:
Line 62: Line 64:
run "update-mac-symbols.sh"
run "update-mac-symbols.sh"


./update-mac-symbols.sh
./update-mac-symbols.sh


build the "Release" configuration of the "llmozlib2" target:
build the "Release" configuration of the "llmozlib2" target:


xcodebuild -project llmozlib2.xcodeproj -target llmozlib2 -configuration Release
xcodebuild -project llmozlib2.xcodeproj -target llmozlib2 -configuration Release


now build ubrowser
now build ubrowser


cd tests/ubrowser
cd tests/ubrowser
xcodebuild -project ubrowser.xcodeproj -target ubrowser -configuration Release
xcodebuild -project ubrowser.xcodeproj -target ubrowser -configuration Release
open build/Release/ubrowser.app
open build/Release/ubrowser.app

Latest revision as of 14:43, 19 November 2009

KBcaution.png Important: For a more recent version of the Qt/WebKit rendering library (LLQtWebKit) please go to this page

1) Get Qt and set environment variables.

Download Qt from trolltech.com

Extract it somewhere such as $HOME/dev/qt-4.5/

Then set the environment variable QTDIR to point to that location.

cd $HOME/dev/qt-4.5/
export QTDIR=`pwd`
export PATH=$PATH:$QTDIR/bin

2) Get llmozlib and checkout the qtwebkit branch

cd $HOME/dev
# note if you hasve write access and want to make changes, 
# use git+ssh://git@code.staikos.net/srv/git/llmozlib
git clone git://code.staikos.net/llmozlib
git checkout -b qtwebkit origin/qtwebkit

3) Apply locally maintained Qt patches

cd $QTDIR

# the patch files are numbered in the order they should be applied, so this should do the right thing
for patchfile in /path/to/llmozlib/llmozlib2/qt_patches/[0-9]* /path/to/llmozlib/llmozlib2/qt_patches/qtwebkit-[0-9]* ; do
	echo applying "$patchfile"
	patch -p1 <"$patchfile"
done

4) Compile Qt

cd $QTDIR
./configure -opensource -no-framework -fast -no-qt3support -prefix $PWD -static -release -no-xmlpatterns -no-phonon -universal -sdk /Developer/SDKs/MacOSX10.4u.sdk/
make

If you have a multi-core machine, you can speed the make up substantially by using the '-j' argument. On a 4-core machine, I use 'make -j4'.

For some reason, this doesn't seem to build libJavaScriptCore.a. I also had to do the following:

cd $QTDIR/src/3rdparty/webkit/JavaScriptCore
make

5) build llmozlib2.dylib with XCode:

cd $HOME/dev/llmozlib/llmozlib2/

Create a symlink to QTDIR in the same directory as llmozlib2.xcodeproj (this allows the xcode project to find it easily):

ln -s $QTDIR QTDIR

build the "llwebkitlib" configuration of the "llmozlib2" target (note especially: the default configuration is "Release". Be sure to specify "llwebkitlib" as the configuration):

xcodebuild -project llmozlib2.xcodeproj -target llmozlib2 -configuration llwebkitlib

6) build ubrowser with xcode:

Get the GLUI Framework (the one tested to work is at http://lukecyca.com/wp-content/uploads/2008/12/GLUI-Framework-2.35.tgz)

run "update-mac-symbols.sh"

./update-mac-symbols.sh

build the "Release" configuration of the "llmozlib2" target:

xcodebuild -project llmozlib2.xcodeproj -target llmozlib2 -configuration Release

now build ubrowser

cd tests/ubrowser
xcodebuild -project ubrowser.xcodeproj -target ubrowser -configuration Release
open build/Release/ubrowser.app