From 673112b192a9494ea96f7daca061b080db5d3977 Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Fri, 17 Jul 2009 14:18:07 +0200 Subject: Check for support of -z nodelete LD flag, don't use it unconditionally. On non-GNU, non-Sun linkers, the -z option is often not understood; make sure that the -z nodelete option is usable before making use of it. Unbreaks build on Mac OS X. --- configure.ac | 9 +++++++++ src/Makefile.am | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index cc7f674a..112a1a8f 100644 --- a/configure.ac +++ b/configure.ac @@ -119,6 +119,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. diff --git a/src/Makefile.am b/src/Makefile.am index ac627c84..c022fa7c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 -- cgit From a6d67187126ef37b69b0d8d94dfeebeb364a8444 Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Fri, 17 Jul 2009 14:33:33 +0200 Subject: Request explicitly POSIX.1-2001 for clock_gettime. This might actually call for a rewrite of system extensions handling. --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 112a1a8f..9b49f23e 100644 --- a/configure.ac +++ b/configure.ac @@ -74,6 +74,9 @@ 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]) + ;; esac AM_SILENT_RULES([yes]) -- cgit From 0a5257b520ae540775367eb20a4db3e76436cdf9 Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Fri, 17 Jul 2009 20:41:58 +0200 Subject: Also request Darwin extensions, as they are needed for stuff like NSIG. Without this definition, non-POSIX interfaces (which are needed) are hidden by the _POSIX_C_SOURCE request (for clock_gettime). --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 9b49f23e..18007357 100644 --- a/configure.ac +++ b/configure.ac @@ -76,6 +76,7 @@ case $host in ;; *-*-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 -- cgit From 191c57effe385c797d8f226accd9afceee972888 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Fri, 17 Jul 2009 13:45:37 +0200 Subject: make bootstrap.sh aware of Darwin environment Signed-off-by: Daniel Mack --- bootstrap.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index aa9755fa..a5bd9a78 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -40,10 +40,22 @@ run_versioned() { set -ex +case $(uname) in + *Darwin*) + CP_OPTS="-R" + CHMOD_OPTS="" + LIBTOOLIZE="glibtoolize" + ;; + *) + CP_OPTS="-av" + CHMOD_OPTS="-c" + ;; +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 ${CP_OPTS} .git/hooks/pre-commit.sample .git/hooks/pre-commit + chmod ${CHMOD_OPTS} +x .git/hooks/pre-commit fi if [ -f .tarball-version ]; then -- cgit From 8c85c9999661a57e1bd10e79ad398b812ff4ea87 Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Fri, 17 Jul 2009 20:48:44 +0200 Subject: Further simplify on Daniel's patch for bootstrap.sh. Instead of having further indirections, stick to POSIX command options for cp and chmod. This leaves just the LIBTOOL handling to be Darwin-specific. --- bootstrap.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index a5bd9a78..79e0a7dc 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -42,20 +42,14 @@ set -ex case $(uname) in *Darwin*) - CP_OPTS="-R" - CHMOD_OPTS="" LIBTOOLIZE="glibtoolize" ;; - *) - CP_OPTS="-av" - CHMOD_OPTS="-c" - ;; esac if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then echo "Activating pre-commit hook." - cp ${CP_OPTS} .git/hooks/pre-commit.sample .git/hooks/pre-commit - chmod ${CHMOD_OPTS} +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 -- cgit From 542607f4c602e632b32efe2b6fd21f81ff52bd8d Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Fri, 17 Jul 2009 21:03:22 +0200 Subject: Make the rtstutter tests mostly pointless without CLOCK_REALTIME. On the other hand, this actually makes the test build, and test at least that it doesn't abort away, when the CLOCK_REALTIME interface is not present (or when clock_gettime is not found). --- src/tests/rtstutter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tests/rtstutter.c b/src/tests/rtstutter.c index a4b5d596..c93fee93 100644 --- a/src/tests/rtstutter.c +++ b/src/tests/rtstutter.c @@ -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)); } -- cgit From d18eb61bd2fe5940bccc2b5fcda4029159021d00 Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Fri, 17 Jul 2009 21:05:49 +0200 Subject: Again make sure that the wait() definition is not shadowed. Rename the parameter in pa_asyncmsgq_get() to wait_op. --- src/pulsecore/asyncmsgq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pulsecore/asyncmsgq.c b/src/pulsecore/asyncmsgq.c index e191b05f..083d9de2 100644 --- a/src/pulsecore/asyncmsgq.c +++ b/src/pulsecore/asyncmsgq.c @@ -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; } -- cgit