编译的过程基本上参照的是(http://trac.webkit.org/wiki/WinCE#WindowsCEPortofWebKit),做了一些小的调整
一、使用工具版本
vs2005 + sp1
cmake 2.8.11.2(此处需要注意的是在系统路径中cygwin的cmake路径不能放在此路径前面)
gperf 3.0.1
win flex_bison 2.4
ActivePerl 5.16.3.1603
python 3.3.2
二、使用代码版本
WebKit修订号: r153820
WebKit的svn地址: http://svn.webkit.org/repository/webkit/trunk
thirdparty的git地址: git://gitorious.org/webkit-thirdparty/bsquare-webkit-thirdparty.git
之所以没有使用原文所说的thirdparty,是因为现在用的有pthread、freetype、wceshunt等多个库,一起编译出来便于独立使用。
三、一些调整
1、在cmake配置完成后,使用UE打开所有的vcproj文件,批量将WarnAsError="TRUE"修改成WarnAsError="FALSE"
2、修改一些源文件,主要是关于编译时编码警告的问题(使用notepad打开另存为UTF8),还有就是关于无法访问私有函数问题(先改成公有函数应付一下)。附patch文件
Index: css/BasicShapeFunctions.cpp =================================================================== --- css/BasicShapeFunctions.cpp (revision 153820) +++ css/BasicShapeFunctions.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: css/BasicShapeFunctions.h =================================================================== --- css/BasicShapeFunctions.h (revision 153820) +++ css/BasicShapeFunctions.h (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: css/CSSBasicShapes.cpp =================================================================== --- css/CSSBasicShapes.cpp (revision 153820) +++ css/CSSBasicShapes.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: css/CSSBasicShapes.h =================================================================== --- css/CSSBasicShapes.h (revision 153820) +++ css/CSSBasicShapes.h (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: css/CSSParserMode.h =================================================================== --- css/CSSParserMode.h (revision 153820) +++ css/CSSParserMode.h (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. * Copyright (C) 2012 Apple Inc. All rights reserved. * Index: css/StyleResolver.cpp =================================================================== --- css/StyleResolver.cpp (revision 153820) +++ css/StyleResolver.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 1999 Lars Knoll ([email protected]) * (C) 2004-2005 Allan Sandfeld Jensen ([email protected]) * Copyright (C) 2006, 2007 Nicholas Shanks ([email protected]) Index: css/TransformFunctions.cpp =================================================================== --- css/TransformFunctions.cpp (revision 153820) +++ css/TransformFunctions.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. * Copyright (C) 2012 Google Inc. All rights reserved. * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved. Index: css/TransformFunctions.h =================================================================== --- css/TransformFunctions.h (revision 153820) +++ css/TransformFunctions.h (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: css/ViewportStyleResolver.cpp =================================================================== --- css/ViewportStyleResolver.cpp (revision 153820) +++ css/ViewportStyleResolver.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2012 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: css/ViewportStyleResolver.h =================================================================== --- css/ViewportStyleResolver.h (revision 153820) +++ css/ViewportStyleResolver.h (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2012 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: css/WebKitCSSViewportRule.cpp =================================================================== --- css/WebKitCSSViewportRule.cpp (revision 153820) +++ css/WebKitCSSViewportRule.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2012 Intel Corporation. All rights reserved. * Copyright (C) 2012 Apple Inc. All rights reserved. * Index: css/WebKitCSSViewportRule.h =================================================================== --- css/WebKitCSSViewportRule.h (revision 153820) +++ css/WebKitCSSViewportRule.h (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2012 Intel Corporation. All rights reserved. * Copyright (C) 2012 Apple Inc. All rights reserved. * Index: Modules/webdatabase/Database.h =================================================================== --- Modules/webdatabase/Database.h (revision 153820) +++ Modules/webdatabase/Database.h (working copy) @@ -75,6 +75,8 @@ void scheduleTransactionCallback(SQLTransaction*); + Vector<String> performGetTableNames(); + private: Database(PassRefPtr<DatabaseBackendContext>, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize); @@ -84,7 +86,7 @@ void runTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransactionErrorCallback>, PassRefPtr<VoidCallback> successCallback, bool readOnly, const ChangeVersionData* = 0); - Vector<String> performGetTableNames(); + //Vector<String> performGetTableNames(); RefPtr<SecurityOrigin> m_databaseThreadSecurityOrigin; RefPtr<DatabaseContext> m_databaseContext; Index: platform/LocalizedStrings.cpp =================================================================== --- platform/LocalizedStrings.cpp (revision 153820) +++ platform/LocalizedStrings.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2003, 2006, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. * Copyright (C) 2010 Igalia S.L * Index: platform/ThreadGlobalData.cpp =================================================================== --- platform/ThreadGlobalData.cpp (revision 153820) +++ platform/ThreadGlobalData.cpp (working copy) @@ -28,6 +28,7 @@ #include "ThreadGlobalData.h" #include "CachedResourceRequestInitiators.h" +#include "DOMImplementation.h" #include "EventNames.h" #include "InspectorCounters.h" #include "ThreadTimers.h" Index: platform/win/FileSystemWin.cpp =================================================================== --- platform/win/FileSystemWin.cpp (revision 153820) +++ platform/win/FileSystemWin.cpp (working copy) @@ -180,6 +180,14 @@ #endif // !USE(CF) +int SHCreateDirectoryEx(HWND hwnd, LPCWSTR pszPath, SECURITY_ATTRIBUTES *psa) +{ + if (CreateDirectoryW(pszPath, psa)) + return ERROR_SUCCESS; + else + return ERROR_BAD_PATHNAME; +} + bool makeAllDirectories(const String& path) { String fullPath = path; Index: rendering/ClipPathOperation.h =================================================================== --- rendering/ClipPathOperation.h (revision 153820) +++ rendering/ClipPathOperation.h (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: rendering/LogicalSelectionOffsetCaches.h =================================================================== --- rendering/LogicalSelectionOffsetCaches.h (revision 153820) +++ rendering/LogicalSelectionOffsetCaches.h (working copy) @@ -76,63 +76,63 @@ return object; } -class LogicalSelectionOffsetCaches { +class ContainingBlockInfo { public: - class ContainingBlockInfo { - public: - ContainingBlockInfo() - : m_block(0) - , m_cache(0) - , m_hasFloatsOrFlowThreads(false) - , m_cachedLogicalLeftSelectionOffset(false) - , m_cachedLogicalRightSelectionOffset(false) - { } + ContainingBlockInfo() + : m_block(0) + , m_cache(0) + , m_hasFloatsOrFlowThreads(false) + , m_cachedLogicalLeftSelectionOffset(false) + , m_cachedLogicalRightSelectionOffset(false) + { } - void setBlock(RenderBlock* block, const LogicalSelectionOffsetCaches* cache) - { - m_block = block; - m_hasFloatsOrFlowThreads = m_hasFloatsOrFlowThreads || m_block->containsFloats() || m_block->flowThreadContainingBlock(); - m_cache = cache; - m_cachedLogicalLeftSelectionOffset = false; - m_cachedLogicalRightSelectionOffset = false; - } + void setBlock(RenderBlock* block, const LogicalSelectionOffsetCaches* cache) + { + m_block = block; + m_hasFloatsOrFlowThreads = m_hasFloatsOrFlowThreads || m_block->containsFloats() || m_block->flowThreadContainingBlock(); + m_cache = cache; + m_cachedLogicalLeftSelectionOffset = false; + m_cachedLogicalRightSelectionOffset = false; + } - RenderBlock* block() const { return m_block; } - const LogicalSelectionOffsetCaches* cache() const { return m_cache; } + RenderBlock* block() const { return m_block; } + const LogicalSelectionOffsetCaches* cache() const { return m_cache; } - LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, LayoutUnit position) const - { - ASSERT(m_cache); - if (m_hasFloatsOrFlowThreads || !m_cachedLogicalLeftSelectionOffset) { - m_cachedLogicalLeftSelectionOffset = true; - m_logicalLeftSelectionOffset = m_block->logicalLeftSelectionOffset(rootBlock, position, *m_cache); - } else - ASSERT(m_logicalLeftSelectionOffset == m_block->logicalLeftSelectionOffset(rootBlock, position, *m_cache)); - return m_logicalLeftSelectionOffset; - } + LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, LayoutUnit position) const + { + ASSERT(m_cache); + if (m_hasFloatsOrFlowThreads || !m_cachedLogicalLeftSelectionOffset) { + m_cachedLogicalLeftSelectionOffset = true; + m_logicalLeftSelectionOffset = m_block->logicalLeftSelectionOffset(rootBlock, position, *m_cache); + } else + ASSERT(m_logicalLeftSelectionOffset == m_block->logicalLeftSelectionOffset(rootBlock, position, *m_cache)); + return m_logicalLeftSelectionOffset; + } - LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, LayoutUnit position) const - { - ASSERT(m_cache); - if (m_hasFloatsOrFlowThreads || !m_cachedLogicalRightSelectionOffset) { - m_cachedLogicalRightSelectionOffset = true; - m_logicalRightSelectionOffset = m_block->logicalRightSelectionOffset(rootBlock, position, *m_cache); - } else - ASSERT(m_logicalRightSelectionOffset == m_block->logicalRightSelectionOffset(rootBlock, position, *m_cache)); - return m_logicalRightSelectionOffset; - } + LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, LayoutUnit position) const + { + ASSERT(m_cache); + if (m_hasFloatsOrFlowThreads || !m_cachedLogicalRightSelectionOffset) { + m_cachedLogicalRightSelectionOffset = true; + m_logicalRightSelectionOffset = m_block->logicalRightSelectionOffset(rootBlock, position, *m_cache); + } else + ASSERT(m_logicalRightSelectionOffset == m_block->logicalRightSelectionOffset(rootBlock, position, *m_cache)); + return m_logicalRightSelectionOffset; + } - private: - RenderBlock* m_block; - const LogicalSelectionOffsetCaches* m_cache; - bool m_hasFloatsOrFlowThreads : 1; - mutable bool m_cachedLogicalLeftSelectionOffset : 1; - mutable bool m_cachedLogicalRightSelectionOffset : 1; - mutable LayoutUnit m_logicalLeftSelectionOffset; - mutable LayoutUnit m_logicalRightSelectionOffset; - - }; +private: + RenderBlock* m_block; + const LogicalSelectionOffsetCaches* m_cache; + bool m_hasFloatsOrFlowThreads : 1; + mutable bool m_cachedLogicalLeftSelectionOffset : 1; + mutable bool m_cachedLogicalRightSelectionOffset : 1; + mutable LayoutUnit m_logicalLeftSelectionOffset; + mutable LayoutUnit m_logicalRightSelectionOffset; + +}; +class LogicalSelectionOffsetCaches { +public: LogicalSelectionOffsetCaches(RenderBlock* rootBlock) { ASSERT(rootBlock->isSelectionRoot()); Index: rendering/RenderBlock.cpp =================================================================== --- rendering/RenderBlock.cpp (revision 153820) +++ rendering/RenderBlock.cpp (working copy) @@ -3848,7 +3848,8 @@ logicalLeft += cb->logicalLeft(); ASSERT(currentCache); - const LogicalSelectionOffsetCaches::ContainingBlockInfo& info = currentCache->containingBlockInfo(cb); + //const LogicalSelectionOffsetCaches::ContainingBlockInfo& info = currentCache->containingBlockInfo(cb); + const ContainingBlockInfo& info = currentCache->containingBlockInfo(cb); cb = info.block(); currentCache = info.cache(); } @@ -3870,7 +3871,8 @@ logicalRight += cb->logicalLeft(); ASSERT(currentCache); - const LogicalSelectionOffsetCaches::ContainingBlockInfo& info = currentCache->containingBlockInfo(cb); + //const LogicalSelectionOffsetCaches::ContainingBlockInfo& info = currentCache->containingBlockInfo(cb); + const ContainingBlockInfo& info = currentCache->containingBlockInfo(cb); cb = info.block(); currentCache = info.cache(); } Index: rendering/RenderBlock.h =================================================================== --- rendering/RenderBlock.h (revision 153820) +++ rendering/RenderBlock.h (working copy) @@ -92,6 +92,9 @@ explicit RenderBlock(ContainerNode*); virtual ~RenderBlock(); + LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&); + LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&); + static RenderBlock* createAnonymous(Document*); RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); } @@ -955,9 +958,10 @@ LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& lastLogicalRight, const LogicalSelectionOffsetCaches&, const PaintInfo*); LayoutRect blockSelectionGap(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, LayoutUnit lastLogicalTop, LayoutUnit lastLogicalLeft, LayoutUnit lastLogicalRight, LayoutUnit logicalBottom, const LogicalSelectionOffsetCaches&, const PaintInfo*); - LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&); - LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&); - + //LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&); + //LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&); + + friend class ContainingBlockInfo; friend class LogicalSelectionOffsetCaches; virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const; Index: rendering/RenderBoxModelObject.cpp =================================================================== --- rendering/RenderBoxModelObject.cpp (revision 153820) +++ rendering/RenderBoxModelObject.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 1999 Lars Knoll ([email protected]) * (C) 1999 Antti Koivisto ([email protected]) * (C) 2005 Allan Sandfeld Jensen ([email protected]) Index: rendering/RenderRegion.h =================================================================== --- rendering/RenderRegion.h (revision 153820) +++ rendering/RenderRegion.h (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: rendering/style/RenderStyle.h =================================================================== --- rendering/style/RenderStyle.h (revision 153820) +++ rendering/style/RenderStyle.h (working copy) @@ -1768,6 +1768,8 @@ static BlendMode initialBlendMode() { return BlendModeNormal; } #endif + Color backgroundColor() const { return m_background->color(); } + private: bool changeRequiresLayout(const RenderStyle*, unsigned& changedContextSensitiveProperties) const; bool changeRequiresPositionedLayoutOnly(const RenderStyle*, unsigned& changedContextSensitiveProperties) const; @@ -1822,7 +1824,7 @@ Color borderRightColor() const { return surround->border.right().color(); } Color borderTopColor() const { return surround->border.top().color(); } Color borderBottomColor() const { return surround->border.bottom().color(); } - Color backgroundColor() const { return m_background->color(); } + //Color backgroundColor() const { return m_background->color(); } Color color() const; Color columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); } Color outlineColor() const { return m_background->outline().color(); } Index: rendering/svg/RenderSVGRoot.cpp =================================================================== --- rendering/svg/RenderSVGRoot.cpp (revision 153820) +++ rendering/svg/RenderSVGRoot.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <[email protected]> * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <[email protected]> * Copyright (C) 2007 Eric Seidel <[email protected]> Index: svg/SVGSVGElement.cpp =================================================================== --- svg/SVGSVGElement.cpp (revision 153820) +++ svg/SVGSVGElement.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <[email protected]> * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <[email protected]> * Copyright (C) 2007 Apple Inc. All rights reserved.
编译出来后全是lib文件,尽管使用的是MinSizeRel,但是webcore.lib也有五百多MB,下一步想生成DLL方式。