[mythtv] [RFC v2] New Win32 build script

Lawrence Rust lvr at softsystem.co.uk
Wed Jan 19 09:30:54 UTC 2011


On Tue, 2011-01-18 at 23:44 -0800, Dan Wilson wrote:
[snip]
> > # To cross-compile MythTV fixes/0.24 branch:
> > $ ./mythbuild -b fixes/0.24
> 
> I had to use ./mythbuild.sh.

Thanks for trying the script and apologies for the misinformation -
trying to rush and missed the extension.

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

I've only tested with bash.  There are a couple of places where
arithmetic evaluation e.g. "for ((..." is used so a standard sh will
baulk at that.

> 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

Oops - late change swapped 2 small blocks and I didn't test on a clean
install.  Thanks.

> 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'

OK, later builds of mingw have dropped the cc alias.  Noted.

>  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?

The same problem occurs on a native Windows build with MSys and is
mentioned in a comment in the script.  The script disables threads in
this case.  Thread support in libxml2 isn't required by Myth so I have
disabled it for all systems.

> 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?

What a mess.  Looks like autoconf could be at fault and is confusing
host and build system include paths.  That doesn't bode well since many
of the following packages also use the same autoconf 2.66

> 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.

Libxml2 isn't a pre-requisite to build MythTV and wasn't even included
until the current master branch so you could just comment out the call
to build LIBXML2

> 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!

Thanks for the feedback.

-- Lawrence




More information about the mythtv-dev mailing list