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)
102 if test $HAVE_OPENSSL = yes; then
103 AC_CHECK_LIB([crypto], [RSA_set0_key],
104 AC_DEFINE([HAVE_RSA_SET0_KEY], [1], [openssl-1.1]))
107 ######################################################################### gcrypt
110 LIB_ARG_WITH([gcrypt], [-lgcrypt])
111 AC_CHECK_HEADER(gcrypt.h, [], [HAVE_GCRYPT=no])
112 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [HAVE_GCRYPT=no])
113 LIB_SUBST_FLAGS(gcrypt)
115 ######################################################################### crypto
116 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
117 Force using crypto library "lib". This package requires either
118 openssl or libgcrypt being installed. Possible values for "lib"
119 are thus "openssl" and "gcrypt". If this option is not given,
120 openssl is tried first. If openssl was not found, gcrypt is
123 CRYPTOLIB="$enable_cryptolib"
124 case "$enable_cryptolib" in
126 test $HAVE_OPENSSL = no && AC_MSG_ERROR(openssl not found)
127 crypto_ldflags="$openssl_ldflags"
130 test $HAVE_GCRYPT = no && AC_MSG_ERROR(gcrypt not found)
131 crypto_ldflags="$gcrypt_ldflags"
135 if test $HAVE_GCRYPT = yes; then
137 crypto_ldflags="$gcrypt_ldflags"
139 if test $HAVE_OPENSSL = yes; then
141 crypto_ldflags="$openssl_ldflags"
145 AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib])
148 AC_SUBST(crypto_ldflags)
149 ########################################################################## iconv
152 AC_SEARCH_LIBS([libiconv_open], [iconv],
153 [iconv_ldflags="$LIBS"],
156 AC_SUBST(iconv_ldflags)
157 AC_MSG_CHECKING([whether iconv needs const char ** cast])
162 size_t iconv(iconv_t cd, const char **inbuf,
163 size_t *inbytesleft, char **outbuf,
164 size_t *outbytesleft);
167 [cast='(const char **)'; msg=yes],
170 AC_DEFINE_UNQUOTED(ICONV_CAST, $cast, [cast for second arg to iconv()])
173 ########################################################################### ucred
174 AC_MSG_CHECKING(for struct ucred)
175 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
176 #include <sys/types.h>
177 #include <sys/socket.h>
179 struct ucred sucred; sucred.pid=0;
180 ]])],[have_ucred=yes],[have_ucred=no])
181 AC_MSG_RESULT($have_ucred)
182 if test ${have_ucred} = yes; then
183 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
185 ########################################################################### gengetopt
186 echo 'option "z" z "" flag off' | $GENGETOPT --file-name conftest-ggo &&
188 [gengetopt_args_info_description],
189 [ggo_descriptions_declared=yes],
190 [ggo_descriptions_declared=no],
191 [#include "conftest-ggo.h"]
193 AC_SUBST(ggo_descriptions_declared)
194 ########################################################################### curses
196 LIB_ARG_WITH([curses], [])
198 AC_CHECK_HEADER(curses.h, [], [HAVE_CURSES=no])
199 AC_SEARCH_LIBS([initscr], [ncursesw curses], [], [HAVE_CURSES=no])
200 curses_ldflags="$curses_ldflags $LIBS"
201 LIB_SUBST_FLAGS(curses)
203 ########################################################################### ip_mreqn
204 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
205 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
211 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
212 AC_MSG_RESULT($have_ip_mreqn)
213 if test ${have_ip_mreqn} = yes; then
214 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
216 ########################################################################### osx
218 AC_MSG_CHECKING(for CoreAudio (MacOs))
219 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
220 #include <CoreAudio/CoreAudio.h>
223 ]])],[have_core_audio=yes],[have_core_audio=no])
224 AC_MSG_RESULT($have_core_audio)
225 if test ${have_core_audio} = yes; then
226 f1="-framework CoreAudio"
227 f2="-framework AudioToolbox"
228 f3="-framework AudioUnit"
229 f4="-framework CoreServices"
230 core_audio_ldflags="$f1 $f2 $f3 $f4"
231 AC_SUBST(core_audio_ldflags)
232 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
234 ########################################################################### ogg
236 LIB_ARG_WITH([ogg], [-logg])
238 AC_CHECK_HEADERS([ogg/ogg.h], [], [HAVE_OGG=no])
239 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [HAVE_OGG=no])
240 AC_CHECK_LIB([ogg], [ogg_stream_flush_fill], [
241 AC_DEFINE(HAVE_OGG_STREAM_FLUSH_FILL, 1, [libogg >= 1.3.0])])
244 ######################################################################### vorbis
246 LIB_ARG_WITH([vorbis], [-lvorbis -lvorbisfile])
248 AC_CHECK_HEADERS([vorbis/codec.h], [], [HAVE_VORBIS=no])
249 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [HAVE_VORBIS=no])
250 LIB_SUBST_FLAGS(vorbis)
252 ######################################################################### speex
254 LIB_ARG_WITH([speex], [-lspeex])
256 AC_CHECK_HEADERS([speex/speex.h], [], [HAVE_SPEEX=no])
257 AC_CHECK_LIB([speex], [speex_decoder_init], [], [HAVE_SPEEX=no])
258 LIB_SUBST_FLAGS(speex)
260 ######################################################################### opus
262 LIB_ARG_WITH([opus], [-lopus])
264 AC_CHECK_HEADERS([opus/opus.h], [], [HAVE_OPUS=no])
265 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [HAVE_OPUS=no])
266 LIB_SUBST_FLAGS(opus)
268 ########################################################################### flac
270 LIB_ARG_WITH([flac], [-lFLAC -lm])
272 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], HAVE_FLAC=no)
273 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], HAVE_FLAC=no)
274 LIB_SUBST_FLAGS(flac)
277 # some helper functions for codecs which use the ogg container format
278 AC_DEFUN([NEED_OGG_OBJECTS], [{
279 test "$HAVE_OGG" = 'yes' -a \( \
280 "$HAVE_VORBIS" = 'yes' \
281 -o "$HAVE_SPEEX" = 'yes' \
282 -o "$HAVE_OPUS" = 'yes' \
283 -o "$HAVE_FLAC" = 'yes' \
286 AC_DEFUN([NEED_VORBIS_OBJECTS], [{
287 test "$HAVE_OGG" = 'yes' -a "$HAVE_VORBIS" = 'yes'
289 AC_DEFUN([NEED_SPEEX_OBJECTS], [{
290 test "$HAVE_OGG" = 'yes' -a "$HAVE_SPEEX" = 'yes'
292 AC_DEFUN([NEED_OPUS_OBJECTS], [{
293 test "$HAVE_OGG" = 'yes' -a "$HAVE_OPUS" = 'yes'
295 AC_DEFUN([NEED_FLAC_OBJECTS], [{
296 test "$HAVE_OGG" = 'yes' -a "$HAVE_FLAC" = 'yes'
298 ########################################################################### faad
300 LIB_ARG_WITH([faad], [-lfaad -lmp4ff])
302 AC_CHECK_HEADER(neaacdec.h, [], HAVE_FAAD=no)
303 AC_CHECK_HEADER(mp4ff.h, [], HAVE_FAAD=no)
304 AC_CHECK_LIB([faad], [NeAACDecOpen], [], HAVE_FAAD=no)
305 AC_CHECK_LIB([mp4ff], [mp4ff_meta_get_artist], [], HAVE_FAAD=no)
306 LIB_SUBST_FLAGS(faad)
308 ########################################################################### mad
310 LIB_ARG_WITH([mad], [-lmad])
312 AC_CHECK_HEADER(mad.h, [], HAVE_MAD=no)
313 AC_CHECK_LIB([mad], [mad_stream_init], [], HAVE_MAD=no)
316 ###################################################################### libid3tag
318 LIB_ARG_WITH([id3tag], [-lid3tag -lz])
320 AC_CHECK_HEADER(id3tag.h, [], HAVE_ID3TAG=no)
321 AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
322 LIB_SUBST_FLAGS(id3tag)
324 ########################################################################### oss
326 LIB_ARG_WITH([oss], [])
327 AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=yes], [HAVE_OSS=no])
328 AC_CHECK_LIB(ossaudio, _oss_ioctl, [oss_ldflags="$oss_ldflags -lossaudio"], [])
331 ########################################################################### alsa
333 LIB_ARG_WITH([alsa], [-lasound])
335 AC_CHECK_HEADER(alsa/asoundlib.h, [], HAVE_ALSA=no)
336 AC_CHECK_LIB([asound], [snd_pcm_open], [], HAVE_ALSA=no)
337 LIB_SUBST_FLAGS(alsa)
339 ######################################################################### pthread
341 LIB_ARG_WITH([pthread], [-lpthread])
343 AC_CHECK_HEADER(pthread.h, [], HAVE_PTHREAD=no)
344 AC_CHECK_LIB([pthread], [pthread_create], [], HAVE_PTHREAD=no)
345 LIB_SUBST_FLAGS(pthread)
347 ########################################################################### libao
349 LIB_ARG_WITH([ao], [-lao])
351 AC_CHECK_HEADER(ao/ao.h, [], HAVE_AO=no)
352 AC_CHECK_LIB([ao], [ao_initialize], [], HAVE_AO=no)
355 AC_DEFUN([NEED_AO_OBJECTS], [{ test $HAVE_AO = yes -a $HAVE_PTHREAD = yes; }])
356 ######################################################################## readline
358 AC_SEARCH_LIBS([tgetent], [tinfo curses terminfo termcap])
359 LIB_ARG_WITH([readline], [-lreadline $LIBS])
361 AC_CHECK_HEADER([readline/readline.h], [], [HAVE_READLINE=no])
362 AC_CHECK_LIB([readline], [rl_free_keymap], [], HAVE_READLINE=no)
365 [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
369 #include <readline/readline.h>
372 LIB_SUBST_FLAGS(readline)
374 ############################################################# libsamplerate
376 LIB_ARG_WITH([samplerate], [-lsamplerate])
378 AC_CHECK_HEADER(samplerate.h, [], HAVE_SAMPLERATE=no)
379 AC_CHECK_LIB([samplerate], [src_process], [], HAVE_SAMPLERATE=no)
380 LIB_SUBST_FLAGS(samplerate)
382 ########################################################################## mp4v2
384 LIB_ARG_WITH([mp4v2], [-lmp4v2])
386 AC_CHECK_HEADER([mp4v2/mp4v2.h], [], [HAVE_MP4V2=no])
387 AC_CHECK_LIB([mp4v2], [MP4Read], [], [HAVE_MP4V2=no])
388 LIB_SUBST_FLAGS(mp4v2)
390 ######################################################################### server
391 if test -n "$CRYPTOLIB" && test $HAVE_OSL = yes; then
393 executables="$executables server"
394 server_cmdline_objs="server"
395 server_errlist_objs="
435 if test "$CRYPTOLIB" = openssl; then
436 server_errlist_objs="$server_errlist_objs crypt"
438 server_errlist_objs="$server_errlist_objs gcrypt"
440 NEED_OGG_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh_common"
441 NEED_VORBIS_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh"
442 NEED_SPEEX_OBJECTS() && server_errlist_objs="$server_errlist_objs spx_afh spx_common"
443 NEED_OPUS_OBJECTS() && server_errlist_objs="$server_errlist_objs opus_afh opus_common"
444 NEED_FLAC_OBJECTS && server_errlist_objs="$server_errlist_objs flac_afh"
445 if test $HAVE_FAAD = yes && test $HAVE_MP4V2 = yes; then
446 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
448 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
449 AC_SUBST(server_objs, add_dot_o($server_objs))
453 ############################################################# client
454 if test -n "$CRYPTOLIB"; then
456 executables="$executables client"
457 client_cmdline_objs="client"
458 client_errlist_objs="
475 if test "$CRYPTOLIB" = openssl; then
476 client_errlist_objs="$client_errlist_objs crypt"
478 client_errlist_objs="$client_errlist_objs gcrypt"
480 if test $HAVE_READLINE = yes; then
481 client_errlist_objs="$client_errlist_objs interactive"
483 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
484 AC_SUBST(client_objs, add_dot_o($client_objs))
488 ############################################################# audiod
489 if test -n "$CRYPTOLIB"; then
491 executables="$executables audiod"
492 audiod_audio_formats="wma"
493 audiod_cmdline_objs="$audiod_cmdline_objs
505 audiod_errlist_objs="$audiod_errlist_objs
544 if test "$CRYPTOLIB" = openssl; then
545 audiod_errlist_objs="$audiod_errlist_objs crypt"
547 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
549 if test "$have_core_audio" = "yes"; then
550 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
551 audiod_cmdline_objs="$audiod_cmdline_objs osx_write"
553 NEED_VORBIS_OBJECTS && {
554 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
555 audiod_audio_formats="$audiod_audio_formats ogg"
557 NEED_SPEEX_OBJECTS && {
558 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
559 audiod_audio_formats="$audiod_audio_formats spx"
561 NEED_OPUS_OBJECTS && {
562 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
563 audiod_audio_formats="$audiod_audio_formats opus"
565 NEED_FLAC_OBJECTS && {
566 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
567 audiod_audio_formats="$audiod_audio_formats flac"
569 if test $HAVE_FAAD = yes; then
570 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
571 audiod_audio_formats="$audiod_audio_formats aac"
573 if test $HAVE_MAD = yes; then
574 audiod_audio_formats="$audiod_audio_formats mp3"
575 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
576 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
578 if test $HAVE_OSS = yes; then
579 audiod_errlist_objs="$audiod_errlist_objs oss_write"
580 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
582 if test $HAVE_ALSA = yes; then
583 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
584 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
587 audiod_errlist_objs="$audiod_errlist_objs ao_write"
588 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
590 if test $HAVE_SAMPLERATE = yes; then
591 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
592 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
594 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
595 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
597 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
598 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
599 enum of audio formats supported by audiod)
600 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
601 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
605 ########################################################################### fade
606 if test $HAVE_OSS = yes -o $HAVE_ALSA = yes; then
608 executables="$executables fade"
609 fade_cmdline_objs="fade"
610 fade_errlist_objs="fade exec string fd version ggo"
611 if test $HAVE_OSS = yes; then
612 fade_errlist_objs="$fade_errlist_objs oss_mix"
613 mixers="${mixers}oss "
614 default_mixer="OSS_MIX"
616 if test $HAVE_ALSA = yes; then
617 fade_errlist_objs="$fade_errlist_objs alsa_mix"
618 mixers="${mixers}alsa "
619 default_mixer="ALSA_MIX"
621 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
622 AC_SUBST(fade_objs, add_dot_o($fade_objs))
625 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
628 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
629 enum of supported mixers)
630 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
631 use this mixer if none was specified)
632 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
633 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
636 printf 'extern void '$i'_mix_init(struct mixer *); '
639 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
640 init functions of the supported mixers)
641 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
642 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
645 AC_MSG_WARN([no mixer support])
647 ########################################################################### gui
648 if test $HAVE_CURSES = yes; then
650 executables="$executables gui"
651 gui_cmdline_objs="gui"
666 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
667 AC_SUBST(gui_objs, add_dot_o($gui_objs))
670 AC_MSG_WARN([no curses lib, cannot build para_gui])
672 ######################################################################## filter
682 filter_errlist_objs="
707 filter_cmdline_objs="
714 NEED_VORBIS_OBJECTS && {
715 filters="$filters oggdec"
716 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
718 NEED_SPEEX_OBJECTS && {
719 filters="$filters spxdec"
720 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
722 NEED_OPUS_OBJECTS && {
723 filters="$filters opusdec"
724 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
726 NEED_FLAC_OBJECTS && {
727 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
728 filters="$filters flacdec"
730 if test $HAVE_FAAD = yes; then
731 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
732 filters="$filters aacdec"
734 if test $HAVE_MAD = yes; then
735 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
736 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
737 filters="$filters mp3dec"
739 if test $HAVE_SAMPLERATE = yes; then
740 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
741 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
742 filters="$filters resample"
744 filters="$(echo $filters)"
746 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
748 AC_SUBST(filter_objs, add_dot_o($filter_objs))
750 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
751 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
752 enum of supported filters)
753 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
754 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
755 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
756 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
757 ########################################################################## recv
787 NEED_OGG_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
788 NEED_VORBIS_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh"
789 NEED_SPEEX_OBJECTS && recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
790 NEED_OPUS_OBJECTS && recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
791 NEED_FLAC_OBJECTS && recv_errlist_objs="$recv_errlist_objs flac_afh"
793 if test $HAVE_FAAD = yes -a $HAVE_MP4V2 = yes; then
794 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
796 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
797 AC_SUBST(receivers, "http dccp udp afh")
798 AC_SUBST(recv_objs, add_dot_o($recv_objs))
799 ########################################################################### afh
800 audio_format_handlers="mp3 wma"
801 afh_cmdline_objs="afh"
814 NEED_OGG_OBJECTS && afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
815 NEED_VORBIS_OBJECTS && {
816 afh_errlist_objs="$afh_errlist_objs ogg_afh"
817 audio_format_handlers="$audio_format_handlers ogg"
819 NEED_SPEEX_OBJECTS && {
820 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
821 audio_format_handlers="$audio_format_handlers spx"
823 NEED_OPUS_OBJECTS && {
824 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
825 audio_format_handlers="$audio_format_handlers opus"
827 NEED_FLAC_OBJECTS && {
828 afh_errlist_objs="$afh_errlist_objs flac_afh"
829 audio_format_handlers="$audio_format_handlers flac"
831 if test $HAVE_FAAD = yes -a $HAVE_MP4V2 = yes; then
832 afh_errlist_objs="$afh_errlist_objs aac_afh aac_common"
833 audio_format_handlers="$audio_format_handlers aac"
836 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
838 AC_SUBST(afh_objs, add_dot_o($afh_objs))
839 ########################################################################## play
885 if test "$have_core_audio" = "yes"; then
886 play_errlist_objs="$play_errlist_objs osx_write ipc"
887 play_cmdline_objs="$play_cmdline_objs osx_write"
889 NEED_OGG_OBJECTS && play_errlist_objs="$play_errlist_objs ogg_afh_common"
890 NEED_VORBIS_OBJECTS && {
891 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
893 NEED_SPEEX_OBJECTS && {
894 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
897 play_errlist_objs="$play_errlist_objs
902 NEED_FLAC_OBJECTS && {
903 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
905 if test $HAVE_FAAD = yes; then
906 play_errlist_objs="$play_errlist_objs aacdec_filter"
908 if test $HAVE_MP4V2 = yes; then
909 play_errlist_objs="$play_errlist_objs aac_afh"
911 if test $HAVE_MP4V2 = yes || test $HAVE_FAAD = yes; then
912 play_errlist_objs="$play_errlist_objs aac_common"
914 if test $HAVE_MAD = yes; then
915 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
916 play_errlist_objs="$play_errlist_objs mp3dec_filter"
918 if test $HAVE_OSS = yes; then
919 play_errlist_objs="$play_errlist_objs oss_write"
920 play_cmdline_objs="$play_cmdline_objs oss_write"
922 if test $HAVE_ALSA = yes; then
923 play_errlist_objs="$play_errlist_objs alsa_write"
924 play_cmdline_objs="$play_cmdline_objs alsa_write"
927 play_errlist_objs="$play_errlist_objs ao_write"
928 play_cmdline_objs="$play_cmdline_objs ao_write"
930 if test $HAVE_READLINE = yes; then
931 play_errlist_objs="$play_errlist_objs interactive"
933 if test $HAVE_SAMPLERATE = yes; then
934 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
935 play_cmdline_objs="$play_cmdline_objs resample_filter"
938 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
939 AC_SUBST(play_objs, add_dot_o($play_objs))
940 ######################################################################### write
960 default_writer="FILE_WRITE"
962 if test "$have_core_audio" = "yes"; then
963 write_errlist_objs="$write_errlist_objs osx_write ipc"
964 write_cmdline_objs="$write_cmdline_objs osx_write"
965 writers="$writers osx"
966 default_writer="OSX_WRITE"
969 write_errlist_objs="$write_errlist_objs ao_write"
970 write_cmdline_objs="$write_cmdline_objs ao_write"
971 writers="$writers ao"
972 default_writer="AO_WRITE"
974 if test $HAVE_OSS = yes; then
975 write_errlist_objs="$write_errlist_objs oss_write"
976 write_cmdline_objs="$write_cmdline_objs oss_write"
977 writers="$writers oss"
978 default_writer="OSS_WRITE"
980 if test $HAVE_ALSA = yes; then
981 write_errlist_objs="$write_errlist_objs alsa_write"
982 write_cmdline_objs="$write_cmdline_objs alsa_write"
983 writers="$writers alsa"
984 default_writer="ALSA_WRITE"
987 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
988 AC_SUBST(write_objs, add_dot_o($write_objs))
989 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
990 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
991 enum of supported writers)
992 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
993 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
994 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
995 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
996 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
997 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
998 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
999 ######################################################################## audioc
1000 audioc_cmdline_objs="audioc"
1001 audioc_errlist_objs="
1009 if test $HAVE_READLINE = yes; then
1010 audioc_errlist_objs="$audioc_errlist_objs
1017 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1018 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1019 ################################################################## status items
1021 status_items="basename status num_played mtime bitrate frequency file_size
1022 status_flags format score techinfo afs_mode
1023 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1024 offset seconds_total stream_start current_time audiod_uptime image_id
1025 lyrics_id duration directory lyrics_name image_name path hash channels
1026 last_played num_chunks chunk_time amplification artist title year album
1027 comment max_chunk_size"
1030 for i in $status_items; do
1031 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1033 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1034 [enum of all status items])
1037 for i in $status_items; do
1038 result="$result \"$i\", "
1040 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1041 [char * array of all status items])
1043 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1044 [formats supported by para_server and para_afh])
1046 AC_SUBST(executables)
1050 paraslash configuration:
1051 ~~~~~~~~~~~~~~~~~~~~~~~~
1052 crypto lib: ${CRYPTOLIB:-[none]}
1053 unix socket credentials: $have_ucred
1054 readline (interactive CLIs): $HAVE_READLINE
1055 id3 version 2 support: $HAVE_ID3TAG
1059 audio format handlers: $audio_format_handlers
1060 filters: $(echo $filters)
1063 para_server: $build_server
1064 para_gui: $build_gui
1065 para_fade: $build_fade
1066 para_client: $build_client
1067 para_audiod: $build_audiod