X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=configure;h=795c22037325b44f79cf1fcb817240de3724eaa3;hp=e45ae394256a8eca2ea3f77f25336fd4e4c42783;hb=0dcebdf4a70ef0d8144b8fcba763ae87e7fc74b5;hpb=37adbfc4e189873d1d02c145b81c779971ef5337 diff --git a/configure b/configure index e45ae394..795c2203 100755 --- a/configure +++ b/configure @@ -238,8 +238,25 @@ fi cc="${CC-${cross_prefix}gcc}" +########################################## +# check endianness +bigendian="no" +cat > $TMPC < +int main(void) +{ + volatile uint32_t i=0x01234567; + return (*((uint8_t*)(&i))) == 0x67; +} +EOF +if compile_prog "" "" "endian"; then + $TMPE && bigendian="yes" +fi + + echo "Operating system $targetos" echo "CPU $cpu" +echo "Big endian $bigendian" echo "Compiler $cc" echo @@ -783,6 +800,11 @@ else echo "Unknown wordsize!" exit 1 fi +if test "$bigendian" = "yes" ; then + echo "CONFIG_BIG_ENDIAN=y" >> $config_host_mak +else + echo "CONFIG_LITTLE_ENDIAN=y" >> $config_host_mak +fi if test "$libaio" = "yes" ; then echo "CONFIG_LIBAIO=y" >> $config_host_mak fi