Add m4/endian.m4 and use it in configure.ac.