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...')
 
(Fixed formatting problems with the sections of shell script commands)
Line 7: Line 7:


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 -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 39:
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 54:
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 62:
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

Revision as of 16:14, 5 August 2009

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