[mythtv] [RFC v2] New Win32 build script

Lawrence Rust lvr at softsystem.co.uk
Mon Dec 13 10:01:48 UTC 2010

On Sun, 2010-12-12 at 23:41 -0800, Dan Wilson wrote:
> On 12/11/2010 09:49 AM, Lawrence Rust wrote:
> > After a number of comments and suggestions I have revised the Windows
> > cross compiling build script.  Thanks to everyone who contributed.  The
> > new script can be viewed here:
> > http://www.softsystem.co.uk/download/mythtv/mythbuildw32-1
> >
> > An archive of the script and its associated (mandatory) patches is here:
> > http://www.softsystem.co.uk/download/mythtv/mythbuildw32-1.zip
> >
> Thanks for your hard work on improving the win32 compilation support!
> On Windows XP Pro (actually a windows XP virtual machine running under 
> vmware workstation), using mythbuildw32-1.zip, I get this:
> $ ./mythbuildw32
> *********************************************************************
> Building MythTV fixes/0.24 for Windows.
> *********************************************************************
> Press [Return] to continue or [Control-C] to abort:
> *********************************************************************
> ftp wget-1.11.4.tar.bz2
> ftp.exe: connect: Not owner

What does ftp.exe --version report?

This could be a temporary problem with ftp://mirror.cict.fr which is the
URL in the script for wget.  Maybe try:

WINGET_URL="ftp://ftp.gnu.org/gnu/wget/wget-1.11.4.tar.bz2" ./mythbuildw32

If not then maybe some tcp/ip or nat problem with vmware?

> Not connected.
> Not connected.
> Not connected.
> Passive mode on.
> Not connected.
> Extracting wget-1.11.4.tar.bz2 ...
> tar (child): wget-1.11.4.tar.bz2: Cannot open: No such file or directory
> tar (child): Error is not recoverable: exiting now
> tar: Child returned status 2
> tar: Error is not recoverable: exiting now

Expected error behaviour with an invalid archive.  Unfortunately ftp.exe
doesn't return an nice error code on failure.

It's an ugly fudge to workaround the lack of wget in Msys. Alternatively
you can install a pre-built wget from here:

And the script will use that.

> I then tried cross-compiling in linux (Fedora 14 x86_64), and got the 
> following:
> *********************************************************************
> Cross building MythTV fixes/0.24 for Windows using i686-pc-mingw32
> *********************************************************************
> Press [Return] to continue or [Control-C] to abort:
> <stdin>: In function 'int main()':
> <stdin>:2:26: error: '_clear87' was not declared in this scope
> <stdin>:2:43: error: '_control87' was not declared in this scope

This is expected if the mingw compiler has a bug in the float.h header.

> The mingw32 <float.h> header must be patched to compile Qt.
> Do you wish to apply this patch (sudo is required) [Yn] y
> The text leading up to this was:
> --------------------------
> |--- /usr/i686-pc-mingw32/include/float.h    2009-06-30 
> 10:32:33.000000000 +0200
> |+++ /usr/i686-pc-mingw32/include/float.h    2010-11-03 
> 22:55:07.000000000 +0100
> --------------------------
> File to patch: ^C

The patch failed due to the path to float.h varying between different
versions/builds of mingw.  Several others have reported this and I
believe that I have a solution.  In the meantime decline the patch to

> $ find /usr -name float.h

It's this one:
> /usr/i686-pc-mingw32/sys-root/mingw/include/float.h
> /usr/local/src/wine/wine-1.1.30/include/msvcrt/float.h
> /usr/local/eldk-4.1/ppc_85xx/usr/src/linux-
> /usr/local/eldk-4.1/ppc_85xx/usr/src/linux-
> /usr/local/eldk-4.1/ppc_85xx/usr/lib/gcc/ppc-linux/4.0.0/include/float.h
> /usr/local/eldk-4.1/usr/lib/gcc/powerpc-linux/4.0.0/include/float.h
> /usr/local/eldk-4.1/usr/lib/gcc/powerpc-linux/4.0.0/install-tools/include/float.h
> /usr/local/include/wine/msvcrt/float.h
> /usr/include/c++/4.5.1/tr1/float.h
> /usr/lib/gcc/x86_64-redhat-linux/4.5.1/include/float.h

and the next one that need fixing:
> /usr/lib64/gcc/i686-pc-mingw32/4.5.0/include/c++/tr1/float.h
> /usr/lib64/gcc/i686-pc-mingw32/4.5.0/include/float.h


There's a revised script to work around these path problems here:

This version will also do a full debug build:

MYTHBUILD=debug ./mythbuildw32

NB it adds quite some time to build a debug Qt.
Subsequent builds will stick with last build type.  To change back to

MYTHBUILD=release ./mythbuildw32

Thanks for your help.

-- Lawrence

More information about the mythtv-dev mailing list