Ticket #1563: configure.patch

File configure.patch, 1.8 KB (added by mino@…, 18 years ago)

MacOS X autodetect CPU patch

  • configure

     
    221221    processor_flags=`cat /proc/cpuinfo | grep "flags" | head -n 1`
    222222fi
    223223
     224if test -f /usr/bin/hostinfo ; then
     225    if test x"$processor" = x"" -o x"$processor" = x"$cpu_raw" -o \
     226            x"$processor" = x"unknown" -o x"$processor" = x"powerpc" ; then
     227        processor=`/usr/bin/hostinfo | grep "Processor type:"`
     228        processor=${processor#Processor type: *}
     229        processor=${processor% (*}
     230        if test x"${processor:0:3}" = x"ppc" ; then
     231            tune=$processor
     232        else
     233            processor=`/usr/sbin/sysctl -n machdep.cpu.model_string`
     234            processor_flags=`/usr/sbin/sysctl -n machdep.cpu.features`
     235            processor_flags=`echo $processor_flags | tr "[A-Z]" "[a-z]"`
     236        fi
     237    fi
     238fi
     239
    224240# These have to be looked up early for some types of cross-compiling to work
    225241cpu_overide="no"
    226242for opt do
     
    12021218       ARCHFLAGS="-march=pentium4"
    12031219   elif expr "$processor" : ".*Pentium(R) [4MD]" > /dev/null ; then
    12041220       ARCHFLAGS="-march=pentium4"
     1221   elif expr "$processor" : ".*Intel P6 Family" > /dev/null ; then
     1222       cpu_raw="i686"
     1223       ARCHFLAGS="-march=pentium4"
    12051224   elif expr "$processor" : ".*Xeon(TM) CPU" > /dev/null ; then
    12061225       ARCHFLAGS="-march=pentium4"
    12071226   elif expr "$processor" : ".*Celeron(R) M processor" > /dev/null ; then
     
    15511570$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
    15521571fi
    15531572
    1554 if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
     1573if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes" -a "$darwin" != "yes" ; then
    15551574    echo "error, no memalign() but sse enabled, either disable it or use --enable-memalign-hack"
    15561575    exit 1
    15571576fi