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_PATH_PROG(UNAMEPATH, uname, no)
69 if test "$UNAMEPATH" = "no"; then
70 AC_MSG_ERROR(unable to determine system type)
72 AC_MSG_CHECKING(os type)
73 OSTYPE="`$UNAMEPATH -s`"
74 AC_MSG_RESULT("$OSTYPE")
76 if test "$OSTYPE" = "SunOS"; then
77 # needed on SunOS for socket magic
78 arch_cppflags="-D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
79 AC_SUBST(arch_cppflags)
84 AC_PATH_PROG([gengetopt], [gengetopt])
85 test -z "$gengetopt" && AC_MSG_ERROR(
86 [gengetopt is required to build this package])
88 AC_PATH_PROG([help2man], [help2man])
89 test -z "$help2man" && AC_MSG_ERROR(
90 [help2man is required to build this package])
92 AC_PATH_PROG([install], [install])
93 test -z "$install" && AC_MSG_ERROR(
94 [The install program is required to build this package])
99 executables="recv filter audioc write afh play"
100 ################################################################## clock_gettime
102 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
103 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
105 if test -n "$clock_gettime_lib"; then
106 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
107 define to 1 if clock_gettime() is supported])
109 if test "$clock_gettime_lib" = "rt"; then
110 AC_SUBST(clock_gettime_ldflags, -lrt)
113 ########################################################################### osl
115 LIB_ARG_WITH([osl], [-losl])
117 AC_CHECK_HEADER(osl.h, [], [HAVE_OSL=no])
118 AC_CHECK_LIB([osl], [osl_open_table], [], [HAVE_OSL=no])
121 ########################################################################### crypto
122 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
123 Force using crypto library "lib". This package requires either
124 openssl or libgcrypt being installed. Possible values for "lib"
125 are thus "openssl" and "gcrypt". If this option is not given,
126 openssl is tried first. If openssl was not found, gcrypt is
129 case "$enable_cryptolib" in
130 "openssl") check_openssl="yes"; check_gcrypt="no";;
131 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
132 "") check_openssl="yes"; check_gcrypt="yes";;
133 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
135 ###################################################################### openssl
136 if test "$check_openssl" = "yes"; then
137 OLD_CPPFLAGS="$CPPFLAGS"
138 OLD_LDFLAGS="$LDFLAGS"
141 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
142 [look for openssl headers also in dir])])
143 if test -n "$with_openssl_headers"; then
144 openssl_cppflags="-I$with_openssl_headers"
145 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
147 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
148 [look for openssl libraries also in dir])])
149 if test -n "$with_openssl_libs"; then
150 openssl_libs="-L$with_openssl_libs"
151 LDFLAGS="$LDFLAGS $openssl_libs"
153 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
154 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
155 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
156 # try harder: openssl is sometimes installed in /usr/local/ssl
157 openssl_cppflags="-I/usr/local/ssl/include"
158 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
159 openssl_libs="-L/usr/local/ssl/lib"
160 LDFLAGS="$LDFLAGS $openssl_libs"
162 unset ac_cv_header_openssl_ssl_h 2> /dev/null
163 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
164 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
165 if test "$have_openssl" = "yes"; then
166 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
169 if test "$have_openssl" = "yes"; then
170 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
171 AC_SUBST(openssl_cppflags)
172 openssl_ldflags="$openssl_libs -lssl -lcrypto"
173 AC_SUBST(openssl_ldflags)
177 AC_MSG_WARN([openssl libraries not found])
179 CPPFLAGS="$OLD_CPPFLAGS"
180 LDFLAGS="$OLD_LDFLAGS"
185 ########################################################################### gcrypt
186 if test "$check_gcrypt" = "yes"; then
187 OLD_CPPFLAGS="$CPPFLAGS"
188 OLD_LDFLAGS="$LDFLAGS"
191 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
192 [look for gcrypt headers also in dir])])
193 if test -n "$with_gcrypt_headers"; then
194 gcrypt_cppflags="-I$with_gcrypt_headers"
195 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
197 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
198 [look for libgcrypt also in dir])])
199 if test -n "$with_gcrypt_libs"; then
200 gcrypt_libs="-L$with_gcrypt_libs"
201 LDFLAGS="$LDFLAGS $gcrypt_libs"
203 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
204 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
205 if test "$have_gcrypt" = "yes"; then
206 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
207 AC_SUBST(gcrypt_cppflags)
208 gcrypt_ldflags="$gcrypt_libs -lgcrypt"
209 AC_SUBST(gcrypt_ldflags)
211 AC_MSG_WARN([gcrypt library not found])
213 CPPFLAGS="$OLD_CPPFLAGS"
214 LDFLAGS="$OLD_LDFLAGS"
219 ########################################################################### libsocket
220 AC_CHECK_LIB([c], [socket],
222 [socket_ldflags="-lsocket"]
224 AC_SUBST(socket_ldflags)
225 ########################################################################### libnsl
226 AC_CHECK_LIB([c], [gethostbyname],
228 [nsl_ldflags="-lnsl"]
230 AC_SUBST(nsl_ldflags)
231 ########################################################################### ucred
232 AC_MSG_CHECKING(for struct ucred)
233 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
235 #include <sys/types.h>
236 #include <sys/socket.h>
238 struct ucred sucred; sucred.pid=0;
239 ]])],[have_ucred=yes],[have_ucred=no])
240 AC_MSG_RESULT($have_ucred)
241 if test ${have_ucred} = yes; then
242 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
244 ########################################################################### gengetopt
245 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
247 [gengetopt_args_info_description],
248 [ggo_descriptions_declared=yes],
249 [ggo_descriptions_declared=no],
250 [#include "conftest-ggo.h"]
252 AC_SUBST(ggo_descriptions_declared)
253 ########################################################################### curses
255 OLD_CPPFLAGS="$CPPFLAGS"
256 OLD_LDFLAGS="$LDFLAGS"
258 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
259 [look for curses.h also in dir])])
260 if test -n "$with_curses_headers"; then
261 curses_cppflags="-I$with_curses_headers"
262 CPPFLAGS="$CPPFLAGS $curses_cppflags"
264 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
265 [look for libcurses also in dir])])
266 if test -n "$with_curses_libs"; then
267 curses_libs="-L$with_curses_libs"
268 LDFLAGS="$LDFLAGS $curses_libs"
270 AC_CHECK_HEADER(curses.h, [], [
273 curses_ldflags="$curses_libs"
274 AC_CHECK_LIB([ncursesw], [initscr],
275 [curses_ldflags="$curses_libs -lncursesw"], [
276 AC_CHECK_LIB([curses], [initscr],
277 [curses_ldflags="$curses_libs -lcurses"],
282 AC_SUBST(curses_cppflags)
283 AC_SUBST(curses_ldflags)
284 CPPFLAGS="$OLD_CPPFLAGS"
285 LDFLAGS="$OLD_LDFLAGS"
287 ########################################################################### ip_mreqn
288 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
289 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
295 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
296 AC_MSG_RESULT($have_ip_mreqn)
297 if test ${have_ip_mreqn} = yes; then
298 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
300 ########################################################################### osx
302 AC_MSG_CHECKING(for CoreAudio (MacOs))
303 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
304 #include <CoreAudio/CoreAudio.h>
307 ]])],[have_core_audio=yes],[have_core_audio=no])
308 AC_MSG_RESULT($have_core_audio)
309 if test ${have_core_audio} = yes; then
310 f1="-framework CoreAudio"
311 f2="-framework AudioToolbox"
312 f3="-framework AudioUnit"
313 f4="-framework CoreServices"
314 core_audio_ldflags="$f1 $f2 $f3 $f4"
315 AC_SUBST(core_audio_ldflags)
316 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
318 ####################################################### ogg/vorbis/speex/opus
320 OLD_CPPFLAGS="$CPPFLAGS"
321 OLD_LDFLAGS="$LDFLAGS"
323 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
324 [look for ogg headers also in dir])])
325 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
326 [look for ogg libs also in dir])])
327 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
328 [look for vorbis headers also in dir])])
329 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
330 [look for vorbis libs also in dir])])
331 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
332 [look for speex headers also in dir])])
333 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
334 [look for speex libs also in dir])])
335 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
336 [look for opus headers also in dir])])
337 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
338 [look for opus libs also in dir])])
340 if test -n "$with_ogg_headers"; then
341 ogg_cppflags="-I$with_ogg_headers"
342 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
344 if test -n "$with_ogg_libs"; then
345 ogg_libs="-L$with_ogg_libs"
346 LDFLAGS="$LDFLAGS $ogg_libs"
348 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
349 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
350 CPPFLAGS="$OLD_CPPFLAGS"
351 LDFLAGS="$OLD_LDFLAGS"
357 if test "$have_ogg" = "yes"; then
358 OLD_CPPFLAGS="$CPPFLAGS"
359 OLD_LDFLAGS="$LDFLAGS"
362 if test -n "$with_vorbis_headers"; then
363 vorbis_cppflags="-I$with_vorbis_headers"
364 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
366 if test -n "$with_vorbis_libs"; then
367 vorbis_libs="-L$with_vorbis_libs"
368 LDFLAGS="$LDFLAGS $vorbis_libs"
370 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
371 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
372 CPPFLAGS="$OLD_CPPFLAGS"
373 LDFLAGS="$OLD_LDFLAGS"
377 OLD_CPPFLAGS="$CPPFLAGS"
378 OLD_LDFLAGS="$LDFLAGS"
380 if test -n "$with_speex_headers"; then
381 speex_cppflags="-I$with_speex_headers"
382 CPPFLAGS="$CPPFLAGS $speex_cppflags"
384 if test -n "$with_speex_libs"; then
385 speex_libs="-L$with_speex_libs"
386 LDFLAGS="$LDFLAGS $speex_libs"
388 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
389 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
390 CPPFLAGS="$OLD_CPPFLAGS"
391 LDFLAGS="$OLD_LDFLAGS"
395 OLD_CPPFLAGS="$CPPFLAGS"
396 OLD_LDFLAGS="$LDFLAGS"
398 if test -n "$with_opus_headers"; then
399 opus_cppflags="-I$with_opus_headers"
400 CPPFLAGS="$CPPFLAGS $opus_cppflags"
402 if test -n "$with_opus_libs"; then
403 opus_libs="-L$with_opus_libs"
404 LDFLAGS="$LDFLAGS $opus_libs"
406 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
407 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
408 CPPFLAGS="$OLD_CPPFLAGS"
409 LDFLAGS="$OLD_LDFLAGS"
412 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
418 msg="support in para_server/para_filter/para_afh"
419 if test "$have_vorbis" = "yes" || \
420 test "$have_speex" = "yes" || \
421 test "$have_opus" = "yes"; then
422 AC_SUBST(ogg_cppflags)
423 ogg_ldflags="$ogg_libs -logg"
424 if test "$OSTYPE" = "Darwin"; then
425 ogg_ldflags="-Wl,-bind_at_load $ogg_ldflags"
427 AC_SUBST(ogg_ldflags)
429 if test "$have_vorbis" = "yes"; then
430 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
431 AC_SUBST(vorbis_cppflags)
432 vorbis_ldflags="$vorbis_libs -lvorbis -lvorbisfile"
433 AC_SUBST(vorbis_ldflags)
435 if test "$have_speex" = "yes"; then
436 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
437 AC_SUBST(speex_cppflags)
438 speex_ldflags="$speex_libs -lspeex"
439 AC_SUBST(speex_ldflags)
441 AC_MSG_WARN([no ogg/speex $msg])
443 if test "$have_opus" = "yes"; then
444 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
445 AC_SUBST(opus_cppflags)
446 opus_ldflags="$opus_libs -lopus"
447 AC_SUBST(opus_ldflags)
448 audio_format_handlers="$audio_format_handlers opus"
450 AC_MSG_WARN([no ogg/opus $msg])
452 ########################################################################### faad
454 OLD_CPPFLAGS="$CPPFLAGS"
455 OLD_LDFLAGS="$LDFLAGS"
457 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
458 [look for neaacdec.h also in dir])])
459 if test -n "$with_faad_headers"; then
460 faad_cppflags="-I$with_faad_headers"
461 CPPFLAGS="$CPPFLAGS $faad_cppflags"
463 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
464 [look for libfaad also in dir])])
465 if test -n "$with_faad_libs"; then
466 faad_libs="-L$with_faad_libs"
467 LDFLAGS="$LDFLAGS $faad_libs"
469 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
470 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
471 if test "$have_faad" = "yes"; then
472 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
473 AC_SUBST(faad_cppflags)
474 faad_ldflags="$faad_libs -lfaad"
475 AC_SUBST(faad_ldflags)
477 CPPFLAGS="$OLD_CPPFLAGS"
478 LDFLAGS="$OLD_LDFLAGS"
480 ########################################################################### mad
482 OLD_CPPFLAGS="$CPPFLAGS"
483 OLD_LDFLAGS="$LDFLAGS"
486 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
487 [look for mad.h also in dir])])
488 if test -n "$with_mad_headers"; then
489 mad_cppflags="-I$with_mad_headers"
490 CPPFLAGS="$CPPFLAGS $mad_cppflags"
492 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
493 [look for libmad also in dir])])
494 if test -n "$with_mad_libs"; then
495 mad_libs="-L$with_mad_libs"
496 LDFLAGS="$LDFLAGS $mad_libs"
498 AC_CHECK_HEADERS([mad.h], [], [
501 AC_CHECK_LIB([mad], [mad_stream_init], [], [
504 if test "$have_mad" = "yes"; then
505 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
506 AC_SUBST(mad_cppflags)
507 mad_ldflags="$mad_libs -lmad"
508 AC_SUBST(mad_ldflags)
510 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
512 CPPFLAGS="$OLD_CPPFLAGS"
513 LDFLAGS="$OLD_LDFLAGS"
515 ###################################################################### libid3tag
516 OLD_CPPFLAGS="$CPPFLAGS"
517 OLD_LDFLAGS="$LDFLAGS"
521 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
522 [look for id3tag header files also in dir])])
523 if test -n "$with_id3tag_headers"; then
524 id3tag_cppflags="-I$with_id3tag_headers"
525 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
527 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
528 [look for id3tag libs also in dir])])
529 if test -n "$with_id3tag_libs"; then
530 id3tag_libs="-L$with_id3tag_libs"
531 LDFLAGS="$LDFLAGS $id3tag_libs"
534 AC_MSG_CHECKING(for libid3tag)
535 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
538 struct id3_tag t = {.flags = 0};
539 ]])],[],[have_libid3tag=no])
540 AC_MSG_RESULT($have_libid3tag)
542 if test ${have_libid3tag} = yes; then
543 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
544 AC_SUBST(id3tag_cppflags)
545 AC_SUBST(id3tag_ldflags, "$id3tag_libs -lid3tag -lz")
547 CPPFLAGS="$OLD_CPPFLAGS"
548 LDFLAGS="$OLD_LDFLAGS"
550 ########################################################################### flac
551 OLD_CPPFLAGS="$CPPFLAGS"
552 OLD_LDFLAGS="$LDFLAGS"
556 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
557 [look for flac headers also in dir])])
558 if test -n "$with_flac_headers"; then
559 flac_cppflags="-I$with_flac_headers"
560 CPPFLAGS="$CPPFLAGS $flac_cppflags"
562 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
563 [look for flac libs also in dir])])
564 if test -n "$with_flac_libs"; then
565 flac_libs="-L$with_flac_libs"
566 LDFLAGS="$LDFLAGS $flac_libs"
568 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
569 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], [
570 # nope, try again with -logg
571 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [],
572 have_flac=no, -lm -logg)
574 if test "$have_flac" = "yes"; then
575 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
576 AC_SUBST(flac_cppflags)
577 flac_ldflags="$flac_libs -lFLAC"
578 AC_SUBST(flac_ldflags)
580 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
582 CPPFLAGS="$OLD_CPPFLAGS"
583 LDFLAGS="$OLD_LDFLAGS"
585 ########################################################################### oss
586 OLD_CPPFLAGS="$CPPFLAGS"
587 OLD_LDFLAGS="$LDFLAGS"
591 msg="=> will not build oss writer"
593 AC_CHECK_HEADER(sys/soundcard.h, [
594 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
595 oss_ldflags="-lossaudio"
596 AC_SUBST(oss_ldflags)
602 AC_MSG_WARN([no sys/soundcard.h $msg])
605 CPPFLAGS="$OLD_CPPFLAGS"
606 LDFLAGS="$OLD_LDFLAGS"
609 ########################################################################### alsa
610 OLD_CPPFLAGS="$CPPFLAGS"
611 OLD_LDFLAGS="$LDFLAGS"
614 msg="=> no alsa support for para_audiod/para_write"
615 if test "$OSTYPE" != "Linux"; then
620 if test "$have_alsa" = "yes"; then
621 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
623 AC_MSG_WARN([no alsa/asoundlib $msg])
627 if test "$have_alsa" = "yes"; then
628 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
630 AC_MSG_WARN([no libasound $msg])
634 if test "$have_alsa" = "yes"; then
635 alsa_ldflags="-lasound"
636 AC_SUBST(alsa_ldflags)
639 CPPFLAGS="$OLD_CPPFLAGS"
640 LDFLAGS="$OLD_LDFLAGS"
642 ########################################################################### libao
643 OLD_CPPFLAGS="$CPPFLAGS"
644 OLD_LDFLAGS="$LDFLAGS"
648 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
649 [look for ao/ao.h also in dir])])
650 if test -n "$with_ao_headers"; then
651 ao_cppflags="-I$with_ao_headers"
652 CPPFLAGS="$CPPFLAGS $ao_cppflags"
654 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
655 [look for libao also in dir])])
656 if test -n "$with_ao_libs"; then
657 ao_libs="-L$with_ao_libs"
658 LDFLAGS="$LDFLAGS $ao_libs"
660 msg="no libao support for para_audiod/para_write"
661 AC_CHECK_HEADERS([ao/ao.h], [
664 AC_MSG_WARN([ao.h not found, $msg])
666 if test "$have_ao" = "yes"; then
667 AC_CHECK_LIB([ao], [ao_initialize], [], [
669 AC_MSG_WARN([ao lib not found or not working, $msg])
672 if test "$have_ao" = "yes"; then
673 AC_CHECK_HEADERS([pthread.h], [
676 AC_MSG_WARN([pthread.h not found, $msg])
679 if test "$have_ao" = "yes"; then
680 AC_CHECK_LIB([pthread], [pthread_create], [], [
682 AC_MSG_WARN([pthread lib not found or not working, $msg])
685 if test "$have_ao" = "yes"; then
686 AC_SUBST(ao_cppflags)
687 ao_ldflags="$ao_libs -lao -lpthread"
691 CPPFLAGS="$OLD_CPPFLAGS"
692 LDFLAGS="$OLD_LDFLAGS"
694 ############################################################# readline
695 OLD_CPPFLAGS="$CPPFLAGS"
696 OLD_LDFLAGS="$LDFLAGS"
700 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
701 [look for libreadline header files also in dir])])
702 if test -n "$with_readline_headers"; then
703 readline_cppflags="-I$with_readline_headers"
704 CPPFLAGS="$CPPFLAGS $readline_cppflags"
707 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
708 [look for readline library also in dir])])
709 if test -n "$with_readline_libs"; then
710 readline_libs="-L$with_readline_libs"
711 LDFLAGS="$LDFLAGS $readline_libs"
713 msg="no interactive cli support"
714 AC_CHECK_HEADERS([readline/readline.h], [
717 AC_MSG_WARN([readline/readline.h not found, $msg])
720 if test "$have_readline" = "yes"; then
721 readline_ldflags="$readline_libs"
722 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
723 readline_ldflags="$readline_ldflags -lreadline"
724 ], [have_readline="no"])
725 if test "$have_readline" = "no"; then # try with -lcurses
727 AC_MSG_NOTICE([trying again with -lcurses])
728 unset ac_cv_search_rl_free_keymap 2> /dev/null
729 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
731 readline_ldflags="$readline_ldflags -lreadline -lcurses"
734 if test "$have_readline" = "no"; then # try with -ltermcap
736 AC_MSG_NOTICE([trying again with -ltermcap])
737 unset ac_cv_search_rl_free_keymap 2> /dev/null
738 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
740 readline_ldflags="$readline_ldflags -lreadline -ltermcap"
745 if test "$have_readline" = "yes"; then
748 [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
752 #include <readline/readline.h>
755 AC_SUBST(readline_cppflags)
756 AC_SUBST(readline_ldflags)
757 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
759 AC_MSG_WARN([libreadline not found or unusable])
761 CPPFLAGS="$OLD_CPPFLAGS"
762 LDFLAGS="$OLD_LDFLAGS"
764 ############################################################# libsamplerate
765 OLD_CPPFLAGS="$CPPFLAGS"
766 OLD_LDFLAGS="$LDFLAGS"
769 have_samplerate="yes"
770 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
771 [look for samplerate headers also in dir])])
772 if test -n "$with_samplerate_headers"; then
773 samplerate_cppflags="-I$with_samplerate_headers"
774 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
776 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
777 [look for samplerate libs also in dir])])
778 if test -n "$with_samplerate_libs"; then
779 samplerate_libs="-L$with_samplerate_libs"
780 LDFLAGS="$LDFLAGS $samplerate_libs"
783 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
784 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
786 if test "$have_samplerate" = "yes"; then
787 AC_SUBST(samplerate_cppflags)
788 samplerate_ldflags="$samplerate_libs -lsamplerate"
789 AC_SUBST(samplerate_ldflags)
791 AC_MSG_WARN([no resample support in para_audiod/para_filter])
793 CPPFLAGS="$OLD_CPPFLAGS"
794 LDFLAGS="$OLD_LDFLAGS"
796 ######################################################################### server
797 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
798 -a "$HAVE_OSL" = "yes" ; then
801 executables="$executables server"
802 server_cmdline_objs="server"
803 server_errlist_objs="
842 if test "$have_openssl" = "yes"; then
843 server_errlist_objs="$server_errlist_objs crypt"
845 if test "$have_gcrypt" = "yes"; then
846 server_errlist_objs="$server_errlist_objs gcrypt"
848 if test "$have_vorbis" = "yes" || \
849 test "$have_speex" = "yes" || \
850 test "$have_opus" = "yes"; then
851 server_errlist_objs="$server_errlist_objs ogg_afh_common"
853 if test "$have_vorbis" = "yes"; then
854 server_errlist_objs="$server_errlist_objs ogg_afh"
856 if test "$have_speex" = "yes"; then
857 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
859 if test "$have_opus" = "yes"; then
860 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
862 if test "$have_faad" = "yes"; then
863 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
865 if test "$have_flac" = "yes"; then
866 server_errlist_objs="$server_errlist_objs flac_afh"
868 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
869 AC_SUBST(server_objs, add_dot_o($server_objs))
870 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
871 objlist_to_errlist($server_errlist_objs), errors used by para_server)
875 ############################################################# client
876 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
878 executables="$executables client"
879 client_cmdline_objs="client"
880 client_errlist_objs="
896 if test "$have_openssl" = "yes"; then
897 client_errlist_objs="$client_errlist_objs crypt"
899 if test "$have_gcrypt" = "yes"; then
900 client_errlist_objs="$client_errlist_objs gcrypt"
902 if test "$have_readline" = "yes"; then
903 client_errlist_objs="$client_errlist_objs interactive"
905 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
906 AC_SUBST(client_objs, add_dot_o($client_objs))
907 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
908 objlist_to_errlist($client_errlist_objs), errors used by para_client)
912 ############################################################# audiod
913 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
915 executables="$executables audiod"
916 audiod_audio_formats="wma"
917 audiod_cmdline_objs="$audiod_cmdline_objs
929 audiod_errlist_objs="$audiod_errlist_objs
967 if test "$have_openssl" = "yes"; then
968 audiod_errlist_objs="$audiod_errlist_objs crypt"
970 if test "$have_gcrypt" = "yes"; then
971 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
973 if test "$have_core_audio" = "yes"; then
974 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
975 audiod_cmdline_objs="$audiod_cmdline_objs osx_write"
977 if test "$have_vorbis" = "yes"; then
978 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
979 audiod_audio_formats="$audiod_audio_formats ogg"
981 if test "$have_speex" = "yes"; then
982 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
983 audiod_audio_formats="$audiod_audio_formats spx"
985 if test "$have_opus" = "yes"; then
986 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
987 audiod_audio_formats="$audiod_audio_formats opus"
989 if test "$have_faad" = "yes"; then
990 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
991 audiod_audio_formats="$audiod_audio_formats aac"
993 if test "$have_mad" = "yes"; then
994 audiod_audio_formats="$audiod_audio_formats mp3"
995 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
996 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
998 if test "$have_flac" = "yes"; then
999 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
1000 audiod_audio_formats="$audiod_audio_formats flac"
1002 if test "$have_oss" = "yes"; then
1003 audiod_errlist_objs="$audiod_errlist_objs oss_write"
1004 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
1006 if test "$have_alsa" = "yes"; then
1007 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
1008 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
1010 if test "$have_ao" = "yes"; then
1011 audiod_errlist_objs="$audiod_errlist_objs ao_write"
1012 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
1014 if test "$have_samplerate" = "yes"; then
1015 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1016 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
1018 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
1019 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1020 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1021 errors used by para_audiod)
1023 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1024 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1025 enum of audio formats supported by audiod)
1026 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1027 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1031 ########################################################################### fade
1032 if test "$have_oss" = "yes" -o "$have_alsa" = "yes"; then
1034 executables="$executables fade"
1035 fade_cmdline_objs="fade"
1036 fade_errlist_objs="fade exec string fd version ggo"
1037 if test "$have_oss" = "yes"; then
1038 fade_errlist_objs="$fade_errlist_objs oss_mix"
1039 mixers="${mixers}oss "
1040 default_mixer="OSS_MIX"
1042 if test "$have_alsa" = "yes"; then
1043 fade_errlist_objs="$fade_errlist_objs alsa_mix"
1044 mixers="${mixers}alsa "
1045 default_mixer="ALSA_MIX"
1047 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
1048 AC_SUBST(fade_objs, add_dot_o($fade_objs))
1049 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
1050 objlist_to_errlist($fade_errlist_objs),
1051 errors used by para_fade)
1053 for i in $mixers; do
1054 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
1057 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
1058 enum of supported mixers)
1059 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
1060 use this mixer if none was specified)
1061 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
1062 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
1064 for i in $mixers; do
1065 printf 'extern void '$i'_mix_init(struct mixer *); '
1068 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
1069 init functions of the supported mixers)
1070 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
1071 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
1074 AC_MSG_WARN([no mixer support])
1076 ########################################################################### gui
1077 if test "$have_curses" = "yes"; then
1079 executables="$executables gui"
1080 gui_cmdline_objs="gui"
1095 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
1096 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1097 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1098 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1101 AC_MSG_WARN([no curses lib, cannot build para_gui])
1103 ######################################################################## filter
1113 filter_errlist_objs="
1138 filter_cmdline_objs="
1146 if test "$have_vorbis" = "yes"; then
1147 filters="$filters oggdec"
1148 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
1150 if test "$have_speex" = "yes"; then
1151 filters="$filters spxdec"
1152 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
1154 if test "$have_opus" = "yes"; then
1155 filters="$filters opusdec"
1156 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
1158 if test "$have_faad" = "yes"; then
1159 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
1160 filters="$filters aacdec"
1162 if test "$have_mad" = "yes"; then
1163 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
1164 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
1165 filters="$filters mp3dec"
1167 if test "$have_flac" = "yes"; then
1168 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
1169 filters="$filters flacdec"
1171 if test "$have_samplerate" = "yes"; then
1172 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1173 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
1174 filters="$filters resample"
1176 filters="$(echo $filters)"
1178 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
1180 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1181 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1182 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1184 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1185 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1186 enum of supported filters)
1187 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1188 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1189 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1190 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1191 ########################################################################## recv
1221 if test "$have_vorbis" = "yes" || \
1222 test "$have_speex" = "yes" || \
1223 test "$have_opus" = "yes"; then
1224 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
1226 if test "$have_vorbis" = "yes"; then
1227 recv_errlist_objs="$recv_errlist_objs ogg_afh"
1229 if test "$have_speex" = "yes"; then
1230 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
1232 if test "$have_opus" = "yes"; then
1233 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
1235 if test "$have_faad" = "yes"; then
1236 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
1238 if test "$have_flac" = "yes"; then
1239 recv_errlist_objs="$recv_errlist_objs flac_afh"
1241 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
1242 AC_SUBST(receivers, "http dccp udp afh")
1243 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1244 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1245 errors used by para_recv)
1246 ########################################################################### afh
1247 audio_format_handlers="mp3 wma"
1248 afh_cmdline_objs="afh"
1261 if test "$have_vorbis" = "yes" || \
1262 test "$have_speex" = "yes" || \
1263 test "$have_opus" = "yes"; then
1264 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
1266 if test "$have_vorbis" = "yes"; then
1267 afh_errlist_objs="$afh_errlist_objs ogg_afh"
1268 audio_format_handlers="$audio_format_handlers ogg"
1270 if test "$have_speex" = "yes"; then
1271 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
1272 audio_format_handlers="$audio_format_handlers spx"
1274 if test "$have_opus" = "yes"; then
1275 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
1276 audio_format_handlers="$audio_format_handlers opus"
1278 if test "$have_faad" = "yes"; then
1279 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
1280 audio_format_handlers="$audio_format_handlers aac"
1282 if test "$have_flac" = "yes"; then
1283 afh_errlist_objs="$afh_errlist_objs flac_afh"
1284 audio_format_handlers="$audio_format_handlers flac"
1287 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
1289 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1290 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1291 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1292 ########################################################################## play
1338 if test "$have_core_audio" = "yes"; then
1339 play_errlist_objs="$play_errlist_objs osx_write ipc"
1340 play_cmdline_objs="$play_cmdline_objs osx_write"
1342 if test "$have_vorbis" = "yes" || \
1343 test "$have_speex" = "yes" || \
1344 test "$have_opus" = "yes"; then
1345 play_errlist_objs="$play_errlist_objs ogg_afh_common"
1347 if test "$have_vorbis" = "yes"; then
1348 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
1350 if test "$have_speex" = "yes"; then
1351 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
1353 if test "$have_opus" = "yes"; then
1354 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
1356 if test "$have_faad" = "yes"; then
1357 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
1359 if test "$have_mad" = "yes"; then
1360 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
1361 play_errlist_objs="$play_errlist_objs mp3dec_filter"
1363 if test "$have_flac" = "yes"; then
1364 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
1366 if test "$have_oss" = "yes"; then
1367 play_errlist_objs="$play_errlist_objs oss_write"
1368 play_cmdline_objs="$play_cmdline_objs oss_write"
1370 if test "$have_alsa" = "yes"; then
1371 play_errlist_objs="$play_errlist_objs alsa_write"
1372 play_cmdline_objs="$play_cmdline_objs alsa_write"
1374 if test "$have_ao" = "yes"; then
1375 play_errlist_objs="$play_errlist_objs ao_write"
1376 play_cmdline_objs="$play_cmdline_objs ao_write"
1378 if test "$have_readline" = "yes"; then
1379 play_errlist_objs="$play_errlist_objs interactive"
1381 if test "$have_samplerate" = "yes"; then
1382 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1383 play_cmdline_objs="$play_cmdline_objs resample_filter"
1386 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
1387 AC_SUBST(play_objs, add_dot_o($play_objs))
1388 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1389 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1390 ######################################################################### write
1391 write_cmdline_objs="
1395 write_errlist_objs="
1410 default_writer="FILE_WRITE"
1412 if test "$have_core_audio" = "yes"; then
1413 write_errlist_objs="$write_errlist_objs osx_write ipc"
1414 write_cmdline_objs="$write_cmdline_objs osx_write"
1415 writers="$writers osx"
1416 default_writer="OSX_WRITE"
1418 if test "$have_ao" = "yes"; then
1419 write_errlist_objs="$write_errlist_objs ao_write"
1420 write_cmdline_objs="$write_cmdline_objs ao_write"
1421 writers="$writers ao"
1422 default_writer="AO_WRITE"
1424 if test "$have_oss" = "yes"; then
1425 write_errlist_objs="$write_errlist_objs oss_write"
1426 write_cmdline_objs="$write_cmdline_objs oss_write"
1427 writers="$writers oss"
1428 default_writer="OSS_WRITE"
1430 if test "$have_alsa" = "yes"; then
1431 write_errlist_objs="$write_errlist_objs alsa_write"
1432 write_cmdline_objs="$write_cmdline_objs alsa_write"
1433 writers="$writers alsa"
1434 default_writer="ALSA_WRITE"
1437 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
1438 AC_SUBST(write_objs, add_dot_o($write_objs))
1439 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1440 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1441 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1442 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1443 enum of supported writers)
1444 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1445 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1446 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1447 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1448 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1449 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1450 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1451 ######################################################################## audioc
1452 audioc_cmdline_objs="audioc"
1453 audioc_errlist_objs="
1461 if test "$have_readline" = "yes"; then
1462 audioc_errlist_objs="$audioc_errlist_objs
1469 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1470 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1471 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1472 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1473 ############################################################# error2.h
1474 # these are always built
1477 $filter_errlist_objs
1478 $audioc_errlist_objs
1484 # optional executables
1485 if test "$build_server" = "yes"; then
1486 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1488 if test "$build_gui" = "yes"; then
1489 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1491 if test "$build_fade" = "yes"; then
1492 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1494 if test "$build_client" = "yes"; then
1495 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1497 if test "$build_audiod" = "yes"; then
1498 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1501 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1503 object_executable_matrix=
1504 for i in $executables; do
1505 eval objs=\$${i}_errlist_objs
1506 object_executable_matrix="$object_executable_matrix $i: $objs"
1508 # use echo to replace newlines by space
1509 AC_SUBST(object_executable_matrix, $(echo $object_executable_matrix))
1511 SS=$(for obj in $all_errlist_objs; do
1512 printf '%s' " SS_$obj,"; done | tr 'a-z' 'A-Z')
1513 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1514 [enum {$SS NUM_SS}],
1515 [list of all objects that use the paraslash error facility]
1517 ################################################################## status items
1519 status_items="basename status num_played mtime bitrate frequency file_size
1520 status_flags format score techinfo afs_mode
1521 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1522 offset seconds_total stream_start current_time audiod_uptime image_id
1523 lyrics_id duration directory lyrics_name image_name path hash channels
1524 last_played num_chunks chunk_time amplification artist title year album
1528 for i in $status_items; do
1529 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1531 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1532 [enum of all status items])
1535 for i in $status_items; do
1536 result="$result \"$i\", "
1538 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1539 [char * array of all status items])
1541 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1542 [formats supported by para_server and para_afh])
1544 AC_SUBST(executables)
1548 paraslash configuration:
1549 ~~~~~~~~~~~~~~~~~~~~~~~~
1550 unix socket credentials: $have_ucred
1551 readline (interactive CLIs): $have_readline
1552 audio formats handlers: $audio_format_handlers
1553 id3 version2 support: $have_libid3tag
1557 para_fade: $build_fade
1558 para_server: $build_server
1559 para_gui: $build_gui
1560 para_fade: $build_fade
1561 para_client: $build_client
1562 para_audiod: $build_audiod