diff options
author | Marcus Comstedt <marcus@mc.pp.se> | 2010-10-05 21:54:12 +0200 |
---|---|---|
committer | Marcus Comstedt <marcus@mc.pp.se> | 2010-10-05 21:57:36 +0200 |
commit | 17d313248175f0905f46b5761dbed249e5e984f5 (patch) | |
tree | 4d0acc9bbec1cb6d510db7428b210d696d32ebc3 /android-configure.sh | |
parent | 4e024bb4f5c8aa8b07459f7fbd65c35122127fd1 (diff) | |
download | external_qemu-17d313248175f0905f46b5761dbed249e5e984f5.zip external_qemu-17d313248175f0905f46b5761dbed249e5e984f5.tar.gz external_qemu-17d313248175f0905f46b5761dbed249e5e984f5.tar.bz2 |
Fix detection of host endianness
The host endianness in android-configure.sh was backwards (assuming
that HOST_BIGENDIAN=1 means that the host is bigendian). However,
the script also failed to use the result, which is probably why
nobody noticed. Now, HOST_WORDS_BIGENDIAN is defined in
config-host.h if HOST_BIGENDIAN is 1.
Change-Id: Ied07f9db76c24e5ce403ae17fde5df7f50fafe8a
Diffstat (limited to 'android-configure.sh')
-rwxr-xr-x | android-configure.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/android-configure.sh b/android-configure.sh index b992064..febf59c 100755 --- a/android-configure.sh +++ b/android-configure.sh @@ -336,7 +336,7 @@ cat > $TMPC << EOF #include <inttypes.h> int main(int argc, char ** argv){ volatile uint32_t i=0x01234567; - return (*((uint8_t*)(&i))) == 0x67; + return (*((uint8_t*)(&i))) == 0x01; } EOF feature_run_exec HOST_BIGENDIAN @@ -441,6 +441,9 @@ case "$CPU" in ;; esac echo "#define HOST_$CONFIG_CPU 1" >> $config_h +if [ "$HOST_BIGENDIAN" = "1" ] ; then + echo "#define HOST_WORDS_BIGENDIAN 1" >> $config_h +fi BSD=0 case "$TARGET_OS" in linux-*) CONFIG_OS=LINUX |