AC_CHECK_LIB([opus], [opus_multistream_decode], [], [HAVE_OPUS=no])
LIB_SUBST_FLAGS(opus)
UNSTASH_FLAGS
+########################################################################### flac
+STASH_FLAGS
+LIB_ARG_WITH([flac], [-lFLAC -lm])
+HAVE_FLAC=yes
+AC_CHECK_HEADER(FLAC/stream_decoder.h, [], HAVE_FLAC=no)
+AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], HAVE_FLAC=no)
+LIB_SUBST_FLAGS(flac)
+UNSTASH_FLAGS
# some helper functions for codecs which use the ogg container format
AC_DEFUN([NEED_OGG_OBJECTS], [{
"$HAVE_VORBIS" = 'yes' \
-o "$HAVE_SPEEX" = 'yes' \
-o "$HAVE_OPUS" = 'yes' \
+ -o "$HAVE_FLAC" = 'yes' \
\)
}])
AC_DEFUN([NEED_VORBIS_OBJECTS], [{
AC_DEFUN([NEED_OPUS_OBJECTS], [{
test "$HAVE_OGG" = 'yes' -a "$HAVE_OPUS" = 'yes'
}])
+AC_DEFUN([NEED_FLAC_OBJECTS], [{
+ test "$HAVE_OGG" = 'yes' -a "$HAVE_FLAC" = 'yes'
+}])
########################################################################### faad
STASH_FLAGS
LIB_ARG_WITH([faad], [-lfaad])
AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
LIB_SUBST_FLAGS(id3tag)
UNSTASH_FLAGS
-########################################################################### 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], [], [
- # nope, try again with -logg
- AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [],
- have_flac=no, -lm -logg)
- ], -lm)
-if test "$have_flac" = "yes"; then
- AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
- AC_SUBST(flac_cppflags)
- flac_ldflags="$flac_libs -lFLAC"
- AC_SUBST(flac_ldflags)
-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"
NEED_VORBIS_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh"
NEED_SPEEX_OBJECTS() && server_errlist_objs="$server_errlist_objs spx_afh spx_common"
NEED_OPUS_OBJECTS() && server_errlist_objs="$server_errlist_objs opus_afh opus_common"
+ NEED_FLAC_OBJECTS && server_errlist_objs="$server_errlist_objs flac_afh"
test $HAVE_FAAD = yes && server_errlist_objs="$server_errlist_objs aac_afh aac_common"
- if test "$have_flac" = "yes"; then
- server_errlist_objs="$server_errlist_objs flac_afh"
- fi
server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
AC_SUBST(server_objs, add_dot_o($server_objs))
AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
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 aac_common"
audiod_audio_formats="$audiod_audio_formats aac"
audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
fi
- if test "$have_flac" = "yes"; then
- audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
- audiod_audio_formats="$audiod_audio_formats flac"
- fi
if test "$have_oss" = "yes"; then
audiod_errlist_objs="$audiod_errlist_objs oss_write"
audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
filters="$filters opusdec"
filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
}
+NEED_FLAC_OBJECTS && {
+ filter_errlist_objs="$filter_errlist_objs flacdec_filter"
+ filters="$filters flacdec"
+}
if test $HAVE_FAAD = yes; then
filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
filters="$filters aacdec"
filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
filters="$filters mp3dec"
fi
-if test "$have_flac" = "yes"; then
- filter_errlist_objs="$filter_errlist_objs flacdec_filter"
- filters="$filters flacdec"
-fi
if test "$have_samplerate" = "yes"; then
filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
filter_cmdline_objs="$filter_cmdline_objs resample_filter"
NEED_VORBIS_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh"
NEED_SPEEX_OBJECTS && recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
NEED_OPUS_OBJECTS && recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
+NEED_FLAC_OBJECTS && recv_errlist_objs="$recv_errlist_objs flac_afh"
if test $HAVE_FAAD = yes; then
recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
fi
-if test "$have_flac" = "yes"; then
- recv_errlist_objs="$recv_errlist_objs flac_afh"
-fi
recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
AC_SUBST(receivers, "http dccp udp afh")
AC_SUBST(recv_objs, add_dot_o($recv_objs))
afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
audio_format_handlers="$audio_format_handlers opus"
}
+NEED_FLAC_OBJECTS && {
+ afh_errlist_objs="$afh_errlist_objs flac_afh"
+ audio_format_handlers="$audio_format_handlers flac"
+}
if test $HAVE_FAAD = yes; then
afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
audio_format_handlers="$audio_format_handlers aac"
fi
-if test "$have_flac" = "yes"; then
- afh_errlist_objs="$afh_errlist_objs flac_afh"
- audio_format_handlers="$audio_format_handlers flac"
-fi
afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
opus_afh
opus_common
"
+NEED_FLAC_OBJECTS && {
+ play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
+}
if test $HAVE_FAAD = yes; then
play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
fi
play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
play_errlist_objs="$play_errlist_objs mp3dec_filter"
fi
-if test "$have_flac" = "yes"; then
- play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
-fi
if test "$have_oss" = "yes"; then
play_errlist_objs="$play_errlist_objs oss_write"
play_cmdline_objs="$play_cmdline_objs oss_write"