All pastes #745001 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-10-21 23:11 UTC
rendered paste body
# endian testing
echocheck "byte order"
if test "$_big_endian" = auto ; then
  cat > $TMPC <<EOF
short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
                      (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
int main(){
  return (int)ascii_name;
} 
EOF
echo "check2"
  if cc_check ; then 
    if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then 
      _big_endian=yes
    else
      _big_endian=no
    fi
  else
    echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
  fi
fi
echo "check3"
if test "$_big_endian" = yes ; then
  _byte_order='big-endian'
  _def_words_endian='#define WORDS_BIGENDIAN 1'
else
  _byte_order='little-endian'
  _def_words_endian='#undef WORDS_BIGENDIAN'
fi
echores "$_byte_order"