[mythtv] Cross-compiling on Mac OS X 10.6 to 10.4 (tiger)

david.w.smiley at gmail.com david.w.smiley at gmail.com
Tue Oct 19 04:23:42 UTC 2010

I'm trying to build the MythTV for Mac OS X 10.4 to run on an AppleTV (which
runs a stripped down 10.4).  The only MythTV components I'm after right now
are the backend components: MythBackend, MythFillDatabase, MythCommFlag, and
MythJobQueue -- no GUI components.  I'll ultimately view the shows with an
up-and-coming plugin for Boxee: MythBoxee, and I'll manage show recordings
via Mythweb.  I already demonstrated that the meager AppleTV hardware only
used 40% of my CPU when watching 720p HD via Boxee, so long as the video was
encoded properly.  I'm very impressed.

My main challenge right now is cross-compiling MythTV on my 10.6 laptop for
10.4.   I've been modifying osx-packager.pl, not messing with anything
else.  The command I run is: ./osx-packager.pl -svnbranch release-0-23-fixes
-verbose -enable-backend -enable-jobtools -pluginskip -themeskip

The first change was a minor one which is adjusting the @targets arrays to
to not have the MythTV components I didn't care about (see the 1st
paragraph).  AFAIK I did this right.

To do the cross-compile, I needed to do a fair bit of googling and trial and
error.  I'm a Java expert but I'm clueless when it comes to building UNIX
oriented C/C++ apps. I've managed to build MythTV's dependencies with the
exception of QT.  I set the following environment variable near the top of
the perl script:
  our $SDKROOT = "/Developer/SDKs/MacOSX10.4u.sdk";
The critical thing now is modifying the CFLAGS env and LDFLAGS env.  I
altered 2 relevant lines of the script to be these two lines:
  $ENV{'CFLAGS'} = $ENV{'CXXFLAGS'} = $ENV{'CPPFLAGS'} = "-isysroot $SDKROOT
-arch i386 -mmacosx-version-min=10.4 -I$SDKROOT/usr/include/gcc/darwin/3.3
  $ENV{'LDFLAGS'} = "-isysroot $SDKROOT -arch i386 -mmacosx-version-min=10.4
Two tricks here were: firstly discovering that LDFLAGS needed to use
isysroot (like CFLAGS does) not syslibroot, and secondly that the gcc/darwin
related path there was needed to resolve stdarg.h not being able to process
the line:  #include_next <stdarg.h>

I've read a bunch of pages on QT... and in the end I downloaded it
precompiled for v4.7 for the Mac "Carbon" framework since Qt's Cocoa-only
support doesn't support Mac 10.4.  Hopefully in the end I can simply copy
the Qt Mac Framework directories over to the AppleTV and have that work.  I
think myth is currently compiling against 4.6 headers which managed to get
on the build path from an earlier failed build attempt but hopefully that
doesn't matter.

I'm not sure how to cross-compile MythTV for 10.4.  I've tried something or
two but I'm running out of steam... not being familiar with any of these
technologies (I'm a Java guy remember), I feel lost in the deep woods.  Can
someone offer any tips/advise or care to help?

~ David Smiley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-dev/attachments/20101019/a83d7616/attachment.htm>

More information about the mythtv-dev mailing list