Changeset 4c76a93


Ignore:
Timestamp:
Dec 31, 2011 10:46:49 PM (9 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
3f4d1544
Parents:
ce0e0b2
Message:

Add CPU type check for OSX

I removed Tanuki's broken CPU "bitness" check for OSX in
3db46be1ede7d858b6c319905cf310d99227eb29. With this commit I add one that
works. Note that at this point we don't use the "bitness" checking because we
ship a quad-fat wrapper for OSX. Unfortunately, one can only manipulate the osx
binaries with "lipo" which is only available in OSX. In the future we may want
to use the "bitness" logic.

In any case, the old check set the bits to 64 for Leopard and above, but just
because a Mac is running Leopard or Snow Leopard doesn't mean it's 64bit
capable. This addition of mine will actually check the flags using sysctl. I'm
not using uname because OSX < Lion starts in 32bit mode by default (but can
still run 64bit binaries).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • installer/resources/i2prouter

    rce0e0b2 r4c76a93  
    358358    OS_VER=`sw_vers | grep 'ProductVersion:' | grep -o '[0-9]*\.[0-9]*\.[0-9]*'`
    359359    DIST_ARCH="universal"
    360     DIST_BITS="64"
     360    if [ $(sysctl -n hw.cpu64bit_capable) -eq 1 ]; then
     361        DIST_BITS="64"
     362    else
     363        DIST_BITS="32"
     364    fi
    361365    APP_PLIST_BASE=${PLIST_DOMAIN}.${APP_NAME}
    362366    APP_PLIST=${APP_PLIST_BASE}.plist
Note: See TracChangeset for help on using the changeset viewer.