summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkim <jkim@058c260c-8361-11dd-a0ac-aa2bafec7d09>2013-12-05 03:51:49 +0800
committerjkim <jkim@058c260c-8361-11dd-a0ac-aa2bafec7d09>2013-12-05 03:51:49 +0800
commitf6995a7141a63c2ca8f0f6a1049302069402ee5f (patch)
tree7c0a5c02a9f4b79b502f2cfde72dc0858d32fa64
parent61ff61381cdad4d034a6d56ca2c331efdefb001e (diff)
downloadxorg-devel-ports-f6995a7141a63c2ca8f0f6a1049302069402ee5f.tar
xorg-devel-ports-f6995a7141a63c2ca8f0f6a1049302069402ee5f.tar.gz
xorg-devel-ports-f6995a7141a63c2ca8f0f6a1049302069402ee5f.tar.bz2
xorg-devel-ports-f6995a7141a63c2ca8f0f6a1049302069402ee5f.tar.lz
xorg-devel-ports-f6995a7141a63c2ca8f0f6a1049302069402ee5f.tar.xz
xorg-devel-ports-f6995a7141a63c2ca8f0f6a1049302069402ee5f.tar.zst
xorg-devel-ports-f6995a7141a63c2ca8f0f6a1049302069402ee5f.zip
libxshmfence - Shared memory 'SyncFence' synchronization primitive
This library offers a CPU-based synchronization primitive compatible with the X SyncFence objects that can be shared between processes using file descriptor passing. WWW: http://www.freedesktop.org/Software/xlibs git-svn-id: https://trillian.chruetertee.ch/svn/ports/trunk@1291 058c260c-8361-11dd-a0ac-aa2bafec7d09
-rw-r--r--devel/libxshmfence/Makefile19
-rw-r--r--devel/libxshmfence/distinfo2
-rw-r--r--devel/libxshmfence/files/patch-configure.ac16
-rw-r--r--devel/libxshmfence/files/patch-src__xshmfence_futex.h83
-rw-r--r--devel/libxshmfence/pkg-descr5
-rw-r--r--devel/libxshmfence/pkg-plist6
6 files changed, 131 insertions, 0 deletions
diff --git a/devel/libxshmfence/Makefile b/devel/libxshmfence/Makefile
new file mode 100644
index 0000000..5e0ffd4
--- /dev/null
+++ b/devel/libxshmfence/Makefile
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+PORTNAME= libxshmfence
+PORTVERSION= 1.1
+CATEGORIES= devel
+
+MAINTAINER= x11@FreeBSD.org
+COMMENT= Shared memory 'SyncFence' synchronization primitive
+
+LICENSE= MIT
+
+USE_AUTOTOOLS= autoconf
+USE_XORG= xproto
+XORG_CAT= lib
+
+test: build
+ @cd ${WRKSRC} && ${MAKE} check
+
+.include <bsd.port.mk>
diff --git a/devel/libxshmfence/distinfo b/devel/libxshmfence/distinfo
new file mode 100644
index 0000000..3b5cd87
--- /dev/null
+++ b/devel/libxshmfence/distinfo
@@ -0,0 +1,2 @@
+SHA256 (xorg/lib/libxshmfence-1.1.tar.bz2) = dbc2db2925ca9f216fd1e9c63d0974db9f4d49aaf5877ffb606d2d8d7e58cebe
+SIZE (xorg/lib/libxshmfence-1.1.tar.bz2) = 291347
diff --git a/devel/libxshmfence/files/patch-configure.ac b/devel/libxshmfence/files/patch-configure.ac
new file mode 100644
index 0000000..7102582
--- /dev/null
+++ b/devel/libxshmfence/files/patch-configure.ac
@@ -0,0 +1,16 @@
+--- configure.ac.orig 2013-11-27 00:54:13.000000000 -0500
++++ configure.ac 2013-12-04 14:08:06.000000000 -0500
+@@ -55,6 +55,13 @@
+
+ if test "x$FUTEX" = "xauto"; then
+ AC_CHECK_HEADER([linux/futex.h], [FUTEX=yes], [FUTEX=no])
++ if test "x$FUTEX" = "xno"; then
++ AC_CHECK_HEADER([sys/umtx.h], [FUTEX=yes], [FUTEX=no],
++ [[#include <errno.h>
++ #ifdef HAVE_SYS_TYPES_H
++ # include <sys/types.h>
++ #endif]])
++ fi
+ fi
+
+ if test "x$FUTEX" = "xyes"; then
diff --git a/devel/libxshmfence/files/patch-src__xshmfence_futex.h b/devel/libxshmfence/files/patch-src__xshmfence_futex.h
new file mode 100644
index 0000000..8ed68b6
--- /dev/null
+++ b/devel/libxshmfence/files/patch-src__xshmfence_futex.h
@@ -0,0 +1,83 @@
+--- src/xshmfence_futex.h.orig 2013-11-20 17:13:08.000000000 -0500
++++ src/xshmfence_futex.h 2013-12-04 14:06:21.000000000 -0500
+@@ -1,5 +1,6 @@
+ /*
+ * Copyright © 2013 Keith Packard
++ * Copyright © 2013 Jung-uk Kim <jkim@FreeBSD.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+@@ -24,37 +25,59 @@
+ #define _XSHMFENCE_FUTEX_H_
+
+ #include <errno.h>
++
++#ifdef __FreeBSD__
++
++#include <sys/types.h>
++#include <sys/umtx.h>
++
++typedef u_long futex_t;
++
++static inline int futex_wake(futex_t *addr) {
++ return umtx_wake(addr, INT_MAX);
++}
++
++static inline int futex_wait(futex_t *addr, futex_t value) {
++ return umtx_wait(addr, value, NULL);
++}
++
++#else
++
+ #include <stdint.h>
+ #include <values.h>
+ #include <linux/futex.h>
+ #include <sys/time.h>
+ #include <sys/syscall.h>
+
++typedef int32_t futex_t;
++
+ static inline long sys_futex(void *addr1, int op, int val1, struct timespec *timeout, void *addr2, int val3)
+ {
+ return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
+ }
+
+-static inline int futex_wake(int32_t *addr) {
++static inline int futex_wake(futex_t *addr) {
+ return sys_futex(addr, FUTEX_WAKE, MAXINT, NULL, NULL, 0);
+ }
+
+-static inline int futex_wait(int32_t *addr, int32_t value) {
++static inline int futex_wait(futex_t *addr, futex_t value) {
+ return sys_futex(addr, FUTEX_WAIT, value, NULL, NULL, 0);
+ }
+
++#endif
++
+ #define barrier() __asm__ __volatile__("": : :"memory")
+
+-static inline void atomic_store(int32_t *f, int32_t v)
++static inline void atomic_store(futex_t *f, futex_t v)
+ {
+ barrier();
+ *f = v;
+ barrier();
+ }
+
+-static inline int32_t atomic_fetch(int32_t *a)
++static inline futex_t atomic_fetch(futex_t *a)
+ {
+- int32_t v;
++ futex_t v;
+ barrier();
+ v = *a;
+ barrier();
+@@ -62,7 +85,7 @@
+ }
+
+ struct xshmfence {
+- int32_t v;
++ futex_t v;
+ };
+
+ #define xshmfence_init(fd)
diff --git a/devel/libxshmfence/pkg-descr b/devel/libxshmfence/pkg-descr
new file mode 100644
index 0000000..fdc1a01
--- /dev/null
+++ b/devel/libxshmfence/pkg-descr
@@ -0,0 +1,5 @@
+This library offers a CPU-based synchronization primitive compatible
+with the X SyncFence objects that can be shared between processes
+using file descriptor passing.
+
+WWW: http://www.freedesktop.org/Software/xlibs
diff --git a/devel/libxshmfence/pkg-plist b/devel/libxshmfence/pkg-plist
new file mode 100644
index 0000000..462fda0
--- /dev/null
+++ b/devel/libxshmfence/pkg-plist
@@ -0,0 +1,6 @@
+include/X11/xshmfence.h
+lib/libxshmfence.a
+lib/libxshmfence.la
+lib/libxshmfence.so
+lib/libxshmfence.so.1
+libdata/pkgconfig/xshmfence.pc