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 executables="recv filter audioc write afh play"
96 audio_format_handlers="mp3 wma"
98 recv_cmdline_objs="add_cmdline(recv http_recv dccp_recv udp_recv afh_recv)"
101 http_recv recv_common recv time string net dccp_recv fd
102 sched stdout ggo udp_recv buffer_tree afh_recv afh_common
103 wma_afh wma_common mp3_afh version
108 filter_cmdline_objs="add_cmdline(filter compress_filter amp_filter prebuffer_filter)"
109 filter_errlist_objs="filter_common wav_filter compress_filter filter string
110 stdin stdout sched fd amp_filter ggo fecdec_filter fec version
111 prebuffer_filter time bitstream imdct wma_common wmadec_filter buffer_tree"
113 filters=" compress wav amp fecdec wmadec prebuffer"
115 audioc_cmdline_objs="add_cmdline(audioc)"
116 audioc_errlist_objs="
126 afh_cmdline_objs="add_cmdline(afh)"
127 afh_errlist_objs="afh string fd mp3_afh afh_common time wma_afh wma_common
131 write_cmdline_objs="add_cmdline(write file_write)"
132 write_errlist_objs="write write_common file_write time fd string sched stdin
133 buffer_tree ggo check_wav version"
136 default_writer="FILE_WRITE"
138 gui_cmdline_objs="add_cmdline(gui)"
152 gui_objs="$gui_cmdline_objs $gui_errlist_objs"
153 play_errlist_objs="play fd sched ggo buffer_tree time string net
155 wma_afh wma_common mp3_afh
156 recv_common udp_recv http_recv dccp_recv
157 filter_common fec bitstream imdct
158 wav_filter compress_filter amp_filter prebuffer_filter fecdec_filter
160 write_common file_write
163 play_cmdline_objs="add_cmdline(http_recv dccp_recv udp_recv afh_recv compress_filter amp_filter prebuffer_filter file_write play)"
165 ################################################################## clock_gettime
167 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
168 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
170 if test -n "$clock_gettime_lib"; then
171 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
172 define to 1 if clock_gettime() is supported])
174 if test "$clock_gettime_lib" = "rt"; then
175 AC_SUBST(clock_gettime_ldflags, -lrt)
177 ########################################################################### osl
179 OLD_CPPFLAGS="$CPPFLAGS"
180 OLD_LDFLAGS="$LDFLAGS"
182 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
183 [look for osl.h also in dir])])
184 if test -n "$with_osl_headers"; then
185 osl_cppflags="-I$with_osl_headers"
186 CPPFLAGS="$CPPFLAGS $osl_cppflags"
188 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
189 [look for libosl also in dir])])
190 if test -n "$with_osl_libs"; then
191 osl_libs="-L$with_osl_libs"
192 LDFLAGS="$LDFLAGS $osl_libs"
195 AC_CHECK_HEADER(osl.h, [], have_osl=no)
196 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
197 if test "$have_osl" = "no"; then
198 AC_MSG_WARN([libosl not found, can not build para_server.
200 http://systemlinux.org/~maan/osl
202 git clone git://git.tuebingen.mpg.de/osl
205 AC_SUBST(osl_cppflags)
206 CPPFLAGS="$OLD_CPPFLAGS"
207 LDFLAGS="$OLD_LDFLAGS"
209 ########################################################################### crypto
210 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
211 Force using crypto library "lib". This package requires either
212 openssl or libgcrypt being installed. Possible values for "lib"
213 are thus "openssl" and "gcrypt". If this option is not given,
214 openssl is tried first. If openssl was not found, gcrypt is
217 case "$enable_cryptolib" in
218 "openssl") check_openssl="yes"; check_gcrypt="no";;
219 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
220 "") check_openssl="yes"; check_gcrypt="yes";;
221 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
223 ###################################################################### openssl
224 if test "$check_openssl" = "yes"; then
225 OLD_CPPFLAGS="$CPPFLAGS"
226 OLD_LDFLAGS="$LDFLAGS"
229 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
230 [look for openssl headers also in dir])])
231 if test -n "$with_openssl_headers"; then
232 openssl_cppflags="-I$with_openssl_headers"
233 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
235 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
236 [look for openssl libraries also in dir])])
237 if test -n "$with_openssl_libs"; then
238 openssl_libs="-L$with_openssl_libs"
239 LDFLAGS="$LDFLAGS $openssl_libs"
241 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
242 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
243 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
244 # try harder: openssl is sometimes installed in /usr/local/ssl
245 openssl_cppflags="-I/usr/local/ssl/include"
246 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
247 openssl_libs="-L/usr/local/ssl/lib"
248 LDFLAGS="$LDFLAGS $openssl_libs"
250 unset ac_cv_header_openssl_ssl_h 2> /dev/null
251 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
252 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
253 if test "$have_openssl" = "yes"; then
254 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
257 if test "$have_openssl" = "yes"; then
258 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
259 AC_SUBST(openssl_cppflags)
260 openssl_libs="$openssl_libs -lssl -lcrypto"
261 server_ldflags="$server_ldflags $openssl_libs"
262 client_ldflags="$client_ldflags $openssl_libs"
263 audiod_ldflags="$audiod_ldflags $openssl_libs"
265 server_errlist_objs="$server_errlist_objs crypt"
266 client_errlist_objs="$client_errlist_objs crypt"
267 audiod_errlist_objs="$audiod_errlist_objs crypt"
271 AC_MSG_WARN([openssl libraries not found])
273 CPPFLAGS="$OLD_CPPFLAGS"
274 LDFLAGS="$OLD_LDFLAGS"
279 ########################################################################### gcrypt
280 if test "$check_gcrypt" = "yes"; then
281 OLD_CPPFLAGS="$CPPFLAGS"
282 OLD_LDFLAGS="$LDFLAGS"
285 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
286 [look for gcrypt headers also in dir])])
287 if test -n "$with_gcrypt_headers"; then
288 gcrypt_cppflags="-I$with_gcrypt_headers"
289 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
291 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
292 [look for libgcrypt also in dir])])
293 if test -n "$with_gcrypt_libs"; then
294 gcrypt_libs="-L$with_gcrypt_libs"
295 LDFLAGS="$LDFLAGS $gcrypt_libs"
297 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
298 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
299 if test "$have_gcrypt" = "yes"; then
300 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
301 AC_SUBST(gcrypt_cppflags)
302 gcrypt_libs="$gcrypt_libs -lgcrypt"
303 server_ldflags="$server_ldflags $gcrypt_libs"
304 client_ldflags="$client_ldflags $gcrypt_libs"
305 audiod_ldflags="$audiod_ldflags $gcrypt_libs"
307 server_errlist_objs="$server_errlist_objs gcrypt"
308 client_errlist_objs="$client_errlist_objs gcrypt"
309 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
311 AC_MSG_WARN([gcrypt library not found])
313 CPPFLAGS="$OLD_CPPFLAGS"
314 LDFLAGS="$OLD_LDFLAGS"
319 ########################################################################### libsocket
320 AC_CHECK_LIB([c], [socket],
322 [socket_lib="-lsocket"]
324 server_ldflags="$server_ldflags $socket_lib"
325 client_ldflags="$client_ldflags $socket_lib"
326 audioc_ldflags="$audioc_ldflags $socket_lib"
327 audiod_ldflags="$audiod_ldflags $socket_lib"
328 recv_ldflags="$recv_ldflags $socket_lib"
329 AC_SEARCH_LIBS([connect],[socket],[],[
330 AC_MSG_ERROR([Fatal: Did not find connect().])
332 ########################################################################### libnsl
333 AC_CHECK_LIB([c], [gethostbyname],
337 server_ldflags="$server_ldflags $nsl_lib"
338 client_ldflags="$client_ldflags $nsl_lib"
339 audioc_ldflags="$audioc_ldflags $nsl_lib"
340 recv_ldflags="$recv_ldflags $nsl_lib"
341 AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[
342 AC_MSG_ERROR([Fatal: Did not find inet_ntoa().])
344 ########################################################################### ucred
345 AC_MSG_CHECKING(for struct ucred)
346 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
348 #include <sys/types.h>
349 #include <sys/socket.h>
351 struct ucred sucred; sucred.pid=0;
352 ]])],[have_ucred=yes],[have_ucred=no])
353 AC_MSG_RESULT($have_ucred)
354 if test ${have_ucred} = yes; then
355 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
357 ########################################################################### gengetopt
358 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
360 [gengetopt_args_info_description],
361 [ggo_descriptions_declared=yes],
362 [ggo_descriptions_declared=no],
363 [#include "conftest-ggo.h"]
365 AC_SUBST(ggo_descriptions_declared)
366 ########################################################################### curses
368 OLD_CPPFLAGS="$CPPFLAGS"
369 OLD_LDFLAGS="$LDFLAGS"
371 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
372 [look for curses.h also in dir])])
373 if test -n "$with_curses_headers"; then
374 curses_cppflags="-I$with_curses_headers"
375 CPPFLAGS="$CPPFLAGS $curses_cppflags"
377 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
378 [look for libcurses also in dir])])
379 if test -n "$with_curses_libs"; then
380 curses_libs="-L$with_curses_libs"
381 LDFLAGS="$LDFLAGS $curses_libs"
383 AC_CHECK_HEADER(curses.h, [], [
386 gui_ldflags="$curses_libs"
387 AC_CHECK_LIB([ncursesw], [initscr],
388 [gui_ldflags="$curses_libs -lncursesw"], [
389 AC_CHECK_LIB([curses], [initscr],
390 [gui_ldflags="$curses_libs -lcurses"],
395 if test "$have_curses" = "yes"; then
396 AC_SUBST(curses_cppflags)
398 executables="$executables gui"
401 AC_MSG_WARN([no curses lib, cannot build para_gui])
403 CPPFLAGS="$OLD_CPPFLAGS"
404 LDFLAGS="$OLD_LDFLAGS"
407 ########################################################################### ip_mreqn
408 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
409 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
415 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
416 AC_MSG_RESULT($have_ip_mreqn)
417 if test ${have_ip_mreqn} = yes; then
418 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
420 ########################################################################### osx
422 AC_MSG_CHECKING(for CoreAudio (MacOs))
423 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
424 #include <CoreAudio/CoreAudio.h>
427 ]])],[have_core_audio=yes],[have_core_audio=no])
428 AC_MSG_RESULT($have_core_audio)
429 if test ${have_core_audio} = yes; then
430 f1="-framework CoreAudio"
431 f2="-framework AudioToolbox"
432 f3="-framework AudioUnit"
433 f4="-framework CoreServices"
436 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
437 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
438 audiod_ldflags="$audiod_ldflags $f"
440 play_errlist_objs="$play_errlist_objs osx_write ipc"
441 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
442 play_ldflags="$play_ldflags $f"
444 write_errlist_objs="$write_errlist_objs osx_write ipc"
445 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
446 write_ldflags="$write_ldflags $f"
447 writers="$writers osx"
448 default_writer="OSX_WRITE"
449 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
451 ####################################################### ogg/vorbis/speex/opus
453 OLD_CPPFLAGS="$CPPFLAGS"
454 OLD_LDFLAGS="$LDFLAGS"
456 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
457 [look for ogg headers also in dir])])
458 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
459 [look for ogg libs also in dir])])
460 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
461 [look for vorbis headers also in dir])])
462 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
463 [look for vorbis libs also in dir])])
464 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
465 [look for speex headers also in dir])])
466 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
467 [look for speex libs also in dir])])
468 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
469 [look for opus headers also in dir])])
470 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
471 [look for opus libs also in dir])])
473 if test -n "$with_ogg_headers"; then
474 ogg_cppflags="-I$with_ogg_headers"
475 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
477 if test -n "$with_ogg_libs"; then
478 ogg_libs="-L$with_ogg_libs"
479 LDFLAGS="$LDFLAGS $ogg_libs"
481 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
482 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
487 if test "$have_ogg" = "yes"; then
489 if test -n "$with_vorbis_headers"; then
490 vorbis_cppflags="-I$with_vorbis_headers"
491 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
493 if test -n "$with_vorbis_libs"; then
494 vorbis_libs="-L$with_vorbis_libs"
495 LDFLAGS="$LDFLAGS $vorbis_libs"
497 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
498 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
501 if test -n "$with_speex_headers"; then
502 speex_cppflags="-I$with_speex_headers"
503 CPPFLAGS="$CPPFLAGS $speex_cppflags"
505 if test -n "$with_speex_libs"; then
506 speex_libs="-L$with_speex_libs"
507 LDFLAGS="$LDFLAGS $speex_libs"
509 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
510 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
513 if test -n "$with_opus_headers"; then
514 opus_cppflags="-I$with_opus_headers"
515 CPPFLAGS="$CPPFLAGS $opus_cppflags"
517 if test -n "$with_opus_libs"; then
518 opus_libs="-L$with_opus_libs"
519 LDFLAGS="$LDFLAGS $opus_libs"
521 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
522 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
524 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
530 msg="support in para_server/para_filter/para_afh"
531 if test "$have_vorbis" = "yes" || \
532 test "$have_speex" = "yes" || \
533 test "$have_opus" = "yes"; then
534 AC_SUBST(ogg_cppflags)
535 ogg_libs="$ogg_libs -logg"
536 if test "$OSTYPE" = "Darwin"; then
537 ogg_libs="-Wl,-bind_at_load $ogg_libs"
539 server_ldflags="$server_ldflags $ogg_libs"
540 filter_ldflags="$filter_ldflags $ogg_libs"
541 audiod_ldflags="$audiod_ldflags $ogg_libs"
542 play_ldflags="$play_ldflags $ogg_libs"
543 afh_ldflags="$afh_ldflags $ogg_libs"
544 recv_ldflags="$recv_ldflags $ogg_libs"
545 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
546 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
547 server_errlist_objs="$server_errlist_objs ogg_afh_common"
548 play_errlist_objs="$play_errlist_objs ogg_afh_common"
550 if test "$have_vorbis" = "yes"; then
551 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
552 filters="$filters oggdec"
553 vorbis_libs="-lvorbis -lvorbisfile"
554 server_ldflags="$server_ldflags $vorbis_libs"
555 filter_ldflags="$filter_ldflags $vorbis_libs"
556 audiod_ldflags="$audiod_ldflags $vorbis_libs"
557 play_ldflags="$play_ldflags $vorbis_libs"
558 afh_ldflags="$afh_ldflags $vorbis_libs"
559 recv_ldflags="$recv_ldflags $vorbis_libs"
561 server_errlist_objs="$server_errlist_objs ogg_afh"
562 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
563 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
564 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
565 afh_errlist_objs="$afh_errlist_objs ogg_afh"
566 recv_errlist_objs="$recv_errlist_objs ogg_afh"
568 audiod_audio_formats="$audiod_audio_formats ogg"
569 audio_format_handlers="$audio_format_handlers ogg"
571 AC_MSG_WARN([no ogg/vorbis $msg])
573 if test "$have_speex" = "yes"; then
574 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
575 filters="$filters spxdec"
577 server_ldflags="$server_ldflags $speex_libs"
578 filter_ldflags="$filter_ldflags $speex_libs"
579 audiod_ldflags="$audiod_ldflags $speex_libs"
580 play_ldflags="$play_ldflags $speex_libs"
581 afh_ldflags="$afh_ldflags $speex_libs"
582 recv_ldflags="$recv_ldflags $speex_libs"
584 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
585 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
586 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
587 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
588 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
589 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
591 audiod_audio_formats="$audiod_audio_formats spx"
592 audio_format_handlers="$audio_format_handlers spx"
594 AC_MSG_WARN([no ogg/speex $msg])
596 if test "$have_opus" = "yes"; then
597 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
598 filters="$filters opusdec"
600 server_ldflags="$server_ldflags $opus_libs"
601 filter_ldflags="$filter_ldflags $opus_libs"
602 audiod_ldflags="$audiod_ldflags $opus_libs"
603 afh_ldflags="$afh_ldflags $opus_libs"
604 play_ldflags="$play_ldflags $opus_libs"
605 recv_ldflags="$recv_ldflags $opus_libs"
607 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
608 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
609 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
610 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
611 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
612 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
614 audiod_audio_formats="$audiod_audio_formats opus"
615 audio_format_handlers="$audio_format_handlers opus"
617 AC_MSG_WARN([no ogg/opus $msg])
619 CPPFLAGS="$OLD_CPPFLAGS"
620 LDFLAGS="$OLD_LDFLAGS"
622 ########################################################################### faad
624 OLD_CPPFLAGS="$CPPFLAGS"
625 OLD_LDFLAGS="$LDFLAGS"
627 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
628 [look for neaacdec.h also in dir])])
629 if test -n "$with_faad_headers"; then
630 faad_cppflags="-I$with_faad_headers"
631 CPPFLAGS="$CPPFLAGS $faad_cppflags"
633 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
634 [look for libfaad also in dir])])
635 if test -n "$with_faad_libs"; then
636 faad_libs="-L$with_faad_libs"
637 LDFLAGS="$LDFLAGS $faad_libs"
639 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
640 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
641 if test "$have_faad" = "yes"; then
642 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
643 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
644 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
645 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
646 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
647 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
648 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
650 server_ldflags="$server_ldflags $faad_libs -lfaad"
651 filter_ldflags="$filter_ldflags $faad_libs -lfaad"
652 audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
653 play_ldflags="$play_ldflags $faad_libs -lfaad"
654 afh_ldflags="$afh_ldflags $faad_libs -lfaad"
655 recv_ldflags="$afh_ldflags $faad_libs -lfaad"
657 audiod_audio_formats="$audiod_audio_formats aac"
658 audio_format_handlers="$audio_format_handlers aac"
659 filters="$filters aacdec"
660 AC_SUBST(faad_cppflags)
662 AC_MSG_WARN([no aac support in para_audiod/para_filter])
664 CPPFLAGS="$OLD_CPPFLAGS"
665 LDFLAGS="$OLD_LDFLAGS"
667 ########################################################################### mad
669 OLD_CPPFLAGS="$CPPFLAGS"
670 OLD_LDFLAGS="$LDFLAGS"
673 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
674 [look for mad.h also in dir])])
675 if test -n "$with_mad_headers"; then
676 mad_cppflags="-I$with_mad_headers"
677 CPPFLAGS="$CPPFLAGS $mad_cppflags"
679 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
680 [look for libmad also in dir])])
681 if test -n "$with_mad_libs"; then
682 mad_libs="-L$with_mad_libs"
683 LDFLAGS="$LDFLAGS $mad_libs"
685 AC_CHECK_HEADERS([mad.h], [], [
688 AC_CHECK_LIB([mad], [mad_stream_init], [], [
691 if test "$have_mad" = "yes"; then
692 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
693 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(mp3dec_filter)"
694 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(mp3dec_filter)"
695 play_cmdline_objs="$play_cmdline_objs add_cmdline(mp3dec_filter)"
696 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
697 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
698 play_errlist_objs="$play_errlist_objs mp3dec_filter"
699 filter_ldflags="$filter_ldflags $mad_libs -lmad"
700 audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
701 play_ldflags="$play_ldflags $mad_libs -lmad"
702 audiod_audio_formats="$audiod_audio_formats mp3"
703 filters="$filters mp3dec"
704 AC_SUBST(mad_cppflags)
706 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
708 CPPFLAGS="$OLD_CPPFLAGS"
709 LDFLAGS="$OLD_LDFLAGS"
711 ###################################################################### libid3tag
712 OLD_CPPFLAGS="$CPPFLAGS"
713 OLD_LDFLAGS="$LDFLAGS"
717 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
718 [look for id3tag header files also in dir])])
719 if test -n "$with_id3tag_headers"; then
720 id3tag_cppflags="-I$with_id3tag_headers"
721 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
723 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
724 [look for id3tag libs also in dir])])
725 if test -n "$with_id3tag_libs"; then
726 id3tag_libs="-L$with_id3tag_libs"
727 LDFLAGS="$LDFLAGS $id3tag_libs"
730 AC_MSG_CHECKING(for libid3tag)
731 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
734 struct id3_tag t = {.flags = 0};
735 ]])],[],[have_libid3tag=no])
736 AC_MSG_RESULT($have_libid3tag)
738 if test ${have_libid3tag} = yes; then
739 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
740 server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
741 afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
742 play_ldflags="$play_ldflags -lz"
743 recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
744 play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
745 AC_SUBST(id3tag_cppflags)
747 AC_MSG_WARN([no support for id3v2 tags])
749 CPPFLAGS="$OLD_CPPFLAGS"
750 LDFLAGS="$OLD_LDFLAGS"
752 ########################################################################### flac
753 OLD_CPPFLAGS="$CPPFLAGS"
754 OLD_LDFLAGS="$LDFLAGS"
758 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
759 [look for flac headers also in dir])])
760 if test -n "$with_flac_headers"; then
761 flac_cppflags="-I$with_flac_headers"
762 CPPFLAGS="$CPPFLAGS $flac_cppflags"
764 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
765 [look for flac libs also in dir])])
766 if test -n "$with_flac_libs"; then
767 flac_libs="-L$with_flac_libs"
768 LDFLAGS="$LDFLAGS $flac_libs"
770 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
771 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
772 if test "$have_flac" = "yes"; then
773 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
774 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
775 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
776 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
777 afh_errlist_objs="$afh_errlist_objs flac_afh"
778 server_errlist_objs="$server_errlist_objs flac_afh"
779 recv_errlist_objs="$recv_errlist_objs flac_afh"
780 filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
781 audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
782 play_ldflags="$play_ldflags $flac_libs -lFLAC"
783 server_ldflags="$server_ldflags $flac_libs -lFLAC"
784 afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
785 recv_ldflags="$recv_ldflags $flac_libs -lFLAC"
786 filters="$filters flacdec"
787 audio_format_handlers="$audio_format_handlers flac"
788 audiod_audio_formats="$audiod_audio_formats flac"
789 AC_SUBST(flac_cppflags)
791 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
793 CPPFLAGS="$OLD_CPPFLAGS"
794 LDFLAGS="$OLD_LDFLAGS"
796 ########################################################################### oss
797 OLD_CPPFLAGS="$CPPFLAGS"
798 OLD_LDFLAGS="$LDFLAGS"
802 msg="=> will not build oss writer"
804 AC_CHECK_HEADER(sys/soundcard.h, [
805 audiod_errlist_objs="$audiod_errlist_objs oss_write"
806 play_errlist_objs="$play_errlist_objs oss_write"
807 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"
808 play_cmdline_objs="$play_cmdline_objs add_cmdline(oss_write)"
810 write_errlist_objs="$write_errlist_objs oss_write"
811 write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
812 fade_errlist_objs="$fade_errlist_objs oss_mix"
814 writers="$writers oss"
815 default_writer="OSS_WRITE"
816 mixers="${mixers}oss "
817 default_mixer="OSS_MIX"
819 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
820 audiod_ldflags="$audiod_ldflags -lossaudio"
821 play_ldflags="$play_ldflags -lossaudio"
822 write_ldflags="$write_ldflags -lossaudio"
823 fade_ldflags="$fade_ldflags -lossaudio"
829 AC_MSG_WARN([no sys/soundcard.h $msg])
832 CPPFLAGS="$OLD_CPPFLAGS"
833 LDFLAGS="$OLD_LDFLAGS"
836 ########################################################################### alsa
837 OLD_CPPFLAGS="$CPPFLAGS"
838 OLD_LDFLAGS="$LDFLAGS"
841 msg="=> no alsa support for para_audiod/para_write"
842 if test "$OSTYPE" != "Linux"; then
847 if test "$have_alsa" = "yes"; then
848 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
850 AC_MSG_WARN([no alsa/asoundlib $msg])
854 if test "$have_alsa" = "yes"; then
855 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
857 AC_MSG_WARN([no libasound $msg])
861 if test "$have_alsa" = "yes"; then
862 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
863 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(alsa_write)"
864 audiod_ldflags="$audiod_ldflags -lasound"
865 play_errlist_objs="$play_errlist_objs alsa_write"
866 play_cmdline_objs="$play_cmdline_objs add_cmdline(alsa_write)"
867 play_ldflags="$play_ldflags -lasound"
869 write_errlist_objs="$write_errlist_objs alsa_write"
870 write_cmdline_objs="$write_cmdline_objs add_cmdline(alsa_write)"
871 write_ldflags="$write_ldflags -lasound"
872 fade_errlist_objs="$fade_errlist_objs alsa_mix"
873 fade_ldflags="$fade_ldflags -lasound"
875 writers="$writers alsa"
876 default_writer="ALSA_WRITE"
877 mixers="${mixers}alsa "
878 default_mixer="ALSA_MIX"
881 CPPFLAGS="$OLD_CPPFLAGS"
882 LDFLAGS="$OLD_LDFLAGS"
884 ########################################################################### fade
885 if test -n "$mixers"; then
887 executables="$executables fade"
888 fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
889 fade_cmdline_objs="add_cmdline(fade)"
890 fade_objs="$fade_cmdline_objs $fade_errlist_objs"
891 AC_SUBST(fade_objs, add_dot_o($fade_objs))
892 AC_SUBST(fade_ldflags, $fade_ldflags)
893 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
894 objlist_to_errlist($fade_errlist_objs),
895 errors used by para_fade)
898 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
901 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
902 enum of supported mixers)
903 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
904 use this mixer if none was specified)
905 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
906 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
909 printf 'extern void '$i'_mix_init(struct mixer *); '
912 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
913 init functions of the supported mixers)
914 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
915 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
916 mixer_summary="supported mixers:: $mixers, default: $default_mixer"
919 AC_MSG_WARN([no mixer support])
920 mixer_summary="para_fade: no"
922 ########################################################################### libao
923 OLD_CPPFLAGS="$CPPFLAGS"
924 OLD_LDFLAGS="$LDFLAGS"
928 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
929 [look for ao/ao.h also in dir])])
930 if test -n "$with_ao_headers"; then
931 ao_cppflags="-I$with_ao_headers"
932 CPPFLAGS="$CPPFLAGS $ao_cppflags"
934 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
935 [look for libao also in dir])])
936 if test -n "$with_ao_libs"; then
937 ao_libs="-L$with_ao_libs"
938 LDFLAGS="$LDFLAGS $ao_libs"
940 msg="no libao support for para_audiod/para_write"
941 AC_CHECK_HEADERS([ao/ao.h], [
944 AC_MSG_WARN([ao.h not found, $msg])
946 if test "$have_ao" = "yes"; then
947 AC_CHECK_LIB([ao], [ao_initialize], [], [
949 AC_MSG_WARN([ao lib not found or not working, $msg])
952 if test "$have_ao" = "yes"; then
953 AC_CHECK_HEADERS([pthread.h], [
956 AC_MSG_WARN([pthread.h not found, $msg])
959 if test "$have_ao" = "yes"; then
960 AC_CHECK_LIB([pthread], [pthread_create], [], [
962 AC_MSG_WARN([pthread lib not found or not working, $msg])
965 if test "$have_ao" = "yes"; then
966 audiod_errlist_objs="$audiod_errlist_objs ao_write"
967 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(ao_write)"
968 audiod_ldflags="$audiod_ldflags -lao -lpthread"
970 play_errlist_objs="$play_errlist_objs ao_write"
971 play_cmdline_objs="$play_cmdline_objs add_cmdline(ao_write)"
972 play_ldflags="$play_ldflags -lao -lpthread"
974 write_errlist_objs="$write_errlist_objs ao_write"
975 write_cmdline_objs="$write_cmdline_objs add_cmdline(ao_write)"
976 write_ldflags="$write_ldflags $ao_libs -lao -lpthread"
977 writers="$writers ao"
978 AC_SUBST(ao_cppflags)
981 CPPFLAGS="$OLD_CPPFLAGS"
982 LDFLAGS="$OLD_LDFLAGS"
984 ############################################################# readline
985 OLD_CPPFLAGS="$CPPFLAGS"
986 OLD_LDFLAGS="$LDFLAGS"
990 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
991 [look for libreadline header files also in dir])])
992 if test -n "$with_readline_headers"; then
993 readline_cppflags="-I$with_readline_headers"
994 CPPFLAGS="$CPPFLAGS $readline_cppflags"
997 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
998 [look for readline library also in dir])])
999 if test -n "$with_readline_libs"; then
1000 readline_libs="-L$with_readline_libs"
1001 LDFLAGS="$LDFLAGS $readline_libs"
1003 msg="no interactive cli support"
1004 AC_CHECK_HEADERS([readline/readline.h], [
1007 AC_MSG_WARN([readline/readline.h not found, $msg])
1010 if test "$have_curses" != "yes"; then
1012 AC_MSG_WARN([interactive cli support depends on curses,])
1013 AC_MSG_WARN([but no curses lib was detected, $msg])
1016 if test "$have_readline" = "yes"; then
1017 readline_libs="$readline_libs -lreadline"
1018 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
1019 if test "$have_readline" = "no"; then # try with -lcurses
1021 AC_MSG_NOTICE([trying again with -lcurses])
1022 unset ac_cv_search_rl_free_keymap 2> /dev/null
1023 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1025 readline_libs="$readline_libs -lcurses"
1028 if test "$have_readline" = "no"; then # try with -ltermcap
1030 AC_MSG_NOTICE([trying again with -ltermcap])
1031 unset ac_cv_search_rl_free_keymap 2> /dev/null
1032 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1034 readline_libs="$readline_libs -ltermcap"
1039 if test "$have_readline" = "yes"; then
1040 client_errlist_objs="$client_errlist_objs interactive"
1041 client_ldflags="$client_ldflags $readline_libs"
1042 audioc_errlist_objs="$audioc_errlist_objs buffer_tree interactive sched time"
1043 audioc_ldflags="$audioc_ldflags $readline_libs"
1044 play_errlist_objs="$play_errlist_objs interactive"
1045 play_ldflags="$play_ldflags $readline_libs"
1046 AC_SUBST(readline_cppflags)
1047 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
1049 AC_MSG_WARN([libreadline not found or unusable])
1051 CPPFLAGS="$OLD_CPPFLAGS"
1052 LDFLAGS="$OLD_LDFLAGS"
1054 ############################################################# libsamplerate
1055 OLD_CPPFLAGS="$CPPFLAGS"
1056 OLD_LDFLAGS="$LDFLAGS"
1059 have_samplerate="yes"
1060 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
1061 [look for samplerate headers also in dir])])
1062 if test -n "$with_samplerate_headers"; then
1063 samplerate_cppflags="-I$with_samplerate_headers"
1064 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
1066 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
1067 [look for samplerate libs also in dir])])
1068 if test -n "$with_samplerate_libs"; then
1069 samplerate_libs="-L$with_samplerate_libs"
1070 LDFLAGS="$LDFLAGS $samplerate_libs"
1073 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
1074 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
1076 if test "$have_samplerate" = "yes"; then
1077 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1078 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(resample_filter)"
1079 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1080 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(resample_filter)"
1081 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1082 play_cmdline_objs="$play_cmdline_objs add_cmdline(resample_filter)"
1083 filter_ldflags="$filter_ldflags $samplerate_libs -lsamplerate"
1084 audiod_ldflags="$audiod_ldflags $samplerate_libs -lsamplerate"
1085 play_ldflags="$play_ldflags $samplerate_libs -lsamplerate"
1086 filters="$filters resample"
1087 AC_SUBST(samplerate_cppflags)
1089 AC_MSG_WARN([no resample support in para_audiod/para_filter])
1091 CPPFLAGS="$OLD_CPPFLAGS"
1092 LDFLAGS="$OLD_LDFLAGS"
1094 ######################################################################### server
1095 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
1096 -a "$have_osl" = "yes" ; then
1099 executables="$executables server"
1100 server_cmdline_objs="add_cmdline(server)"
1101 server_errlist_objs="$server_errlist_objs
1140 server_ldflags="$server_ldflags $osl_libs -losl"
1144 ############################################################# client
1145 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1147 executables="$executables client"
1148 client_cmdline_objs="add_cmdline(client)"
1149 client_errlist_objs="$client_errlist_objs
1168 ############################################################# audiod
1169 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1171 executables="$executables audiod"
1172 audiod_cmdline_objs="$audiod_cmdline_objs
1173 add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
1174 audiod_errlist_objs="$audiod_errlist_objs
1211 audiod_ldflags="$audiod_ldflags -lm"
1212 audiod_audio_formats="$audiod_audio_formats wma"
1216 ############################################################# error2.h
1217 AC_MSG_NOTICE(creating error2.h)
1219 # these are always built
1222 $filter_errlist_objs
1223 $audioc_errlist_objs
1229 # optional executables
1230 if test "$build_server" = "yes"; then
1231 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1233 if test "$build_gui" = "yes"; then
1234 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1236 if test "$build_fade" = "yes"; then
1237 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1239 if test "$build_client" = "yes"; then
1240 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1242 if test "$build_audiod" = "yes"; then
1243 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1246 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1248 for i in $executables; do
1250 eval echo \$${i}_errlist_objs
1251 done | ./error2.pl > error2.h
1252 for obj in $all_errlist_objs; do
1253 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1255 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1256 [enum {$SS NUM_SS}],
1257 [list of all objects that use the paraslash error facility]
1260 ################################################################## status items
1262 status_items="basename status num_played mtime bitrate frequency file_size
1263 status_flags format score techinfo afs_mode
1264 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1265 offset seconds_total stream_start current_time audiod_uptime image_id
1266 lyrics_id duration directory lyrics_name image_name path hash channels
1267 last_played num_chunks chunk_time amplification artist title year album
1271 for i in $status_items; do
1272 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1274 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1275 [enum of all status items])
1278 for i in $status_items; do
1279 result="$result \"$i\", "
1281 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1282 [char * array of all status items])
1284 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1285 [formats supported by para_server and para_afh])
1287 AC_SUBST(executables)
1289 recv_objs="$recv_cmdline_objs $recv_errlist_objs"
1290 filter_objs="$filter_cmdline_objs $filter_errlist_objs"
1291 audiod_objs="$audiod_cmdline_objs $audiod_errlist_objs"
1292 server_objs="$server_cmdline_objs $server_errlist_objs"
1293 write_objs="$write_cmdline_objs $write_errlist_objs"
1294 client_objs="$client_cmdline_objs $client_errlist_objs"
1295 audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
1296 afh_objs="$afh_cmdline_objs $afh_errlist_objs"
1297 play_objs="$play_cmdline_objs $play_errlist_objs"
1300 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1301 AC_SUBST(recv_ldflags, $recv_ldflags)
1302 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1303 errors used by para_recv)
1305 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1306 AC_SUBST(filter_ldflags, $filter_ldflags)
1307 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1308 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1310 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1311 AC_SUBST(audiod_ldflags, $audiod_ldflags)
1312 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1313 errors used by para_audiod)
1315 AC_SUBST(server_objs, add_dot_o($server_objs))
1316 AC_SUBST(server_ldflags, $server_ldflags)
1317 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
1318 objlist_to_errlist($server_errlist_objs), errors used by para_server)
1320 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1321 AC_SUBST(afh_ldflags, $afh_ldflags)
1322 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1323 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1325 AC_SUBST(write_objs, add_dot_o($write_objs))
1326 AC_SUBST(write_ldflags, $write_ldflags)
1327 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1328 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1330 AC_SUBST(client_objs, add_dot_o($client_objs))
1331 AC_SUBST(client_ldflags, $client_ldflags)
1332 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
1333 objlist_to_errlist($client_errlist_objs), errors used by para_client)
1335 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1336 AC_SUBST(audioc_ldflags, $audioc_ldflags)
1337 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1338 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1340 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1341 AC_SUBST(gui_ldflags, $gui_ldflags)
1342 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1343 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1345 AC_SUBST(play_objs, add_dot_o($play_objs))
1346 AC_SUBST(play_ldflags, $play_ldflags)
1347 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1348 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1350 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1351 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1352 enum of supported filters)
1353 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1354 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1355 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1356 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1358 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1359 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1360 enum of supported writers)
1361 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1362 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1363 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1364 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1365 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1366 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1367 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1369 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1370 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1371 enum of audio formats supported by audiod)
1372 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1373 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1377 paraslash configuration:
1378 ~~~~~~~~~~~~~~~~~~~~~~~~
1379 unix socket credentials: $have_ucred
1380 readline (interactive CLIs): $have_readline
1381 audio formats handlers: $audio_format_handlers
1382 id3 version2 support: $have_libid3tag
1387 para_server: $build_server
1388 para_gui: $build_gui
1389 para_fade: $build_fade
1390 para_client: $build_client
1391 para_audiod: $build_audiod