[91265] trunk/dports/graphics/fontconfig
ryandesign at macports.org
ryandesign at macports.org
Tue Mar 27 19:01:20 PDT 2012
Revision: 91265
https://trac.macports.org/changeset/91265
Author: ryandesign at macports.org
Date: 2012-03-27 19:01:20 -0700 (Tue, 27 Mar 2012)
Log Message:
-----------
fontconfig: fix font cache; see #33769
Modified Paths:
--------------
trunk/dports/graphics/fontconfig/Portfile
Added Paths:
-----------
trunk/dports/graphics/fontconfig/files/patch-check-arch-at-runtime.diff
Removed Paths:
-------------
trunk/dports/graphics/fontconfig/files/0001-fcarch-Restrict-FC_ARCHITECTURE-usage-to-fcarch.h.diff
trunk/dports/graphics/fontconfig/files/0002-fcarch-Check-for-architecture-type-at-runtime.diff
Modified: trunk/dports/graphics/fontconfig/Portfile
===================================================================
--- trunk/dports/graphics/fontconfig/Portfile 2012-03-28 01:29:25 UTC (rev 91264)
+++ trunk/dports/graphics/fontconfig/Portfile 2012-03-28 02:01:20 UTC (rev 91265)
@@ -7,6 +7,7 @@
name fontconfig
version 2.9.0
+revision 1
categories graphics
maintainers ryandesign
license fontconfig
@@ -45,11 +46,8 @@
# https://bugs.freedesktop.org/show_bug.cgi?id=20208
patch.pre_args -p1
-patchfiles 0001-fcarch-Restrict-FC_ARCHITECTURE-usage-to-fcarch.h.diff \
- 0002-fcarch-Check-for-architecture-type-at-runtime.diff
+patchfiles patch-check-arch-at-runtime.diff
-use_autoreconf yes
-
# We put this into a pre-configure so it can be evaluated _after_ variants selection.
pre-configure {
configure.args-append --with-add-fonts=[join ${add_fonts} ,]
Deleted: trunk/dports/graphics/fontconfig/files/0001-fcarch-Restrict-FC_ARCHITECTURE-usage-to-fcarch.h.diff
===================================================================
--- trunk/dports/graphics/fontconfig/files/0001-fcarch-Restrict-FC_ARCHITECTURE-usage-to-fcarch.h.diff 2012-03-28 01:29:25 UTC (rev 91264)
+++ trunk/dports/graphics/fontconfig/files/0001-fcarch-Restrict-FC_ARCHITECTURE-usage-to-fcarch.h.diff 2012-03-28 02:01:20 UTC (rev 91265)
@@ -1,235 +0,0 @@
-From 38543764df4e5f4071ff3e5fa8dc467e0bd26b9e Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston <jeremyhu at apple.com>
-Date: Sun, 18 Mar 2012 23:16:36 -0700
-Subject: [PATCH 1/2] fcarch: Restrict FC_ARCHITECTURE usage to fcarch.h
-
-This should have no runtime effect, but it sets the stage for the
-following patch.
-
-Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
----
- fc-cache/fc-cache.c | 8 ++++++--
- fc-cat/fc-cat.c | 7 +++++--
- src/fcarch.c | 41 ++++-------------------------------------
- src/fcarch.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
- src/fccache.c | 7 +++++--
- 5 files changed, 68 insertions(+), 43 deletions(-)
-
-diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c
-index d265350..e68ddc1 100644
---- a/fc-cache/fc-cache.c
-+++ b/fc-cache/fc-cache.c
-@@ -258,6 +258,7 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose)
- FcBool remove;
- FcCache *cache;
- struct stat target_stat;
-+ FcChar8 suffix[1 + FC_ARCH_MAX_LEN + sizeof (FC_CACHE_SUFFIX) + 1];
-
- dir_base = FcStrPlus (dir, (FcChar8 *) "/");
- if (!dir_base)
-@@ -282,6 +283,9 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose)
- FcStrFree (dir_base);
- return FcFalse;
- }
-+ strcpy((char *)suffix, "-");
-+ _FcGetArch(suffix + 1);
-+ strlcpy((char *)suffix, FC_CACHE_SUFFIX, sizeof(suffix));
- while ((ent = readdir (d)))
- {
- FcChar8 *file_name;
-@@ -291,8 +295,8 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose)
- continue;
- /* skip cache files for different architectures and */
- /* files which are not cache files at all */
-- if (strlen(ent->d_name) != 32 + strlen ("-" FC_ARCHITECTURE FC_CACHE_SUFFIX) ||
-- strcmp(ent->d_name + 32, "-" FC_ARCHITECTURE FC_CACHE_SUFFIX))
-+ if (strlen(ent->d_name) != 32 + strlen((char *)suffix) ||
-+ strcmp(ent->d_name + 32, (char *)suffix))
- continue;
-
- file_name = FcStrPlus (dir_base, (FcChar8 *) ent->d_name);
-diff --git a/fc-cat/fc-cat.c b/fc-cat/fc-cat.c
-index c3d6829..af6e859 100644
---- a/fc-cat/fc-cat.c
-+++ b/fc-cat/fc-cat.c
-@@ -149,13 +149,16 @@ static void
- usage (char *program, int error)
- {
- FILE *file = error ? stderr : stdout;
-+ FcChar8 arch[FC_ARCH_MAX_LEN + 1];
-+
-+ _FcGetArch(arch);
- #if HAVE_GETOPT_LONG
- fprintf (file, "usage: %s [-rv] [--recurse] [--verbose] [*-%s.cache-2|directory]...\n",
-- program, FC_ARCHITECTURE);
-+ program, arch);
- fprintf (file, " %s [-Vh] [--version] [--help]\n", program);
- #else
- fprintf (file, "usage: %s [-rvVh] [*-%s.cache-2|directory]...\n",
-- program, FC_ARCHITECTURE);
-+ program, arch);
- #endif
- fprintf (file, "Reads font information cache from:\n");
- fprintf (file, " 1) specified fontconfig cache file\n");
-diff --git a/src/fcarch.c b/src/fcarch.c
-index c69397e..7df2e3e 100644
---- a/src/fcarch.c
-+++ b/src/fcarch.c
-@@ -27,47 +27,14 @@
- #include <config.h>
- #endif
-
--/* If architecture is hardcoded, skip the assert tests */
--
--#ifndef FC_ARCHITECTURE
--
- #include "fcarch.h"
-
--/* Make sure the cache structure is consistent with what we expect */
--
--#include "fcint.h"
--
--FC_ASSERT_STATIC (1 == sizeof (char));
--FC_ASSERT_STATIC (2 == sizeof (FcChar16));
--FC_ASSERT_STATIC (4 == sizeof (int));
--FC_ASSERT_STATIC (4 == sizeof (FcChar32));
--FC_ASSERT_STATIC (4 == sizeof (FcObject));
--FC_ASSERT_STATIC (4 == sizeof (FcValueBinding));
--FC_ASSERT_STATIC (8 == sizeof (FcAlign));
--FC_ASSERT_STATIC (0x20 == sizeof (FcCharLeaf));
--
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (intptr_t));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcPatternEltPtr));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueListPtr));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (char *));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (struct FcPatternElt *));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueList *));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcStrSet *));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcCharLeaf **));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcChar16 *));
--
--FC_ASSERT_STATIC (0x08 + 1*ALIGNOF_DOUBLE == sizeof (FcValue));
--FC_ASSERT_STATIC (0x00 + 2*SIZEOF_VOID_P == sizeof (FcPatternElt));
--FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcPattern));
--FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcCharSet));
--FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache));
--
--#endif
--
--
- int
- main (int argc, char **argv)
- {
-- printf ("%s\n", FC_ARCHITECTURE);
-+ FcChar8 arch[FC_ARCH_MAX_LEN + 1];
-+
-+ _FcGetArch(arch);
-+ printf ("%s\n", arch);
- return 0;
- }
-diff --git a/src/fcarch.h b/src/fcarch.h
-index 9cabf04..8695933 100644
---- a/src/fcarch.h
-+++ b/src/fcarch.h
-@@ -27,6 +27,36 @@
- #include <config.h>
- #endif
-
-+#include "fcint.h"
-+
-+#ifndef FC_ARCHITECTURE
-+/* Make sure the cache structure is consistent with what we expect */
-+FC_ASSERT_STATIC (1 == sizeof (char));
-+FC_ASSERT_STATIC (2 == sizeof (FcChar16));
-+FC_ASSERT_STATIC (4 == sizeof (int));
-+FC_ASSERT_STATIC (4 == sizeof (FcChar32));
-+FC_ASSERT_STATIC (4 == sizeof (FcObject));
-+FC_ASSERT_STATIC (4 == sizeof (FcValueBinding));
-+FC_ASSERT_STATIC (8 == sizeof (FcAlign));
-+FC_ASSERT_STATIC (0x20 == sizeof (FcCharLeaf));
-+
-+FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (intptr_t));
-+FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcPatternEltPtr));
-+FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueListPtr));
-+FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (char *));
-+FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (struct FcPatternElt *));
-+FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueList *));
-+FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcStrSet *));
-+FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcCharLeaf **));
-+FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcChar16 *));
-+
-+FC_ASSERT_STATIC (0x08 + 1*ALIGNOF_DOUBLE == sizeof (FcValue));
-+FC_ASSERT_STATIC (0x00 + 2*SIZEOF_VOID_P == sizeof (FcPatternElt));
-+FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcPattern));
-+FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcCharSet));
-+FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache));
-+#endif
-+
- /*
- * Each unique machine architecture needs an entry in this file
- * So far the differences boil down to: endianness, 32 vs 64 bit pointers,
-@@ -46,6 +76,19 @@
- * be64 1234 8 8
- */
-
-+#include <errno.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+
-+/* Returns 0 on success or an errno on failure.
-+ * buffer must be non-NULL and point to a character buffer with at least
-+ * FC_ARCH_MAX_LEN + 1 bytes available.
-+ */
-+#define FC_ARCH_MAX_LEN 6
-+static inline int _FcGetArch(FcChar8 *buffer) {
-+ if (buffer == NULL)
-+ return EINVAL;
-+
- #if defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN
- # define FC_ARCH_ENDIAN "be"
- #else /* !WORDS_BIGENDIAN */
-@@ -67,4 +110,9 @@
- # define FC_ARCHITECTURE FC_ARCH_ENDIAN FC_ARCH_SIZE_ALIGN
- #endif
-
-+ snprintf((char *) buffer, FC_ARCH_MAX_LEN + 1, "%s", FC_ARCHITECTURE);
-+
-+ return 0;
-+}
-+
- #endif /* _FCARCH_H_ */
-diff --git a/src/fccache.c b/src/fccache.c
-index d8102d7..783e54a 100644
---- a/src/fccache.c
-+++ b/src/fccache.c
-@@ -57,7 +57,7 @@ static void MD5Update(struct MD5Context *ctx, const unsigned char *buf, unsigned
- static void MD5Final(unsigned char digest[16], struct MD5Context *ctx);
- static void MD5Transform(FcChar32 buf[4], FcChar32 in[16]);
-
--#define CACHEBASE_LEN (1 + 32 + 1 + sizeof (FC_ARCHITECTURE) + sizeof (FC_CACHE_SUFFIX))
-+#define CACHEBASE_LEN (1 + 32 + 1 + FC_ARCH_MAX_LEN + sizeof (FC_CACHE_SUFFIX))
-
- #ifdef _WIN32
-
-@@ -159,6 +159,7 @@ FcDirCacheBasename (const FcChar8 * dir, FcChar8 cache_base[CACHEBASE_LEN])
- FcChar8 *hex_hash;
- int cnt;
- struct MD5Context ctx;
-+ FcChar8 arch[FC_ARCH_MAX_LEN + 1];
-
- MD5Init (&ctx);
- MD5Update (&ctx, (const unsigned char *)dir, strlen ((const char *) dir));
-@@ -173,7 +174,9 @@ FcDirCacheBasename (const FcChar8 * dir, FcChar8 cache_base[CACHEBASE_LEN])
- hex_hash[2*cnt+1] = bin2hex[hash[cnt] & 0xf];
- }
- hex_hash[2*cnt] = 0;
-- strcat ((char *) cache_base, "-" FC_ARCHITECTURE FC_CACHE_SUFFIX);
-+
-+ _FcGetArch(arch);
-+ snprintf((char *) cache_base, CACHEBASE_LEN, "-%s%s", arch, FC_CACHE_SUFFIX);
-
- return cache_base;
- }
---
-1.7.9.2
-
Deleted: trunk/dports/graphics/fontconfig/files/0002-fcarch-Check-for-architecture-type-at-runtime.diff
===================================================================
--- trunk/dports/graphics/fontconfig/files/0002-fcarch-Check-for-architecture-type-at-runtime.diff 2012-03-28 01:29:25 UTC (rev 91264)
+++ trunk/dports/graphics/fontconfig/files/0002-fcarch-Check-for-architecture-type-at-runtime.diff 2012-03-28 02:01:20 UTC (rev 91265)
@@ -1,132 +0,0 @@
-From 3d2f1071573cc171ceddd796fd911faabc491302 Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston <jeremyhu at apple.com>
-Date: Sun, 18 Mar 2012 23:21:09 -0700
-Subject: [PATCH 2/2] fcarch: Check for architecture type at runtime rather
- than build time
-
-https://bugs.freedesktop.org/show_bug.cgi?id=20208
-
-Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
----
- configure.in | 2 --
- src/fcarch.h | 75 ++++++++++++++++++++++++++++++++--------------------------
- 2 files changed, 42 insertions(+), 35 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index 3204f2e..41a7d39 100644
---- a/configure.in
-+++ b/configure.in
-@@ -493,8 +493,6 @@ AC_SUBST(DOCMAN3)
-
- dnl Figure out what cache format suffix to use for this architecture
- AC_C_BIGENDIAN
--AC_CHECK_SIZEOF([void *])
--AC_CHECK_ALIGNOF([double])
-
-
-
-diff --git a/src/fcarch.h b/src/fcarch.h
-index 8695933..0675994 100644
---- a/src/fcarch.h
-+++ b/src/fcarch.h
-@@ -40,23 +40,27 @@ FC_ASSERT_STATIC (4 == sizeof (FcValueBinding));
- FC_ASSERT_STATIC (8 == sizeof (FcAlign));
- FC_ASSERT_STATIC (0x20 == sizeof (FcCharLeaf));
-
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (intptr_t));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcPatternEltPtr));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueListPtr));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (char *));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (struct FcPatternElt *));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueList *));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcStrSet *));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcCharLeaf **));
--FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcChar16 *));
-+FC_ASSERT_STATIC (sizeof(void *) == sizeof (intptr_t));
-+FC_ASSERT_STATIC (sizeof(void *) == sizeof (FcPatternEltPtr));
-+FC_ASSERT_STATIC (sizeof(void *) == sizeof (FcValueListPtr));
-+FC_ASSERT_STATIC (sizeof(void *) == sizeof (char *));
-+FC_ASSERT_STATIC (sizeof(void *) == sizeof (struct FcPatternElt *));
-+FC_ASSERT_STATIC (sizeof(void *) == sizeof (FcValueList *));
-+FC_ASSERT_STATIC (sizeof(void *) == sizeof (FcStrSet *));
-+FC_ASSERT_STATIC (sizeof(void *) == sizeof (FcCharLeaf **));
-+FC_ASSERT_STATIC (sizeof(void *) == sizeof (FcChar16 *));
-
--FC_ASSERT_STATIC (0x08 + 1*ALIGNOF_DOUBLE == sizeof (FcValue));
--FC_ASSERT_STATIC (0x00 + 2*SIZEOF_VOID_P == sizeof (FcPatternElt));
--FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcPattern));
--FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcCharSet));
--FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache));
--#endif
-+FC_ASSERT_STATIC (0x08 + offsetof(struct { char c; double d; }, d) == sizeof (FcValue));
-+FC_ASSERT_STATIC (0x00 + 2*sizeof(void *) == sizeof (FcPatternElt));
-+FC_ASSERT_STATIC (0x08 + 2*sizeof(void *) == sizeof (FcPattern));
-+FC_ASSERT_STATIC (0x08 + 2*sizeof(void *) == sizeof (FcCharSet));
-+FC_ASSERT_STATIC (0x08 + 6*sizeof(void *) == sizeof (FcCache));
-
-+#ifdef __APPLE__
-+#include <machine/endian.h>
-+#endif
-+#endif
-+
- /*
- * Each unique machine architecture needs an entry in this file
- * So far the differences boil down to: endianness, 32 vs 64 bit pointers,
-@@ -86,31 +90,36 @@ FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache));
- */
- #define FC_ARCH_MAX_LEN 6
- static inline int _FcGetArch(FcChar8 *buffer) {
-+ const char *endian;
-+ int ptr_bytes;
-+ int dbl_align;
-+
- if (buffer == NULL)
- return EINVAL;
-
--#if defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN
--# define FC_ARCH_ENDIAN "be"
--#else /* !WORDS_BIGENDIAN */
--# define FC_ARCH_ENDIAN "le"
--#endif
-+#ifdef FC_ARCHITECTURE
-+ /* If FC_ARCHITECTURE is set, use it */
-+ snprintf((char *) buffer, FC_ARCH_MAX_LEN + 1, "%s", FC_ARCHITECTURE);
-+#else
-
--#if SIZEOF_VOID_P == 4
--# if ALIGNOF_DOUBLE == 4
--# define FC_ARCH_SIZE_ALIGN "32d4"
--# else /* ALIGNOF_DOUBLE != 4 */
--# define FC_ARCH_SIZE_ALIGN "32d8"
--# endif
--#else /* SIZEOF_VOID_P != 4 */
--# define FC_ARCH_SIZE_ALIGN "64"
-+#if defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
-+ endian = "le";
-+#elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
-+ endian = "be";
-+#elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_PDP_ENDIAN
-+ endian = "pe";
-+#elif defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN
-+ /* Fallback on what configure tells us */
-+ endian = "be";
-+#else
-+ endian = "le";
- #endif
-
--/* config.h might override this */
--#ifndef FC_ARCHITECTURE
--# define FC_ARCHITECTURE FC_ARCH_ENDIAN FC_ARCH_SIZE_ALIGN
--#endif
-+ ptr_bytes = 8 * sizeof(void *);
-+ dbl_align = offsetof(struct { char c; double d; }, d);
-
-- snprintf((char *) buffer, FC_ARCH_MAX_LEN + 1, "%s", FC_ARCHITECTURE);
-+ snprintf((char *) buffer, FC_ARCH_MAX_LEN + 1, "%s%dd%d", endian, ptr_bytes, dbl_align);
-+#endif
-
- return 0;
- }
---
-1.7.9.2
-
Copied: trunk/dports/graphics/fontconfig/files/patch-check-arch-at-runtime.diff (from rev 91264, trunk/dports/graphics/fontconfig/files/0002-fcarch-Check-for-architecture-type-at-runtime.diff)
===================================================================
--- trunk/dports/graphics/fontconfig/files/patch-check-arch-at-runtime.diff (rev 0)
+++ trunk/dports/graphics/fontconfig/files/patch-check-arch-at-runtime.diff 2012-03-28 02:01:20 UTC (rev 91265)
@@ -0,0 +1,86 @@
+From 8cc4498122b17843b00ec3eebdd7a7d8d59cb7ff Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Mon, 19 Mar 2012 09:16:41 +0000
+Subject: fcarch: Check for architecture signature at compile time rather than configure time
+
+https://bugs.freedesktop.org/show_bug.cgi?id=20208
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c
+index d265350..deb4aa8 100644
+--- a/fc-cache/fc-cache.c
++++ b/fc-cache/fc-cache.c
+@@ -22,8 +22,6 @@
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+-#include "../src/fcarch.h"
+-
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #else
+@@ -34,6 +32,7 @@
+ #endif
+
+ #include <fontconfig/fontconfig.h>
++#include "../src/fcarch.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+diff --git a/src/fcarch.c b/src/fcarch.c
+index c69397e..09d24b3 100644
+--- a/src/fcarch.c
++++ b/src/fcarch.c
+@@ -31,12 +31,12 @@
+
+ #ifndef FC_ARCHITECTURE
+
+-#include "fcarch.h"
+-
+ /* Make sure the cache structure is consistent with what we expect */
+
+ #include "fcint.h"
+
++#include "fcarch.h"
++
+ FC_ASSERT_STATIC (1 == sizeof (char));
+ FC_ASSERT_STATIC (2 == sizeof (FcChar16));
+ FC_ASSERT_STATIC (4 == sizeof (int));
+diff --git a/src/fcarch.h b/src/fcarch.h
+index 9cabf04..22e6f8e 100644
+--- a/src/fcarch.h
++++ b/src/fcarch.h
+@@ -46,9 +46,28 @@
+ * be64 1234 8 8
+ */
+
+-#if defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN
++#ifdef __APPLE__
++# include <machine/endian.h>
++# undef SIZEOF_VOID_P
++# undef ALIGNOF_DOUBLE
++# ifdef __LP64__
++# define SIZEOF_VOID_P 8
++# define ALIGNOF_DOUBLE 8
++# else
++# define SIZEOF_VOID_P 4
++# define ALIGNOF_DOUBLE 4
++# endif
++#endif
++
++#if defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
++# define FC_ARCH_ENDIAN "le"
++#elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
++# define FC_ARCH_ENDIAN "be"
++#elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_PDP_ENDIAN
++# define FC_ARCH_ENDIAN "pe"
++#elif defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN
+ # define FC_ARCH_ENDIAN "be"
+-#else /* !WORDS_BIGENDIAN */
++#else
+ # define FC_ARCH_ENDIAN "le"
+ #endif
+
+--
+cgit v0.9.0.2-2-gbebe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120327/56e053f9/attachment.html>
More information about the macports-changes
mailing list