"Michael S. Tsirkin" <m...@redhat.com> writes: > Heh, configure script runs the program it's built > in a couple of places. This probably does not > work for cross-builds: > > if compile_prog "" "" ; then > $TMPE && bigendian="yes" > else > echo big/little test failed > fi > > likely works by luck for build to intel, because error > is interpreted as little-endian.
In FFmpeg we check the endianness like this: check_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 This works on every combination of build and target system we use. -- Måns Rullgård m...@mansr.com