[webkit-dev] Successfully built the windows cairo port of webkit with MINGW compiler

Alexander Vassilev avasilev at voipgate.com
Thu Jan 22 14:17:10 PST 2009

Hi all,

I have managed to build webkit with MINGW (wasn't very easy huh). What I
actually built are WebCore and JsCore, but not the windows WebKit stuff
that implements COM classes and interfaces - this is because I want my
code that talks with webkit to be portable, I am targetting MacOS and
Linux after I implement my application on Windows. Now comes the part
where I have a couple of DLLs and don't know what to do with them :) I
have not even tested that the build I have done actually works.
As for the details on the port - porting webkit to MINGW required
roughly the following:
 - adding a MINGW compatibility header that is included in config.h and
defines several functions that are not available in the MINGW runtime
(like wcscpy_s and other _s string functions). I think this is the
cleanest way to solve these compatibility problems with missing CRT
 - Changing quite a few of C++ casts to C casts because MINGW did not
like the C++ casts
 - Changing some function pointer expressions which originally were
specified without "*": MINGW did not like this
 - Adding a special case in the JsCore JIT compiler assembly code to do
a call to a C++ method - name manging for MINGW is slightly different
and the linker could not resolve the symbol reference
 - Patching several MINGW win32api headers which did not correspond to
the api prototypes specified in MSDN and caused compile errors
 - Rebuilding mingw's libgdi32.a because it was missing the function
GetCharWidthI, and adding the prototype to the appropriate winapi
header. The lib was generated from MS's gdi32.lib using reimp (from
MINGW utils package) and dlltool
 - Rebuilding libuuid.a since it missed two COM interface IIDs. Rebuilt
from MS's uuid.lib using reimp and dlltool
 - Some type conversions were mede more explicit because the compiler
did not do them automatically. For example a function returning a
FloatRect object specifies in its return statement a winapi RECT
structure, for which MINGW did not know that it has to first convert it
to IntRect and then to FloatRect, so this conversion was made more explicit.
 - Converted some instantiations of classes using assignment to explicit
calls to the constructor, like Foo f = bar => Foo f(bar)
 - Some other changes that I cannot recollect at the moment

Could you point me to an example C/C++ application that embeds webkit
and loads a page, so that I can test the built binaries and know from
where to start learning the webkit API.
Once I can confirm the built webkit lib is working properly I will post
the patches.

Best regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avasilev.vcf
Type: text/x-vcard
Size: 127 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090123/db0cf1a3/attachment.vcf>

More information about the webkit-dev mailing list