From 711de8df9b78a46d4e12b810c26d26e9ead294e6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 17 Aug 2004 17:56:09 +0000 Subject: autoconf beefup build fixes git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@134 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/Makefile.am | 31 +++++++++++++++++++++---------- polyp/cli-text.c | 10 +++++----- polyp/sample-util.c | 10 +++++----- polyp/sink-input.c | 2 +- polyp/sink.c | 2 +- polyp/source.c | 2 +- polyp/util.c | 4 ++++ 7 files changed, 38 insertions(+), 23 deletions(-) (limited to 'polyp') diff --git a/polyp/Makefile.am b/polyp/Makefile.am index 791abf0e..1f982515 100644 --- a/polyp/Makefile.am +++ b/polyp/Makefile.am @@ -17,9 +17,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. -AM_CFLAGS=-ansi -D_GNU_SOURCE -DDLSEARCHDIR=\"$(pkglibdir)\" -I$(srcdir)/.. -AM_LDADD=-L. -lpthread -AM_LIBADD=-L. -lpthread +AM_CFLAGS=-ansi -D_GNU_SOURCE -DDLSEARCHDIR=\"$(pkglibdir)\" -I$(srcdir)/.. $(PTHREAD_CFLAGS) +AM_LDADD=$(PTHREAD_LIBS) +AM_LIBADD=$(PTHREAD_LIBS) polypincludedir=$(includedir)/polyp @@ -75,8 +75,11 @@ pkglib_LTLIBRARIES=libiochannel.la \ module-esound-protocol-tcp.la \ module-esound-protocol-unix.la \ module-native-protocol-tcp.la \ - module-native-protocol-unix.la \ - module-x11-bell.la + module-native-protocol-unix.la + +if !X_DISPLAY_MISSING +pkglib_LTLIBRARIES+=module-x11-bell.la +endif lib_LTLIBRARIES=libpolyp.la \ libpolyp-error.la \ @@ -265,9 +268,12 @@ module_cli_la_SOURCES = module-cli.c module_cli_la_LDFLAGS = -module -avoid-version module_cli_la_LIBADD = $(AM_LIBADD) libcli.la libiochannel.la +if !X_DISPLAY_MISSING module_x11_bell_la_SOURCES = module-x11-bell.c +module_x11_bell_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) module_x11_bell_la_LDFLAGS = -module -avoid-version -module_x11_bell_la_LIBADD = $(AM_LIBADD) -lX11 -L/usr/X11R6/lib +module_x11_bell_la_LIBADD = $(AM_LIBADD) $(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIB) +endif libpolyp_la_SOURCES = polyplib.h \ polyplib-def.h \ @@ -299,20 +305,29 @@ libpolyp_la_SOURCES = polyplib.h \ cdecl.h \ llist.h libpolyp_la_CFLAGS = $(AM_CFLAGS) +libpolyp_la_LDFLAGS = -version-info 0:0:0 libpolyp_mainloop_la_SOURCES = mainloop-api.h mainloop-api.c \ mainloop.c mainloop.h \ mainloop-signal.c mainloop-signal.h libpolyp_mainloop_la_CFLAGS = $(AM_CFLAGS) libpolyp_mainloop_la_LIBADD = $(AM_LIBADD) libpolyp.la +libpolyp_mainloop_la_LDFLAGS = -version-info 0:0:0 libpolyp_error_la_SOURCES = polyplib-error.c polyplib-error.h libpolyp_error_la_CFLAGS = $(AM_CFLAGS) libpolyp_error_la_LIBADD = $(AM_LIBADD) libpolyp.la +libpolyp_error_la_LDFLAGS = -version-info 0:0:0 libpolyp_simple_la_SOURCES = polyplib-simple.c polyplib-simple.h libpolyp_simple_la_CFLAGS = $(AM_CFLAGS) libpolyp_simple_la_LIBADD = $(AM_LIBADD) libpolyp.la libpolyp-mainloop.la +libpolyp_simple_la_LDFLAGS = -version-info 0:0:0 + +libpolyp_mainloop_glib_la_SOURCES = glib-mainloop.h glib-mainloop.c +libpolyp_mainloop_glib_la_CFLAGS = $(AM_CFLAGS) $(GLIB20_CFLAGS) +libpolyp_mainloop_glib_la_LIBADD = $(AM_LIBADD) libpolyp-mainloop.la $(GLIB20_LIBS) +libpolyp_mainloop_glib_la_LDFLAGS = -version-info 0:0:0 pacat_SOURCES = pacat.c pacat_LDADD = $(AM_LDADD) libpolyp.la libpolyp-error.la libpolyp-mainloop.la @@ -330,10 +345,6 @@ parec_simple_SOURCES = parec-simple.c parec_simple_LDADD = $(AM_LDADD) libpolyp.la libpolyp-simple.la libpolyp-error.la parec_simple_CFLAGS = $(AM_CFLAGS) -libpolyp_mainloop_glib_la_SOURCES = glib-mainloop.h glib-mainloop.c -libpolyp_mainloop_glib_la_CFLAGS = $(AM_CFLAGS) $(GLIB20_CFLAGS) -libpolyp_mainloop_glib_la_LIBADD = $(AM_LIBADD) libpolyp-mainloop.la $(GLIB20_LIBS) - mainloop_test_SOURCES = mainloop-test.c mainloop_test_CFLAGS = $(AM_CFLAGS) mainloop_test_LDADD = $(AM_LDADD) libpolyp-mainloop.la libpolyp.la diff --git a/polyp/cli-text.c b/polyp/cli-text.c index 558b53ca..000d6d34 100644 --- a/polyp/cli-text.c +++ b/polyp/cli-text.c @@ -89,7 +89,7 @@ char *pa_sink_list_to_string(struct pa_core *c) { for (sink = pa_idxset_first(c->sinks, &index); sink; sink = pa_idxset_next(c->sinks, &index)) { char ss[PA_SAMPLE_SNPRINT_MAX_LENGTH]; - pa_sample_snprint(ss, sizeof(ss), &sink->sample_spec); + pa_sample_spec_snprint(ss, sizeof(ss), &sink->sample_spec); assert(sink->monitor_source); pa_strbuf_printf( s, @@ -123,7 +123,7 @@ char *pa_source_list_to_string(struct pa_core *c) { for (source = pa_idxset_first(c->sources, &index); source; source = pa_idxset_next(c->sources, &index)) { char ss[PA_SAMPLE_SNPRINT_MAX_LENGTH]; - pa_sample_snprint(ss, sizeof(ss), &source->sample_spec); + pa_sample_spec_snprint(ss, sizeof(ss), &source->sample_spec); pa_strbuf_printf(s, " %c index: %u\n\tname: <%s>\n\tsample_spec: <%s>\n", c->default_source_name && !strcmp(source->name, c->default_source_name) ? '*' : ' ', source->index, @@ -155,7 +155,7 @@ char *pa_source_output_list_to_string(struct pa_core *c) { for (o = pa_idxset_first(c->source_outputs, &index); o; o = pa_idxset_next(c->source_outputs, &index)) { char ss[PA_SAMPLE_SNPRINT_MAX_LENGTH]; - pa_sample_snprint(ss, sizeof(ss), &o->sample_spec); + pa_sample_spec_snprint(ss, sizeof(ss), &o->sample_spec); assert(o->source); pa_strbuf_printf( s, " index: %u\n\tname: <%s>\n\tsource: <%u>\n\tsample_spec: <%s>\n", @@ -185,7 +185,7 @@ char *pa_sink_input_list_to_string(struct pa_core *c) { for (i = pa_idxset_first(c->sink_inputs, &index); i; i = pa_idxset_next(c->sink_inputs, &index)) { char ss[PA_SAMPLE_SNPRINT_MAX_LENGTH]; - pa_sample_snprint(ss, sizeof(ss), &i->sample_spec); + pa_sample_spec_snprint(ss, sizeof(ss), &i->sample_spec); assert(i->sink); pa_strbuf_printf( s, " index: %u\n\tname: <%s>\n\tsink: <%u>\n\tvolume: <0x%04x>\n\tlatency: <%u usec>\n\tsample_spec: <%s>\n", @@ -221,7 +221,7 @@ char *pa_scache_list_to_string(struct pa_core *c) { while ((e = pa_hashmap_iterate(c->scache_hashmap, &state))) { double l; char ss[PA_SAMPLE_SNPRINT_MAX_LENGTH]; - pa_sample_snprint(ss, sizeof(ss), &e->sample_spec); + pa_sample_spec_snprint(ss, sizeof(ss), &e->sample_spec); l = (double) e->memchunk.length / pa_bytes_per_second(&e->sample_spec); diff --git a/polyp/sample-util.c b/polyp/sample-util.c index 8f5558a4..6a09478f 100644 --- a/polyp/sample-util.c +++ b/polyp/sample-util.c @@ -64,7 +64,7 @@ void pa_silence_memory(void *p, size_t length, const struct pa_sample_spec *spec memset(p, c, length); } -size_t pa_mix(struct pa_mix_info channels[], unsigned nchannels, void *data, size_t length, const struct pa_sample_spec *spec, uint32_t volume) { +size_t pa_mix(struct pa_mix_info channels[], unsigned nchannels, void *data, size_t length, const struct pa_sample_spec *spec, pa_volume_t volume) { unsigned c, d; assert(channels && data && length && spec); assert(spec->format == PA_SAMPLE_S16NE); @@ -82,7 +82,7 @@ size_t pa_mix(struct pa_mix_info channels[], unsigned nchannels, void *data, siz if (d >= channels[c].chunk.length) return d; - if (volume == PA_VOLUME_MUTE) + if (volume == PA_VOLUME_MUTED) v = 0; else { v = *((int16_t*) (channels[c].chunk.memblock->data + channels[c].chunk.index + d)); @@ -94,7 +94,7 @@ size_t pa_mix(struct pa_mix_info channels[], unsigned nchannels, void *data, siz sum += v; } - if (volume == PA_VOLUME_MUTE) + if (volume == PA_VOLUME_MUTED) sum = 0; else if (volume != PA_VOLUME_NORM) sum = (int32_t) ((float) sum*volume/PA_VOLUME_NORM); @@ -108,7 +108,7 @@ size_t pa_mix(struct pa_mix_info channels[], unsigned nchannels, void *data, siz } -void pa_volume_memchunk(struct pa_memchunk*c, const struct pa_sample_spec *spec, uint32_t volume) { +void pa_volume_memchunk(struct pa_memchunk*c, const struct pa_sample_spec *spec, pa_volume_t volume) { int16_t *d; size_t n; assert(c && spec && (c->length % pa_frame_size(spec) == 0)); @@ -117,7 +117,7 @@ void pa_volume_memchunk(struct pa_memchunk*c, const struct pa_sample_spec *spec, if (volume == PA_VOLUME_NORM) return; - if (volume == PA_VOLUME_MUTE) { + if (volume == PA_VOLUME_MUTED) { pa_silence_memchunk(c, spec); return; } diff --git a/polyp/sink-input.c b/polyp/sink-input.c index 7629bfb9..efa8c551 100644 --- a/polyp/sink-input.c +++ b/polyp/sink-input.c @@ -71,7 +71,7 @@ struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, con r = pa_idxset_put(s->inputs, i, NULL); assert(r == 0); - pa_sample_snprint(st, sizeof(st), spec); + pa_sample_spec_snprint(st, sizeof(st), spec); fprintf(stderr, "sink-input: created %u \"%s\" on %u with sample spec \"%s\"\n", i->index, i->name, s->index, st); pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_NEW, i->index); diff --git a/polyp/sink.c b/polyp/sink.c index eb3133ac..becaef9e 100644 --- a/polyp/sink.c +++ b/polyp/sink.c @@ -76,7 +76,7 @@ struct pa_sink* pa_sink_new(struct pa_core *core, const char *name, int fail, co r = pa_idxset_put(core->sinks, s, &s->index); assert(s->index != PA_IDXSET_INVALID && r >= 0); - pa_sample_snprint(st, sizeof(st), spec); + pa_sample_spec_snprint(st, sizeof(st), spec); fprintf(stderr, "sink: created %u \"%s\" with sample spec \"%s\"\n", s->index, s->name, st); pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_SINK | PA_SUBSCRIPTION_EVENT_NEW, s->index); diff --git a/polyp/source.c b/polyp/source.c index 2c611651..6ab439d6 100644 --- a/polyp/source.c +++ b/polyp/source.c @@ -62,7 +62,7 @@ struct pa_source* pa_source_new(struct pa_core *core, const char *name, int fail r = pa_idxset_put(core->sources, s, &s->index); assert(s->index != PA_IDXSET_INVALID && r >= 0); - pa_sample_snprint(st, sizeof(st), spec); + pa_sample_spec_snprint(st, sizeof(st), spec); fprintf(stderr, "source: created %u \"%s\" with sample spec \"%s\"\n", s->index, s->name, st); pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_SOURCE | PA_SUBSCRIPTION_EVENT_NEW, s->index); diff --git a/polyp/util.c b/polyp/util.c index 70766a06..2878c546 100644 --- a/polyp/util.c +++ b/polyp/util.c @@ -114,12 +114,16 @@ void pa_check_for_sigpipe(void) { struct sigaction sa; sigset_t set; +#ifdef HAVE_PTHREAD if (pthread_sigmask(SIG_SETMASK, NULL, &set) < 0) { +#endif if (sigprocmask(SIG_SETMASK, NULL, &set) < 0) { fprintf(stderr, __FILE__": sigprocmask() failed: %s\n", strerror(errno)); return; } +#ifdef HAVE_PTHREAD } +#endif if (sigismember(&set, SIGPIPE)) return; -- cgit