]> git.tue.mpg.de Git - paraslash.git/commitdiff
build: Add object "cmdline" suffix only once.
authorAndre Noll <maan@systemlinux.org>
Sun, 8 Sep 2013 01:10:56 +0000 (01:10 +0000)
committerAndre Noll <maan@systemlinux.org>
Sun, 1 Dec 2013 10:47:32 +0000 (11:47 +0100)
This is equivalent, but it is both simpler and less error-prone than
calling add_cmdline() for each check. Change all affected assignments
to the one-line-per-object format while we're at it.

configure.ac

index c5379b1407b9dca173517d07e4d0861665e9148b..c90baf79a22b7841416781e991a7a11e09ad7f63 100644 (file)
@@ -8,6 +8,7 @@ AC_CONFIG_HEADER([config.h])
 
 AC_CONFIG_FILES([Makefile])
 AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
+AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
 AC_DEFUN([objlist_to_errlist],[$(for i in $@; do printf "DEFINE_ERRLIST($(echo $i| tr 'a-z' 'A-Z'));"; done) [const char **para_errlist[[]]] = {$(for i in $@; do printf "PARA_ERRLIST($(echo $i | tr 'a-z' 'A-Z')), "; done) }])
 AC_PATH_PROG(UNAMEPATH, uname, no)
 if test "$UNAMEPATH" = "no"; then
@@ -88,13 +89,16 @@ AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \
        strncasecmp strrchr strspn alarm mkdir inet_ntoa socket], [],
        [AC_MSG_ERROR([function not found, cannot live without it])])
 
-AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
-
-
 executables="recv filter audioc write afh play"
 audio_format_handlers="mp3 wma"
 
-recv_cmdline_objs="add_cmdline(recv http_recv dccp_recv udp_recv afh_recv)"
+recv_cmdline_objs="
+       recv
+       http_recv
+       dccp_recv
+       udp_recv
+       afh_recv
+"
 
 recv_errlist_objs="
        http_recv recv_common recv time string net dccp_recv fd
@@ -104,14 +108,19 @@ recv_errlist_objs="
 
 recv_ldflags=""
 
-filter_cmdline_objs="add_cmdline(filter compress_filter amp_filter prebuffer_filter)"
+filter_cmdline_objs="
+       filter
+       compress_filter
+       amp_filter
+       prebuffer_filter
+"
 filter_errlist_objs="filter_common wav_filter compress_filter filter string
        stdin stdout sched fd amp_filter ggo fecdec_filter fec version
        prebuffer_filter time bitstream imdct wma_common wmadec_filter buffer_tree"
 filter_ldflags="-lm"
 filters=" compress wav amp fecdec wmadec prebuffer"
 
-audioc_cmdline_objs="add_cmdline(audioc)"
+audioc_cmdline_objs="audioc"
 audioc_errlist_objs="
        audioc
        string
@@ -122,19 +131,19 @@ audioc_errlist_objs="
 "
 audioc_ldflags=""
 
-afh_cmdline_objs="add_cmdline(afh)"
+afh_cmdline_objs="afh"
 afh_errlist_objs="afh string fd mp3_afh afh_common time wma_afh wma_common
        version ggo"
 afh_ldflags=""
 
-write_cmdline_objs="add_cmdline(write file_write)"
+write_cmdline_objs="write file_write"
 write_errlist_objs="write write_common file_write time fd string sched stdin
        buffer_tree ggo check_wav version"
 write_ldflags=""
 writers=" file"
 default_writer="FILE_WRITE"
 
-gui_cmdline_objs="add_cmdline(gui)"
+gui_cmdline_objs="gui"
 gui_errlist_objs="
        exec
        signal
@@ -148,7 +157,6 @@ gui_errlist_objs="
        version
        ggo
 "
-gui_objs="$gui_cmdline_objs $gui_errlist_objs"
 play_errlist_objs="play fd sched ggo buffer_tree time string net
        afh_recv afh_common
        wma_afh wma_common mp3_afh
@@ -159,7 +167,17 @@ play_errlist_objs="play fd sched ggo buffer_tree time string net
        write_common file_write
        version
 "
-play_cmdline_objs="add_cmdline(http_recv dccp_recv udp_recv afh_recv compress_filter amp_filter prebuffer_filter file_write play)"
+play_cmdline_objs="
+       http_recv
+       dccp_recv
+       udp_recv
+       afh_recv
+       compress_filter
+       amp_filter
+       prebuffer_filter
+       file_write
+       play
+"
 play_ldflags="-lm"
 ################################################################## clock_gettime
 clock_gettime_lib=
@@ -689,9 +707,9 @@ AC_CHECK_LIB([mad], [mad_stream_init], [], [
 ])
 if test "$have_mad" = "yes"; then
        AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
-       filter_cmdline_objs="$filter_cmdline_objs add_cmdline(mp3dec_filter)"
-       audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(mp3dec_filter)"
-       play_cmdline_objs="$play_cmdline_objs add_cmdline(mp3dec_filter)"
+       filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
+       audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
+       play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
        filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
        audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
        play_errlist_objs="$play_errlist_objs mp3dec_filter"
@@ -803,11 +821,11 @@ msg="=> will not build oss writer"
 AC_CHECK_HEADER(sys/soundcard.h, [
        audiod_errlist_objs="$audiod_errlist_objs oss_write"
        play_errlist_objs="$play_errlist_objs oss_write"
-       audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"
-       play_cmdline_objs="$play_cmdline_objs add_cmdline(oss_write)"
+       audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
+       play_cmdline_objs="$play_cmdline_objs oss_write"
 
        write_errlist_objs="$write_errlist_objs oss_write"
-       write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
+       write_cmdline_objs="$write_cmdline_objs oss_write"
        fade_errlist_objs="$fade_errlist_objs oss_mix"
 
        writers="$writers oss"
@@ -859,14 +877,14 @@ fi
 
 if test "$have_alsa" = "yes"; then
        audiod_errlist_objs="$audiod_errlist_objs alsa_write"
-       audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(alsa_write)"
+       audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
        audiod_ldflags="$audiod_ldflags -lasound"
        play_errlist_objs="$play_errlist_objs alsa_write"
-       play_cmdline_objs="$play_cmdline_objs add_cmdline(alsa_write)"
+       play_cmdline_objs="$play_cmdline_objs alsa_write"
        play_ldflags="$play_ldflags -lasound"
 
        write_errlist_objs="$write_errlist_objs alsa_write"
-       write_cmdline_objs="$write_cmdline_objs add_cmdline(alsa_write)"
+       write_cmdline_objs="$write_cmdline_objs alsa_write"
        write_ldflags="$write_ldflags -lasound"
        fade_errlist_objs="$fade_errlist_objs alsa_mix"
        fade_ldflags="$fade_ldflags -lasound"
@@ -885,8 +903,8 @@ if test -n "$mixers"; then
        build_fade="yes"
        executables="$executables fade"
        fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
-       fade_cmdline_objs="add_cmdline(fade)"
-       fade_objs="$fade_cmdline_objs $fade_errlist_objs"
+       fade_cmdline_objs="fade"
+       fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
        AC_SUBST(fade_objs, add_dot_o($fade_objs))
        AC_SUBST(fade_ldflags, $fade_ldflags)
        AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
@@ -963,15 +981,15 @@ if test "$have_ao" = "yes"; then
 fi
 if test "$have_ao" = "yes"; then
        audiod_errlist_objs="$audiod_errlist_objs ao_write"
-       audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(ao_write)"
+       audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
        audiod_ldflags="$audiod_ldflags -lao -lpthread"
 
        play_errlist_objs="$play_errlist_objs ao_write"
-       play_cmdline_objs="$play_cmdline_objs add_cmdline(ao_write)"
+       play_cmdline_objs="$play_cmdline_objs ao_write"
        play_ldflags="$play_ldflags -lao -lpthread"
 
        write_errlist_objs="$write_errlist_objs ao_write"
-       write_cmdline_objs="$write_cmdline_objs add_cmdline(ao_write)"
+       write_cmdline_objs="$write_cmdline_objs ao_write"
        write_ldflags="$write_ldflags $ao_libs -lao -lpthread"
        writers="$writers ao"
        AC_SUBST(ao_cppflags)
@@ -1074,11 +1092,11 @@ AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
 
 if test "$have_samplerate" = "yes"; then
        filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
-       filter_cmdline_objs="$filter_cmdline_objs add_cmdline(resample_filter)"
+       filter_cmdline_objs="$filter_cmdline_objs resample_filter"
        audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
-       audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(resample_filter)"
+       audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
        play_errlist_objs="$play_errlist_objs resample_filter check_wav"
-       play_cmdline_objs="$play_cmdline_objs add_cmdline(resample_filter)"
+       play_cmdline_objs="$play_cmdline_objs resample_filter"
        filter_ldflags="$filter_ldflags $samplerate_libs -lsamplerate"
        audiod_ldflags="$audiod_ldflags $samplerate_libs -lsamplerate"
        play_ldflags="$play_ldflags $samplerate_libs -lsamplerate"
@@ -1096,7 +1114,7 @@ if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
 
        build_server="yes"
        executables="$executables server"
-       server_cmdline_objs="add_cmdline(server)"
+       server_cmdline_objs="server"
        server_errlist_objs="$server_errlist_objs
                server
                afh_common
@@ -1144,7 +1162,7 @@ fi
 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
        build_client="yes"
        executables="$executables client"
-       client_cmdline_objs="add_cmdline(client)"
+       client_cmdline_objs="client"
        client_errlist_objs="$client_errlist_objs
                client
                net
@@ -1169,7 +1187,16 @@ if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
        build_audiod="yes"
        executables="$executables audiod"
        audiod_cmdline_objs="$audiod_cmdline_objs
-               add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
+               audiod
+               compress_filter
+               http_recv
+               dccp_recv
+               file_write
+               client
+               amp_filter
+               udp_recv
+               prebuffer_filter
+       "
        audiod_errlist_objs="$audiod_errlist_objs
                audiod
                signal
@@ -1285,16 +1312,16 @@ AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
 
 AC_SUBST(executables)
 
-recv_objs="$recv_cmdline_objs $recv_errlist_objs"
-filter_objs="$filter_cmdline_objs $filter_errlist_objs"
-audiod_objs="$audiod_cmdline_objs $audiod_errlist_objs"
-server_objs="$server_cmdline_objs $server_errlist_objs"
-write_objs="$write_cmdline_objs $write_errlist_objs"
-client_objs="$client_cmdline_objs $client_errlist_objs"
-audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
-afh_objs="$afh_cmdline_objs $afh_errlist_objs"
-play_objs="$play_cmdline_objs $play_errlist_objs"
-
+recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
+filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
+audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
+server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
+write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
+client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
+audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
+afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
+play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
+gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
 
 AC_SUBST(recv_objs, add_dot_o($recv_objs))
 AC_SUBST(recv_ldflags, $recv_ldflags)