Add missing parts from utf8mac.diff (libiconv-1.11-utf8mac.patch),
adjust for Solaris and support little endian platforms.  -- fumiyas

--- libiconv-1.10/lib/utf8mac.h.dist	2007-03-29 21:50:15.000000000 +0900
+++ libiconv-1.10/lib/utf8mac.h	2007-03-29 21:57:09.000000000 +0900
@@ -29,7 +29,27 @@
 
 #include <errno.h>                      /* EINVAL, ENAMETOOLONG */
 #include <string.h>                     /* bzero() */
-#include <libkern/OSByteOrder.h>
+
+#ifdef __sun
+# include <sys/types.h>
+# include <sys/byteorder.h>
+# ifdef BSWAP_16
+#  define OSSwapInt16(x) BSWAP_16(x)
+# else
+#  define OSSwapInt16(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
+# endif
+  typedef uint8_t u_int8_t;
+  typedef uint16_t u_int16_t;
+  typedef uint32_t u_int32_t;
+  typedef uint64_t u_int64_t;
+#else
+# include <byteswap.h>
+# define OSSwapInt16(x) bswap_16(x)
+#endif /* __sun */
+
+#ifdef WORDS_LITTLEENDIAN
+# define __LITTLE_ENDIAN__
+#endif

 #define	UTF_REVERSE_ENDIAN	0x01	/* reverse UCS-2 byte order */
 #define	UTF_NO_NULL_TERM	0x02	/* do not add null termination */
--- libiconv-1.10/lib/flags.h.dist    2005-07-06 19:58:06.000000000 +0900
+++ libiconv-1.10/lib/flags.h     2007-03-29 22:20:25.000000000 +0900
@@ -14,6 +14,7 @@

 #define ei_ascii_oflags (0)
 #define ei_utf8_oflags (HAVE_ACCENTS | HAVE_QUOTATION_MARKS | HAVE_HANGUL_JAMO)
+#define ei_utf8mac_oflags (HAVE_ACCENTS | HAVE_QUOTATION_MARKS | HAVE_HANGUL_JAMO)
 #define ei_ucs2_oflags (HAVE_ACCENTS | HAVE_QUOTATION_MARKS | HAVE_HANGUL_JAMO)
 #define ei_ucs2be_oflags (HAVE_ACCENTS | HAVE_QUOTATION_MARKS | HAVE_HANGUL_JAMO)
 #define ei_ucs2le_oflags (HAVE_ACCENTS | HAVE_QUOTATION_MARKS | HAVE_HANGUL_JAMO)
--- libiconv-1.10/lib/aliases.gperf.dist      2005-07-06 19:57:56.000000000 +0900
+++ libiconv-1.10/lib/aliases.gperf       2007-03-29 22:40:40.000000000 +0900
@@ -21,6 +21,8 @@
 US, ei_ascii
 CSASCII, ei_ascii
 UTF-8, ei_utf8
+UTF-8-MAC, ei_utf8mac
+UTF8-MAC, ei_utf8mac
 UCS-2, ei_ucs2
 ISO-10646-UCS-2, ei_ucs2
 CSUNICODE, ei_ucs2
