Ticket #4270 (closed patch: fixed)
Opened 5 years ago
Last modified 5 years ago
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
Change History
comment:1 Changed 5 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 5 years ago by danielk
- Owner changed from ijr to danielk
- Priority changed from major to minor
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 5 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 5 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 5 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 5 years ago by danielk
comment:7 Changed 5 years ago by danielk
comment:8 Changed 5 years ago by danielk
comment:9 Changed 5 years ago by danielk
comment:10 Changed 5 years ago by danielk
comment:11 Changed 5 years ago by danielk
comment:12 Changed 5 years ago by danielk
Changed 5 years ago by danielk
- Attachment 4270-plugins-v1.patch added
What is left of the plugins patch; mythmusic & mythgallery.
Changed 5 years ago by andrei@…
- Attachment 4270-plugins-v2.patch.gz added
can't submit uncompressed - gets rejected as "spam"
Changed 5 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 5 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 5 years ago by andrei@…
- Attachment mythtv-svn15115.patch.gz added
latest buildable MinGW patch
comment:14 Changed 5 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 5 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 5 years ago by danielk
comment:17 Changed 5 years ago by danielk
comment:18 Changed 5 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.
comment:19 Changed 5 years ago by danielk
comment:20 Changed 5 years ago by danielk
comment:21 Changed 5 years ago by danielk
comment:22 Changed 5 years ago by danielk
comment:23 Changed 5 years ago by danielk
Changed 5 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)
comment:24 Changed 5 years ago by andrei@…
The last mythplugins.patch allows mythmusic to compile with CDDA functionality disabled.
comment:25 Changed 5 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 5 years ago by andrei@…
- Attachment mingw.2.patch added
suseconds_t, enable mediamonitor in mythfrontend
comment:26 Changed 5 years ago by nigel
comment:27 Changed 5 years ago by nigel
comment:28 Changed 5 years ago by nigel
comment:29 Changed 5 years ago by nigel
Changed 5 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 5 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 5 years ago by nigel
comment:31 Changed 5 years ago by nigel
comment:32 Changed 5 years ago by nigel
- Status changed from new to closed
- Resolution set to fixed
