On Mon, Mar 18, 2013 at 05:40:02PM -0400, Brian Callahan wrote:
> On 3/18/2013 5:38 PM, Matthieu Herrb wrote:
> >On Mon, Mar 18, 2013 at 09:44:38PM +0100, Matthieu Herrb wrote:
> >>On Mon, Mar 18, 2013 at 04:12:59PM -0400, Brian Callahan wrote:
> >>>Hi --
> >>>
> >>>I tried building xenocara on a fresh install and fresh cvs checkout on
> >>>loongson, and I get the error below. There are no atomics on loongson.
> >>>
> >>Please test the patch below on as many arcitectures as possible.
> >>
> >>diff --git lib/fontconfig/common/config.h lib/fontconfig/common/config.h
> >>index 1836d1f..5e6070d 100644
> >>--- lib/fontconfig/common/config.h
> >>+++ lib/fontconfig/common/config.h
> >>@@ -90,7 +90,9 @@
> >> #define HAVE_GETUID 1
> >>
> >> /* Have Intel __sync_* atomic primitives */
> >>+#if defined(__i386__) || defined(__amd64__)
> >> #define HAVE_INTEL_ATOMIC_PRIMITIVES 1
> >>+#endif
> >>
> >> /* Define to 1 if you have the <inttypes.h> header file. */
> >> #define HAVE_INTTYPES_H 1
> >>
> >
> >Or do we have a list of architectures that support those gcc builtins
> >somewhere already ?
> >
>
> I don't know if we have a list somewhere, but I do know that no MIPS archs
> have those atomics, so at a minimum, we'd have to block out mips64 and
> mips64el.
>
Ok. So afer advice from kettenis@, here's a imho better
patch. (keeping the list in Makefile.inc will make it easier to expand
it later)
diff --git lib/fontconfig/Makefile.inc lib/fontconfig/Makefile.inc
index 5f0c63a..2854fb8 100644
--- lib/fontconfig/Makefile.inc
+++ lib/fontconfig/Makefile.inc
@@ -16,4 +16,10 @@ CFLAGS += -I${FONTCONFIG} \
-I${.CURDIR}/../common \
-I${.CURDIR}
+.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "amd64" || \
+ ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
+ ${MACHINE_ARCH} == "sparc64"
+CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES=1
+.endif
+
NOPROFILE =
diff --git lib/fontconfig/common/config.h lib/fontconfig/common/config.h
index 1836d1f..27713a1 100644
--- lib/fontconfig/common/config.h
+++ lib/fontconfig/common/config.h
@@ -90,7 +90,7 @@
#define HAVE_GETUID 1
/* Have Intel __sync_* atomic primitives */
-#define HAVE_INTEL_ATOMIC_PRIMITIVES 1
+/* #undef HAVE_INTEL_ATOMIC_PRIMITIVES 1 */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
--
Matthieu Herrb