From ee41d31b46e6c3213b799d79fb65a5351aa9d221 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 28 Aug 2006 21:59:51 +0200 Subject: [PATCH] Do not build audiod if no audio formats are supported Also, nicify the summary output of configure --- Makefile.in | 2 +- configure.ac | 59 ++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 44 insertions(+), 17 deletions(-) diff --git a/Makefile.in b/Makefile.in index b1d56ca4..a243b7bb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -48,7 +48,7 @@ CPPFLAGS += -Wmissing-format-attribute CPPFLAGS += -Wunused-macros CPPFLAGS += -Wshadow -BINARIES = para_server para_client para_gui para_audiod para_audioc para_recv para_filter para_write @extra_binaries@ +BINARIES = para_server para_client para_gui para_audioc para_recv para_filter para_write @extra_binaries@ FONTS := $(wildcard fonts/*.png) PICS := $(wildcard pics/paraslash/*.jpg) diff --git a/configure.ac b/configure.ac index 3b524f52..85f4c829 100644 --- a/configure.ac +++ b/configure.ac @@ -20,8 +20,7 @@ AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h stdl [], [AC_MSG_ERROR([$ac_header not found])]) AC_CHECK_HEADER(linux/soundcard.h, [extras="$extras para_fade"], - [AC_MSG_WARN([linux/soundcard.h not found, \ - cannot build para_fade])]) + [AC_MSG_WARN([linux/soundcard.h not found, cannot build para_fade])]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -60,9 +59,14 @@ recv_errlist_objs="http_recv recv_common recv time string net dccp_recv dccp fd sched stdout" recv_ldflags="" +receivers=" http dccp" +senders=" http dccp" +selectors=" random playlist" + filter_cmdline_objs="filter.cmdline compress_filter.cmdline" filter_errlist_objs="filter_chain wav compress filter string stdin stdout sched fd" filter_ldflags="" +filters=" compress wav" audioc_cmdline_objs="audioc.cmdline" audioc_errlist_objs="audioc string net fd" @@ -74,17 +78,19 @@ audiod_errlist_objs="audiod signal string daemon stat net recv_common fd sched write_common file_write audiod_command crypt client_common" audiod_ldflags="" +audiod_audio_formats="" server_cmdline_objs="server.cmdline" server_errlist_objs="server mp3_afh afs command net string signal random_selector time daemon stat crypt http_send db close_on_fork playlist_selector ipc dccp dccp_send fd" server_ldflags="" +server_audio_formats=" mp3" write_cmdline_objs="write.cmdline file_write.cmdline" write_errlist_objs="write write_common file_write time fd string sched stdin" write_ldflags="" -write_writers="file" +writers=" file" client_cmdline_objs="client.cmdline" client_errlist_objs="client net string crypt fd sched stdin stdout client_common" @@ -176,8 +182,8 @@ if test ${have_core_audio} = yes; then write_errlist_objs="$write_errlist_objs osx_write" write_cmdline_objs="$write_cmdline_objs osx_write.cmdline" write_ldflags="$write_ldflags $f" - write_writers="$write_writers osx" - AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on MacOs) + writers="$writers osx" + AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X) fi ########################################################################### gtk2 @@ -194,6 +200,7 @@ else fi ########################################################################### sdl +# FIXME AC_CHECK_LIB([SDL_image], [SDL_Init], [extras="$extras para_sdl_gui"], [ AC_MSG_WARN([libSDL_image not found, cannot build para_sdl_gui]) ]) @@ -221,6 +228,7 @@ AC_CHECK_LIB([mysqlclient], [mysql_init], [], [ have_mysql="no" ]) if test "$have_mysql" = "yes"; then + selectors="$selectors mysql" server_ldflags="$server_ldflags $mysql_libs -lmysqlclient" server_errlist_objs="$server_errlist_objs mysql_selector" AC_SUBST(mysql_cppflags) @@ -242,6 +250,7 @@ AC_CHECK_HEADERS([ogg/ogg.h vorbis/codec.h], [], [ ]) if test "$have_ogg" = "yes"; then AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg vorbis support) + filters="$filters oggdec" server_ldflags="$server_ldflags -logg -lvorbis -lvorbisfile" filter_ldflags="$filter_ldflags -lvorbis -lvorbisfile" audiod_ldflags="$audiod_ldflags -lvorbis -lvorbisfile" @@ -252,6 +261,10 @@ if test "$have_ogg" = "yes"; then server_errlist_objs="$server_errlist_objs ogg_afh" filter_errlist_objs="$filter_errlist_objs oggdec" audiod_errlist_objs="$audiod_errlist_objs oggdec" + + audiod_audio_formats="ogg" + server_audio_formats="$server_audio_formats ogg" + filter_filters="$filter_filters oggdec" else AC_MSG_WARN([no ogg vorbis support in para_server/para_filter]) fi @@ -274,11 +287,15 @@ AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no) if test "$have_faad" = "yes"; then AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter) filter_errlist_objs="$filter_errlist_objs aacdec aac_common" + filter_filters="$filter_filters aacdec" audiod_errlist_objs="$audiod_errlist_objs aacdec aac_common" server_errlist_objs="$server_errlist_objs aac_afh aac_common" server_ldflags="$server_ldflags $faad_libs -lfaad" filter_ldflags="$filter_ldflags $faad_libs -lfaad" audiod_ldflags="$audiod_ldflags $faad_libs -lfaad" + audiod_audio_formats="$audiod_audio_formats aac" + server_audio_formats="$server_audio_formats aac" + filters="$filters aacdec" AC_SUBST(faad_cppflags) AC_SUBST(faad_libs) else @@ -310,11 +327,18 @@ if test "$have_mad" = "yes"; then audiod_errlist_objs="$audiod_errlist_objs mp3dec" filter_ldflags="$filter_ldflags $mad_libs -lmad" audiod_ldflags="$audiod_ldflags $mad_libs -lmad" + audiod_audio_formats="$audiod_audio_formats mp3" + filters="$filters mp3dec" AC_SUBST(mad_cppflags) AC_SUBST(mad_libs) else AC_MSG_WARN([no mp3dec support in para_audiod/para_filter]) fi +if test -n "$audiod_audio_formats"; then + extras="$extras para_audiod" +else + AC_MSG_WARN([can not build para_audiod (no supported audio formats)]) +fi ########################################################################### alsa have_alsa="yes" msg="=> no alsa support for para_audiod/para_write" @@ -334,7 +358,7 @@ if test "$have_alsa" = "yes"; then write_errlist_objs="$write_errlist_objs alsa_write" write_cmdline_objs="$write_cmdline_objs alsa_write.cmdline" write_ldflags="$write_ldflags -lasound" - write_writers="$write_writers alsa" + writers="$writers alsa" fi ########################################################################### ortp have_ortp="yes" @@ -363,6 +387,9 @@ if test "$have_ortp" = "yes"; then recv_ldflags="$recv_ldflags -lortp" server_ldflags="$server_ldflags -lortp" audiod_ldflags="$audiod_ldflags -lortp" + + receivers="$receivers ortp" + senders="$senders ortp" AC_DEFINE(HAVE_ORTP, 1, [define to 1 to turn on ortp support]) else @@ -443,14 +470,14 @@ AC_SUBST(audioc_objs, add_dot_o($audioc_objs)) AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS, objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc) -enum="$(for i in $write_writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)" +enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)" AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS, enum of supported writers) -names="$(for i in $write_writers; do printf \"$i\",' ' ; done)" +names="$(for i in $writers; do printf \"$i\",' ' ; done)" AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names) -inits="$(for i in $write_writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)" +inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)" AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers) -array="$(for i in $write_writers; do printf '{.init = '$i'_write_init},'; done)" +array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)" AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers) gui_cmdline_objs="gui.cmdline" @@ -467,11 +494,11 @@ gcc -MM -MG $mysql_cppflags $faad_cppflags $mad_cppflags *.c > Makefile.deps AC_MSG_NOTICE([ paraslash configuration: ~~~~~~~~~~~~~~~~~~~~~~~~ -mysql support: $have_mysql -ogg vorbis support: $have_ogg -mp3dec support (libmad): $have_mad -aac support (libfaad): $have_faad -ortp support: $have_ortp unix socket credentials: $have_ucred -supported writers for para_write: $write_writers +audio file selectors supported by para_server: $selectors +audio formats supported by para_server: $server_audio_formats +senders supported by para_server/para_send: $senders +receivers supported by para_audiod/para_recv: $receivers +filters supported by para_audiod/para_filter: $filters +writers supported by para_audiod/para_write: $writers ]) -- 2.39.2