From 17d313248175f0905f46b5761dbed249e5e984f5 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Tue, 5 Oct 2010 21:54:12 +0200 Subject: 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 --- android-configure.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'android-configure.sh') 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 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 -- cgit v1.1