Changes between Initial Version and Version 1 of BuildingQtOnOSX

Aug 26, 2009 2:25:58 PM (12 years ago)

Initial Page for OSX build instructions


  • BuildingQtOnOSX

    v1 v1  
     2See Also:
     3 * [BuildingQtOnLinux Building Qt Port on Linux]
     4 * [BuildingQtOnWindows Building on Qt Port Windows]
     6These instructions assume you are building on an OSX system with Mac Ports installed having the qt4-mac (4.5.2) port installed.
     8== Checkout the Code ==
     9You'll need to check out WebKit from SVN or Qt WebKit from Git
     11svn checkout WebKit # WebKit SVN Trunk
     15git clone git:// # Qt WebKit Git Branch
     18== Building ==
     20=== Workaround #1 ===
     21This works around the problem with Qt headers being reference directly from /usr/include regardless of where the QTDIR is (Fixes "''../../../WebKit/JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h:26:17: error: QChar: No such file or directory''" errors):
     23export QTDIR=/opt/local/libexec/qt4-mac # mac ports Qt
     24cd /usr/include
     25for q in $QTDIR/include/*; do if [ ! -e "`basename $q`" ]; then sudo ln -s "$q"; fi ; done # create a symlink
     28=== Workaround #2 ===
     29Next start the build:
     31export WEBKITSRCDIR=qtwebkit # change this to 'WebKit' to build WebKit SVN Trunk
     32export WEBKITOUTPUTDIR=`pwd`/${WEBKITSRCDIR}-build
     33${WEBKITSRCDIR}/WebKitTools/Scripts/build-webkit --qt --qmake=qmake-4.5 --makeargs="-j2" -spec macx-g++ --no-video --debug
     36The build will ultimately fail with an error message "''Undefined symbols: "WebCore::CSSParser::lex()", referenced from: WebCore::CSSParser::lex(void*)in CSSParser.o''" when it attempts to link the binaries, to fix that we run the flex make target by hand and copy the result into the build output drectory: 
     38cd ${WEBKITSRCDIR}/WebCore
     39rm tokenizer.cpp
     40WebCore=. make -f DerivedSources.make tokenizer.cpp
     41mv tokenizer.cpp ${WEBKITOUTPUTDIR}/Debug/WebCore/generated/debug/tokenizer.cpp
     44=== Finish Up and Run ===
     45Rerunning the build should recompile CSSParser.cpp and link correctly.
     47${WEBKITSRCDIR}/WebKitTools/Scripts/build-webkit --qt --qmake=qmake-4.5 --makeargs="-j2" -spec macx-g++ --no-video --debug
     50Finally start the demo Qt browser:
     52${WEBKITSRCDIR}/WebKitTools/Scripts/run-launcher --qt --debug # After this, check the dock and you'll see Qt icon ...