diff options
author | zeising <zeising@058c260c-8361-11dd-a0ac-aa2bafec7d09> | 2013-12-08 19:31:05 +0800 |
---|---|---|
committer | zeising <zeising@058c260c-8361-11dd-a0ac-aa2bafec7d09> | 2013-12-08 19:31:05 +0800 |
commit | 45da8a47386df4cddf4229eadcb8227f6c97ad62 (patch) | |
tree | 7efff7de30cc6d1fb3ab7445922cc5c06d47a69b /x11/libxshmfence | |
parent | dd68fe99648f6bb3784639bcd042dcab756cef7d (diff) | |
download | xorg-devel-ports-45da8a47386df4cddf4229eadcb8227f6c97ad62.tar xorg-devel-ports-45da8a47386df4cddf4229eadcb8227f6c97ad62.tar.gz xorg-devel-ports-45da8a47386df4cddf4229eadcb8227f6c97ad62.tar.bz2 xorg-devel-ports-45da8a47386df4cddf4229eadcb8227f6c97ad62.tar.lz xorg-devel-ports-45da8a47386df4cddf4229eadcb8227f6c97ad62.tar.xz xorg-devel-ports-45da8a47386df4cddf4229eadcb8227f6c97ad62.tar.zst xorg-devel-ports-45da8a47386df4cddf4229eadcb8227f6c97ad62.zip |
Move xshmemfence to x11 category, most other x11 libraries live here.
Hook it up in bsd.xorg.mk
git-svn-id: https://trillian.chruetertee.ch/svn/ports/trunk@1296 058c260c-8361-11dd-a0ac-aa2bafec7d09
Diffstat (limited to 'x11/libxshmfence')
-rw-r--r-- | x11/libxshmfence/Makefile | 18 | ||||
-rw-r--r-- | x11/libxshmfence/distinfo | 2 | ||||
-rw-r--r-- | x11/libxshmfence/files/patch-config.h.in | 12 | ||||
-rw-r--r-- | x11/libxshmfence/files/patch-configure | 30 | ||||
-rw-r--r-- | x11/libxshmfence/files/patch-src__xshmfence_futex.h | 83 | ||||
-rw-r--r-- | x11/libxshmfence/pkg-descr | 5 | ||||
-rw-r--r-- | x11/libxshmfence/pkg-plist | 6 |
7 files changed, 156 insertions, 0 deletions
diff --git a/x11/libxshmfence/Makefile b/x11/libxshmfence/Makefile new file mode 100644 index 0000000..dd0b6db --- /dev/null +++ b/x11/libxshmfence/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +PORTNAME= libxshmfence +PORTVERSION= 1.1 +CATEGORIES= x11 + +MAINTAINER= x11@FreeBSD.org +COMMENT= Shared memory 'SyncFence' synchronization primitive + +LICENSE= MIT + +USE_XORG= xproto +XORG_CAT= lib + +test: build + @cd ${WRKSRC} && ${MAKE} check + +.include <bsd.port.mk> diff --git a/x11/libxshmfence/distinfo b/x11/libxshmfence/distinfo new file mode 100644 index 0000000..3b5cd87 --- /dev/null +++ b/x11/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/x11/libxshmfence/files/patch-config.h.in b/x11/libxshmfence/files/patch-config.h.in new file mode 100644 index 0000000..ea96db2 --- /dev/null +++ b/x11/libxshmfence/files/patch-config.h.in @@ -0,0 +1,12 @@ +--- config.h.in.orig 2013-11-27 00:54:40.000000000 -0500 ++++ config.h.in 2013-12-05 16:28:18.000000000 -0500 +@@ -33,6 +33,9 @@ + /* Define to 1 if you have the <sys/types.h> header file. */ + #undef HAVE_SYS_TYPES_H + ++/* Use umtx */ ++#undef HAVE_UMTX ++ + /* Define to 1 if you have the <unistd.h> header file. */ + #undef HAVE_UNISTD_H + diff --git a/x11/libxshmfence/files/patch-configure b/x11/libxshmfence/files/patch-configure new file mode 100644 index 0000000..16697e3 --- /dev/null +++ b/x11/libxshmfence/files/patch-configure @@ -0,0 +1,30 @@ +--- configure 2013-11-27 00:54:35.000000000 -0500 ++++ configure 2013-12-05 16:30:53.000000000 -0500 +@@ -17633,11 +17633,27 @@ + ac_fn_c_check_header_mongrel "$LINENO" "linux/futex.h" "ac_cv_header_linux_futex_h" "$ac_includes_default" + if test "x$ac_cv_header_linux_futex_h" = xyes; then : + FUTEX=yes ++fi ++ ++ ++fi ++ ++if test "x$FUTEX" = "xauto"; then ++ ac_fn_c_check_header_compile "$LINENO" "sys/umtx.h" "ac_cv_header_sys_umtx_h" "#include <errno.h> ++ #include <sys/types.h> ++" ++if test "x$ac_cv_header_sys_umtx_h" = xyes; then : ++ FUTEX=yes + else + FUTEX=no + fi + + ++ if test "x$FUTEX" = "xyes"; then ++ ++$as_echo "#define HAVE_UMTX 1" >>confdefs.h ++ ++ fi + fi + + if test "x$FUTEX" = "xyes"; then diff --git a/x11/libxshmfence/files/patch-src__xshmfence_futex.h b/x11/libxshmfence/files/patch-src__xshmfence_futex.h new file mode 100644 index 0000000..32deb6a --- /dev/null +++ b/x11/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-05 16:09:39.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 HAVE_UMTX ++ ++#include <sys/types.h> ++#include <sys/umtx.h> ++ ++typedef u_long futex_type; ++ ++static inline int futex_wake(futex_type *addr) { ++ return umtx_wake(addr, INT_MAX); ++} ++ ++static inline int futex_wait(futex_type *addr, futex_type 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_type; ++ + 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_type *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_type *addr, futex_type 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_type *f, futex_type v) + { + barrier(); + *f = v; + barrier(); + } + +-static inline int32_t atomic_fetch(int32_t *a) ++static inline futex_type atomic_fetch(futex_type *a) + { +- int32_t v; ++ futex_type v; + barrier(); + v = *a; + barrier(); +@@ -62,7 +85,7 @@ + } + + struct xshmfence { +- int32_t v; ++ futex_type v; + }; + + #define xshmfence_init(fd) diff --git a/x11/libxshmfence/pkg-descr b/x11/libxshmfence/pkg-descr new file mode 100644 index 0000000..fdc1a01 --- /dev/null +++ b/x11/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/x11/libxshmfence/pkg-plist b/x11/libxshmfence/pkg-plist new file mode 100644 index 0000000..462fda0 --- /dev/null +++ b/x11/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 |