2 # Process this file with autoconf to produce a configure script.
6 AC_INIT([paraslash], [m4_esyscmd_s(./GIT-VERSION-GEN)],
7 [maan@tuebingen.mpg.de], [], [http://people.tuebingen.mpg.de/maan/paraslash/])
8 AC_CONFIG_HEADERS([config.h])
10 AC_CONFIG_FILES([Makefile])
11 AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
12 AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
13 AC_DEFUN([make_errlist_defines], \
15 printf "DEFINE_ERRLIST($(echo $i | tr 'a-z' 'A-Z'));"; \
18 AC_DEFUN([make_para_errlists], \
20 printf "PARA_ERRLIST($(echo $i | tr 'a-z' 'A-Z')), "; \
23 AC_DEFUN([objlist_to_errlist],[ \
24 make_errlist_defines($@) \
25 [const char **para_errlist[[]]] = {make_para_errlists($@)} \
27 AC_DEFUN([LIB_ARG_WITH], [
28 AC_ARG_WITH($1-headers, [AS_HELP_STRING(--with-$1-headers=dir,
29 [look for $1 headers in dir])])
30 AC_ARG_WITH($1-libs, [AS_HELP_STRING(--with-$1-libs=dir,
31 [look for $1 libraries in dir])])
32 if test -n "$with_$1_headers"; then
33 $1_cppflags="-I$with_$1_headers"
34 CPPFLAGS="$CPPFLAGS $$1_cppflags"
36 if test -n "$with_$1_libs"; then
37 $1_ldflags="-L$with_$1_libs $2"
41 LDFLAGS="$LDFLAGS $$1_ldflags"
44 AC_DEFUN([STASH_FLAGS], [
45 OLD_CPPFLAGS="$CPPFLAGS"
46 OLD_LDFLAGS="$LDFLAGS"
50 AC_DEFUN([UNSTASH_FLAGS], [
51 CPPFLAGS="$OLD_CPPFLAGS"
52 LDFLAGS="$OLD_LDFLAGS"
55 AC_DEFUN([LIB_SUBST_FLAGS], [
56 if test "$HAVE_[]m4_toupper([$1])" = 'yes'; then
57 AC_DEFINE(HAVE_[]m4_toupper([$1]), 1,
58 define to 1 to turn on $1 support)
63 AC_SUBST(HAVE_[]m4_toupper([$1]))
68 AC_USE_SYSTEM_EXTENSIONS
71 AC_PATH_PROG([GENGETOPT], [gengetopt])
72 test -z "$GENGETOPT" && AC_MSG_ERROR(
73 [gengetopt is required to build this package])
75 AC_PATH_PROG([M4], [m4])
76 test -z "$M4" && AC_MSG_ERROR(
77 [The m4 macro processor is required to build this package])
79 AC_PATH_PROG([HELP2MAN], [help2man])
80 test -z "$HELP2MAN" && AC_MSG_ERROR(
81 [help2man is required to build this package])
83 AC_PATH_PROG([INSTALL], [install])
84 test -z "$INSTALL" && AC_MSG_ERROR(
85 [The install program is required to build this package])
90 executables="recv filter audioc write afh play"
91 ################################################################## clock_gettime
93 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
94 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
96 if test -n "$clock_gettime_lib"; then
97 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
98 define to 1 if clock_gettime() is supported])
100 if test "$clock_gettime_lib" = "rt"; then
101 AC_SUBST(clock_gettime_ldflags, -lrt)
104 ########################################################################### osl
106 LIB_ARG_WITH([osl], [-losl])
108 AC_CHECK_HEADER(osl.h, [], [HAVE_OSL=no])
109 AC_CHECK_LIB([osl], [osl_open_table], [], [HAVE_OSL=no])
112 ######################################################################## openssl
115 LIB_ARG_WITH([openssl], [-lssl -lcrypto])
116 AC_CHECK_HEADER(openssl/ssl.h, [], [HAVE_OPENSSL=no])
117 AC_CHECK_LIB([crypto], [RAND_bytes], [], [HAVE_OPENSSL=no])
118 LIB_SUBST_FLAGS(openssl)
119 if test $HAVE_OPENSSL = yes; then
120 AC_CHECK_LIB([crypto], [RSA_set0_key],
121 AC_DEFINE([HAVE_RSA_SET0_KEY], [1], [openssl-1.1]))
124 ######################################################################### gcrypt
127 LIB_ARG_WITH([gcrypt], [-lgcrypt])
128 AC_CHECK_HEADER(gcrypt.h, [], [HAVE_GCRYPT=no])
129 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [HAVE_GCRYPT=no])
130 LIB_SUBST_FLAGS(gcrypt)
132 ######################################################################### crypto
133 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
134 Force using crypto library "lib". This package requires either
135 openssl or libgcrypt being installed. Possible values for "lib"
136 are thus "openssl" and "gcrypt". If this option is not given,
137 openssl is tried first. If openssl was not found, gcrypt is
140 CRYPTOLIB="$enable_cryptolib"
141 case "$enable_cryptolib" in
143 test $HAVE_OPENSSL = no && AC_MSG_ERROR(openssl not found)
144 crypto_ldflags="$openssl_ldflags"
147 test $HAVE_GCRYPT = no && AC_MSG_ERROR(gcrypt not found)
148 crypto_ldflags="$gcrypt_ldflags"
152 if test $HAVE_GCRYPT = yes; then
154 crypto_ldflags="$gcrypt_ldflags"
156 if test $HAVE_OPENSSL = yes; then
158 crypto_ldflags="$openssl_ldflags"
162 AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib])
165 AC_SUBST(crypto_ldflags)
166 ########################################################################## iconv
169 AC_SEARCH_LIBS([libiconv_open], [iconv],
170 [iconv_ldflags="$LIBS"],
173 AC_SUBST(iconv_ldflags)
174 AC_MSG_CHECKING([whether iconv needs const char ** cast])
179 size_t iconv(iconv_t cd, const char **inbuf,
180 size_t *inbytesleft, char **outbuf,
181 size_t *outbytesleft);
184 [cast='(const char **)'; msg=yes],
187 AC_DEFINE_UNQUOTED(ICONV_CAST, $cast, [cast for second arg to iconv()])
190 ########################################################################### ucred
191 AC_MSG_CHECKING(for struct ucred)
192 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
193 #include <sys/types.h>
194 #include <sys/socket.h>
196 struct ucred sucred; sucred.pid=0;
197 ]])],[have_ucred=yes],[have_ucred=no])
198 AC_MSG_RESULT($have_ucred)
199 if test ${have_ucred} = yes; then
200 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
202 ########################################################################### gengetopt
203 echo 'option "z" z "" flag off' | $GENGETOPT --file-name conftest-ggo &&
205 [gengetopt_args_info_description],
206 [ggo_descriptions_declared=yes],
207 [ggo_descriptions_declared=no],
208 [#include "conftest-ggo.h"]
210 AC_SUBST(ggo_descriptions_declared)
211 ########################################################################### curses
213 LIB_ARG_WITH([curses], [])
215 AC_CHECK_HEADER(curses.h, [], [HAVE_CURSES=no])
216 AC_SEARCH_LIBS([initscr], [ncursesw curses], [], [HAVE_CURSES=no])
217 curses_ldflags="$curses_ldflags $LIBS"
218 LIB_SUBST_FLAGS(curses)
220 ########################################################################### ip_mreqn
221 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
222 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
228 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
229 AC_MSG_RESULT($have_ip_mreqn)
230 if test ${have_ip_mreqn} = yes; then
231 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
233 ########################################################################### osx
235 AC_MSG_CHECKING(for CoreAudio (MacOs))
236 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
237 #include <CoreAudio/CoreAudio.h>
240 ]])],[have_core_audio=yes],[have_core_audio=no])
241 AC_MSG_RESULT($have_core_audio)
242 if test ${have_core_audio} = yes; then
243 f1="-framework CoreAudio"
244 f2="-framework AudioToolbox"
245 f3="-framework AudioUnit"
246 f4="-framework CoreServices"
247 core_audio_ldflags="$f1 $f2 $f3 $f4"
248 AC_SUBST(core_audio_ldflags)
249 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
251 ########################################################################### ogg
253 LIB_ARG_WITH([ogg], [-logg])
255 AC_CHECK_HEADERS([ogg/ogg.h], [], [HAVE_OGG=no])
256 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [HAVE_OGG=no])
257 AC_CHECK_LIB([ogg], [ogg_stream_flush_fill], [
258 AC_DEFINE(HAVE_OGG_STREAM_FLUSH_FILL, 1, [libogg >= 1.3.0])])
261 ######################################################################### vorbis
263 LIB_ARG_WITH([vorbis], [-lvorbis -lvorbisfile])
265 AC_CHECK_HEADERS([vorbis/codec.h], [], [HAVE_VORBIS=no])
266 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [HAVE_VORBIS=no])
267 LIB_SUBST_FLAGS(vorbis)
269 ######################################################################### speex
271 LIB_ARG_WITH([speex], [-lspeex])
273 AC_CHECK_HEADERS([speex/speex.h], [], [HAVE_SPEEX=no])
274 AC_CHECK_LIB([speex], [speex_decoder_init], [], [HAVE_SPEEX=no])
275 LIB_SUBST_FLAGS(speex)
277 ######################################################################### opus
279 LIB_ARG_WITH([opus], [-lopus])
281 AC_CHECK_HEADERS([opus/opus.h], [], [HAVE_OPUS=no])
282 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [HAVE_OPUS=no])
283 LIB_SUBST_FLAGS(opus)
285 ########################################################################### flac
287 LIB_ARG_WITH([flac], [-lFLAC -lm])
289 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], HAVE_FLAC=no)
290 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], HAVE_FLAC=no)
291 LIB_SUBST_FLAGS(flac)
294 # some helper functions for codecs which use the ogg container format
295 AC_DEFUN([NEED_OGG_OBJECTS], [{
296 test "$HAVE_OGG" = 'yes' -a \( \
297 "$HAVE_VORBIS" = 'yes' \
298 -o "$HAVE_SPEEX" = 'yes' \
299 -o "$HAVE_OPUS" = 'yes' \
300 -o "$HAVE_FLAC" = 'yes' \
303 AC_DEFUN([NEED_VORBIS_OBJECTS], [{
304 test "$HAVE_OGG" = 'yes' -a "$HAVE_VORBIS" = 'yes'
306 AC_DEFUN([NEED_SPEEX_OBJECTS], [{
307 test "$HAVE_OGG" = 'yes' -a "$HAVE_SPEEX" = 'yes'
309 AC_DEFUN([NEED_OPUS_OBJECTS], [{
310 test "$HAVE_OGG" = 'yes' -a "$HAVE_OPUS" = 'yes'
312 AC_DEFUN([NEED_FLAC_OBJECTS], [{
313 test "$HAVE_OGG" = 'yes' -a "$HAVE_FLAC" = 'yes'
315 ########################################################################### faad
317 LIB_ARG_WITH([faad], [-lfaad])
319 AC_CHECK_HEADER(neaacdec.h, [], HAVE_FAAD=no)
320 AC_CHECK_LIB([faad], [NeAACDecOpen], [], HAVE_FAAD=no)
321 LIB_SUBST_FLAGS(faad)
323 ########################################################################### mad
325 LIB_ARG_WITH([mad], [-lmad])
327 AC_CHECK_HEADER(mad.h, [], HAVE_MAD=no)
328 AC_CHECK_LIB([mad], [mad_stream_init], [], HAVE_MAD=no)
331 ###################################################################### libid3tag
333 LIB_ARG_WITH([id3tag], [-lid3tag -lz])
335 AC_CHECK_HEADER(id3tag.h, [], HAVE_ID3TAG=no)
336 AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
337 LIB_SUBST_FLAGS(id3tag)
339 ########################################################################### oss
341 LIB_ARG_WITH([oss], [])
342 AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=yes], [HAVE_OSS=no])
343 AC_CHECK_LIB(ossaudio, _oss_ioctl, [oss_ldflags="$oss_ldflags -lossaudio"], [])
346 ########################################################################### alsa
348 LIB_ARG_WITH([alsa], [-lasound])
350 AC_CHECK_HEADER(alsa/asoundlib.h, [], HAVE_ALSA=no)
351 AC_CHECK_LIB([asound], [snd_pcm_open], [], HAVE_ALSA=no)
352 LIB_SUBST_FLAGS(alsa)
354 ######################################################################### pthread
356 LIB_ARG_WITH([pthread], [-lpthread])
358 AC_CHECK_HEADER(pthread.h, [], HAVE_PTHREAD=no)
359 AC_CHECK_LIB([pthread], [pthread_create], [], HAVE_PTHREAD=no)
360 LIB_SUBST_FLAGS(pthread)
362 ########################################################################### libao
364 LIB_ARG_WITH([ao], [-lao])
366 AC_CHECK_HEADER(ao/ao.h, [], HAVE_AO=no)
367 AC_CHECK_LIB([ao], [ao_initialize], [], HAVE_AO=no)
370 AC_DEFUN([NEED_AO_OBJECTS], [{ test $HAVE_AO = yes -a $HAVE_PTHREAD = yes; }])
371 ######################################################################## readline
373 AC_SEARCH_LIBS([tgetent], [tinfo curses terminfo termcap])
374 LIB_ARG_WITH([readline], [-lreadline $LIBS])
376 AC_CHECK_HEADER([readline/readline.h], [], [HAVE_READLINE=no])
377 AC_CHECK_LIB([readline], [rl_free_keymap], [], HAVE_READLINE=no)
380 [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
384 #include <readline/readline.h>
387 LIB_SUBST_FLAGS(readline)
389 ############################################################# libsamplerate
391 LIB_ARG_WITH([samplerate], [-lsamplerate])
393 AC_CHECK_HEADER(samplerate.h, [], HAVE_SAMPLERATE=no)
394 AC_CHECK_LIB([samplerate], [src_process], [], HAVE_SAMPLERATE=no)
395 LIB_SUBST_FLAGS(samplerate)
397 ########################################################################## mp4v2
399 LIB_ARG_WITH([mp4v2], [-lmp4v2])
401 AC_CHECK_HEADER([mp4v2/mp4v2.h], [], [HAVE_MP4V2=no])
402 AC_CHECK_LIB([mp4v2], [MP4Read], [], [HAVE_MP4V2=no])
403 LIB_SUBST_FLAGS(mp4v2)
405 ######################################################################### server
406 if test -n "$CRYPTOLIB" && test $HAVE_OSL = yes; then
408 executables="$executables server"
409 server_cmdline_objs="server"
410 server_errlist_objs="
450 if test "$CRYPTOLIB" = openssl; then
451 server_errlist_objs="$server_errlist_objs crypt"
453 server_errlist_objs="$server_errlist_objs gcrypt"
455 NEED_OGG_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh_common"
456 NEED_VORBIS_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh"
457 NEED_SPEEX_OBJECTS() && server_errlist_objs="$server_errlist_objs spx_afh spx_common"
458 NEED_OPUS_OBJECTS() && server_errlist_objs="$server_errlist_objs opus_afh opus_common"
459 NEED_FLAC_OBJECTS && server_errlist_objs="$server_errlist_objs flac_afh"
460 if test $HAVE_FAAD = yes && test $HAVE_MP4V2 = yes; then
461 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
463 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
464 AC_SUBST(server_objs, add_dot_o($server_objs))
465 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
466 objlist_to_errlist($server_errlist_objs), errors used by para_server)
470 ############################################################# client
471 if test -n "$CRYPTOLIB"; then
473 executables="$executables client"
474 client_cmdline_objs="client"
475 client_errlist_objs="
492 if test "$CRYPTOLIB" = openssl; then
493 client_errlist_objs="$client_errlist_objs crypt"
495 client_errlist_objs="$client_errlist_objs gcrypt"
497 if test $HAVE_READLINE = yes; then
498 client_errlist_objs="$client_errlist_objs interactive"
500 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
501 AC_SUBST(client_objs, add_dot_o($client_objs))
502 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
503 objlist_to_errlist($client_errlist_objs), errors used by para_client)
507 ############################################################# audiod
508 if test -n "$CRYPTOLIB"; then
510 executables="$executables audiod"
511 audiod_audio_formats="wma"
512 audiod_cmdline_objs="$audiod_cmdline_objs
524 audiod_errlist_objs="$audiod_errlist_objs
563 if test "$CRYPTOLIB" = openssl; then
564 audiod_errlist_objs="$audiod_errlist_objs crypt"
566 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
568 if test "$have_core_audio" = "yes"; then
569 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
570 audiod_cmdline_objs="$audiod_cmdline_objs osx_write"
572 NEED_VORBIS_OBJECTS && {
573 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
574 audiod_audio_formats="$audiod_audio_formats ogg"
576 NEED_SPEEX_OBJECTS && {
577 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
578 audiod_audio_formats="$audiod_audio_formats spx"
580 NEED_OPUS_OBJECTS && {
581 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
582 audiod_audio_formats="$audiod_audio_formats opus"
584 NEED_FLAC_OBJECTS && {
585 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
586 audiod_audio_formats="$audiod_audio_formats flac"
588 if test $HAVE_FAAD = yes; then
589 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
590 audiod_audio_formats="$audiod_audio_formats aac"
592 if test $HAVE_MAD = yes; then
593 audiod_audio_formats="$audiod_audio_formats mp3"
594 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
595 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
597 if test $HAVE_OSS = yes; then
598 audiod_errlist_objs="$audiod_errlist_objs oss_write"
599 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
601 if test $HAVE_ALSA = yes; then
602 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
603 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
606 audiod_errlist_objs="$audiod_errlist_objs ao_write"
607 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
609 if test $HAVE_SAMPLERATE = yes; then
610 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
611 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
613 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
614 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
615 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
616 errors used by para_audiod)
618 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
619 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
620 enum of audio formats supported by audiod)
621 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
622 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
626 ########################################################################### fade
627 if test $HAVE_OSS = yes -o $HAVE_ALSA = yes; then
629 executables="$executables fade"
630 fade_cmdline_objs="fade"
631 fade_errlist_objs="fade exec string fd version ggo"
632 if test $HAVE_OSS = yes; then
633 fade_errlist_objs="$fade_errlist_objs oss_mix"
634 mixers="${mixers}oss "
635 default_mixer="OSS_MIX"
637 if test $HAVE_ALSA = yes; then
638 fade_errlist_objs="$fade_errlist_objs alsa_mix"
639 mixers="${mixers}alsa "
640 default_mixer="ALSA_MIX"
642 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
643 AC_SUBST(fade_objs, add_dot_o($fade_objs))
644 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
645 objlist_to_errlist($fade_errlist_objs),
646 errors used by para_fade)
649 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
652 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
653 enum of supported mixers)
654 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
655 use this mixer if none was specified)
656 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
657 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
660 printf 'extern void '$i'_mix_init(struct mixer *); '
663 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
664 init functions of the supported mixers)
665 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
666 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
669 AC_MSG_WARN([no mixer support])
671 ########################################################################### gui
672 if test $HAVE_CURSES = yes; then
674 executables="$executables gui"
675 gui_cmdline_objs="gui"
690 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
691 AC_SUBST(gui_objs, add_dot_o($gui_objs))
692 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
693 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
696 AC_MSG_WARN([no curses lib, cannot build para_gui])
698 ######################################################################## filter
708 filter_errlist_objs="
733 filter_cmdline_objs="
740 NEED_VORBIS_OBJECTS && {
741 filters="$filters oggdec"
742 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
744 NEED_SPEEX_OBJECTS && {
745 filters="$filters spxdec"
746 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
748 NEED_OPUS_OBJECTS && {
749 filters="$filters opusdec"
750 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
752 NEED_FLAC_OBJECTS && {
753 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
754 filters="$filters flacdec"
756 if test $HAVE_FAAD = yes; then
757 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
758 filters="$filters aacdec"
760 if test $HAVE_MAD = yes; then
761 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
762 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
763 filters="$filters mp3dec"
765 if test $HAVE_SAMPLERATE = yes; then
766 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
767 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
768 filters="$filters resample"
770 filters="$(echo $filters)"
772 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
774 AC_SUBST(filter_objs, add_dot_o($filter_objs))
775 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
776 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
778 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
779 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
780 enum of supported filters)
781 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
782 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
783 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
784 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
785 ########################################################################## recv
815 NEED_OGG_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
816 NEED_VORBIS_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh"
817 NEED_SPEEX_OBJECTS && recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
818 NEED_OPUS_OBJECTS && recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
819 NEED_FLAC_OBJECTS && recv_errlist_objs="$recv_errlist_objs flac_afh"
821 if test $HAVE_FAAD = yes -a $HAVE_MP4V2 = yes; then
822 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
824 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
825 AC_SUBST(receivers, "http dccp udp afh")
826 AC_SUBST(recv_objs, add_dot_o($recv_objs))
827 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
828 errors used by para_recv)
829 ########################################################################### afh
830 audio_format_handlers="mp3 wma"
831 afh_cmdline_objs="afh"
844 NEED_OGG_OBJECTS && afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
845 NEED_VORBIS_OBJECTS && {
846 afh_errlist_objs="$afh_errlist_objs ogg_afh"
847 audio_format_handlers="$audio_format_handlers ogg"
849 NEED_SPEEX_OBJECTS && {
850 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
851 audio_format_handlers="$audio_format_handlers spx"
853 NEED_OPUS_OBJECTS && {
854 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
855 audio_format_handlers="$audio_format_handlers opus"
857 NEED_FLAC_OBJECTS && {
858 afh_errlist_objs="$afh_errlist_objs flac_afh"
859 audio_format_handlers="$audio_format_handlers flac"
861 if test $HAVE_FAAD = yes -a $HAVE_MP4V2 = yes; then
862 afh_errlist_objs="$afh_errlist_objs aac_afh aac_common"
863 audio_format_handlers="$audio_format_handlers aac"
866 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
868 AC_SUBST(afh_objs, add_dot_o($afh_objs))
869 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
870 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
871 ########################################################################## play
917 if test "$have_core_audio" = "yes"; then
918 play_errlist_objs="$play_errlist_objs osx_write ipc"
919 play_cmdline_objs="$play_cmdline_objs osx_write"
921 NEED_OGG_OBJECTS && play_errlist_objs="$play_errlist_objs ogg_afh_common"
922 NEED_VORBIS_OBJECTS && {
923 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
925 NEED_SPEEX_OBJECTS && {
926 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
929 play_errlist_objs="$play_errlist_objs
934 NEED_FLAC_OBJECTS && {
935 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
937 if test $HAVE_FAAD = yes; then
938 play_errlist_objs="$play_errlist_objs aacdec_filter"
940 if test $HAVE_MP4V2 = yes; then
941 play_errlist_objs="$play_errlist_objs aac_afh"
943 if test $HAVE_MP4V2 = yes || test $HAVE_FAAD = yes; then
944 play_errlist_objs="$play_errlist_objs aac_common"
946 if test $HAVE_MAD = yes; then
947 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
948 play_errlist_objs="$play_errlist_objs mp3dec_filter"
950 if test $HAVE_OSS = yes; then
951 play_errlist_objs="$play_errlist_objs oss_write"
952 play_cmdline_objs="$play_cmdline_objs oss_write"
954 if test $HAVE_ALSA = yes; then
955 play_errlist_objs="$play_errlist_objs alsa_write"
956 play_cmdline_objs="$play_cmdline_objs alsa_write"
959 play_errlist_objs="$play_errlist_objs ao_write"
960 play_cmdline_objs="$play_cmdline_objs ao_write"
962 if test $HAVE_READLINE = yes; then
963 play_errlist_objs="$play_errlist_objs interactive"
965 if test $HAVE_SAMPLERATE = yes; then
966 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
967 play_cmdline_objs="$play_cmdline_objs resample_filter"
970 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
971 AC_SUBST(play_objs, add_dot_o($play_objs))
972 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
973 objlist_to_errlist($play_errlist_objs), errors used by para_play)
974 ######################################################################### write
994 default_writer="FILE_WRITE"
996 if test "$have_core_audio" = "yes"; then
997 write_errlist_objs="$write_errlist_objs osx_write ipc"
998 write_cmdline_objs="$write_cmdline_objs osx_write"
999 writers="$writers osx"
1000 default_writer="OSX_WRITE"
1002 NEED_AO_OBJECTS && {
1003 write_errlist_objs="$write_errlist_objs ao_write"
1004 write_cmdline_objs="$write_cmdline_objs ao_write"
1005 writers="$writers ao"
1006 default_writer="AO_WRITE"
1008 if test $HAVE_OSS = yes; then
1009 write_errlist_objs="$write_errlist_objs oss_write"
1010 write_cmdline_objs="$write_cmdline_objs oss_write"
1011 writers="$writers oss"
1012 default_writer="OSS_WRITE"
1014 if test $HAVE_ALSA = yes; then
1015 write_errlist_objs="$write_errlist_objs alsa_write"
1016 write_cmdline_objs="$write_cmdline_objs alsa_write"
1017 writers="$writers alsa"
1018 default_writer="ALSA_WRITE"
1021 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
1022 AC_SUBST(write_objs, add_dot_o($write_objs))
1023 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1024 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1025 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1026 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1027 enum of supported writers)
1028 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1029 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1030 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1031 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1032 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1033 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1034 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1035 ######################################################################## audioc
1036 audioc_cmdline_objs="audioc"
1037 audioc_errlist_objs="
1045 if test $HAVE_READLINE = yes; then
1046 audioc_errlist_objs="$audioc_errlist_objs
1053 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1054 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1055 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1056 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1057 ############################################################# error2.h
1058 # these are always built
1061 $filter_errlist_objs
1062 $audioc_errlist_objs
1068 # optional executables
1069 if test "$build_server" = "yes"; then
1070 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1072 if test "$build_gui" = "yes"; then
1073 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1075 if test "$build_fade" = "yes"; then
1076 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1078 if test "$build_client" = "yes"; then
1079 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1081 if test "$build_audiod" = "yes"; then
1082 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1085 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1087 object_executable_matrix=
1088 for i in $executables; do
1089 eval objs=\$${i}_errlist_objs
1090 object_executable_matrix="$object_executable_matrix $i: $objs"
1092 # use echo to replace newlines by space
1093 AC_SUBST(object_executable_matrix, $(echo $object_executable_matrix))
1095 SS=$(for obj in $all_errlist_objs; do
1096 printf '%s' " SS_$obj,"; done | tr 'a-z' 'A-Z')
1097 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1098 [enum {$SS NUM_SS}],
1099 [list of all objects that use the paraslash error facility]
1101 ################################################################## status items
1103 status_items="basename status num_played mtime bitrate frequency file_size
1104 status_flags format score techinfo afs_mode
1105 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1106 offset seconds_total stream_start current_time audiod_uptime image_id
1107 lyrics_id duration directory lyrics_name image_name path hash channels
1108 last_played num_chunks chunk_time amplification artist title year album
1112 for i in $status_items; do
1113 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1115 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1116 [enum of all status items])
1119 for i in $status_items; do
1120 result="$result \"$i\", "
1122 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1123 [char * array of all status items])
1125 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1126 [formats supported by para_server and para_afh])
1128 AC_SUBST(executables)
1132 paraslash configuration:
1133 ~~~~~~~~~~~~~~~~~~~~~~~~
1134 crypto lib: ${CRYPTOLIB:-[none]}
1135 unix socket credentials: $have_ucred
1136 readline (interactive CLIs): $HAVE_READLINE
1137 id3 version 2 support: $HAVE_ID3TAG
1141 audio format handlers: $audio_format_handlers
1142 filters: $(echo $filters)
1145 para_server: $build_server
1146 para_gui: $build_gui
1147 para_fade: $build_fade
1148 para_client: $build_client
1149 para_audiod: $build_audiod