9 [ "$VERBOSE" = "yes" ] && echo "Determining machine byte-order... ($*)"
11 # build and run a test program
12 test -d "$OUTDIR/config.tests/unix/endian" || mkdir
-p "$OUTDIR/config.tests/unix/endian"
13 "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/endian/endiantest.pro" -o "$OUTDIR/config.tests/unix/endian/Makefile" >/dev
/null
2>&1
14 cd "$OUTDIR/config.tests/unix/endian"
18 [ "$VERBOSE" = "yes" ] && $MAKE ||
$MAKE >/dev
/null
2>&1
20 if [ -f .
/endiantest.exe
]; then
21 binary
=.
/endiantest.exe
27 if [ -f $binary ]; then
30 [ "$VERBOSE" = "yes" ] && echo "Unknown byte order!"
34 if strings $binary |
grep LeastSignificantByteFirst
>/dev
/null
2>&1; then
35 [ "$VERBOSE" = "yes" ] && echo " Found 'LeastSignificantByteFirst' in binary"
37 elif strings $binary |
grep MostSignificantByteFirst
>/dev
/null
2>&1; then
38 [ "$VERBOSE" = "yes" ] && echo " Found 'MostSignificantByteFirst' in binary"
42 # make clean as this tests is compiled for both the host and the target
46 if [ "$ENDIAN" = "LITTLE" ]; then
47 [ "$VERBOSE" = "yes" ] && echo "Using little endian."
49 elif [ "$ENDIAN" = "BIG" ]; then
50 [ "$VERBOSE" = "yes" ] && echo "Using big endian."
53 [ "$VERBOSE" = "yes" ] && echo "Unknown byte order!"