From: Assar Westerlund <[EMAIL PROTECTED]>
Date: 08 Jul 2000 01:45:04 +0200
Ian Lance Taylor <[EMAIL PROTECTED]> writes:
> and then
> grep 0123 foo.o
> grep 3210 foo.o
> If only the first grep matches, you have a big endian system. If only
> the second grep matches, you have a little endian system. If both or
> neither match, you don't know.
Greping objecct files strikes me as error-prone.
Well, yes, but I believe the test will work as stated. Do you
disagree? That is, do you believe it will ever generate an incorrect
result?
An alternative is to use the strings program if it is available; e.g.,
strings foo.o | grep 0123
However, a GNU configure script should not rely on the existence of
strings, according to
http://www.gnu.org/prep/standards_47.html#SEC47
Ian