From a090a14ca84c952a13aefd2cb0992d64b8146c09 Mon Sep 17 00:00:00 2001 From: Mke Brady Date: Wed, 3 Jun 2015 20:15:54 +0100 Subject: [PATCH] Make dummy, pipe and stdout back ends optional compilations --- Makefile.am | 12 ++++++++++++ configure.ac | 13 +++++++++++-- shairport.c | 9 +++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 203fffbb..84c20d60 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,6 +26,18 @@ if USE_SNDIO shairport_sync_SOURCES += audio_sndio.c endif +if USE_STDOUT +shairport_sync_SOURCES += audio_stdout.c +endif + +if USE_PIPE +shairport_sync_SOURCES += audio_pipe.c +endif + +if USE_DUMMY +shairport_sync_SOURCES += audio_dummy.c +endif + if USE_AO shairport_sync_SOURCES += audio_ao.c endif diff --git a/configure.ac b/configure.ac index 56dee0e2..8734643d 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,15 @@ else AC_CHECK_LIB([popt],[poptGetContext], , AC_MSG_ERROR(libpopt needed)) fi +AC_ARG_WITH([dummy],[ --with-dummy = include the dummy audio back end ],[AC_MSG_RESULT(>>Including the dummy audio back end) AC_DEFINE([CONFIG_DUMMY], 1, [Needed by the compiler.]) ], ) +AM_CONDITIONAL([USE_DUMMY], [test "x$with_dummy" = "x1" ]) + +AC_ARG_WITH([stdout],[ --with-stdout = include the stdout audio back end ],[ AC_MSG_RESULT(>>Including the stdout audio back end) AC_DEFINE([CONFIG_STDOUT], 1, [Needed by the compiler.]) ], ) +AM_CONDITIONAL([USE_STDOUT], [test "x$with_stdout" = "x1" ]) + +AC_ARG_WITH([pipe],[ --with-pipe = include the pipe audio back end ],[ AC_MSG_RESULT(>>Including the pipe audio back end) AC_DEFINE([CONFIG_PIPE], 1, [Needed by the compiler.]) ], ) +AM_CONDITIONAL([USE_PIPE], [test "x$with_pipe" = "x1" ]) + AC_ARG_WITH([initscript], [ --with-initscript = include a startup script], ,[with_initscript=1]) AM_CONDITIONAL([INSTALL_INITSCRIPT], [test "x$with_initscript" = "x1"]) @@ -173,8 +182,8 @@ AC_ARG_WITH(ao, [ --with-ao = choose native AO (Audio Output?) API support -- p AM_CONDITIONAL([USE_AO], [test "x$HAS_AO" = "x1"]) # Look for pulseaudio flag -AC_ARG_WITH(pulseaudio, [ --with-pulseaudio = choose native PulseAudio API support -- probably broken], [ - AC_MSG_RESULT(>>Including a PulseAudio back end --- N.B. this is probably broken!) +AC_ARG_WITH(pulseaudio, [ --with-pulseaudio = choose native PulseAudio API support -- N.B. no synchronisation -- so underflow or overflow is inevitable!], [ + AC_MSG_RESULT(>>Including a PulseAudio back end -- N.B. no synchronisation -- so underflow or overflow is inevitable!) HAS_PULSE=1 AC_DEFINE([CONFIG_PULSE], 1, [Needed by the compiler.]) AC_CHECK_LIB([pulse-simple], [pa_simple_new], , AC_MSG_ERROR(PulseAudio support requires the pulse-simple library!)) diff --git a/shairport.c b/shairport.c index 97cd0bbd..16a42080 100644 --- a/shairport.c +++ b/shairport.c @@ -132,6 +132,15 @@ void print_version(void) { #ifdef CONFIG_PULSE strcat(version_string, "-pulse"); #endif +#ifdef CONFIG_DUMMY + strcat(version_string, "-dummy"); +#endif +#ifdef CONFIG_STDOUT + strcat(version_string, "-stdout"); +#endif +#ifdef CONFIG_PIPE + strcat(version_string, "-pipe"); +#endif #ifdef HAVE_LIBSOXR strcat(version_string, "-soxr"); #endif