--- libelf/_libelf_config.h	2011-12-04 07:45:47.000000000 +0100
+++ libelf/_libelf_config.h	2012-09-25 11:01:26.000000000 +0200
@@ -175,3 +175,26 @@
 #endif
 
 #endif /* defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) */
+
+
+#ifdef __APPLE__
+
+#define	LIBELF_VCSID(ID)
+
+#if defined(__i386__)
+
+#define	LIBELF_ARCH		EM_386
+#define	LIBELF_BYTEORDER	ELFDATA2LSB
+#define	LIBELF_CLASS		ELFCLASS32
+
+#elif defined(__x86_64__)
+
+#define	LIBELF_ARCH		EM_X86_64
+#define	LIBELF_BYTEORDER	ELFDATA2LSB
+#define	LIBELF_CLASS		ELFCLASS64
+
+#else
+#error	Unknown Mac OS X architecture.
+#endif
+
+#endif /* __APPLE__ */
