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 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 gui_cmdline_objs="add_cmdline(gui)"
161 gui_objs="$gui_cmdline_objs $gui_errlist_objs"
162 play_errlist_objs="play fd sched ggo buffer_tree time string net
164 wma_afh wma_common mp3_afh
165 recv_common udp_recv http_recv dccp_recv
166 filter_common fec bitstream imdct
167 wav_filter compress_filter amp_filter prebuffer_filter fecdec_filter
169 write_common file_write
172 play_cmdline_objs="add_cmdline(http_recv dccp_recv udp_recv afh_recv compress_filter amp_filter prebuffer_filter file_write play)"
174 ################################################################## clock_gettime
176 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
177 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
179 if test -n "$clock_gettime_lib"; then
180 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
181 define to 1 if clock_gettime() is supported])
183 if test "$clock_gettime_lib" = "rt"; then
184 AC_SUBST(clock_gettime_ldflags, -lrt)
186 ########################################################################### osl
188 OLD_CPPFLAGS="$CPPFLAGS"
189 OLD_LDFLAGS="$LDFLAGS"
191 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
192 [look for osl.h also in dir])])
193 if test -n "$with_osl_headers"; then
194 osl_cppflags="-I$with_osl_headers"
195 CPPFLAGS="$CPPFLAGS $osl_cppflags"
197 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
198 [look for libosl also in dir])])
199 if test -n "$with_osl_libs"; then
200 osl_libs="-L$with_osl_libs"
201 LDFLAGS="$LDFLAGS $osl_libs"
204 AC_CHECK_HEADER(osl.h, [], have_osl=no)
205 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
206 if test "$have_osl" = "no"; then
207 AC_MSG_WARN([libosl not found, can not build para_server.
209 http://systemlinux.org/~maan/osl
211 git clone git://git.tuebingen.mpg.de/osl
214 AC_SUBST(osl_cppflags)
215 CPPFLAGS="$OLD_CPPFLAGS"
216 LDFLAGS="$OLD_LDFLAGS"
218 ########################################################################### crypto
219 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
220 Force using crypto library "lib". This package requires either
221 openssl or libgcrypt being installed. Possible values for "lib"
222 are thus "openssl" and "gcrypt". If this option is not given,
223 openssl is tried first. If openssl was not found, gcrypt is
226 case "$enable_cryptolib" in
227 "openssl") check_openssl="yes"; check_gcrypt="no";;
228 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
229 "") check_openssl="yes"; check_gcrypt="yes";;
230 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
232 ###################################################################### openssl
233 if test "$check_openssl" = "yes"; then
234 OLD_CPPFLAGS="$CPPFLAGS"
235 OLD_LDFLAGS="$LDFLAGS"
238 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
239 [look for openssl headers also in dir])])
240 if test -n "$with_openssl_headers"; then
241 openssl_cppflags="-I$with_openssl_headers"
242 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
244 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
245 [look for openssl libraries also in dir])])
246 if test -n "$with_openssl_libs"; then
247 openssl_libs="-L$with_openssl_libs"
248 LDFLAGS="$LDFLAGS $openssl_libs"
250 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
251 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
252 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
253 # try harder: openssl is sometimes installed in /usr/local/ssl
254 openssl_cppflags="-I/usr/local/ssl/include"
255 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
256 openssl_libs="-L/usr/local/ssl/lib"
257 LDFLAGS="$LDFLAGS $openssl_libs"
259 unset ac_cv_header_openssl_ssl_h 2> /dev/null
260 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
261 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
262 if test "$have_openssl" = "yes"; then
263 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
266 if test "$have_openssl" = "yes"; then
267 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
268 AC_SUBST(openssl_cppflags)
269 openssl_libs="$openssl_libs -lssl -lcrypto"
270 server_ldflags="$server_ldflags $openssl_libs"
271 client_ldflags="$client_ldflags $openssl_libs"
272 audiod_ldflags="$audiod_ldflags $openssl_libs"
274 server_errlist_objs="$server_errlist_objs crypt"
275 client_errlist_objs="$client_errlist_objs crypt"
276 audiod_errlist_objs="$audiod_errlist_objs crypt"
280 AC_MSG_WARN([openssl libraries not found])
282 CPPFLAGS="$OLD_CPPFLAGS"
283 LDFLAGS="$OLD_LDFLAGS"
288 ########################################################################### gcrypt
289 if test "$check_gcrypt" = "yes"; then
290 OLD_CPPFLAGS="$CPPFLAGS"
291 OLD_LDFLAGS="$LDFLAGS"
294 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
295 [look for gcrypt headers also in dir])])
296 if test -n "$with_gcrypt_headers"; then
297 gcrypt_cppflags="-I$with_gcrypt_headers"
298 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
300 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
301 [look for libgcrypt also in dir])])
302 if test -n "$with_gcrypt_libs"; then
303 gcrypt_libs="-L$with_gcrypt_libs"
304 LDFLAGS="$LDFLAGS $gcrypt_libs"
306 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
307 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
308 if test "$have_gcrypt" = "yes"; then
309 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
310 AC_SUBST(gcrypt_cppflags)
311 gcrypt_libs="$gcrypt_libs -lgcrypt"
312 server_ldflags="$server_ldflags $gcrypt_libs"
313 client_ldflags="$client_ldflags $gcrypt_libs"
314 audiod_ldflags="$audiod_ldflags $gcrypt_libs"
316 server_errlist_objs="$server_errlist_objs gcrypt"
317 client_errlist_objs="$client_errlist_objs gcrypt"
318 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
320 AC_MSG_WARN([gcrypt library not found])
322 CPPFLAGS="$OLD_CPPFLAGS"
323 LDFLAGS="$OLD_LDFLAGS"
328 ###########################################################################
329 if test "$have_openssl" = "no" -a "$have_gcrypt" = "no"; then
330 AC_MSG_ERROR([neither openssl nor gcrypt usable])
332 ########################################################################### libsocket
333 AC_CHECK_LIB([c], [socket],
335 [socket_lib="-lsocket"]
337 server_ldflags="$server_ldflags $socket_lib"
338 client_ldflags="$client_ldflags $socket_lib"
339 audioc_ldflags="$audioc_ldflags $socket_lib"
340 audiod_ldflags="$audiod_ldflags $socket_lib"
341 recv_ldflags="$recv_ldflags $socket_lib"
342 AC_SEARCH_LIBS([connect],[socket],[],[
343 AC_MSG_ERROR([Fatal: Did not find connect().])
345 ########################################################################### libnsl
346 AC_CHECK_LIB([c], [gethostbyname],
350 server_ldflags="$server_ldflags $nsl_lib"
351 client_ldflags="$client_ldflags $nsl_lib"
352 audioc_ldflags="$audioc_ldflags $nsl_lib"
353 recv_ldflags="$recv_ldflags $nsl_lib"
354 AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[
355 AC_MSG_ERROR([Fatal: Did not find inet_ntoa().])
357 ########################################################################### ucred
358 AC_MSG_CHECKING(for struct ucred)
359 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
361 #include <sys/types.h>
362 #include <sys/socket.h>
364 struct ucred sucred; sucred.pid=0;
365 ]])],[have_ucred=yes],[have_ucred=no])
366 AC_MSG_RESULT($have_ucred)
367 if test ${have_ucred} = yes; then
368 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
370 ########################################################################### gengetopt
371 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
373 [gengetopt_args_info_description],
374 [ggo_descriptions_declared=yes],
375 [ggo_descriptions_declared=no],
376 [#include "conftest-ggo.h"]
378 AC_SUBST(ggo_descriptions_declared)
379 ########################################################################### curses
381 OLD_CPPFLAGS="$CPPFLAGS"
382 OLD_LDFLAGS="$LDFLAGS"
384 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
385 [look for curses.h also in dir])])
386 if test -n "$with_curses_headers"; then
387 curses_cppflags="-I$with_curses_headers"
388 CPPFLAGS="$CPPFLAGS $curses_cppflags"
390 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
391 [look for libcurses also in dir])])
392 if test -n "$with_curses_libs"; then
393 curses_libs="-L$with_curses_libs"
394 LDFLAGS="$LDFLAGS $curses_libs"
396 AC_CHECK_HEADER(curses.h, [], [
399 gui_ldflags="$curses_libs"
400 AC_CHECK_LIB([ncursesw], [initscr],
401 [gui_ldflags="$curses_libs -lncursesw"], [
402 AC_CHECK_LIB([curses], [initscr],
403 [gui_ldflags="$curses_libs -lcurses"],
408 if test "$have_curses" = "yes"; then
409 AC_SUBST(curses_cppflags)
411 executables="$executables gui"
414 AC_MSG_WARN([no curses lib, cannot build para_gui])
416 CPPFLAGS="$OLD_CPPFLAGS"
417 LDFLAGS="$OLD_LDFLAGS"
420 ########################################################################### ip_mreqn
421 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
422 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
428 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
429 AC_MSG_RESULT($have_ip_mreqn)
430 if test ${have_ip_mreqn} = yes; then
431 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
433 ########################################################################### osx
435 AC_MSG_CHECKING(for CoreAudio (MacOs))
436 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
437 #include <CoreAudio/CoreAudio.h>
440 ]])],[have_core_audio=yes],[have_core_audio=no])
441 AC_MSG_RESULT($have_core_audio)
442 if test ${have_core_audio} = yes; then
443 f1="-framework CoreAudio"
444 f2="-framework AudioToolbox"
445 f3="-framework AudioUnit"
446 f4="-framework CoreServices"
449 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
450 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
451 audiod_ldflags="$audiod_ldflags $f"
453 play_errlist_objs="$play_errlist_objs osx_write ipc"
454 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
455 play_ldflags="$play_ldflags $f"
457 write_errlist_objs="$write_errlist_objs osx_write ipc"
458 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
459 write_ldflags="$write_ldflags $f"
460 writers="$writers osx"
461 default_writer="OSX_WRITE"
462 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
464 ####################################################### ogg/vorbis/speex/opus
466 OLD_CPPFLAGS="$CPPFLAGS"
467 OLD_LDFLAGS="$LDFLAGS"
469 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
470 [look for ogg headers also in dir])])
471 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
472 [look for ogg libs also in dir])])
473 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
474 [look for vorbis headers also in dir])])
475 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
476 [look for vorbis libs also in dir])])
477 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
478 [look for speex headers also in dir])])
479 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
480 [look for speex libs also in dir])])
481 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
482 [look for opus headers also in dir])])
483 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
484 [look for opus libs also in dir])])
486 if test -n "$with_ogg_headers"; then
487 ogg_cppflags="-I$with_ogg_headers"
488 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
490 if test -n "$with_ogg_libs"; then
491 ogg_libs="-L$with_ogg_libs"
492 LDFLAGS="$LDFLAGS $ogg_libs"
494 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
495 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
500 if test "$have_ogg" = "yes"; then
502 if test -n "$with_vorbis_headers"; then
503 vorbis_cppflags="-I$with_vorbis_headers"
504 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
506 if test -n "$with_vorbis_libs"; then
507 vorbis_libs="-L$with_vorbis_libs"
508 LDFLAGS="$LDFLAGS $vorbis_libs"
510 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
511 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
514 if test -n "$with_speex_headers"; then
515 speex_cppflags="-I$with_speex_headers"
516 CPPFLAGS="$CPPFLAGS $speex_cppflags"
518 if test -n "$with_speex_libs"; then
519 speex_libs="-L$with_speex_libs"
520 LDFLAGS="$LDFLAGS $speex_libs"
522 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
523 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
526 if test -n "$with_opus_headers"; then
527 opus_cppflags="-I$with_opus_headers"
528 CPPFLAGS="$CPPFLAGS $opus_cppflags"
530 if test -n "$with_opus_libs"; then
531 opus_libs="-L$with_opus_libs"
532 LDFLAGS="$LDFLAGS $opus_libs"
534 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
535 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
537 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
543 msg="support in para_server/para_filter/para_afh"
544 if test "$have_vorbis" = "yes" || \
545 test "$have_speex" = "yes" || \
546 test "$have_opus" = "yes"; then
547 AC_SUBST(ogg_cppflags)
548 ogg_libs="$ogg_libs -logg"
549 if test "$OSTYPE" = "Darwin"; then
550 ogg_libs="-Wl,-bind_at_load $ogg_libs"
552 server_ldflags="$server_ldflags $ogg_libs"
553 filter_ldflags="$filter_ldflags $ogg_libs"
554 audiod_ldflags="$audiod_ldflags $ogg_libs"
555 play_ldflags="$play_ldflags $ogg_libs"
556 afh_ldflags="$afh_ldflags $ogg_libs"
557 recv_ldflags="$recv_ldflags $ogg_libs"
558 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
559 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
560 server_errlist_objs="$server_errlist_objs ogg_afh_common"
561 play_errlist_objs="$play_errlist_objs ogg_afh_common"
563 if test "$have_vorbis" = "yes"; then
564 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
565 filters="$filters oggdec"
566 vorbis_libs="-lvorbis -lvorbisfile"
567 server_ldflags="$server_ldflags $vorbis_libs"
568 filter_ldflags="$filter_ldflags $vorbis_libs"
569 audiod_ldflags="$audiod_ldflags $vorbis_libs"
570 play_ldflags="$play_ldflags $vorbis_libs"
571 afh_ldflags="$afh_ldflags $vorbis_libs"
572 recv_ldflags="$recv_ldflags $vorbis_libs"
574 server_errlist_objs="$server_errlist_objs ogg_afh"
575 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
576 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
577 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
578 afh_errlist_objs="$afh_errlist_objs ogg_afh"
579 recv_errlist_objs="$recv_errlist_objs ogg_afh"
581 audiod_audio_formats="$audiod_audio_formats ogg"
582 audio_format_handlers="$audio_format_handlers ogg"
584 AC_MSG_WARN([no ogg/vorbis $msg])
586 if test "$have_speex" = "yes"; then
587 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
588 filters="$filters spxdec"
590 server_ldflags="$server_ldflags $speex_libs"
591 filter_ldflags="$filter_ldflags $speex_libs"
592 audiod_ldflags="$audiod_ldflags $speex_libs"
593 play_ldflags="$play_ldflags $speex_libs"
594 afh_ldflags="$afh_ldflags $speex_libs"
595 recv_ldflags="$recv_ldflags $speex_libs"
597 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
598 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
599 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
600 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
601 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
602 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
604 audiod_audio_formats="$audiod_audio_formats spx"
605 audio_format_handlers="$audio_format_handlers spx"
607 AC_MSG_WARN([no ogg/speex $msg])
609 if test "$have_opus" = "yes"; then
610 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
611 filters="$filters opusdec"
613 server_ldflags="$server_ldflags $opus_libs"
614 filter_ldflags="$filter_ldflags $opus_libs"
615 audiod_ldflags="$audiod_ldflags $opus_libs"
616 afh_ldflags="$afh_ldflags $opus_libs"
617 play_ldflags="$play_ldflags $opus_libs"
618 recv_ldflags="$recv_ldflags $opus_libs"
620 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
621 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
622 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
623 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
624 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
625 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
627 audiod_audio_formats="$audiod_audio_formats opus"
628 audio_format_handlers="$audio_format_handlers opus"
630 AC_MSG_WARN([no ogg/opus $msg])
632 CPPFLAGS="$OLD_CPPFLAGS"
633 LDFLAGS="$OLD_LDFLAGS"
635 ########################################################################### faad
637 OLD_CPPFLAGS="$CPPFLAGS"
638 OLD_LDFLAGS="$LDFLAGS"
640 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
641 [look for neaacdec.h also in dir])])
642 if test -n "$with_faad_headers"; then
643 faad_cppflags="-I$with_faad_headers"
644 CPPFLAGS="$CPPFLAGS $faad_cppflags"
646 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
647 [look for libfaad also in dir])])
648 if test -n "$with_faad_libs"; then
649 faad_libs="-L$with_faad_libs"
650 LDFLAGS="$LDFLAGS $faad_libs"
652 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
653 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
654 if test "$have_faad" = "yes"; then
655 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
656 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
657 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
658 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
659 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
660 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
661 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
663 server_ldflags="$server_ldflags $faad_libs -lfaad"
664 filter_ldflags="$filter_ldflags $faad_libs -lfaad"
665 audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
666 play_ldflags="$play_ldflags $faad_libs -lfaad"
667 afh_ldflags="$afh_ldflags $faad_libs -lfaad"
668 recv_ldflags="$afh_ldflags $faad_libs -lfaad"
670 audiod_audio_formats="$audiod_audio_formats aac"
671 audio_format_handlers="$audio_format_handlers aac"
672 filters="$filters aacdec"
673 AC_SUBST(faad_cppflags)
675 AC_MSG_WARN([no aac support in para_audiod/para_filter])
677 CPPFLAGS="$OLD_CPPFLAGS"
678 LDFLAGS="$OLD_LDFLAGS"
680 ########################################################################### mad
682 OLD_CPPFLAGS="$CPPFLAGS"
683 OLD_LDFLAGS="$LDFLAGS"
686 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
687 [look for mad.h also in dir])])
688 if test -n "$with_mad_headers"; then
689 mad_cppflags="-I$with_mad_headers"
690 CPPFLAGS="$CPPFLAGS $mad_cppflags"
692 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
693 [look for libmad also in dir])])
694 if test -n "$with_mad_libs"; then
695 mad_libs="-L$with_mad_libs"
696 LDFLAGS="$LDFLAGS $mad_libs"
698 AC_CHECK_HEADERS([mad.h], [], [
701 AC_CHECK_LIB([mad], [mad_stream_init], [], [
704 if test "$have_mad" = "yes"; then
705 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
706 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(mp3dec_filter)"
707 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(mp3dec_filter)"
708 play_cmdline_objs="$play_cmdline_objs add_cmdline(mp3dec_filter)"
709 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
710 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
711 play_errlist_objs="$play_errlist_objs mp3dec_filter"
712 filter_ldflags="$filter_ldflags $mad_libs -lmad"
713 audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
714 play_ldflags="$play_ldflags $mad_libs -lmad"
715 audiod_audio_formats="$audiod_audio_formats mp3"
716 filters="$filters mp3dec"
717 AC_SUBST(mad_cppflags)
719 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
721 CPPFLAGS="$OLD_CPPFLAGS"
722 LDFLAGS="$OLD_LDFLAGS"
724 ###################################################################### libid3tag
725 OLD_CPPFLAGS="$CPPFLAGS"
726 OLD_LDFLAGS="$LDFLAGS"
730 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
731 [look for id3tag header files also in dir])])
732 if test -n "$with_id3tag_headers"; then
733 id3tag_cppflags="-I$with_id3tag_headers"
734 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
736 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
737 [look for id3tag libs also in dir])])
738 if test -n "$with_id3tag_libs"; then
739 id3tag_libs="-L$with_id3tag_libs"
740 LDFLAGS="$LDFLAGS $id3tag_libs"
743 AC_MSG_CHECKING(for libid3tag)
744 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
747 struct id3_tag t = {.flags = 0};
748 ]])],[],[have_libid3tag=no])
749 AC_MSG_RESULT($have_libid3tag)
751 if test ${have_libid3tag} = yes; then
752 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
753 server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
754 afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
755 play_ldflags="$play_ldflags -lz"
756 recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
757 play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
758 AC_SUBST(id3tag_cppflags)
760 AC_MSG_WARN([no support for id3v2 tags])
762 CPPFLAGS="$OLD_CPPFLAGS"
763 LDFLAGS="$OLD_LDFLAGS"
765 ########################################################################### flac
766 OLD_CPPFLAGS="$CPPFLAGS"
767 OLD_LDFLAGS="$LDFLAGS"
771 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
772 [look for flac headers also in dir])])
773 if test -n "$with_flac_headers"; then
774 flac_cppflags="-I$with_flac_headers"
775 CPPFLAGS="$CPPFLAGS $flac_cppflags"
777 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
778 [look for flac libs also in dir])])
779 if test -n "$with_flac_libs"; then
780 flac_libs="-L$with_flac_libs"
781 LDFLAGS="$LDFLAGS $flac_libs"
783 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
784 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
785 if test "$have_flac" = "yes"; then
786 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
787 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
788 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
789 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
790 afh_errlist_objs="$afh_errlist_objs flac_afh"
791 server_errlist_objs="$server_errlist_objs flac_afh"
792 recv_errlist_objs="$recv_errlist_objs flac_afh"
793 filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
794 audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
795 play_ldflags="$play_ldflags $flac_libs -lFLAC"
796 server_ldflags="$server_ldflags $flac_libs -lFLAC"
797 afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
798 recv_ldflags="$recv_ldflags $flac_libs -lFLAC"
799 filters="$filters flacdec"
800 audio_format_handlers="$audio_format_handlers flac"
801 audiod_audio_formats="$audiod_audio_formats flac"
802 AC_SUBST(flac_cppflags)
804 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
806 CPPFLAGS="$OLD_CPPFLAGS"
807 LDFLAGS="$OLD_LDFLAGS"
809 ########################################################################### oss
810 OLD_CPPFLAGS="$CPPFLAGS"
811 OLD_LDFLAGS="$LDFLAGS"
815 msg="=> will not build oss writer"
817 AC_CHECK_HEADER(sys/soundcard.h, [
818 audiod_errlist_objs="$audiod_errlist_objs oss_write"
819 play_errlist_objs="$play_errlist_objs oss_write"
820 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"
821 play_cmdline_objs="$play_cmdline_objs add_cmdline(oss_write)"
823 write_errlist_objs="$write_errlist_objs oss_write"
824 write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
825 fade_errlist_objs="$fade_errlist_objs oss_mix"
827 writers="$writers oss"
828 default_writer="OSS_WRITE"
829 mixers="${mixers}oss "
830 default_mixer="OSS_MIX"
832 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
833 audiod_ldflags="$audiod_ldflags -lossaudio"
834 play_ldflags="$play_ldflags -lossaudio"
835 write_ldflags="$write_ldflags -lossaudio"
836 fade_ldflags="$fade_ldflags -lossaudio"
842 AC_MSG_WARN([no sys/soundcard.h $msg])
845 CPPFLAGS="$OLD_CPPFLAGS"
846 LDFLAGS="$OLD_LDFLAGS"
849 ########################################################################### alsa
850 OLD_CPPFLAGS="$CPPFLAGS"
851 OLD_LDFLAGS="$LDFLAGS"
854 msg="=> no alsa support for para_audiod/para_write"
855 if test "$OSTYPE" != "Linux"; then
860 if test "$have_alsa" = "yes"; then
861 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
863 AC_MSG_WARN([no alsa/asoundlib $msg])
867 if test "$have_alsa" = "yes"; then
868 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
870 AC_MSG_WARN([no libasound $msg])
874 if test "$have_alsa" = "yes"; then
875 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
876 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(alsa_write)"
877 audiod_ldflags="$audiod_ldflags -lasound"
878 play_errlist_objs="$play_errlist_objs alsa_write"
879 play_cmdline_objs="$play_cmdline_objs add_cmdline(alsa_write)"
880 play_ldflags="$play_ldflags -lasound"
882 write_errlist_objs="$write_errlist_objs alsa_write"
883 write_cmdline_objs="$write_cmdline_objs add_cmdline(alsa_write)"
884 write_ldflags="$write_ldflags -lasound"
885 fade_errlist_objs="$fade_errlist_objs alsa_mix"
886 fade_ldflags="$fade_ldflags -lasound"
888 writers="$writers alsa"
889 default_writer="ALSA_WRITE"
890 mixers="${mixers}alsa "
891 default_mixer="ALSA_MIX"
894 CPPFLAGS="$OLD_CPPFLAGS"
895 LDFLAGS="$OLD_LDFLAGS"
897 ########################################################################### fade
898 if test -n "$mixers"; then
900 executables="$executables fade"
901 fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
902 fade_cmdline_objs="add_cmdline(fade)"
903 fade_objs="$fade_cmdline_objs $fade_errlist_objs"
904 AC_SUBST(fade_objs, add_dot_o($fade_objs))
905 AC_SUBST(fade_ldflags, $fade_ldflags)
906 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
907 objlist_to_errlist($fade_errlist_objs),
908 errors used by para_fade)
911 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
914 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
915 enum of supported mixers)
916 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
917 use this mixer if none was specified)
918 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
919 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
922 printf 'extern void '$i'_mix_init(struct mixer *); '
925 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
926 init functions of the supported mixers)
927 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
928 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
929 mixer_summary="supported mixers:: $mixers, default: $default_mixer"
932 AC_MSG_WARN([no mixer support])
933 mixer_summary="para_fade: no"
935 ########################################################################### libao
936 OLD_CPPFLAGS="$CPPFLAGS"
937 OLD_LDFLAGS="$LDFLAGS"
941 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
942 [look for ao/ao.h also in dir])])
943 if test -n "$with_ao_headers"; then
944 ao_cppflags="-I$with_ao_headers"
945 CPPFLAGS="$CPPFLAGS $ao_cppflags"
947 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
948 [look for libao also in dir])])
949 if test -n "$with_ao_libs"; then
950 ao_libs="-L$with_ao_libs"
951 LDFLAGS="$LDFLAGS $ao_libs"
953 msg="no libao support for para_audiod/para_write"
954 AC_CHECK_HEADERS([ao/ao.h], [
957 AC_MSG_WARN([ao.h not found, $msg])
959 if test "$have_ao" = "yes"; then
960 AC_CHECK_LIB([ao], [ao_initialize], [], [
962 AC_MSG_WARN([ao lib not found or not working, $msg])
965 if test "$have_ao" = "yes"; then
966 AC_CHECK_HEADERS([pthread.h], [
969 AC_MSG_WARN([pthread.h not found, $msg])
972 if test "$have_ao" = "yes"; then
973 AC_CHECK_LIB([pthread], [pthread_create], [], [
975 AC_MSG_WARN([pthread lib not found or not working, $msg])
978 if test "$have_ao" = "yes"; then
979 audiod_errlist_objs="$audiod_errlist_objs ao_write"
980 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(ao_write)"
981 audiod_ldflags="$audiod_ldflags -lao -lpthread"
983 play_errlist_objs="$play_errlist_objs ao_write"
984 play_cmdline_objs="$play_cmdline_objs add_cmdline(ao_write)"
985 play_ldflags="$play_ldflags -lao -lpthread"
987 write_errlist_objs="$write_errlist_objs ao_write"
988 write_cmdline_objs="$write_cmdline_objs add_cmdline(ao_write)"
989 write_ldflags="$write_ldflags $ao_libs -lao -lpthread"
990 writers="$writers ao"
991 AC_SUBST(ao_cppflags)
994 CPPFLAGS="$OLD_CPPFLAGS"
995 LDFLAGS="$OLD_LDFLAGS"
997 ############################################################# readline
998 OLD_CPPFLAGS="$CPPFLAGS"
999 OLD_LDFLAGS="$LDFLAGS"
1003 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
1004 [look for libreadline header files also in dir])])
1005 if test -n "$with_readline_headers"; then
1006 readline_cppflags="-I$with_readline_headers"
1007 CPPFLAGS="$CPPFLAGS $readline_cppflags"
1010 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
1011 [look for readline library also in dir])])
1012 if test -n "$with_readline_libs"; then
1013 readline_libs="-L$with_readline_libs"
1014 LDFLAGS="$LDFLAGS $readline_libs"
1016 msg="no interactive cli support"
1017 AC_CHECK_HEADERS([readline/readline.h], [
1020 AC_MSG_WARN([readline/readline.h not found, $msg])
1023 if test "$have_curses" != "yes"; then
1025 AC_MSG_WARN([interactive cli support depends on curses,])
1026 AC_MSG_WARN([but no curses lib was detected, $msg])
1029 if test "$have_readline" = "yes"; then
1030 readline_libs="$readline_libs -lreadline"
1031 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
1032 if test "$have_readline" = "no"; then # try with -lcurses
1034 AC_MSG_NOTICE([trying again with -lcurses])
1035 unset ac_cv_search_rl_free_keymap 2> /dev/null
1036 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1038 readline_libs="$readline_libs -lcurses"
1041 if test "$have_readline" = "no"; then # try with -ltermcap
1043 AC_MSG_NOTICE([trying again with -ltermcap])
1044 unset ac_cv_search_rl_free_keymap 2> /dev/null
1045 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1047 readline_libs="$readline_libs -ltermcap"
1052 if test "$have_readline" = "yes"; then
1053 client_errlist_objs="$client_errlist_objs interactive"
1054 client_ldflags="$client_ldflags $readline_libs"
1055 audioc_errlist_objs="$audioc_errlist_objs buffer_tree interactive sched time"
1056 audioc_ldflags="$audioc_ldflags $readline_libs"
1057 play_errlist_objs="$play_errlist_objs interactive"
1058 play_ldflags="$play_ldflags $readline_libs"
1059 AC_SUBST(readline_cppflags)
1060 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
1062 AC_MSG_WARN([libreadline not found or unusable])
1064 CPPFLAGS="$OLD_CPPFLAGS"
1065 LDFLAGS="$OLD_LDFLAGS"
1067 ############################################################# libsamplerate
1068 OLD_CPPFLAGS="$CPPFLAGS"
1069 OLD_LDFLAGS="$LDFLAGS"
1072 have_samplerate="yes"
1073 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
1074 [look for samplerate headers also in dir])])
1075 if test -n "$with_samplerate_headers"; then
1076 samplerate_cppflags="-I$with_samplerate_headers"
1077 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
1079 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
1080 [look for samplerate libs also in dir])])
1081 if test -n "$with_samplerate_libs"; then
1082 samplerate_libs="-L$with_samplerate_libs"
1083 LDFLAGS="$LDFLAGS $samplerate_libs"
1086 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
1087 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
1089 if test "$have_samplerate" = "yes"; then
1090 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1091 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(resample_filter)"
1092 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1093 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(resample_filter)"
1094 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1095 play_cmdline_objs="$play_cmdline_objs add_cmdline(resample_filter)"
1096 filter_ldflags="$filter_ldflags $samplerate_libs -lsamplerate"
1097 audiod_ldflags="$audiod_ldflags $samplerate_libs -lsamplerate"
1098 play_ldflags="$play_ldflags $samplerate_libs -lsamplerate"
1099 filters="$filters resample"
1100 AC_SUBST(samplerate_cppflags)
1102 AC_MSG_WARN([no resample support in para_audiod/para_filter])
1104 CPPFLAGS="$OLD_CPPFLAGS"
1105 LDFLAGS="$OLD_LDFLAGS"
1107 ######################################################################### server
1108 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
1109 -a "$have_osl" = "yes" ; then
1112 executables="$executables server"
1113 server_cmdline_objs="add_cmdline(server)"
1114 server_errlist_objs="$server_errlist_objs
1153 server_ldflags="$server_ldflags $osl_libs -losl"
1157 ############################################################# client
1158 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1160 executables="$executables client"
1161 client_cmdline_objs="add_cmdline(client)"
1162 client_errlist_objs="$client_errlist_objs
1181 ############################################################# error2.h
1182 AC_MSG_NOTICE(creating error2.h)
1184 # these are always built
1187 $filter_errlist_objs
1188 $audioc_errlist_objs
1191 $audiod_errlist_objs
1195 # optional executables
1196 if test "$build_server" = "yes"; then
1197 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1199 if test "$build_gui" = "yes"; then
1200 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1202 if test "$build_fade" = "yes"; then
1203 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1205 if test "$build_client" = "yes"; then
1206 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1209 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1211 for i in $executables; do
1213 eval echo \$${i}_errlist_objs
1214 done | ./error2.pl > error2.h
1215 for obj in $all_errlist_objs; do
1216 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1218 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1219 [enum {$SS NUM_SS}],
1220 [list of all objects that use the paraslash error facility]
1223 ################################################################## status items
1225 status_items="basename status num_played mtime bitrate frequency file_size
1226 status_flags format score techinfo afs_mode
1227 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1228 offset seconds_total stream_start current_time audiod_uptime image_id
1229 lyrics_id duration directory lyrics_name image_name path hash channels
1230 last_played num_chunks chunk_time amplification artist title year album
1234 for i in $status_items; do
1235 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1237 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1238 [enum of all status items])
1241 for i in $status_items; do
1242 result="$result \"$i\", "
1244 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1245 [char * array of all status items])
1247 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1248 [formats supported by para_server and para_afh])
1250 AC_SUBST(executables)
1252 recv_objs="$recv_cmdline_objs $recv_errlist_objs"
1253 filter_objs="$filter_cmdline_objs $filter_errlist_objs"
1254 audiod_objs="$audiod_cmdline_objs $audiod_errlist_objs"
1255 server_objs="$server_cmdline_objs $server_errlist_objs"
1256 write_objs="$write_cmdline_objs $write_errlist_objs"
1257 client_objs="$client_cmdline_objs $client_errlist_objs"
1258 audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
1259 afh_objs="$afh_cmdline_objs $afh_errlist_objs"
1260 play_objs="$play_cmdline_objs $play_errlist_objs"
1263 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1264 AC_SUBST(recv_ldflags, $recv_ldflags)
1265 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1266 errors used by para_recv)
1268 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1269 AC_SUBST(filter_ldflags, $filter_ldflags)
1270 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1271 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1273 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1274 AC_SUBST(audiod_ldflags, $audiod_ldflags)
1275 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1276 errors used by para_audiod)
1278 AC_SUBST(server_objs, add_dot_o($server_objs))
1279 AC_SUBST(server_ldflags, $server_ldflags)
1280 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
1281 objlist_to_errlist($server_errlist_objs), errors used by para_server)
1283 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1284 AC_SUBST(afh_ldflags, $afh_ldflags)
1285 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1286 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1288 AC_SUBST(write_objs, add_dot_o($write_objs))
1289 AC_SUBST(write_ldflags, $write_ldflags)
1290 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1291 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1293 AC_SUBST(client_objs, add_dot_o($client_objs))
1294 AC_SUBST(client_ldflags, $client_ldflags)
1295 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
1296 objlist_to_errlist($client_errlist_objs), errors used by para_client)
1298 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1299 AC_SUBST(audioc_ldflags, $audioc_ldflags)
1300 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1301 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1303 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1304 AC_SUBST(gui_ldflags, $gui_ldflags)
1305 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1306 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1308 AC_SUBST(play_objs, add_dot_o($play_objs))
1309 AC_SUBST(play_ldflags, $play_ldflags)
1310 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1311 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1313 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1314 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1315 enum of supported filters)
1316 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1317 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1318 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1319 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1321 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1322 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1323 enum of supported writers)
1324 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1325 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1326 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1327 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1328 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1329 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1330 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1332 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1333 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1334 enum of audio formats supported by audiod)
1335 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1336 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1340 paraslash configuration:
1341 ~~~~~~~~~~~~~~~~~~~~~~~~
1342 unix socket credentials: $have_ucred
1343 readline (interactive CLIs): $have_readline
1344 audio formats handlers: $audio_format_handlers
1345 id3 version2 support: $have_libid3tag
1350 para_server: $build_server
1351 para_gui: $build_gui
1352 para_fade: $build_fade
1353 para_client: $build_client