I developed a library that performs various formatting for RIFF chunks, and it is absolutely dependent on the endianness of the system. I am porting it to a wider range of systems, but the issue remains for testing the endianness.
I am using autoconf for the configuring aspect of the project.
Is there a way in Configure.in to test for endianness?
Why are you writing code that is dependent on endian?
That would only make sense if you're trying to read blocks of data directly from the file, and assuming that you can just drop it on top of say an int and it will work.
If you treat the file as a stream of bytes, and assemble byte-by-byte the actual data elements, say
unsigned short foo = buff + (unsigned short)buff << 8;
then the whole endian problem goes away.
Besides, "big" and "little" are not the only choices.
Endianness - Wikipedia, the free encyclopedia
By the time you've written all the hacks for all the possible combinations, you may as well have done the job the simple (if a little tedious at the outset) way from the start.