Opened 16 years ago

Closed 16 years ago

#4270 closed patch (fixed)

MythTV on Windows (with MinGW)

Reported by: andrei@… Owned by: danielk
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords: Windows
Cc: Ticket locked: no

Description

The attached patches for MytTV and MythPlugins? allow building native Windows port of MythTV. It's very buggy at this point, but it works. See mythtv-dev mailing list for details.

Attachments (17)

mythtv.patch.gz (36.1 KB) - added by andrei@… 16 years ago.
mythplugins.patch.gz (4.0 KB) - added by andrei@… 16 years ago.
qt.patch.gz (7.8 KB) - added by andrei@… 16 years ago.
qt-3.3.x-p8 for mingw patch
mythtv.patch.2.gz (31.6 KB) - added by andrei@… 16 years ago.
4270-plugins-v1.patch (11.0 KB) - added by danielk 16 years ago.
What is left of the plugins patch; mythmusic & mythgallery.
4270-plugins-v2.patch.gz (3.2 KB) - added by andrei@… 16 years ago.
can't submit uncompressed - gets rejected as "spam"
4270-mythtv-v1.patch (110.8 KB) - added by danielk 16 years ago.
Version of mythtv portion after reading it over and making small edits (the .pro files still need some work).
mythtv-svn15115.patch.gz (21.5 KB) - added by andrei@… 16 years ago.
latest buildable MinGW patch
mingw-svn15128.patch (21.5 KB) - added by andrei@… 16 years ago.
See explanation in comments
mingw-svn15128.2.patch (20.6 KB) - added by andrei@… 16 years ago.
mingw.patch (1.1 KB) - added by andrei@… 16 years ago.
one of the latest commits broke upnputil.h (suseconds_t is not a type in MinGW and/or Windows)
mythplugins.patch (3.2 KB) - added by andrei@… 16 years ago.
mingw.2.patch (1.2 KB) - added by andrei@… 16 years ago.
suseconds_t, enable mediamonitor in mythfrontend
mythmusic.1.patch (1.3 KB) - added by anonymous 16 years ago.
Try to build mythmusic
mythplugins-configure.patch (768 bytes) - added by andrei@… 16 years ago.
this was supposed to be substring extraction in Bash. Changeset 15183 was not applied correctly.
mythgoom.patch (1.1 KB) - added by andrei@… 16 years ago.
mythgoom needs compat.h
mythmusic.patch (1.6 KB) - added by andrei@… 16 years ago.
allow mythmusic to compile using cddecoder_windows, use parent's implementation of some methods (for now)

Download all attachments as: .zip

Change History (49)

Changed 16 years ago by andrei@…

Attachment: mythtv.patch.gz added

Changed 16 years ago by andrei@…

Attachment: mythplugins.patch.gz added

Changed 16 years ago by andrei@…

Attachment: qt.patch.gz added

qt-3.3.x-p8 for mingw patch

comment:1 Changed 16 years ago by andrei@…

config script parameters that I used (debug): MythTV ./configure --prefix=/usr --disable-dbox2 --disable-hdhomerun \

--disable-dvb --disable-ivtv --disable-iptv \ --disable-joystick-menu \ --disable-xvmc-vld \ --disable-x11 \ --disable-xvmc \ --enable-directx \ --enable-memalign-hack \ --cpu=k8 \ --compile-type=debug

MythPlugins?: ./configure --prefix=/usr \

--disable-mytharchive \ --disable-mythbrowser \ --disable-mythflix \ --disable-mythgame \ --disable-mythnews \ --disable-mythphone \ --enable-aac \ --disable-mythzoneminder \ --disable-mythweb \ --enable-libvisual \ --enable-fftw \ --compile-type=debug

comment:2 Changed 16 years ago by danielk

Owner: changed from Isaac Richards to danielk
Priority: majorminor

Can you regenerate the mythtv patch against the current trunk?

Also the qt patch could be shrunk a bit by just defining Q_EXPORT as a follows: #undef Q_EXPORT #define Q_EXPORT

comment:3 Changed 16 years ago by danielk

(In [15068]) Refs #4270. Weather and SourceManager? define some methods without an implementations. Confusing the MS Windows linker.

comment:4 Changed 16 years ago by danielk

(In [15069]) Refs #4270. "LoadImage?" is an MS Windows macro, this renames the "LoadImage?" method to "Load" to avoid the collision.

comment:5 Changed 16 years ago by danielk

(In [15070]) Refs #4270. Two small fixes for mythcontrols, bzero->memset (POSIX) + dummy definition for method defined but not implemented in MythControls? (confuses MS Windows linker).

comment:6 Changed 16 years ago by danielk

(In [15071]) Refs #4270. Adds a compat.h header for dealing with platform incompatiblities.

Creates one place to place all the Windows/OSX/Linux hacks, so we have less ifdef's throughout the code.

This includes various MINGW hacks from Andrei, plus some of my own old windows hacks.

Changed 16 years ago by andrei@…

Attachment: mythtv.patch.2.gz added

comment:7 Changed 16 years ago by danielk

(In [15107]) Fixes #4284. Fixes #4298. Refs #4270. Rewrites the MythMediaDevice::isMounted() to use Qt classes rather than POSIX calls and to not print bogus warnings.

comment:8 Changed 16 years ago by danielk

(In [15108]) Refs #4270. Modified configure & version.pro for mingw

comment:9 Changed 16 years ago by danielk

(In [15112]) Refs #4270. Applies the libmyth portion of the mingw patches.

comment:10 Changed 16 years ago by danielk

(In [15113]) Refs #4270. mingw changes for mythweather (adds compat.h & USING_MINGW define.)

comment:11 Changed 16 years ago by danielk

(In [15114]) Refs #4270. mingw changes for mythvideo (adds compat.h, USING_MINGW define, and puts ioctl.h header in linux
freebsd ifdef block.)

comment:12 Changed 16 years ago by danielk

(In [15115]) Refs #4270. mingw changes for mythmovies (adds compat.h, USING_MINGW define, and removes declaration for checkDataReady() a method which has no implementation.)

Changed 16 years ago by danielk

Attachment: 4270-plugins-v1.patch added

What is left of the plugins patch; mythmusic & mythgallery.

Changed 16 years ago by andrei@…

Attachment: 4270-plugins-v2.patch.gz added

can't submit uncompressed - gets rejected as "spam"

Changed 16 years ago by danielk

Attachment: 4270-mythtv-v1.patch added

Version of mythtv portion after reading it over and making small edits (the .pro files still need some work).

comment:13 Changed 16 years ago by andrei@…

Daniel, I am working on the patch right now (it's 11:30PM here, so I'll wrap up soon and resume tomorrow), should I read your 4270-mythtv-v1.patch file and try to incorporate the changes or should I wait untill you commit the changes to SVN and then do it?

Changed 16 years ago by andrei@…

Attachment: mythtv-svn15115.patch.gz added

latest buildable MinGW patch

comment:14 Changed 16 years ago by danielk

(In [15120]) Refs #4270. Applies patch for MinGW compiling.

Mostly this does three things:

  • Renames methods that conflict with MS Windows defines/functions, or undefs the MS Windows defines.
  • Rearranges headers so things will compile under MingGW
  • Adds a some platform specific code, almost all isolated to compat.h or util.{h,cpp}

This won't fully compile under MinGW yet. I've removed all the suspect changes and code changes that require more extensive testing. The idea is to shrink the MinGW by taking out all the boilerplate stuff in this patch + bits that are only compiled under MinGW and can't break other builds.

Due to the header changes this may break the compile for you, please just post any compile error to the dev mailing list and I'll fix it.

PS The MYTH_BINARY_VERSION has changed, so plugins need to be recompiled.

comment:15 Changed 16 years ago by danielk

Andrei, make the next patch against the current svn now that I've applied the patch.

Try to explain each change and new file so I know why it is needed, and can suggest/implement a better solution if there is a problem with the current solution.

comment:16 Changed 16 years ago by danielk

(In [15122]) Refs #4270. MinGW compile fixes for mythgallery.

comment:17 Changed 16 years ago by danielk

(In [15123]) Refs #4270. MinGW compile fixes for mythmusic.

Changed 16 years ago by andrei@…

Attachment: mingw-svn15128.patch added

See explanation in comments

comment:18 Changed 16 years ago by andrei@…

compat.h:

use pragma warning(disable) only with Visual C++ gmtime_r and localtime_r are not needed here, they are only

used once and if left here generate "redefinition" warnings (they are defined in pthred.h, but not implemented)

#define lseek lseek64 creates two lseek64 defines with different

signatures - the compiler is not happy

operator==(pthread.... - not needed anymore signal() is actually supported in MinGW, just not all signals,

and besides, "signal" is used by QT, so this didn't work

ThreadedFileWriter?.cpp: see signal() explanation above

RingBuffer?.cpp: see lseek64() explanation

vsync.h, vsync.cpp: doesn't compile if not protected by #ifdef's

mythmainwindow.cpp: implement "get display dpi"

libmythui.def, libmythupnp.def: these are needed to create "import libraries" to

work around circular references between Myth libraries (e.g.: libmyth uses libmythui which uses libmyth)

mpegts.c: needs compat.h

os_support.c: if #ifdef CONFIG_NETWORK is where it is, it tries

unnecessarily to include <winsock2.h> and fails due to conflict between winsock close() and io close() and a bunch of other errors

audiooutputwin: fixes (didn't compile) (by the way, why do we need

to move Windows stuff to private class, if the header file is only included when compiling on Windows?)

util.cpp: new char[MAX_PATH+1] allocates memory, who frees it?

MAX_PATH is 260, actual restriction is 256, +1 is not necessary. Considering that it's just 260, I think stack allocation makes sense. I think we actually want to mkdir/create file, and then show error message if something went wrong.

upnptasknotify.h, httpserver.h: typo? (should be #ifndef, not #ifdef)

mythbackend/main.cpp: there's no fork() on Windows, new process does not

have open handles. Or am I missing something?

postprocess/postprocess.pro: hack, but I nelieve that postprocess.c is

not compiled on any other platform either. Excluding filter_postprocess.c gets rid of "undefined symbol" errors.

Changed 16 years ago by andrei@…

Attachment: mingw-svn15128.2.patch added

comment:19 Changed 16 years ago by danielk

(In [15135]) Refs #4270. This rearranges some includes so as to not break OS X compile.

comment:20 Changed 16 years ago by danielk

(In [15137]) Refs #4270. Adds the MinGW defines in settings.pro

comment:21 Changed 16 years ago by danielk

(In [15138]) Refs #4270. Removes MinGW defines from sub-pro files, now defined in settings.pro + removes NVR from MinGW build.

comment:22 Changed 16 years ago by danielk

(In [15139]) Refs #4270. Adds def files for MinGW build. These are needed due to the circular dependencies.

comment:23 Changed 16 years ago by danielk

(In [15143]) Refs #4270. More MinGW fixes.

Changed 16 years ago by andrei@…

Attachment: mingw.patch added

one of the latest commits broke upnputil.h (suseconds_t is not a type in MinGW and/or Windows)

Changed 16 years ago by andrei@…

Attachment: mythplugins.patch added

comment:24 Changed 16 years ago by andrei@…

The last mythplugins.patch allows mythmusic to compile with CDDA functionality disabled.

comment:25 Changed 16 years ago by Nigel

1) suseconds_t should now be something like:

Index: compat.h
===================================================================
--- compat.h    (revision 15161)
+++ compat.h    (working copy)
@@ -240,6 +240,10 @@
 // suseconds_t
 #include <sys/types.h>
 
+#ifdef USING_MINGW
+    typedef long long suseconds_t;
+#endif
+
 #include "mythconfig.h"
 #if defined(CONFIG_DARWIN) && ! defined (_SUSECONDS_T)
         typedef int32_t suseconds_t;   // 10.3 or earlier don't have this

but could it be int32_t (like Darwin) instead of long long?

2) For MythMusic, instead of the #ifdefs, it might be better to make a mostly empty cddecoder implementation? e.g.cddecoder-windows.cpp? I can knock one up if you like?

Changed 16 years ago by andrei@…

Attachment: mingw.2.patch added

suseconds_t, enable mediamonitor in mythfrontend

comment:26 Changed 16 years ago by Nigel

(In [15180]) MinGW suseconds_t. Linux seems to use a long, so I will do same here. See #4270

comment:27 Changed 16 years ago by Nigel

(In [15181]) Enable Media Monitor on WIN32 (now that there is a WinGW version). See #4270

comment:28 Changed 16 years ago by Nigel

(In [15182]) Horrible skeleton cddecoder to allow Windows compilation. (?) See #4270

comment:29 Changed 16 years ago by Nigel

(In [15183]) Better MinGW check (non-OS specific). See #4270

Changed 16 years ago by anonymous

Attachment: mythmusic.1.patch added

Try to build mythmusic

Changed 16 years ago by andrei@…

Attachment: mythplugins-configure.patch added

this was supposed to be substring extraction in Bash. Changeset 15183 was not applied correctly.

Changed 16 years ago by andrei@…

Attachment: mythgoom.patch added

mythgoom needs compat.h

Changed 16 years ago by andrei@…

Attachment: mythmusic.patch added

allow mythmusic to compile using cddecoder_windows, use parent's implementation of some methods (for now)

comment:30 Changed 16 years ago by Nigel

(In [15190]) Mistake in MinGW check [15183]. See #4270

comment:31 Changed 16 years ago by Nigel

(In [15191]) MinGW build fix. See #4270

comment:32 Changed 16 years ago by Nigel

Resolution: fixed
Status: newclosed

(In [15193]) Allow mythmusic to compile under MinGW. Closes #4270

Note: See TracTickets for help on using tickets.