[mythtv] [RFC v2] New Win32 build script

Dan Wilson dwilson at solidstatesoftware.com
Wed Jan 19 07:44:15 UTC 2011


On 01/18/2011 01:29 PM, Lawrence Rust wrote:
>
> Coincidentally, I have just put the finishing touches to this final
> release which will cross compile, compile natively on Windows using Msys
> or produce a native build on Linux (Intel and PowerPC) and maybe MacOSX
> too.  You can find it here:
>
> http://www.softsystem.co.uk/download/mythtv/mythbuild-110118.zip
>

It still doesn't work for me.  I am running Fedora 14 64-bit:
> Usage:
>
> $ unzip mythbuild-110118.zip&&  chmod +x mythbuild.sh
>
> NB the patches too are now downloaded at runtime from the web.
>
> # For general info on the script
> $ ./mythbuild -h
>
> # To cross-compile latest MythTV master branch with debugging:
> $ ./mythbuild -b master -d
>
> # To cross-compile MythTV fixes/0.24 branch:
> $ ./mythbuild -b fixes/0.24

I had to use ./mythbuild.sh.  Is there a preferred/required shell one 
should be using when invoking the script?  (I generally use tcsh, btw).

I started in a clean subdirectory (mythbuild.sh was the only file in the 
directory, there were no subdirectories):

./mythbuild.sh -b fixes/0.24

*********************************************************************
Building MythTV branch 'fixes/0.24' (release) for Windows
*********************************************************************

Press [Return] to continue or [Control-C] to abort:

Target changed.  Reconfiguring all packages
touch: cannot touch 
`/home/dwilson/mythbuildw32/mythbuild/target-Windows': No such file or 
directory


So I created the mythbuild subdirectory, and that got us further:

./mythbuild.sh -b fixes/0.24

*********************************************************************
Building MythTV branch 'fixes/0.24' (release) for Windows
*********************************************************************

Press [Return] to continue or [Control-C] to abort:

Target changed.  Reconfiguring all packages

....

*********************************************************************
Building unzip60...
*********************************************************************

Extracting unzip60.zip ...
Applying patch unzip60/SFXWiz32.diff
patching file process.c
patching file windll/guisfx/sfxwiz.c
+ make -j 5 CC=i686-pc-mingw32-cc AR=i686-pc-mingw32-ar 
RC=i686-pc-mingw32-windres LOCAL_UNZIP=-DCHEAP_SFX_AUTORUN guisfx
i686-pc-mingw32-cc -c -DWIN32 -DFORCE_WIN32_OVER_UNIX  -Wall  
-DIZ_CRCOPTIM_UNFOLDTBL -DASM_CRC -DCHEAP_SFX_AUTORUN -o sfxwiz.o  -Os 
-mcpu=pentiumpro -DSFX -I. windll/guisfx/sfxwiz.c
make: i686-pc-mingw32-cc: Command not found



i686-pc-mingw32-cc appears to be called i686-pc-mingw32-gcc on this 
system.  I changed the script by adding a 'g' and it ran until it got 
into the libxml2 make:

i686-pc-mingw32-gcc -DHAVE_CONFIG_H -I. -I./include -I./include  
-D_REENTRANT    -DWIN32  -g -O2 -pedantic -W -Wformat -Wunused 
-Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat 
-Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith 
-Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes 
-Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -MT 
testC14N.o -MD -MP -MF .deps/testC14N.Tpo -c -o testC14N.o testC14N.c
testThreads.c: In function 'main':
testThreads.c:110:6: error: conversion to non-scalar type requested
make[2]: *** [testThreads.o] Error 1

The line in question is:    tid[i] = (pthread_t) -1;

which is seriously wrong code!

I looked at where tid[i] is used, and couldn't see why this line was 
required, plus I figured the build script wouldn't try to run 
testThreads, so I just commented out that line and continued.  Perhaps 
that needs to be added to the patch list?

Next problem:  libxml2 build dies due to failure to find needed include 
files. This eventually turned into a rat-hole that I couldn't get out of.
First missing include was bits/wordsize.h file.
A copy of that file is present in /usr/include/bits/wordsize.h, but the 
script/compiler isn't finding it. mingw32 doesn't seem to have one.
I moved a copy of /usr/include/bits/wordsize.h to 
mythbuild/libxml2-2.7.8/include/bits/wordsize.h.  Then I edited the 
copied file to force 32-bit word size, just in case.
I then got another missing include file "pyconfig-32.h".  Since this is 
a 64-bit system, /usr/include/python2.7 has pyconfig.h and 
pyconfig-64.h, but no pyconfig-32.h.
I installed python-2.7-8.fc14.1.i686 package, which got me pyconfig-32.h.
Next missing include was sys/select.h, which is present in 
/usr/include/sys.  I copied it to mythbuild/libxml2-2.7.8/include/sys.
/usr/i686-pc-mingw32/sys-root/mingw/include/sys directory exists, by the 
way, but select.h is not in it.
Next missing include was features.h, which is in /usr/include.  I copied 
it to mythbuild/libxml2-2.7.8/include.
Next it was missing another include file from /usr/include/sys.  At this 
point, I got impatient and just copied the entire contents of 
/usr/include/sys to mythbuild/libxml2-2.7.8/include/sys.
Next missing include was gnu/stubs.h.  While /usr/include/gnu/stubs.h 
exists, it was clear that it would also need gnu/stubs-32.h, which is 
only present in the i686 glibc-devel package.  So I installed 
glibc-devel-2.12.90-21.i686 package, then copied gnu subdirectory to 
mythbuild/libxml2-2.7.8/include/gnu.
Next missing include was bits/types.h.  I copied it. bits/typesizes.h 
was also missing, and needed, so I copied that as well.

And there were more - I won't bore you with them here further. It's 
clear that something is badly wrong with the libxml2 make script when 
trying to cross-compile on a 64-bit system for a 32-bit target. I don't 
see this as your problem, really - the libxml2 developers ought to 
support that better?

In the meantime, I was curious to see what would happen once I got past 
libxml2, so I kept copying and modifying files as needed.

Unfortunately, I hit a wall.

In file included from ../include/libxml/nanoftp.h:20:0,
                  from libxml_wrap.h:7,
                  from libxml2-py.c:7:
/usr/i686-pc-mingw32/sys-root/mingw/include/winsock2.h:64:3: error: 
conflicting types for 'fd_set'
../include/sys/select.h:78:5: note: previous declaration of 'fd_set' was 
here
/usr/i686-pc-mingw32/sys-root/mingw/include/winsock2.h:109:8: error: 
redefinition of 'struct timeval'
../include/bits/time.h:75:8: note: originally defined here

/usr/i686-pc-mingw32/sys-root/mingw/include/sys directory exists, by the 
way, but select.h is not in it.

There were more errors like this, but you see the nature of them here. I 
"could" go in and attempt to fix this by hand, but I've reached the end 
of my patience with libxml2. Any chance we can get libxml2 developers to 
fix the cross-compilation problems, I wonder?

In the meantime, I'm going to install fedora 14 32-bit into a virtual 
machine and try this process there.  I'll let you know in another post 
how it goes.

Thanks for all your hard work on this!

Dan.



More information about the mythtv-dev mailing list