+2004-05-07 Ken Raeburn <raeburn@mit.edu>
+
+ * configure.in: Check for machine/endian.h too.
+
2004-05-05 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (all-prerecurse): Make sure headers generated by
dnl checks for structures
dnl checks for compiler characteristics
-dnl AC_C_BIGENDIAN
-AC_CHECK_HEADERS(endian.h)
+dnl AC_C_BIGENDIAN - No, check at compile time; Darwin can build for multiple
+dnl targets in one tree.
+AC_CHECK_HEADERS(endian.h machine/endian.h)
+dnl There's also sys/endian.h on IRIX, but we already check _MIPSE{L,B}.
AC_C_CONST
AC_CHECK_SIZEOF(int)
+2004-05-07 Ken Raeburn <raeburn@mit.edu>
+
+ * db-int.h: Include machine/endian.h if available. Check for
+ __LITTLE_ENDIAN__ and __BIG_ENDIAN__, _MIPSEB and _MIPSEL.
+
2004-05-05 Ken Raeburn <raeburn@mit.edu>
* db-int.h: Include stdlib.h, and endian.h if available.
#ifdef HAVE_ENDIAN_H
# include <endian.h>
#endif
+#ifdef HAVE_MACHINE_ENDIAN_H
+# include <machine/endian.h>
+#endif
/* Handle both BIG and LITTLE defined and BYTE_ORDER matches one, or
just one defined; both with and without leading underscores.
Ignore "PDP endian" machines, this code doesn't support them
anyways. */
#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) && !defined(BYTE_ORDER)
+# ifdef __LITTLE_ENDIAN__
+# define LITTLE_ENDIAN __LITTLE_ENDIAN__
+# endif
+# ifdef __BIG_ENDIAN__
+# define BIG_ENDIAN __BIG_ENDIAN__
+# endif
+#endif
+#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) && !defined(BYTE_ORDER)
# ifdef _LITTLE_ENDIAN
# define LITTLE_ENDIAN _LITTLE_ENDIAN
# endif
# define BYTE_ORDER __BYTE_ORDER
# endif
#endif
+
+#if defined(_MIPSEL) && !defined(LITTLE_ENDIAN)
+# define LITTLE_ENDIAN
+#endif
+#if defined(_MIPSEB) && !defined(BIG_ENDIAN)
+# define BIG_ENDIAN
+#endif
+
#if defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN) && defined(BYTE_ORDER)
# if LITTLE_ENDIAN == BYTE_ORDER
# define DB_BYTE_ORDER DB_LITTLE_ENDIAN