+ write_errlist_objs="$write_errlist_objs ao_write"
+ write_cmdline_objs="$write_cmdline_objs ao_write"
+ writers="$writers ao"
+fi
+
+CPPFLAGS="$OLD_CPPFLAGS"
+LDFLAGS="$OLD_LDFLAGS"
+LIBS="$OLD_LIBS"
+############################################################# readline
+OLD_CPPFLAGS="$CPPFLAGS"
+OLD_LDFLAGS="$LDFLAGS"
+OLD_LIBS="$LIBS"
+
+have_readline="yes"
+AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
+ [look for libreadline header files also in dir])])
+if test -n "$with_readline_headers"; then
+ readline_cppflags="-I$with_readline_headers"
+ CPPFLAGS="$CPPFLAGS $readline_cppflags"
+fi
+
+AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
+ [look for readline library also in dir])])
+if test -n "$with_readline_libs"; then
+ readline_libs="-L$with_readline_libs"
+ LDFLAGS="$LDFLAGS $readline_libs"
+fi
+msg="no interactive cli support"
+AC_CHECK_HEADERS([readline/readline.h], [
+ ], [
+ have_readline="no"
+ AC_MSG_WARN([readline/readline.h not found, $msg])
+])
+
+if test "$have_curses" != "yes"; then
+ have_readline="no"
+ AC_MSG_WARN([interactive cli support depends on curses,])
+ AC_MSG_WARN([but no curses lib was detected, $msg])
+fi
+
+if test "$have_readline" = "yes"; then
+ readline_ldflags="$readline_libs -lreadline"
+ AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
+ if test "$have_readline" = "no"; then # try with -lcurses
+ # clear cache
+ AC_MSG_NOTICE([trying again with -lcurses])
+ unset ac_cv_search_rl_free_keymap 2> /dev/null
+ AC_SEARCH_LIBS([rl_free_keymap], [readline], [
+ have_readline=yes
+ readline_ldflags="$readline_ldflags -lcurses"
+ ], [], [-lcurses])
+ fi
+ if test "$have_readline" = "no"; then # try with -ltermcap
+ # clear cache
+ AC_MSG_NOTICE([trying again with -ltermcap])
+ unset ac_cv_search_rl_free_keymap 2> /dev/null
+ AC_SEARCH_LIBS([rl_free_keymap], [readline], [
+ have_readline=yes
+ readline_ldflags="$readline_ldflags -ltermcap"
+ ], [], [-ltermcap])
+ fi
+fi
+
+if test "$have_readline" = "yes"; then
+ AC_SUBST(readline_cppflags)
+ AC_SUBST(readline_ldflags)
+ client_errlist_objs="$client_errlist_objs interactive"
+ audioc_errlist_objs="$audioc_errlist_objs buffer_tree interactive sched time"
+ play_errlist_objs="$play_errlist_objs interactive"
+ AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
+else
+ AC_MSG_WARN([libreadline not found or unusable])
+fi
+CPPFLAGS="$OLD_CPPFLAGS"
+LDFLAGS="$OLD_LDFLAGS"
+LIBS="$OLD_LIBS"
+############################################################# libsamplerate
+OLD_CPPFLAGS="$CPPFLAGS"
+OLD_LDFLAGS="$LDFLAGS"
+OLD_LIBS="$LIBS"
+
+have_samplerate="yes"
+AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
+ [look for samplerate headers also in dir])])
+if test -n "$with_samplerate_headers"; then
+ samplerate_cppflags="-I$with_samplerate_headers"
+ CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
+fi
+AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
+ [look for samplerate libs also in dir])])
+if test -n "$with_samplerate_libs"; then
+ samplerate_libs="-L$with_samplerate_libs"
+ LDFLAGS="$LDFLAGS $samplerate_libs"
+fi
+
+AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
+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 resample_filter"
+ audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
+ audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
+ play_errlist_objs="$play_errlist_objs resample_filter check_wav"
+ 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"
+ filters="$filters resample"
+ AC_SUBST(samplerate_cppflags)
+else
+ AC_MSG_WARN([no resample support in para_audiod/para_filter])
+fi
+CPPFLAGS="$OLD_CPPFLAGS"
+LDFLAGS="$OLD_LDFLAGS"
+LIBS="$OLD_LIBS"
+######################################################################### server
+if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
+ -a "$have_osl" = "yes" ; then
+
+ build_server="yes"
+ executables="$executables server"
+ server_cmdline_objs="server"
+ server_errlist_objs="$server_errlist_objs
+ server
+ afh_common
+ mp3_afh
+ vss
+ command
+ net
+ string
+ signal
+ time
+ daemon
+ http_send
+ close_on_fork
+ mm
+ crypt_common
+ ipc
+ dccp_send
+ fd
+ user_list
+ chunk_queue
+ afs
+ aft
+ mood
+ score
+ attribute
+ blob
+ playlist
+ sched
+ acl
+ send_common
+ udp_send
+ color
+ fec
+ wma_afh
+ wma_common
+ sideband
+ version
+ ggo
+ "
+ server_ldflags="$server_ldflags $osl_libs -losl"
+else
+ build_server="no"
+fi
+############################################################# client
+if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
+ build_client="yes"
+ executables="$executables client"
+ client_cmdline_objs="client"
+ client_errlist_objs="$client_errlist_objs
+ client
+ net
+ string
+ fd
+ sched
+ stdin
+ stdout
+ time
+ sideband
+ client_common
+ buffer_tree
+ crypt_common
+ version
+ ggo
+ "
+else
+ build_client="no"
+fi
+############################################################# audiod
+if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
+ build_audiod="yes"
+ executables="$executables audiod"
+ audiod_cmdline_objs="$audiod_cmdline_objs
+ audiod
+ compress_filter
+ http_recv
+ dccp_recv
+ file_write
+ client
+ amp_filter
+ udp_recv
+ prebuffer_filter
+ "
+ audiod_errlist_objs="$audiod_errlist_objs
+ audiod
+ signal
+ string
+ daemon
+ stat
+ net
+ crypt_common
+ sideband
+ time
+ grab_client
+ filter_common
+ wav_filter
+ compress_filter
+ amp_filter
+ http_recv
+ dccp_recv
+ recv_common
+ fd
+ sched
+ write_common
+ file_write
+ audiod_command
+ fecdec_filter
+ client_common
+ ggo
+ udp_recv
+ color
+ fec
+ prebuffer_filter
+ version
+ bitstream
+ imdct
+ wma_common
+ wmadec_filter
+ buffer_tree
+ "
+ audiod_ldflags="$audiod_ldflags -lm"
+ audiod_audio_formats="$audiod_audio_formats wma"
+else
+ build_audiod="no"
+fi
+########################################################################### fade
+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="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,
+ 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]'