3 AC_INIT([paraslash], [m4_esyscmd_s(./GIT-VERSION-GEN)],
4 [maan@tuebingen.mpg.de], [], [http://people.tuebingen.mpg.de/maan/paraslash/])
5 AC_CONFIG_HEADERS([config.h])
7 AC_CONFIG_FILES([Makefile])
8 AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
9 AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
10 AC_DEFUN([LIB_ARG_WITH], [
11 AC_ARG_WITH($1-headers, [AS_HELP_STRING(--with-$1-headers=dir,
12 [look for $1 headers in dir])])
13 AC_ARG_WITH($1-libs, [AS_HELP_STRING(--with-$1-libs=dir,
14 [look for $1 libraries in dir])])
15 if test -n "$with_$1_headers"; then
16 $1_cppflags="-I$with_$1_headers"
17 CPPFLAGS="$CPPFLAGS $$1_cppflags"
19 if test -n "$with_$1_libs"; then
20 $1_ldflags="-L$with_$1_libs $2"
24 LDFLAGS="$LDFLAGS $$1_ldflags"
27 AC_DEFUN([STASH_FLAGS], [
28 OLD_CPPFLAGS="$CPPFLAGS"
29 OLD_LDFLAGS="$LDFLAGS"
33 AC_DEFUN([UNSTASH_FLAGS], [
34 CPPFLAGS="$OLD_CPPFLAGS"
35 LDFLAGS="$OLD_LDFLAGS"
38 AC_DEFUN([LIB_SUBST_FLAGS], [
39 if test "$HAVE_[]m4_toupper([$1])" = 'yes'; then
40 AC_DEFINE(HAVE_[]m4_toupper([$1]), 1,
41 define to 1 to turn on $1 support)
46 AC_SUBST(HAVE_[]m4_toupper([$1]))
51 AC_USE_SYSTEM_EXTENSIONS
54 AC_PATH_PROG([GENGETOPT], [gengetopt])
55 test -z "$GENGETOPT" && AC_MSG_ERROR(
56 [gengetopt is required to build this package])
58 AC_PATH_PROG([M4], [m4])
59 test -z "$M4" && AC_MSG_ERROR(
60 [The m4 macro processor is required to build this package])
62 AC_PATH_PROG([HELP2MAN], [help2man])
63 test -z "$HELP2MAN" && AC_MSG_ERROR(
64 [help2man is required to build this package])
66 AC_PATH_PROG([INSTALL], [install])
67 test -z "$INSTALL" && AC_MSG_ERROR(
68 [The install program is required to build this package])
73 executables="recv filter audioc write afh play"
74 ################################################################## clock_gettime
76 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
77 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
79 if test -n "$clock_gettime_lib"; then
80 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
81 define to 1 if clock_gettime() is supported])
83 if test "$clock_gettime_lib" = "rt"; then
84 AC_SUBST(clock_gettime_ldflags, -lrt)
87 ########################################################################### osl
89 LIB_ARG_WITH([osl], [-losl])
91 AC_CHECK_HEADER(osl.h, [], [HAVE_OSL=no])
92 AC_CHECK_LIB([osl], [osl_open_table], [], [HAVE_OSL=no])
95 ######################################################################## openssl
98 LIB_ARG_WITH([openssl], [-lssl -lcrypto])
99 AC_CHECK_HEADER(openssl/ssl.h, [], [HAVE_OPENSSL=no])
100 AC_CHECK_LIB([crypto], [RAND_bytes], [], [HAVE_OPENSSL=no])
101 LIB_SUBST_FLAGS(openssl)
103 ######################################################################### gcrypt
106 LIB_ARG_WITH([gcrypt], [-lgcrypt])
107 AC_CHECK_HEADER(gcrypt.h, [], [HAVE_GCRYPT=no])
108 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [HAVE_GCRYPT=no])
109 LIB_SUBST_FLAGS(gcrypt)
111 ######################################################################### crypto
112 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
113 Force using crypto library "lib". This package requires either
114 openssl or libgcrypt being installed. Possible values for "lib"
115 are thus "openssl" and "gcrypt". If this option is not given,
116 openssl is tried first. If openssl was not found, gcrypt is
119 CRYPTOLIB="$enable_cryptolib"
120 case "$enable_cryptolib" in
122 test $HAVE_OPENSSL = no && AC_MSG_ERROR(openssl not found)
123 crypto_ldflags="$openssl_ldflags"
126 test $HAVE_GCRYPT = no && AC_MSG_ERROR(gcrypt not found)
127 crypto_ldflags="$gcrypt_ldflags"
131 if test $HAVE_GCRYPT = yes; then
133 crypto_ldflags="$gcrypt_ldflags"
135 if test $HAVE_OPENSSL = yes; then
137 crypto_ldflags="$openssl_ldflags"
141 AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib])
144 AC_SUBST(crypto_ldflags)
145 ########################################################################## iconv
148 AC_SEARCH_LIBS([libiconv_open], [iconv],
149 [iconv_ldflags="$LIBS"],
152 AC_SUBST(iconv_ldflags)
153 AC_MSG_CHECKING([whether iconv needs const char ** cast])
158 size_t iconv(iconv_t cd, const char **inbuf,
159 size_t *inbytesleft, char **outbuf,
160 size_t *outbytesleft);
163 [cast='(const char **)'; msg=yes],
166 AC_DEFINE_UNQUOTED(ICONV_CAST, $cast, [cast for second arg to iconv()])
169 ########################################################################### ucred
170 AC_MSG_CHECKING(for struct ucred)
171 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
172 #include <sys/types.h>
173 #include <sys/socket.h>
175 struct ucred sucred; sucred.pid=0;
176 ]])],[have_ucred=yes],[have_ucred=no])
177 AC_MSG_RESULT($have_ucred)
178 if test ${have_ucred} = yes; then
179 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
181 ########################################################################### gengetopt
182 echo 'option "z" z "" flag off' | $GENGETOPT --file-name conftest-ggo &&
184 [gengetopt_args_info_description],
185 [ggo_descriptions_declared=yes],
186 [ggo_descriptions_declared=no],
187 [#include "conftest-ggo.h"]
189 AC_SUBST(ggo_descriptions_declared)
190 ########################################################################### curses
192 LIB_ARG_WITH([curses], [])
194 AC_CHECK_HEADER(curses.h, [], [HAVE_CURSES=no])
195 AC_SEARCH_LIBS([initscr], [ncursesw curses], [], [HAVE_CURSES=no])
196 curses_ldflags="$curses_ldflags $LIBS"
197 LIB_SUBST_FLAGS(curses)
199 ########################################################################### ip_mreqn
200 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
201 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
207 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
208 AC_MSG_RESULT($have_ip_mreqn)
209 if test ${have_ip_mreqn} = yes; then
210 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
212 ########################################################################### osx
214 AC_MSG_CHECKING(for CoreAudio (MacOs))
215 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
216 #include <CoreAudio/CoreAudio.h>
219 ]])],[have_core_audio=yes],[have_core_audio=no])
220 AC_MSG_RESULT($have_core_audio)
221 if test ${have_core_audio} = yes; then
222 f1="-framework CoreAudio"
223 f2="-framework AudioToolbox"
224 f3="-framework AudioUnit"
225 f4="-framework CoreServices"
226 core_audio_ldflags="$f1 $f2 $f3 $f4"
227 AC_SUBST(core_audio_ldflags)
228 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
230 ########################################################################### ogg
232 LIB_ARG_WITH([ogg], [-logg])
234 AC_CHECK_HEADERS([ogg/ogg.h], [], [HAVE_OGG=no])
235 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [HAVE_OGG=no])
236 AC_CHECK_LIB([ogg], [ogg_stream_flush_fill], [
237 AC_DEFINE(HAVE_OGG_STREAM_FLUSH_FILL, 1, [libogg >= 1.3.0])])
240 ######################################################################### vorbis
242 LIB_ARG_WITH([vorbis], [-lvorbis -lvorbisfile])
244 AC_CHECK_HEADERS([vorbis/codec.h], [], [HAVE_VORBIS=no])
245 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [HAVE_VORBIS=no])
246 LIB_SUBST_FLAGS(vorbis)
248 ######################################################################### speex
250 LIB_ARG_WITH([speex], [-lspeex])
252 AC_CHECK_HEADERS([speex/speex.h], [], [HAVE_SPEEX=no])
253 AC_CHECK_LIB([speex], [speex_decoder_init], [], [HAVE_SPEEX=no])
254 LIB_SUBST_FLAGS(speex)
256 ######################################################################### opus
258 LIB_ARG_WITH([opus], [-lopus])
260 AC_CHECK_HEADERS([opus/opus.h], [], [HAVE_OPUS=no])
261 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [HAVE_OPUS=no])
262 LIB_SUBST_FLAGS(opus)
264 ########################################################################### flac
266 LIB_ARG_WITH([flac], [-lFLAC -lm])
268 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], HAVE_FLAC=no)
269 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], HAVE_FLAC=no)
270 LIB_SUBST_FLAGS(flac)
273 # some helper functions for codecs which use the ogg container format
274 AC_DEFUN([NEED_OGG_OBJECTS], [{
275 test "$HAVE_OGG" = 'yes' -a \( \
276 "$HAVE_VORBIS" = 'yes' \
277 -o "$HAVE_SPEEX" = 'yes' \
278 -o "$HAVE_OPUS" = 'yes' \
279 -o "$HAVE_FLAC" = 'yes' \
282 AC_DEFUN([NEED_VORBIS_OBJECTS], [{
283 test "$HAVE_OGG" = 'yes' -a "$HAVE_VORBIS" = 'yes'
285 AC_DEFUN([NEED_SPEEX_OBJECTS], [{
286 test "$HAVE_OGG" = 'yes' -a "$HAVE_SPEEX" = 'yes'
288 AC_DEFUN([NEED_OPUS_OBJECTS], [{
289 test "$HAVE_OGG" = 'yes' -a "$HAVE_OPUS" = 'yes'
291 AC_DEFUN([NEED_FLAC_OBJECTS], [{
292 test "$HAVE_OGG" = 'yes' -a "$HAVE_FLAC" = 'yes'
294 ########################################################################### faad
296 LIB_ARG_WITH([faad], [-lfaad])
298 AC_CHECK_HEADER(neaacdec.h, [], HAVE_FAAD=no)
299 AC_CHECK_LIB([faad], [NeAACDecOpen], [], HAVE_FAAD=no)
300 LIB_SUBST_FLAGS(faad)
302 ########################################################################### mad
304 LIB_ARG_WITH([mad], [-lmad])
306 AC_CHECK_HEADER(mad.h, [], HAVE_MAD=no)
307 AC_CHECK_LIB([mad], [mad_stream_init], [], HAVE_MAD=no)
310 ###################################################################### libid3tag
312 LIB_ARG_WITH([id3tag], [-lid3tag -lz])
314 AC_CHECK_HEADER(id3tag.h, [], HAVE_ID3TAG=no)
315 AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
316 LIB_SUBST_FLAGS(id3tag)
318 ########################################################################### oss
320 LIB_ARG_WITH([oss], [])
321 AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=yes], [HAVE_OSS=no])
322 AC_CHECK_LIB(ossaudio, _oss_ioctl, [oss_ldflags="$oss_ldflags -lossaudio"], [])
325 ########################################################################### alsa
327 LIB_ARG_WITH([alsa], [-lasound])
329 AC_CHECK_HEADER(alsa/asoundlib.h, [], HAVE_ALSA=no)
330 AC_CHECK_LIB([asound], [snd_pcm_open], [], HAVE_ALSA=no)
331 LIB_SUBST_FLAGS(alsa)
333 ######################################################################### pthread
335 LIB_ARG_WITH([pthread], [-lpthread])
337 AC_CHECK_HEADER(pthread.h, [], HAVE_PTHREAD=no)
338 AC_CHECK_LIB([pthread], [pthread_create], [], HAVE_PTHREAD=no)
339 LIB_SUBST_FLAGS(pthread)
341 ########################################################################### libao
343 LIB_ARG_WITH([ao], [-lao])
345 AC_CHECK_HEADER(ao/ao.h, [], HAVE_AO=no)
346 AC_CHECK_LIB([ao], [ao_initialize], [], HAVE_AO=no)
349 AC_DEFUN([NEED_AO_OBJECTS], [{ test $HAVE_AO = yes -a $HAVE_PTHREAD = yes; }])
350 ######################################################################## readline
352 AC_SEARCH_LIBS([tgetent], [tinfo curses terminfo termcap])
353 LIB_ARG_WITH([readline], [-lreadline $LIBS])
355 AC_CHECK_HEADER([readline/readline.h], [], [HAVE_READLINE=no])
356 AC_CHECK_LIB([readline], [rl_free_keymap], [], HAVE_READLINE=no)
359 [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
363 #include <readline/readline.h>
366 LIB_SUBST_FLAGS(readline)
368 ############################################################# libsamplerate
370 LIB_ARG_WITH([samplerate], [-lsamplerate])
372 AC_CHECK_HEADER(samplerate.h, [], HAVE_SAMPLERATE=no)
373 AC_CHECK_LIB([samplerate], [src_process], [], HAVE_SAMPLERATE=no)
374 LIB_SUBST_FLAGS(samplerate)
376 ########################################################################## mp4v2
378 LIB_ARG_WITH([mp4v2], [-lmp4v2])
380 AC_CHECK_HEADER([mp4v2/mp4v2.h], [], [HAVE_MP4V2=no])
381 AC_CHECK_LIB([mp4v2], [MP4Read], [], [HAVE_MP4V2=no])
382 LIB_SUBST_FLAGS(mp4v2)
384 ######################################################################### server
385 if test -n "$CRYPTOLIB" && test $HAVE_OSL = yes; then
387 executables="$executables server"
388 server_cmdline_objs="server"
389 server_errlist_objs="
429 if test "$CRYPTOLIB" = openssl; then
430 server_errlist_objs="$server_errlist_objs crypt"
432 server_errlist_objs="$server_errlist_objs gcrypt"
434 NEED_OGG_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh_common"
435 NEED_VORBIS_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh"
436 NEED_SPEEX_OBJECTS() && server_errlist_objs="$server_errlist_objs spx_afh spx_common"
437 NEED_OPUS_OBJECTS() && server_errlist_objs="$server_errlist_objs opus_afh opus_common"
438 NEED_FLAC_OBJECTS && server_errlist_objs="$server_errlist_objs flac_afh"
439 if test $HAVE_FAAD = yes && test $HAVE_MP4V2 = yes; then
440 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
442 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
443 AC_SUBST(server_objs, add_dot_o($server_objs))
447 ############################################################# client
448 if test -n "$CRYPTOLIB"; then
450 executables="$executables client"
451 client_cmdline_objs="client"
452 client_errlist_objs="
469 if test "$CRYPTOLIB" = openssl; then
470 client_errlist_objs="$client_errlist_objs crypt"
472 client_errlist_objs="$client_errlist_objs gcrypt"
474 if test $HAVE_READLINE = yes; then
475 client_errlist_objs="$client_errlist_objs interactive"
477 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
478 AC_SUBST(client_objs, add_dot_o($client_objs))
482 ############################################################# audiod
483 if test -n "$CRYPTOLIB"; then
485 executables="$executables audiod"
486 audiod_audio_formats="wma"
487 audiod_cmdline_objs="$audiod_cmdline_objs
499 audiod_errlist_objs="$audiod_errlist_objs
538 if test "$CRYPTOLIB" = openssl; then
539 audiod_errlist_objs="$audiod_errlist_objs crypt"
541 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
543 if test "$have_core_audio" = "yes"; then
544 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
545 audiod_cmdline_objs="$audiod_cmdline_objs osx_write"
547 NEED_VORBIS_OBJECTS && {
548 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
549 audiod_audio_formats="$audiod_audio_formats ogg"
551 NEED_SPEEX_OBJECTS && {
552 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
553 audiod_audio_formats="$audiod_audio_formats spx"
555 NEED_OPUS_OBJECTS && {
556 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
557 audiod_audio_formats="$audiod_audio_formats opus"
559 NEED_FLAC_OBJECTS && {
560 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
561 audiod_audio_formats="$audiod_audio_formats flac"
563 if test $HAVE_FAAD = yes; then
564 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
565 audiod_audio_formats="$audiod_audio_formats aac"
567 if test $HAVE_MAD = yes; then
568 audiod_audio_formats="$audiod_audio_formats mp3"
569 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
570 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
572 if test $HAVE_OSS = yes; then
573 audiod_errlist_objs="$audiod_errlist_objs oss_write"
574 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
576 if test $HAVE_ALSA = yes; then
577 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
578 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
581 audiod_errlist_objs="$audiod_errlist_objs ao_write"
582 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
584 if test $HAVE_SAMPLERATE = yes; then
585 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
586 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
588 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
589 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
591 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
592 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
593 enum of audio formats supported by audiod)
594 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
595 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
599 ########################################################################### fade
600 if test $HAVE_OSS = yes -o $HAVE_ALSA = yes; then
602 executables="$executables fade"
603 fade_cmdline_objs="fade"
604 fade_errlist_objs="fade exec string fd version ggo"
605 if test $HAVE_OSS = yes; then
606 fade_errlist_objs="$fade_errlist_objs oss_mix"
607 mixers="${mixers}oss "
608 default_mixer="OSS_MIX"
610 if test $HAVE_ALSA = yes; then
611 fade_errlist_objs="$fade_errlist_objs alsa_mix"
612 mixers="${mixers}alsa "
613 default_mixer="ALSA_MIX"
615 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
616 AC_SUBST(fade_objs, add_dot_o($fade_objs))
619 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
622 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
623 enum of supported mixers)
624 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
625 use this mixer if none was specified)
626 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
627 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
630 printf 'extern void '$i'_mix_init(struct mixer *); '
633 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
634 init functions of the supported mixers)
635 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
636 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
639 AC_MSG_WARN([no mixer support])
641 ########################################################################### gui
642 if test $HAVE_CURSES = yes; then
644 executables="$executables gui"
645 gui_cmdline_objs="gui"
660 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
661 AC_SUBST(gui_objs, add_dot_o($gui_objs))
664 AC_MSG_WARN([no curses lib, cannot build para_gui])
666 ######################################################################## filter
676 filter_errlist_objs="
701 filter_cmdline_objs="
708 NEED_VORBIS_OBJECTS && {
709 filters="$filters oggdec"
710 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
712 NEED_SPEEX_OBJECTS && {
713 filters="$filters spxdec"
714 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
716 NEED_OPUS_OBJECTS && {
717 filters="$filters opusdec"
718 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
720 NEED_FLAC_OBJECTS && {
721 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
722 filters="$filters flacdec"
724 if test $HAVE_FAAD = yes; then
725 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
726 filters="$filters aacdec"
728 if test $HAVE_MAD = yes; then
729 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
730 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
731 filters="$filters mp3dec"
733 if test $HAVE_SAMPLERATE = yes; then
734 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
735 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
736 filters="$filters resample"
738 filters="$(echo $filters)"
740 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
742 AC_SUBST(filter_objs, add_dot_o($filter_objs))
744 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
745 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
746 enum of supported filters)
747 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
748 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
749 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
750 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
751 ########################################################################## recv
781 NEED_OGG_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
782 NEED_VORBIS_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh"
783 NEED_SPEEX_OBJECTS && recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
784 NEED_OPUS_OBJECTS && recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
785 NEED_FLAC_OBJECTS && recv_errlist_objs="$recv_errlist_objs flac_afh"
787 if test $HAVE_FAAD = yes -a $HAVE_MP4V2 = yes; then
788 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
790 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
791 AC_SUBST(receivers, "http dccp udp afh")
792 AC_SUBST(recv_objs, add_dot_o($recv_objs))
793 ########################################################################### afh
794 audio_format_handlers="mp3 wma"
795 afh_cmdline_objs="afh"
808 NEED_OGG_OBJECTS && afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
809 NEED_VORBIS_OBJECTS && {
810 afh_errlist_objs="$afh_errlist_objs ogg_afh"
811 audio_format_handlers="$audio_format_handlers ogg"
813 NEED_SPEEX_OBJECTS && {
814 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
815 audio_format_handlers="$audio_format_handlers spx"
817 NEED_OPUS_OBJECTS && {
818 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
819 audio_format_handlers="$audio_format_handlers opus"
821 NEED_FLAC_OBJECTS && {
822 afh_errlist_objs="$afh_errlist_objs flac_afh"
823 audio_format_handlers="$audio_format_handlers flac"
825 if test $HAVE_FAAD = yes -a $HAVE_MP4V2 = yes; then
826 afh_errlist_objs="$afh_errlist_objs aac_afh aac_common"
827 audio_format_handlers="$audio_format_handlers aac"
830 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
832 AC_SUBST(afh_objs, add_dot_o($afh_objs))
833 ########################################################################## play
879 if test "$have_core_audio" = "yes"; then
880 play_errlist_objs="$play_errlist_objs osx_write ipc"
881 play_cmdline_objs="$play_cmdline_objs osx_write"
883 NEED_OGG_OBJECTS && play_errlist_objs="$play_errlist_objs ogg_afh_common"
884 NEED_VORBIS_OBJECTS && {
885 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
887 NEED_SPEEX_OBJECTS && {
888 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
891 play_errlist_objs="$play_errlist_objs
896 NEED_FLAC_OBJECTS && {
897 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
899 if test $HAVE_FAAD = yes; then
900 play_errlist_objs="$play_errlist_objs aacdec_filter"
902 if test $HAVE_MP4V2 = yes; then
903 play_errlist_objs="$play_errlist_objs aac_afh"
905 if test $HAVE_MP4V2 = yes || test $HAVE_FAAD = yes; then
906 play_errlist_objs="$play_errlist_objs aac_common"
908 if test $HAVE_MAD = yes; then
909 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
910 play_errlist_objs="$play_errlist_objs mp3dec_filter"
912 if test $HAVE_OSS = yes; then
913 play_errlist_objs="$play_errlist_objs oss_write"
914 play_cmdline_objs="$play_cmdline_objs oss_write"
916 if test $HAVE_ALSA = yes; then
917 play_errlist_objs="$play_errlist_objs alsa_write"
918 play_cmdline_objs="$play_cmdline_objs alsa_write"
921 play_errlist_objs="$play_errlist_objs ao_write"
922 play_cmdline_objs="$play_cmdline_objs ao_write"
924 if test $HAVE_READLINE = yes; then
925 play_errlist_objs="$play_errlist_objs interactive"
927 if test $HAVE_SAMPLERATE = yes; then
928 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
929 play_cmdline_objs="$play_cmdline_objs resample_filter"
932 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
933 AC_SUBST(play_objs, add_dot_o($play_objs))
934 ######################################################################### write
954 default_writer="FILE_WRITE"
956 if test "$have_core_audio" = "yes"; then
957 write_errlist_objs="$write_errlist_objs osx_write ipc"
958 write_cmdline_objs="$write_cmdline_objs osx_write"
959 writers="$writers osx"
960 default_writer="OSX_WRITE"
963 write_errlist_objs="$write_errlist_objs ao_write"
964 write_cmdline_objs="$write_cmdline_objs ao_write"
965 writers="$writers ao"
966 default_writer="AO_WRITE"
968 if test $HAVE_OSS = yes; then
969 write_errlist_objs="$write_errlist_objs oss_write"
970 write_cmdline_objs="$write_cmdline_objs oss_write"
971 writers="$writers oss"
972 default_writer="OSS_WRITE"
974 if test $HAVE_ALSA = yes; then
975 write_errlist_objs="$write_errlist_objs alsa_write"
976 write_cmdline_objs="$write_cmdline_objs alsa_write"
977 writers="$writers alsa"
978 default_writer="ALSA_WRITE"
981 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
982 AC_SUBST(write_objs, add_dot_o($write_objs))
983 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
984 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
985 enum of supported writers)
986 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
987 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
988 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
989 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
990 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
991 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
992 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
993 ######################################################################## audioc
994 audioc_cmdline_objs="audioc"
995 audioc_errlist_objs="
1003 if test $HAVE_READLINE = yes; then
1004 audioc_errlist_objs="$audioc_errlist_objs
1011 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1012 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1013 ################################################################## status items
1015 status_items="basename status num_played mtime bitrate frequency file_size
1016 status_flags format score techinfo afs_mode
1017 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1018 offset seconds_total stream_start current_time audiod_uptime image_id
1019 lyrics_id duration directory lyrics_name image_name path hash channels
1020 last_played num_chunks chunk_time amplification artist title year album
1024 for i in $status_items; do
1025 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1027 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1028 [enum of all status items])
1031 for i in $status_items; do
1032 result="$result \"$i\", "
1034 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1035 [char * array of all status items])
1037 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1038 [formats supported by para_server and para_afh])
1040 AC_SUBST(executables)
1044 paraslash configuration:
1045 ~~~~~~~~~~~~~~~~~~~~~~~~
1046 crypto lib: ${CRYPTOLIB:-[none]}
1047 unix socket credentials: $have_ucred
1048 readline (interactive CLIs): $HAVE_READLINE
1049 id3 version 2 support: $HAVE_ID3TAG
1053 audio format handlers: $audio_format_handlers
1054 filters: $(echo $filters)
1057 para_server: $build_server
1058 para_gui: $build_gui
1059 para_fade: $build_fade
1060 para_client: $build_client
1061 para_audiod: $build_audiod