From 1d8840412fc1dd76a73ee13413cd7fc9a6ff229a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 19 Sep 2011 07:39:27 +0200 Subject: configure.ac: add option --enable-solaris-output Allow enabling the plugin explicitly without running Solaris, to test the build. --- NEWS | 1 + configure.ac | 17 ++++++++++++++--- src/output/solaris_output_plugin.c | 20 +++++++++++++++++++- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index cc6874068..af7315360 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.16.5 (2010/??/??) * configure.ac - disable assertions in the non-debugging build - show solaris plugin result correctly + - add option --enable-solaris-output * pcm_format: fix 32-to-24 bit conversion (the "silence" bug) * input: - rewind: reduce heap usage diff --git a/configure.ac b/configure.ac index e87cf114b..50e8d8c7a 100644 --- a/configure.ac +++ b/configure.ac @@ -324,6 +324,11 @@ AC_ARG_ENABLE(sndfile, [enable sndfile support]),, enable_sndfile=auto) +AC_ARG_ENABLE(solaris_output, + AS_HELP_STRING([--enable-solaris-output], + [enables the Solaris /dev/audio output]),, + [enable_solaris_output=auto]) + AC_ARG_ENABLE(sqlite, AS_HELP_STRING([--enable-sqlite], [enable support for the SQLite database]),, @@ -1370,16 +1375,22 @@ fi AM_CONDITIONAL(HAVE_SHOUT, test x$enable_shout = xyes) dnl --------------------------------- Solaris --------------------------------- -case "$host_os" in + +if test x$enable_solaris_output = xauto; then + case "$host_os" in solaris*) - AC_DEFINE(ENABLE_SOLARIS_OUTPUT, 1, [Define to enable Solaris /dev/audio support]) enable_solaris_output=yes ;; *) enable_solaris_output=no ;; -esac + esac +fi + +if test x$enable_solaris_output = xyes; then + AC_DEFINE(ENABLE_SOLARIS_OUTPUT, 1, [Define to enable Solaris /dev/audio support]) +fi AM_CONDITIONAL(ENABLE_SOLARIS_OUTPUT, test x$enable_solaris_output = xyes) diff --git a/src/output/solaris_output_plugin.c b/src/output/solaris_output_plugin.c index 22c583805..6f6f507b3 100644 --- a/src/output/solaris_output_plugin.c +++ b/src/output/solaris_output_plugin.c @@ -23,7 +23,6 @@ #include -#include #include #include #include @@ -31,6 +30,25 @@ #include #include +#ifdef __sun +#include +#else + +/* some fake declarations that allow build this plugin on systems + other than Solaris, just to see if it compiles */ + +#define AUDIO_GETINFO 0 +#define AUDIO_SETINFO 0 +#define AUDIO_ENCODING_LINEAR 0 + +struct audio_info { + struct { + unsigned sample_rate, channels, precision, encoding; + } play; +}; + +#endif + #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "solaris_output" -- cgit v1.2.3