$NetBSD$

Byte order defines for other than linux

--- lib/md5.c.orig	2010-03-18 22:11:23.000000000 +0000
+++ lib/md5.c
@@ -14,7 +14,20 @@
  * needed on buffers full of bytes, and then call MD5Final, which
  * will fill a supplied 16-byte array with the digest.
  */
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
+#include <sys/endian.h>
+#define __BYTE_ORDER		_BYTE_ORDER
+#define __LITTLE_ENDIAN		_LITTLE_ENDIAN
+#define __BIG_ENDIAN		_BIG_ENDIAN
+#elif defined(__APPLE__)
+#include <machine/endian.h>
+#include <libkern/OSByteOrder.h>
+#define __BYTE_ORDER		BYTE_ORDER
+#define __LITTLE_ENDIAN		LITTLE_ENDIAN
+#define __BIG_ENDIAN		BIG_ENDIAN
+#else
 #include <endian.h>
+#endif
 #include <string.h>		/* for memcpy() */
 
 #include "md5.h"
