Opened 17 years ago

Closed 16 years ago

#3062 closed enhancement (fixed)

Freebsd compatibility patches

Reported by: usleepless@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

a couple of things to make compiling mythtv on freebsd possible.

Attachments (2)

mythtv-freebsd.diff (7.2 KB) - added by usleepless@… 17 years ago.
yuv2rgb.cpp.diff (564 bytes) - added by anonymous 17 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 17 years ago by anonymous

Type: defectenhancement

comment:2 Changed 17 years ago by usleepless@…

the yuv2rgb patch is no good: the #ifdef needs to be around the RGBOUT macro, not within.

comment:3 Changed 17 years ago by usleepless@…

fixed the yuv2rgb patch, added patches to httprequest.cpp and FrameAnalyer?.h

comment:4 Changed 17 years ago by usleepless@…

added patch for version.pro ( explicitly calling sh )

comment:5 Changed 17 years ago by usleepless@…

added patches:

libs/libmythupnp/upnputil.h programs/mythbackend/backendutil.cpp

mythtv-svn now compiles on FreeBSD with these patches.

comment:6 Changed 17 years ago by Nigel

videodev_myth.h - Patch is good on OS X 10.4. (although I am curious as to why it is needed. Yes the current code is non-portable, but are long longs not 64bit on FreeBSD?)
mpegrecorder.cpp - Doesn't FreeBSD have select() ? (I thought if OS X does, FreeBSD would too?)
mainserver.cpp - What is the problem with the lock?
videoout_xv.cpp - I suspect NetBSD also lacks malloc.h. It should probably be:

#ifdef _linux_
#include <malloc.h>
#endif


yuv2rgb.cpp - Don't see the need. The values should all be small positives (e.g. UCHAR_MAX is 255)
httprequest.cpp - Could you use the sendfile64() that I wrote for Darwin instead?
upnputil.h - How about this instead:

#ifdef __FreeBSD__
#define __suseconds_t_defined
#endif


version.pro - Curious. What is the behavior without the sh -c ?
Sorry if I seem picky here. I just want to understand these, and make sure it all works for Linux, *BSD, Darwin, and maybe even Windows.

Changed 17 years ago by usleepless@…

Attachment: mythtv-freebsd.diff added

comment:7 Changed 17 years ago by usleepless@…

Nigel,

adjusted videoout_xv.cpp patch, removed yuv2rgb.cpp patch ( is only failing on amd64-fbsd? ), adjusted upnputil.h patch, used sendfile64 in httprequest.cpp.

freebsd compatibility would be very welcome.

regards,

usleep

comment:8 Changed 17 years ago by Nigel

(In [12798]) Various small FreeBSD compatibility patches. See #3062 The hairy ones are commented as HACK

Changed 17 years ago by anonymous

Attachment: yuv2rgb.cpp.diff added

comment:9 Changed 17 years ago by usleepless@…

Added a refined patch for yuv2rgb.cpp, needed for AMD64/FreeBSD compile.

Somehow the compiler casts UCHAR_MAX ( which is defined as 0xff at the base ) to an unsigned int, while the second parameter to std::min ( std::max ) returns a signed int. std::min can not cope. The problem does not occur on i386.

comment:10 Changed 17 years ago by usleepless@…

Oh, and the yuv2rgb.cpp problem also occurs on openbsd ( this is where the patch came from ):

http://www.phaze.org/mythtv/obsd_myth.patch

comment:11 Changed 17 years ago by Nigel

(In [12807]) FeeeBSD compat. fixes. See #3062

comment:12 Changed 17 years ago by Janne Grunau

(In [13252]) Refs #3062. include malloc.h only if configure found it

comment:13 Changed 16 years ago by Nigel

Resolution: fixed
Status: newclosed

I haven't heard any other FreeBSD build problems, so I assume this can be closed.

Note: See TracTickets for help on using tickets.