Ticket #26454: patch-cpuinfo-tovid-init.in.2.diff

File patch-cpuinfo-tovid-init.in.2.diff, 1.3 KB (added by danielb@…, 14 years ago)
  • src/tovid-init.in

    old new  
    449449
    450450
    451451# ******************************************************************************
    452 # Platform-specific initialization
    453 # Determines host platform and configures things accordingly
     452# configure whether to use multiple cpus
    454453# ******************************************************************************
    455 KERNEL=$(uname)
    456 if test "$KERNEL" = "Linux"; then
    457     # Linux should have /proc/cpuinfo
    458     CPU_MODEL=$(awk -F ":" '/model name/ {print $2}' /proc/cpuinfo | head -n 1)
    459     CPU_SPEED=$(awk 'BEGIN { IGNORECASE = 1 } /MHz/ { print $4 }' /proc/cpuinfo | head -n 1)
    460     # Test for multiple CPUs. If they are available, try to use them.
    461     if test $(grep "^processor" /proc/cpuinfo | wc -l) -ge "2"; then
    462         MULTIPLE_CPUS=:
    463     else
    464         MULTIPLE_CPUS=false
    465     fi
    466 elif test "$KERNEL" = "Darwin"; then
    467     :
     454CPU_MODEL=$(sysctl -n -a machdep.cpu.brand_string)
     455CPU_SPEED=$(sysctl -n -a hw.cpufrequency)
     456CPU_SPEED=$(bc_math "$CPU_SPEED / 1000000000")
     457# Test for multiple CPUs. If they are available, try to use them.
     458if test $(sysctl -n -a hw.activecpu) -ge "2"; then
     459    MULTIPLE_CPUS=:
     460else
     461    MULTIPLE_CPUS=false
    468462fi
    469463
    470464