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])
45 AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h \
46 stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h sys/un.h \
47 sys/ipc.h unistd.h utime.h stddef.h],
48 [], [AC_MSG_ERROR([$ac_header not found])])
50 # Checks for typedefs, structures, and compiler characteristics.
70 # Checks for library functions.
72 AC_PROG_GCC_TRADITIONAL
76 AC_FUNC_SELECT_ARGTYPES
83 AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \
84 regcomp select strchr strdup strerror strstr strtol uname \
85 fchdir gettimeofday localtime_r munmap strcasecmp strcspn \
86 strncasecmp strrchr strspn alarm mkdir inet_ntoa socket], [],
87 [AC_MSG_ERROR([function not found, cannot live without it])])
89 AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
92 executables="recv filter audioc write afh play"
93 audio_format_handlers="mp3 wma"
95 recv_cmdline_objs="add_cmdline(recv http_recv dccp_recv udp_recv afh_recv)"
98 http_recv recv_common recv time string net dccp_recv fd
99 sched stdout ggo udp_recv buffer_tree afh_recv afh_common
100 wma_afh wma_common mp3_afh version
105 filter_cmdline_objs="add_cmdline(filter compress_filter amp_filter prebuffer_filter)"
106 filter_errlist_objs="filter_common wav_filter compress_filter filter string
107 stdin stdout sched fd amp_filter ggo fecdec_filter fec version
108 prebuffer_filter time bitstream imdct wma_common wmadec_filter buffer_tree"
110 filters=" compress wav amp fecdec wmadec prebuffer"
112 audioc_cmdline_objs="add_cmdline(audioc)"
113 audioc_errlist_objs="
123 afh_cmdline_objs="add_cmdline(afh)"
124 afh_errlist_objs="afh string fd mp3_afh afh_common time wma_afh wma_common
128 write_cmdline_objs="add_cmdline(write file_write)"
129 write_errlist_objs="write write_common file_write time fd string sched stdin
130 buffer_tree ggo check_wav version"
133 default_writer="FILE_WRITE"
135 gui_cmdline_objs="add_cmdline(gui)"
149 gui_objs="$gui_cmdline_objs $gui_errlist_objs"
150 play_errlist_objs="play fd sched ggo buffer_tree time string net
152 wma_afh wma_common mp3_afh
153 recv_common udp_recv http_recv dccp_recv
154 filter_common fec bitstream imdct
155 wav_filter compress_filter amp_filter prebuffer_filter fecdec_filter
157 write_common file_write
160 play_cmdline_objs="add_cmdline(http_recv dccp_recv udp_recv afh_recv compress_filter amp_filter prebuffer_filter file_write play)"
162 ################################################################## clock_gettime
164 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
165 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
167 if test -n "$clock_gettime_lib"; then
168 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
169 define to 1 if clock_gettime() is supported])
171 if test "$clock_gettime_lib" = "rt"; then
172 AC_SUBST(clock_gettime_ldflags, -lrt)
174 ########################################################################### osl
176 OLD_CPPFLAGS="$CPPFLAGS"
177 OLD_LDFLAGS="$LDFLAGS"
179 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
180 [look for osl.h also in dir])])
181 if test -n "$with_osl_headers"; then
182 osl_cppflags="-I$with_osl_headers"
183 CPPFLAGS="$CPPFLAGS $osl_cppflags"
185 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
186 [look for libosl also in dir])])
187 if test -n "$with_osl_libs"; then
188 osl_libs="-L$with_osl_libs"
189 LDFLAGS="$LDFLAGS $osl_libs"
192 AC_CHECK_HEADER(osl.h, [], have_osl=no)
193 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
194 if test "$have_osl" = "no"; then
195 AC_MSG_WARN([libosl not found, can not build para_server.
197 http://systemlinux.org/~maan/osl
199 git clone git://git.tuebingen.mpg.de/osl
202 AC_SUBST(osl_cppflags)
203 CPPFLAGS="$OLD_CPPFLAGS"
204 LDFLAGS="$OLD_LDFLAGS"
206 ########################################################################### crypto
207 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
208 Force using crypto library "lib". This package requires either
209 openssl or libgcrypt being installed. Possible values for "lib"
210 are thus "openssl" and "gcrypt". If this option is not given,
211 openssl is tried first. If openssl was not found, gcrypt is
214 case "$enable_cryptolib" in
215 "openssl") check_openssl="yes"; check_gcrypt="no";;
216 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
217 "") check_openssl="yes"; check_gcrypt="yes";;
218 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
220 ###################################################################### openssl
221 if test "$check_openssl" = "yes"; then
222 OLD_CPPFLAGS="$CPPFLAGS"
223 OLD_LDFLAGS="$LDFLAGS"
226 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
227 [look for openssl headers also in dir])])
228 if test -n "$with_openssl_headers"; then
229 openssl_cppflags="-I$with_openssl_headers"
230 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
232 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
233 [look for openssl libraries also in dir])])
234 if test -n "$with_openssl_libs"; then
235 openssl_libs="-L$with_openssl_libs"
236 LDFLAGS="$LDFLAGS $openssl_libs"
238 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
239 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
240 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
241 # try harder: openssl is sometimes installed in /usr/local/ssl
242 openssl_cppflags="-I/usr/local/ssl/include"
243 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
244 openssl_libs="-L/usr/local/ssl/lib"
245 LDFLAGS="$LDFLAGS $openssl_libs"
247 unset ac_cv_header_openssl_ssl_h 2> /dev/null
248 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
249 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
250 if test "$have_openssl" = "yes"; then
251 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
254 if test "$have_openssl" = "yes"; then
255 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
256 AC_SUBST(openssl_cppflags)
257 openssl_libs="$openssl_libs -lssl -lcrypto"
258 server_ldflags="$server_ldflags $openssl_libs"
259 client_ldflags="$client_ldflags $openssl_libs"
260 audiod_ldflags="$audiod_ldflags $openssl_libs"
262 server_errlist_objs="$server_errlist_objs crypt"
263 client_errlist_objs="$client_errlist_objs crypt"
264 audiod_errlist_objs="$audiod_errlist_objs crypt"
268 AC_MSG_WARN([openssl libraries not found])
270 CPPFLAGS="$OLD_CPPFLAGS"
271 LDFLAGS="$OLD_LDFLAGS"
276 ########################################################################### gcrypt
277 if test "$check_gcrypt" = "yes"; then
278 OLD_CPPFLAGS="$CPPFLAGS"
279 OLD_LDFLAGS="$LDFLAGS"
282 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
283 [look for gcrypt headers also in dir])])
284 if test -n "$with_gcrypt_headers"; then
285 gcrypt_cppflags="-I$with_gcrypt_headers"
286 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
288 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
289 [look for libgcrypt also in dir])])
290 if test -n "$with_gcrypt_libs"; then
291 gcrypt_libs="-L$with_gcrypt_libs"
292 LDFLAGS="$LDFLAGS $gcrypt_libs"
294 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
295 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
296 if test "$have_gcrypt" = "yes"; then
297 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
298 AC_SUBST(gcrypt_cppflags)
299 gcrypt_libs="$gcrypt_libs -lgcrypt"
300 server_ldflags="$server_ldflags $gcrypt_libs"
301 client_ldflags="$client_ldflags $gcrypt_libs"
302 audiod_ldflags="$audiod_ldflags $gcrypt_libs"
304 server_errlist_objs="$server_errlist_objs gcrypt"
305 client_errlist_objs="$client_errlist_objs gcrypt"
306 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
308 AC_MSG_WARN([gcrypt library not found])
310 CPPFLAGS="$OLD_CPPFLAGS"
311 LDFLAGS="$OLD_LDFLAGS"
316 ########################################################################### libsocket
317 AC_CHECK_LIB([c], [socket],
319 [socket_lib="-lsocket"]
321 server_ldflags="$server_ldflags $socket_lib"
322 client_ldflags="$client_ldflags $socket_lib"
323 audioc_ldflags="$audioc_ldflags $socket_lib"
324 audiod_ldflags="$audiod_ldflags $socket_lib"
325 recv_ldflags="$recv_ldflags $socket_lib"
326 AC_SEARCH_LIBS([connect],[socket],[],[
327 AC_MSG_ERROR([Fatal: Did not find connect().])
329 ########################################################################### libnsl
330 AC_CHECK_LIB([c], [gethostbyname],
334 server_ldflags="$server_ldflags $nsl_lib"
335 client_ldflags="$client_ldflags $nsl_lib"
336 audioc_ldflags="$audioc_ldflags $nsl_lib"
337 recv_ldflags="$recv_ldflags $nsl_lib"
338 AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[
339 AC_MSG_ERROR([Fatal: Did not find inet_ntoa().])
341 ########################################################################### ucred
342 AC_MSG_CHECKING(for struct ucred)
343 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
345 #include <sys/types.h>
346 #include <sys/socket.h>
348 struct ucred sucred; sucred.pid=0;
349 ]])],[have_ucred=yes],[have_ucred=no])
350 AC_MSG_RESULT($have_ucred)
351 if test ${have_ucred} = yes; then
352 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
354 ########################################################################### gengetopt
355 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
357 [gengetopt_args_info_description],
358 [ggo_descriptions_declared=yes],
359 [ggo_descriptions_declared=no],
360 [#include "conftest-ggo.h"]
362 AC_SUBST(ggo_descriptions_declared)
363 ########################################################################### curses
365 OLD_CPPFLAGS="$CPPFLAGS"
366 OLD_LDFLAGS="$LDFLAGS"
368 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
369 [look for curses.h also in dir])])
370 if test -n "$with_curses_headers"; then
371 curses_cppflags="-I$with_curses_headers"
372 CPPFLAGS="$CPPFLAGS $curses_cppflags"
374 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
375 [look for libcurses also in dir])])
376 if test -n "$with_curses_libs"; then
377 curses_libs="-L$with_curses_libs"
378 LDFLAGS="$LDFLAGS $curses_libs"
380 AC_CHECK_HEADER(curses.h, [], [
383 gui_ldflags="$curses_libs"
384 AC_CHECK_LIB([ncursesw], [initscr],
385 [gui_ldflags="$curses_libs -lncursesw"], [
386 AC_CHECK_LIB([curses], [initscr],
387 [gui_ldflags="$curses_libs -lcurses"],
392 if test "$have_curses" = "yes"; then
393 AC_SUBST(curses_cppflags)
395 executables="$executables gui"
398 AC_MSG_WARN([no curses lib, cannot build para_gui])
400 CPPFLAGS="$OLD_CPPFLAGS"
401 LDFLAGS="$OLD_LDFLAGS"
404 ########################################################################### ip_mreqn
405 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
406 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
412 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
413 AC_MSG_RESULT($have_ip_mreqn)
414 if test ${have_ip_mreqn} = yes; then
415 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
417 ########################################################################### osx
419 AC_MSG_CHECKING(for CoreAudio (MacOs))
420 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
421 #include <CoreAudio/CoreAudio.h>
424 ]])],[have_core_audio=yes],[have_core_audio=no])
425 AC_MSG_RESULT($have_core_audio)
426 if test ${have_core_audio} = yes; then
427 f1="-framework CoreAudio"
428 f2="-framework AudioToolbox"
429 f3="-framework AudioUnit"
430 f4="-framework CoreServices"
433 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
434 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
435 audiod_ldflags="$audiod_ldflags $f"
437 play_errlist_objs="$play_errlist_objs osx_write ipc"
438 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
439 play_ldflags="$play_ldflags $f"
441 write_errlist_objs="$write_errlist_objs osx_write ipc"
442 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
443 write_ldflags="$write_ldflags $f"
444 writers="$writers osx"
445 default_writer="OSX_WRITE"
446 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
448 ####################################################### ogg/vorbis/speex/opus
450 OLD_CPPFLAGS="$CPPFLAGS"
451 OLD_LDFLAGS="$LDFLAGS"
453 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
454 [look for ogg headers also in dir])])
455 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
456 [look for ogg libs also in dir])])
457 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
458 [look for vorbis headers also in dir])])
459 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
460 [look for vorbis libs also in dir])])
461 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
462 [look for speex headers also in dir])])
463 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
464 [look for speex libs also in dir])])
465 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
466 [look for opus headers also in dir])])
467 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
468 [look for opus libs also in dir])])
470 if test -n "$with_ogg_headers"; then
471 ogg_cppflags="-I$with_ogg_headers"
472 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
474 if test -n "$with_ogg_libs"; then
475 ogg_libs="-L$with_ogg_libs"
476 LDFLAGS="$LDFLAGS $ogg_libs"
478 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
479 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
484 if test "$have_ogg" = "yes"; then
486 if test -n "$with_vorbis_headers"; then
487 vorbis_cppflags="-I$with_vorbis_headers"
488 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
490 if test -n "$with_vorbis_libs"; then
491 vorbis_libs="-L$with_vorbis_libs"
492 LDFLAGS="$LDFLAGS $vorbis_libs"
494 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
495 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
498 if test -n "$with_speex_headers"; then
499 speex_cppflags="-I$with_speex_headers"
500 CPPFLAGS="$CPPFLAGS $speex_cppflags"
502 if test -n "$with_speex_libs"; then
503 speex_libs="-L$with_speex_libs"
504 LDFLAGS="$LDFLAGS $speex_libs"
506 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
507 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
510 if test -n "$with_opus_headers"; then
511 opus_cppflags="-I$with_opus_headers"
512 CPPFLAGS="$CPPFLAGS $opus_cppflags"
514 if test -n "$with_opus_libs"; then
515 opus_libs="-L$with_opus_libs"
516 LDFLAGS="$LDFLAGS $opus_libs"
518 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
519 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
521 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
527 msg="support in para_server/para_filter/para_afh"
528 if test "$have_vorbis" = "yes" || \
529 test "$have_speex" = "yes" || \
530 test "$have_opus" = "yes"; then
531 AC_SUBST(ogg_cppflags)
532 ogg_libs="$ogg_libs -logg"
533 if test "$OSTYPE" = "Darwin"; then
534 ogg_libs="-Wl,-bind_at_load $ogg_libs"
536 server_ldflags="$server_ldflags $ogg_libs"
537 filter_ldflags="$filter_ldflags $ogg_libs"
538 audiod_ldflags="$audiod_ldflags $ogg_libs"
539 play_ldflags="$play_ldflags $ogg_libs"
540 afh_ldflags="$afh_ldflags $ogg_libs"
541 recv_ldflags="$recv_ldflags $ogg_libs"
542 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
543 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
544 server_errlist_objs="$server_errlist_objs ogg_afh_common"
545 play_errlist_objs="$play_errlist_objs ogg_afh_common"
547 if test "$have_vorbis" = "yes"; then
548 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
549 filters="$filters oggdec"
550 vorbis_libs="-lvorbis -lvorbisfile"
551 server_ldflags="$server_ldflags $vorbis_libs"
552 filter_ldflags="$filter_ldflags $vorbis_libs"
553 audiod_ldflags="$audiod_ldflags $vorbis_libs"
554 play_ldflags="$play_ldflags $vorbis_libs"
555 afh_ldflags="$afh_ldflags $vorbis_libs"
556 recv_ldflags="$recv_ldflags $vorbis_libs"
558 server_errlist_objs="$server_errlist_objs ogg_afh"
559 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
560 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
561 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
562 afh_errlist_objs="$afh_errlist_objs ogg_afh"
563 recv_errlist_objs="$recv_errlist_objs ogg_afh"
565 audiod_audio_formats="$audiod_audio_formats ogg"
566 audio_format_handlers="$audio_format_handlers ogg"
568 AC_MSG_WARN([no ogg/vorbis $msg])
570 if test "$have_speex" = "yes"; then
571 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
572 filters="$filters spxdec"
574 server_ldflags="$server_ldflags $speex_libs"
575 filter_ldflags="$filter_ldflags $speex_libs"
576 audiod_ldflags="$audiod_ldflags $speex_libs"
577 play_ldflags="$play_ldflags $speex_libs"
578 afh_ldflags="$afh_ldflags $speex_libs"
579 recv_ldflags="$recv_ldflags $speex_libs"
581 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
582 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
583 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
584 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
585 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
586 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
588 audiod_audio_formats="$audiod_audio_formats spx"
589 audio_format_handlers="$audio_format_handlers spx"
591 AC_MSG_WARN([no ogg/speex $msg])
593 if test "$have_opus" = "yes"; then
594 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
595 filters="$filters opusdec"
597 server_ldflags="$server_ldflags $opus_libs"
598 filter_ldflags="$filter_ldflags $opus_libs"
599 audiod_ldflags="$audiod_ldflags $opus_libs"
600 afh_ldflags="$afh_ldflags $opus_libs"
601 play_ldflags="$play_ldflags $opus_libs"
602 recv_ldflags="$recv_ldflags $opus_libs"
604 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
605 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
606 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
607 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
608 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
609 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
611 audiod_audio_formats="$audiod_audio_formats opus"
612 audio_format_handlers="$audio_format_handlers opus"
614 AC_MSG_WARN([no ogg/opus $msg])
616 CPPFLAGS="$OLD_CPPFLAGS"
617 LDFLAGS="$OLD_LDFLAGS"
619 ########################################################################### faad
621 OLD_CPPFLAGS="$CPPFLAGS"
622 OLD_LDFLAGS="$LDFLAGS"
624 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
625 [look for neaacdec.h also in dir])])
626 if test -n "$with_faad_headers"; then
627 faad_cppflags="-I$with_faad_headers"
628 CPPFLAGS="$CPPFLAGS $faad_cppflags"
630 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
631 [look for libfaad also in dir])])
632 if test -n "$with_faad_libs"; then
633 faad_libs="-L$with_faad_libs"
634 LDFLAGS="$LDFLAGS $faad_libs"
636 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
637 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
638 if test "$have_faad" = "yes"; then
639 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
640 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
641 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
642 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
643 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
644 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
645 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
647 server_ldflags="$server_ldflags $faad_libs -lfaad"
648 filter_ldflags="$filter_ldflags $faad_libs -lfaad"
649 audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
650 play_ldflags="$play_ldflags $faad_libs -lfaad"
651 afh_ldflags="$afh_ldflags $faad_libs -lfaad"
652 recv_ldflags="$afh_ldflags $faad_libs -lfaad"
654 audiod_audio_formats="$audiod_audio_formats aac"
655 audio_format_handlers="$audio_format_handlers aac"
656 filters="$filters aacdec"
657 AC_SUBST(faad_cppflags)
659 AC_MSG_WARN([no aac support in para_audiod/para_filter])
661 CPPFLAGS="$OLD_CPPFLAGS"
662 LDFLAGS="$OLD_LDFLAGS"
664 ########################################################################### mad
666 OLD_CPPFLAGS="$CPPFLAGS"
667 OLD_LDFLAGS="$LDFLAGS"
670 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
671 [look for mad.h also in dir])])
672 if test -n "$with_mad_headers"; then
673 mad_cppflags="-I$with_mad_headers"
674 CPPFLAGS="$CPPFLAGS $mad_cppflags"
676 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
677 [look for libmad also in dir])])
678 if test -n "$with_mad_libs"; then
679 mad_libs="-L$with_mad_libs"
680 LDFLAGS="$LDFLAGS $mad_libs"
682 AC_CHECK_HEADERS([mad.h], [], [
685 AC_CHECK_LIB([mad], [mad_stream_init], [], [
688 if test "$have_mad" = "yes"; then
689 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
690 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(mp3dec_filter)"
691 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(mp3dec_filter)"
692 play_cmdline_objs="$play_cmdline_objs add_cmdline(mp3dec_filter)"
693 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
694 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
695 play_errlist_objs="$play_errlist_objs mp3dec_filter"
696 filter_ldflags="$filter_ldflags $mad_libs -lmad"
697 audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
698 play_ldflags="$play_ldflags $mad_libs -lmad"
699 audiod_audio_formats="$audiod_audio_formats mp3"
700 filters="$filters mp3dec"
701 AC_SUBST(mad_cppflags)
703 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
705 CPPFLAGS="$OLD_CPPFLAGS"
706 LDFLAGS="$OLD_LDFLAGS"
708 ###################################################################### libid3tag
709 OLD_CPPFLAGS="$CPPFLAGS"
710 OLD_LDFLAGS="$LDFLAGS"
714 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
715 [look for id3tag header files also in dir])])
716 if test -n "$with_id3tag_headers"; then
717 id3tag_cppflags="-I$with_id3tag_headers"
718 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
720 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
721 [look for id3tag libs also in dir])])
722 if test -n "$with_id3tag_libs"; then
723 id3tag_libs="-L$with_id3tag_libs"
724 LDFLAGS="$LDFLAGS $id3tag_libs"
727 AC_MSG_CHECKING(for libid3tag)
728 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
731 struct id3_tag t = {.flags = 0};
732 ]])],[],[have_libid3tag=no])
733 AC_MSG_RESULT($have_libid3tag)
735 if test ${have_libid3tag} = yes; then
736 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
737 server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
738 afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
739 play_ldflags="$play_ldflags -lz"
740 recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
741 play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
742 AC_SUBST(id3tag_cppflags)
744 AC_MSG_WARN([no support for id3v2 tags])
746 CPPFLAGS="$OLD_CPPFLAGS"
747 LDFLAGS="$OLD_LDFLAGS"
749 ########################################################################### flac
750 OLD_CPPFLAGS="$CPPFLAGS"
751 OLD_LDFLAGS="$LDFLAGS"
755 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
756 [look for flac headers also in dir])])
757 if test -n "$with_flac_headers"; then
758 flac_cppflags="-I$with_flac_headers"
759 CPPFLAGS="$CPPFLAGS $flac_cppflags"
761 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
762 [look for flac libs also in dir])])
763 if test -n "$with_flac_libs"; then
764 flac_libs="-L$with_flac_libs"
765 LDFLAGS="$LDFLAGS $flac_libs"
767 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
768 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
769 if test "$have_flac" = "yes"; then
770 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
771 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
772 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
773 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
774 afh_errlist_objs="$afh_errlist_objs flac_afh"
775 server_errlist_objs="$server_errlist_objs flac_afh"
776 recv_errlist_objs="$recv_errlist_objs flac_afh"
777 filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
778 audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
779 play_ldflags="$play_ldflags $flac_libs -lFLAC"
780 server_ldflags="$server_ldflags $flac_libs -lFLAC"
781 afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
782 recv_ldflags="$recv_ldflags $flac_libs -lFLAC"
783 filters="$filters flacdec"
784 audio_format_handlers="$audio_format_handlers flac"
785 audiod_audio_formats="$audiod_audio_formats flac"
786 AC_SUBST(flac_cppflags)
788 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
790 CPPFLAGS="$OLD_CPPFLAGS"
791 LDFLAGS="$OLD_LDFLAGS"
793 ########################################################################### oss
794 OLD_CPPFLAGS="$CPPFLAGS"
795 OLD_LDFLAGS="$LDFLAGS"
799 msg="=> will not build oss writer"
801 AC_CHECK_HEADER(sys/soundcard.h, [
802 audiod_errlist_objs="$audiod_errlist_objs oss_write"
803 play_errlist_objs="$play_errlist_objs oss_write"
804 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"
805 play_cmdline_objs="$play_cmdline_objs add_cmdline(oss_write)"
807 write_errlist_objs="$write_errlist_objs oss_write"
808 write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
809 fade_errlist_objs="$fade_errlist_objs oss_mix"
811 writers="$writers oss"
812 default_writer="OSS_WRITE"
813 mixers="${mixers}oss "
814 default_mixer="OSS_MIX"
816 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
817 audiod_ldflags="$audiod_ldflags -lossaudio"
818 play_ldflags="$play_ldflags -lossaudio"
819 write_ldflags="$write_ldflags -lossaudio"
820 fade_ldflags="$fade_ldflags -lossaudio"
826 AC_MSG_WARN([no sys/soundcard.h $msg])
829 CPPFLAGS="$OLD_CPPFLAGS"
830 LDFLAGS="$OLD_LDFLAGS"
833 ########################################################################### alsa
834 OLD_CPPFLAGS="$CPPFLAGS"
835 OLD_LDFLAGS="$LDFLAGS"
838 msg="=> no alsa support for para_audiod/para_write"
839 if test "$OSTYPE" != "Linux"; then
844 if test "$have_alsa" = "yes"; then
845 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
847 AC_MSG_WARN([no alsa/asoundlib $msg])
851 if test "$have_alsa" = "yes"; then
852 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
854 AC_MSG_WARN([no libasound $msg])
858 if test "$have_alsa" = "yes"; then
859 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
860 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(alsa_write)"
861 audiod_ldflags="$audiod_ldflags -lasound"
862 play_errlist_objs="$play_errlist_objs alsa_write"
863 play_cmdline_objs="$play_cmdline_objs add_cmdline(alsa_write)"
864 play_ldflags="$play_ldflags -lasound"
866 write_errlist_objs="$write_errlist_objs alsa_write"
867 write_cmdline_objs="$write_cmdline_objs add_cmdline(alsa_write)"
868 write_ldflags="$write_ldflags -lasound"
869 fade_errlist_objs="$fade_errlist_objs alsa_mix"
870 fade_ldflags="$fade_ldflags -lasound"
872 writers="$writers alsa"
873 default_writer="ALSA_WRITE"
874 mixers="${mixers}alsa "
875 default_mixer="ALSA_MIX"
878 CPPFLAGS="$OLD_CPPFLAGS"
879 LDFLAGS="$OLD_LDFLAGS"
881 ########################################################################### fade
882 if test -n "$mixers"; then
884 executables="$executables fade"
885 fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
886 fade_cmdline_objs="add_cmdline(fade)"
887 fade_objs="$fade_cmdline_objs $fade_errlist_objs"
888 AC_SUBST(fade_objs, add_dot_o($fade_objs))
889 AC_SUBST(fade_ldflags, $fade_ldflags)
890 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
891 objlist_to_errlist($fade_errlist_objs),
892 errors used by para_fade)
895 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
898 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
899 enum of supported mixers)
900 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
901 use this mixer if none was specified)
902 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
903 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
906 printf 'extern void '$i'_mix_init(struct mixer *); '
909 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
910 init functions of the supported mixers)
911 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
912 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
913 mixer_summary="supported mixers:: $mixers, default: $default_mixer"
916 AC_MSG_WARN([no mixer support])
917 mixer_summary="para_fade: no"
919 ########################################################################### libao
920 OLD_CPPFLAGS="$CPPFLAGS"
921 OLD_LDFLAGS="$LDFLAGS"
925 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
926 [look for ao/ao.h also in dir])])
927 if test -n "$with_ao_headers"; then
928 ao_cppflags="-I$with_ao_headers"
929 CPPFLAGS="$CPPFLAGS $ao_cppflags"
931 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
932 [look for libao also in dir])])
933 if test -n "$with_ao_libs"; then
934 ao_libs="-L$with_ao_libs"
935 LDFLAGS="$LDFLAGS $ao_libs"
937 msg="no libao support for para_audiod/para_write"
938 AC_CHECK_HEADERS([ao/ao.h], [
941 AC_MSG_WARN([ao.h not found, $msg])
943 if test "$have_ao" = "yes"; then
944 AC_CHECK_LIB([ao], [ao_initialize], [], [
946 AC_MSG_WARN([ao lib not found or not working, $msg])
949 if test "$have_ao" = "yes"; then
950 AC_CHECK_HEADERS([pthread.h], [
953 AC_MSG_WARN([pthread.h not found, $msg])
956 if test "$have_ao" = "yes"; then
957 AC_CHECK_LIB([pthread], [pthread_create], [], [
959 AC_MSG_WARN([pthread lib not found or not working, $msg])
962 if test "$have_ao" = "yes"; then
963 audiod_errlist_objs="$audiod_errlist_objs ao_write"
964 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(ao_write)"
965 audiod_ldflags="$audiod_ldflags -lao -lpthread"
967 play_errlist_objs="$play_errlist_objs ao_write"
968 play_cmdline_objs="$play_cmdline_objs add_cmdline(ao_write)"
969 play_ldflags="$play_ldflags -lao -lpthread"
971 write_errlist_objs="$write_errlist_objs ao_write"
972 write_cmdline_objs="$write_cmdline_objs add_cmdline(ao_write)"
973 write_ldflags="$write_ldflags $ao_libs -lao -lpthread"
974 writers="$writers ao"
975 AC_SUBST(ao_cppflags)
978 CPPFLAGS="$OLD_CPPFLAGS"
979 LDFLAGS="$OLD_LDFLAGS"
981 ############################################################# readline
982 OLD_CPPFLAGS="$CPPFLAGS"
983 OLD_LDFLAGS="$LDFLAGS"
987 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
988 [look for libreadline header files also in dir])])
989 if test -n "$with_readline_headers"; then
990 readline_cppflags="-I$with_readline_headers"
991 CPPFLAGS="$CPPFLAGS $readline_cppflags"
994 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
995 [look for readline library also in dir])])
996 if test -n "$with_readline_libs"; then
997 readline_libs="-L$with_readline_libs"
998 LDFLAGS="$LDFLAGS $readline_libs"
1000 msg="no interactive cli support"
1001 AC_CHECK_HEADERS([readline/readline.h], [
1004 AC_MSG_WARN([readline/readline.h not found, $msg])
1007 if test "$have_curses" != "yes"; then
1009 AC_MSG_WARN([interactive cli support depends on curses,])
1010 AC_MSG_WARN([but no curses lib was detected, $msg])
1013 if test "$have_readline" = "yes"; then
1014 readline_libs="$readline_libs -lreadline"
1015 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
1016 if test "$have_readline" = "no"; then # try with -lcurses
1018 AC_MSG_NOTICE([trying again with -lcurses])
1019 unset ac_cv_search_rl_free_keymap 2> /dev/null
1020 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1022 readline_libs="$readline_libs -lcurses"
1025 if test "$have_readline" = "no"; then # try with -ltermcap
1027 AC_MSG_NOTICE([trying again with -ltermcap])
1028 unset ac_cv_search_rl_free_keymap 2> /dev/null
1029 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1031 readline_libs="$readline_libs -ltermcap"
1036 if test "$have_readline" = "yes"; then
1037 client_errlist_objs="$client_errlist_objs interactive"
1038 client_ldflags="$client_ldflags $readline_libs"
1039 audioc_errlist_objs="$audioc_errlist_objs buffer_tree interactive sched time"
1040 audioc_ldflags="$audioc_ldflags $readline_libs"
1041 play_errlist_objs="$play_errlist_objs interactive"
1042 play_ldflags="$play_ldflags $readline_libs"
1043 AC_SUBST(readline_cppflags)
1044 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
1046 AC_MSG_WARN([libreadline not found or unusable])
1048 CPPFLAGS="$OLD_CPPFLAGS"
1049 LDFLAGS="$OLD_LDFLAGS"
1051 ############################################################# libsamplerate
1052 OLD_CPPFLAGS="$CPPFLAGS"
1053 OLD_LDFLAGS="$LDFLAGS"
1056 have_samplerate="yes"
1057 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
1058 [look for samplerate headers also in dir])])
1059 if test -n "$with_samplerate_headers"; then
1060 samplerate_cppflags="-I$with_samplerate_headers"
1061 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
1063 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
1064 [look for samplerate libs also in dir])])
1065 if test -n "$with_samplerate_libs"; then
1066 samplerate_libs="-L$with_samplerate_libs"
1067 LDFLAGS="$LDFLAGS $samplerate_libs"
1070 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
1071 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
1073 if test "$have_samplerate" = "yes"; then
1074 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1075 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(resample_filter)"
1076 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1077 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(resample_filter)"
1078 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1079 play_cmdline_objs="$play_cmdline_objs add_cmdline(resample_filter)"
1080 filter_ldflags="$filter_ldflags $samplerate_libs -lsamplerate"
1081 audiod_ldflags="$audiod_ldflags $samplerate_libs -lsamplerate"
1082 play_ldflags="$play_ldflags $samplerate_libs -lsamplerate"
1083 filters="$filters resample"
1084 AC_SUBST(samplerate_cppflags)
1086 AC_MSG_WARN([no resample support in para_audiod/para_filter])
1088 CPPFLAGS="$OLD_CPPFLAGS"
1089 LDFLAGS="$OLD_LDFLAGS"
1091 ######################################################################### server
1092 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
1093 -a "$have_osl" = "yes" ; then
1096 executables="$executables server"
1097 server_cmdline_objs="add_cmdline(server)"
1098 server_errlist_objs="$server_errlist_objs
1137 server_ldflags="$server_ldflags $osl_libs -losl"
1141 ############################################################# client
1142 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1144 executables="$executables client"
1145 client_cmdline_objs="add_cmdline(client)"
1146 client_errlist_objs="$client_errlist_objs
1165 ############################################################# audiod
1166 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1168 executables="$executables audiod"
1169 audiod_cmdline_objs="$audiod_cmdline_objs
1170 add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
1171 audiod_errlist_objs="$audiod_errlist_objs
1208 audiod_ldflags="$audiod_ldflags -lm"
1209 audiod_audio_formats="$audiod_audio_formats wma"
1213 ############################################################# error2.h
1214 AC_MSG_NOTICE(creating error2.h)
1216 # these are always built
1219 $filter_errlist_objs
1220 $audioc_errlist_objs
1226 # optional executables
1227 if test "$build_server" = "yes"; then
1228 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1230 if test "$build_gui" = "yes"; then
1231 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1233 if test "$build_fade" = "yes"; then
1234 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1236 if test "$build_client" = "yes"; then
1237 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1239 if test "$build_audiod" = "yes"; then
1240 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1243 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1245 for i in $executables; do
1247 eval echo \$${i}_errlist_objs
1248 done | ./error2.pl > error2.h
1249 for obj in $all_errlist_objs; do
1250 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1252 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1253 [enum {$SS NUM_SS}],
1254 [list of all objects that use the paraslash error facility]
1257 ################################################################## status items
1259 status_items="basename status num_played mtime bitrate frequency file_size
1260 status_flags format score techinfo afs_mode
1261 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1262 offset seconds_total stream_start current_time audiod_uptime image_id
1263 lyrics_id duration directory lyrics_name image_name path hash channels
1264 last_played num_chunks chunk_time amplification artist title year album
1268 for i in $status_items; do
1269 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1271 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1272 [enum of all status items])
1275 for i in $status_items; do
1276 result="$result \"$i\", "
1278 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1279 [char * array of all status items])
1281 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1282 [formats supported by para_server and para_afh])
1284 AC_SUBST(executables)
1286 recv_objs="$recv_cmdline_objs $recv_errlist_objs"
1287 filter_objs="$filter_cmdline_objs $filter_errlist_objs"
1288 audiod_objs="$audiod_cmdline_objs $audiod_errlist_objs"
1289 server_objs="$server_cmdline_objs $server_errlist_objs"
1290 write_objs="$write_cmdline_objs $write_errlist_objs"
1291 client_objs="$client_cmdline_objs $client_errlist_objs"
1292 audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
1293 afh_objs="$afh_cmdline_objs $afh_errlist_objs"
1294 play_objs="$play_cmdline_objs $play_errlist_objs"
1297 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1298 AC_SUBST(recv_ldflags, $recv_ldflags)
1299 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1300 errors used by para_recv)
1302 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1303 AC_SUBST(filter_ldflags, $filter_ldflags)
1304 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1305 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1307 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1308 AC_SUBST(audiod_ldflags, $audiod_ldflags)
1309 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1310 errors used by para_audiod)
1312 AC_SUBST(server_objs, add_dot_o($server_objs))
1313 AC_SUBST(server_ldflags, $server_ldflags)
1314 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
1315 objlist_to_errlist($server_errlist_objs), errors used by para_server)
1317 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1318 AC_SUBST(afh_ldflags, $afh_ldflags)
1319 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1320 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1322 AC_SUBST(write_objs, add_dot_o($write_objs))
1323 AC_SUBST(write_ldflags, $write_ldflags)
1324 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1325 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1327 AC_SUBST(client_objs, add_dot_o($client_objs))
1328 AC_SUBST(client_ldflags, $client_ldflags)
1329 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
1330 objlist_to_errlist($client_errlist_objs), errors used by para_client)
1332 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1333 AC_SUBST(audioc_ldflags, $audioc_ldflags)
1334 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1335 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1337 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1338 AC_SUBST(gui_ldflags, $gui_ldflags)
1339 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1340 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1342 AC_SUBST(play_objs, add_dot_o($play_objs))
1343 AC_SUBST(play_ldflags, $play_ldflags)
1344 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1345 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1347 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1348 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1349 enum of supported filters)
1350 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1351 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1352 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1353 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1355 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1356 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1357 enum of supported writers)
1358 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1359 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1360 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1361 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1362 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1363 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1364 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1366 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1367 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1368 enum of audio formats supported by audiod)
1369 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1370 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1374 paraslash configuration:
1375 ~~~~~~~~~~~~~~~~~~~~~~~~
1376 unix socket credentials: $have_ucred
1377 readline (interactive CLIs): $have_readline
1378 audio formats handlers: $audio_format_handlers
1379 id3 version2 support: $have_libid3tag
1384 para_server: $build_server
1385 para_gui: $build_gui
1386 para_fade: $build_fade
1387 para_client: $build_client
1388 para_audiod: $build_audiod