+ if compile_prog "" "" "endian"; then
+ $TMPE && bigendian="yes"
+ fi
+else
+ # If we're cross compiling, try our best to work it out and rely on the
+ # run-time check to fail if we get it wrong.
+ cat > $TMPC <<EOF
+#include <endian.h>
+int main(void)
+{
+#if __BYTE_ORDER != __BIG_ENDIAN
+# error "Unknown endianness"
+#endif
+}
+EOF
+ compile_prog "" "" "endian" && bigendian="yes"
+ check_define "__ARMEB__" && bigendian="yes"
+ check_define "__MIPSEB__" && bigendian="yes"