AC_INIT([paraslash],[git],[maan@systemlinux.org])
AC_CONFIG_HEADER([config.h])
+AC_SUBST(install_sh, [$INSTALL])
+AC_CONFIG_FILES([Makefile])
+AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
+AC_DEFUN([add_para],[$(for i in $@; do printf "para_$i "; 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
AC_MSG_ERROR(unable to determine system type)
gui_cmdline_objs="add_cmdline(gui)"
gui_errlist_objs="exec signal string stat ringbuffer fd gui gui_theme"
gui_objs="$gui_cmdline_objs $gui_errlist_objs"
-
-fade_cmdline_objs="add_cmdline(fade)"
-fade_errlist_objs="fade exec string fd"
-
-
########################################################################### snprintf
# ===========================================================================
# http://www.nongnu.org/autoconf-archive/ax_func_snprintf.html
OLD_LIBS="$LIBS"
have_oss="yes"
-msg="=> will not build para_fade/oss writer"
+msg="=> will not build oss writer"
AC_CHECK_HEADER(sys/soundcard.h, [
- extras="$extras fade"
- executables="$executables fade"
- all_errlist_objs="$all_errlist_objs oss_write fade"
audiod_errlist_objs="$audiod_errlist_objs oss_write"
audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"
-
write_errlist_objs="$write_errlist_objs oss_write"
write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
+ fade_errlist_objs="$fade_errlist_objs oss_mix"
+ all_errlist_objs="$all_errlist_objs oss_write oss_mix"
+
writers="$writers oss"
default_writer="OSS_WRITE"
+ mixers="${mixers}oss "
+ default_mixer="OSS_MIX"
+
AC_CHECK_LIB(ossaudio, _oss_ioctl, [
audiod_ldflags="$audiod_ldflags -lossaudio"
write_ldflags="$write_ldflags -lossaudio"
CPPFLAGS="$OLD_CPPFLAGS"
LDFLAGS="$OLD_LDFLAGS"
LIBS="$OLD_LIBS"
+########################################################################### fade
+if test -n "$mixers"; then
+ extras="$extras fade"
+ executables="$executables fade"
+ all_errlist_objs="$all_errlist_objs fade"
+ fade_errlist_objs="$fade_errlist_objs fade exec string fd"
+ fade_cmdline_objs="add_cmdline(fade)"
+ fade_objs="$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,
+ objlist_to_errlist($fade_errlist_objs),
+ errors used by para_fade)
+ enum="$(
+ for i in $mixers; do
+ printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
+ done
+ )"
+ AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
+ enum of supported mixers)
+ AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
+ use this mixer if none was specified)
+ names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
+ AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
+ inits="$(
+ for i in $mixers; do
+ printf 'extern void '$i'_mix_init(struct mixer *); '
+ done
+ )"
+ AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
+ init functions of the supported mixers)
+ array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
+ AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
+ mixer_summary="mixers supported by para_fade: $mixers"
+else
+ AC_MSG_WARN([no mixer support])
+ mixer_summary="para_fade: no"
+fi
########################################################################### libao
OLD_CPPFLAGS="$CPPFLAGS"
OLD_LD_FLAGS="$LDFLAGS"
CPPFLAGS="$OLD_CPPFLAGS"
LDFLAGS="$OLD_LDFLAGS"
LIBS="$OLD_LIBS"
-#############################################################
-
-
-AC_SUBST(install_sh, [$INSTALL])
-AC_CONFIG_FILES([Makefile])
-
-
-AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
-AC_DEFUN([add_para],[$(for i in $@; do printf "para_$i "; 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) }])
############################################################# error2.h
AC_MSG_NOTICE(creating error2.h)
for i in $executables; do
client_objs="$client_cmdline_objs $client_errlist_objs"
audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
afh_objs="$afh_cmdline_objs $afh_errlist_objs"
-fade_objs="$fade_cmdline_objs $fade_errlist_objs"
AC_SUBST(recv_objs, add_dot_o($recv_objs))
AC_SUBST(recv_ldflags, $recv_ldflags)
AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
-AC_SUBST(fade_objs, add_dot_o($fade_objs))
-AC_SUBST(fade_ldflags, $fade_ldflags)
-AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
- objlist_to_errlist($fade_errlist_objs), errors used by para_fade)
-
-
enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
enum of supported filters)
filters supported by para_audiod/para_filter: $filters
writers supported by para_audiod/para_write: $writers
optional executables: $extras
+$mixer_summary
])