pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/MesaLib #define bswap_32 bswap32 for NetBSD i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/42bd9d4f26b0
branches:  trunk
changeset: 545920:42bd9d4f26b0
user:      bjs <bjs%pkgsrc.org@localhost>
date:      Sun Aug 17 09:41:35 2008 +0000

description:
#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.

diffstat:

 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(-)

diffs (96 lines):

diff -r 6eb672712080 -r 42bd9d4f26b0 graphics/MesaLib/Makefile
--- a/graphics/MesaLib/Makefile Sun Aug 17 09:29:00 2008 +0000
+++ b/graphics/MesaLib/Makefile Sun Aug 17 09:41:35 2008 +0000
@@ -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 @@
 .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 -r 6eb672712080 -r 42bd9d4f26b0 graphics/MesaLib/distinfo
--- a/graphics/MesaLib/distinfo Sun Aug 17 09:29:00 2008 +0000
+++ b/graphics/MesaLib/distinfo Sun Aug 17 09:41:35 2008 +0000
@@ -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 @@
 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 -r 6eb672712080 -r 42bd9d4f26b0 graphics/MesaLib/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/MesaLib/patches/patch-aa Sun Aug 17 09:41:35 2008 +0000
@@ -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 <sys/types.h>
++#include <machine/byteswap.h>
++#define bswap_32 bswap32
++#else
+ #include <byteswap.h>
++#endif
+ #define LE32_IN( x )          bswap_32( *(GLuint *)(x) )
+ #define LE32_IN_FLOAT( x )                                            \
+ ({                                                                    \
diff -r 6eb672712080 -r 42bd9d4f26b0 graphics/MesaLib/patches/patch-af
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/MesaLib/patches/patch-af Sun Aug 17 09:41:35 2008 +0000
@@ -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 <sys/atomic.h>
++#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()  \



Home | Main Index | Thread Index | Old Index