diff options
author | skrll <skrll@pkgsrc.org> | 2003-07-07 20:51:53 +0000 |
---|---|---|
committer | skrll <skrll@pkgsrc.org> | 2003-07-07 20:51:53 +0000 |
commit | b635b604b5e46fcea7b48aa1c962bf161c2910b3 (patch) | |
tree | ca316207382d0ba594a486e1d85aa2af2678442e /audio/arts/patches | |
parent | 8566b2c3fdf6209cb61f946a35c90893983c595d (diff) | |
download | pkgsrc-b635b604b5e46fcea7b48aa1c962bf161c2910b3.tar.gz |
Fix (at least) artsd on -current.
The s/mcop_mt/mcop/ hack that worked with pth doesn't work in -current.
Make libmcop_mt build with pre-current and pth by providing sem_* calls
based on a mutex and a condition variable.
Diffstat (limited to 'audio/arts/patches')
-rw-r--r-- | audio/arts/patches/patch-aa | 13 | ||||
-rw-r--r-- | audio/arts/patches/patch-ad | 13 | ||||
-rw-r--r-- | audio/arts/patches/patch-ae | 22 | ||||
-rw-r--r-- | audio/arts/patches/patch-ag | 11 | ||||
-rw-r--r-- | audio/arts/patches/patch-ah | 168 |
5 files changed, 169 insertions, 58 deletions
diff --git a/audio/arts/patches/patch-aa b/audio/arts/patches/patch-aa deleted file mode 100644 index eedc32ab82f..00000000000 --- a/audio/arts/patches/patch-aa +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-aa,v 1.3 2003/03/11 13:33:46 markd Exp $ - ---- Makefile.in.orig Sat Jan 4 06:07:18 2003 -+++ Makefile.in -@@ -297,7 +297,7 @@ - x_libraries = @x_libraries@ - - AUTOMAKE_OPTIONS = foreign 1.5 --COMPILE_FIRST = libltdl mcop mcopidl flow mcop_mt soundserver artsc examples tests doc -+COMPILE_FIRST = libltdl mcop mcopidl flow soundserver artsc examples tests doc - EXTRA_DIST = admin - - #DIST_SUBDIRS = mcop mcop_mt mcopidl flow soundserver artsc examples tests doc diff --git a/audio/arts/patches/patch-ad b/audio/arts/patches/patch-ad deleted file mode 100644 index cc906a65cae..00000000000 --- a/audio/arts/patches/patch-ad +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-ad,v 1.3 2003/03/11 13:33:46 markd Exp $ - ---- soundserver/Makefile.am.orig Sun Sep 22 23:28:12 2002 -+++ soundserver/Makefile.am -@@ -52,7 +52,7 @@ - bin_PROGRAMS = artsd artsplay artscat artswrapper artsshell artsrec - - artsd_LDADD = libsoundserver_idl.la $(FLOWLIBS) \ -- $(top_builddir)/mcop_mt/libmcop_mt.la $(USE_THREADS) -+ $(top_builddir)/mcop/libmcop.la $(USE_THREADS) - artsd_SOURCES = soundserverv2_impl.cc soundserver_impl.cc simplesoundserver_impl.cc artsd.cc cpuusage.cc samplestorage_impl.cc - artsd_COMPILE_FIRST = soundserver.h artsversion.h - diff --git a/audio/arts/patches/patch-ae b/audio/arts/patches/patch-ae deleted file mode 100644 index 3c9a5bca436..00000000000 --- a/audio/arts/patches/patch-ae +++ /dev/null @@ -1,22 +0,0 @@ -$NetBSD: patch-ae,v 1.3 2003/03/11 13:33:46 markd Exp $ - ---- soundserver/Makefile.in.orig Sat Jan 4 06:07:18 2003 -+++ soundserver/Makefile.in -@@ -337,7 +337,7 @@ - bin_PROGRAMS = artsd artsplay artscat artswrapper artsshell artsrec - - artsd_LDADD = libsoundserver_idl.la $(FLOWLIBS) \ -- $(top_builddir)/mcop_mt/libmcop_mt.la $(USE_THREADS) -+ $(top_builddir)/mcop/libmcop.la $(USE_THREADS) - - artsd_SOURCES = soundserverv2_impl.cc soundserver_impl.cc simplesoundserver_impl.cc artsd.cc cpuusage.cc samplestorage_impl.cc - artsd_COMPILE_FIRST = soundserver.h artsversion.h -@@ -443,7 +443,7 @@ - @KDE_USE_FINAL_TRUE@artsd_OBJECTS = $(artsd_final_OBJECTS) - artsd_DEPENDENCIES = libsoundserver_idl.la \ - $(top_builddir)/flow/libartsflow.la \ -- $(top_builddir)/mcop_mt/libmcop_mt.la -+ $(top_builddir)/mcop/libmcop.la - artsd_LDFLAGS = - am_artsplay_OBJECTS = artsplay.$(OBJEXT) - #>- artsplay_OBJECTS = $(am_artsplay_OBJECTS) diff --git a/audio/arts/patches/patch-ag b/audio/arts/patches/patch-ag index b4f115e48cc..4876bd3e2de 100644 --- a/audio/arts/patches/patch-ag +++ b/audio/arts/patches/patch-ag @@ -1,4 +1,4 @@ -$NetBSD: patch-ag,v 1.2 2003/03/11 13:33:46 markd Exp $ +$NetBSD: patch-ag,v 1.3 2003/07/07 20:51:55 skrll Exp $ --- configure.orig Sat Jan 4 06:07:20 2003 +++ configure @@ -11,12 +11,3 @@ $NetBSD: patch-ag,v 1.2 2003/03/11 13:33:46 markd Exp $ fi -@@ -31509,7 +31509,7 @@ - - - --DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin" -+DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin mcop_mt" - - if test ! -s $srcdir/subdirs; then - TOPSUBDIRS="" diff --git a/audio/arts/patches/patch-ah b/audio/arts/patches/patch-ah new file mode 100644 index 00000000000..ce039f758c4 --- /dev/null +++ b/audio/arts/patches/patch-ah @@ -0,0 +1,168 @@ +$NetBSD: patch-ah,v 1.1 2003/07/07 20:51:55 skrll Exp $ + +--- mcop_mt/threads_posix.cc.orig 2002-03-25 22:13:17.000000000 +0000 ++++ mcop_mt/threads_posix.cc +@@ -34,7 +34,150 @@ + #endif + + #include <pthread.h> ++#include <unistd.h> ++#ifdef _POSIX_SEMAPHORES + #include <semaphore.h> ++#else ++ ++#include <errno.h> ++ ++struct sem_t { ++ pthread_mutex_t lock; ++ pthread_cond_t gtzero; ++ unsigned int count; ++ unsigned int nwaiters; ++}; ++ ++static int sem_init(sem_t *, int, unsigned int); ++static int sem_destroy(sem_t *); ++static int sem_wait(sem_t *); ++static int sem_trywait(sem_t *); ++static int sem_post(sem_t *); ++static int sem_getvalue(sem_t *, int *); ++ ++static int ++sem_init(sem_t *sem, int pshared, unsigned int value) ++{ ++ ++ /* ++ * Range check the arguments. ++ */ ++ if (pshared != 0) { ++ errno = EPERM; ++ return -1; ++ } ++ ++ if (value > INT_MAX) { ++ errno = EINVAL; ++ return -1; ++ } ++ ++ /* ++ * Initialize the semaphore. ++ */ ++ if (pthread_mutex_init(&sem->lock, NULL) != 0) { ++ errno = ENOMEM; ++ return -1; ++ } ++ ++ if (pthread_cond_init(&sem->gtzero, NULL) != 0) { ++ pthread_mutex_destroy(&sem->lock); ++ errno = ENOMEM; ++ return -1; ++ } ++ ++ sem->count = value; ++ sem->nwaiters = 0; ++ ++ return 0; ++} ++ ++static int ++sem_destroy(sem_t *sem) ++{ ++ ++ /* Make sure there are no waiters. */ ++ pthread_mutex_lock(&sem->lock); ++ if (sem->nwaiters > 0) { ++ pthread_mutex_unlock(&sem->lock); ++ errno = EBUSY; ++ return -1; ++ } ++ pthread_mutex_unlock(&sem->lock); ++ ++ pthread_mutex_destroy(&sem->lock); ++ pthread_cond_destroy(&sem->gtzero); ++ ++ return 0; ++} ++ ++static int ++sem_wait(sem_t *sem) ++{ ++ pthread_testcancel(); ++ ++ pthread_mutex_lock(&sem->lock); ++ ++ while (sem->count == 0) { ++ sem->nwaiters++; ++ pthread_cond_wait(&sem->gtzero, &sem->lock); ++ } ++ sem->count--; ++ ++ pthread_mutex_unlock(&sem->lock); ++ ++ pthread_testcancel(); ++ return 0; ++} ++ ++static int ++sem_trywait(sem_t *sem) ++{ ++ int retval; ++ ++ pthread_mutex_lock(&sem->lock); ++ ++ if (sem->count > 0) { ++ sem->count--; ++ retval = 0; ++ } else { ++ errno = EAGAIN; ++ retval = -1; ++ } ++ ++ pthread_mutex_unlock(&sem->lock); ++ ++ return retval; ++} ++ ++static int ++sem_post(sem_t *sem) ++{ ++ pthread_mutex_lock(&sem->lock); ++ ++ sem->count++; ++ if (sem->nwaiters > 0) { ++ pthread_cond_broadcast(&sem->gtzero); ++ } ++ ++ pthread_mutex_unlock(&sem->lock); ++ ++ return 0; ++} ++ ++static int ++sem_getvalue(sem_t *sem, int *sval) ++{ ++ ++ pthread_mutex_lock(&sem->lock); ++ *sval = sem->count; ++ pthread_mutex_unlock(&sem->lock); ++ ++ return 0; ++} ++#endif ++ ++ + #include <debug.h> + #include <string.h> + +@@ -187,10 +330,12 @@ public: + Thread_impl(Thread *thread) : thread(thread) { + } + void setPriority(int priority) { ++#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING + struct sched_param sp; + sp.sched_priority = priority; + if (pthread_setschedparam(pthread, SCHED_FIFO, &sp)) + arts_debug("Thread::setPriority: sched_setscheduler failed"); ++#endif + } + static pthread_key_t privateDataKey; + static void *threadStartInternal(void *impl) |