[pulseaudio-discuss] [RFC] [PATCH] build-sys: Make esound bits optional

Maarten Bosmans mkbosmans at gmail.com
Wed Dec 21 13:50:47 PST 2011


2011/12/21 Arun Raghavan <arun.raghavan at collabora.co.uk>:
> IMO EsounD is really quite irrelevant on most modern systems today, and more
> so for embedded systems.
>
> Any objections to making it optional?

No, seems fine.

I'd go for HAVE_ESOUND though just to keep it consistent with the rest.

As seen in Makefile.am as a conditional or in source files as a macro,
the semantics of the symbol for esound are not different from those
for e.g. solaris. It just determines whether a certain piece of code
gets compiled or not.

The only place where esound is different from the others is in
configure.ac. But even here we have already lost a precise link
between HAVE_SOLARIS and the availability of the solaris headers. As
when --disable-solaris is passed to configure, HAVE_SOLARIS=0 even
when the headers are available.

So it's probably better to be consistently imprecise with our variable
naming than to introduce a new name prefix.

Maarten

> Cheers,
> Arun
>
> ---
>  configure.ac    |    6 ++++++
>  src/Makefile.am |   39 ++++++++++++++++++++++++++++++---------
>  2 files changed, 36 insertions(+), 9 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 5e9cebc..00c5bfd 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -739,6 +739,12 @@ AC_SUBST(HAVE_ALSA)
>  AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
>  AS_IF([test "x$HAVE_ALSA" = "x1"], AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?]))
>
> +#### EsounD support (optional) ####
> +
> +AC_ARG_ENABLE([esound],
> +    AS_HELP_STRING([--disable-esound],[Disable optional EsounD support]))
> +AM_CONDITIONAL([WANT_ESOUND], [test "x$enable_esound" != "xno"])
> +
>  #### Solaris audio support (optional) ####
>
>  AC_ARG_ENABLE([solaris],
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 649f82f..df91e68 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -900,8 +900,12 @@ modlibexec_LTLIBRARIES = \
>                libprotocol-cli.la \
>                libprotocol-simple.la \
>                libprotocol-http.la \
> -               libprotocol-native.la \
> +               libprotocol-native.la
> +
> +if WANT_ESOUND
> +modlibexec_LTLIBRARIES += \
>                libprotocol-esound.la
> +endif
>
>  # We need to emulate sendmsg/recvmsg to support this on Win32
>  if !OS_IS_WIN32
> @@ -939,9 +943,11 @@ libprotocol_native_la_CFLAGS += $(DBUS_CFLAGS)
>  libprotocol_native_la_LIBADD += $(DBUS_LIBS)
>  endif
>
> +if WANT_ESOUND
>  libprotocol_esound_la_SOURCES = pulsecore/protocol-esound.c pulsecore/protocol-esound.h pulsecore/esound.h
>  libprotocol_esound_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
>  libprotocol_esound_la_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
> +endif
>
>  librtp_la_SOURCES = \
>                modules/rtp/rtp.c modules/rtp/rtp.h \
> @@ -998,12 +1004,10 @@ modlibexec_LTLIBRARIES += \
>                module-sine.la \
>                module-native-protocol-tcp.la \
>                module-native-protocol-fd.la \
> -               module-esound-protocol-tcp.la \
>                module-combine.la \
>                module-combine-sink.la \
>                module-remap-sink.la \
>                module-ladspa-sink.la \
> -               module-esound-sink.la \
>                module-tunnel-sink.la \
>                module-tunnel-source.la \
>                module-position-event-sounds.la \
> @@ -1016,6 +1020,12 @@ modlibexec_LTLIBRARIES += \
>                module-filter-apply.la \
>                module-filter-heuristics.la
>
> +if WANT_ESOUND
> +modlibexec_LTLIBRARIES += \
> +               module-esound-protocol-tcp.la \
> +               module-esound-sink.la
> +endif
> +
>  # See comment at librtp.la above
>  if !OS_IS_WIN32
>  modlibexec_LTLIBRARIES += \
> @@ -1028,9 +1038,12 @@ modlibexec_LTLIBRARIES += \
>                module-cli-protocol-unix.la \
>                module-simple-protocol-unix.la \
>                module-http-protocol-unix.la \
> -               module-native-protocol-unix.la \
> +               module-native-protocol-unix.la
> +if WANT_ESOUND
> +modlibexec_LTLIBRARIES += \
>                module-esound-protocol-unix.la
>  endif
> +endif
>
>  if HAVE_MKFIFO
>  modlibexec_LTLIBRARIES += \
> @@ -1039,10 +1052,12 @@ modlibexec_LTLIBRARIES += \
>  endif
>
>  if !OS_IS_WIN32
> +if WANT_ESOUND
>  modlibexec_LTLIBRARIES += \
>                module-esound-compat-spawnfd.la \
>                module-esound-compat-spawnpid.la
>  endif
> +endif
>
>  if HAVE_REGEX
>  modlibexec_LTLIBRARIES += \
> @@ -1233,8 +1248,6 @@ SYMDEF_FILES = \
>                module-pipe-source-symdef.h \
>                module-simple-protocol-tcp-symdef.h \
>                module-simple-protocol-unix-symdef.h \
> -               module-esound-protocol-tcp-symdef.h \
> -               module-esound-protocol-unix-symdef.h \
>                module-native-protocol-tcp-symdef.h \
>                module-native-protocol-unix-symdef.h \
>                module-native-protocol-fd-symdef.h \
> @@ -1244,15 +1257,12 @@ SYMDEF_FILES = \
>                module-remap-sink-symdef.h \
>                module-ladspa-sink-symdef.h \
>                module-equalizer-sink-symdef.h \
> -               module-esound-compat-spawnfd-symdef.h \
> -               module-esound-compat-spawnpid-symdef.h \
>                module-match-symdef.h \
>                module-tunnel-sink-symdef.h \
>                module-tunnel-source-symdef.h \
>                module-null-sink-symdef.h \
>                module-null-source-symdef.h \
>                module-sine-source-symdef.h \
> -               module-esound-sink-symdef.h \
>                module-zeroconf-publish-symdef.h \
>                module-zeroconf-discover-symdef.h \
>                module-bonjour-publish-symdef.h \
> @@ -1310,6 +1320,15 @@ SYMDEF_FILES = \
>                module-filter-apply-symdef.h \
>                module-filter-heuristics-symdef.h
>
> +if WANT_ESOUND
> +SYMDEF_FILES += \
> +               module-esound-protocol-tcp-symdef.h \
> +               module-esound-protocol-unix-symdef.h \
> +               module-esound-compat-spawnfd-symdef.h \
> +               module-esound-compat-spawnpid-symdef.h \
> +               module-esound-sink-symdef.h
> +endif
> +
>  EXTRA_DIST += $(SYMDEF_FILES)
>  BUILT_SOURCES += $(SYMDEF_FILES) builddirs
>
> @@ -1398,6 +1417,7 @@ module_native_protocol_fd_la_LIBADD = $(MODULE_LIBADD) libprotocol-native.la
>
>  # EsounD protocol
>
> +if WANT_ESOUND
>  module_esound_protocol_tcp_la_SOURCES = modules/module-protocol-stub.c
>  module_esound_protocol_tcp_la_CFLAGS = -DUSE_TCP_SOCKETS -DUSE_PROTOCOL_ESOUND $(AM_CFLAGS)
>  module_esound_protocol_tcp_la_LDFLAGS = $(MODULE_LDFLAGS)
> @@ -1419,6 +1439,7 @@ module_esound_compat_spawnpid_la_LIBADD = $(MODULE_LIBADD)
>  module_esound_sink_la_SOURCES = modules/module-esound-sink.c
>  module_esound_sink_la_LDFLAGS = $(MODULE_LDFLAGS) $(WINSOCK_LIBS)
>  module_esound_sink_la_LIBADD = $(MODULE_LIBADD)
> +endif
>
>  # Pipes
>
> --
> 1.7.8
>
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


More information about the pulseaudio-discuss mailing list