]> git.tue.mpg.de Git - paraslash.git/commitdiff
build: Construct server and upgrade_db object list in Makefile.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 24 Jun 2023 16:56:05 +0000 (18:56 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 17 Mar 2024 11:34:49 +0000 (12:34 +0100)
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
Makefile.real
configure.ac

index c618561d4dfeb18ebeb31f93a90ac69e32f84c63..74af5d57aa784dd51b59f255c2234a76d6f5f8a1 100644 (file)
@@ -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@
index 42ff86269faea344ae961a2e7d6b4e928c8e1d49..0ba0feaca572f2937bae45624d72d4da577d6fa8 100644 (file)
@@ -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) \
index efcd228816a382111ee367732c48e0b3d191ec3e..b44f78e47c4a3bfacc6df1b72ebea10486f88e38 100644 (file)
@@ -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"