From f0614bf4176d0d3683475f9072a6a6bc0fee04b8 Mon Sep 17 00:00:00 2001 From: bjs Date: Sun, 17 Aug 2008 09:41:35 +0000 Subject: #define bswap_32 bswap32 for NetBSD in the mach64 driver; also, for the sis driver, use either NetBSD's atomic ops if we have them, else check for gcc's __sync_synchronize. I suppose the right thing to do is split the dri drivers out of this package, but hopefully this will resolve [pkg/39359]. No revision bump, as I just updated the package a few hours ago. --- graphics/MesaLib/Makefile | 13 ++++++++++++- graphics/MesaLib/distinfo | 4 +++- graphics/MesaLib/patches/patch-aa | 19 +++++++++++++++++++ graphics/MesaLib/patches/patch-af | 20 ++++++++++++++++++++ 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 graphics/MesaLib/patches/patch-aa create mode 100644 graphics/MesaLib/patches/patch-af diff --git a/graphics/MesaLib/Makefile b/graphics/MesaLib/Makefile index 4db6c975777..9a0f5cf5f23 100644 --- a/graphics/MesaLib/Makefile +++ b/graphics/MesaLib/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.69 2008/08/17 08:25:50 bjs Exp $ +# $NetBSD: Makefile,v 1.70 2008/08/17 09:41:35 bjs Exp $ PKGNAME= MesaLib-${MESA_PKGVERSION} COMMENT= Graphics library similar to SGI's OpenGL @@ -21,6 +21,17 @@ BUILDLINK_API_DEPENDS.driproto+= xf86driproto>=2.0.4 .include "../../mk/bsd.prefs.mk" CFLAGS.NetBSD+= -D_NETBSD_SOURCE +CFLAGS.NetBSD+= ${ATOMIC_OPS_CHECK}HAVE_NETBSD_ATOMIC_OPS + +.if ${OPSYS} == "NetBSD" && !target(netbsd-atomic-ops-check) +netbsd-atomic-ops-check: +ATOMIC_OPS_CHECK!=\ + if ( ${NM} /usr/lib/libc.so | ${GREP} -q atomic_cas_uint ); then \ + ${ECHO} "-D"; \ + else \ + ${ECHO} "-U"; \ + fi +.endif .if (${MACHINE_ARCH} == "x86_64" || \ ${MACHINE_ARCH} == "sparc64" || \ diff --git a/graphics/MesaLib/distinfo b/graphics/MesaLib/distinfo index f9b9ed7d52c..a341dd61927 100644 --- a/graphics/MesaLib/distinfo +++ b/graphics/MesaLib/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.56 2008/07/27 00:03:42 bjs Exp $ +$NetBSD: distinfo,v 1.57 2008/08/17 09:41:35 bjs Exp $ SHA1 (Mesa-7.0.4/MesaDemos-7.0.4.tar.bz2) = 70e9b37120b978fda9cff8e1478e94cdc245b80f RMD160 (Mesa-7.0.4/MesaDemos-7.0.4.tar.bz2) = 1dd92b4260a32c30e9242a28fbb34178b24abf44 @@ -9,10 +9,12 @@ Size (Mesa-7.0.4/MesaGLUT-7.0.4.tar.bz2) = 327581 bytes SHA1 (Mesa-7.0.4/MesaLib-7.0.4.tar.bz2) = 7f658fb2e8fa988d2c00aa63d9e4b834f96b67db RMD160 (Mesa-7.0.4/MesaLib-7.0.4.tar.bz2) = 7c3dff2b7eddcbd4974147dd0ae09a792d6d0765 Size (Mesa-7.0.4/MesaLib-7.0.4.tar.bz2) = 3401051 bytes +SHA1 (patch-aa) = 230d96c82fdfdbb40aa304572c4696dd241f24c7 SHA1 (patch-ab) = 06e2b4159bbda8c87cd264babe129b6bea017cbc SHA1 (patch-ac) = ed3ec49ea2aacf231bbcb38093f3dc01a0cb2468 SHA1 (patch-ad) = 5667b1bfab7cfeb1b9ea8750798f027fd0ccfd44 SHA1 (patch-ae) = e1c37a279cf3fc78d7eb43e392abbb40d3419a5f +SHA1 (patch-af) = bdfb8218b79f82a5c37cae27d0db33f5fdbcf94f SHA1 (patch-ag) = 9010c8c90a43a37bbc5766957e25536ac67e55b5 SHA1 (patch-ah) = 3e60a700697f200fb2819f9270a37ad4a5cfa695 SHA1 (patch-ai) = 171a27e6e4a5ed92c6c2355283179e2091031a79 diff --git a/graphics/MesaLib/patches/patch-aa b/graphics/MesaLib/patches/patch-aa new file mode 100644 index 00000000000..77a5cb2b038 --- /dev/null +++ b/graphics/MesaLib/patches/patch-aa @@ -0,0 +1,19 @@ +$NetBSD: patch-aa,v 1.10 2008/08/17 09:41:35 bjs Exp $ + +--- src/mesa/drivers/dri/mach64/mach64_context.h.orig 2008-07-18 10:39:12.000000000 -0400 ++++ src/mesa/drivers/dri/mach64/mach64_context.h +@@ -296,7 +296,14 @@ extern GLboolean mach64UnbindContext( __ + #define LE32_OUT( x, y ) do { *(GLuint *)(x) = (y); } while (0) + #define LE32_OUT_FLOAT( x, y ) do { *(GLfloat *)(x) = (y); } while (0) + #else ++/* XXX mesa should handle many more platforms here [properly] */ ++#if defined(__NetBSD__) ++#include ++#include ++#define bswap_32 bswap32 ++#else + #include ++#endif + #define LE32_IN( x ) bswap_32( *(GLuint *)(x) ) + #define LE32_IN_FLOAT( x ) \ + ({ \ diff --git a/graphics/MesaLib/patches/patch-af b/graphics/MesaLib/patches/patch-af new file mode 100644 index 00000000000..c54d76eb28e --- /dev/null +++ b/graphics/MesaLib/patches/patch-af @@ -0,0 +1,20 @@ +$NetBSD: patch-af,v 1.11 2008/08/17 09:41:35 bjs Exp $ + +--- src/mesa/drivers/dri/sis/sis_context.h.orig 2008-07-18 10:39:12.000000000 -0400 ++++ src/mesa/drivers/dri/sis/sis_context.h +@@ -403,8 +403,14 @@ struct sis_context + + #if defined(__i386__) || defined(__amd64__) + #define MMIO_WMB() __asm __volatile("" : : : "memory") ++#elif defined(HAVE_NETBSD_ATOMIC_H) ++#include ++#define MMIO_WMB() membar_sync() /* XXX is this adequate? */ ++#elif defined(__sync_synchronize) /* gcc built-in */ ++#define MMIO_WMB() __sync_synchronize() + #else +-#error platform needs WMB ++#warning Please define MMIO_WMB for this platform ++#define MMIO_WMB() + #endif + + #define mEndPrimitive() \ -- cgit v1.2.3