--- a/configure 2018-05-14 13:06:45.048908319 +0200 +++ b/configure 2018-05-14 12:55:02.526913502 +0200 @@ -961,14 +961,16 @@ # skip endianness check for Intel Compiler and MSVS, as all supported platforms are little. each have flags that will cause the check to fail as well CPU_ENDIAN="little-endian" if [ $compiler = GNU ]; then - echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c - $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed" - if (${cross_prefix}strings -a conftest.o | grep -q BIGE) && (${cross_prefix}strings -a conftest.o | grep -q FPendian) ; then - define WORDS_BIGENDIAN - CPU_ENDIAN="big-endian" - elif !(${cross_prefix}strings -a conftest.o | grep -q EGIB && ${cross_prefix}strings -a conftest.o | grep -q naidnePF) ; then - die "endian test failed" - fi + cat <<-EOF > conftest.c +#include +#define IS_BIG_ENDIAN (*(uint16_t *)"\0\xff" < 0x100) +int main(void) { return IS_BIG_ENDIAN; } +EOF + $CC $CFLAGS -o conftest conftest.c || die "endian test failed" + ./conftest || { + define WORDS_BIGENDIAN + CPU_ENDIAN="big-endian" + } fi if [ "$cli_libx264" = "system" -a "$shared" != "yes" ] ; then