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([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) }])
12 AC_PATH_PROG(UNAMEPATH, uname, no)
13 if test "$UNAMEPATH" = "no"; then
14 AC_MSG_ERROR(unable to determine system type)
16 AC_MSG_CHECKING(os type)
17 OSTYPE="`$UNAMEPATH -s`"
18 AC_MSG_RESULT("$OSTYPE")
20 if test "$OSTYPE" = "SunOS"; then
21 # needed on SunOS for socket magic
22 arch_cppflags="-D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
23 AC_SUBST(arch_cppflags)
28 AC_PATH_PROG([gengetopt], [gengetopt])
29 test -z "$gengetopt" && AC_MSG_ERROR(
30 [gengetopt is required to build this package])
32 AC_PATH_PROG([help2man], [help2man])
33 test -z "$help2man" && AC_MSG_ERROR(
34 [help2man is required to build this package])
39 AC_SUBST(install_sh, [$INSTALL])
46 AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h \
47 stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h sys/un.h \
48 sys/ipc.h unistd.h utime.h stddef.h],
49 [], [AC_MSG_ERROR([$ac_header not found])])
51 # Checks for typedefs, structures, and compiler characteristics.
71 # Checks for library functions.
73 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 AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
95 all_errlist_objs="mp3_afh afh_common net string signal time daemon
96 stat afh amp_filter fd ringbuffer sched audiod
97 grab_client filter_common wav_filter compress_filter http_recv
98 dccp_recv recv_common write_common file_write audiod_command
99 client_common recv stdout filter stdin audioc write client
100 exec send_common ggo udp_recv color fec fecdec_filter
101 prebuffer_filter bitstream imdct check_wav
102 wma_afh wma_common wmadec_filter buffer_tree crypt_common
103 gui gui_theme sideband afh_recv play version"
105 executables="recv filter audioc write client afh audiod play"
107 recv_cmdline_objs="add_cmdline(recv http_recv dccp_recv udp_recv afh_recv)"
110 http_recv recv_common recv time string net dccp_recv fd
111 sched stdout ggo udp_recv buffer_tree afh_recv afh_common
112 wma_afh wma_common mp3_afh version
117 filter_cmdline_objs="add_cmdline(filter compress_filter amp_filter prebuffer_filter)"
118 filter_errlist_objs="filter_common wav_filter compress_filter filter string
119 stdin stdout sched fd amp_filter ggo fecdec_filter fec version
120 prebuffer_filter time bitstream imdct wma_common wmadec_filter buffer_tree"
122 filters=" compress wav amp fecdec wmadec prebuffer"
124 audioc_cmdline_objs="add_cmdline(audioc)"
125 audioc_errlist_objs="
135 audiod_cmdline_objs="add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
136 audiod_errlist_objs="audiod signal string daemon stat net crypt_common sideband
137 time grab_client filter_common wav_filter compress_filter amp_filter http_recv dccp_recv
138 recv_common fd sched write_common file_write audiod_command fecdec_filter
139 client_common ggo udp_recv color fec prebuffer_filter version
140 bitstream imdct wma_common wmadec_filter buffer_tree"
142 audiod_audio_formats="wma"
144 afh_cmdline_objs="add_cmdline(afh)"
145 afh_errlist_objs="afh string fd mp3_afh afh_common time wma_afh wma_common
149 write_cmdline_objs="add_cmdline(write file_write)"
150 write_errlist_objs="write write_common file_write time fd string sched stdin
151 buffer_tree ggo check_wav version"
154 default_writer="FILE_WRITE"
156 client_cmdline_objs="add_cmdline(client)"
157 client_errlist_objs="
175 gui_cmdline_objs="add_cmdline(gui)"
189 gui_objs="$gui_cmdline_objs $gui_errlist_objs"
190 play_errlist_objs="play fd sched ggo buffer_tree time string net
192 wma_afh wma_common mp3_afh
193 recv_common udp_recv http_recv dccp_recv
194 filter_common fec bitstream imdct
195 wav_filter compress_filter amp_filter prebuffer_filter fecdec_filter
197 write_common file_write
200 play_cmdline_objs="add_cmdline(http_recv dccp_recv udp_recv afh_recv compress_filter amp_filter prebuffer_filter file_write play)"
202 ################################################################## clock_gettime
204 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
205 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
207 if test -n "$clock_gettime_lib"; then
208 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
209 define to 1 if clock_gettime() is supported])
211 if test "$clock_gettime_lib" = "rt"; then
212 AC_SUBST(clock_gettime_ldflags, -lrt)
214 ########################################################################### osl
216 OLD_CPPFLAGS="$CPPFLAGS"
217 OLD_LDFLAGS="$LDFLAGS"
219 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
220 [look for osl.h also in dir])])
221 if test -n "$with_osl_headers"; then
222 osl_cppflags="-I$with_osl_headers"
223 CPPFLAGS="$CPPFLAGS $osl_cppflags"
225 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
226 [look for libosl also in dir])])
227 if test -n "$with_osl_libs"; then
228 osl_libs="-L$with_osl_libs"
229 LDFLAGS="$LDFLAGS $osl_libs"
232 AC_CHECK_HEADER(osl.h, [], have_osl=no)
233 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
234 if test "$have_osl" = "no"; then
235 AC_MSG_WARN([libosl not found, can not build para_server.
237 http://systemlinux.org/~maan/osl
239 git clone git://git.tuebingen.mpg.de/osl
242 extras="$extras server"
243 executables="$executables server"
244 server_cmdline_objs="add_cmdline(server)"
245 server_errlist_objs="
282 all_errlist_objs="$all_errlist_objs server vss command
283 http_send close_on_fork mm ipc dccp_send user_list
284 chunk_queue afs aft mood score attribute blob playlist
288 audio_format_handlers="mp3 wma"
289 AC_SUBST(osl_cppflags)
290 server_ldflags="$server_ldflags $osl_libs -losl"
292 CPPFLAGS="$OLD_CPPFLAGS"
293 LDFLAGS="$OLD_LDFLAGS"
295 ########################################################################### crypto
296 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
297 Force using crypto library "lib". This package requires either
298 openssl or libgcrypt being installed. Possible values for "lib"
299 are thus "openssl" and "gcrypt". If this option is not given,
300 openssl is tried first. If openssl was not found, gcrypt is
303 case "$enable_cryptolib" in
304 "openssl") check_openssl="yes"; check_gcrypt="no";;
305 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
306 "") check_openssl="yes"; check_gcrypt="yes";;
307 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
309 ###################################################################### openssl
310 if test "$check_openssl" = "yes"; then
311 OLD_CPPFLAGS="$CPPFLAGS"
312 OLD_LDFLAGS="$LDFLAGS"
315 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
316 [look for openssl headers also in dir])])
317 if test -n "$with_openssl_headers"; then
318 openssl_cppflags="-I$with_openssl_headers"
319 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
321 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
322 [look for openssl libraries also in dir])])
323 if test -n "$with_openssl_libs"; then
324 openssl_libs="-L$with_openssl_libs"
325 LDFLAGS="$LDFLAGS $openssl_libs"
327 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
328 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
329 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
330 # try harder: openssl is sometimes installed in /usr/local/ssl
331 openssl_cppflags="-I/usr/local/ssl/include"
332 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
333 openssl_libs="-L/usr/local/ssl/lib"
334 LDFLAGS="$LDFLAGS $openssl_libs"
336 unset ac_cv_header_openssl_ssl_h 2> /dev/null
337 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
338 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
339 if test "$have_openssl" = "yes"; then
340 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
343 if test "$have_openssl" = "yes"; then
344 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
345 AC_SUBST(openssl_cppflags)
346 openssl_libs="$openssl_libs -lssl -lcrypto"
347 server_ldflags="$server_ldflags $openssl_libs"
348 client_ldflags="$client_ldflags $openssl_libs"
349 audiod_ldflags="$audiod_ldflags $openssl_libs"
351 all_errlist_objs="$all_errlist_objs crypt"
352 server_errlist_objs="$server_errlist_objs crypt"
353 client_errlist_objs="$client_errlist_objs crypt"
354 audiod_errlist_objs="$audiod_errlist_objs crypt"
358 AC_MSG_WARN([openssl libraries not found])
360 CPPFLAGS="$OLD_CPPFLAGS"
361 LDFLAGS="$OLD_LDFLAGS"
366 ########################################################################### gcrypt
367 if test "$check_gcrypt" = "yes"; then
368 OLD_CPPFLAGS="$CPPFLAGS"
369 OLD_LDFLAGS="$LDFLAGS"
372 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
373 [look for gcrypt headers also in dir])])
374 if test -n "$with_gcrypt_headers"; then
375 gcrypt_cppflags="-I$with_gcrypt_headers"
376 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
378 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
379 [look for libgcrypt also in dir])])
380 if test -n "$with_gcrypt_libs"; then
381 gcrypt_libs="-L$with_gcrypt_libs"
382 LDFLAGS="$LDFLAGS $gcrypt_libs"
384 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
385 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
386 if test "$have_gcrypt" = "yes"; then
387 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
388 AC_SUBST(gcrypt_cppflags)
389 gcrypt_libs="$gcrypt_libs -lgcrypt"
390 server_ldflags="$server_ldflags $gcrypt_libs"
391 client_ldflags="$client_ldflags $gcrypt_libs"
392 audiod_ldflags="$audiod_ldflags $gcrypt_libs"
394 all_errlist_objs="$all_errlist_objs gcrypt"
395 server_errlist_objs="$server_errlist_objs gcrypt"
396 client_errlist_objs="$client_errlist_objs gcrypt"
397 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
399 AC_MSG_WARN([gcrypt library not found])
401 CPPFLAGS="$OLD_CPPFLAGS"
402 LDFLAGS="$OLD_LDFLAGS"
407 ###########################################################################
408 if test "$have_openssl" = "no" -a "$have_gcrypt" = "no"; then
409 AC_MSG_ERROR([neither openssl nor gcrypt usable])
411 ########################################################################### libsocket
412 AC_CHECK_LIB([c], [socket],
414 [socket_lib="-lsocket"]
416 server_ldflags="$server_ldflags $socket_lib"
417 client_ldflags="$client_ldflags $socket_lib"
418 audioc_ldflags="$audioc_ldflags $socket_lib"
419 audiod_ldflags="$audiod_ldflags $socket_lib"
420 recv_ldflags="$recv_ldflags $socket_lib"
421 AC_SEARCH_LIBS([connect],[socket],[],[
422 AC_MSG_ERROR([Fatal: Did not find connect().])
424 ########################################################################### libnsl
425 AC_CHECK_LIB([c], [gethostbyname],
429 server_ldflags="$server_ldflags $nsl_lib"
430 client_ldflags="$client_ldflags $nsl_lib"
431 audioc_ldflags="$audioc_ldflags $nsl_lib"
432 recv_ldflags="$recv_ldflags $nsl_lib"
433 AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[
434 AC_MSG_ERROR([Fatal: Did not find inet_ntoa().])
436 ########################################################################### ucred
437 AC_MSG_CHECKING(for struct ucred)
438 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
440 #include <sys/types.h>
441 #include <sys/socket.h>
443 struct ucred sucred; sucred.pid=0;
444 ]])],[have_ucred=yes],[have_ucred=no])
445 AC_MSG_RESULT($have_ucred)
446 if test ${have_ucred} = yes; then
447 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
449 ########################################################################### gengetopt
450 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
452 [gengetopt_args_info_description],
453 [ggo_descriptions_declared=yes],
454 [ggo_descriptions_declared=no],
455 [#include "conftest-ggo.h"]
457 AC_SUBST(ggo_descriptions_declared)
458 ########################################################################### curses
460 OLD_CPPFLAGS="$CPPFLAGS"
461 OLD_LDFLAGS="$LDFLAGS"
463 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
464 [look for curses.h also in dir])])
465 if test -n "$with_curses_headers"; then
466 curses_cppflags="-I$with_curses_headers"
467 CPPFLAGS="$CPPFLAGS $curses_cppflags"
469 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
470 [look for libcurses also in dir])])
471 if test -n "$with_curses_libs"; then
472 curses_libs="-L$with_curses_libs"
473 LDFLAGS="$LDFLAGS $curses_libs"
475 AC_CHECK_HEADER(curses.h, [], [
478 gui_ldflags="$curses_libs"
479 AC_CHECK_LIB([ncursesw], [initscr],
480 [gui_ldflags="$curses_libs -lncursesw"], [
481 AC_CHECK_LIB([curses], [initscr],
482 [gui_ldflags="$curses_libs -lcurses"],
487 if test "$have_curses" = "yes"; then
488 AC_SUBST(curses_cppflags)
490 executables="$executables gui"
492 AC_MSG_WARN([no curses lib, cannot build para_gui])
494 CPPFLAGS="$OLD_CPPFLAGS"
495 LDFLAGS="$OLD_LDFLAGS"
498 ########################################################################### ip_mreqn
499 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
500 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
506 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
507 AC_MSG_RESULT($have_ip_mreqn)
508 if test ${have_ip_mreqn} = yes; then
509 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
511 ########################################################################### osx
513 AC_MSG_CHECKING(for CoreAudio (MacOs))
514 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
515 #include <CoreAudio/CoreAudio.h>
518 ]])],[have_core_audio=yes],[have_core_audio=no])
519 AC_MSG_RESULT($have_core_audio)
520 if test ${have_core_audio} = yes; then
521 f1="-framework CoreAudio"
522 f2="-framework AudioToolbox"
523 f3="-framework AudioUnit"
524 f4="-framework CoreServices"
527 all_errlist_objs="$all_errlist_objs osx_write"
528 # ipc is linked into para_server server and into the osx writer. If osl
529 # was not found, para_server will not be built and ipc has not yet been
530 # added to the list of all objects, so we must add it here.
531 if test "$have_osl" = "no"; then
532 all_errlist_objs="$all_errlist_objs ipc"
534 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
535 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
536 audiod_ldflags="$audiod_ldflags $f"
538 play_errlist_objs="$play_errlist_objs osx_write ipc"
539 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
540 play_ldflags="$play_ldflags $f"
542 write_errlist_objs="$write_errlist_objs osx_write ipc"
543 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
544 write_ldflags="$write_ldflags $f"
545 writers="$writers osx"
546 default_writer="OSX_WRITE"
547 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
549 ####################################################### ogg/vorbis/speex/opus
551 OLD_CPPFLAGS="$CPPFLAGS"
552 OLD_LDFLAGS="$LDFLAGS"
554 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
555 [look for ogg headers also in dir])])
556 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
557 [look for ogg libs also in dir])])
558 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
559 [look for vorbis headers also in dir])])
560 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
561 [look for vorbis libs also in dir])])
562 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
563 [look for speex headers also in dir])])
564 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
565 [look for speex libs also in dir])])
566 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
567 [look for opus headers also in dir])])
568 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
569 [look for opus libs also in dir])])
571 if test -n "$with_ogg_headers"; then
572 ogg_cppflags="-I$with_ogg_headers"
573 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
575 if test -n "$with_ogg_libs"; then
576 ogg_libs="-L$with_ogg_libs"
577 LDFLAGS="$LDFLAGS $ogg_libs"
579 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
580 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
585 if test "$have_ogg" = "yes"; then
587 if test -n "$with_vorbis_headers"; then
588 vorbis_cppflags="-I$with_vorbis_headers"
589 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
591 if test -n "$with_vorbis_libs"; then
592 vorbis_libs="-L$with_vorbis_libs"
593 LDFLAGS="$LDFLAGS $vorbis_libs"
595 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
596 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
599 if test -n "$with_speex_headers"; then
600 speex_cppflags="-I$with_speex_headers"
601 CPPFLAGS="$CPPFLAGS $speex_cppflags"
603 if test -n "$with_speex_libs"; then
604 speex_libs="-L$with_speex_libs"
605 LDFLAGS="$LDFLAGS $speex_libs"
607 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
608 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
611 if test -n "$with_opus_headers"; then
612 opus_cppflags="-I$with_opus_headers"
613 CPPFLAGS="$CPPFLAGS $opus_cppflags"
615 if test -n "$with_opus_libs"; then
616 opus_libs="-L$with_opus_libs"
617 LDFLAGS="$LDFLAGS $opus_libs"
619 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
620 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
622 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
628 msg="support in para_server/para_filter/para_afh"
629 if test "$have_vorbis" = "yes" || \
630 test "$have_speex" = "yes" || \
631 test "$have_opus" = "yes"; then
632 AC_SUBST(ogg_cppflags)
633 ogg_libs="$ogg_libs -logg"
634 if test "$OSTYPE" = "Darwin"; then
635 ogg_libs="-Wl,-bind_at_load $ogg_libs"
637 server_ldflags="$server_ldflags $ogg_libs"
638 filter_ldflags="$filter_ldflags $ogg_libs"
639 audiod_ldflags="$audiod_ldflags $ogg_libs"
640 play_ldflags="$play_ldflags $ogg_libs"
641 afh_ldflags="$afh_ldflags $ogg_libs"
642 recv_ldflags="$recv_ldflags $ogg_libs"
643 all_errlist_objs="$all_errlist_objs ogg_afh_common"
644 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
645 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
646 server_errlist_objs="$server_errlist_objs ogg_afh_common"
647 play_errlist_objs="$play_errlist_objs ogg_afh_common"
649 if test "$have_vorbis" = "yes"; then
650 all_errlist_objs="$all_errlist_objs oggdec_filter ogg_afh"
651 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
652 filters="$filters oggdec"
653 vorbis_libs="-lvorbis -lvorbisfile"
654 server_ldflags="$server_ldflags $vorbis_libs"
655 filter_ldflags="$filter_ldflags $vorbis_libs"
656 audiod_ldflags="$audiod_ldflags $vorbis_libs"
657 play_ldflags="$play_ldflags $vorbis_libs"
658 afh_ldflags="$afh_ldflags $vorbis_libs"
659 recv_ldflags="$recv_ldflags $vorbis_libs"
661 server_errlist_objs="$server_errlist_objs ogg_afh"
662 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
663 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
664 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
665 afh_errlist_objs="$afh_errlist_objs ogg_afh"
666 recv_errlist_objs="$recv_errlist_objs ogg_afh"
668 audiod_audio_formats="$audiod_audio_formats ogg"
669 audio_format_handlers="$audio_format_handlers ogg"
671 AC_MSG_WARN([no ogg/vorbis $msg])
673 if test "$have_speex" = "yes"; then
674 all_errlist_objs="$all_errlist_objs spxdec_filter spx_afh spx_common"
675 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
676 filters="$filters spxdec"
678 server_ldflags="$server_ldflags $speex_libs"
679 filter_ldflags="$filter_ldflags $speex_libs"
680 audiod_ldflags="$audiod_ldflags $speex_libs"
681 play_ldflags="$play_ldflags $speex_libs"
682 afh_ldflags="$afh_ldflags $speex_libs"
683 recv_ldflags="$recv_ldflags $speex_libs"
685 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
686 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
687 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
688 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
689 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
690 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
692 audiod_audio_formats="$audiod_audio_formats spx"
693 audio_format_handlers="$audio_format_handlers spx"
695 AC_MSG_WARN([no ogg/speex $msg])
697 if test "$have_opus" = "yes"; then
698 all_errlist_objs="$all_errlist_objs opusdec_filter opus_afh opus_common"
699 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
700 filters="$filters opusdec"
702 server_ldflags="$server_ldflags $opus_libs"
703 filter_ldflags="$filter_ldflags $opus_libs"
704 audiod_ldflags="$audiod_ldflags $opus_libs"
705 afh_ldflags="$afh_ldflags $opus_libs"
706 play_ldflags="$play_ldflags $opus_libs"
707 recv_ldflags="$recv_ldflags $opus_libs"
709 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
710 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
711 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
712 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
713 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
714 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
716 audiod_audio_formats="$audiod_audio_formats opus"
717 audio_format_handlers="$audio_format_handlers opus"
719 AC_MSG_WARN([no ogg/opus $msg])
721 CPPFLAGS="$OLD_CPPFLAGS"
722 LDFLAGS="$OLD_LDFLAGS"
724 ########################################################################### faad
726 OLD_CPPFLAGS="$CPPFLAGS"
727 OLD_LDFLAGS="$LDFLAGS"
729 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
730 [look for neaacdec.h also in dir])])
731 if test -n "$with_faad_headers"; then
732 faad_cppflags="-I$with_faad_headers"
733 CPPFLAGS="$CPPFLAGS $faad_cppflags"
735 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
736 [look for libfaad also in dir])])
737 if test -n "$with_faad_libs"; then
738 faad_libs="-L$with_faad_libs"
739 LDFLAGS="$LDFLAGS $faad_libs"
741 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
742 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
743 if test "$have_faad" = "yes"; then
744 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
745 all_errlist_objs="$all_errlist_objs aac_common aacdec_filter aac_afh"
746 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
747 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
748 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
749 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
750 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
751 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
753 server_ldflags="$server_ldflags $faad_libs -lfaad"
754 filter_ldflags="$filter_ldflags $faad_libs -lfaad"
755 audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
756 play_ldflags="$play_ldflags $faad_libs -lfaad"
757 afh_ldflags="$afh_ldflags $faad_libs -lfaad"
758 recv_ldflags="$afh_ldflags $faad_libs -lfaad"
760 audiod_audio_formats="$audiod_audio_formats aac"
761 audio_format_handlers="$audio_format_handlers aac"
762 filters="$filters aacdec"
763 AC_SUBST(faad_cppflags)
765 AC_MSG_WARN([no aac support in para_audiod/para_filter])
767 CPPFLAGS="$OLD_CPPFLAGS"
768 LDFLAGS="$OLD_LDFLAGS"
770 ########################################################################### mad
772 OLD_CPPFLAGS="$CPPFLAGS"
773 OLD_LDFLAGS="$LDFLAGS"
776 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
777 [look for mad.h also in dir])])
778 if test -n "$with_mad_headers"; then
779 mad_cppflags="-I$with_mad_headers"
780 CPPFLAGS="$CPPFLAGS $mad_cppflags"
782 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
783 [look for libmad also in dir])])
784 if test -n "$with_mad_libs"; then
785 mad_libs="-L$with_mad_libs"
786 LDFLAGS="$LDFLAGS $mad_libs"
788 AC_CHECK_HEADERS([mad.h], [], [
791 AC_CHECK_LIB([mad], [mad_stream_init], [], [
794 if test "$have_mad" = "yes"; then
795 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
796 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(mp3dec_filter)"
797 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(mp3dec_filter)"
798 play_cmdline_objs="$play_cmdline_objs add_cmdline(mp3dec_filter)"
799 all_errlist_objs="$all_errlist_objs mp3dec_filter"
800 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
801 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
802 play_errlist_objs="$play_errlist_objs mp3dec_filter"
803 filter_ldflags="$filter_ldflags $mad_libs -lmad"
804 audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
805 play_ldflags="$play_ldflags $mad_libs -lmad"
806 audiod_audio_formats="$audiod_audio_formats mp3"
807 filters="$filters mp3dec"
808 AC_SUBST(mad_cppflags)
810 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
812 CPPFLAGS="$OLD_CPPFLAGS"
813 LDFLAGS="$OLD_LDFLAGS"
815 ###################################################################### libid3tag
816 OLD_CPPFLAGS="$CPPFLAGS"
817 OLD_LDFLAGS="$LDFLAGS"
821 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
822 [look for id3tag header files also in dir])])
823 if test -n "$with_id3tag_headers"; then
824 id3tag_cppflags="-I$with_id3tag_headers"
825 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
827 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
828 [look for id3tag libs also in dir])])
829 if test -n "$with_id3tag_libs"; then
830 id3tag_libs="-L$with_id3tag_libs"
831 LDFLAGS="$LDFLAGS $id3tag_libs"
834 AC_MSG_CHECKING(for libid3tag)
835 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
838 struct id3_tag t = {.flags = 0};
839 ]])],[],[have_libid3tag=no])
840 AC_MSG_RESULT($have_libid3tag)
842 if test ${have_libid3tag} = yes; then
843 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
844 server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
845 afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
846 play_ldflags="$play_ldflags -lz"
847 recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
848 play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
849 AC_SUBST(id3tag_cppflags)
851 AC_MSG_WARN([no support for id3v2 tags])
853 CPPFLAGS="$OLD_CPPFLAGS"
854 LDFLAGS="$OLD_LDFLAGS"
856 ########################################################################### flac
857 OLD_CPPFLAGS="$CPPFLAGS"
858 OLD_LDFLAGS="$LDFLAGS"
862 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
863 [look for flac headers also in dir])])
864 if test -n "$with_flac_headers"; then
865 flac_cppflags="-I$with_flac_headers"
866 CPPFLAGS="$CPPFLAGS $flac_cppflags"
868 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
869 [look for flac libs also in dir])])
870 if test -n "$with_flac_libs"; then
871 flac_libs="-L$with_flac_libs"
872 LDFLAGS="$LDFLAGS $flac_libs"
874 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
875 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
876 if test "$have_flac" = "yes"; then
877 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
878 all_errlist_objs="$all_errlist_objs flacdec_filter flac_afh"
879 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
880 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
881 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
882 afh_errlist_objs="$afh_errlist_objs flac_afh"
883 server_errlist_objs="$server_errlist_objs flac_afh"
884 recv_errlist_objs="$recv_errlist_objs flac_afh"
885 filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
886 audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
887 play_ldflags="$play_ldflags $flac_libs -lFLAC"
888 server_ldflags="$server_ldflags $flac_libs -lFLAC"
889 afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
890 recv_ldflags="$recv_ldflags $flac_libs -lFLAC"
891 filters="$filters flacdec"
892 audio_format_handlers="$audio_format_handlers flac"
893 audiod_audio_formats="$audiod_audio_formats flac"
894 AC_SUBST(flac_cppflags)
896 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
898 CPPFLAGS="$OLD_CPPFLAGS"
899 LDFLAGS="$OLD_LDFLAGS"
901 ########################################################################### oss
902 OLD_CPPFLAGS="$CPPFLAGS"
903 OLD_LDFLAGS="$LDFLAGS"
907 msg="=> will not build oss writer"
909 AC_CHECK_HEADER(sys/soundcard.h, [
910 audiod_errlist_objs="$audiod_errlist_objs oss_write"
911 play_errlist_objs="$play_errlist_objs oss_write"
912 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"
913 play_cmdline_objs="$play_cmdline_objs add_cmdline(oss_write)"
915 write_errlist_objs="$write_errlist_objs oss_write"
916 write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
917 fade_errlist_objs="$fade_errlist_objs oss_mix"
918 all_errlist_objs="$all_errlist_objs oss_write oss_mix"
920 writers="$writers oss"
921 default_writer="OSS_WRITE"
922 mixers="${mixers}oss "
923 default_mixer="OSS_MIX"
925 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
926 audiod_ldflags="$audiod_ldflags -lossaudio"
927 play_ldflags="$play_ldflags -lossaudio"
928 write_ldflags="$write_ldflags -lossaudio"
929 fade_ldflags="$fade_ldflags -lossaudio"
935 AC_MSG_WARN([no sys/soundcard.h $msg])
938 CPPFLAGS="$OLD_CPPFLAGS"
939 LDFLAGS="$OLD_LDFLAGS"
942 ########################################################################### alsa
943 OLD_CPPFLAGS="$CPPFLAGS"
944 OLD_LDFLAGS="$LDFLAGS"
947 msg="=> no alsa support for para_audiod/para_write"
948 if test "$OSTYPE" != "Linux"; then
953 if test "$have_alsa" = "yes"; then
954 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
956 AC_MSG_WARN([no alsa/asoundlib $msg])
960 if test "$have_alsa" = "yes"; then
961 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
963 AC_MSG_WARN([no libasound $msg])
967 if test "$have_alsa" = "yes"; then
968 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
969 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(alsa_write)"
970 audiod_ldflags="$audiod_ldflags -lasound"
971 play_errlist_objs="$play_errlist_objs alsa_write"
972 play_cmdline_objs="$play_cmdline_objs add_cmdline(alsa_write)"
973 play_ldflags="$play_ldflags -lasound"
975 write_errlist_objs="$write_errlist_objs alsa_write"
976 write_cmdline_objs="$write_cmdline_objs add_cmdline(alsa_write)"
977 write_ldflags="$write_ldflags -lasound"
978 fade_errlist_objs="$fade_errlist_objs alsa_mix"
979 fade_ldflags="$fade_ldflags -lasound"
980 all_errlist_objs="$all_errlist_objs alsa_write alsa_mix"
982 writers="$writers alsa"
983 default_writer="ALSA_WRITE"
984 mixers="${mixers}alsa "
985 default_mixer="ALSA_MIX"
988 CPPFLAGS="$OLD_CPPFLAGS"
989 LDFLAGS="$OLD_LDFLAGS"
991 ########################################################################### fade
992 if test -n "$mixers"; then
993 extras="$extras fade"
994 executables="$executables fade"
995 all_errlist_objs="$all_errlist_objs fade"
996 fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
997 fade_cmdline_objs="add_cmdline(fade)"
998 fade_objs="$fade_cmdline_objs $fade_errlist_objs"
999 AC_SUBST(fade_objs, add_dot_o($fade_objs))
1000 AC_SUBST(fade_ldflags, $fade_ldflags)
1001 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
1002 objlist_to_errlist($fade_errlist_objs),
1003 errors used by para_fade)
1005 for i in $mixers; do
1006 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
1009 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
1010 enum of supported mixers)
1011 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
1012 use this mixer if none was specified)
1013 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
1014 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
1016 for i in $mixers; do
1017 printf 'extern void '$i'_mix_init(struct mixer *); '
1020 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
1021 init functions of the supported mixers)
1022 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
1023 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
1024 mixer_summary="supported mixers:: $mixers, default: $default_mixer"
1026 AC_MSG_WARN([no mixer support])
1027 mixer_summary="para_fade: no"
1029 ########################################################################### libao
1030 OLD_CPPFLAGS="$CPPFLAGS"
1031 OLD_LDFLAGS="$LDFLAGS"
1035 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
1036 [look for ao/ao.h also in dir])])
1037 if test -n "$with_ao_headers"; then
1038 ao_cppflags="-I$with_ao_headers"
1039 CPPFLAGS="$CPPFLAGS $ao_cppflags"
1041 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
1042 [look for libao also in dir])])
1043 if test -n "$with_ao_libs"; then
1044 ao_libs="-L$with_ao_libs"
1045 LDFLAGS="$LDFLAGS $ao_libs"
1047 msg="no libao support for para_audiod/para_write"
1048 AC_CHECK_HEADERS([ao/ao.h], [
1051 AC_MSG_WARN([ao.h not found, $msg])
1053 if test "$have_ao" = "yes"; then
1054 AC_CHECK_LIB([ao], [ao_initialize], [], [
1056 AC_MSG_WARN([ao lib not found or not working, $msg])
1059 if test "$have_ao" = "yes"; then
1060 AC_CHECK_HEADERS([pthread.h], [
1063 AC_MSG_WARN([pthread.h not found, $msg])
1066 if test "$have_ao" = "yes"; then
1067 AC_CHECK_LIB([pthread], [pthread_create], [], [
1069 AC_MSG_WARN([pthread lib not found or not working, $msg])
1072 if test "$have_ao" = "yes"; then
1073 all_errlist_objs="$all_errlist_objs ao_write"
1074 audiod_errlist_objs="$audiod_errlist_objs ao_write"
1075 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(ao_write)"
1076 audiod_ldflags="$audiod_ldflags -lao -lpthread"
1078 play_errlist_objs="$play_errlist_objs ao_write"
1079 play_cmdline_objs="$play_cmdline_objs add_cmdline(ao_write)"
1080 play_ldflags="$play_ldflags -lao -lpthread"
1082 write_errlist_objs="$write_errlist_objs ao_write"
1083 write_cmdline_objs="$write_cmdline_objs add_cmdline(ao_write)"
1084 write_ldflags="$write_ldflags $ao_libs -lao -lpthread"
1085 writers="$writers ao"
1086 AC_SUBST(ao_cppflags)
1089 CPPFLAGS="$OLD_CPPFLAGS"
1090 LDFLAGS="$OLD_LDFLAGS"
1092 ############################################################# readline
1093 OLD_CPPFLAGS="$CPPFLAGS"
1094 OLD_LDFLAGS="$LDFLAGS"
1098 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
1099 [look for libreadline header files also in dir])])
1100 if test -n "$with_readline_headers"; then
1101 readline_cppflags="-I$with_readline_headers"
1102 CPPFLAGS="$CPPFLAGS $readline_cppflags"
1105 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
1106 [look for readline library also in dir])])
1107 if test -n "$with_readline_libs"; then
1108 readline_libs="-L$with_readline_libs"
1109 LDFLAGS="$LDFLAGS $readline_libs"
1111 msg="no interactive cli support"
1112 AC_CHECK_HEADERS([readline/readline.h], [
1115 AC_MSG_WARN([readline/readline.h not found, $msg])
1118 if test "$have_curses" != "yes"; then
1120 AC_MSG_WARN([interactive cli support depends on curses,])
1121 AC_MSG_WARN([but no curses lib was detected, $msg])
1124 if test "$have_readline" = "yes"; then
1125 readline_libs="$readline_libs -lreadline"
1126 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
1127 if test "$have_readline" = "no"; then # try with -lcurses
1129 AC_MSG_NOTICE([trying again with -lcurses])
1130 unset ac_cv_search_rl_free_keymap 2> /dev/null
1131 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1133 readline_libs="$readline_libs -lcurses"
1136 if test "$have_readline" = "no"; then # try with -ltermcap
1138 AC_MSG_NOTICE([trying again with -ltermcap])
1139 unset ac_cv_search_rl_free_keymap 2> /dev/null
1140 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1142 readline_libs="$readline_libs -ltermcap"
1147 if test "$have_readline" = "yes"; then
1148 all_errlist_objs="$all_errlist_objs interactive"
1149 client_errlist_objs="$client_errlist_objs interactive"
1150 client_ldflags="$client_ldflags $readline_libs"
1151 audioc_errlist_objs="$audioc_errlist_objs buffer_tree interactive sched time"
1152 audioc_ldflags="$audioc_ldflags $readline_libs"
1153 play_errlist_objs="$play_errlist_objs interactive"
1154 play_ldflags="$play_ldflags $readline_libs"
1155 AC_SUBST(readline_cppflags)
1156 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
1158 AC_MSG_WARN([libreadline not found or unusable])
1160 CPPFLAGS="$OLD_CPPFLAGS"
1161 LDFLAGS="$OLD_LDFLAGS"
1163 ############################################################# libsamplerate
1164 OLD_CPPFLAGS="$CPPFLAGS"
1165 OLD_LDFLAGS="$LDFLAGS"
1168 have_samplerate="yes"
1169 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
1170 [look for samplerate headers also in dir])])
1171 if test -n "$with_samplerate_headers"; then
1172 samplerate_cppflags="-I$with_samplerate_headers"
1173 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
1175 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
1176 [look for samplerate libs also in dir])])
1177 if test -n "$with_samplerate_libs"; then
1178 samplerate_libs="-L$with_samplerate_libs"
1179 LDFLAGS="$LDFLAGS $samplerate_libs"
1182 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
1183 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
1185 if test "$have_samplerate" = "yes"; then
1186 all_errlist_objs="$all_errlist_objs resample_filter"
1187 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1188 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(resample_filter)"
1189 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1190 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(resample_filter)"
1191 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1192 play_cmdline_objs="$play_cmdline_objs add_cmdline(resample_filter)"
1193 filter_ldflags="$filter_ldflags $samplerate_libs -lsamplerate"
1194 audiod_ldflags="$audiod_ldflags $samplerate_libs -lsamplerate"
1195 play_ldflags="$play_ldflags $samplerate_libs -lsamplerate"
1196 filters="$filters resample"
1197 AC_SUBST(samplerate_cppflags)
1199 AC_MSG_WARN([no resample support in para_audiod/para_filter])
1201 CPPFLAGS="$OLD_CPPFLAGS"
1202 LDFLAGS="$OLD_LDFLAGS"
1204 ############################################################# error2.h
1205 AC_MSG_NOTICE(creating error2.h)
1206 for i in $executables; do
1208 eval echo \$${i}_errlist_objs
1209 done | ./error2.pl > error2.h
1210 for obj in $all_errlist_objs; do
1211 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1213 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1214 [enum {$SS NUM_SS}],
1215 [list of all objects that use the paraslash error facility]
1218 ################################################################## status items
1220 status_items="basename status num_played mtime bitrate frequency file_size
1221 status_flags format score techinfo afs_mode
1222 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1223 offset seconds_total stream_start current_time audiod_uptime image_id
1224 lyrics_id duration directory lyrics_name image_name path hash channels
1225 last_played num_chunks chunk_time amplification artist title year album
1229 for i in $status_items; do
1230 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1232 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1233 [enum of all status items])
1236 for i in $status_items; do
1237 result="$result \"$i\", "
1239 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1240 [char * array of all status items])
1242 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1243 [formats supported by para_server and para_afh])
1245 AC_SUBST(executables)
1247 recv_objs="$recv_cmdline_objs $recv_errlist_objs"
1248 filter_objs="$filter_cmdline_objs $filter_errlist_objs"
1249 audiod_objs="$audiod_cmdline_objs $audiod_errlist_objs"
1250 server_objs="$server_cmdline_objs $server_errlist_objs"
1251 write_objs="$write_cmdline_objs $write_errlist_objs"
1252 client_objs="$client_cmdline_objs $client_errlist_objs"
1253 audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
1254 afh_objs="$afh_cmdline_objs $afh_errlist_objs"
1255 play_objs="$play_cmdline_objs $play_errlist_objs"
1258 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1259 AC_SUBST(recv_ldflags, $recv_ldflags)
1260 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1261 errors used by para_recv)
1263 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1264 AC_SUBST(filter_ldflags, $filter_ldflags)
1265 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1266 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1268 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1269 AC_SUBST(audiod_ldflags, $audiod_ldflags)
1270 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1271 errors used by para_audiod)
1273 AC_SUBST(server_objs, add_dot_o($server_objs))
1274 AC_SUBST(server_ldflags, $server_ldflags)
1275 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
1276 objlist_to_errlist($server_errlist_objs), errors used by para_server)
1278 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1279 AC_SUBST(afh_ldflags, $afh_ldflags)
1280 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1281 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1283 AC_SUBST(write_objs, add_dot_o($write_objs))
1284 AC_SUBST(write_ldflags, $write_ldflags)
1285 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1286 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1288 AC_SUBST(client_objs, add_dot_o($client_objs))
1289 AC_SUBST(client_ldflags, $client_ldflags)
1290 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
1291 objlist_to_errlist($client_errlist_objs), errors used by para_client)
1293 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1294 AC_SUBST(audioc_ldflags, $audioc_ldflags)
1295 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1296 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1298 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1299 AC_SUBST(gui_ldflags, $gui_ldflags)
1300 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1301 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1303 AC_SUBST(play_objs, add_dot_o($play_objs))
1304 AC_SUBST(play_ldflags, $play_ldflags)
1305 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1306 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1308 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1309 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1310 enum of supported filters)
1311 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1312 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1313 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1314 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1316 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1317 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1318 enum of supported writers)
1319 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1320 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1321 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1322 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1323 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1324 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1325 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1327 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1328 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1329 enum of audio formats supported by audiod)
1330 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1331 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1335 paraslash configuration:
1336 ~~~~~~~~~~~~~~~~~~~~~~~~
1337 unix socket credentials: $have_ucred
1338 readline (interactive CLIs): $have_readline
1339 audio formats handlers: $audio_format_handlers
1340 id3 version2 support: $have_libid3tag
1343 optional executables: $extras