Mercurial > mplayer.hg
comparison configure @ 13478:20619c6203a0
detect byte order even for cross-compiling
author | faust3 |
---|---|
date | Sun, 26 Sep 2004 14:49:33 +0000 |
parents | 8e026ebb082f |
children | fc357e2c7328 |
comparison
equal
deleted
inserted
replaced
13477:8e026ebb082f | 13478:20619c6203a0 |
---|---|
5842 | 5842 |
5843 # endian testing | 5843 # endian testing |
5844 echocheck "byte order" | 5844 echocheck "byte order" |
5845 if test "$_big_endian" = auto ; then | 5845 if test "$_big_endian" = auto ; then |
5846 cat > $TMPC <<EOF | 5846 cat > $TMPC <<EOF |
5847 #include <inttypes.h> | 5847 short asci_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|0)}; |
5848 int main(void) { | 5848 int main(){ |
5849 volatile uint32_t i=0x01234567; | 5849 char* s = (char*)asci_name; |
5850 return (*((uint8_t*)(&i))) == 0x67; | 5850 return 0; |
5851 } | 5851 } |
5852 EOF | 5852 EOF |
5853 if cc_check ; then | 5853 if cc_check ; then |
5854 if $TMPO ; then | 5854 if test `grep -l MPlayer $TMPO` ; then |
5855 _big_endian=yes | 5855 _big_endian=yes |
5856 else | 5856 else |
5857 _big_endian=no | 5857 _big_endian=no |
5858 fi | 5858 fi |
5859 else | 5859 else |