From 63df7d00a150c9558fb4ba96da9cf7c4000fc464 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 24 Jun 2023 18:56:05 +0200 Subject: [PATCH] build: Construct server and upgrade_db object list in Makefile. Currently configure.ac defines variables for the list of objects of each executable and exports these via AC_SUBST to Makefile.in. The lists are then extended and munged further in Makefile.real. It it easier to construct the lists only in the makefile. So, as a first step, stop to export the object list of para_server and para_upgrade_db. Instead, export the variables needed to construct the list in the makefile. --- Makefile.in | 13 +++++++-- Makefile.real | 38 +++++++++++++++++++++++++ configure.ac | 79 ++++++--------------------------------------------- 3 files changed, 57 insertions(+), 73 deletions(-) diff --git a/Makefile.in b/Makefile.in index c618561d..74af5d57 100644 --- a/Makefile.in +++ b/Makefile.in @@ -12,6 +12,17 @@ FLEX := @FLEX@ BISON := @BISON@ M4 := @M4@ LOPSUBGEN := @LOPSUBGEN@ +CRYPTOLIB := @CRYPTOLIB@ + +NEED_OGG_OBJECTS := @NEED_OGG_OBJECTS@ +NEED_VORBIS_OBJECTS := @NEED_VORBIS_OBJECTS@ +NEED_SPEEX_OBJECTS := @NEED_SPEEX_OBJECTS@ +NEED_OPUS_OBJECTS := @NEED_OPUS_OBJECTS@ +NEED_FLAC_OBJECTS := @NEED_FLAC_OBJECTS@ + +HAVE_OSL := @HAVE_OSL@ +HAVE_FAAD := @HAVE_FAAD@ +HAVE_FLAC := @HAVE_FLAC@ executables := @executables@ @@ -22,8 +33,6 @@ gui_objs := @gui_objs@ audiod_objs := @audiod_objs@ audioc_objs := @audioc_objs@ mixer_objs := @mixer_objs@ -server_objs := @server_objs@ -upgrade_db_objs := @upgrade_db_objs@ write_objs := @write_objs@ afh_objs := @afh_objs@ play_objs := @play_objs@ diff --git a/Makefile.real b/Makefile.real index 42ff8626..0ba0feac 100644 --- a/Makefile.real +++ b/Makefile.real @@ -38,6 +38,44 @@ test_dir := t yy_src_dir := yy yy_build_dir := $(build_dir)/yy +ifneq ($(CRYPTOLIB),) + ifeq ($(HAVE_OSL),yes) + server_objs := $(addsuffix .o, \ + server afh_common mp3_afh vss command net string \ + signal time daemon http_send close_on_fork \ + crypt_common base64 ipc dccp_send fd user_list \ + chunk_queue afs aft mood mp score attribute blob \ + playlist sched acl send_common udp_send color fec \ + wma_afh wma_common sideband version lsu \ + ) + ifeq ($(CRYPTOLIB),openssl) + server_objs += openssl.o + else + server_objs += gcrypt.o + endif + ifeq ($(NEED_OGG_OBJECTS),yes) + server_objs += ogg_afh_common.o + endif + ifeq ($(NEED_VORBIS_OBJECTS),yes) + server_objs += ogg_afh.o + endif + ifeq ($(NEED_SPEEX_OBJECTS),yes) + server_objs += spx_afh.o spx_common.o + endif + ifeq ($(NEED_OPUS_OBJECTS),yes) + server_objs += opus_afh.o opus_common.o + endif + ifeq ($(NEED_FLAC_OBJECTS),yes) + server_objs += flac_afh.o + endif + ifeq ($(HAVE_FAAD),yes) + server_objs += aac_afh.o mp4.o + endif + upgrade_db_objs := $(addsuffix .o, crypt_common exec fd string \ + upgrade_db version base64) + endif +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) \ diff --git a/configure.ac b/configure.ac index efcd2288..b44f78e4 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,7 @@ AC_DEFUN([LIB_SUBST_FLAGS], [ if test "$HAVE_[]m4_toupper([$1])" = 'yes'; then AC_DEFINE(HAVE_[]m4_toupper([$1]), 1, define to 1 to turn on $1 support) + AC_SUBST(HAVE_[]m4_toupper([$1])) else $1_cppflags= $1_ldflags= @@ -172,6 +173,7 @@ case "$enable_cryptolib" in ;; esac AC_SUBST(crypto_ldflags) +AC_SUBST(CRYPTOLIB) ########################################################################## iconv STASH_FLAGS LIBS= @@ -280,14 +282,19 @@ AS_IF([test "$HAVE_OGG" = 'yes' -a \( \ -o "$HAVE_OPUS" = 'yes' \ -o "$HAVE_FLAC" = 'yes' \ \)], [NEED_OGG_OBJECTS=yes], [NEED_OGG_OBJECTS=no]) +AC_SUBST([NEED_OGG_OBJECTS]) AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_VORBIS" = 'yes'], [NEED_VORBIS_OBJECTS=yes], [NEED_VORBIS_OBJECTS=no]) +AC_SUBST([NEED_VORBIS_OBJECTS]) AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_SPEEX" = 'yes'], [NEED_SPEEX_OBJECTS=yes], [NEED_SPEEX_OBJECTS=no]) +AC_SUBST([NEED_SPEEX_OBJECTS]) AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_OPUS" = 'yes'], [NEED_OPUS_OBJECTS=yes], [NEED_OPUS_OBJECTS=no]) +AC_SUBST([NEED_OPUS_OBJECTS]) AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_FLAC" = 'yes'], [NEED_FLAC_OBJECTS=yes], [NEED_FLAC_OBJECTS=no]) +AC_SUBST([NEED_FLAC_OBJECTS]) ########################################################################### faad STASH_FLAGS LIB_ARG_WITH([faad], [-lfaad]) @@ -375,83 +382,13 @@ AC_ARG_ENABLE([ubsan], [AS_HELP_STRING(--enable-ubsan, [Detect and report undefined behaviour.])], [ENABLE_UBSAN=yes], [ENABLE_UBSAN=no]) AC_SUBST(ENABLE_UBSAN) -######################################################################### server +######################################################### server and upgrade_db if test -n "$CRYPTOLIB" && test $HAVE_OSL = yes; then build_server="yes" executables="$executables server upgrade_db" - server_objs=" - server - afh_common - mp3_afh - vss - command - net - string - signal - time - daemon - http_send - close_on_fork - crypt_common - base64 - ipc - dccp_send - fd - user_list - chunk_queue - afs - aft - mood - mp - score - attribute - blob - playlist - sched - acl - send_common - udp_send - color - fec - wma_afh - wma_common - sideband - version - lsu - " - if test "$CRYPTOLIB" = openssl; then - server_objs="$server_objs openssl" - else - server_objs="$server_objs gcrypt" - fi - 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 - AC_SUBST(server_objs, add_dot_o($server_objs)) else build_server="no" fi -############################################################# upgrade_db -upgrade_db_objs=' - crypt_common - exec - fd - string - upgrade_db - version - base64 -' -AC_SUBST(upgrade_db_objs, add_dot_o($upgrade_db_objs)) ############################################################# client if test -n "$CRYPTOLIB"; then build_client="yes" -- 2.39.5