summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-07-02 10:51:27 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-07-02 11:01:05 +0300
commite184571feb05e822323c763ca5be6e44a21f2e0f (patch)
treeaba727d336e9d3a29892cdd0de1a5ec2ce82d71e
parent927456fd9737c6139d582089006021e167aa17e9 (diff)
downloadapk-tools-e184571feb05e822323c763ca5be6e44a21f2e0f.tar.gz
apk-tools-e184571feb05e822323c763ca5be6e44a21f2e0f.tar.bz2
apk-tools-e184571feb05e822323c763ca5be6e44a21f2e0f.tar.xz
apk-tools-e184571feb05e822323c763ca5be6e44a21f2e0f.zip
defines: detect endianess on arm, for armel
-rw-r--r--src/apk_defines.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h
index 00a6f9e..7f8d3b6 100644
--- a/src/apk_defines.h
+++ b/src/apk_defines.h
@@ -12,6 +12,7 @@
#ifndef APK_DEFINES_H
#define APK_DEFINES_H
+#include <endian.h>
#include <string.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
@@ -75,6 +76,8 @@ extern char **apk_argv;
#define APK_DEFAULT_ARCH "ppc"
#elif defined(__powerpc64__)
#define APK_DEFAULT_ARCH "ppc64"
+#elif defined(__arm__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define APK_DEFAULT_ARCH "armel"
#elif defined(__arm__)
#define APK_DEFAULT_ARCH "arm"
#else