[mythtv] MythTV on Mac OS X for Intel

MythTV mythtv at taoyama.com
Tue Mar 21 09:19:59 UTC 2006


Todd and Nigel,

I just posted on the list another mechanism for getting cpu info that  
might help.  It uses the 'hostinfo' command to determine the cpu type.

I also just found that on an Intel machine sysctl returns some more  
useful information.

This is from my Intel MacMini:

machdep.cpu.vendor: GenuineIntel
machdep.cpu.brand_string: Genuine Intel(R) CPU           T2300  @  
1.66GHz
machdep.cpu.model_string: Unknown Intel P6 Family
machdep.cpu.family: 6
machdep.cpu.model: 14
machdep.cpu.extmodel: 0
machdep.cpu.extfamily: 0
machdep.cpu.feature_bits: -1075184641 49577
machdep.cpu.extfeature_bits: 1048576 0
machdep.cpu.stepping: 8
machdep.cpu.signature: 1768
machdep.cpu.brand: 0
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP  
MTRR PGE MCA CMOV PAT CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM SSE3  
MON VMX EST TM2 TPR
machdep.cpu.extfeatures: XD
machdep.cpu.logical_per_package: 2
machdep.cpu.cores_per_package: 2

I think we can make this work even better since I think  
"machdep.cpu.features" and "machdep.cpu.model_string" can be fed  
directly into the "processor_flags" and "processor" variables in  
configure and the normal x86 settings will work.

The commands would be:
sysctl -n machdep.cpu.model_string
sysctl -n machdep.cpu.features

I'll see if I can come up with a good patch using both the 'hostinfo'  
and 'sysctl' that will work cleanly for both PPC and Intel.

Mino


On Mar 21, 2006, at 12:34 AM, Todd Ignasiak wrote:

> On 3/20/06, Nigel Pearson <nigel at ind.tansu.com.au> wrote:
>>> I used these arguments to configure:
>>>
>>> env QMAKESPEC=/opt/local/share/qt3/mkspecs/macx-g++ \
>>> LD_LIBRARY_PATH=/opt/local/lib \
>>>    ./configure --prefix=/opt/myth --arch=i686 \
>>>              --disable-distcc \
>>>              "--extra-cflags=-msse -msse2" \
>>>              "--extra-cxxflags=-msse -msse2" \
>>>              --cc=gcc
>>
>>
>>         Kris, Todd, others.
>>
>>         Could I get you to try these configure changes?
>> I am hoping it will now auto-configure on an Intel Mac.
>> The tuning flags are probably wrong, but we can argue
>> those later.
>
> The CPU type has some whitespace that's getting in the way:
>
> ./configure
> find: /Developer/FireWireSDK*: No such file or directory
> # Basic Settings
> Compile type     release
> Compiler cache   no
> DistCC           yes
> Install prefix   /usr/local
> CPU              x86 (      Intel Core Duo)
> Big Endian       no
> MMX enabled      no
> Vector Builtins  no
>
>
> Changing the sed expression to "sed 's/^[ \t]*CPU Type: //'" worked  
> for me:
>
> ./configure
> find: /Developer/FireWireSDK*: No such file or directory
> # Basic Settings
> Compile type     release
> Compiler cache   no
> DistCC           yes
> Install prefix   /usr/local
> CPU              x86 (Intel Core Duo)
> Big Endian       no
> MMX enabled      yes
> Vector Builtins  no
>
> Also, a couple more questions on MacOS configure defaults:
>
> --disable-distcc:  distcc is installed on Macs, but the build fails
> when it is used in the default config.  Should it be disabled by
> default?
> --disable-mmx:  the Intel CPUs support MMX.  But, without some patches
> to tweak the syntax, compile fails.
>
>> Index: configure
>> ===================================================================
>> --- configure   (revision 9412)
>> +++ configure   (working copy)
>> @@ -221,6 +221,18 @@
>>       processor_flags=`cat /proc/cpuinfo | grep "flags" | head -n 1`
>>   fi
>>
>> +# Mac OS X equivalent
>> +if test -x /usr/sbin/system_profiler ; then
>> +    processor=`/usr/sbin/system_profiler SPHardwareDataType \
>> +               | grep 'CPU Type' | sed 's/CPU Type: //'`
>> +    if [ x"$processor" = x"Intel Core Solo" \
>> +         -o x"$processor" = x"Intel Core Duo" ]; then
>> +      # Override the default (useless) i386 for auto-MMX detection
>> later
>> +      cpu="pentium-m"
>> +      cpu_raw=$cpu
>> +    fi
>> +fi
>> +
>>   # These have to be looked up early for some types of cross- 
>> compiling
>> to work
>>   cpu_overide="no"
>>   for opt do
>> @@ -487,6 +499,7 @@
>>   strip="strip -x"
>>   LDFLAGS="-Wl,-search_paths_first"
>>   FFSLDFLAGS=-Wl,-bind_at_load
>> +memalignhack="yes"   # Probably not useful, but needed on Intel?
>>   ;;
>>   MINGW32*)
>>   # Note: the rest of the mingw32 config is done afterwards as  
>> mingw32
>> @@ -1279,6 +1292,10 @@
>>          optimize="small"
>>          cpu_raw="c3"
>>
>> +# Intel Core
>> +   elif expr "$processor" : ".*Intel Core" > /dev/null ; then
>> +       ARCHFLAGS="-march=pentium-m -msse -msse2 -msse3 -mfpmath=sse
>> -ffast-math"
>> +
>>   # if no known processor info, tune base on cpu_raw info
>>      elif test x"$cpu_raw" = x"i686" -a x"$mmx" = x"yes" ; then
>>          ARCHFLAGS="-march=pentium2"
>>
>> --
>> Nigel Pearson, nigel at ind.tansu.com.au|  "Let's see how Spike is  
>> going"
>> Telstra Net. Eng., Sydney, Australia |              ...
>> Office: 9814 4803    Fax:  9814 4897 |"I'd like to keep Spike as my
>> pet."
>> Mobile: 0408 664435  Home: 9792 6998 |        Illyria - Angel
>>
>> _______________________________________________
>> mythtv-dev mailing list
>> mythtv-dev at mythtv.org
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>



More information about the mythtv-dev mailing list