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])
70 AC_PATH_PROG([lopsubgen], [lopsubgen])
71 test -z "$lopsubgen" && AC_MSG_ERROR(
72 [lopsubgen is required to build this package])
77 executables="recv filter audioc write afh play"
78 ################################################################## clock_gettime
80 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
81 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
83 if test -n "$clock_gettime_lib"; then
84 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
85 define to 1 if clock_gettime() is supported])
87 if test "$clock_gettime_lib" = "rt"; then
88 AC_SUBST(clock_gettime_ldflags, -lrt)
91 ########################################################################### osl
93 LIB_ARG_WITH([osl], [-losl])
95 AC_CHECK_HEADER(osl.h, [], [HAVE_OSL=no])
96 AC_CHECK_LIB([osl], [osl_open_table], [], [HAVE_OSL=no])
99 ######################################################################## lopsub
101 LIB_ARG_WITH([lopsub], [-llopsub])
103 AC_CHECK_HEADER(lopsub.h, [], [HAVE_LOPSUB=no])
104 AC_CHECK_LIB([lopsub], [lls_merge], [], [HAVE_LOPSUB=yes])
105 if test $HAVE_LOPSUB = no; then AC_MSG_ERROR([
106 The lopsub library is required to build this software, but
107 the above checks indicate it is not installed on your system.
108 Run the following command to download a copy.
109 git clone git://git.tuebingen.mpg.de/lopsub.git
110 Install the library, then run this configure script again.
113 LIB_SUBST_FLAGS([lopsub])
115 ######################################################################## openssl
118 LIB_ARG_WITH([openssl], [-lssl -lcrypto])
119 AC_CHECK_HEADER(openssl/ssl.h, [], [HAVE_OPENSSL=no])
120 AC_CHECK_LIB([crypto], [RAND_bytes], [], [HAVE_OPENSSL=no])
121 LIB_SUBST_FLAGS(openssl)
122 if test $HAVE_OPENSSL = yes; then
123 AC_CHECK_LIB([crypto], [RSA_set0_key],
124 AC_DEFINE([HAVE_RSA_SET0_KEY], [1], [openssl-1.1]))
127 ######################################################################### gcrypt
130 LIB_ARG_WITH([gcrypt], [-lgcrypt])
131 AC_CHECK_HEADER(gcrypt.h, [], [HAVE_GCRYPT=no])
132 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [HAVE_GCRYPT=no])
133 LIB_SUBST_FLAGS(gcrypt)
135 ######################################################################### crypto
136 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
137 Force using crypto library "lib". This package requires either
138 openssl or libgcrypt being installed. Possible values for "lib"
139 are thus "openssl" and "gcrypt". If this option is not given,
140 openssl is tried first. If openssl was not found, gcrypt is
143 CRYPTOLIB="$enable_cryptolib"
144 case "$enable_cryptolib" in
146 test $HAVE_OPENSSL = no && AC_MSG_ERROR(openssl not found)
147 crypto_ldflags="$openssl_ldflags"
150 test $HAVE_GCRYPT = no && AC_MSG_ERROR(gcrypt not found)
151 crypto_ldflags="$gcrypt_ldflags"
155 if test $HAVE_GCRYPT = yes; then
157 crypto_ldflags="$gcrypt_ldflags"
159 if test $HAVE_OPENSSL = yes; then
161 crypto_ldflags="$openssl_ldflags"
165 AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib])
168 AC_SUBST(crypto_ldflags)
169 ########################################################################## iconv
172 AC_SEARCH_LIBS([libiconv_open], [iconv],
173 [iconv_ldflags="$LIBS"],
176 AC_SUBST(iconv_ldflags)
177 AC_MSG_CHECKING([whether iconv needs const char ** cast])
182 size_t iconv(iconv_t cd, const char **inbuf,
183 size_t *inbytesleft, char **outbuf,
184 size_t *outbytesleft);
187 [cast='(const char **)'; msg=yes],
190 AC_DEFINE_UNQUOTED(ICONV_CAST, $cast, [cast for second arg to iconv()])
193 ########################################################################### ucred
194 AC_MSG_CHECKING(for struct ucred)
195 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
196 #include <sys/types.h>
197 #include <sys/socket.h>
199 struct ucred sucred; sucred.pid=0;
200 ]])],[have_ucred=yes],[have_ucred=no])
201 AC_MSG_RESULT($have_ucred)
202 if test ${have_ucred} = yes; then
203 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
205 ########################################################################### gengetopt
206 echo 'option "z" z "" flag off' | $GENGETOPT --file-name conftest-ggo &&
208 [gengetopt_args_info_description],
209 [ggo_descriptions_declared=yes],
210 [ggo_descriptions_declared=no],
211 [#include "conftest-ggo.h"]
213 AC_SUBST(ggo_descriptions_declared)
214 ########################################################################### curses
216 LIB_ARG_WITH([curses], [])
218 AC_CHECK_HEADER(curses.h, [], [HAVE_CURSES=no])
219 AC_SEARCH_LIBS([initscr], [ncursesw curses], [], [HAVE_CURSES=no])
220 curses_ldflags="$curses_ldflags $LIBS"
221 LIB_SUBST_FLAGS(curses)
223 ########################################################################### ip_mreqn
224 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
225 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
231 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
232 AC_MSG_RESULT($have_ip_mreqn)
233 if test ${have_ip_mreqn} = yes; then
234 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
236 ########################################################################### osx
238 AC_MSG_CHECKING(for CoreAudio (MacOs))
239 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
240 #include <CoreAudio/CoreAudio.h>
243 ]])],[have_core_audio=yes],[have_core_audio=no])
244 AC_MSG_RESULT($have_core_audio)
245 if test ${have_core_audio} = yes; then
246 f1="-framework CoreAudio"
247 f2="-framework AudioToolbox"
248 f3="-framework AudioUnit"
249 f4="-framework CoreServices"
250 core_audio_ldflags="$f1 $f2 $f3 $f4"
251 AC_SUBST(core_audio_ldflags)
252 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
254 ########################################################################### ogg
256 LIB_ARG_WITH([ogg], [-logg])
258 AC_CHECK_HEADERS([ogg/ogg.h], [], [HAVE_OGG=no])
259 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [HAVE_OGG=no])
260 AC_CHECK_LIB([ogg], [ogg_stream_flush_fill], [
261 AC_DEFINE(HAVE_OGG_STREAM_FLUSH_FILL, 1, [libogg >= 1.3.0])])
264 ######################################################################### vorbis
266 LIB_ARG_WITH([vorbis], [-lvorbis -lvorbisfile])
268 AC_CHECK_HEADERS([vorbis/codec.h], [], [HAVE_VORBIS=no])
269 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [HAVE_VORBIS=no])
270 LIB_SUBST_FLAGS(vorbis)
272 ######################################################################### speex
274 LIB_ARG_WITH([speex], [-lspeex])
276 AC_CHECK_HEADERS([speex/speex.h], [], [HAVE_SPEEX=no])
277 AC_CHECK_LIB([speex], [speex_decoder_init], [], [HAVE_SPEEX=no])
278 LIB_SUBST_FLAGS(speex)
280 ######################################################################### opus
282 LIB_ARG_WITH([opus], [-lopus])
284 AC_CHECK_HEADERS([opus/opus.h], [], [HAVE_OPUS=no])
285 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [HAVE_OPUS=no])
286 LIB_SUBST_FLAGS(opus)
288 ########################################################################### flac
290 LIB_ARG_WITH([flac], [-lFLAC -lm])
292 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], HAVE_FLAC=no)
293 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], HAVE_FLAC=no)
294 LIB_SUBST_FLAGS(flac)
297 # some helper functions for codecs which use the ogg container format
298 AC_DEFUN([NEED_OGG_OBJECTS], [{
299 test "$HAVE_OGG" = 'yes' -a \( \
300 "$HAVE_VORBIS" = 'yes' \
301 -o "$HAVE_SPEEX" = 'yes' \
302 -o "$HAVE_OPUS" = 'yes' \
303 -o "$HAVE_FLAC" = 'yes' \
306 AC_DEFUN([NEED_VORBIS_OBJECTS], [{
307 test "$HAVE_OGG" = 'yes' -a "$HAVE_VORBIS" = 'yes'
309 AC_DEFUN([NEED_SPEEX_OBJECTS], [{
310 test "$HAVE_OGG" = 'yes' -a "$HAVE_SPEEX" = 'yes'
312 AC_DEFUN([NEED_OPUS_OBJECTS], [{
313 test "$HAVE_OGG" = 'yes' -a "$HAVE_OPUS" = 'yes'
315 AC_DEFUN([NEED_FLAC_OBJECTS], [{
316 test "$HAVE_OGG" = 'yes' -a "$HAVE_FLAC" = 'yes'
318 ########################################################################### faad
320 LIB_ARG_WITH([faad], [-lfaad])
322 AC_CHECK_HEADER(neaacdec.h, [], HAVE_FAAD=no)
323 AC_CHECK_LIB([faad], [NeAACDecOpen], [], HAVE_FAAD=no)
324 LIB_SUBST_FLAGS(faad)
326 ########################################################################### mad
328 LIB_ARG_WITH([mad], [-lmad])
330 AC_CHECK_HEADER(mad.h, [], HAVE_MAD=no)
331 AC_CHECK_LIB([mad], [mad_stream_init], [], HAVE_MAD=no)
334 ###################################################################### libid3tag
336 LIB_ARG_WITH([id3tag], [-lid3tag -lz])
338 AC_CHECK_HEADER(id3tag.h, [], HAVE_ID3TAG=no)
339 AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
340 LIB_SUBST_FLAGS(id3tag)
342 ########################################################################### oss
344 LIB_ARG_WITH([oss], [])
345 AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=yes], [HAVE_OSS=no])
346 AC_CHECK_LIB(ossaudio, _oss_ioctl, [oss_ldflags="$oss_ldflags -lossaudio"], [])
349 ########################################################################### alsa
351 LIB_ARG_WITH([alsa], [-lasound])
353 AC_CHECK_HEADER(alsa/asoundlib.h, [], HAVE_ALSA=no)
354 AC_CHECK_LIB([asound], [snd_pcm_open], [], HAVE_ALSA=no)
355 LIB_SUBST_FLAGS(alsa)
357 ######################################################################### pthread
359 LIB_ARG_WITH([pthread], [-lpthread])
361 AC_CHECK_HEADER(pthread.h, [], HAVE_PTHREAD=no)
362 AC_CHECK_LIB([pthread], [pthread_create], [], HAVE_PTHREAD=no)
363 LIB_SUBST_FLAGS(pthread)
365 ########################################################################### libao
367 LIB_ARG_WITH([ao], [-lao])
369 AC_CHECK_HEADER(ao/ao.h, [], HAVE_AO=no)
370 AC_CHECK_LIB([ao], [ao_initialize], [], HAVE_AO=no)
373 AC_DEFUN([NEED_AO_OBJECTS], [{ test $HAVE_AO = yes -a $HAVE_PTHREAD = yes; }])
374 ######################################################################## readline
376 AC_SEARCH_LIBS([tgetent], [tinfo curses terminfo termcap])
377 LIB_ARG_WITH([readline], [-lreadline $LIBS])
379 AC_CHECK_HEADER([readline/readline.h], [], [HAVE_READLINE=no])
380 AC_CHECK_LIB([readline], [rl_free_keymap], [], HAVE_READLINE=no)
383 [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
387 #include <readline/readline.h>
390 LIB_SUBST_FLAGS(readline)
392 ############################################################# libsamplerate
394 LIB_ARG_WITH([samplerate], [-lsamplerate])
396 AC_CHECK_HEADER(samplerate.h, [], HAVE_SAMPLERATE=no)
397 AC_CHECK_LIB([samplerate], [src_process], [], HAVE_SAMPLERATE=no)
398 LIB_SUBST_FLAGS(samplerate)
400 ########################################################################## mp4v2
402 LIB_ARG_WITH([mp4v2], [-lmp4v2])
404 AC_CHECK_HEADER([mp4v2/mp4v2.h], [], [HAVE_MP4V2=no])
405 AC_CHECK_LIB([mp4v2], [MP4Read], [], [HAVE_MP4V2=no])
406 LIB_SUBST_FLAGS(mp4v2)
408 ######################################################################### server
409 if test -n "$CRYPTOLIB" && test $HAVE_OSL = yes; then
411 executables="$executables server"
412 server_cmdline_objs="server"
413 server_errlist_objs="
453 if test "$CRYPTOLIB" = openssl; then
454 server_errlist_objs="$server_errlist_objs crypt"
456 server_errlist_objs="$server_errlist_objs gcrypt"
458 NEED_OGG_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh_common"
459 NEED_VORBIS_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh"
460 NEED_SPEEX_OBJECTS() && server_errlist_objs="$server_errlist_objs spx_afh spx_common"
461 NEED_OPUS_OBJECTS() && server_errlist_objs="$server_errlist_objs opus_afh opus_common"
462 NEED_FLAC_OBJECTS && server_errlist_objs="$server_errlist_objs flac_afh"
463 if test $HAVE_FAAD = yes && test $HAVE_MP4V2 = yes; then
464 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
466 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
467 AC_SUBST(server_objs, add_dot_o($server_objs))
471 ############################################################# client
472 if test -n "$CRYPTOLIB"; then
474 executables="$executables client"
475 client_cmdline_objs="client"
476 client_errlist_objs="
493 if test "$CRYPTOLIB" = openssl; then
494 client_errlist_objs="$client_errlist_objs crypt"
496 client_errlist_objs="$client_errlist_objs gcrypt"
498 if test $HAVE_READLINE = yes; then
499 client_errlist_objs="$client_errlist_objs interactive"
501 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
502 AC_SUBST(client_objs, add_dot_o($client_objs))
506 ############################################################# audiod
507 if test -n "$CRYPTOLIB"; then
509 executables="$executables audiod"
510 audiod_audio_formats="wma"
511 audiod_cmdline_objs="$audiod_cmdline_objs
520 audiod_errlist_objs="$audiod_errlist_objs
559 if test "$CRYPTOLIB" = openssl; then
560 audiod_errlist_objs="$audiod_errlist_objs crypt"
562 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
564 if test "$have_core_audio" = "yes"; then
565 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
566 audiod_cmdline_objs="$audiod_cmdline_objs osx_write"
568 NEED_VORBIS_OBJECTS && {
569 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
570 audiod_audio_formats="$audiod_audio_formats ogg"
572 NEED_SPEEX_OBJECTS && {
573 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
574 audiod_audio_formats="$audiod_audio_formats spx"
576 NEED_OPUS_OBJECTS && {
577 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
578 audiod_audio_formats="$audiod_audio_formats opus"
580 NEED_FLAC_OBJECTS && {
581 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
582 audiod_audio_formats="$audiod_audio_formats flac"
584 if test $HAVE_FAAD = yes; then
585 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
586 audiod_audio_formats="$audiod_audio_formats aac"
588 if test $HAVE_MAD = yes; then
589 audiod_audio_formats="$audiod_audio_formats mp3"
590 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
591 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
593 if test $HAVE_OSS = yes; then
594 audiod_errlist_objs="$audiod_errlist_objs oss_write"
595 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
597 if test $HAVE_ALSA = yes; then
598 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
599 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
602 audiod_errlist_objs="$audiod_errlist_objs ao_write"
603 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
605 if test $HAVE_SAMPLERATE = yes; then
606 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
607 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
609 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
610 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
612 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
613 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
614 enum of audio formats supported by audiod)
615 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
616 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
620 ########################################################################### fade
621 if test $HAVE_OSS = yes -o $HAVE_ALSA = yes; then
623 executables="$executables fade"
624 fade_cmdline_objs="fade"
625 fade_errlist_objs="fade exec string fd version ggo"
626 if test $HAVE_OSS = yes; then
627 fade_errlist_objs="$fade_errlist_objs oss_mix"
628 mixers="${mixers}oss "
629 default_mixer="OSS_MIX"
631 if test $HAVE_ALSA = yes; then
632 fade_errlist_objs="$fade_errlist_objs alsa_mix"
633 mixers="${mixers}alsa "
634 default_mixer="ALSA_MIX"
636 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
637 AC_SUBST(fade_objs, add_dot_o($fade_objs))
640 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
643 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
644 enum of supported mixers)
645 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
646 use this mixer if none was specified)
647 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
648 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
651 printf 'extern void '$i'_mix_init(struct mixer *); '
654 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
655 init functions of the supported mixers)
656 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
657 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
660 AC_MSG_WARN([no mixer support])
662 ########################################################################### gui
663 if test $HAVE_CURSES = yes; then
665 executables="$executables gui"
666 gui_cmdline_objs="gui"
681 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
682 AC_SUBST(gui_objs, add_dot_o($gui_objs))
685 AC_MSG_WARN([no curses lib, cannot build para_gui])
687 ######################################################################## filter
697 filter_errlist_objs="
722 filter_cmdline_objs="
729 NEED_VORBIS_OBJECTS && {
730 filters="$filters oggdec"
731 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
733 NEED_SPEEX_OBJECTS && {
734 filters="$filters spxdec"
735 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
737 NEED_OPUS_OBJECTS && {
738 filters="$filters opusdec"
739 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
741 NEED_FLAC_OBJECTS && {
742 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
743 filters="$filters flacdec"
745 if test $HAVE_FAAD = yes; then
746 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
747 filters="$filters aacdec"
749 if test $HAVE_MAD = yes; then
750 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
751 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
752 filters="$filters mp3dec"
754 if test $HAVE_SAMPLERATE = yes; then
755 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
756 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
757 filters="$filters resample"
759 filters="$(echo $filters)"
761 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
763 AC_SUBST(filter_objs, add_dot_o($filter_objs))
765 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
766 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
767 enum of supported filters)
768 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
769 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
770 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
771 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
772 ########################################################################## recv
797 NEED_OGG_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
798 NEED_VORBIS_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh"
799 NEED_SPEEX_OBJECTS && recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
800 NEED_OPUS_OBJECTS && recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
801 NEED_FLAC_OBJECTS && recv_errlist_objs="$recv_errlist_objs flac_afh"
803 if test $HAVE_FAAD = yes -a $HAVE_MP4V2 = yes; then
804 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
806 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
807 AC_SUBST(recv_objs, add_dot_o($recv_objs))
808 ########################################################################### afh
809 audio_format_handlers="mp3 wma"
810 afh_cmdline_objs="afh"
823 NEED_OGG_OBJECTS && afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
824 NEED_VORBIS_OBJECTS && {
825 afh_errlist_objs="$afh_errlist_objs ogg_afh"
826 audio_format_handlers="$audio_format_handlers ogg"
828 NEED_SPEEX_OBJECTS && {
829 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
830 audio_format_handlers="$audio_format_handlers spx"
832 NEED_OPUS_OBJECTS && {
833 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
834 audio_format_handlers="$audio_format_handlers opus"
836 NEED_FLAC_OBJECTS && {
837 afh_errlist_objs="$afh_errlist_objs flac_afh"
838 audio_format_handlers="$audio_format_handlers flac"
840 if test $HAVE_FAAD = yes -a $HAVE_MP4V2 = yes; then
841 afh_errlist_objs="$afh_errlist_objs aac_afh aac_common"
842 audio_format_handlers="$audio_format_handlers aac"
845 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
847 AC_SUBST(afh_objs, add_dot_o($afh_objs))
848 ########################################################################## play
890 if test "$have_core_audio" = "yes"; then
891 play_errlist_objs="$play_errlist_objs osx_write ipc"
892 play_cmdline_objs="$play_cmdline_objs osx_write"
894 NEED_OGG_OBJECTS && play_errlist_objs="$play_errlist_objs ogg_afh_common"
895 NEED_VORBIS_OBJECTS && {
896 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
898 NEED_SPEEX_OBJECTS && {
899 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
902 play_errlist_objs="$play_errlist_objs
907 NEED_FLAC_OBJECTS && {
908 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
910 if test $HAVE_FAAD = yes; then
911 play_errlist_objs="$play_errlist_objs aacdec_filter"
913 if test $HAVE_MP4V2 = yes; then
914 play_errlist_objs="$play_errlist_objs aac_afh"
916 if test $HAVE_MP4V2 = yes || test $HAVE_FAAD = yes; then
917 play_errlist_objs="$play_errlist_objs aac_common"
919 if test $HAVE_MAD = yes; then
920 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
921 play_errlist_objs="$play_errlist_objs mp3dec_filter"
923 if test $HAVE_OSS = yes; then
924 play_errlist_objs="$play_errlist_objs oss_write"
925 play_cmdline_objs="$play_cmdline_objs oss_write"
927 if test $HAVE_ALSA = yes; then
928 play_errlist_objs="$play_errlist_objs alsa_write"
929 play_cmdline_objs="$play_cmdline_objs alsa_write"
932 play_errlist_objs="$play_errlist_objs ao_write"
933 play_cmdline_objs="$play_cmdline_objs ao_write"
935 if test $HAVE_READLINE = yes; then
936 play_errlist_objs="$play_errlist_objs interactive"
938 if test $HAVE_SAMPLERATE = yes; then
939 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
940 play_cmdline_objs="$play_cmdline_objs resample_filter"
943 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
944 AC_SUBST(play_objs, add_dot_o($play_objs))
945 ######################################################################### write
965 default_writer="FILE_WRITE"
967 if test "$have_core_audio" = "yes"; then
968 write_errlist_objs="$write_errlist_objs osx_write ipc"
969 write_cmdline_objs="$write_cmdline_objs osx_write"
970 writers="$writers osx"
971 default_writer="OSX_WRITE"
974 write_errlist_objs="$write_errlist_objs ao_write"
975 write_cmdline_objs="$write_cmdline_objs ao_write"
976 writers="$writers ao"
977 default_writer="AO_WRITE"
979 if test $HAVE_OSS = yes; then
980 write_errlist_objs="$write_errlist_objs oss_write"
981 write_cmdline_objs="$write_cmdline_objs oss_write"
982 writers="$writers oss"
983 default_writer="OSS_WRITE"
985 if test $HAVE_ALSA = yes; then
986 write_errlist_objs="$write_errlist_objs alsa_write"
987 write_cmdline_objs="$write_cmdline_objs alsa_write"
988 writers="$writers alsa"
989 default_writer="ALSA_WRITE"
992 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
993 AC_SUBST(write_objs, add_dot_o($write_objs))
994 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
995 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
996 enum of supported writers)
997 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
998 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
999 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1000 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1001 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1002 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1003 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1004 ######################################################################## audioc
1005 audioc_errlist_objs="
1012 if test $HAVE_READLINE = yes; then
1013 audioc_errlist_objs="$audioc_errlist_objs
1020 audioc_objs="$audioc_errlist_objs"
1021 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1022 ################################################################## status items
1024 status_items="basename status num_played mtime bitrate frequency file_size
1025 status_flags format score techinfo afs_mode
1026 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1027 offset seconds_total stream_start current_time audiod_uptime image_id
1028 lyrics_id duration directory lyrics_name image_name path hash channels
1029 last_played num_chunks chunk_time amplification artist title year album
1033 for i in $status_items; do
1034 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1036 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1037 [enum of all status items])
1040 for i in $status_items; do
1041 result="$result \"$i\", "
1043 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1044 [char * array of all status items])
1046 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1047 [formats supported by para_server and para_afh])
1049 AC_SUBST(executables)
1053 paraslash configuration:
1054 ~~~~~~~~~~~~~~~~~~~~~~~~
1055 crypto lib: ${CRYPTOLIB:-[none]}
1056 unix socket credentials: $have_ucred
1057 readline (interactive CLIs): $HAVE_READLINE
1058 id3 version 2 support: $HAVE_ID3TAG
1062 audio format handlers: $audio_format_handlers
1063 filters: $(echo $filters)
1066 para_server: $build_server
1067 para_gui: $build_gui
1068 para_fade: $build_fade
1069 para_client: $build_client
1070 para_audiod: $build_audiod