tech-pkg archive

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

libdrm build fix



Hello,

attached patch fixes the build of x11/libdrm. It could be though
that this update should be reverted altogether, as apparently it
requires atomic operations, which were introduced with NetBSD 5.0
only, I think; otherwise, further patches would be required for
NetBSD 4.x.

Regards,

Dennis den Brok
Index: x11/libdrm/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libdrm/distinfo,v
retrieving revision 1.12
diff -u -r1.12 distinfo
--- x11/libdrm/distinfo 16 Apr 2010 13:43:36 -0000      1.12
+++ x11/libdrm/distinfo 17 Apr 2010 20:36:10 -0000
@@ -5,3 +5,4 @@
 Size (libdrm-2.4.20.tar.bz2) = 400812 bytes
 SHA1 (patch-ab) = 66dadd3244bfa9c69be0982fd2108deb94483de2
 SHA1 (patch-ac) = 61635a93d4b83783023114cd96993dc1075cbe1b
+SHA1 (patch-ad) = 9fd02973debca20e2c56bd94a6bf12ec3c00c58a
Index: x11/libdrm/patches/patch-ad
===================================================================
RCS file: x11/libdrm/patches/patch-ad
diff -N x11/libdrm/patches/patch-ad
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ x11/libdrm/patches/patch-ad 17 Apr 2010 20:36:10 -0000
@@ -0,0 +1,27 @@
+$NetBSD: patch-ad,v 1.1 2010/04/17 20:00:07 dennis Exp $
+--- xf86atomic.h.orig  2010-03-22 20:39:27.000000000 +0000
++++ xf86atomic.h       2010-04-17 07:35:18.000000000 +0000
+@@ -92,6 +92,23 @@
+ 
+ #endif
+ 
++#if defined(__NetBSD__) && !defined(HAS_ATOMIC_OPS)  /* NetBSD */
++
++#include <sys/atomic.h>
++#define HAS_ATOMIC_OPS 1
++
++typedef struct { int atomic; } atomic_t;
++
++# define atomic_read(x) (int) ((x)->atomic)
++# define atomic_set(x, val) ((x)->atomic = (val))
++# define atomic_inc(x) (atomic_inc_uint (&(x)->atomic))
++# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 1)
++# define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v)))
++# define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v)))
++# define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, 
newv)
++
++#endif
++
+ #if ! HAS_ATOMIC_OPS
+ #error libdrm requires atomic operations, please define them for your 
CPU/compiler.
+ #endif


Home | Main Index | Thread Index | Old Index