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)
120 ######################################################################### gcrypt
123 LIB_ARG_WITH([gcrypt], [-lgcrypt])
124 AC_CHECK_HEADER(gcrypt.h, [], [HAVE_GCRYPT=no])
125 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [HAVE_GCRYPT=no])
126 LIB_SUBST_FLAGS(gcrypt)
128 ######################################################################### crypto
129 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
130 Force using crypto library "lib". This package requires either
131 openssl or libgcrypt being installed. Possible values for "lib"
132 are thus "openssl" and "gcrypt". If this option is not given,
133 openssl is tried first. If openssl was not found, gcrypt is
136 CRYPTOLIB="$enable_cryptolib"
137 case "$enable_cryptolib" in
139 test $HAVE_OPENSSL = no && AC_MSG_ERROR(openssl not found)
140 crypto_ldflags="$openssl_ldflags"
143 test $HAVE_GCRYPT = no && AC_MSG_ERROR(gcrypt not found)
144 crypto_ldflags="$gcrypt_ldflags"
148 if test $HAVE_GCRYPT = yes; then
150 crypto_ldflags="$gcrypt_ldflags"
152 if test $HAVE_OPENSSL = yes; then
154 crypto_ldflags="$openssl_ldflags"
158 AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib])
161 AC_SUBST(crypto_ldflags)
162 ########################################################################## iconv
165 AC_SEARCH_LIBS([libiconv_open], [iconv],
166 [iconv_ldflags="$LIBS"],
169 AC_SUBST(iconv_ldflags)
170 AC_MSG_CHECKING([whether iconv needs const char ** cast])
175 size_t iconv(iconv_t cd, const char **inbuf,
176 size_t *inbytesleft, char **outbuf,
177 size_t *outbytesleft);
180 [cast='(const char **)'; msg=yes],
183 AC_DEFINE_UNQUOTED(ICONV_CAST, $cast, [cast for second arg to iconv()])
186 ########################################################################### ucred
187 AC_MSG_CHECKING(for struct ucred)
188 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
189 #include <sys/types.h>
190 #include <sys/socket.h>
192 struct ucred sucred; sucred.pid=0;
193 ]])],[have_ucred=yes],[have_ucred=no])
194 AC_MSG_RESULT($have_ucred)
195 if test ${have_ucred} = yes; then
196 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
198 ########################################################################### gengetopt
199 echo 'option "z" z "" flag off' | $GENGETOPT --file-name conftest-ggo &&
201 [gengetopt_args_info_description],
202 [ggo_descriptions_declared=yes],
203 [ggo_descriptions_declared=no],
204 [#include "conftest-ggo.h"]
206 AC_SUBST(ggo_descriptions_declared)
207 ########################################################################### curses
209 LIB_ARG_WITH([curses], [])
211 AC_CHECK_HEADER(curses.h, [], [HAVE_CURSES=no])
212 AC_SEARCH_LIBS([initscr], [ncursesw curses], [], [HAVE_CURSES=no])
213 curses_ldflags="$curses_ldflags $LIBS"
214 LIB_SUBST_FLAGS(curses)
216 ########################################################################### ip_mreqn
217 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
218 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
224 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
225 AC_MSG_RESULT($have_ip_mreqn)
226 if test ${have_ip_mreqn} = yes; then
227 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
229 ########################################################################### osx
231 AC_MSG_CHECKING(for CoreAudio (MacOs))
232 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
233 #include <CoreAudio/CoreAudio.h>
236 ]])],[have_core_audio=yes],[have_core_audio=no])
237 AC_MSG_RESULT($have_core_audio)
238 if test ${have_core_audio} = yes; then
239 f1="-framework CoreAudio"
240 f2="-framework AudioToolbox"
241 f3="-framework AudioUnit"
242 f4="-framework CoreServices"
243 core_audio_ldflags="$f1 $f2 $f3 $f4"
244 AC_SUBST(core_audio_ldflags)
245 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
247 ########################################################################### ogg
249 LIB_ARG_WITH([ogg], [-logg])
251 AC_CHECK_HEADERS([ogg/ogg.h], [], [HAVE_OGG=no])
252 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [HAVE_OGG=no])
253 AC_CHECK_LIB([ogg], [ogg_stream_flush_fill], [
254 AC_DEFINE(HAVE_OGG_STREAM_FLUSH_FILL, 1, [libogg >= 1.3.0])])
257 ######################################################################### vorbis
259 LIB_ARG_WITH([vorbis], [-lvorbis -lvorbisfile])
261 AC_CHECK_HEADERS([vorbis/codec.h], [], [HAVE_VORBIS=no])
262 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [HAVE_VORBIS=no])
263 LIB_SUBST_FLAGS(vorbis)
265 ######################################################################### speex
267 LIB_ARG_WITH([speex], [-lspeex])
269 AC_CHECK_HEADERS([speex/speex.h], [], [HAVE_SPEEX=no])
270 AC_CHECK_LIB([speex], [speex_decoder_init], [], [HAVE_SPEEX=no])
271 LIB_SUBST_FLAGS(speex)
273 ######################################################################### opus
275 LIB_ARG_WITH([opus], [-lopus])
277 AC_CHECK_HEADERS([opus/opus.h], [], [HAVE_OPUS=no])
278 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [HAVE_OPUS=no])
279 LIB_SUBST_FLAGS(opus)
281 ########################################################################### flac
283 LIB_ARG_WITH([flac], [-lFLAC -lm])
285 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], HAVE_FLAC=no)
286 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], HAVE_FLAC=no)
287 LIB_SUBST_FLAGS(flac)
290 # some helper functions for codecs which use the ogg container format
291 AC_DEFUN([NEED_OGG_OBJECTS], [{
292 test "$HAVE_OGG" = 'yes' -a \( \
293 "$HAVE_VORBIS" = 'yes' \
294 -o "$HAVE_SPEEX" = 'yes' \
295 -o "$HAVE_OPUS" = 'yes' \
296 -o "$HAVE_FLAC" = 'yes' \
299 AC_DEFUN([NEED_VORBIS_OBJECTS], [{
300 test "$HAVE_OGG" = 'yes' -a "$HAVE_VORBIS" = 'yes'
302 AC_DEFUN([NEED_SPEEX_OBJECTS], [{
303 test "$HAVE_OGG" = 'yes' -a "$HAVE_SPEEX" = 'yes'
305 AC_DEFUN([NEED_OPUS_OBJECTS], [{
306 test "$HAVE_OGG" = 'yes' -a "$HAVE_OPUS" = 'yes'
308 AC_DEFUN([NEED_FLAC_OBJECTS], [{
309 test "$HAVE_OGG" = 'yes' -a "$HAVE_FLAC" = 'yes'
311 ########################################################################### faad
313 LIB_ARG_WITH([faad], [-lfaad])
315 AC_CHECK_HEADER(neaacdec.h, [], HAVE_FAAD=no)
316 AC_CHECK_LIB([faad], [NeAACDecOpen], [], HAVE_FAAD=no)
317 LIB_SUBST_FLAGS(faad)
319 ########################################################################### mad
321 LIB_ARG_WITH([mad], [-lmad])
323 AC_CHECK_HEADER(mad.h, [], HAVE_MAD=no)
324 AC_CHECK_LIB([mad], [mad_stream_init], [], HAVE_MAD=no)
327 ###################################################################### libid3tag
329 LIB_ARG_WITH([id3tag], [-lid3tag -lz])
331 AC_CHECK_HEADER(id3tag.h, [], HAVE_ID3TAG=no)
332 AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
333 LIB_SUBST_FLAGS(id3tag)
335 ########################################################################### oss
337 LIB_ARG_WITH([oss], [])
338 AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=yes], [HAVE_OSS=no])
339 AC_CHECK_LIB(ossaudio, _oss_ioctl, [oss_ldflags="$oss_ldflags -lossaudio"], [])
342 ########################################################################### alsa
344 LIB_ARG_WITH([alsa], [-lasound])
346 AC_CHECK_HEADER(alsa/asoundlib.h, [], HAVE_ALSA=no)
347 AC_CHECK_LIB([asound], [snd_pcm_open], [], HAVE_ALSA=no)
348 LIB_SUBST_FLAGS(alsa)
350 ######################################################################### pthread
352 LIB_ARG_WITH([pthread], [-lpthread])
354 AC_CHECK_HEADER(pthread.h, [], HAVE_PTHREAD=no)
355 AC_CHECK_LIB([pthread], [pthread_create], [], HAVE_PTHREAD=no)
356 LIB_SUBST_FLAGS(pthread)
358 ########################################################################### libao
360 LIB_ARG_WITH([ao], [-lao])
362 AC_CHECK_HEADER(ao/ao.h, [], HAVE_AO=no)
363 AC_CHECK_LIB([ao], [ao_initialize], [], HAVE_AO=no)
366 AC_DEFUN([NEED_AO_OBJECTS], [{ test $HAVE_AO = yes -a $HAVE_PTHREAD = yes; }])
367 ######################################################################## readline
369 AC_SEARCH_LIBS([tgetent], [tinfo curses terminfo termcap])
370 LIB_ARG_WITH([readline], [-lreadline $LIBS])
372 AC_CHECK_HEADER([readline/readline.h], [], [HAVE_READLINE=no])
373 AC_CHECK_LIB([readline], [rl_free_keymap], [], HAVE_READLINE=no)
376 [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
380 #include <readline/readline.h>
383 LIB_SUBST_FLAGS(readline)
385 ############################################################# libsamplerate
387 LIB_ARG_WITH([samplerate], [-lsamplerate])
389 AC_CHECK_HEADER(samplerate.h, [], HAVE_SAMPLERATE=no)
390 AC_CHECK_LIB([samplerate], [src_process], [], HAVE_SAMPLERATE=no)
391 LIB_SUBST_FLAGS(samplerate)
393 ########################################################################## mp4v2
395 LIB_ARG_WITH([mp4v2], [-lmp4v2])
397 AC_CHECK_HEADER([mp4v2/mp4v2.h], [], [HAVE_MP4V2=no])
398 AC_CHECK_LIB([mp4v2], [MP4Read], [], [HAVE_MP4V2=no])
399 LIB_SUBST_FLAGS(mp4v2)
401 ######################################################################### server
402 if test -n "$CRYPTOLIB" && test $HAVE_OSL = yes; then
404 executables="$executables server"
405 server_cmdline_objs="server"
406 server_errlist_objs="
445 if test "$CRYPTOLIB" = openssl; then
446 server_errlist_objs="$server_errlist_objs crypt"
448 server_errlist_objs="$server_errlist_objs gcrypt"
450 NEED_OGG_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh_common"
451 NEED_VORBIS_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh"
452 NEED_SPEEX_OBJECTS() && server_errlist_objs="$server_errlist_objs spx_afh spx_common"
453 NEED_OPUS_OBJECTS() && server_errlist_objs="$server_errlist_objs opus_afh opus_common"
454 NEED_FLAC_OBJECTS && server_errlist_objs="$server_errlist_objs flac_afh"
455 if test $HAVE_FAAD = yes && test $HAVE_MP4V2 = yes; then
456 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
458 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
459 AC_SUBST(server_objs, add_dot_o($server_objs))
460 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
461 objlist_to_errlist($server_errlist_objs), errors used by para_server)
465 ############################################################# client
466 if test -n "$CRYPTOLIB"; then
468 executables="$executables client"
469 client_cmdline_objs="client"
470 client_errlist_objs="
486 if test "$CRYPTOLIB" = openssl; then
487 client_errlist_objs="$client_errlist_objs crypt"
489 client_errlist_objs="$client_errlist_objs gcrypt"
491 if test $HAVE_READLINE = yes; then
492 client_errlist_objs="$client_errlist_objs interactive"
494 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
495 AC_SUBST(client_objs, add_dot_o($client_objs))
496 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
497 objlist_to_errlist($client_errlist_objs), errors used by para_client)
501 ############################################################# audiod
502 if test -n "$CRYPTOLIB"; then
504 executables="$executables audiod"
505 audiod_audio_formats="wma"
506 audiod_cmdline_objs="$audiod_cmdline_objs
518 audiod_errlist_objs="$audiod_errlist_objs
556 if test "$CRYPTOLIB" = openssl; then
557 audiod_errlist_objs="$audiod_errlist_objs crypt"
559 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
561 if test "$have_core_audio" = "yes"; then
562 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
563 audiod_cmdline_objs="$audiod_cmdline_objs osx_write"
565 NEED_VORBIS_OBJECTS && {
566 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
567 audiod_audio_formats="$audiod_audio_formats ogg"
569 NEED_SPEEX_OBJECTS && {
570 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
571 audiod_audio_formats="$audiod_audio_formats spx"
573 NEED_OPUS_OBJECTS && {
574 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
575 audiod_audio_formats="$audiod_audio_formats opus"
577 NEED_FLAC_OBJECTS && {
578 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
579 audiod_audio_formats="$audiod_audio_formats flac"
581 if test $HAVE_FAAD = yes; then
582 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
583 audiod_audio_formats="$audiod_audio_formats aac"
585 if test $HAVE_MAD = yes; then
586 audiod_audio_formats="$audiod_audio_formats mp3"
587 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
588 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
590 if test $HAVE_OSS = yes; then
591 audiod_errlist_objs="$audiod_errlist_objs oss_write"
592 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
594 if test $HAVE_ALSA = yes; then
595 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
596 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
599 audiod_errlist_objs="$audiod_errlist_objs ao_write"
600 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
602 if test $HAVE_SAMPLERATE = yes; then
603 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
604 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
606 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
607 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
608 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
609 errors used by para_audiod)
611 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
612 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
613 enum of audio formats supported by audiod)
614 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
615 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
619 ########################################################################### fade
620 if test $HAVE_OSS = yes -o $HAVE_ALSA = yes; then
622 executables="$executables fade"
623 fade_cmdline_objs="fade"
624 fade_errlist_objs="fade exec string fd version ggo"
625 if test $HAVE_OSS = yes; then
626 fade_errlist_objs="$fade_errlist_objs oss_mix"
627 mixers="${mixers}oss "
628 default_mixer="OSS_MIX"
630 if test $HAVE_ALSA = yes; then
631 fade_errlist_objs="$fade_errlist_objs alsa_mix"
632 mixers="${mixers}alsa "
633 default_mixer="ALSA_MIX"
635 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
636 AC_SUBST(fade_objs, add_dot_o($fade_objs))
637 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
638 objlist_to_errlist($fade_errlist_objs),
639 errors used by para_fade)
642 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
645 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
646 enum of supported mixers)
647 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
648 use this mixer if none was specified)
649 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
650 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
653 printf 'extern void '$i'_mix_init(struct mixer *); '
656 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
657 init functions of the supported mixers)
658 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
659 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
662 AC_MSG_WARN([no mixer support])
664 ########################################################################### gui
665 if test $HAVE_CURSES = yes; then
667 executables="$executables gui"
668 gui_cmdline_objs="gui"
683 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
684 AC_SUBST(gui_objs, add_dot_o($gui_objs))
685 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
686 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
689 AC_MSG_WARN([no curses lib, cannot build para_gui])
691 ######################################################################## filter
701 filter_errlist_objs="
726 filter_cmdline_objs="
733 NEED_VORBIS_OBJECTS && {
734 filters="$filters oggdec"
735 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
737 NEED_SPEEX_OBJECTS && {
738 filters="$filters spxdec"
739 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
741 NEED_OPUS_OBJECTS && {
742 filters="$filters opusdec"
743 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
745 NEED_FLAC_OBJECTS && {
746 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
747 filters="$filters flacdec"
749 if test $HAVE_FAAD = yes; then
750 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
751 filters="$filters aacdec"
753 if test $HAVE_MAD = yes; then
754 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
755 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
756 filters="$filters mp3dec"
758 if test $HAVE_SAMPLERATE = yes; then
759 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
760 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
761 filters="$filters resample"
763 filters="$(echo $filters)"
765 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
767 AC_SUBST(filter_objs, add_dot_o($filter_objs))
768 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
769 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
771 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
772 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
773 enum of supported filters)
774 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
775 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
776 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
777 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
778 ########################################################################## recv
808 NEED_OGG_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
809 NEED_VORBIS_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh"
810 NEED_SPEEX_OBJECTS && recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
811 NEED_OPUS_OBJECTS && recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
812 NEED_FLAC_OBJECTS && recv_errlist_objs="$recv_errlist_objs flac_afh"
814 if test $HAVE_FAAD = yes -a $HAVE_MP4V2 = yes; then
815 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
817 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
818 AC_SUBST(receivers, "http dccp udp afh")
819 AC_SUBST(recv_objs, add_dot_o($recv_objs))
820 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
821 errors used by para_recv)
822 ########################################################################### afh
823 audio_format_handlers="mp3 wma"
824 afh_cmdline_objs="afh"
837 NEED_OGG_OBJECTS && afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
838 NEED_VORBIS_OBJECTS && {
839 afh_errlist_objs="$afh_errlist_objs ogg_afh"
840 audio_format_handlers="$audio_format_handlers ogg"
842 NEED_SPEEX_OBJECTS && {
843 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
844 audio_format_handlers="$audio_format_handlers spx"
846 NEED_OPUS_OBJECTS && {
847 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
848 audio_format_handlers="$audio_format_handlers opus"
850 NEED_FLAC_OBJECTS && {
851 afh_errlist_objs="$afh_errlist_objs flac_afh"
852 audio_format_handlers="$audio_format_handlers flac"
854 if test $HAVE_FAAD = yes -a $HAVE_MP4V2 = yes; then
855 afh_errlist_objs="$afh_errlist_objs aac_afh aac_common"
856 audio_format_handlers="$audio_format_handlers aac"
859 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
861 AC_SUBST(afh_objs, add_dot_o($afh_objs))
862 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
863 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
864 ########################################################################## play
910 if test "$have_core_audio" = "yes"; then
911 play_errlist_objs="$play_errlist_objs osx_write ipc"
912 play_cmdline_objs="$play_cmdline_objs osx_write"
914 NEED_OGG_OBJECTS && play_errlist_objs="$play_errlist_objs ogg_afh_common"
915 NEED_VORBIS_OBJECTS && {
916 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
918 NEED_SPEEX_OBJECTS && {
919 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
922 play_errlist_objs="$play_errlist_objs
927 NEED_FLAC_OBJECTS && {
928 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
930 if test $HAVE_FAAD = yes; then
931 play_errlist_objs="$play_errlist_objs aacdec_filter"
933 if test $HAVE_MP4V2 = yes; then
934 play_errlist_objs="$play_errlist_objs aac_afh"
936 if test $HAVE_MP4V2 = yes || test $HAVE_FAAD = yes; then
937 play_errlist_objs="$play_errlist_objs aac_common"
939 if test $HAVE_MAD = yes; then
940 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
941 play_errlist_objs="$play_errlist_objs mp3dec_filter"
943 if test $HAVE_OSS = yes; then
944 play_errlist_objs="$play_errlist_objs oss_write"
945 play_cmdline_objs="$play_cmdline_objs oss_write"
947 if test $HAVE_ALSA = yes; then
948 play_errlist_objs="$play_errlist_objs alsa_write"
949 play_cmdline_objs="$play_cmdline_objs alsa_write"
952 play_errlist_objs="$play_errlist_objs ao_write"
953 play_cmdline_objs="$play_cmdline_objs ao_write"
955 if test $HAVE_READLINE = yes; then
956 play_errlist_objs="$play_errlist_objs interactive"
958 if test $HAVE_SAMPLERATE = yes; then
959 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
960 play_cmdline_objs="$play_cmdline_objs resample_filter"
963 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
964 AC_SUBST(play_objs, add_dot_o($play_objs))
965 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
966 objlist_to_errlist($play_errlist_objs), errors used by para_play)
967 ######################################################################### write
987 default_writer="FILE_WRITE"
989 if test "$have_core_audio" = "yes"; then
990 write_errlist_objs="$write_errlist_objs osx_write ipc"
991 write_cmdline_objs="$write_cmdline_objs osx_write"
992 writers="$writers osx"
993 default_writer="OSX_WRITE"
996 write_errlist_objs="$write_errlist_objs ao_write"
997 write_cmdline_objs="$write_cmdline_objs ao_write"
998 writers="$writers ao"
999 default_writer="AO_WRITE"
1001 if test $HAVE_OSS = yes; then
1002 write_errlist_objs="$write_errlist_objs oss_write"
1003 write_cmdline_objs="$write_cmdline_objs oss_write"
1004 writers="$writers oss"
1005 default_writer="OSS_WRITE"
1007 if test $HAVE_ALSA = yes; then
1008 write_errlist_objs="$write_errlist_objs alsa_write"
1009 write_cmdline_objs="$write_cmdline_objs alsa_write"
1010 writers="$writers alsa"
1011 default_writer="ALSA_WRITE"
1014 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
1015 AC_SUBST(write_objs, add_dot_o($write_objs))
1016 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1017 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1018 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1019 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1020 enum of supported writers)
1021 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1022 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1023 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1024 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1025 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1026 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1027 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1028 ######################################################################## audioc
1029 audioc_cmdline_objs="audioc"
1030 audioc_errlist_objs="
1038 if test $HAVE_READLINE = yes; then
1039 audioc_errlist_objs="$audioc_errlist_objs
1046 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1047 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1048 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1049 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1050 ############################################################# error2.h
1051 # these are always built
1054 $filter_errlist_objs
1055 $audioc_errlist_objs
1061 # optional executables
1062 if test "$build_server" = "yes"; then
1063 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1065 if test "$build_gui" = "yes"; then
1066 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1068 if test "$build_fade" = "yes"; then
1069 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1071 if test "$build_client" = "yes"; then
1072 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1074 if test "$build_audiod" = "yes"; then
1075 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1078 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1080 object_executable_matrix=
1081 for i in $executables; do
1082 eval objs=\$${i}_errlist_objs
1083 object_executable_matrix="$object_executable_matrix $i: $objs"
1085 # use echo to replace newlines by space
1086 AC_SUBST(object_executable_matrix, $(echo $object_executable_matrix))
1088 SS=$(for obj in $all_errlist_objs; do
1089 printf '%s' " SS_$obj,"; done | tr 'a-z' 'A-Z')
1090 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1091 [enum {$SS NUM_SS}],
1092 [list of all objects that use the paraslash error facility]
1094 ################################################################## status items
1096 status_items="basename status num_played mtime bitrate frequency file_size
1097 status_flags format score techinfo afs_mode
1098 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1099 offset seconds_total stream_start current_time audiod_uptime image_id
1100 lyrics_id duration directory lyrics_name image_name path hash channels
1101 last_played num_chunks chunk_time amplification artist title year album
1105 for i in $status_items; do
1106 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1108 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1109 [enum of all status items])
1112 for i in $status_items; do
1113 result="$result \"$i\", "
1115 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1116 [char * array of all status items])
1118 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1119 [formats supported by para_server and para_afh])
1121 AC_SUBST(executables)
1125 paraslash configuration:
1126 ~~~~~~~~~~~~~~~~~~~~~~~~
1127 crypto lib: ${CRYPTOLIB:-[none]}
1128 unix socket credentials: $have_ucred
1129 readline (interactive CLIs): $HAVE_READLINE
1130 id3 version 2 support: $HAVE_ID3TAG
1134 audio format handlers: $audio_format_handlers
1135 filters: $(echo $filters)
1138 para_server: $build_server
1139 para_gui: $build_gui
1140 para_fade: $build_fade
1141 para_client: $build_client
1142 para_audiod: $build_audiod