build: Create section for para_write.
authorAndre Noll <maan@systemlinux.org>
Sat, 14 Sep 2013 02:46:37 +0000 (02:46 +0000)
committerAndre Noll <maan@systemlinux.org>
Sun, 1 Dec 2013 10:57:19 +0000 (11:57 +0100)
This moves all parts of configure.ac related to para_write to a
separate section at the bottom and kills @write_ldflags@.

The patch also fixes a minor issue for setups where libao is the only
"real" writer. Previously we used FILE_WRITE as the default writer
in this case. This commit changes it to AO_WRITE.

Makefile.in
configure.ac

index ea55b14..e847a09 100644 (file)
@@ -359,7 +359,7 @@ para_server: $(server_objs)
 
 para_write: $(write_objs)
        @[ -z "$(Q)" ] || echo 'LD $@'
-       $(Q) $(CC) -o $@ $(write_objs) @write_ldflags@ $(LDFLAGS)
+       $(Q) $(CC) -o $@ $(write_objs) $(LDFLAGS)
 
 para_afh: $(afh_objs)
        @[ -z "$(Q)" ] || echo 'LD $@'
index 3d85f30..dc0dd0e 100644 (file)
@@ -103,28 +103,6 @@ audioc_errlist_objs="
 "
 audioc_ldflags=""
 
-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"
-
 ################################################################## clock_gettime
 clock_gettime_lib=
 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
@@ -379,10 +357,6 @@ if test ${have_core_audio} = yes; then
        audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
        audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
 
-       write_errlist_objs="$write_errlist_objs osx_write ipc"
-       write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
-       writers="$writers osx"
-       default_writer="OSX_WRITE"
        AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
 fi
 ####################################################### ogg/vorbis/speex/opus
@@ -675,12 +649,8 @@ AC_CHECK_HEADER(sys/soundcard.h, [
        audiod_errlist_objs="$audiod_errlist_objs oss_write"
        audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
 
-       write_errlist_objs="$write_errlist_objs oss_write"
-       write_cmdline_objs="$write_cmdline_objs oss_write"
        fade_errlist_objs="$fade_errlist_objs oss_mix"
 
-       writers="$writers oss"
-       default_writer="OSS_WRITE"
        mixers="${mixers}oss "
        default_mixer="OSS_MIX"
 
@@ -730,12 +700,8 @@ if test "$have_alsa" = "yes"; then
        audiod_errlist_objs="$audiod_errlist_objs alsa_write"
        audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
 
-       write_errlist_objs="$write_errlist_objs alsa_write"
-       write_cmdline_objs="$write_cmdline_objs alsa_write"
        fade_errlist_objs="$fade_errlist_objs alsa_mix"
 
-       writers="$writers alsa"
-       default_writer="ALSA_WRITE"
        mixers="${mixers}alsa "
        default_mixer="ALSA_MIX"
 fi
@@ -794,9 +760,6 @@ if test "$have_ao" = "yes"; then
        audiod_errlist_objs="$audiod_errlist_objs ao_write"
        audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
 
-       write_errlist_objs="$write_errlist_objs ao_write"
-       write_cmdline_objs="$write_cmdline_objs ao_write"
-       writers="$writers ao"
 fi
 
 CPPFLAGS="$OLD_CPPFLAGS"
@@ -1355,6 +1318,66 @@ play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
 AC_SUBST(play_objs, add_dot_o($play_objs))
 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
        objlist_to_errlist($play_errlist_objs), errors used by para_play)
+######################################################################### 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
+"
+writers="file"
+default_writer="FILE_WRITE"
+
+if test "$have_core_audio" = "yes"; then
+       write_errlist_objs="$write_errlist_objs osx_write ipc"
+       write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
+       writers="$writers osx"
+       default_writer="OSX_WRITE"
+fi
+if test "$have_ao" = "yes"; then
+       write_errlist_objs="$write_errlist_objs ao_write"
+       write_cmdline_objs="$write_cmdline_objs ao_write"
+       writers="$writers ao"
+       default_writer="AO_WRITE"
+fi
+if test "$have_oss" = "yes"; then
+       write_errlist_objs="$write_errlist_objs oss_write"
+       write_cmdline_objs="$write_cmdline_objs oss_write"
+       writers="$writers oss"
+       default_writer="OSS_WRITE"
+fi
+if test "$have_alsa" = "yes"; then
+       write_errlist_objs="$write_errlist_objs alsa_write"
+       write_cmdline_objs="$write_cmdline_objs alsa_write"
+       writers="$writers alsa"
+       default_writer="ALSA_WRITE"
+fi
+write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
+AC_SUBST(write_objs, add_dot_o($write_objs))
+AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
+       objlist_to_errlist($write_errlist_objs), errors used by para_write)
+enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
+AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
+       enum of supported writers)
+AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
+names="$(for i in $writers; do printf \"$i\",' ' ; done)"
+AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
+inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
+AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
+array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
+AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
 ############################################################# error2.h
 # these are always built
 all_errlist_objs="
@@ -1432,7 +1455,6 @@ AC_SUBST(executables)
 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"
 
@@ -1450,11 +1472,6 @@ AC_SUBST(server_ldflags, $server_ldflags)
 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
        objlist_to_errlist($server_errlist_objs), errors used by para_server)
 
-AC_SUBST(write_objs, add_dot_o($write_objs))
-AC_SUBST(write_ldflags, $write_ldflags)
-AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
-       objlist_to_errlist($write_errlist_objs), errors used by para_write)
-
 AC_SUBST(client_objs, add_dot_o($client_objs))
 AC_SUBST(client_ldflags, $client_ldflags)
 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
@@ -1477,17 +1494,6 @@ AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported
 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
 
-enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
-AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
-       enum of supported writers)
-AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
-names="$(for i in $writers; do printf \"$i\",' ' ; done)"
-AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
-inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
-AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
-array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
-AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
-
 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
        enum of audio formats supported by audiod)