From: Andre Noll Date: Wed, 21 Jun 2023 17:39:23 +0000 (+0200) Subject: build: Simplify ogg helpers of configure.ac. X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=f306117cccdb04ba1dc74eba21aef138e114c540;p=paraslash.git build: Simplify ogg helpers of configure.ac. There is no need to define NEED_OGG_OBJECTS and friends as a function because a simple variable will do as well. --- diff --git a/configure.ac b/configure.ac index b5e71e32..a3030864 100644 --- a/configure.ac +++ b/configure.ac @@ -273,27 +273,21 @@ 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], [{ - test "$HAVE_OGG" = 'yes' -a \( \ +# some helpers for the ogg container format +AS_IF([test "$HAVE_OGG" = 'yes' -a \( \ "$HAVE_VORBIS" = 'yes' \ -o "$HAVE_SPEEX" = 'yes' \ -o "$HAVE_OPUS" = 'yes' \ -o "$HAVE_FLAC" = 'yes' \ - \) -}]) -AC_DEFUN([NEED_VORBIS_OBJECTS], [{ - test "$HAVE_OGG" = 'yes' -a "$HAVE_VORBIS" = 'yes' -}]) -AC_DEFUN([NEED_SPEEX_OBJECTS], [{ - test "$HAVE_OGG" = 'yes' -a "$HAVE_SPEEX" = 'yes' -}]) -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' -}]) +\)], [NEED_OGG_OBJECTS=yes], [NEED_OGG_OBJECTS=no]) +AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_VORBIS" = 'yes'], + [NEED_VORBIS_OBJECTS=yes], [NEED_VORBIS_OBJECTS=no]) +AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_SPEEX" = 'yes'], + [NEED_SPEEX_OBJECTS=yes], [NEED_SPEEX_OBJECTS=no]) +AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_OPUS" = 'yes'], + [NEED_OPUS_OBJECTS=yes], [NEED_OPUS_OBJECTS=no]) +AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_FLAC" = 'yes'], + [NEED_FLAC_OBJECTS=yes], [NEED_FLAC_OBJECTS=no]) ########################################################################### faad STASH_FLAGS LIB_ARG_WITH([faad], [-lfaad]) @@ -431,11 +425,16 @@ if test -n "$CRYPTOLIB" && test $HAVE_OSL = yes && test -n "$BISON" && \ else server_objs="$server_objs gcrypt" fi - NEED_OGG_OBJECTS() && server_objs="$server_objs ogg_afh_common" - NEED_VORBIS_OBJECTS() && server_objs="$server_objs ogg_afh" - NEED_SPEEX_OBJECTS() && server_objs="$server_objs spx_afh spx_common" - NEED_OPUS_OBJECTS() && server_objs="$server_objs opus_afh opus_common" - NEED_FLAC_OBJECTS && server_objs="$server_objs flac_afh" + AS_IF([test $NEED_OGG_OBJECTS = yes], + [server_objs="$server_objs ogg_afh_common"]) + AS_IF([test $NEED_VORBIS_OBJECTS = yes], + [server_objs="$server_objs ogg_afh"]) + AS_IF([test $NEED_SPEEX_OBJECTS = yes], + [server_objs="$server_objs spx_afh spx_common"]) + AS_IF([test $NEED_OPUS_OBJECTS = yes], + [server_objs="$server_objs opus_afh opus_common"]) + AS_IF([test $NEED_FLAC_OBJECTS = yes], + [server_objs="$server_objs flac_afh"]) if test $HAVE_FAAD = yes; then server_objs="$server_objs aac_afh mp4" fi @@ -536,22 +535,22 @@ if test -n "$CRYPTOLIB"; then else audiod_objs="$audiod_objs gcrypt" fi - NEED_VORBIS_OBJECTS && { + AS_IF([test $NEED_VORBIS_OBJECTS = yes], [ audiod_objs="$audiod_objs oggdec_filter" audiod_audio_formats="$audiod_audio_formats ogg" - } - NEED_SPEEX_OBJECTS && { + ]) + AS_IF([test $NEED_SPEEX_OBJECTS = yes], [ audiod_objs="$audiod_objs spxdec_filter spx_common" audiod_audio_formats="$audiod_audio_formats spx" - } - NEED_OPUS_OBJECTS && { + ]) + AS_IF([test $NEED_OPUS_OBJECTS = yes], [ audiod_objs="$audiod_objs opusdec_filter opus_common" audiod_audio_formats="$audiod_audio_formats opus" - } - NEED_FLAC_OBJECTS && { + ]) + AS_IF([test $NEED_FLAC_OBJECTS = yes], [ audiod_objs="$audiod_objs flacdec_filter" audiod_audio_formats="$audiod_audio_formats flac" - } + ]) if test $HAVE_FAAD = yes; then audiod_objs="$audiod_objs aacdec_filter" audiod_audio_formats="$audiod_audio_formats aac" @@ -644,10 +643,14 @@ filter_objs=" net sync_filter " -NEED_VORBIS_OBJECTS && filter_objs="$filter_objs oggdec_filter" -NEED_SPEEX_OBJECTS && filter_objs="$filter_objs spxdec_filter spx_common" -NEED_OPUS_OBJECTS && filter_objs="$filter_objs opusdec_filter opus_common" -NEED_FLAC_OBJECTS && filter_objs="$filter_objs flacdec_filter" +AS_IF([test $NEED_VORBIS_OBJECTS = yes], + [filter_objs="$filter_objs oggdec_filter"]) +AS_IF([test $NEED_SPEEX_OBJECTS = yes], + [filter_objs="$filter_objs spxdec_filter spx_common"]) +AS_IF([test $NEED_OPUS_OBJECTS = yes], + [filter_objs="$filter_objs opusdec_filter opus_common"]) +AS_IF([test $NEED_FLAC_OBJECTS = yes], + [filter_objs="$filter_objs flacdec_filter"]) if test $HAVE_FAAD = yes; then filter_objs="$filter_objs aacdec_filter" fi @@ -679,11 +682,13 @@ recv_objs=" mp3_afh version " -NEED_OGG_OBJECTS && recv_objs="$recv_objs ogg_afh_common" -NEED_VORBIS_OBJECTS && recv_objs="$recv_objs ogg_afh" -NEED_SPEEX_OBJECTS && recv_objs="$recv_objs spx_afh spx_common" -NEED_OPUS_OBJECTS && recv_objs="$recv_objs opus_afh opus_common" -NEED_FLAC_OBJECTS && recv_objs="$recv_objs flac_afh" +AS_IF([test $NEED_OGG_OBJECTS = yes], [recv_objs="$recv_objs ogg_afh_common"]) +AS_IF([test $NEED_VORBIS_OBJECTS = yes], [recv_objs="$recv_objs ogg_afh"]) +AS_IF([test $NEED_SPEEX_OBJECTS = yes], + [recv_objs="$recv_objs spx_afh spx_common"]) +AS_IF([test $NEED_OPUS_OBJECTS = yes], + [recv_objs="$recv_objs opus_afh opus_common"]) +AS_IF([test $NEED_FLAC_OBJECTS = yes], [recv_objs="$recv_objs flac_afh"]) if test $HAVE_FAAD = yes; then recv_objs="$recv_objs aac_afh mp4" @@ -702,23 +707,23 @@ afh_objs=" wma_common version " -NEED_OGG_OBJECTS && afh_objs="$afh_objs ogg_afh_common" -NEED_VORBIS_OBJECTS && { +AS_IF([test $NEED_OGG_OBJECTS = yes], [afh_objs="$afh_objs ogg_afh_common"]) +AS_IF([test $NEED_VORBIS_OBJECTS = yes], [ afh_objs="$afh_objs ogg_afh" audio_format_handlers="$audio_format_handlers ogg" -} -NEED_SPEEX_OBJECTS && { +]) +AS_IF([test $NEED_SPEEX_OBJECTS = yes], [ afh_objs="$afh_objs spx_afh spx_common" audio_format_handlers="$audio_format_handlers spx" -} -NEED_OPUS_OBJECTS && { +]) +AS_IF([test $NEED_OPUS_OBJECTS = yes], [ afh_objs="$afh_objs opus_afh opus_common" audio_format_handlers="$audio_format_handlers opus" -} -NEED_FLAC_OBJECTS && { +]) +AS_IF([test $NEED_FLAC_OBJECTS = yes], [ afh_objs="$afh_objs flac_afh" audio_format_handlers="$audio_format_handlers flac" -} +]) if test $HAVE_FAAD = yes; then afh_objs="$afh_objs aac_afh mp4" audio_format_handlers="$audio_format_handlers aac" @@ -758,22 +763,15 @@ play_objs=" sync_filter lsu " -NEED_OGG_OBJECTS && play_objs="$play_objs ogg_afh_common" -NEED_VORBIS_OBJECTS && { - play_objs="$play_objs oggdec_filter ogg_afh" -} -NEED_SPEEX_OBJECTS && { - play_objs="$play_objs spxdec_filter spx_afh spx_common" -} -NEED_OPUS_OBJECTS && - play_objs="$play_objs - opusdec_filter - opus_afh - opus_common - " -NEED_FLAC_OBJECTS && { - play_objs="$play_objs flacdec_filter flac_afh" -} +AS_IF([test $NEED_OGG_OBJECTS = yes], [play_objs="$play_objs ogg_afh_common"]) +AS_IF([test $NEED_VORBIS_OBJECTS = yes], + [play_objs="$play_objs oggdec_filter ogg_afh"]) +AS_IF([test $NEED_SPEEX_OBJECTS = yes], + [play_objs="$play_objs spxdec_filter spx_afh spx_common"]) +AS_IF([test $NEED_OPUS_OBJECTS = yes], + [play_objs="$play_objs opusdec_filter opus_afh opus_common"]) +AS_IF([test $NEED_FLAC_OBJECTS = yes], + [play_objs="$play_objs flacdec_filter flac_afh"]) if test $HAVE_FAAD = yes; then play_objs="$play_objs aac_afh aacdec_filter mp4" fi