]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
build: Construct afh object list in Makefile.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 24 Jun 2023 09:02:38 +0000 (11:02 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 17 Mar 2024 11:34:49 +0000 (12:34 +0100)
Makefile.in
Makefile.real
configure.ac

index 9f6393b4e36f55b8b4b03827207d1667a73e65af..4529779bbb3975e4eebc65cd05c62da9a59432e3 100644 (file)
@@ -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@
index 2c7cff784210ad5b286c67563321d56e86a54e66..6ab2065c654eb6655c7f6c5812db6d420df01eae 100644 (file)
@@ -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)
index 8ea488c2eb2ab9e316cefe3cb9af3c5db651cac8..6d42f87ba980ecad08a51dcef73a42889988f1d4 100644 (file)
@@ -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