[Webkit]QtWebkit开发环境配置及编译方法-Windows32bit
2014-06-06 09:58
501 查看
Dependencies
FirstofallyouneedaversionofQtforWindows.IfyouareanOpenSourcedeveloperthenyoucandownloadtheOpenSourceEditionofQtforWindowsfromtheNokiaWebsite:NotethatyouneedtoenableICUsupportintheQtbuild(alsosee
MakesurethatQtisconfiguredwith-opensslifyouwantHTTPSsupportin
Install
Install
ThefollowingexternalGNUtoolsareneededfromthe
Install
Pleaseinstallthesetoolsinapathwithoutspaces(i.e.notin"C:\ProgramFiles")
MakesuretheGnuWin32packagesareinyourPATHaswellasPerlandPython.Youalsoneedtohave%QTDIR%setandhave%QTDIR%\bininyourPATH.
IfyouhaveCygwin'sbindirectoryinyourpath,makesurethatitcomesafterActiveStatePerlandGnuWin32.YoumighthavetoremoveitcompletelyfromyourPATHifyouhaveproblemswithslashesandbackslasheswhilebuildingusingMinGW.mingw32-makeandGnuWin32'smakewillusesh.exetoruncommandsiftheyfinditinthePATH.
BuildingQtWebKit
OpenaQtCommandPromptfromtheStartMenu.AlternativelyyoucanuseaMSVCorMinGWcommandlineenvironmentthatmatchestheversionofQtyoudownloadedandmakesureqmakeisaccessibleinPATH.
NotethatbuildinginsideCygwinorMSYSiscurrentlynotsupported.PleaseuseaWindowscommandprompt.
ChdirintotheWebKitsourcetree
RunperlTools\Scripts\build-webkit--qt--release
Wait:)
TrytorunWebKitBuild\Release\bin\QtTestBrowser.exe
NotesaboutbuildingQtWebKitwiththeQt/WindowsOpenSourceEdition
Ifyouwanttocompileusingmultiplecores:OnMinGWyoucantrysetMAKE_COMMAND=mingw32-make-j%NUMBER_OF_PROCESSORS%.
IfthisdonotworkyoumighthavetoCtrl-Cbuild-webkit'sexecution,gointheWebKitBuild\Release\directoryandrun:
mingw32-make-CJavaScriptCore-fMakefile.Release-j%NUMBER_OF_PROCESSORS%&&mingw32-make-CWebCore-fMakefile.Release-j%NUMBER_OF_PROCESSORS%&&mingw32-make
OnMSVCusetheCLenvironmentvariablealongwiththe/MPswitch:
setCL=/MP
Ifyouhaven'tsetupyourPATHalreadytoincludetheGnuWin32packagesthenyoumaywanttoexecutethefollowingcommand:setPATH=C:\GnuWin32\bin;C:\Perl\bin;%PATH%ProvidedthattheGnuWin32packagesareinstalledinC:\GnuWin32\binandPerlinC:\Perl\bin.
Ifyougetbuilderrorsin
Ifyougetbuilderrorsaftermakefilegeneration("Makefile:178:*Multipletargetpatterns.Stop.")thenyou'reprobablystillusingtheCygwinversionofmake.TryremovingCygwinfromyour%PATH%forthetimebeing(it'snotcurrentlysupported,asmentionedabove).
A'WorksForMe'Step-by-StepGuidetobuildingQtWebKitonWindowsusingmingw-w64/w32
ThepatchinbugreportUntilQt4.7isreleased,usethegitversionofQt4.7:
Getamingw-w64buildwithmingw32-make:
I'massumingyou'rerunningWindowsx64,asyouwillbetestingthebuild:)
Twooptions:
drangon:
sezero:
Setupyourenvironment:
QtsourcesareinC:\Qtsothatconfigure.exeispresentinthatdirectory
perlisinstalled:
opencmd.exe
runfollowingcommands:
setPATH=C:\mingw64\bin;C:\Qt\bin;%PATH% setQTDIR=C:\Qt cdC:\Qt configure-qt-style-windowsxp-qt-style-windowsvista-phonon mingw32-make
Everythingshouldhavebuilt.Havefun!
Remarks:mingw-w64/w32alsoprovidesatoolchaintargetting32-bitwindows.Sezeroprovidesbuilds:
A'WorksForMe'Step-by-StepGuidetoBuildingQtWebKitonWindowsusingMinGW
ThethementionedGnuWin32toolsOpenforexampleaQtCommandPromptfromtheStartMenu.ClickStart->ProgramFiles->Qt->QTCommandPrompt.Infact,youreallydoneedtouseQtCommandPromptforthisratherthanthenormalwindowscommandprompt.
MakesuretheGnuWin32packagesareinyourPATHaswellasPerl(setPATH=C:\programfiles\gnuwin32\bin;C:\Perl\site\bin;%PATH%.
Youalsoneedtohave%QTDIR%setandhave%QTDIR%\bininyourPATH.
TrimyourPATHdownasmuchaspossible.RemoveGitandMingwfromyourPATHifyouhavetheminstalled,theirpresencecancauseoddbuildfailures.Forexample,thePATHthatworksformeis:
setPath=c:\GnuWin32\bin;c:\Qt\2009.01\qt\bin;c:\Qt\2009.01\bin;C:\Perl\bin;C:\Windows\system32;c:\Qt\2009.01\mingw\bin;C:\Perl\site\bin;C:\Windows
Notethatc:\Qt\2009.01\qtabovewillvarydependingontheQTSDKthatyoudownloaded.Youshouldmodifyitappropriately.
DownloadWebKitfromsvn(makesureyou'veleftthelocationofyoursvnclientinyour%PATH%above):
$svncheckouthttp://svn.webkit.org/repository/webkit/trunk%HOME%\WebKit $cd%HOME%/WebKit
ChangeintotheWebKitsourcetree:cdc:\location\of\webkit
Forsomereason,thebuildcommandwasunabletocreatetheWebKitBuild\ReleasefoldersbyitselfonmyPC.IhadtodomkdirWebKitBuildandmkdirWebKitBuild\Releasebeforebuilding.
Youmayneedtodoamkdirc:\tmp.TheWebKitbuildreliesontheexistenceofc:\tmpwhenbuildinginWindows.
Buildthepatchedwebkit(releasemode):$perlTools\Scripts\build-webkit--qt--release
Thewebkitbuildtakesforever,youcanshortenitusingthebuild-webkit's--no-svgor--minimalflags:
$perlTools\Scripts\build-webkit--qt--release--no-svg $perlTools\Scripts\build-webkit--qt--release--minimal
SpeedupGitonWindows
GittendstoberatherslowforrepositorieswithahugeamountoffilesonWindows.Onewaytodealwiththatistouseasparse-checkout,to"ignore"certainfiles.TheLayoutTestsdirectoryiscertainlyagoodcandidate,ifyoucurrentlydonotneedthesefiles.Asparse-checkoutusesaconfigfile(.git/info/sparse-checkout)todetermineifafileshouldbecheckedoutornot.Filesmentionedintheconfigfilewillbepartofthecheckout.Filesnotmentionedintheconfigfilewillbeignored.Thereisalsoasyntaxtoinvertthislogic,butitiscurrentlynotworkingwellwithdirectories.Createa.git/info/sparse-checkoutfilethatwillignoretheLayoutTestsdirectory:
/* !LayoutTests
Enablesparse-checkout:
gitconfigcore.sparsecheckouttrue
RemovetheLayoutTestsdirectoryifitisalreadythere:
rmdir/sLayoutTests
Updatethegittreecache:
gitread-tree-m-uHEAD
Checkwhichfileshavebeenexcluded:
gitls-files-v|grep^S
参考编译方法:
1.Qt官网下载最新版本:http://qt-project.org/downloads
2.将下载的压缩包解压(例如,路径为:F:/QtWebKit),配置相关环境变量:
-----创建两个变量名,分别为QTDIR(值为F:/QtWebKit/qt-windows-open.....),QMAKESPEC(值为win32-msvc20XX;这里的XX,根据VS的版本决定,本人用的是2010,所以为win32-msvc2010)
3.编译源代码
-----打开VS软件,进入VisualStudioTools中,运行命令行,锁定到qt的源码目录下,运行命令:configure.exe-webkit
-----编译过程中会出现GPL授权相关提示,yes即可,第一步会生成qmake
-----然后运行nmake命令,编译完即成功编译
4.编译应用程序,同上,一次执行qmake和nmake命令,会在debug目录下生成可执行文件
5.qt安装环境里包含webkit源代码,而且自带一个简单的Browser项目
6.将Browser工程设为启动项目,然后编译即可。
相关文章推荐
- QT5.4.2静态编译(包含QtWebKit)及配置方法
- Qtwebkit配置,设置交叉编译环境
- Qt5.2.0 MinGW480 release静态版编译结果、过程及QtCreator配置分享(realfan的编译方法)(configure -h可以显示帮助)(静态编译mysql插件,需要做一些其它工作,机器上要有mysql)(不编译qtwebkit,就不用安装ActivePerl了)(用到 QMediaPlayer的编译办法)
- Windows环境下设置Qt编译环境 - 关于Qt的静态链接库的配置和生成方法
- Qt安装、配置开发环境和使用方法
- VS2013编译环境集成QT的配置方法
- JSP动态网站开发环境配置详细方法第1/2页
- 跨平台GUI--Qt windows 开发环境安装配置(Eclipse CDT+ MinGW+QT) (转载)
- 配置模拟外网环境开发网站的方法
- QTE QT 开发环境的搭建 及 编译
- Qt 4 开发环境的安装和配置(Windows)
- 跨平台GUI--Qt windows 开发环境安装配置(VS2005+QT+IntegrationPlugin)(转载)
- 编译Lua库并配置开发环境
- 安装Qt+MinGW+Eclipse for c_c++开发环境配置总结
- qt:Windows 下 安装配置 QT 开发环境 ( 4.3.2 )
- VS2005下如何安装配置编译并开发QT4.4.3程序
- 如何自己配置和编译一个完整的Linux嵌入式开发环境?
- 跨平台GUI--Qt windows 开发环境安装配置(Eclipse CDT+ MinGW+QT) (转载)
- QT-4.4.1在VC++ 2005 Express环境下的安装,编译,配置
- vc6中集成驱动编译环境的配置方法