2 # Process this file with autoconf to produce a configure script.
6 AC_INIT([paraslash],[git],[maan@systemlinux.org])
7 AC_CONFIG_HEADER([config.h])
9 AC_CONFIG_FILES([Makefile])
10 AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
11 AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
12 AC_DEFUN([objlist_to_errlist],[$(for i in $@; do printf "DEFINE_ERRLIST($(echo $i| tr 'a-z' 'A-Z'));"; done) [const char **para_errlist[[]]] = {$(for i in $@; do printf "PARA_ERRLIST($(echo $i | tr 'a-z' 'A-Z')), "; done) }])
13 AC_PATH_PROG(UNAMEPATH, uname, no)
14 if test "$UNAMEPATH" = "no"; then
15 AC_MSG_ERROR(unable to determine system type)
17 AC_MSG_CHECKING(os type)
18 OSTYPE="`$UNAMEPATH -s`"
19 AC_MSG_RESULT("$OSTYPE")
21 if test "$OSTYPE" = "SunOS"; then
22 # needed on SunOS for socket magic
23 arch_cppflags="-D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
24 AC_SUBST(arch_cppflags)
29 AC_PATH_PROG([gengetopt], [gengetopt])
30 test -z "$gengetopt" && AC_MSG_ERROR(
31 [gengetopt is required to build this package])
33 AC_PATH_PROG([help2man], [help2man])
34 test -z "$help2man" && AC_MSG_ERROR(
35 [help2man is required to build this package])
37 AC_PATH_PROG([install], [install])
38 test -z "$install" && AC_MSG_ERROR(
39 [The install program is required to build this package])
48 AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h \
49 stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h sys/un.h \
50 sys/ipc.h unistd.h utime.h stddef.h],
51 [], [AC_MSG_ERROR([$ac_header not found])])
53 # Checks for typedefs, structures, and compiler characteristics.
73 # Checks for library functions.
75 AC_PROG_GCC_TRADITIONAL
79 AC_FUNC_SELECT_ARGTYPES
86 AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \
87 regcomp select strchr strdup strerror strstr strtol uname \
88 fchdir gettimeofday localtime_r munmap strcasecmp strcspn \
89 strncasecmp strrchr strspn alarm mkdir inet_ntoa socket], [],
90 [AC_MSG_ERROR([function not found, cannot live without it])])
92 executables="recv filter audioc write afh play"
93 audio_format_handlers="mp3 wma"
127 filter_cmdline_objs="
133 filter_errlist_objs="
166 audioc_cmdline_objs="audioc"
167 audioc_errlist_objs="
177 afh_cmdline_objs="afh"
212 default_writer="FILE_WRITE"
258 ################################################################## clock_gettime
260 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
261 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
263 if test -n "$clock_gettime_lib"; then
264 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
265 define to 1 if clock_gettime() is supported])
267 if test "$clock_gettime_lib" = "rt"; then
268 AC_SUBST(clock_gettime_ldflags, -lrt)
270 ########################################################################### osl
272 OLD_CPPFLAGS="$CPPFLAGS"
273 OLD_LDFLAGS="$LDFLAGS"
275 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
276 [look for osl.h also in dir])])
277 if test -n "$with_osl_headers"; then
278 osl_cppflags="-I$with_osl_headers"
279 CPPFLAGS="$CPPFLAGS $osl_cppflags"
281 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
282 [look for libosl also in dir])])
283 if test -n "$with_osl_libs"; then
284 osl_libs="-L$with_osl_libs"
285 LDFLAGS="$LDFLAGS $osl_libs"
288 AC_CHECK_HEADER(osl.h, [], have_osl=no)
289 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
290 if test "$have_osl" = "no"; then
291 AC_MSG_WARN([libosl not found, can not build para_server.
293 http://systemlinux.org/~maan/osl
295 git clone git://git.tuebingen.mpg.de/osl
298 AC_SUBST(osl_cppflags)
299 CPPFLAGS="$OLD_CPPFLAGS"
300 LDFLAGS="$OLD_LDFLAGS"
302 ########################################################################### crypto
303 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
304 Force using crypto library "lib". This package requires either
305 openssl or libgcrypt being installed. Possible values for "lib"
306 are thus "openssl" and "gcrypt". If this option is not given,
307 openssl is tried first. If openssl was not found, gcrypt is
310 case "$enable_cryptolib" in
311 "openssl") check_openssl="yes"; check_gcrypt="no";;
312 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
313 "") check_openssl="yes"; check_gcrypt="yes";;
314 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
316 ###################################################################### openssl
317 if test "$check_openssl" = "yes"; then
318 OLD_CPPFLAGS="$CPPFLAGS"
319 OLD_LDFLAGS="$LDFLAGS"
322 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
323 [look for openssl headers also in dir])])
324 if test -n "$with_openssl_headers"; then
325 openssl_cppflags="-I$with_openssl_headers"
326 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
328 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
329 [look for openssl libraries also in dir])])
330 if test -n "$with_openssl_libs"; then
331 openssl_libs="-L$with_openssl_libs"
332 LDFLAGS="$LDFLAGS $openssl_libs"
334 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
335 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
336 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
337 # try harder: openssl is sometimes installed in /usr/local/ssl
338 openssl_cppflags="-I/usr/local/ssl/include"
339 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
340 openssl_libs="-L/usr/local/ssl/lib"
341 LDFLAGS="$LDFLAGS $openssl_libs"
343 unset ac_cv_header_openssl_ssl_h 2> /dev/null
344 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
345 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
346 if test "$have_openssl" = "yes"; then
347 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
350 if test "$have_openssl" = "yes"; then
351 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
352 AC_SUBST(openssl_cppflags)
353 openssl_libs="$openssl_libs -lssl -lcrypto"
354 server_ldflags="$server_ldflags $openssl_libs"
355 client_ldflags="$client_ldflags $openssl_libs"
356 audiod_ldflags="$audiod_ldflags $openssl_libs"
358 server_errlist_objs="$server_errlist_objs crypt"
359 client_errlist_objs="$client_errlist_objs crypt"
360 audiod_errlist_objs="$audiod_errlist_objs crypt"
364 AC_MSG_WARN([openssl libraries not found])
366 CPPFLAGS="$OLD_CPPFLAGS"
367 LDFLAGS="$OLD_LDFLAGS"
372 ########################################################################### gcrypt
373 if test "$check_gcrypt" = "yes"; then
374 OLD_CPPFLAGS="$CPPFLAGS"
375 OLD_LDFLAGS="$LDFLAGS"
378 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
379 [look for gcrypt headers also in dir])])
380 if test -n "$with_gcrypt_headers"; then
381 gcrypt_cppflags="-I$with_gcrypt_headers"
382 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
384 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
385 [look for libgcrypt also in dir])])
386 if test -n "$with_gcrypt_libs"; then
387 gcrypt_libs="-L$with_gcrypt_libs"
388 LDFLAGS="$LDFLAGS $gcrypt_libs"
390 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
391 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
392 if test "$have_gcrypt" = "yes"; then
393 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
394 AC_SUBST(gcrypt_cppflags)
395 gcrypt_libs="$gcrypt_libs -lgcrypt"
396 server_ldflags="$server_ldflags $gcrypt_libs"
397 client_ldflags="$client_ldflags $gcrypt_libs"
398 audiod_ldflags="$audiod_ldflags $gcrypt_libs"
400 server_errlist_objs="$server_errlist_objs gcrypt"
401 client_errlist_objs="$client_errlist_objs gcrypt"
402 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
404 AC_MSG_WARN([gcrypt library not found])
406 CPPFLAGS="$OLD_CPPFLAGS"
407 LDFLAGS="$OLD_LDFLAGS"
412 ########################################################################### libsocket
413 AC_CHECK_LIB([c], [socket],
415 [socket_lib="-lsocket"]
417 server_ldflags="$server_ldflags $socket_lib"
418 client_ldflags="$client_ldflags $socket_lib"
419 audioc_ldflags="$audioc_ldflags $socket_lib"
420 audiod_ldflags="$audiod_ldflags $socket_lib"
421 recv_ldflags="$recv_ldflags $socket_lib"
422 AC_SEARCH_LIBS([connect],[socket],[],[
423 AC_MSG_ERROR([Fatal: Did not find connect().])
425 ########################################################################### libnsl
426 AC_CHECK_LIB([c], [gethostbyname],
430 server_ldflags="$server_ldflags $nsl_lib"
431 client_ldflags="$client_ldflags $nsl_lib"
432 audioc_ldflags="$audioc_ldflags $nsl_lib"
433 recv_ldflags="$recv_ldflags $nsl_lib"
434 AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[
435 AC_MSG_ERROR([Fatal: Did not find inet_ntoa().])
437 ########################################################################### ucred
438 AC_MSG_CHECKING(for struct ucred)
439 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
441 #include <sys/types.h>
442 #include <sys/socket.h>
444 struct ucred sucred; sucred.pid=0;
445 ]])],[have_ucred=yes],[have_ucred=no])
446 AC_MSG_RESULT($have_ucred)
447 if test ${have_ucred} = yes; then
448 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
450 ########################################################################### gengetopt
451 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
453 [gengetopt_args_info_description],
454 [ggo_descriptions_declared=yes],
455 [ggo_descriptions_declared=no],
456 [#include "conftest-ggo.h"]
458 AC_SUBST(ggo_descriptions_declared)
459 ########################################################################### curses
461 OLD_CPPFLAGS="$CPPFLAGS"
462 OLD_LDFLAGS="$LDFLAGS"
464 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
465 [look for curses.h also in dir])])
466 if test -n "$with_curses_headers"; then
467 curses_cppflags="-I$with_curses_headers"
468 CPPFLAGS="$CPPFLAGS $curses_cppflags"
470 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
471 [look for libcurses also in dir])])
472 if test -n "$with_curses_libs"; then
473 curses_libs="-L$with_curses_libs"
474 LDFLAGS="$LDFLAGS $curses_libs"
476 AC_CHECK_HEADER(curses.h, [], [
479 curses_ldflags="$curses_libs"
480 AC_CHECK_LIB([ncursesw], [initscr],
481 [curses_ldflags="$curses_libs -lncursesw"], [
482 AC_CHECK_LIB([curses], [initscr],
483 [curses_ldflags="$curses_libs -lcurses"],
488 AC_SUBST(curses_cppflags)
489 AC_SUBST(curses_ldflags)
490 CPPFLAGS="$OLD_CPPFLAGS"
491 LDFLAGS="$OLD_LDFLAGS"
493 ########################################################################### ip_mreqn
494 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
495 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
501 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
502 AC_MSG_RESULT($have_ip_mreqn)
503 if test ${have_ip_mreqn} = yes; then
504 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
506 ########################################################################### osx
508 AC_MSG_CHECKING(for CoreAudio (MacOs))
509 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
510 #include <CoreAudio/CoreAudio.h>
513 ]])],[have_core_audio=yes],[have_core_audio=no])
514 AC_MSG_RESULT($have_core_audio)
515 if test ${have_core_audio} = yes; then
516 f1="-framework CoreAudio"
517 f2="-framework AudioToolbox"
518 f3="-framework AudioUnit"
519 f4="-framework CoreServices"
522 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
523 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
524 audiod_ldflags="$audiod_ldflags $f"
526 play_errlist_objs="$play_errlist_objs osx_write ipc"
527 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
528 play_ldflags="$play_ldflags $f"
530 write_errlist_objs="$write_errlist_objs osx_write ipc"
531 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
532 write_ldflags="$write_ldflags $f"
533 writers="$writers osx"
534 default_writer="OSX_WRITE"
535 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
537 ####################################################### ogg/vorbis/speex/opus
539 OLD_CPPFLAGS="$CPPFLAGS"
540 OLD_LDFLAGS="$LDFLAGS"
542 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
543 [look for ogg headers also in dir])])
544 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
545 [look for ogg libs also in dir])])
546 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
547 [look for vorbis headers also in dir])])
548 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
549 [look for vorbis libs also in dir])])
550 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
551 [look for speex headers also in dir])])
552 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
553 [look for speex libs also in dir])])
554 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
555 [look for opus headers also in dir])])
556 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
557 [look for opus libs also in dir])])
559 if test -n "$with_ogg_headers"; then
560 ogg_cppflags="-I$with_ogg_headers"
561 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
563 if test -n "$with_ogg_libs"; then
564 ogg_libs="-L$with_ogg_libs"
565 LDFLAGS="$LDFLAGS $ogg_libs"
567 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
568 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
573 if test "$have_ogg" = "yes"; then
575 if test -n "$with_vorbis_headers"; then
576 vorbis_cppflags="-I$with_vorbis_headers"
577 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
579 if test -n "$with_vorbis_libs"; then
580 vorbis_libs="-L$with_vorbis_libs"
581 LDFLAGS="$LDFLAGS $vorbis_libs"
583 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
584 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
587 if test -n "$with_speex_headers"; then
588 speex_cppflags="-I$with_speex_headers"
589 CPPFLAGS="$CPPFLAGS $speex_cppflags"
591 if test -n "$with_speex_libs"; then
592 speex_libs="-L$with_speex_libs"
593 LDFLAGS="$LDFLAGS $speex_libs"
595 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
596 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
599 if test -n "$with_opus_headers"; then
600 opus_cppflags="-I$with_opus_headers"
601 CPPFLAGS="$CPPFLAGS $opus_cppflags"
603 if test -n "$with_opus_libs"; then
604 opus_libs="-L$with_opus_libs"
605 LDFLAGS="$LDFLAGS $opus_libs"
607 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
608 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
610 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
616 msg="support in para_server/para_filter/para_afh"
617 if test "$have_vorbis" = "yes" || \
618 test "$have_speex" = "yes" || \
619 test "$have_opus" = "yes"; then
620 AC_SUBST(ogg_cppflags)
621 ogg_libs="$ogg_libs -logg"
622 if test "$OSTYPE" = "Darwin"; then
623 ogg_libs="-Wl,-bind_at_load $ogg_libs"
625 server_ldflags="$server_ldflags $ogg_libs"
626 filter_ldflags="$filter_ldflags $ogg_libs"
627 audiod_ldflags="$audiod_ldflags $ogg_libs"
628 play_ldflags="$play_ldflags $ogg_libs"
629 afh_ldflags="$afh_ldflags $ogg_libs"
630 recv_ldflags="$recv_ldflags $ogg_libs"
631 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
632 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
633 server_errlist_objs="$server_errlist_objs ogg_afh_common"
634 play_errlist_objs="$play_errlist_objs ogg_afh_common"
636 if test "$have_vorbis" = "yes"; then
637 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
638 filters="$filters oggdec"
639 vorbis_libs="-lvorbis -lvorbisfile"
640 server_ldflags="$server_ldflags $vorbis_libs"
641 filter_ldflags="$filter_ldflags $vorbis_libs"
642 audiod_ldflags="$audiod_ldflags $vorbis_libs"
643 play_ldflags="$play_ldflags $vorbis_libs"
644 afh_ldflags="$afh_ldflags $vorbis_libs"
645 recv_ldflags="$recv_ldflags $vorbis_libs"
647 server_errlist_objs="$server_errlist_objs ogg_afh"
648 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
649 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
650 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
651 afh_errlist_objs="$afh_errlist_objs ogg_afh"
652 recv_errlist_objs="$recv_errlist_objs ogg_afh"
654 audiod_audio_formats="$audiod_audio_formats ogg"
655 audio_format_handlers="$audio_format_handlers ogg"
657 AC_MSG_WARN([no ogg/vorbis $msg])
659 if test "$have_speex" = "yes"; then
660 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
661 filters="$filters spxdec"
663 server_ldflags="$server_ldflags $speex_libs"
664 filter_ldflags="$filter_ldflags $speex_libs"
665 audiod_ldflags="$audiod_ldflags $speex_libs"
666 play_ldflags="$play_ldflags $speex_libs"
667 afh_ldflags="$afh_ldflags $speex_libs"
668 recv_ldflags="$recv_ldflags $speex_libs"
670 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
671 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
672 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
673 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
674 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
675 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
677 audiod_audio_formats="$audiod_audio_formats spx"
678 audio_format_handlers="$audio_format_handlers spx"
680 AC_MSG_WARN([no ogg/speex $msg])
682 if test "$have_opus" = "yes"; then
683 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
684 filters="$filters opusdec"
686 server_ldflags="$server_ldflags $opus_libs"
687 filter_ldflags="$filter_ldflags $opus_libs"
688 audiod_ldflags="$audiod_ldflags $opus_libs"
689 afh_ldflags="$afh_ldflags $opus_libs"
690 play_ldflags="$play_ldflags $opus_libs"
691 recv_ldflags="$recv_ldflags $opus_libs"
693 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
694 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
695 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
696 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
697 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
698 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
700 audiod_audio_formats="$audiod_audio_formats opus"
701 audio_format_handlers="$audio_format_handlers opus"
703 AC_MSG_WARN([no ogg/opus $msg])
705 CPPFLAGS="$OLD_CPPFLAGS"
706 LDFLAGS="$OLD_LDFLAGS"
708 ########################################################################### faad
710 OLD_CPPFLAGS="$CPPFLAGS"
711 OLD_LDFLAGS="$LDFLAGS"
713 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
714 [look for neaacdec.h also in dir])])
715 if test -n "$with_faad_headers"; then
716 faad_cppflags="-I$with_faad_headers"
717 CPPFLAGS="$CPPFLAGS $faad_cppflags"
719 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
720 [look for libfaad also in dir])])
721 if test -n "$with_faad_libs"; then
722 faad_libs="-L$with_faad_libs"
723 LDFLAGS="$LDFLAGS $faad_libs"
725 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
726 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
727 if test "$have_faad" = "yes"; then
728 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
729 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
730 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
731 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
732 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
733 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
734 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
736 server_ldflags="$server_ldflags $faad_libs -lfaad"
737 filter_ldflags="$filter_ldflags $faad_libs -lfaad"
738 audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
739 play_ldflags="$play_ldflags $faad_libs -lfaad"
740 afh_ldflags="$afh_ldflags $faad_libs -lfaad"
741 recv_ldflags="$afh_ldflags $faad_libs -lfaad"
743 audiod_audio_formats="$audiod_audio_formats aac"
744 audio_format_handlers="$audio_format_handlers aac"
745 filters="$filters aacdec"
746 AC_SUBST(faad_cppflags)
748 AC_MSG_WARN([no aac support in para_audiod/para_filter])
750 CPPFLAGS="$OLD_CPPFLAGS"
751 LDFLAGS="$OLD_LDFLAGS"
753 ########################################################################### mad
755 OLD_CPPFLAGS="$CPPFLAGS"
756 OLD_LDFLAGS="$LDFLAGS"
759 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
760 [look for mad.h also in dir])])
761 if test -n "$with_mad_headers"; then
762 mad_cppflags="-I$with_mad_headers"
763 CPPFLAGS="$CPPFLAGS $mad_cppflags"
765 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
766 [look for libmad also in dir])])
767 if test -n "$with_mad_libs"; then
768 mad_libs="-L$with_mad_libs"
769 LDFLAGS="$LDFLAGS $mad_libs"
771 AC_CHECK_HEADERS([mad.h], [], [
774 AC_CHECK_LIB([mad], [mad_stream_init], [], [
777 if test "$have_mad" = "yes"; then
778 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
779 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
780 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
781 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
782 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
783 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
784 play_errlist_objs="$play_errlist_objs mp3dec_filter"
785 filter_ldflags="$filter_ldflags $mad_libs -lmad"
786 audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
787 play_ldflags="$play_ldflags $mad_libs -lmad"
788 audiod_audio_formats="$audiod_audio_formats mp3"
789 filters="$filters mp3dec"
790 AC_SUBST(mad_cppflags)
792 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
794 CPPFLAGS="$OLD_CPPFLAGS"
795 LDFLAGS="$OLD_LDFLAGS"
797 ###################################################################### libid3tag
798 OLD_CPPFLAGS="$CPPFLAGS"
799 OLD_LDFLAGS="$LDFLAGS"
803 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
804 [look for id3tag header files also in dir])])
805 if test -n "$with_id3tag_headers"; then
806 id3tag_cppflags="-I$with_id3tag_headers"
807 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
809 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
810 [look for id3tag libs also in dir])])
811 if test -n "$with_id3tag_libs"; then
812 id3tag_libs="-L$with_id3tag_libs"
813 LDFLAGS="$LDFLAGS $id3tag_libs"
816 AC_MSG_CHECKING(for libid3tag)
817 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
820 struct id3_tag t = {.flags = 0};
821 ]])],[],[have_libid3tag=no])
822 AC_MSG_RESULT($have_libid3tag)
824 if test ${have_libid3tag} = yes; then
825 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
826 server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
827 afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
828 play_ldflags="$play_ldflags -lz"
829 recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
830 play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
831 AC_SUBST(id3tag_cppflags)
833 AC_MSG_WARN([no support for id3v2 tags])
835 CPPFLAGS="$OLD_CPPFLAGS"
836 LDFLAGS="$OLD_LDFLAGS"
838 ########################################################################### flac
839 OLD_CPPFLAGS="$CPPFLAGS"
840 OLD_LDFLAGS="$LDFLAGS"
844 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
845 [look for flac headers also in dir])])
846 if test -n "$with_flac_headers"; then
847 flac_cppflags="-I$with_flac_headers"
848 CPPFLAGS="$CPPFLAGS $flac_cppflags"
850 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
851 [look for flac libs also in dir])])
852 if test -n "$with_flac_libs"; then
853 flac_libs="-L$with_flac_libs"
854 LDFLAGS="$LDFLAGS $flac_libs"
856 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
857 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
858 if test "$have_flac" = "yes"; then
859 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
860 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
861 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
862 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
863 afh_errlist_objs="$afh_errlist_objs flac_afh"
864 server_errlist_objs="$server_errlist_objs flac_afh"
865 recv_errlist_objs="$recv_errlist_objs flac_afh"
866 filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
867 audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
868 play_ldflags="$play_ldflags $flac_libs -lFLAC"
869 server_ldflags="$server_ldflags $flac_libs -lFLAC"
870 afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
871 recv_ldflags="$recv_ldflags $flac_libs -lFLAC"
872 filters="$filters flacdec"
873 audio_format_handlers="$audio_format_handlers flac"
874 audiod_audio_formats="$audiod_audio_formats flac"
875 AC_SUBST(flac_cppflags)
877 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
879 CPPFLAGS="$OLD_CPPFLAGS"
880 LDFLAGS="$OLD_LDFLAGS"
882 ########################################################################### oss
883 OLD_CPPFLAGS="$CPPFLAGS"
884 OLD_LDFLAGS="$LDFLAGS"
888 msg="=> will not build oss writer"
890 AC_CHECK_HEADER(sys/soundcard.h, [
891 audiod_errlist_objs="$audiod_errlist_objs oss_write"
892 play_errlist_objs="$play_errlist_objs oss_write"
893 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
894 play_cmdline_objs="$play_cmdline_objs oss_write"
896 write_errlist_objs="$write_errlist_objs oss_write"
897 write_cmdline_objs="$write_cmdline_objs oss_write"
898 fade_errlist_objs="$fade_errlist_objs oss_mix"
900 writers="$writers oss"
901 default_writer="OSS_WRITE"
902 mixers="${mixers}oss "
903 default_mixer="OSS_MIX"
905 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
906 audiod_ldflags="$audiod_ldflags -lossaudio"
907 play_ldflags="$play_ldflags -lossaudio"
908 write_ldflags="$write_ldflags -lossaudio"
909 fade_ldflags="$fade_ldflags -lossaudio"
915 AC_MSG_WARN([no sys/soundcard.h $msg])
918 CPPFLAGS="$OLD_CPPFLAGS"
919 LDFLAGS="$OLD_LDFLAGS"
922 ########################################################################### alsa
923 OLD_CPPFLAGS="$CPPFLAGS"
924 OLD_LDFLAGS="$LDFLAGS"
927 msg="=> no alsa support for para_audiod/para_write"
928 if test "$OSTYPE" != "Linux"; then
933 if test "$have_alsa" = "yes"; then
934 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
936 AC_MSG_WARN([no alsa/asoundlib $msg])
940 if test "$have_alsa" = "yes"; then
941 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
943 AC_MSG_WARN([no libasound $msg])
947 if test "$have_alsa" = "yes"; then
948 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
949 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
950 audiod_ldflags="$audiod_ldflags -lasound"
951 play_errlist_objs="$play_errlist_objs alsa_write"
952 play_cmdline_objs="$play_cmdline_objs alsa_write"
953 play_ldflags="$play_ldflags -lasound"
955 write_errlist_objs="$write_errlist_objs alsa_write"
956 write_cmdline_objs="$write_cmdline_objs alsa_write"
957 write_ldflags="$write_ldflags -lasound"
958 fade_errlist_objs="$fade_errlist_objs alsa_mix"
959 fade_ldflags="$fade_ldflags -lasound"
961 writers="$writers alsa"
962 default_writer="ALSA_WRITE"
963 mixers="${mixers}alsa "
964 default_mixer="ALSA_MIX"
967 CPPFLAGS="$OLD_CPPFLAGS"
968 LDFLAGS="$OLD_LDFLAGS"
970 ########################################################################### libao
971 OLD_CPPFLAGS="$CPPFLAGS"
972 OLD_LDFLAGS="$LDFLAGS"
976 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
977 [look for ao/ao.h also in dir])])
978 if test -n "$with_ao_headers"; then
979 ao_cppflags="-I$with_ao_headers"
980 CPPFLAGS="$CPPFLAGS $ao_cppflags"
982 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
983 [look for libao also in dir])])
984 if test -n "$with_ao_libs"; then
985 ao_libs="-L$with_ao_libs"
986 LDFLAGS="$LDFLAGS $ao_libs"
988 msg="no libao support for para_audiod/para_write"
989 AC_CHECK_HEADERS([ao/ao.h], [
992 AC_MSG_WARN([ao.h not found, $msg])
994 if test "$have_ao" = "yes"; then
995 AC_CHECK_LIB([ao], [ao_initialize], [], [
997 AC_MSG_WARN([ao lib not found or not working, $msg])
1000 if test "$have_ao" = "yes"; then
1001 AC_CHECK_HEADERS([pthread.h], [
1004 AC_MSG_WARN([pthread.h not found, $msg])
1007 if test "$have_ao" = "yes"; then
1008 AC_CHECK_LIB([pthread], [pthread_create], [], [
1010 AC_MSG_WARN([pthread lib not found or not working, $msg])
1013 if test "$have_ao" = "yes"; then
1014 audiod_errlist_objs="$audiod_errlist_objs ao_write"
1015 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
1016 audiod_ldflags="$audiod_ldflags -lao -lpthread"
1018 play_errlist_objs="$play_errlist_objs ao_write"
1019 play_cmdline_objs="$play_cmdline_objs ao_write"
1020 play_ldflags="$play_ldflags -lao -lpthread"
1022 write_errlist_objs="$write_errlist_objs ao_write"
1023 write_cmdline_objs="$write_cmdline_objs ao_write"
1024 write_ldflags="$write_ldflags $ao_libs -lao -lpthread"
1025 writers="$writers ao"
1026 AC_SUBST(ao_cppflags)
1029 CPPFLAGS="$OLD_CPPFLAGS"
1030 LDFLAGS="$OLD_LDFLAGS"
1032 ############################################################# readline
1033 OLD_CPPFLAGS="$CPPFLAGS"
1034 OLD_LDFLAGS="$LDFLAGS"
1038 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
1039 [look for libreadline header files also in dir])])
1040 if test -n "$with_readline_headers"; then
1041 readline_cppflags="-I$with_readline_headers"
1042 CPPFLAGS="$CPPFLAGS $readline_cppflags"
1045 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
1046 [look for readline library also in dir])])
1047 if test -n "$with_readline_libs"; then
1048 readline_libs="-L$with_readline_libs"
1049 LDFLAGS="$LDFLAGS $readline_libs"
1051 msg="no interactive cli support"
1052 AC_CHECK_HEADERS([readline/readline.h], [
1055 AC_MSG_WARN([readline/readline.h not found, $msg])
1058 if test "$have_curses" != "yes"; then
1060 AC_MSG_WARN([interactive cli support depends on curses,])
1061 AC_MSG_WARN([but no curses lib was detected, $msg])
1064 if test "$have_readline" = "yes"; then
1065 readline_libs="$readline_libs -lreadline"
1066 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
1067 if test "$have_readline" = "no"; then # try with -lcurses
1069 AC_MSG_NOTICE([trying again with -lcurses])
1070 unset ac_cv_search_rl_free_keymap 2> /dev/null
1071 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1073 readline_libs="$readline_libs -lcurses"
1076 if test "$have_readline" = "no"; then # try with -ltermcap
1078 AC_MSG_NOTICE([trying again with -ltermcap])
1079 unset ac_cv_search_rl_free_keymap 2> /dev/null
1080 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1082 readline_libs="$readline_libs -ltermcap"
1087 if test "$have_readline" = "yes"; then
1088 client_errlist_objs="$client_errlist_objs interactive"
1089 client_ldflags="$client_ldflags $readline_libs"
1090 audioc_errlist_objs="$audioc_errlist_objs buffer_tree interactive sched time"
1091 audioc_ldflags="$audioc_ldflags $readline_libs"
1092 play_errlist_objs="$play_errlist_objs interactive"
1093 play_ldflags="$play_ldflags $readline_libs"
1094 AC_SUBST(readline_cppflags)
1095 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
1097 AC_MSG_WARN([libreadline not found or unusable])
1099 CPPFLAGS="$OLD_CPPFLAGS"
1100 LDFLAGS="$OLD_LDFLAGS"
1102 ############################################################# libsamplerate
1103 OLD_CPPFLAGS="$CPPFLAGS"
1104 OLD_LDFLAGS="$LDFLAGS"
1107 have_samplerate="yes"
1108 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
1109 [look for samplerate headers also in dir])])
1110 if test -n "$with_samplerate_headers"; then
1111 samplerate_cppflags="-I$with_samplerate_headers"
1112 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
1114 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
1115 [look for samplerate libs also in dir])])
1116 if test -n "$with_samplerate_libs"; then
1117 samplerate_libs="-L$with_samplerate_libs"
1118 LDFLAGS="$LDFLAGS $samplerate_libs"
1121 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
1122 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
1124 if test "$have_samplerate" = "yes"; then
1125 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1126 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
1127 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1128 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
1129 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1130 play_cmdline_objs="$play_cmdline_objs resample_filter"
1131 filter_ldflags="$filter_ldflags $samplerate_libs -lsamplerate"
1132 audiod_ldflags="$audiod_ldflags $samplerate_libs -lsamplerate"
1133 play_ldflags="$play_ldflags $samplerate_libs -lsamplerate"
1134 filters="$filters resample"
1135 AC_SUBST(samplerate_cppflags)
1137 AC_MSG_WARN([no resample support in para_audiod/para_filter])
1139 CPPFLAGS="$OLD_CPPFLAGS"
1140 LDFLAGS="$OLD_LDFLAGS"
1142 ######################################################################### server
1143 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
1144 -a "$have_osl" = "yes" ; then
1147 executables="$executables server"
1148 server_cmdline_objs="server"
1149 server_errlist_objs="$server_errlist_objs
1188 server_ldflags="$server_ldflags $osl_libs -losl"
1192 ############################################################# client
1193 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1195 executables="$executables client"
1196 client_cmdline_objs="client"
1197 client_errlist_objs="$client_errlist_objs
1216 ############################################################# audiod
1217 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1219 executables="$executables audiod"
1220 audiod_cmdline_objs="$audiod_cmdline_objs
1231 audiod_errlist_objs="$audiod_errlist_objs
1268 audiod_ldflags="$audiod_ldflags -lm"
1269 audiod_audio_formats="$audiod_audio_formats wma"
1273 ########################################################################### fade
1274 if test -n "$mixers"; then
1276 executables="$executables fade"
1277 fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
1278 fade_cmdline_objs="fade"
1279 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
1280 AC_SUBST(fade_objs, add_dot_o($fade_objs))
1281 AC_SUBST(fade_ldflags, $fade_ldflags)
1282 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
1283 objlist_to_errlist($fade_errlist_objs),
1284 errors used by para_fade)
1286 for i in $mixers; do
1287 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
1290 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
1291 enum of supported mixers)
1292 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
1293 use this mixer if none was specified)
1294 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
1295 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
1297 for i in $mixers; do
1298 printf 'extern void '$i'_mix_init(struct mixer *); '
1301 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
1302 init functions of the supported mixers)
1303 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
1304 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
1305 mixer_summary="supported mixers:: $mixers, default: $default_mixer"
1308 AC_MSG_WARN([no mixer support])
1309 mixer_summary="para_fade: no"
1311 ########################################################################### gui
1312 if test "$have_curses" = "yes"; then
1314 executables="$executables gui"
1315 gui_cmdline_objs="gui"
1329 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
1332 AC_MSG_WARN([no curses lib, cannot build para_gui])
1334 ############################################################# error2.h
1335 AC_MSG_NOTICE(creating error2.h)
1337 # these are always built
1340 $filter_errlist_objs
1341 $audioc_errlist_objs
1347 # optional executables
1348 if test "$build_server" = "yes"; then
1349 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1351 if test "$build_gui" = "yes"; then
1352 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1354 if test "$build_fade" = "yes"; then
1355 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1357 if test "$build_client" = "yes"; then
1358 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1360 if test "$build_audiod" = "yes"; then
1361 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1364 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1366 for i in $executables; do
1368 eval echo \$${i}_errlist_objs
1369 done | ./error2.pl > error2.h
1370 for obj in $all_errlist_objs; do
1371 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1373 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1374 [enum {$SS NUM_SS}],
1375 [list of all objects that use the paraslash error facility]
1378 ################################################################## status items
1380 status_items="basename status num_played mtime bitrate frequency file_size
1381 status_flags format score techinfo afs_mode
1382 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1383 offset seconds_total stream_start current_time audiod_uptime image_id
1384 lyrics_id duration directory lyrics_name image_name path hash channels
1385 last_played num_chunks chunk_time amplification artist title year album
1389 for i in $status_items; do
1390 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1392 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1393 [enum of all status items])
1396 for i in $status_items; do
1397 result="$result \"$i\", "
1399 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1400 [char * array of all status items])
1402 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1403 [formats supported by para_server and para_afh])
1405 AC_SUBST(executables)
1407 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
1408 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
1409 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
1410 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
1411 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
1412 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
1413 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1414 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
1415 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
1416 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
1418 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1419 AC_SUBST(recv_ldflags, $recv_ldflags)
1420 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1421 errors used by para_recv)
1423 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1424 AC_SUBST(filter_ldflags, $filter_ldflags)
1425 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1426 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1428 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1429 AC_SUBST(audiod_ldflags, $audiod_ldflags)
1430 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1431 errors used by para_audiod)
1433 AC_SUBST(server_objs, add_dot_o($server_objs))
1434 AC_SUBST(server_ldflags, $server_ldflags)
1435 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
1436 objlist_to_errlist($server_errlist_objs), errors used by para_server)
1438 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1439 AC_SUBST(afh_ldflags, $afh_ldflags)
1440 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1441 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1443 AC_SUBST(write_objs, add_dot_o($write_objs))
1444 AC_SUBST(write_ldflags, $write_ldflags)
1445 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1446 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1448 AC_SUBST(client_objs, add_dot_o($client_objs))
1449 AC_SUBST(client_ldflags, $client_ldflags)
1450 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
1451 objlist_to_errlist($client_errlist_objs), errors used by para_client)
1453 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1454 AC_SUBST(audioc_ldflags, $audioc_ldflags)
1455 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1456 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1458 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1459 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1460 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1462 AC_SUBST(play_objs, add_dot_o($play_objs))
1463 AC_SUBST(play_ldflags, $play_ldflags)
1464 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1465 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1467 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1468 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1469 enum of supported filters)
1470 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1471 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1472 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1473 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1475 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1476 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1477 enum of supported writers)
1478 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1479 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1480 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1481 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1482 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1483 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1484 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1486 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1487 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1488 enum of audio formats supported by audiod)
1489 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1490 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1494 paraslash configuration:
1495 ~~~~~~~~~~~~~~~~~~~~~~~~
1496 unix socket credentials: $have_ucred
1497 readline (interactive CLIs): $have_readline
1498 audio formats handlers: $audio_format_handlers
1499 id3 version2 support: $have_libid3tag
1500 filters: $(echo $filters)
1504 para_server: $build_server
1505 para_gui: $build_gui
1506 para_fade: $build_fade
1507 para_client: $build_client
1508 para_audiod: $build_audiod