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 client afh audiod 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 audiod_cmdline_objs="add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
127 audiod_errlist_objs="audiod signal string daemon stat net crypt_common sideband
128 time grab_client filter_common wav_filter compress_filter amp_filter http_recv dccp_recv
129 recv_common fd sched write_common file_write audiod_command fecdec_filter
130 client_common ggo udp_recv color fec prebuffer_filter version
131 bitstream imdct wma_common wmadec_filter buffer_tree"
133 audiod_audio_formats="wma"
135 afh_cmdline_objs="add_cmdline(afh)"
136 afh_errlist_objs="afh string fd mp3_afh afh_common time wma_afh wma_common
140 write_cmdline_objs="add_cmdline(write file_write)"
141 write_errlist_objs="write write_common file_write time fd string sched stdin
142 buffer_tree ggo check_wav version"
145 default_writer="FILE_WRITE"
147 client_cmdline_objs="add_cmdline(client)"
148 client_errlist_objs="
166 gui_cmdline_objs="add_cmdline(gui)"
180 gui_objs="$gui_cmdline_objs $gui_errlist_objs"
181 play_errlist_objs="play fd sched ggo buffer_tree time string net
183 wma_afh wma_common mp3_afh
184 recv_common udp_recv http_recv dccp_recv
185 filter_common fec bitstream imdct
186 wav_filter compress_filter amp_filter prebuffer_filter fecdec_filter
188 write_common file_write
191 play_cmdline_objs="add_cmdline(http_recv dccp_recv udp_recv afh_recv compress_filter amp_filter prebuffer_filter file_write play)"
193 ################################################################## clock_gettime
195 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
196 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
198 if test -n "$clock_gettime_lib"; then
199 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
200 define to 1 if clock_gettime() is supported])
202 if test "$clock_gettime_lib" = "rt"; then
203 AC_SUBST(clock_gettime_ldflags, -lrt)
205 ########################################################################### osl
207 OLD_CPPFLAGS="$CPPFLAGS"
208 OLD_LDFLAGS="$LDFLAGS"
210 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
211 [look for osl.h also in dir])])
212 if test -n "$with_osl_headers"; then
213 osl_cppflags="-I$with_osl_headers"
214 CPPFLAGS="$CPPFLAGS $osl_cppflags"
216 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
217 [look for libosl also in dir])])
218 if test -n "$with_osl_libs"; then
219 osl_libs="-L$with_osl_libs"
220 LDFLAGS="$LDFLAGS $osl_libs"
223 AC_CHECK_HEADER(osl.h, [], have_osl=no)
224 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
225 if test "$have_osl" = "no"; then
226 AC_MSG_WARN([libosl not found, can not build para_server.
228 http://systemlinux.org/~maan/osl
230 git clone git://git.tuebingen.mpg.de/osl
233 AC_SUBST(osl_cppflags)
234 CPPFLAGS="$OLD_CPPFLAGS"
235 LDFLAGS="$OLD_LDFLAGS"
237 ########################################################################### crypto
238 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
239 Force using crypto library "lib". This package requires either
240 openssl or libgcrypt being installed. Possible values for "lib"
241 are thus "openssl" and "gcrypt". If this option is not given,
242 openssl is tried first. If openssl was not found, gcrypt is
245 case "$enable_cryptolib" in
246 "openssl") check_openssl="yes"; check_gcrypt="no";;
247 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
248 "") check_openssl="yes"; check_gcrypt="yes";;
249 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
251 ###################################################################### openssl
252 if test "$check_openssl" = "yes"; then
253 OLD_CPPFLAGS="$CPPFLAGS"
254 OLD_LDFLAGS="$LDFLAGS"
257 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
258 [look for openssl headers also in dir])])
259 if test -n "$with_openssl_headers"; then
260 openssl_cppflags="-I$with_openssl_headers"
261 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
263 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
264 [look for openssl libraries also in dir])])
265 if test -n "$with_openssl_libs"; then
266 openssl_libs="-L$with_openssl_libs"
267 LDFLAGS="$LDFLAGS $openssl_libs"
269 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
270 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
271 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
272 # try harder: openssl is sometimes installed in /usr/local/ssl
273 openssl_cppflags="-I/usr/local/ssl/include"
274 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
275 openssl_libs="-L/usr/local/ssl/lib"
276 LDFLAGS="$LDFLAGS $openssl_libs"
278 unset ac_cv_header_openssl_ssl_h 2> /dev/null
279 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
280 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
281 if test "$have_openssl" = "yes"; then
282 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
285 if test "$have_openssl" = "yes"; then
286 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
287 AC_SUBST(openssl_cppflags)
288 openssl_libs="$openssl_libs -lssl -lcrypto"
289 server_ldflags="$server_ldflags $openssl_libs"
290 client_ldflags="$client_ldflags $openssl_libs"
291 audiod_ldflags="$audiod_ldflags $openssl_libs"
293 server_errlist_objs="$server_errlist_objs crypt"
294 client_errlist_objs="$client_errlist_objs crypt"
295 audiod_errlist_objs="$audiod_errlist_objs crypt"
299 AC_MSG_WARN([openssl libraries not found])
301 CPPFLAGS="$OLD_CPPFLAGS"
302 LDFLAGS="$OLD_LDFLAGS"
307 ########################################################################### gcrypt
308 if test "$check_gcrypt" = "yes"; then
309 OLD_CPPFLAGS="$CPPFLAGS"
310 OLD_LDFLAGS="$LDFLAGS"
313 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
314 [look for gcrypt headers also in dir])])
315 if test -n "$with_gcrypt_headers"; then
316 gcrypt_cppflags="-I$with_gcrypt_headers"
317 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
319 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
320 [look for libgcrypt also in dir])])
321 if test -n "$with_gcrypt_libs"; then
322 gcrypt_libs="-L$with_gcrypt_libs"
323 LDFLAGS="$LDFLAGS $gcrypt_libs"
325 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
326 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
327 if test "$have_gcrypt" = "yes"; then
328 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
329 AC_SUBST(gcrypt_cppflags)
330 gcrypt_libs="$gcrypt_libs -lgcrypt"
331 server_ldflags="$server_ldflags $gcrypt_libs"
332 client_ldflags="$client_ldflags $gcrypt_libs"
333 audiod_ldflags="$audiod_ldflags $gcrypt_libs"
335 server_errlist_objs="$server_errlist_objs gcrypt"
336 client_errlist_objs="$client_errlist_objs gcrypt"
337 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
339 AC_MSG_WARN([gcrypt library not found])
341 CPPFLAGS="$OLD_CPPFLAGS"
342 LDFLAGS="$OLD_LDFLAGS"
347 ###########################################################################
348 if test "$have_openssl" = "no" -a "$have_gcrypt" = "no"; then
349 AC_MSG_ERROR([neither openssl nor gcrypt usable])
351 ########################################################################### libsocket
352 AC_CHECK_LIB([c], [socket],
354 [socket_lib="-lsocket"]
356 server_ldflags="$server_ldflags $socket_lib"
357 client_ldflags="$client_ldflags $socket_lib"
358 audioc_ldflags="$audioc_ldflags $socket_lib"
359 audiod_ldflags="$audiod_ldflags $socket_lib"
360 recv_ldflags="$recv_ldflags $socket_lib"
361 AC_SEARCH_LIBS([connect],[socket],[],[
362 AC_MSG_ERROR([Fatal: Did not find connect().])
364 ########################################################################### libnsl
365 AC_CHECK_LIB([c], [gethostbyname],
369 server_ldflags="$server_ldflags $nsl_lib"
370 client_ldflags="$client_ldflags $nsl_lib"
371 audioc_ldflags="$audioc_ldflags $nsl_lib"
372 recv_ldflags="$recv_ldflags $nsl_lib"
373 AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[
374 AC_MSG_ERROR([Fatal: Did not find inet_ntoa().])
376 ########################################################################### ucred
377 AC_MSG_CHECKING(for struct ucred)
378 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
380 #include <sys/types.h>
381 #include <sys/socket.h>
383 struct ucred sucred; sucred.pid=0;
384 ]])],[have_ucred=yes],[have_ucred=no])
385 AC_MSG_RESULT($have_ucred)
386 if test ${have_ucred} = yes; then
387 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
389 ########################################################################### gengetopt
390 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
392 [gengetopt_args_info_description],
393 [ggo_descriptions_declared=yes],
394 [ggo_descriptions_declared=no],
395 [#include "conftest-ggo.h"]
397 AC_SUBST(ggo_descriptions_declared)
398 ########################################################################### curses
400 OLD_CPPFLAGS="$CPPFLAGS"
401 OLD_LDFLAGS="$LDFLAGS"
403 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
404 [look for curses.h also in dir])])
405 if test -n "$with_curses_headers"; then
406 curses_cppflags="-I$with_curses_headers"
407 CPPFLAGS="$CPPFLAGS $curses_cppflags"
409 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
410 [look for libcurses also in dir])])
411 if test -n "$with_curses_libs"; then
412 curses_libs="-L$with_curses_libs"
413 LDFLAGS="$LDFLAGS $curses_libs"
415 AC_CHECK_HEADER(curses.h, [], [
418 gui_ldflags="$curses_libs"
419 AC_CHECK_LIB([ncursesw], [initscr],
420 [gui_ldflags="$curses_libs -lncursesw"], [
421 AC_CHECK_LIB([curses], [initscr],
422 [gui_ldflags="$curses_libs -lcurses"],
427 if test "$have_curses" = "yes"; then
428 AC_SUBST(curses_cppflags)
430 executables="$executables gui"
433 AC_MSG_WARN([no curses lib, cannot build para_gui])
435 CPPFLAGS="$OLD_CPPFLAGS"
436 LDFLAGS="$OLD_LDFLAGS"
439 ########################################################################### ip_mreqn
440 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
441 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
447 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
448 AC_MSG_RESULT($have_ip_mreqn)
449 if test ${have_ip_mreqn} = yes; then
450 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
452 ########################################################################### osx
454 AC_MSG_CHECKING(for CoreAudio (MacOs))
455 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
456 #include <CoreAudio/CoreAudio.h>
459 ]])],[have_core_audio=yes],[have_core_audio=no])
460 AC_MSG_RESULT($have_core_audio)
461 if test ${have_core_audio} = yes; then
462 f1="-framework CoreAudio"
463 f2="-framework AudioToolbox"
464 f3="-framework AudioUnit"
465 f4="-framework CoreServices"
468 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
469 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
470 audiod_ldflags="$audiod_ldflags $f"
472 play_errlist_objs="$play_errlist_objs osx_write ipc"
473 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
474 play_ldflags="$play_ldflags $f"
476 write_errlist_objs="$write_errlist_objs osx_write ipc"
477 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
478 write_ldflags="$write_ldflags $f"
479 writers="$writers osx"
480 default_writer="OSX_WRITE"
481 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
483 ####################################################### ogg/vorbis/speex/opus
485 OLD_CPPFLAGS="$CPPFLAGS"
486 OLD_LDFLAGS="$LDFLAGS"
488 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
489 [look for ogg headers also in dir])])
490 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
491 [look for ogg libs also in dir])])
492 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
493 [look for vorbis headers also in dir])])
494 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
495 [look for vorbis libs also in dir])])
496 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
497 [look for speex headers also in dir])])
498 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
499 [look for speex libs also in dir])])
500 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
501 [look for opus headers also in dir])])
502 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
503 [look for opus libs also in dir])])
505 if test -n "$with_ogg_headers"; then
506 ogg_cppflags="-I$with_ogg_headers"
507 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
509 if test -n "$with_ogg_libs"; then
510 ogg_libs="-L$with_ogg_libs"
511 LDFLAGS="$LDFLAGS $ogg_libs"
513 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
514 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
519 if test "$have_ogg" = "yes"; then
521 if test -n "$with_vorbis_headers"; then
522 vorbis_cppflags="-I$with_vorbis_headers"
523 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
525 if test -n "$with_vorbis_libs"; then
526 vorbis_libs="-L$with_vorbis_libs"
527 LDFLAGS="$LDFLAGS $vorbis_libs"
529 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
530 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
533 if test -n "$with_speex_headers"; then
534 speex_cppflags="-I$with_speex_headers"
535 CPPFLAGS="$CPPFLAGS $speex_cppflags"
537 if test -n "$with_speex_libs"; then
538 speex_libs="-L$with_speex_libs"
539 LDFLAGS="$LDFLAGS $speex_libs"
541 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
542 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
545 if test -n "$with_opus_headers"; then
546 opus_cppflags="-I$with_opus_headers"
547 CPPFLAGS="$CPPFLAGS $opus_cppflags"
549 if test -n "$with_opus_libs"; then
550 opus_libs="-L$with_opus_libs"
551 LDFLAGS="$LDFLAGS $opus_libs"
553 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
554 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
556 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
562 msg="support in para_server/para_filter/para_afh"
563 if test "$have_vorbis" = "yes" || \
564 test "$have_speex" = "yes" || \
565 test "$have_opus" = "yes"; then
566 AC_SUBST(ogg_cppflags)
567 ogg_libs="$ogg_libs -logg"
568 if test "$OSTYPE" = "Darwin"; then
569 ogg_libs="-Wl,-bind_at_load $ogg_libs"
571 server_ldflags="$server_ldflags $ogg_libs"
572 filter_ldflags="$filter_ldflags $ogg_libs"
573 audiod_ldflags="$audiod_ldflags $ogg_libs"
574 play_ldflags="$play_ldflags $ogg_libs"
575 afh_ldflags="$afh_ldflags $ogg_libs"
576 recv_ldflags="$recv_ldflags $ogg_libs"
577 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
578 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
579 server_errlist_objs="$server_errlist_objs ogg_afh_common"
580 play_errlist_objs="$play_errlist_objs ogg_afh_common"
582 if test "$have_vorbis" = "yes"; then
583 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
584 filters="$filters oggdec"
585 vorbis_libs="-lvorbis -lvorbisfile"
586 server_ldflags="$server_ldflags $vorbis_libs"
587 filter_ldflags="$filter_ldflags $vorbis_libs"
588 audiod_ldflags="$audiod_ldflags $vorbis_libs"
589 play_ldflags="$play_ldflags $vorbis_libs"
590 afh_ldflags="$afh_ldflags $vorbis_libs"
591 recv_ldflags="$recv_ldflags $vorbis_libs"
593 server_errlist_objs="$server_errlist_objs ogg_afh"
594 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
595 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
596 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
597 afh_errlist_objs="$afh_errlist_objs ogg_afh"
598 recv_errlist_objs="$recv_errlist_objs ogg_afh"
600 audiod_audio_formats="$audiod_audio_formats ogg"
601 audio_format_handlers="$audio_format_handlers ogg"
603 AC_MSG_WARN([no ogg/vorbis $msg])
605 if test "$have_speex" = "yes"; then
606 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
607 filters="$filters spxdec"
609 server_ldflags="$server_ldflags $speex_libs"
610 filter_ldflags="$filter_ldflags $speex_libs"
611 audiod_ldflags="$audiod_ldflags $speex_libs"
612 play_ldflags="$play_ldflags $speex_libs"
613 afh_ldflags="$afh_ldflags $speex_libs"
614 recv_ldflags="$recv_ldflags $speex_libs"
616 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
617 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
618 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
619 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
620 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
621 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
623 audiod_audio_formats="$audiod_audio_formats spx"
624 audio_format_handlers="$audio_format_handlers spx"
626 AC_MSG_WARN([no ogg/speex $msg])
628 if test "$have_opus" = "yes"; then
629 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
630 filters="$filters opusdec"
632 server_ldflags="$server_ldflags $opus_libs"
633 filter_ldflags="$filter_ldflags $opus_libs"
634 audiod_ldflags="$audiod_ldflags $opus_libs"
635 afh_ldflags="$afh_ldflags $opus_libs"
636 play_ldflags="$play_ldflags $opus_libs"
637 recv_ldflags="$recv_ldflags $opus_libs"
639 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
640 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
641 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
642 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
643 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
644 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
646 audiod_audio_formats="$audiod_audio_formats opus"
647 audio_format_handlers="$audio_format_handlers opus"
649 AC_MSG_WARN([no ogg/opus $msg])
651 CPPFLAGS="$OLD_CPPFLAGS"
652 LDFLAGS="$OLD_LDFLAGS"
654 ########################################################################### faad
656 OLD_CPPFLAGS="$CPPFLAGS"
657 OLD_LDFLAGS="$LDFLAGS"
659 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
660 [look for neaacdec.h also in dir])])
661 if test -n "$with_faad_headers"; then
662 faad_cppflags="-I$with_faad_headers"
663 CPPFLAGS="$CPPFLAGS $faad_cppflags"
665 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
666 [look for libfaad also in dir])])
667 if test -n "$with_faad_libs"; then
668 faad_libs="-L$with_faad_libs"
669 LDFLAGS="$LDFLAGS $faad_libs"
671 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
672 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
673 if test "$have_faad" = "yes"; then
674 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
675 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
676 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
677 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
678 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
679 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
680 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
682 server_ldflags="$server_ldflags $faad_libs -lfaad"
683 filter_ldflags="$filter_ldflags $faad_libs -lfaad"
684 audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
685 play_ldflags="$play_ldflags $faad_libs -lfaad"
686 afh_ldflags="$afh_ldflags $faad_libs -lfaad"
687 recv_ldflags="$afh_ldflags $faad_libs -lfaad"
689 audiod_audio_formats="$audiod_audio_formats aac"
690 audio_format_handlers="$audio_format_handlers aac"
691 filters="$filters aacdec"
692 AC_SUBST(faad_cppflags)
694 AC_MSG_WARN([no aac support in para_audiod/para_filter])
696 CPPFLAGS="$OLD_CPPFLAGS"
697 LDFLAGS="$OLD_LDFLAGS"
699 ########################################################################### mad
701 OLD_CPPFLAGS="$CPPFLAGS"
702 OLD_LDFLAGS="$LDFLAGS"
705 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
706 [look for mad.h also in dir])])
707 if test -n "$with_mad_headers"; then
708 mad_cppflags="-I$with_mad_headers"
709 CPPFLAGS="$CPPFLAGS $mad_cppflags"
711 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
712 [look for libmad also in dir])])
713 if test -n "$with_mad_libs"; then
714 mad_libs="-L$with_mad_libs"
715 LDFLAGS="$LDFLAGS $mad_libs"
717 AC_CHECK_HEADERS([mad.h], [], [
720 AC_CHECK_LIB([mad], [mad_stream_init], [], [
723 if test "$have_mad" = "yes"; then
724 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
725 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(mp3dec_filter)"
726 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(mp3dec_filter)"
727 play_cmdline_objs="$play_cmdline_objs add_cmdline(mp3dec_filter)"
728 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
729 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
730 play_errlist_objs="$play_errlist_objs mp3dec_filter"
731 filter_ldflags="$filter_ldflags $mad_libs -lmad"
732 audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
733 play_ldflags="$play_ldflags $mad_libs -lmad"
734 audiod_audio_formats="$audiod_audio_formats mp3"
735 filters="$filters mp3dec"
736 AC_SUBST(mad_cppflags)
738 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
740 CPPFLAGS="$OLD_CPPFLAGS"
741 LDFLAGS="$OLD_LDFLAGS"
743 ###################################################################### libid3tag
744 OLD_CPPFLAGS="$CPPFLAGS"
745 OLD_LDFLAGS="$LDFLAGS"
749 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
750 [look for id3tag header files also in dir])])
751 if test -n "$with_id3tag_headers"; then
752 id3tag_cppflags="-I$with_id3tag_headers"
753 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
755 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
756 [look for id3tag libs also in dir])])
757 if test -n "$with_id3tag_libs"; then
758 id3tag_libs="-L$with_id3tag_libs"
759 LDFLAGS="$LDFLAGS $id3tag_libs"
762 AC_MSG_CHECKING(for libid3tag)
763 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
766 struct id3_tag t = {.flags = 0};
767 ]])],[],[have_libid3tag=no])
768 AC_MSG_RESULT($have_libid3tag)
770 if test ${have_libid3tag} = yes; then
771 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
772 server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
773 afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
774 play_ldflags="$play_ldflags -lz"
775 recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
776 play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
777 AC_SUBST(id3tag_cppflags)
779 AC_MSG_WARN([no support for id3v2 tags])
781 CPPFLAGS="$OLD_CPPFLAGS"
782 LDFLAGS="$OLD_LDFLAGS"
784 ########################################################################### flac
785 OLD_CPPFLAGS="$CPPFLAGS"
786 OLD_LDFLAGS="$LDFLAGS"
790 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
791 [look for flac headers also in dir])])
792 if test -n "$with_flac_headers"; then
793 flac_cppflags="-I$with_flac_headers"
794 CPPFLAGS="$CPPFLAGS $flac_cppflags"
796 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
797 [look for flac libs also in dir])])
798 if test -n "$with_flac_libs"; then
799 flac_libs="-L$with_flac_libs"
800 LDFLAGS="$LDFLAGS $flac_libs"
802 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
803 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
804 if test "$have_flac" = "yes"; then
805 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
806 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
807 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
808 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
809 afh_errlist_objs="$afh_errlist_objs flac_afh"
810 server_errlist_objs="$server_errlist_objs flac_afh"
811 recv_errlist_objs="$recv_errlist_objs flac_afh"
812 filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
813 audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
814 play_ldflags="$play_ldflags $flac_libs -lFLAC"
815 server_ldflags="$server_ldflags $flac_libs -lFLAC"
816 afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
817 recv_ldflags="$recv_ldflags $flac_libs -lFLAC"
818 filters="$filters flacdec"
819 audio_format_handlers="$audio_format_handlers flac"
820 audiod_audio_formats="$audiod_audio_formats flac"
821 AC_SUBST(flac_cppflags)
823 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
825 CPPFLAGS="$OLD_CPPFLAGS"
826 LDFLAGS="$OLD_LDFLAGS"
828 ########################################################################### oss
829 OLD_CPPFLAGS="$CPPFLAGS"
830 OLD_LDFLAGS="$LDFLAGS"
834 msg="=> will not build oss writer"
836 AC_CHECK_HEADER(sys/soundcard.h, [
837 audiod_errlist_objs="$audiod_errlist_objs oss_write"
838 play_errlist_objs="$play_errlist_objs oss_write"
839 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"
840 play_cmdline_objs="$play_cmdline_objs add_cmdline(oss_write)"
842 write_errlist_objs="$write_errlist_objs oss_write"
843 write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
844 fade_errlist_objs="$fade_errlist_objs oss_mix"
846 writers="$writers oss"
847 default_writer="OSS_WRITE"
848 mixers="${mixers}oss "
849 default_mixer="OSS_MIX"
851 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
852 audiod_ldflags="$audiod_ldflags -lossaudio"
853 play_ldflags="$play_ldflags -lossaudio"
854 write_ldflags="$write_ldflags -lossaudio"
855 fade_ldflags="$fade_ldflags -lossaudio"
861 AC_MSG_WARN([no sys/soundcard.h $msg])
864 CPPFLAGS="$OLD_CPPFLAGS"
865 LDFLAGS="$OLD_LDFLAGS"
868 ########################################################################### alsa
869 OLD_CPPFLAGS="$CPPFLAGS"
870 OLD_LDFLAGS="$LDFLAGS"
873 msg="=> no alsa support for para_audiod/para_write"
874 if test "$OSTYPE" != "Linux"; then
879 if test "$have_alsa" = "yes"; then
880 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
882 AC_MSG_WARN([no alsa/asoundlib $msg])
886 if test "$have_alsa" = "yes"; then
887 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
889 AC_MSG_WARN([no libasound $msg])
893 if test "$have_alsa" = "yes"; then
894 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
895 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(alsa_write)"
896 audiod_ldflags="$audiod_ldflags -lasound"
897 play_errlist_objs="$play_errlist_objs alsa_write"
898 play_cmdline_objs="$play_cmdline_objs add_cmdline(alsa_write)"
899 play_ldflags="$play_ldflags -lasound"
901 write_errlist_objs="$write_errlist_objs alsa_write"
902 write_cmdline_objs="$write_cmdline_objs add_cmdline(alsa_write)"
903 write_ldflags="$write_ldflags -lasound"
904 fade_errlist_objs="$fade_errlist_objs alsa_mix"
905 fade_ldflags="$fade_ldflags -lasound"
907 writers="$writers alsa"
908 default_writer="ALSA_WRITE"
909 mixers="${mixers}alsa "
910 default_mixer="ALSA_MIX"
913 CPPFLAGS="$OLD_CPPFLAGS"
914 LDFLAGS="$OLD_LDFLAGS"
916 ########################################################################### fade
917 if test -n "$mixers"; then
919 executables="$executables fade"
920 fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
921 fade_cmdline_objs="add_cmdline(fade)"
922 fade_objs="$fade_cmdline_objs $fade_errlist_objs"
923 AC_SUBST(fade_objs, add_dot_o($fade_objs))
924 AC_SUBST(fade_ldflags, $fade_ldflags)
925 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
926 objlist_to_errlist($fade_errlist_objs),
927 errors used by para_fade)
930 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
933 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
934 enum of supported mixers)
935 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
936 use this mixer if none was specified)
937 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
938 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
941 printf 'extern void '$i'_mix_init(struct mixer *); '
944 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
945 init functions of the supported mixers)
946 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
947 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
948 mixer_summary="supported mixers:: $mixers, default: $default_mixer"
951 AC_MSG_WARN([no mixer support])
952 mixer_summary="para_fade: no"
954 ########################################################################### libao
955 OLD_CPPFLAGS="$CPPFLAGS"
956 OLD_LDFLAGS="$LDFLAGS"
960 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
961 [look for ao/ao.h also in dir])])
962 if test -n "$with_ao_headers"; then
963 ao_cppflags="-I$with_ao_headers"
964 CPPFLAGS="$CPPFLAGS $ao_cppflags"
966 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
967 [look for libao also in dir])])
968 if test -n "$with_ao_libs"; then
969 ao_libs="-L$with_ao_libs"
970 LDFLAGS="$LDFLAGS $ao_libs"
972 msg="no libao support for para_audiod/para_write"
973 AC_CHECK_HEADERS([ao/ao.h], [
976 AC_MSG_WARN([ao.h not found, $msg])
978 if test "$have_ao" = "yes"; then
979 AC_CHECK_LIB([ao], [ao_initialize], [], [
981 AC_MSG_WARN([ao lib not found or not working, $msg])
984 if test "$have_ao" = "yes"; then
985 AC_CHECK_HEADERS([pthread.h], [
988 AC_MSG_WARN([pthread.h not found, $msg])
991 if test "$have_ao" = "yes"; then
992 AC_CHECK_LIB([pthread], [pthread_create], [], [
994 AC_MSG_WARN([pthread lib not found or not working, $msg])
997 if test "$have_ao" = "yes"; then
998 audiod_errlist_objs="$audiod_errlist_objs ao_write"
999 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(ao_write)"
1000 audiod_ldflags="$audiod_ldflags -lao -lpthread"
1002 play_errlist_objs="$play_errlist_objs ao_write"
1003 play_cmdline_objs="$play_cmdline_objs add_cmdline(ao_write)"
1004 play_ldflags="$play_ldflags -lao -lpthread"
1006 write_errlist_objs="$write_errlist_objs ao_write"
1007 write_cmdline_objs="$write_cmdline_objs add_cmdline(ao_write)"
1008 write_ldflags="$write_ldflags $ao_libs -lao -lpthread"
1009 writers="$writers ao"
1010 AC_SUBST(ao_cppflags)
1013 CPPFLAGS="$OLD_CPPFLAGS"
1014 LDFLAGS="$OLD_LDFLAGS"
1016 ############################################################# readline
1017 OLD_CPPFLAGS="$CPPFLAGS"
1018 OLD_LDFLAGS="$LDFLAGS"
1022 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
1023 [look for libreadline header files also in dir])])
1024 if test -n "$with_readline_headers"; then
1025 readline_cppflags="-I$with_readline_headers"
1026 CPPFLAGS="$CPPFLAGS $readline_cppflags"
1029 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
1030 [look for readline library also in dir])])
1031 if test -n "$with_readline_libs"; then
1032 readline_libs="-L$with_readline_libs"
1033 LDFLAGS="$LDFLAGS $readline_libs"
1035 msg="no interactive cli support"
1036 AC_CHECK_HEADERS([readline/readline.h], [
1039 AC_MSG_WARN([readline/readline.h not found, $msg])
1042 if test "$have_curses" != "yes"; then
1044 AC_MSG_WARN([interactive cli support depends on curses,])
1045 AC_MSG_WARN([but no curses lib was detected, $msg])
1048 if test "$have_readline" = "yes"; then
1049 readline_libs="$readline_libs -lreadline"
1050 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
1051 if test "$have_readline" = "no"; then # try with -lcurses
1053 AC_MSG_NOTICE([trying again with -lcurses])
1054 unset ac_cv_search_rl_free_keymap 2> /dev/null
1055 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1057 readline_libs="$readline_libs -lcurses"
1060 if test "$have_readline" = "no"; then # try with -ltermcap
1062 AC_MSG_NOTICE([trying again with -ltermcap])
1063 unset ac_cv_search_rl_free_keymap 2> /dev/null
1064 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1066 readline_libs="$readline_libs -ltermcap"
1071 if test "$have_readline" = "yes"; then
1072 client_errlist_objs="$client_errlist_objs interactive"
1073 client_ldflags="$client_ldflags $readline_libs"
1074 audioc_errlist_objs="$audioc_errlist_objs buffer_tree interactive sched time"
1075 audioc_ldflags="$audioc_ldflags $readline_libs"
1076 play_errlist_objs="$play_errlist_objs interactive"
1077 play_ldflags="$play_ldflags $readline_libs"
1078 AC_SUBST(readline_cppflags)
1079 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
1081 AC_MSG_WARN([libreadline not found or unusable])
1083 CPPFLAGS="$OLD_CPPFLAGS"
1084 LDFLAGS="$OLD_LDFLAGS"
1086 ############################################################# libsamplerate
1087 OLD_CPPFLAGS="$CPPFLAGS"
1088 OLD_LDFLAGS="$LDFLAGS"
1091 have_samplerate="yes"
1092 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
1093 [look for samplerate headers also in dir])])
1094 if test -n "$with_samplerate_headers"; then
1095 samplerate_cppflags="-I$with_samplerate_headers"
1096 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
1098 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
1099 [look for samplerate libs also in dir])])
1100 if test -n "$with_samplerate_libs"; then
1101 samplerate_libs="-L$with_samplerate_libs"
1102 LDFLAGS="$LDFLAGS $samplerate_libs"
1105 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
1106 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
1108 if test "$have_samplerate" = "yes"; then
1109 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1110 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(resample_filter)"
1111 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1112 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(resample_filter)"
1113 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1114 play_cmdline_objs="$play_cmdline_objs add_cmdline(resample_filter)"
1115 filter_ldflags="$filter_ldflags $samplerate_libs -lsamplerate"
1116 audiod_ldflags="$audiod_ldflags $samplerate_libs -lsamplerate"
1117 play_ldflags="$play_ldflags $samplerate_libs -lsamplerate"
1118 filters="$filters resample"
1119 AC_SUBST(samplerate_cppflags)
1121 AC_MSG_WARN([no resample support in para_audiod/para_filter])
1123 CPPFLAGS="$OLD_CPPFLAGS"
1124 LDFLAGS="$OLD_LDFLAGS"
1126 ######################################################################### server
1127 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
1128 -a "$have_osl" = "yes" ; then
1131 executables="$executables server"
1132 server_cmdline_objs="add_cmdline(server)"
1133 server_errlist_objs="$server_errlist_objs
1172 server_ldflags="$server_ldflags $osl_libs -losl"
1176 ############################################################# error2.h
1177 AC_MSG_NOTICE(creating error2.h)
1179 # these are always built
1182 $filter_errlist_objs
1183 $audioc_errlist_objs
1185 $client_errlist_objs
1187 $audiod_errlist_objs
1191 # optional executables
1192 if test "$build_server" = "yes"; then
1193 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1195 if test "$build_gui" = "yes"; then
1196 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1198 if test "$build_fade" = "yes"; then
1199 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1202 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1204 for i in $executables; do
1206 eval echo \$${i}_errlist_objs
1207 done | ./error2.pl > error2.h
1208 for obj in $all_errlist_objs; do
1209 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1211 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1212 [enum {$SS NUM_SS}],
1213 [list of all objects that use the paraslash error facility]
1216 ################################################################## status items
1218 status_items="basename status num_played mtime bitrate frequency file_size
1219 status_flags format score techinfo afs_mode
1220 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1221 offset seconds_total stream_start current_time audiod_uptime image_id
1222 lyrics_id duration directory lyrics_name image_name path hash channels
1223 last_played num_chunks chunk_time amplification artist title year album
1227 for i in $status_items; do
1228 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1230 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1231 [enum of all status items])
1234 for i in $status_items; do
1235 result="$result \"$i\", "
1237 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1238 [char * array of all status items])
1240 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1241 [formats supported by para_server and para_afh])
1243 AC_SUBST(executables)
1245 recv_objs="$recv_cmdline_objs $recv_errlist_objs"
1246 filter_objs="$filter_cmdline_objs $filter_errlist_objs"
1247 audiod_objs="$audiod_cmdline_objs $audiod_errlist_objs"
1248 server_objs="$server_cmdline_objs $server_errlist_objs"
1249 write_objs="$write_cmdline_objs $write_errlist_objs"
1250 client_objs="$client_cmdline_objs $client_errlist_objs"
1251 audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
1252 afh_objs="$afh_cmdline_objs $afh_errlist_objs"
1253 play_objs="$play_cmdline_objs $play_errlist_objs"
1256 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1257 AC_SUBST(recv_ldflags, $recv_ldflags)
1258 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1259 errors used by para_recv)
1261 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1262 AC_SUBST(filter_ldflags, $filter_ldflags)
1263 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1264 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1266 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1267 AC_SUBST(audiod_ldflags, $audiod_ldflags)
1268 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1269 errors used by para_audiod)
1271 AC_SUBST(server_objs, add_dot_o($server_objs))
1272 AC_SUBST(server_ldflags, $server_ldflags)
1273 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
1274 objlist_to_errlist($server_errlist_objs), errors used by para_server)
1276 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1277 AC_SUBST(afh_ldflags, $afh_ldflags)
1278 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1279 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1281 AC_SUBST(write_objs, add_dot_o($write_objs))
1282 AC_SUBST(write_ldflags, $write_ldflags)
1283 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1284 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1286 AC_SUBST(client_objs, add_dot_o($client_objs))
1287 AC_SUBST(client_ldflags, $client_ldflags)
1288 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
1289 objlist_to_errlist($client_errlist_objs), errors used by para_client)
1291 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1292 AC_SUBST(audioc_ldflags, $audioc_ldflags)
1293 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1294 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1296 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1297 AC_SUBST(gui_ldflags, $gui_ldflags)
1298 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1299 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1301 AC_SUBST(play_objs, add_dot_o($play_objs))
1302 AC_SUBST(play_ldflags, $play_ldflags)
1303 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1304 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1306 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1307 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1308 enum of supported filters)
1309 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1310 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1311 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1312 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1314 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1315 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1316 enum of supported writers)
1317 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1318 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1319 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1320 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1321 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1322 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1323 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1325 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1326 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1327 enum of audio formats supported by audiod)
1328 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1329 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1333 paraslash configuration:
1334 ~~~~~~~~~~~~~~~~~~~~~~~~
1335 unix socket credentials: $have_ucred
1336 readline (interactive CLIs): $have_readline
1337 audio formats handlers: $audio_format_handlers
1338 id3 version2 support: $have_libid3tag
1343 para_server: $build_server
1344 para_gui: $build_gui
1345 para_fade: $build_fade