From 5fd6c1a5acae2a52545e081ac4b38717c7295d80 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 24 Jun 2023 11:02:38 +0200 Subject: [PATCH] build: Construct afh object list in Makefile. --- Makefile.in | 1 - Makefile.real | 29 +++++++++++++++++++++++++++++ configure.ac | 38 -------------------------------------- 3 files changed, 29 insertions(+), 39 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9f6393b4..4529779b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -37,7 +37,6 @@ executables := @executables@ audioc_objs := @audioc_objs@ write_objs := @write_objs@ -afh_objs := @afh_objs@ play_objs := @play_objs@ speex_cppflags := @speex_cppflags@ diff --git a/Makefile.real b/Makefile.real index 2c7cff78..6ab2065c 100644 --- a/Makefile.real +++ b/Makefile.real @@ -194,6 +194,33 @@ ifeq ($(HAVE_FAAD),yes) recv_objs += aac_afh.o mp4.o endif +audio_format_handlers := mp3 wma +afh_objs := $(addsuffix .o, afh string fd mp3_afh afh_common time wma_afh \ + wma_common version) +ifeq ($(NEED_OGG_OBJECTS),yes) + afh_objs += ogg_afh_common.o +endif +ifeq ($(NEED_VORBIS_OBJECTS),yes) + afh_objs += ogg_afh.o + audio_format_handlers += ogg +endif +ifeq ($(NEED_SPEEX_OBJECTS),yes) + afh_objs += spx_common.o + audio_format_handlers += spx +endif +ifeq ($(NEED_OPUS_OBJECTS),yes) + afh_objs += opus_afh.o opus_common.o + audio_format_handlers += opus +endif +ifeq ($(NEED_FLAC_OBJECTS),yes) + afh_objs += flac_afh.o + audio_format_handlers += flac +endif +ifeq ($(HAVE_FAAD),yes) + afh_objs += aac_afh.o mp4.o + audio_format_handlers += aac +endif + # sort removes duplicate words, which is all we need here all_objs := $(sort $(recv_objs) $(filter_objs) $(client_objs) $(gui_objs) \ $(audiod_objs) $(audioc_objs) $(mixer_objs) $(server_objs) \ @@ -358,6 +385,8 @@ OD = $(addsuffix .d, $(addprefix $(dep_dir)/, $(1))) \ $(call OD, audiod): \ CPPFLAGS += -DAUDIOD_AUDIO_FORMAT_ARRAY='$(audiod_audio_formats)' +$(call OD, afh command): \ + CPPFLAGS += -DAUDIO_FORMAT_HANDLERS='"$(audio_format_handlers)"' $(call OD, opus%): CPPFLAGS += $(opus_cppflags) $(call OD, gui gui%): CPPFLAGS += $(curses_cppflags) $(call OD, spx%): CPPFLAGS += $(speex_cppflags) diff --git a/configure.ac b/configure.ac index 8ea488c2..6d42f87b 100644 --- a/configure.ac +++ b/configure.ac @@ -415,41 +415,6 @@ if test $HAVE_CURSES = yes; then build_gui="yes" executables="$executables gui" fi -########################################################################### afh -audio_format_handlers="mp3 wma" -afh_objs=" - afh - string - fd - mp3_afh - afh_common - time - wma_afh - wma_common - version -" -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" -]) -AS_IF([test $NEED_SPEEX_OBJECTS = yes], [ - afh_objs="$afh_objs spx_afh spx_common" - audio_format_handlers="$audio_format_handlers spx" -]) -AS_IF([test $NEED_OPUS_OBJECTS = yes], [ - afh_objs="$afh_objs opus_afh opus_common" - audio_format_handlers="$audio_format_handlers opus" -]) -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" -fi -AC_SUBST(afh_objs, add_dot_o($afh_objs)) ########################################################################## play play_objs=" play @@ -559,8 +524,6 @@ if test $HAVE_READLINE = yes; then fi AC_SUBST(audioc_objs, add_dot_o($audioc_objs)) -AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers", - [formats supported by para_server and para_afh]) AC_SUBST(executables) AC_OUTPUT @@ -571,7 +534,6 @@ crypto lib: ${CRYPTOLIB:-[none]} readline (interactive CLIs): $HAVE_READLINE id3 version 2 support: $HAVE_ID3TAG faad: $HAVE_FAAD -audio format handlers: $audio_format_handlers exe: $executables para_server: $build_server -- 2.39.2