forked from FFmpeg/FFmpeg
configure: simplify bigendian check
The preferred way to use LTO is --enable-lto but often times packagers still end up with -flto in cflags for various reasons. Using grep on binary object files is brittle and relies on specific object representation, which in the case of LLVM bitcode, debug information or other intermediary formats can fail silently. This patch changes the check to a more commonly used define for GCC style compilers. More checks may be needed to cover other potential compilers that don't use the __BYTE_ORDER__ define. Signed-off-by: J. Dekker <jdek@itanimul.li>
This commit is contained in:
parent
459648761f
commit
3090106635
1 changed files with 1 additions and 5 deletions
6
configure
vendored
6
configure
vendored
|
@ -6120,11 +6120,7 @@ extern_prefix=${sym%%ff_extern*}
|
||||||
|
|
||||||
check_cc pragma_deprecated "" '_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
|
check_cc pragma_deprecated "" '_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
|
||||||
|
|
||||||
# The global variable ensures the bits appear unchanged in the object file.
|
test_cpp_condition stdlib.h "defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)" && enable bigendian
|
||||||
test_cc <<EOF || die "endian test failed"
|
|
||||||
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
|
|
||||||
EOF
|
|
||||||
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
|
|
||||||
|
|
||||||
check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
|
check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue