-if test "$have_speex" = "yes"; then
- all_errlist_objs="$all_errlist_objs spxdec_filter spx_afh spx_common"
- AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
- filters="$filters spxdec"
- speex_libs="-lspeex"
- server_ldflags="$server_ldflags $speex_libs"
- filter_ldflags="$filter_ldflags $speex_libs"
- audiod_ldflags="$audiod_ldflags $speex_libs"
- play_ldflags="$play_ldflags $speex_libs"
- afh_ldflags="$afh_ldflags $speex_libs"
- recv_ldflags="$recv_ldflags $speex_libs"
-
- server_errlist_objs="$server_errlist_objs spx_afh spx_common"
- filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
- audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
- play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
- afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
- recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
-
- audiod_audio_formats="$audiod_audio_formats spx"
- audio_format_handlers="$audio_format_handlers spx"
-else
- AC_MSG_WARN([no ogg/speex $msg])
-fi
-if test "$have_opus" = "yes"; then
- all_errlist_objs="$all_errlist_objs opusdec_filter opus_afh opus_common"
- AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
- filters="$filters opusdec"
- opus_libs="-lopus"
- server_ldflags="$server_ldflags $opus_libs"
- filter_ldflags="$filter_ldflags $opus_libs"
- audiod_ldflags="$audiod_ldflags $opus_libs"
- afh_ldflags="$afh_ldflags $opus_libs"
- play_ldflags="$play_ldflags $opus_libs"
- recv_ldflags="$recv_ldflags $opus_libs"
-
- server_errlist_objs="$server_errlist_objs opus_afh opus_common"
- filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
- audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
- afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
- play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
- recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
-
- audiod_audio_formats="$audiod_audio_formats opus"
- audio_format_handlers="$audio_format_handlers opus"
-else
- AC_MSG_WARN([no ogg/opus $msg])
-fi
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
-########################################################################### faad
-have_faad=yes
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
- [look for neaacdec.h also in dir])])
-if test -n "$with_faad_headers"; then
- faad_cppflags="-I$with_faad_headers"
- CPPFLAGS="$CPPFLAGS $faad_cppflags"
-fi
-AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
- [look for libfaad also in dir])])
-if test -n "$with_faad_libs"; then
- faad_libs="-L$with_faad_libs"
- LDFLAGS="$LDFLAGS $faad_libs"
-fi
-AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
-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)
- all_errlist_objs="$all_errlist_objs aac_common aacdec_filter aac_afh"
- filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
- afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
- audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
- play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
- server_errlist_objs="$server_errlist_objs aac_afh aac_common"
- recv_errlist_objs="$recv_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"
- play_ldflags="$play_ldflags $faad_libs -lfaad"
- afh_ldflags="$afh_ldflags $faad_libs -lfaad"
- recv_ldflags="$afh_ldflags $faad_libs -lfaad"
-
- audiod_audio_formats="$audiod_audio_formats aac"
- audio_format_handlers="$audio_format_handlers aac"
- filters="$filters aacdec"
- AC_SUBST(faad_cppflags)
-else
- AC_MSG_WARN([no aac support in para_audiod/para_filter])
-fi
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
-########################################################################### mad
-have_mad="yes"
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-
-AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
- [look for mad.h also in dir])])
-if test -n "$with_mad_headers"; then
- mad_cppflags="-I$with_mad_headers"
- CPPFLAGS="$CPPFLAGS $mad_cppflags"
-fi
-AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
- [look for libmad also in dir])])
-if test -n "$with_mad_libs"; then
- mad_libs="-L$with_mad_libs"
- LDFLAGS="$LDFLAGS $mad_libs"
-fi
-AC_CHECK_HEADERS([mad.h], [], [
- have_mad="no"
-])
-AC_CHECK_LIB([mad], [mad_stream_init], [], [
- have_mad="no"
-])
-if test "$have_mad" = "yes"; then
- AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
- filter_cmdline_objs="$filter_cmdline_objs add_cmdline(mp3dec_filter)"
- audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(mp3dec_filter)"
- play_cmdline_objs="$play_cmdline_objs add_cmdline(mp3dec_filter)"
- all_errlist_objs="$all_errlist_objs mp3dec_filter"
- filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
- audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
- play_errlist_objs="$play_errlist_objs mp3dec_filter"
- filter_ldflags="$filter_ldflags $mad_libs -lmad"
- audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
- play_ldflags="$play_ldflags $mad_libs -lmad"
- audiod_audio_formats="$audiod_audio_formats mp3"
- filters="$filters mp3dec"
- AC_SUBST(mad_cppflags)
-else
- AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
-fi
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
-###################################################################### libid3tag
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-
-have_libid3tag="yes"
-AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
- [look for id3tag header files also in dir])])
-if test -n "$with_id3tag_headers"; then
- id3tag_cppflags="-I$with_id3tag_headers"
- CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
-fi
-AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
- [look for id3tag libs also in dir])])
-if test -n "$with_id3tag_libs"; then
- id3tag_libs="-L$with_id3tag_libs"
- LDFLAGS="$LDFLAGS $id3tag_libs"
-fi
-
-AC_MSG_CHECKING(for libid3tag)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- #include <id3tag.h>
-]], [[
- struct id3_tag t = {.flags = 0};
-]])],[],[have_libid3tag=no])
-AC_MSG_RESULT($have_libid3tag)
-
-if test ${have_libid3tag} = yes; then
- AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
- server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
- afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
- play_ldflags="$play_ldflags -lz"
- recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
- play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
- AC_SUBST(id3tag_cppflags)
-else
- AC_MSG_WARN([no support for id3v2 tags])
-fi
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
-########################################################################### flac
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-
-have_flac="yes"
-AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
- [look for flac headers also in dir])])
-if test -n "$with_flac_headers"; then
- flac_cppflags="-I$with_flac_headers"
- CPPFLAGS="$CPPFLAGS $flac_cppflags"
-fi
-AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
- [look for flac libs also in dir])])
-if test -n "$with_flac_libs"; then
- flac_libs="-L$with_flac_libs"
- LDFLAGS="$LDFLAGS $flac_libs"
-fi
-AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
-AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
-if test "$have_flac" = "yes"; then
- AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
- all_errlist_objs="$all_errlist_objs flacdec_filter flac_afh"
- filter_errlist_objs="$filter_errlist_objs flacdec_filter"
- audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
- play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
- afh_errlist_objs="$afh_errlist_objs flac_afh"
- server_errlist_objs="$server_errlist_objs flac_afh"
- recv_errlist_objs="$recv_errlist_objs flac_afh"
- filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
- audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
- play_ldflags="$play_ldflags $flac_libs -lFLAC"
- server_ldflags="$server_ldflags $flac_libs -lFLAC"
- afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
- recv_ldflags="$afh_ldflags $flac_libs -lFLAC"
- filters="$filters flacdec"
- audio_format_handlers="$audio_format_handlers flac"
- audiod_audio_formats="$audiod_audio_formats flac"
- AC_SUBST(flac_cppflags)
-else
- AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
-fi
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
-########################################################################### oss
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-
-have_oss="yes"
-msg="=> will not build oss writer"
-
-AC_CHECK_HEADER(sys/soundcard.h, [
- audiod_errlist_objs="$audiod_errlist_objs oss_write"
- play_errlist_objs="$play_errlist_objs oss_write"
- audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"
- play_cmdline_objs="$play_cmdline_objs add_cmdline(oss_write)"
-
- write_errlist_objs="$write_errlist_objs oss_write"
- write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
- fade_errlist_objs="$fade_errlist_objs oss_mix"
- all_errlist_objs="$all_errlist_objs oss_write oss_mix"
-
- writers="$writers oss"
- default_writer="OSS_WRITE"
- mixers="${mixers}oss "
- default_mixer="OSS_MIX"
-
- AC_CHECK_LIB(ossaudio, _oss_ioctl, [
- audiod_ldflags="$audiod_ldflags -lossaudio"
- play_ldflags="$play_ldflags -lossaudio"
- write_ldflags="$write_ldflags -lossaudio"
- fade_ldflags="$fade_ldflags -lossaudio"
- ]
- )
- ],
- [
- have_oss="no"
- AC_MSG_WARN([no sys/soundcard.h $msg])
- ]
-)
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
-
-########################################################################### alsa
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-
-msg="=> no alsa support for para_audiod/para_write"
-if test "$OSTYPE" != "Linux"; then
- have_alsa="no"
+############################################################# audiod
+if test -n "$CRYPTOLIB"; then
+ build_audiod="yes"
+ executables="$executables audiod"
+ audiod_audio_formats="wma"
+ audiod_cmdline_objs="$audiod_cmdline_objs
+ audiod
+ compress_filter
+ http_recv
+ dccp_recv
+ file_write
+ client
+ amp_filter
+ udp_recv
+ prebuffer_filter
+ sync_filter
+ "
+ audiod_errlist_objs="$audiod_errlist_objs
+ audiod
+ signal
+ string
+ daemon
+ stat
+ net
+ crypt_common
+ base64
+ sideband
+ time
+ grab_client
+ filter_common
+ wav_filter
+ compress_filter
+ amp_filter
+ http_recv
+ dccp_recv
+ recv_common
+ fd
+ sched
+ write_common
+ file_write
+ audiod_command
+ fecdec_filter
+ client_common
+ ggo
+ udp_recv
+ color
+ fec
+ prebuffer_filter
+ version
+ bitstream
+ imdct
+ wma_common
+ wmadec_filter
+ buffer_tree
+ sync_filter
+ "
+ if test "$CRYPTOLIB" = openssl; then
+ audiod_errlist_objs="$audiod_errlist_objs crypt"
+ else
+ audiod_errlist_objs="$audiod_errlist_objs gcrypt"
+ fi
+ if test "$have_core_audio" = "yes"; then
+ audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
+ audiod_cmdline_objs="$audiod_cmdline_objs osx_write"
+ fi
+ NEED_VORBIS_OBJECTS && {
+ audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
+ audiod_audio_formats="$audiod_audio_formats ogg"
+ }
+ NEED_SPEEX_OBJECTS && {
+ audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
+ audiod_audio_formats="$audiod_audio_formats spx"
+ }
+ NEED_OPUS_OBJECTS && {
+ audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
+ audiod_audio_formats="$audiod_audio_formats opus"
+ }
+ NEED_FLAC_OBJECTS && {
+ audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
+ audiod_audio_formats="$audiod_audio_formats flac"
+ }
+ if test $HAVE_FAAD = yes; then
+ audiod_errlist_objs="$audiod_errlist_objs aacdec_filter"
+ audiod_audio_formats="$audiod_audio_formats aac"
+ fi
+ if test $HAVE_MAD = yes; then
+ audiod_audio_formats="$audiod_audio_formats mp3"
+ audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
+ audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
+ fi
+ if test $HAVE_OSS = yes; then
+ audiod_errlist_objs="$audiod_errlist_objs oss_write"
+ audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
+ fi
+ if test $HAVE_ALSA = yes; then
+ audiod_errlist_objs="$audiod_errlist_objs alsa_write"
+ audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
+ fi
+ NEED_AO_OBJECTS && {
+ audiod_errlist_objs="$audiod_errlist_objs ao_write"
+ audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
+ }
+ if test $HAVE_SAMPLERATE = yes; then
+ audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
+ audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
+ fi
+ audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
+ AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
+
+ enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
+ AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
+ enum of audio formats supported by audiod)
+ names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
+ AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)