aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexandra Ellwood <lxs@mit.edu>2004-05-21 19:47:24 +0000
committerAlexandra Ellwood <lxs@mit.edu>2004-05-21 19:47:24 +0000
commitae1456e38f2ed6f05dfe68661cbaa6d6e54882c6 (patch)
tree991c034c4cdeab9e056ff49a9697e359145fe38f /src
parent80d8c28c80356ebd4ad7c07da59839c2bee598c3 (diff)
downloadkrb5-ae1456e38f2ed6f05dfe68661cbaa6d6e54882c6.zip
krb5-ae1456e38f2ed6f05dfe68661cbaa6d6e54882c6.tar.gz
krb5-ae1456e38f2ed6f05dfe68661cbaa6d6e54882c6.tar.bz2
pullup from trunk
ticket: 2551 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-3@16347 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/util/db2/ChangeLog12
-rw-r--r--src/util/db2/Makefile.in8
-rw-r--r--src/util/db2/configure.in5
-rw-r--r--src/util/db2/include/ChangeLog15
-rw-r--r--src/util/db2/include/db-int.h68
5 files changed, 107 insertions, 1 deletions
diff --git a/src/util/db2/ChangeLog b/src/util/db2/ChangeLog
index 7c9d1df..53542b9 100644
--- a/src/util/db2/ChangeLog
+++ b/src/util/db2/ChangeLog
@@ -1,3 +1,15 @@
+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
+ config.status are up to date.
+ (include/config.h, $(srcdir)/include/config.h.in,
+ include/db-config.h): New rules.
+ * configure.in: Don't check byte order here. Check for endian.h.
+
2003-04-01 Tom Yu <tlyu@mit.edu>
* Makefile.in (install-unix): Delete install-libs. We don't want
diff --git a/src/util/db2/Makefile.in b/src/util/db2/Makefile.in
index 6ca7550..b824864 100644
--- a/src/util/db2/Makefile.in
+++ b/src/util/db2/Makefile.in
@@ -16,6 +16,7 @@ HDRDIR=$(BUILDTOP)/include
HDRS = $(HDRDIR)/db.h $(HDRDIR)/db-config.h $(HDRDIR)/db-ndbm.h
all-unix:: all-liblinks includes
+all-prerecurse: include/config.h include/db-config.h
clean-unix:: clean-liblinks clean-libs clean-includes
includes:: $(HDRS)
@@ -27,6 +28,13 @@ $(HDRDIR)/db-config.h: include/db-config.h
$(HDRDIR)/db-ndbm.h: $(srcdir)/include/db-ndbm.h
$(CP) $(srcdir)/include/db-ndbm.h $@
+include/config.h: $(srcdir)/include/config.h.in
+ cd $(thisconfigdir) && $(SHELL) config.status
+$(srcdir)/include/config.h.in: @MAINT@ $(srcdir)/configure.in $(SRCTOP)/aclocal.m4
+ cd $(srcdir) && ($(AUTOHEADER) --include=$(CONFIG_RELTOPDIR) $(AUTOHEADERFLAGS) || $(AUTOHEADER) --localdir=$(CONFIG_RELTOPDIR) $(AUTOHEADERFLAGS))
+include/db-config.h: $(srcdir)/include/db-config.h.in
+ cd $(thisconfigdir) && $(SHELL) config.status
+
clean-includes::
$(RM) $(HDRS)
# @lib_frag@
diff --git a/src/util/db2/configure.in b/src/util/db2/configure.in
index 6fe6039..dc1fb1a 100644
--- a/src/util/db2/configure.in
+++ b/src/util/db2/configure.in
@@ -63,7 +63,10 @@ AC_COMPILE_TYPE(u_int32_t, unsigned int)
dnl checks for structures
dnl checks for compiler characteristics
-AC_C_BIGENDIAN
+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)
diff --git a/src/util/db2/include/ChangeLog b/src/util/db2/include/ChangeLog
index eacdbc8..1ad2200 100644
--- a/src/util/db2/include/ChangeLog
+++ b/src/util/db2/include/ChangeLog
@@ -1,3 +1,18 @@
+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.
+ (LITTLE_ENDIAN, BIG_ENDIAN, BYTE_ORDER): If not defined, and if
+ versions with one or two leading underscores are defined, define
+ the no-underscore form in terms of the with-underscore one.
+ (DB_BYTE_ORDER): Define by checking LITTLE_ENDIAN, BIG_ENDIAN, and
+ BYTE_ORDER; report an error if that doesn't work. Don't check
+ WORDS_BIGENDIAN.
+
2002-09-05 Ken Raeburn <raeburn@mit.edu>
* db-int.h: If stdint.h or inttypes.h are found, include them.
diff --git a/src/util/db2/include/db-int.h b/src/util/db2/include/db-int.h
index 2c21fb2..f50f6d0 100644
--- a/src/util/db2/include/db-int.h
+++ b/src/util/db2/include/db-int.h
@@ -44,11 +44,79 @@
#define DB_LITTLE_ENDIAN 1234
#define DB_BIG_ENDIAN 4321
+#include <stdlib.h>
+#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
+# ifdef _BIG_ENDIAN
+# define BIG_ENDIAN _BIG_ENDIAN
+# endif
+# ifdef _BYTE_ORDER
+# define BYTE_ORDER _BYTE_ORDER
+# endif
+#endif
+#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
+# ifdef __BYTE_ORDER
+# 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
+# elif BIG_ENDIAN == BYTE_ORDER
+# define DB_BYTE_ORDER DB_BIG_ENDIAN
+# else
+# error "LITTLE_ENDIAN and BIG_ENDIAN defined, but can't determine byte order"
+# endif
+#elif defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)
+# define DB_BYTE_ORDER DB_LITTLE_ENDIAN
+#elif defined(BIG_ENDIAN) && !defined(LITTLE_ENDIAN)
+# define DB_BYTE_ORDER DB_BIG_ENDIAN
+#else
+# error "can't determine byte order from included system headers"
+#endif
+
+#if 0
#ifdef WORDS_BIGENDIAN
#define DB_BYTE_ORDER DB_BIG_ENDIAN
#else
#define DB_BYTE_ORDER DB_LITTLE_ENDIAN
#endif
+#endif
/* end autoconf-based stuff */