2012/2/4 Rafaël Carré <span dir="ltr"><<a href="mailto:funman@videolan.org">funman@videolan.org</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Le 2012-02-03 19:04, Rafaël Carré a écrit :<br>
> vlc | branch: master | Rafaël Carré <<a href="mailto:funman@videolan.org">funman@videolan.org</a>> | Thu Feb  2 18:23:20 2012 -0500| [521f40906c11615b9da6fabb19870724b91769fb] | committer: Rafaël Carré<br>
><br>
> contrib: detect mingw-w64 (as opposed to <a href="http://mingw.org" target="_blank">mingw.org</a>)<br>
<br>
Hello,<br>
<br>
I want to explain what is going on with all the mingw changes.<br>
<br>
<br>
Q. What is Mingw?<br>
A. Mingw is a set of headers and libraries which mimic the Windows SDK,<br>
and let people build applications for Windows without Windows.<br>
It's the equivalent of glibc for Linux.<br>
<br>
Q. What is <a href="http://mingw.org" target="_blank">mingw.org</a>?<br>
A. Often called "mingw32", it's the first project which shipped such<br>
libraries and headers, targetting Windows/i386.<br>
On Debian it's installed in /usr/i586-mingw32msvc<br>
See <a href="http://www.mingw.org/" target="_blank">http://www.mingw.org/</a><br>
<br>
Q. What is mingw-w64?<br>
A. It's a fork of <a href="http://mingw.org" target="_blank">mingw.org</a> which adds Win64 compatibility (targetting<br>
x86_64), but keeps Win32 compatibility.<br>
On Debian it's installed in /usr/x86_64-w64-mingw32 and<br>
/usr/i686-w64-mingw32.<br>
See <a href="http://mingw-w64.sourceforge.net/" target="_blank">http://mingw-w64.sourceforge.net/</a><br>
<br>
Q. What does VLC build with?<br>
A. It was always built with <a href="http://mingw.org" target="_blank">mingw.org</a><br>
See <a href="http://wiki.videolan.org/Win32Compile" target="_blank">http://wiki.videolan.org/Win32Compile</a><br>
<br>
<br>
<br>
So to build VLC with <a href="http://mingw.org" target="_blank">mingw.org</a> you need:<br>
        gcc built for i586-ming32msvc target (available as gcc-mingw32 in<br>
debian, which is gcc 4.4)<br>
        binutils built for i586-mingw32msvc target (available as<br>
mingw32-binutils in debian, which is binutils 2.20)<br>
        <a href="http://mingw.org" target="_blank">mingw.org</a> >= 3.15 (only 3.13 is available in debian, you can get a more<br>
recent package on <a href="http://people.videolan.org/~jb/debian/" target="_blank">http://people.videolan.org/~jb/debian/</a> , or get 3.15<br>
from Ubuntu).<br>
        directx, directshow, direct2d, and dxva2api headers which are absent<br>
from <a href="http://mingw.org" target="_blank">mingw.org</a> (that is taken care by the contrib)<br>
<br>
<br>
<br>
If you want to use mingw-w64 (for either 32bits or 64bits), you need:<br>
        gcc built for your target (debian has gcc-mingw-w64 which is gcc 4.6.2)<br>
        binutils built for your target (debian has binutils-mingw-w64 which<br>
depends on both targets)<br>
        mingw-w64 built for your target.<br>
<br>
<br>
So which version of mingw-w64 works with VLC ? Let's see....<br>
<br>
<= 2.0.0 has a #define printf __mingw_printf which breaks printf format<br>
attribute and C++ using printf as a name for class members, so it can<br>
not be used to build Qt4.<br>
<br>
2.0.1 has fixes for printf functions, but a bug in the definition of<br>
asprintf will make VLC crash at runtime.<br>
<br>
2.0.1+svn4784-1 available in Debian works, but<br>
include/sdks/_mingw_directx.h incorrectly states that DirectX SDK is not<br>
available while it is; you can change the #if 0 into #if 1 into that file.<br>
<br>
I was recently given commit access to mingw-w64 and I have been<br>
contributing fixes for those issues.<br>
<br>
<br>
What remains to be done:<br>
- Fix the availability of DirectX SDK in header<br>
- Fix ID2D1HwndRenderTarget interface (d2d1.h in Debian's version is not<br>
detected by VLC due to using C++ syntax, which is fixed already)<br>
<br>
When that 2 changes will be done, 3.0 and 2.0.2 will be the first<br>
versions of mingw-w64 able to build VLC out of the box (and without<br>
using external headers).<br>
<br>
You can find automated builds for both 32/64 bits target, and for Linux<br>
i386/amd64 / Windows (presumably 32bits) and OSX (presumably i386) on:<br>
<a href="http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Automated%20Builds/" target="_blank">http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Automated%20Builds/</a><br>

<a href="http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/" target="_blank">http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/</a><br>

<br>
However I don't know the schedule for rebuild.<br>
<br></blockquote><div><br></div><div>If this workflow works with Debian netinst, I could do Wiki tutorial for virtual machine compile since build from Windows seems somewhat error prone for new developers.</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
So you can continue to use <a href="http://mingw.org" target="_blank">mingw.org</a> without worrying, and if you have a<br>
question about mingw-w64 I will be glad to answer.<br>
<br>
<br>
In the meantime I advise to use debian sid versions of mingw-w64, and<br>
fix /usr/*/include/sdks/_mingw_directx.h . I will speak soon with the<br>
package maintainer to have a fixed version.<br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br>
</blockquote></div><br>