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

Arun Raghavan arun.raghavan at collabora.co.uk
Wed Dec 21 10:02:26 PST 2011


On Wed, 2011-12-21 at 19:43 +0200, Tanu Kaskinen wrote:
> On Wed, 2011-12-21 at 20:39 +0530, Arun Raghavan wrote:
> > IMO EsounD is really quite irrelevant on most modern systems today, and more
> > so for embedded systems.
> > 
> > Any objections to making it optional?
> 
> I think I've read somewhere that the main motivation for Pulseaudio was
> that EsounD sucked, and a drop-in replacement was needed. Since being
> EsounD compatible is the main purpose, having EsounD compatibility can't
> be optional!

Haha, you had me there for a moment! :D

> Just kidding. My only complaint is that all other dependencies use
> format HAVE_SOMETHING instead of WANT_SOMETHING, and for example Solaris

I went with WANT_ because it signals some compile-time choice, whereas
HAVE_ typically signals availability of some dependency. Not religious
about this either way, though.

> support has this configure.ac snippet (other dependencies seem to be
> similar):

Let me break it down:

> AC_ARG_ENABLE([solaris],
>     AS_HELP_STRING([--disable-solaris],[Disable optional Solaris audio
> support]))
> 
> AS_IF([test "x$enable_solaris" != "xno"],
>     [AC_CHECK_HEADERS([sys/audio.h], HAVE_SOLARIS=1, HAVE_SOLARIS=0)],
>     HAVE_SOLARIS=0)

This sets up a HAVE_SOLARIS variable based on whether the header is
available, if Solaris support was not explicitly disabled.

> AS_IF([test "x$enable_solaris" = "xyes" && test "x$HAVE_SOLARIS" =
> "x0"],
>     [AC_MSG_ERROR([*** Solaris audio support not found])])

This checks if Solaris support was explicitly requested but the header
was not found.

At this point, if no explicit request was made, we've automagically
decided based on whether the header is available or not.

> AM_CONDITIONAL([HAVE_SOLARIS], [test "x$HAVE_SOLARIS" = x1])

That's the conditional for use in Makefile.am.

> AS_IF([test "x$HAVE_SOLARIS" = "x1"], AC_DEFINE([HAVE_SOLARIS], 1, [Have
> Solaris audio?]))

And that's the define for use in code.

> I know very little about autoconf - why is it sufficient to have only
> this, much shorter snippet, for EsounD?
> 
> AC_ARG_ENABLE([esound],
>     AS_HELP_STRING([--disable-esound],[Disable optional EsounD
> support]))
> AM_CONDITIONAL([WANT_ESOUND], [test "x$enable_esound" != "xno"])

For EsounD, we just need an enable/disable check -- no dependencies, so
the check is simpler.

Regards,
Arun



More information about the pulseaudio-discuss mailing list