diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-07-28 15:02:47 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-07-28 15:02:47 +0000 |
commit | a399990884f2b88a81b7b5aecda968922fd3b11e (patch) | |
tree | fd5ce077eda648de37e2b9af2468d9da7f3fca93 /configure | |
parent | 59eb2ed1f31d2b23ba2e50242627c096b0990e62 (diff) | |
download | ffmpeg-a399990884f2b88a81b7b5aecda968922fd3b11e.tar.gz |
better big/little endian test
Originally committed as revision 830 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -187,16 +187,27 @@ if test "$win32" = "yes" ; then network="no" fi -# endianness : guess with cpu type. Should also use prefix -if test "$cpu" = "powerpc"; then - bigendian="yes" -fi - cc="${cross_prefix}${cc}" ar="${cross_prefix}${ar}" strip="${cross_prefix}${strip}" # --- +# big/little endian test +cat > $TMPC << EOF +#include <inttypes.h> +int main(int argc, char ** argv){ + volatile uint32_t i=0x01234567; + return (*((uint8_t*)(&i))) == 0x67; +} +EOF + +if $cc -o $TMPO $TMPC 2>/dev/null ; then +$TMPO && bigendian="yes" +else +echo big/little test failed +fi + +# --- # check availability of some header files cat > $TMPC << EOF |