]> code.delx.au - pulseaudio/commitdiff
Merge commit 'flameeyes/osx'
authorLennart Poettering <lennart@poettering.net>
Thu, 23 Jul 2009 13:13:29 +0000 (15:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Jul 2009 13:13:29 +0000 (15:13 +0200)
bootstrap.sh
configure.ac
src/Makefile.am
src/pulsecore/asyncmsgq.c
src/tests/rtstutter.c

index aa9755faacf8d462249830a5563d935f136e39e5..79e0a7dcef8237f35e65c6fc7f02598371a0cbe8 100755 (executable)
@@ -40,10 +40,16 @@ run_versioned() {
 
 set -ex
 
+case $(uname) in
+       *Darwin*)
+               LIBTOOLIZE="glibtoolize"
+               ;;
+esac
+
 if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
     echo "Activating pre-commit hook."
-    cp -av .git/hooks/pre-commit.sample .git/hooks/pre-commit
-    chmod -c +x  .git/hooks/pre-commit
+    cp -pv  .git/hooks/pre-commit.sample .git/hooks/pre-commit
+    chmod -v +x  .git/hooks/pre-commit
 fi
 
 if [ -f .tarball-version ]; then
index cc7f674abc4a170b738e86a9befec5e23577df3d..18007357c9c8245a857b8202f829d7fa3c05b107 100644 (file)
@@ -74,6 +74,10 @@ case $host in
       AC_DEFINE(_XOPEN_SOURCE,        600, Needed to get declarations for msg_control and msg_controllen on Solaris)
       AC_DEFINE(__EXTENSIONS__,         1, Needed to get declarations for msg_control and msg_controllen on Solaris)
       ;;
+   *-*-darwin* )
+      AC_DEFINE([_POSIX_C_SOURCE], [200112L], [Needed to get clock_gettime on Mac OS X])
+      AC_DEFINE([_DARWIN_C_SOURCE], [200112L], [Needed to get NSIG on Mac OS X])
+      ;;
 esac
 
 AM_SILENT_RULES([yes])
@@ -119,6 +123,15 @@ dnl  other linkes might be added later
 CC_CHECK_LDFLAGS([-Wl,-z,now], [IMMEDIATE_LDFLAGS="-Wl,-z,now"])
 AC_SUBST([IMMEDIATE_LDFLAGS])
 
+dnl On ELF systems we don't want the libraries to be unloaded since we
+dnl don't clean them up properly, so we request the nodelete flag to be
+dnl enabled.
+dnl
+dnl On other systems, we don't really know how to do that, but it's
+dnl welcome if somebody can tell.
+CC_CHECK_LDFLAGS([-Wl,-z,nodelete], [NODELETE_LDFLAGS="-Wl,-z,nodelete"])
+AC_SUBST([NODELETE_LDFLAGS])
+
 dnl Check for the proper way to build libraries that have no undefined
 dnl symbols; on some hosts this needs to be avoided but the macro
 dnl takes care of it.
index ac627c84e6ba76a20b0f4037b4e8a68a5416fe15..c022fa7ca101cf90ea90c027a20644b03b998b23 100644 (file)
@@ -87,7 +87,7 @@ AM_CFLAGS = \
 
 AM_LIBADD = $(PTHREAD_LIBS) $(INTLLIBS)
 AM_LDADD = $(PTHREAD_LIBS) $(INTLLIBS)
-AM_LDFLAGS = -Wl,-z,nodelete
+AM_LDFLAGS = $(NODELETE_LDFLAGS)
 
 if STATIC_BINS
 BINLDFLAGS = -static
index e191b05fb03ff6d63c067ee09a82f0d3d7c9c025..083d9de21bd20e0135b996268cea957198bd7418 100644 (file)
@@ -172,11 +172,11 @@ int pa_asyncmsgq_send(pa_asyncmsgq *a, pa_msgobject *object, int code, const voi
     return i.ret;
 }
 
-int pa_asyncmsgq_get(pa_asyncmsgq *a, pa_msgobject **object, int *code, void **userdata, int64_t *offset, pa_memchunk *chunk, pa_bool_t wait) {
+int pa_asyncmsgq_get(pa_asyncmsgq *a, pa_msgobject **object, int *code, void **userdata, int64_t *offset, pa_memchunk *chunk, pa_bool_t wait_op) {
     pa_assert(PA_REFCNT_VALUE(a) > 0);
     pa_assert(!a->current);
 
-    if (!(a->current = pa_asyncq_pop(a->asyncq, wait))) {
+    if (!(a->current = pa_asyncq_pop(a->asyncq, wait_op))) {
 /*         pa_log("failure"); */
         return -1;
     }
index a4b5d596a6caef6df3d2f2f002f5a9fb7e9bd23c..c93fee939f1a0fa8746f7e36bff54c4a4987fd88 100644 (file)
@@ -67,7 +67,9 @@ static void* work(void *p) {
         pa_log_notice("CPU%i: Sleeping for 1s", PA_PTR_TO_UINT(p));
         sleep(1);
 
+#ifdef CLOCK_REALTIME
         pa_assert_se(clock_gettime(CLOCK_REALTIME, &end) == 0);
+#endif
 
         nsec =
             (uint64_t) ((((double) rand())*(double)(msec_upper-msec_lower)*PA_NSEC_PER_MSEC)/RAND_MAX) +
@@ -84,7 +86,9 @@ static void* work(void *p) {
         }
 
         do {
+#ifdef CLOCK_REALTIME
             pa_assert_se(clock_gettime(CLOCK_REALTIME, &now) == 0);
+#endif
         } while (now.tv_sec < end.tv_sec ||
                  (now.tv_sec == end.tv_sec && now.tv_nsec < end.tv_nsec));
     }