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 ###########################################################################
320 if test "$have_openssl" = "no" -a "$have_gcrypt" = "no"; then
321 AC_MSG_ERROR([neither openssl nor gcrypt usable])
323 ########################################################################### libsocket
324 AC_CHECK_LIB([c], [socket],
326 [socket_lib="-lsocket"]
328 server_ldflags="$server_ldflags $socket_lib"
329 client_ldflags="$client_ldflags $socket_lib"
330 audioc_ldflags="$audioc_ldflags $socket_lib"
331 audiod_ldflags="$audiod_ldflags $socket_lib"
332 recv_ldflags="$recv_ldflags $socket_lib"
333 AC_SEARCH_LIBS([connect],[socket],[],[
334 AC_MSG_ERROR([Fatal: Did not find connect().])
336 ########################################################################### libnsl
337 AC_CHECK_LIB([c], [gethostbyname],
341 server_ldflags="$server_ldflags $nsl_lib"
342 client_ldflags="$client_ldflags $nsl_lib"
343 audioc_ldflags="$audioc_ldflags $nsl_lib"
344 recv_ldflags="$recv_ldflags $nsl_lib"
345 AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[
346 AC_MSG_ERROR([Fatal: Did not find inet_ntoa().])
348 ########################################################################### ucred
349 AC_MSG_CHECKING(for struct ucred)
350 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
352 #include <sys/types.h>
353 #include <sys/socket.h>
355 struct ucred sucred; sucred.pid=0;
356 ]])],[have_ucred=yes],[have_ucred=no])
357 AC_MSG_RESULT($have_ucred)
358 if test ${have_ucred} = yes; then
359 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
361 ########################################################################### gengetopt
362 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
364 [gengetopt_args_info_description],
365 [ggo_descriptions_declared=yes],
366 [ggo_descriptions_declared=no],
367 [#include "conftest-ggo.h"]
369 AC_SUBST(ggo_descriptions_declared)
370 ########################################################################### curses
372 OLD_CPPFLAGS="$CPPFLAGS"
373 OLD_LDFLAGS="$LDFLAGS"
375 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
376 [look for curses.h also in dir])])
377 if test -n "$with_curses_headers"; then
378 curses_cppflags="-I$with_curses_headers"
379 CPPFLAGS="$CPPFLAGS $curses_cppflags"
381 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
382 [look for libcurses also in dir])])
383 if test -n "$with_curses_libs"; then
384 curses_libs="-L$with_curses_libs"
385 LDFLAGS="$LDFLAGS $curses_libs"
387 AC_CHECK_HEADER(curses.h, [], [
390 gui_ldflags="$curses_libs"
391 AC_CHECK_LIB([ncursesw], [initscr],
392 [gui_ldflags="$curses_libs -lncursesw"], [
393 AC_CHECK_LIB([curses], [initscr],
394 [gui_ldflags="$curses_libs -lcurses"],
399 if test "$have_curses" = "yes"; then
400 AC_SUBST(curses_cppflags)
402 executables="$executables gui"
405 AC_MSG_WARN([no curses lib, cannot build para_gui])
407 CPPFLAGS="$OLD_CPPFLAGS"
408 LDFLAGS="$OLD_LDFLAGS"
411 ########################################################################### ip_mreqn
412 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
413 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
419 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
420 AC_MSG_RESULT($have_ip_mreqn)
421 if test ${have_ip_mreqn} = yes; then
422 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
424 ########################################################################### osx
426 AC_MSG_CHECKING(for CoreAudio (MacOs))
427 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
428 #include <CoreAudio/CoreAudio.h>
431 ]])],[have_core_audio=yes],[have_core_audio=no])
432 AC_MSG_RESULT($have_core_audio)
433 if test ${have_core_audio} = yes; then
434 f1="-framework CoreAudio"
435 f2="-framework AudioToolbox"
436 f3="-framework AudioUnit"
437 f4="-framework CoreServices"
440 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
441 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
442 audiod_ldflags="$audiod_ldflags $f"
444 play_errlist_objs="$play_errlist_objs osx_write ipc"
445 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
446 play_ldflags="$play_ldflags $f"
448 write_errlist_objs="$write_errlist_objs osx_write ipc"
449 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
450 write_ldflags="$write_ldflags $f"
451 writers="$writers osx"
452 default_writer="OSX_WRITE"
453 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
455 ####################################################### ogg/vorbis/speex/opus
457 OLD_CPPFLAGS="$CPPFLAGS"
458 OLD_LDFLAGS="$LDFLAGS"
460 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
461 [look for ogg headers also in dir])])
462 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
463 [look for ogg libs also in dir])])
464 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
465 [look for vorbis headers also in dir])])
466 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
467 [look for vorbis libs also in dir])])
468 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
469 [look for speex headers also in dir])])
470 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
471 [look for speex libs also in dir])])
472 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
473 [look for opus headers also in dir])])
474 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
475 [look for opus libs also in dir])])
477 if test -n "$with_ogg_headers"; then
478 ogg_cppflags="-I$with_ogg_headers"
479 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
481 if test -n "$with_ogg_libs"; then
482 ogg_libs="-L$with_ogg_libs"
483 LDFLAGS="$LDFLAGS $ogg_libs"
485 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
486 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
491 if test "$have_ogg" = "yes"; then
493 if test -n "$with_vorbis_headers"; then
494 vorbis_cppflags="-I$with_vorbis_headers"
495 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
497 if test -n "$with_vorbis_libs"; then
498 vorbis_libs="-L$with_vorbis_libs"
499 LDFLAGS="$LDFLAGS $vorbis_libs"
501 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
502 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
505 if test -n "$with_speex_headers"; then
506 speex_cppflags="-I$with_speex_headers"
507 CPPFLAGS="$CPPFLAGS $speex_cppflags"
509 if test -n "$with_speex_libs"; then
510 speex_libs="-L$with_speex_libs"
511 LDFLAGS="$LDFLAGS $speex_libs"
513 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
514 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
517 if test -n "$with_opus_headers"; then
518 opus_cppflags="-I$with_opus_headers"
519 CPPFLAGS="$CPPFLAGS $opus_cppflags"
521 if test -n "$with_opus_libs"; then
522 opus_libs="-L$with_opus_libs"
523 LDFLAGS="$LDFLAGS $opus_libs"
525 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
526 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
528 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
534 msg="support in para_server/para_filter/para_afh"
535 if test "$have_vorbis" = "yes" || \
536 test "$have_speex" = "yes" || \
537 test "$have_opus" = "yes"; then
538 AC_SUBST(ogg_cppflags)
539 ogg_libs="$ogg_libs -logg"
540 if test "$OSTYPE" = "Darwin"; then
541 ogg_libs="-Wl,-bind_at_load $ogg_libs"
543 server_ldflags="$server_ldflags $ogg_libs"
544 filter_ldflags="$filter_ldflags $ogg_libs"
545 audiod_ldflags="$audiod_ldflags $ogg_libs"
546 play_ldflags="$play_ldflags $ogg_libs"
547 afh_ldflags="$afh_ldflags $ogg_libs"
548 recv_ldflags="$recv_ldflags $ogg_libs"
549 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
550 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
551 server_errlist_objs="$server_errlist_objs ogg_afh_common"
552 play_errlist_objs="$play_errlist_objs ogg_afh_common"
554 if test "$have_vorbis" = "yes"; then
555 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
556 filters="$filters oggdec"
557 vorbis_libs="-lvorbis -lvorbisfile"
558 server_ldflags="$server_ldflags $vorbis_libs"
559 filter_ldflags="$filter_ldflags $vorbis_libs"
560 audiod_ldflags="$audiod_ldflags $vorbis_libs"
561 play_ldflags="$play_ldflags $vorbis_libs"
562 afh_ldflags="$afh_ldflags $vorbis_libs"
563 recv_ldflags="$recv_ldflags $vorbis_libs"
565 server_errlist_objs="$server_errlist_objs ogg_afh"
566 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
567 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
568 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
569 afh_errlist_objs="$afh_errlist_objs ogg_afh"
570 recv_errlist_objs="$recv_errlist_objs ogg_afh"
572 audiod_audio_formats="$audiod_audio_formats ogg"
573 audio_format_handlers="$audio_format_handlers ogg"
575 AC_MSG_WARN([no ogg/vorbis $msg])
577 if test "$have_speex" = "yes"; then
578 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
579 filters="$filters spxdec"
581 server_ldflags="$server_ldflags $speex_libs"
582 filter_ldflags="$filter_ldflags $speex_libs"
583 audiod_ldflags="$audiod_ldflags $speex_libs"
584 play_ldflags="$play_ldflags $speex_libs"
585 afh_ldflags="$afh_ldflags $speex_libs"
586 recv_ldflags="$recv_ldflags $speex_libs"
588 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
589 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
590 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
591 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
592 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
593 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
595 audiod_audio_formats="$audiod_audio_formats spx"
596 audio_format_handlers="$audio_format_handlers spx"
598 AC_MSG_WARN([no ogg/speex $msg])
600 if test "$have_opus" = "yes"; then
601 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
602 filters="$filters opusdec"
604 server_ldflags="$server_ldflags $opus_libs"
605 filter_ldflags="$filter_ldflags $opus_libs"
606 audiod_ldflags="$audiod_ldflags $opus_libs"
607 afh_ldflags="$afh_ldflags $opus_libs"
608 play_ldflags="$play_ldflags $opus_libs"
609 recv_ldflags="$recv_ldflags $opus_libs"
611 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
612 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
613 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
614 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
615 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
616 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
618 audiod_audio_formats="$audiod_audio_formats opus"
619 audio_format_handlers="$audio_format_handlers opus"
621 AC_MSG_WARN([no ogg/opus $msg])
623 CPPFLAGS="$OLD_CPPFLAGS"
624 LDFLAGS="$OLD_LDFLAGS"
626 ########################################################################### faad
628 OLD_CPPFLAGS="$CPPFLAGS"
629 OLD_LDFLAGS="$LDFLAGS"
631 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
632 [look for neaacdec.h also in dir])])
633 if test -n "$with_faad_headers"; then
634 faad_cppflags="-I$with_faad_headers"
635 CPPFLAGS="$CPPFLAGS $faad_cppflags"
637 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
638 [look for libfaad also in dir])])
639 if test -n "$with_faad_libs"; then
640 faad_libs="-L$with_faad_libs"
641 LDFLAGS="$LDFLAGS $faad_libs"
643 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
644 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
645 if test "$have_faad" = "yes"; then
646 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
647 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
648 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
649 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
650 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
651 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
652 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
654 server_ldflags="$server_ldflags $faad_libs -lfaad"
655 filter_ldflags="$filter_ldflags $faad_libs -lfaad"
656 audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
657 play_ldflags="$play_ldflags $faad_libs -lfaad"
658 afh_ldflags="$afh_ldflags $faad_libs -lfaad"
659 recv_ldflags="$afh_ldflags $faad_libs -lfaad"
661 audiod_audio_formats="$audiod_audio_formats aac"
662 audio_format_handlers="$audio_format_handlers aac"
663 filters="$filters aacdec"
664 AC_SUBST(faad_cppflags)
666 AC_MSG_WARN([no aac support in para_audiod/para_filter])
668 CPPFLAGS="$OLD_CPPFLAGS"
669 LDFLAGS="$OLD_LDFLAGS"
671 ########################################################################### mad
673 OLD_CPPFLAGS="$CPPFLAGS"
674 OLD_LDFLAGS="$LDFLAGS"
677 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
678 [look for mad.h also in dir])])
679 if test -n "$with_mad_headers"; then
680 mad_cppflags="-I$with_mad_headers"
681 CPPFLAGS="$CPPFLAGS $mad_cppflags"
683 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
684 [look for libmad also in dir])])
685 if test -n "$with_mad_libs"; then
686 mad_libs="-L$with_mad_libs"
687 LDFLAGS="$LDFLAGS $mad_libs"
689 AC_CHECK_HEADERS([mad.h], [], [
692 AC_CHECK_LIB([mad], [mad_stream_init], [], [
695 if test "$have_mad" = "yes"; then
696 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
697 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(mp3dec_filter)"
698 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(mp3dec_filter)"
699 play_cmdline_objs="$play_cmdline_objs add_cmdline(mp3dec_filter)"
700 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
701 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
702 play_errlist_objs="$play_errlist_objs mp3dec_filter"
703 filter_ldflags="$filter_ldflags $mad_libs -lmad"
704 audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
705 play_ldflags="$play_ldflags $mad_libs -lmad"
706 audiod_audio_formats="$audiod_audio_formats mp3"
707 filters="$filters mp3dec"
708 AC_SUBST(mad_cppflags)
710 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
712 CPPFLAGS="$OLD_CPPFLAGS"
713 LDFLAGS="$OLD_LDFLAGS"
715 ###################################################################### libid3tag
716 OLD_CPPFLAGS="$CPPFLAGS"
717 OLD_LDFLAGS="$LDFLAGS"
721 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
722 [look for id3tag header files also in dir])])
723 if test -n "$with_id3tag_headers"; then
724 id3tag_cppflags="-I$with_id3tag_headers"
725 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
727 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
728 [look for id3tag libs also in dir])])
729 if test -n "$with_id3tag_libs"; then
730 id3tag_libs="-L$with_id3tag_libs"
731 LDFLAGS="$LDFLAGS $id3tag_libs"
734 AC_MSG_CHECKING(for libid3tag)
735 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
738 struct id3_tag t = {.flags = 0};
739 ]])],[],[have_libid3tag=no])
740 AC_MSG_RESULT($have_libid3tag)
742 if test ${have_libid3tag} = yes; then
743 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
744 server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
745 afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
746 play_ldflags="$play_ldflags -lz"
747 recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
748 play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
749 AC_SUBST(id3tag_cppflags)
751 AC_MSG_WARN([no support for id3v2 tags])
753 CPPFLAGS="$OLD_CPPFLAGS"
754 LDFLAGS="$OLD_LDFLAGS"
756 ########################################################################### flac
757 OLD_CPPFLAGS="$CPPFLAGS"
758 OLD_LDFLAGS="$LDFLAGS"
762 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
763 [look for flac headers also in dir])])
764 if test -n "$with_flac_headers"; then
765 flac_cppflags="-I$with_flac_headers"
766 CPPFLAGS="$CPPFLAGS $flac_cppflags"
768 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
769 [look for flac libs also in dir])])
770 if test -n "$with_flac_libs"; then
771 flac_libs="-L$with_flac_libs"
772 LDFLAGS="$LDFLAGS $flac_libs"
774 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
775 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
776 if test "$have_flac" = "yes"; then
777 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
778 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
779 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
780 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
781 afh_errlist_objs="$afh_errlist_objs flac_afh"
782 server_errlist_objs="$server_errlist_objs flac_afh"
783 recv_errlist_objs="$recv_errlist_objs flac_afh"
784 filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
785 audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
786 play_ldflags="$play_ldflags $flac_libs -lFLAC"
787 server_ldflags="$server_ldflags $flac_libs -lFLAC"
788 afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
789 recv_ldflags="$recv_ldflags $flac_libs -lFLAC"
790 filters="$filters flacdec"
791 audio_format_handlers="$audio_format_handlers flac"
792 audiod_audio_formats="$audiod_audio_formats flac"
793 AC_SUBST(flac_cppflags)
795 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
797 CPPFLAGS="$OLD_CPPFLAGS"
798 LDFLAGS="$OLD_LDFLAGS"
800 ########################################################################### oss
801 OLD_CPPFLAGS="$CPPFLAGS"
802 OLD_LDFLAGS="$LDFLAGS"
806 msg="=> will not build oss writer"
808 AC_CHECK_HEADER(sys/soundcard.h, [
809 audiod_errlist_objs="$audiod_errlist_objs oss_write"
810 play_errlist_objs="$play_errlist_objs oss_write"
811 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"
812 play_cmdline_objs="$play_cmdline_objs add_cmdline(oss_write)"
814 write_errlist_objs="$write_errlist_objs oss_write"
815 write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
816 fade_errlist_objs="$fade_errlist_objs oss_mix"
818 writers="$writers oss"
819 default_writer="OSS_WRITE"
820 mixers="${mixers}oss "
821 default_mixer="OSS_MIX"
823 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
824 audiod_ldflags="$audiod_ldflags -lossaudio"
825 play_ldflags="$play_ldflags -lossaudio"
826 write_ldflags="$write_ldflags -lossaudio"
827 fade_ldflags="$fade_ldflags -lossaudio"
833 AC_MSG_WARN([no sys/soundcard.h $msg])
836 CPPFLAGS="$OLD_CPPFLAGS"
837 LDFLAGS="$OLD_LDFLAGS"
840 ########################################################################### alsa
841 OLD_CPPFLAGS="$CPPFLAGS"
842 OLD_LDFLAGS="$LDFLAGS"
845 msg="=> no alsa support for para_audiod/para_write"
846 if test "$OSTYPE" != "Linux"; then
851 if test "$have_alsa" = "yes"; then
852 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
854 AC_MSG_WARN([no alsa/asoundlib $msg])
858 if test "$have_alsa" = "yes"; then
859 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
861 AC_MSG_WARN([no libasound $msg])
865 if test "$have_alsa" = "yes"; then
866 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
867 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(alsa_write)"
868 audiod_ldflags="$audiod_ldflags -lasound"
869 play_errlist_objs="$play_errlist_objs alsa_write"
870 play_cmdline_objs="$play_cmdline_objs add_cmdline(alsa_write)"
871 play_ldflags="$play_ldflags -lasound"
873 write_errlist_objs="$write_errlist_objs alsa_write"
874 write_cmdline_objs="$write_cmdline_objs add_cmdline(alsa_write)"
875 write_ldflags="$write_ldflags -lasound"
876 fade_errlist_objs="$fade_errlist_objs alsa_mix"
877 fade_ldflags="$fade_ldflags -lasound"
879 writers="$writers alsa"
880 default_writer="ALSA_WRITE"
881 mixers="${mixers}alsa "
882 default_mixer="ALSA_MIX"
885 CPPFLAGS="$OLD_CPPFLAGS"
886 LDFLAGS="$OLD_LDFLAGS"
888 ########################################################################### fade
889 if test -n "$mixers"; then
891 executables="$executables fade"
892 fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
893 fade_cmdline_objs="add_cmdline(fade)"
894 fade_objs="$fade_cmdline_objs $fade_errlist_objs"
895 AC_SUBST(fade_objs, add_dot_o($fade_objs))
896 AC_SUBST(fade_ldflags, $fade_ldflags)
897 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
898 objlist_to_errlist($fade_errlist_objs),
899 errors used by para_fade)
902 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
905 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
906 enum of supported mixers)
907 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
908 use this mixer if none was specified)
909 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
910 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
913 printf 'extern void '$i'_mix_init(struct mixer *); '
916 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
917 init functions of the supported mixers)
918 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
919 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
920 mixer_summary="supported mixers:: $mixers, default: $default_mixer"
923 AC_MSG_WARN([no mixer support])
924 mixer_summary="para_fade: no"
926 ########################################################################### libao
927 OLD_CPPFLAGS="$CPPFLAGS"
928 OLD_LDFLAGS="$LDFLAGS"
932 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
933 [look for ao/ao.h also in dir])])
934 if test -n "$with_ao_headers"; then
935 ao_cppflags="-I$with_ao_headers"
936 CPPFLAGS="$CPPFLAGS $ao_cppflags"
938 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
939 [look for libao also in dir])])
940 if test -n "$with_ao_libs"; then
941 ao_libs="-L$with_ao_libs"
942 LDFLAGS="$LDFLAGS $ao_libs"
944 msg="no libao support for para_audiod/para_write"
945 AC_CHECK_HEADERS([ao/ao.h], [
948 AC_MSG_WARN([ao.h not found, $msg])
950 if test "$have_ao" = "yes"; then
951 AC_CHECK_LIB([ao], [ao_initialize], [], [
953 AC_MSG_WARN([ao lib not found or not working, $msg])
956 if test "$have_ao" = "yes"; then
957 AC_CHECK_HEADERS([pthread.h], [
960 AC_MSG_WARN([pthread.h not found, $msg])
963 if test "$have_ao" = "yes"; then
964 AC_CHECK_LIB([pthread], [pthread_create], [], [
966 AC_MSG_WARN([pthread lib not found or not working, $msg])
969 if test "$have_ao" = "yes"; then
970 audiod_errlist_objs="$audiod_errlist_objs ao_write"
971 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(ao_write)"
972 audiod_ldflags="$audiod_ldflags -lao -lpthread"
974 play_errlist_objs="$play_errlist_objs ao_write"
975 play_cmdline_objs="$play_cmdline_objs add_cmdline(ao_write)"
976 play_ldflags="$play_ldflags -lao -lpthread"
978 write_errlist_objs="$write_errlist_objs ao_write"
979 write_cmdline_objs="$write_cmdline_objs add_cmdline(ao_write)"
980 write_ldflags="$write_ldflags $ao_libs -lao -lpthread"
981 writers="$writers ao"
982 AC_SUBST(ao_cppflags)
985 CPPFLAGS="$OLD_CPPFLAGS"
986 LDFLAGS="$OLD_LDFLAGS"
988 ############################################################# readline
989 OLD_CPPFLAGS="$CPPFLAGS"
990 OLD_LDFLAGS="$LDFLAGS"
994 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
995 [look for libreadline header files also in dir])])
996 if test -n "$with_readline_headers"; then
997 readline_cppflags="-I$with_readline_headers"
998 CPPFLAGS="$CPPFLAGS $readline_cppflags"
1001 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
1002 [look for readline library also in dir])])
1003 if test -n "$with_readline_libs"; then
1004 readline_libs="-L$with_readline_libs"
1005 LDFLAGS="$LDFLAGS $readline_libs"
1007 msg="no interactive cli support"
1008 AC_CHECK_HEADERS([readline/readline.h], [
1011 AC_MSG_WARN([readline/readline.h not found, $msg])
1014 if test "$have_curses" != "yes"; then
1016 AC_MSG_WARN([interactive cli support depends on curses,])
1017 AC_MSG_WARN([but no curses lib was detected, $msg])
1020 if test "$have_readline" = "yes"; then
1021 readline_libs="$readline_libs -lreadline"
1022 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
1023 if test "$have_readline" = "no"; then # try with -lcurses
1025 AC_MSG_NOTICE([trying again with -lcurses])
1026 unset ac_cv_search_rl_free_keymap 2> /dev/null
1027 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1029 readline_libs="$readline_libs -lcurses"
1032 if test "$have_readline" = "no"; then # try with -ltermcap
1034 AC_MSG_NOTICE([trying again with -ltermcap])
1035 unset ac_cv_search_rl_free_keymap 2> /dev/null
1036 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1038 readline_libs="$readline_libs -ltermcap"
1043 if test "$have_readline" = "yes"; then
1044 client_errlist_objs="$client_errlist_objs interactive"
1045 client_ldflags="$client_ldflags $readline_libs"
1046 audioc_errlist_objs="$audioc_errlist_objs buffer_tree interactive sched time"
1047 audioc_ldflags="$audioc_ldflags $readline_libs"
1048 play_errlist_objs="$play_errlist_objs interactive"
1049 play_ldflags="$play_ldflags $readline_libs"
1050 AC_SUBST(readline_cppflags)
1051 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
1053 AC_MSG_WARN([libreadline not found or unusable])
1055 CPPFLAGS="$OLD_CPPFLAGS"
1056 LDFLAGS="$OLD_LDFLAGS"
1058 ############################################################# libsamplerate
1059 OLD_CPPFLAGS="$CPPFLAGS"
1060 OLD_LDFLAGS="$LDFLAGS"
1063 have_samplerate="yes"
1064 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
1065 [look for samplerate headers also in dir])])
1066 if test -n "$with_samplerate_headers"; then
1067 samplerate_cppflags="-I$with_samplerate_headers"
1068 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
1070 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
1071 [look for samplerate libs also in dir])])
1072 if test -n "$with_samplerate_libs"; then
1073 samplerate_libs="-L$with_samplerate_libs"
1074 LDFLAGS="$LDFLAGS $samplerate_libs"
1077 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
1078 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
1080 if test "$have_samplerate" = "yes"; then
1081 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1082 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(resample_filter)"
1083 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1084 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(resample_filter)"
1085 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1086 play_cmdline_objs="$play_cmdline_objs add_cmdline(resample_filter)"
1087 filter_ldflags="$filter_ldflags $samplerate_libs -lsamplerate"
1088 audiod_ldflags="$audiod_ldflags $samplerate_libs -lsamplerate"
1089 play_ldflags="$play_ldflags $samplerate_libs -lsamplerate"
1090 filters="$filters resample"
1091 AC_SUBST(samplerate_cppflags)
1093 AC_MSG_WARN([no resample support in para_audiod/para_filter])
1095 CPPFLAGS="$OLD_CPPFLAGS"
1096 LDFLAGS="$OLD_LDFLAGS"
1098 ######################################################################### server
1099 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
1100 -a "$have_osl" = "yes" ; then
1103 executables="$executables server"
1104 server_cmdline_objs="add_cmdline(server)"
1105 server_errlist_objs="$server_errlist_objs
1144 server_ldflags="$server_ldflags $osl_libs -losl"
1148 ############################################################# client
1149 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1151 executables="$executables client"
1152 client_cmdline_objs="add_cmdline(client)"
1153 client_errlist_objs="$client_errlist_objs
1172 ############################################################# audiod
1173 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1175 executables="$executables audiod"
1176 audiod_cmdline_objs="$audiod_cmdline_objs
1177 add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
1178 audiod_errlist_objs="$audiod_errlist_objs
1215 audiod_ldflags="$audiod_ldflags -lm"
1216 audiod_audio_formats="$audiod_audio_formats wma"
1220 ############################################################# error2.h
1221 AC_MSG_NOTICE(creating error2.h)
1223 # these are always built
1226 $filter_errlist_objs
1227 $audioc_errlist_objs
1233 # optional executables
1234 if test "$build_server" = "yes"; then
1235 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1237 if test "$build_gui" = "yes"; then
1238 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1240 if test "$build_fade" = "yes"; then
1241 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1243 if test "$build_client" = "yes"; then
1244 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1246 if test "$build_audiod" = "yes"; then
1247 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1250 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1252 for i in $executables; do
1254 eval echo \$${i}_errlist_objs
1255 done | ./error2.pl > error2.h
1256 for obj in $all_errlist_objs; do
1257 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1259 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1260 [enum {$SS NUM_SS}],
1261 [list of all objects that use the paraslash error facility]
1264 ################################################################## status items
1266 status_items="basename status num_played mtime bitrate frequency file_size
1267 status_flags format score techinfo afs_mode
1268 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1269 offset seconds_total stream_start current_time audiod_uptime image_id
1270 lyrics_id duration directory lyrics_name image_name path hash channels
1271 last_played num_chunks chunk_time amplification artist title year album
1275 for i in $status_items; do
1276 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1278 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1279 [enum of all status items])
1282 for i in $status_items; do
1283 result="$result \"$i\", "
1285 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1286 [char * array of all status items])
1288 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1289 [formats supported by para_server and para_afh])
1291 AC_SUBST(executables)
1293 recv_objs="$recv_cmdline_objs $recv_errlist_objs"
1294 filter_objs="$filter_cmdline_objs $filter_errlist_objs"
1295 audiod_objs="$audiod_cmdline_objs $audiod_errlist_objs"
1296 server_objs="$server_cmdline_objs $server_errlist_objs"
1297 write_objs="$write_cmdline_objs $write_errlist_objs"
1298 client_objs="$client_cmdline_objs $client_errlist_objs"
1299 audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
1300 afh_objs="$afh_cmdline_objs $afh_errlist_objs"
1301 play_objs="$play_cmdline_objs $play_errlist_objs"
1304 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1305 AC_SUBST(recv_ldflags, $recv_ldflags)
1306 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1307 errors used by para_recv)
1309 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1310 AC_SUBST(filter_ldflags, $filter_ldflags)
1311 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1312 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1314 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1315 AC_SUBST(audiod_ldflags, $audiod_ldflags)
1316 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1317 errors used by para_audiod)
1319 AC_SUBST(server_objs, add_dot_o($server_objs))
1320 AC_SUBST(server_ldflags, $server_ldflags)
1321 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
1322 objlist_to_errlist($server_errlist_objs), errors used by para_server)
1324 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1325 AC_SUBST(afh_ldflags, $afh_ldflags)
1326 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1327 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1329 AC_SUBST(write_objs, add_dot_o($write_objs))
1330 AC_SUBST(write_ldflags, $write_ldflags)
1331 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1332 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1334 AC_SUBST(client_objs, add_dot_o($client_objs))
1335 AC_SUBST(client_ldflags, $client_ldflags)
1336 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
1337 objlist_to_errlist($client_errlist_objs), errors used by para_client)
1339 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1340 AC_SUBST(audioc_ldflags, $audioc_ldflags)
1341 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1342 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1344 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1345 AC_SUBST(gui_ldflags, $gui_ldflags)
1346 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1347 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1349 AC_SUBST(play_objs, add_dot_o($play_objs))
1350 AC_SUBST(play_ldflags, $play_ldflags)
1351 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1352 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1354 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1355 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1356 enum of supported filters)
1357 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1358 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1359 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1360 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1362 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1363 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1364 enum of supported writers)
1365 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1366 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1367 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1368 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1369 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1370 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1371 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1373 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1374 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1375 enum of audio formats supported by audiod)
1376 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1377 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1381 paraslash configuration:
1382 ~~~~~~~~~~~~~~~~~~~~~~~~
1383 unix socket credentials: $have_ucred
1384 readline (interactive CLIs): $have_readline
1385 audio formats handlers: $audio_format_handlers
1386 id3 version2 support: $have_libid3tag
1391 para_server: $build_server
1392 para_gui: $build_gui
1393 para_fade: $build_fade
1394 para_client: $build_client
1395 para_audiod: $build_audiod