File: makebyteorder.sh

package info (click to toggle)
exifprobe 2.0.1%2Bgit20170416.3c2b769-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 2,904 kB
  • sloc: ansic: 34,799; sh: 413; makefile: 82
file content (19 lines) | stat: -rwxr-xr-x 558 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# @(#) $Id: makebyteorder.sh,v 1.1 2003/01/12 19:30:31 alex Exp $

if test -f /usr/include/machine/endian.h
then
    byteorder=`grep BYTE_ /usr/include/machine/endian.h`
elif test -f /usr/include/bits/endian.h
then
    byteorder=`grep BYTE_ /usr/include/bits/endian.h`
fi

case "${byteorder}" in
    *BIG*) echo "#define NATIVE_BYTEORDER_BIGENDIAN" > byteorder.h ;;
    *LITTLE*) echo "#define NATIVE_BYTEORDER_LITTLE_ENDIAN" > byteorder.h ;;
    *) echo "#define NATIVE_BYTEORDER_UNKNOWN /* assume little-endian */" > byteorder.h ;;
esac

exit 0