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])
36 AC_PATH_PROG([install], [install])
37 test -z "$install" && AC_MSG_ERROR(
38 [The install program is required to build this package])
47 AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h \
48 stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h sys/un.h \
49 sys/ipc.h unistd.h utime.h stddef.h],
50 [], [AC_MSG_ERROR([$ac_header not found])])
52 # Checks for typedefs, structures, and compiler characteristics.
72 # Checks for library functions.
74 AC_PROG_GCC_TRADITIONAL
78 AC_FUNC_SELECT_ARGTYPES
85 AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \
86 regcomp select strchr strdup strerror strstr strtol uname \
87 fchdir gettimeofday localtime_r munmap strcasecmp strcspn \
88 strncasecmp strrchr strspn alarm mkdir inet_ntoa socket], [],
89 [AC_MSG_ERROR([function not found, cannot live without it])])
91 AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
94 executables="recv filter audioc write afh play"
95 audio_format_handlers="mp3 wma"
97 recv_cmdline_objs="add_cmdline(recv http_recv dccp_recv udp_recv afh_recv)"
100 http_recv recv_common recv time string net dccp_recv fd
101 sched stdout ggo udp_recv buffer_tree afh_recv afh_common
102 wma_afh wma_common mp3_afh version
107 filter_cmdline_objs="add_cmdline(filter compress_filter amp_filter prebuffer_filter)"
108 filter_errlist_objs="filter_common wav_filter compress_filter filter string
109 stdin stdout sched fd amp_filter ggo fecdec_filter fec version
110 prebuffer_filter time bitstream imdct wma_common wmadec_filter buffer_tree"
112 filters=" compress wav amp fecdec wmadec prebuffer"
114 audioc_cmdline_objs="add_cmdline(audioc)"
115 audioc_errlist_objs="
125 afh_cmdline_objs="add_cmdline(afh)"
126 afh_errlist_objs="afh string fd mp3_afh afh_common time wma_afh wma_common
130 write_cmdline_objs="add_cmdline(write file_write)"
131 write_errlist_objs="write write_common file_write time fd string sched stdin
132 buffer_tree ggo check_wav version"
135 default_writer="FILE_WRITE"
137 gui_cmdline_objs="add_cmdline(gui)"
151 gui_objs="$gui_cmdline_objs $gui_errlist_objs"
152 play_errlist_objs="play fd sched ggo buffer_tree time string net
154 wma_afh wma_common mp3_afh
155 recv_common udp_recv http_recv dccp_recv
156 filter_common fec bitstream imdct
157 wav_filter compress_filter amp_filter prebuffer_filter fecdec_filter
159 write_common file_write
162 play_cmdline_objs="add_cmdline(http_recv dccp_recv udp_recv afh_recv compress_filter amp_filter prebuffer_filter file_write play)"
164 ################################################################## clock_gettime
166 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
167 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
169 if test -n "$clock_gettime_lib"; then
170 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
171 define to 1 if clock_gettime() is supported])
173 if test "$clock_gettime_lib" = "rt"; then
174 AC_SUBST(clock_gettime_ldflags, -lrt)
176 ########################################################################### osl
178 OLD_CPPFLAGS="$CPPFLAGS"
179 OLD_LDFLAGS="$LDFLAGS"
181 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
182 [look for osl.h also in dir])])
183 if test -n "$with_osl_headers"; then
184 osl_cppflags="-I$with_osl_headers"
185 CPPFLAGS="$CPPFLAGS $osl_cppflags"
187 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
188 [look for libosl also in dir])])
189 if test -n "$with_osl_libs"; then
190 osl_libs="-L$with_osl_libs"
191 LDFLAGS="$LDFLAGS $osl_libs"
194 AC_CHECK_HEADER(osl.h, [], have_osl=no)
195 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
196 if test "$have_osl" = "no"; then
197 AC_MSG_WARN([libosl not found, can not build para_server.
199 http://systemlinux.org/~maan/osl
201 git clone git://git.tuebingen.mpg.de/osl
204 AC_SUBST(osl_cppflags)
205 CPPFLAGS="$OLD_CPPFLAGS"
206 LDFLAGS="$OLD_LDFLAGS"
208 ########################################################################### crypto
209 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
210 Force using crypto library "lib". This package requires either
211 openssl or libgcrypt being installed. Possible values for "lib"
212 are thus "openssl" and "gcrypt". If this option is not given,
213 openssl is tried first. If openssl was not found, gcrypt is
216 case "$enable_cryptolib" in
217 "openssl") check_openssl="yes"; check_gcrypt="no";;
218 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
219 "") check_openssl="yes"; check_gcrypt="yes";;
220 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
222 ###################################################################### openssl
223 if test "$check_openssl" = "yes"; then
224 OLD_CPPFLAGS="$CPPFLAGS"
225 OLD_LDFLAGS="$LDFLAGS"
228 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
229 [look for openssl headers also in dir])])
230 if test -n "$with_openssl_headers"; then
231 openssl_cppflags="-I$with_openssl_headers"
232 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
234 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
235 [look for openssl libraries also in dir])])
236 if test -n "$with_openssl_libs"; then
237 openssl_libs="-L$with_openssl_libs"
238 LDFLAGS="$LDFLAGS $openssl_libs"
240 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
241 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
242 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
243 # try harder: openssl is sometimes installed in /usr/local/ssl
244 openssl_cppflags="-I/usr/local/ssl/include"
245 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
246 openssl_libs="-L/usr/local/ssl/lib"
247 LDFLAGS="$LDFLAGS $openssl_libs"
249 unset ac_cv_header_openssl_ssl_h 2> /dev/null
250 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
251 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
252 if test "$have_openssl" = "yes"; then
253 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
256 if test "$have_openssl" = "yes"; then
257 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
258 AC_SUBST(openssl_cppflags)
259 openssl_libs="$openssl_libs -lssl -lcrypto"
260 server_ldflags="$server_ldflags $openssl_libs"
261 client_ldflags="$client_ldflags $openssl_libs"
262 audiod_ldflags="$audiod_ldflags $openssl_libs"
264 server_errlist_objs="$server_errlist_objs crypt"
265 client_errlist_objs="$client_errlist_objs crypt"
266 audiod_errlist_objs="$audiod_errlist_objs crypt"
270 AC_MSG_WARN([openssl libraries not found])
272 CPPFLAGS="$OLD_CPPFLAGS"
273 LDFLAGS="$OLD_LDFLAGS"
278 ########################################################################### gcrypt
279 if test "$check_gcrypt" = "yes"; then
280 OLD_CPPFLAGS="$CPPFLAGS"
281 OLD_LDFLAGS="$LDFLAGS"
284 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
285 [look for gcrypt headers also in dir])])
286 if test -n "$with_gcrypt_headers"; then
287 gcrypt_cppflags="-I$with_gcrypt_headers"
288 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
290 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
291 [look for libgcrypt also in dir])])
292 if test -n "$with_gcrypt_libs"; then
293 gcrypt_libs="-L$with_gcrypt_libs"
294 LDFLAGS="$LDFLAGS $gcrypt_libs"
296 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
297 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
298 if test "$have_gcrypt" = "yes"; then
299 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
300 AC_SUBST(gcrypt_cppflags)
301 gcrypt_libs="$gcrypt_libs -lgcrypt"
302 server_ldflags="$server_ldflags $gcrypt_libs"
303 client_ldflags="$client_ldflags $gcrypt_libs"
304 audiod_ldflags="$audiod_ldflags $gcrypt_libs"
306 server_errlist_objs="$server_errlist_objs gcrypt"
307 client_errlist_objs="$client_errlist_objs gcrypt"
308 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
310 AC_MSG_WARN([gcrypt library not found])
312 CPPFLAGS="$OLD_CPPFLAGS"
313 LDFLAGS="$OLD_LDFLAGS"
318 ########################################################################### libsocket
319 AC_CHECK_LIB([c], [socket],
321 [socket_lib="-lsocket"]
323 server_ldflags="$server_ldflags $socket_lib"
324 client_ldflags="$client_ldflags $socket_lib"
325 audioc_ldflags="$audioc_ldflags $socket_lib"
326 audiod_ldflags="$audiod_ldflags $socket_lib"
327 recv_ldflags="$recv_ldflags $socket_lib"
328 AC_SEARCH_LIBS([connect],[socket],[],[
329 AC_MSG_ERROR([Fatal: Did not find connect().])
331 ########################################################################### libnsl
332 AC_CHECK_LIB([c], [gethostbyname],
336 server_ldflags="$server_ldflags $nsl_lib"
337 client_ldflags="$client_ldflags $nsl_lib"
338 audioc_ldflags="$audioc_ldflags $nsl_lib"
339 recv_ldflags="$recv_ldflags $nsl_lib"
340 AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[
341 AC_MSG_ERROR([Fatal: Did not find inet_ntoa().])
343 ########################################################################### ucred
344 AC_MSG_CHECKING(for struct ucred)
345 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
347 #include <sys/types.h>
348 #include <sys/socket.h>
350 struct ucred sucred; sucred.pid=0;
351 ]])],[have_ucred=yes],[have_ucred=no])
352 AC_MSG_RESULT($have_ucred)
353 if test ${have_ucred} = yes; then
354 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
356 ########################################################################### gengetopt
357 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
359 [gengetopt_args_info_description],
360 [ggo_descriptions_declared=yes],
361 [ggo_descriptions_declared=no],
362 [#include "conftest-ggo.h"]
364 AC_SUBST(ggo_descriptions_declared)
365 ########################################################################### curses
367 OLD_CPPFLAGS="$CPPFLAGS"
368 OLD_LDFLAGS="$LDFLAGS"
370 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
371 [look for curses.h also in dir])])
372 if test -n "$with_curses_headers"; then
373 curses_cppflags="-I$with_curses_headers"
374 CPPFLAGS="$CPPFLAGS $curses_cppflags"
376 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
377 [look for libcurses also in dir])])
378 if test -n "$with_curses_libs"; then
379 curses_libs="-L$with_curses_libs"
380 LDFLAGS="$LDFLAGS $curses_libs"
382 AC_CHECK_HEADER(curses.h, [], [
385 gui_ldflags="$curses_libs"
386 AC_CHECK_LIB([ncursesw], [initscr],
387 [gui_ldflags="$curses_libs -lncursesw"], [
388 AC_CHECK_LIB([curses], [initscr],
389 [gui_ldflags="$curses_libs -lcurses"],
394 if test "$have_curses" = "yes"; then
395 AC_SUBST(curses_cppflags)
397 executables="$executables gui"
400 AC_MSG_WARN([no curses lib, cannot build para_gui])
402 CPPFLAGS="$OLD_CPPFLAGS"
403 LDFLAGS="$OLD_LDFLAGS"
406 ########################################################################### ip_mreqn
407 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
408 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
414 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
415 AC_MSG_RESULT($have_ip_mreqn)
416 if test ${have_ip_mreqn} = yes; then
417 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
419 ########################################################################### osx
421 AC_MSG_CHECKING(for CoreAudio (MacOs))
422 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
423 #include <CoreAudio/CoreAudio.h>
426 ]])],[have_core_audio=yes],[have_core_audio=no])
427 AC_MSG_RESULT($have_core_audio)
428 if test ${have_core_audio} = yes; then
429 f1="-framework CoreAudio"
430 f2="-framework AudioToolbox"
431 f3="-framework AudioUnit"
432 f4="-framework CoreServices"
435 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
436 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
437 audiod_ldflags="$audiod_ldflags $f"
439 play_errlist_objs="$play_errlist_objs osx_write ipc"
440 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
441 play_ldflags="$play_ldflags $f"
443 write_errlist_objs="$write_errlist_objs osx_write ipc"
444 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
445 write_ldflags="$write_ldflags $f"
446 writers="$writers osx"
447 default_writer="OSX_WRITE"
448 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
450 ####################################################### ogg/vorbis/speex/opus
452 OLD_CPPFLAGS="$CPPFLAGS"
453 OLD_LDFLAGS="$LDFLAGS"
455 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
456 [look for ogg headers also in dir])])
457 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
458 [look for ogg libs also in dir])])
459 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
460 [look for vorbis headers also in dir])])
461 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
462 [look for vorbis libs also in dir])])
463 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
464 [look for speex headers also in dir])])
465 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
466 [look for speex libs also in dir])])
467 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
468 [look for opus headers also in dir])])
469 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
470 [look for opus libs also in dir])])
472 if test -n "$with_ogg_headers"; then
473 ogg_cppflags="-I$with_ogg_headers"
474 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
476 if test -n "$with_ogg_libs"; then
477 ogg_libs="-L$with_ogg_libs"
478 LDFLAGS="$LDFLAGS $ogg_libs"
480 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
481 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
486 if test "$have_ogg" = "yes"; then
488 if test -n "$with_vorbis_headers"; then
489 vorbis_cppflags="-I$with_vorbis_headers"
490 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
492 if test -n "$with_vorbis_libs"; then
493 vorbis_libs="-L$with_vorbis_libs"
494 LDFLAGS="$LDFLAGS $vorbis_libs"
496 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
497 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
500 if test -n "$with_speex_headers"; then
501 speex_cppflags="-I$with_speex_headers"
502 CPPFLAGS="$CPPFLAGS $speex_cppflags"
504 if test -n "$with_speex_libs"; then
505 speex_libs="-L$with_speex_libs"
506 LDFLAGS="$LDFLAGS $speex_libs"
508 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
509 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
512 if test -n "$with_opus_headers"; then
513 opus_cppflags="-I$with_opus_headers"
514 CPPFLAGS="$CPPFLAGS $opus_cppflags"
516 if test -n "$with_opus_libs"; then
517 opus_libs="-L$with_opus_libs"
518 LDFLAGS="$LDFLAGS $opus_libs"
520 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
521 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
523 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
529 msg="support in para_server/para_filter/para_afh"
530 if test "$have_vorbis" = "yes" || \
531 test "$have_speex" = "yes" || \
532 test "$have_opus" = "yes"; then
533 AC_SUBST(ogg_cppflags)
534 ogg_libs="$ogg_libs -logg"
535 if test "$OSTYPE" = "Darwin"; then
536 ogg_libs="-Wl,-bind_at_load $ogg_libs"
538 server_ldflags="$server_ldflags $ogg_libs"
539 filter_ldflags="$filter_ldflags $ogg_libs"
540 audiod_ldflags="$audiod_ldflags $ogg_libs"
541 play_ldflags="$play_ldflags $ogg_libs"
542 afh_ldflags="$afh_ldflags $ogg_libs"
543 recv_ldflags="$recv_ldflags $ogg_libs"
544 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
545 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
546 server_errlist_objs="$server_errlist_objs ogg_afh_common"
547 play_errlist_objs="$play_errlist_objs ogg_afh_common"
549 if test "$have_vorbis" = "yes"; then
550 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
551 filters="$filters oggdec"
552 vorbis_libs="-lvorbis -lvorbisfile"
553 server_ldflags="$server_ldflags $vorbis_libs"
554 filter_ldflags="$filter_ldflags $vorbis_libs"
555 audiod_ldflags="$audiod_ldflags $vorbis_libs"
556 play_ldflags="$play_ldflags $vorbis_libs"
557 afh_ldflags="$afh_ldflags $vorbis_libs"
558 recv_ldflags="$recv_ldflags $vorbis_libs"
560 server_errlist_objs="$server_errlist_objs ogg_afh"
561 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
562 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
563 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
564 afh_errlist_objs="$afh_errlist_objs ogg_afh"
565 recv_errlist_objs="$recv_errlist_objs ogg_afh"
567 audiod_audio_formats="$audiod_audio_formats ogg"
568 audio_format_handlers="$audio_format_handlers ogg"
570 AC_MSG_WARN([no ogg/vorbis $msg])
572 if test "$have_speex" = "yes"; then
573 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
574 filters="$filters spxdec"
576 server_ldflags="$server_ldflags $speex_libs"
577 filter_ldflags="$filter_ldflags $speex_libs"
578 audiod_ldflags="$audiod_ldflags $speex_libs"
579 play_ldflags="$play_ldflags $speex_libs"
580 afh_ldflags="$afh_ldflags $speex_libs"
581 recv_ldflags="$recv_ldflags $speex_libs"
583 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
584 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
585 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
586 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
587 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
588 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
590 audiod_audio_formats="$audiod_audio_formats spx"
591 audio_format_handlers="$audio_format_handlers spx"
593 AC_MSG_WARN([no ogg/speex $msg])
595 if test "$have_opus" = "yes"; then
596 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
597 filters="$filters opusdec"
599 server_ldflags="$server_ldflags $opus_libs"
600 filter_ldflags="$filter_ldflags $opus_libs"
601 audiod_ldflags="$audiod_ldflags $opus_libs"
602 afh_ldflags="$afh_ldflags $opus_libs"
603 play_ldflags="$play_ldflags $opus_libs"
604 recv_ldflags="$recv_ldflags $opus_libs"
606 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
607 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
608 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
609 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
610 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
611 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
613 audiod_audio_formats="$audiod_audio_formats opus"
614 audio_format_handlers="$audio_format_handlers opus"
616 AC_MSG_WARN([no ogg/opus $msg])
618 CPPFLAGS="$OLD_CPPFLAGS"
619 LDFLAGS="$OLD_LDFLAGS"
621 ########################################################################### faad
623 OLD_CPPFLAGS="$CPPFLAGS"
624 OLD_LDFLAGS="$LDFLAGS"
626 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
627 [look for neaacdec.h also in dir])])
628 if test -n "$with_faad_headers"; then
629 faad_cppflags="-I$with_faad_headers"
630 CPPFLAGS="$CPPFLAGS $faad_cppflags"
632 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
633 [look for libfaad also in dir])])
634 if test -n "$with_faad_libs"; then
635 faad_libs="-L$with_faad_libs"
636 LDFLAGS="$LDFLAGS $faad_libs"
638 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
639 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
640 if test "$have_faad" = "yes"; then
641 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
642 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
643 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
644 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
645 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
646 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
647 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
649 server_ldflags="$server_ldflags $faad_libs -lfaad"
650 filter_ldflags="$filter_ldflags $faad_libs -lfaad"
651 audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
652 play_ldflags="$play_ldflags $faad_libs -lfaad"
653 afh_ldflags="$afh_ldflags $faad_libs -lfaad"
654 recv_ldflags="$afh_ldflags $faad_libs -lfaad"
656 audiod_audio_formats="$audiod_audio_formats aac"
657 audio_format_handlers="$audio_format_handlers aac"
658 filters="$filters aacdec"
659 AC_SUBST(faad_cppflags)
661 AC_MSG_WARN([no aac support in para_audiod/para_filter])
663 CPPFLAGS="$OLD_CPPFLAGS"
664 LDFLAGS="$OLD_LDFLAGS"
666 ########################################################################### mad
668 OLD_CPPFLAGS="$CPPFLAGS"
669 OLD_LDFLAGS="$LDFLAGS"
672 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
673 [look for mad.h also in dir])])
674 if test -n "$with_mad_headers"; then
675 mad_cppflags="-I$with_mad_headers"
676 CPPFLAGS="$CPPFLAGS $mad_cppflags"
678 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
679 [look for libmad also in dir])])
680 if test -n "$with_mad_libs"; then
681 mad_libs="-L$with_mad_libs"
682 LDFLAGS="$LDFLAGS $mad_libs"
684 AC_CHECK_HEADERS([mad.h], [], [
687 AC_CHECK_LIB([mad], [mad_stream_init], [], [
690 if test "$have_mad" = "yes"; then
691 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
692 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(mp3dec_filter)"
693 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(mp3dec_filter)"
694 play_cmdline_objs="$play_cmdline_objs add_cmdline(mp3dec_filter)"
695 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
696 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
697 play_errlist_objs="$play_errlist_objs mp3dec_filter"
698 filter_ldflags="$filter_ldflags $mad_libs -lmad"
699 audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
700 play_ldflags="$play_ldflags $mad_libs -lmad"
701 audiod_audio_formats="$audiod_audio_formats mp3"
702 filters="$filters mp3dec"
703 AC_SUBST(mad_cppflags)
705 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
707 CPPFLAGS="$OLD_CPPFLAGS"
708 LDFLAGS="$OLD_LDFLAGS"
710 ###################################################################### libid3tag
711 OLD_CPPFLAGS="$CPPFLAGS"
712 OLD_LDFLAGS="$LDFLAGS"
716 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
717 [look for id3tag header files also in dir])])
718 if test -n "$with_id3tag_headers"; then
719 id3tag_cppflags="-I$with_id3tag_headers"
720 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
722 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
723 [look for id3tag libs also in dir])])
724 if test -n "$with_id3tag_libs"; then
725 id3tag_libs="-L$with_id3tag_libs"
726 LDFLAGS="$LDFLAGS $id3tag_libs"
729 AC_MSG_CHECKING(for libid3tag)
730 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
733 struct id3_tag t = {.flags = 0};
734 ]])],[],[have_libid3tag=no])
735 AC_MSG_RESULT($have_libid3tag)
737 if test ${have_libid3tag} = yes; then
738 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
739 server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
740 afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
741 play_ldflags="$play_ldflags -lz"
742 recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
743 play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
744 AC_SUBST(id3tag_cppflags)
746 AC_MSG_WARN([no support for id3v2 tags])
748 CPPFLAGS="$OLD_CPPFLAGS"
749 LDFLAGS="$OLD_LDFLAGS"
751 ########################################################################### flac
752 OLD_CPPFLAGS="$CPPFLAGS"
753 OLD_LDFLAGS="$LDFLAGS"
757 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
758 [look for flac headers also in dir])])
759 if test -n "$with_flac_headers"; then
760 flac_cppflags="-I$with_flac_headers"
761 CPPFLAGS="$CPPFLAGS $flac_cppflags"
763 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
764 [look for flac libs also in dir])])
765 if test -n "$with_flac_libs"; then
766 flac_libs="-L$with_flac_libs"
767 LDFLAGS="$LDFLAGS $flac_libs"
769 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
770 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
771 if test "$have_flac" = "yes"; then
772 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
773 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
774 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
775 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
776 afh_errlist_objs="$afh_errlist_objs flac_afh"
777 server_errlist_objs="$server_errlist_objs flac_afh"
778 recv_errlist_objs="$recv_errlist_objs flac_afh"
779 filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
780 audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
781 play_ldflags="$play_ldflags $flac_libs -lFLAC"
782 server_ldflags="$server_ldflags $flac_libs -lFLAC"
783 afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
784 recv_ldflags="$recv_ldflags $flac_libs -lFLAC"
785 filters="$filters flacdec"
786 audio_format_handlers="$audio_format_handlers flac"
787 audiod_audio_formats="$audiod_audio_formats flac"
788 AC_SUBST(flac_cppflags)
790 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
792 CPPFLAGS="$OLD_CPPFLAGS"
793 LDFLAGS="$OLD_LDFLAGS"
795 ########################################################################### oss
796 OLD_CPPFLAGS="$CPPFLAGS"
797 OLD_LDFLAGS="$LDFLAGS"
801 msg="=> will not build oss writer"
803 AC_CHECK_HEADER(sys/soundcard.h, [
804 audiod_errlist_objs="$audiod_errlist_objs oss_write"
805 play_errlist_objs="$play_errlist_objs oss_write"
806 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"
807 play_cmdline_objs="$play_cmdline_objs add_cmdline(oss_write)"
809 write_errlist_objs="$write_errlist_objs oss_write"
810 write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
811 fade_errlist_objs="$fade_errlist_objs oss_mix"
813 writers="$writers oss"
814 default_writer="OSS_WRITE"
815 mixers="${mixers}oss "
816 default_mixer="OSS_MIX"
818 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
819 audiod_ldflags="$audiod_ldflags -lossaudio"
820 play_ldflags="$play_ldflags -lossaudio"
821 write_ldflags="$write_ldflags -lossaudio"
822 fade_ldflags="$fade_ldflags -lossaudio"
828 AC_MSG_WARN([no sys/soundcard.h $msg])
831 CPPFLAGS="$OLD_CPPFLAGS"
832 LDFLAGS="$OLD_LDFLAGS"
835 ########################################################################### alsa
836 OLD_CPPFLAGS="$CPPFLAGS"
837 OLD_LDFLAGS="$LDFLAGS"
840 msg="=> no alsa support for para_audiod/para_write"
841 if test "$OSTYPE" != "Linux"; then
846 if test "$have_alsa" = "yes"; then
847 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
849 AC_MSG_WARN([no alsa/asoundlib $msg])
853 if test "$have_alsa" = "yes"; then
854 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
856 AC_MSG_WARN([no libasound $msg])
860 if test "$have_alsa" = "yes"; then
861 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
862 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(alsa_write)"
863 audiod_ldflags="$audiod_ldflags -lasound"
864 play_errlist_objs="$play_errlist_objs alsa_write"
865 play_cmdline_objs="$play_cmdline_objs add_cmdline(alsa_write)"
866 play_ldflags="$play_ldflags -lasound"
868 write_errlist_objs="$write_errlist_objs alsa_write"
869 write_cmdline_objs="$write_cmdline_objs add_cmdline(alsa_write)"
870 write_ldflags="$write_ldflags -lasound"
871 fade_errlist_objs="$fade_errlist_objs alsa_mix"
872 fade_ldflags="$fade_ldflags -lasound"
874 writers="$writers alsa"
875 default_writer="ALSA_WRITE"
876 mixers="${mixers}alsa "
877 default_mixer="ALSA_MIX"
880 CPPFLAGS="$OLD_CPPFLAGS"
881 LDFLAGS="$OLD_LDFLAGS"
883 ########################################################################### fade
884 if test -n "$mixers"; then
886 executables="$executables fade"
887 fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
888 fade_cmdline_objs="add_cmdline(fade)"
889 fade_objs="$fade_cmdline_objs $fade_errlist_objs"
890 AC_SUBST(fade_objs, add_dot_o($fade_objs))
891 AC_SUBST(fade_ldflags, $fade_ldflags)
892 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
893 objlist_to_errlist($fade_errlist_objs),
894 errors used by para_fade)
897 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
900 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
901 enum of supported mixers)
902 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
903 use this mixer if none was specified)
904 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
905 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
908 printf 'extern void '$i'_mix_init(struct mixer *); '
911 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
912 init functions of the supported mixers)
913 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
914 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
915 mixer_summary="supported mixers:: $mixers, default: $default_mixer"
918 AC_MSG_WARN([no mixer support])
919 mixer_summary="para_fade: no"
921 ########################################################################### libao
922 OLD_CPPFLAGS="$CPPFLAGS"
923 OLD_LDFLAGS="$LDFLAGS"
927 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
928 [look for ao/ao.h also in dir])])
929 if test -n "$with_ao_headers"; then
930 ao_cppflags="-I$with_ao_headers"
931 CPPFLAGS="$CPPFLAGS $ao_cppflags"
933 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
934 [look for libao also in dir])])
935 if test -n "$with_ao_libs"; then
936 ao_libs="-L$with_ao_libs"
937 LDFLAGS="$LDFLAGS $ao_libs"
939 msg="no libao support for para_audiod/para_write"
940 AC_CHECK_HEADERS([ao/ao.h], [
943 AC_MSG_WARN([ao.h not found, $msg])
945 if test "$have_ao" = "yes"; then
946 AC_CHECK_LIB([ao], [ao_initialize], [], [
948 AC_MSG_WARN([ao lib not found or not working, $msg])
951 if test "$have_ao" = "yes"; then
952 AC_CHECK_HEADERS([pthread.h], [
955 AC_MSG_WARN([pthread.h not found, $msg])
958 if test "$have_ao" = "yes"; then
959 AC_CHECK_LIB([pthread], [pthread_create], [], [
961 AC_MSG_WARN([pthread lib not found or not working, $msg])
964 if test "$have_ao" = "yes"; then
965 audiod_errlist_objs="$audiod_errlist_objs ao_write"
966 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(ao_write)"
967 audiod_ldflags="$audiod_ldflags -lao -lpthread"
969 play_errlist_objs="$play_errlist_objs ao_write"
970 play_cmdline_objs="$play_cmdline_objs add_cmdline(ao_write)"
971 play_ldflags="$play_ldflags -lao -lpthread"
973 write_errlist_objs="$write_errlist_objs ao_write"
974 write_cmdline_objs="$write_cmdline_objs add_cmdline(ao_write)"
975 write_ldflags="$write_ldflags $ao_libs -lao -lpthread"
976 writers="$writers ao"
977 AC_SUBST(ao_cppflags)
980 CPPFLAGS="$OLD_CPPFLAGS"
981 LDFLAGS="$OLD_LDFLAGS"
983 ############################################################# readline
984 OLD_CPPFLAGS="$CPPFLAGS"
985 OLD_LDFLAGS="$LDFLAGS"
989 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
990 [look for libreadline header files also in dir])])
991 if test -n "$with_readline_headers"; then
992 readline_cppflags="-I$with_readline_headers"
993 CPPFLAGS="$CPPFLAGS $readline_cppflags"
996 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
997 [look for readline library also in dir])])
998 if test -n "$with_readline_libs"; then
999 readline_libs="-L$with_readline_libs"
1000 LDFLAGS="$LDFLAGS $readline_libs"
1002 msg="no interactive cli support"
1003 AC_CHECK_HEADERS([readline/readline.h], [
1006 AC_MSG_WARN([readline/readline.h not found, $msg])
1009 if test "$have_curses" != "yes"; then
1011 AC_MSG_WARN([interactive cli support depends on curses,])
1012 AC_MSG_WARN([but no curses lib was detected, $msg])
1015 if test "$have_readline" = "yes"; then
1016 readline_libs="$readline_libs -lreadline"
1017 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
1018 if test "$have_readline" = "no"; then # try with -lcurses
1020 AC_MSG_NOTICE([trying again with -lcurses])
1021 unset ac_cv_search_rl_free_keymap 2> /dev/null
1022 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1024 readline_libs="$readline_libs -lcurses"
1027 if test "$have_readline" = "no"; then # try with -ltermcap
1029 AC_MSG_NOTICE([trying again with -ltermcap])
1030 unset ac_cv_search_rl_free_keymap 2> /dev/null
1031 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
1033 readline_libs="$readline_libs -ltermcap"
1038 if test "$have_readline" = "yes"; then
1039 client_errlist_objs="$client_errlist_objs interactive"
1040 client_ldflags="$client_ldflags $readline_libs"
1041 audioc_errlist_objs="$audioc_errlist_objs buffer_tree interactive sched time"
1042 audioc_ldflags="$audioc_ldflags $readline_libs"
1043 play_errlist_objs="$play_errlist_objs interactive"
1044 play_ldflags="$play_ldflags $readline_libs"
1045 AC_SUBST(readline_cppflags)
1046 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
1048 AC_MSG_WARN([libreadline not found or unusable])
1050 CPPFLAGS="$OLD_CPPFLAGS"
1051 LDFLAGS="$OLD_LDFLAGS"
1053 ############################################################# libsamplerate
1054 OLD_CPPFLAGS="$CPPFLAGS"
1055 OLD_LDFLAGS="$LDFLAGS"
1058 have_samplerate="yes"
1059 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
1060 [look for samplerate headers also in dir])])
1061 if test -n "$with_samplerate_headers"; then
1062 samplerate_cppflags="-I$with_samplerate_headers"
1063 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
1065 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
1066 [look for samplerate libs also in dir])])
1067 if test -n "$with_samplerate_libs"; then
1068 samplerate_libs="-L$with_samplerate_libs"
1069 LDFLAGS="$LDFLAGS $samplerate_libs"
1072 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
1073 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
1075 if test "$have_samplerate" = "yes"; then
1076 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1077 filter_cmdline_objs="$filter_cmdline_objs add_cmdline(resample_filter)"
1078 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1079 audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(resample_filter)"
1080 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1081 play_cmdline_objs="$play_cmdline_objs add_cmdline(resample_filter)"
1082 filter_ldflags="$filter_ldflags $samplerate_libs -lsamplerate"
1083 audiod_ldflags="$audiod_ldflags $samplerate_libs -lsamplerate"
1084 play_ldflags="$play_ldflags $samplerate_libs -lsamplerate"
1085 filters="$filters resample"
1086 AC_SUBST(samplerate_cppflags)
1088 AC_MSG_WARN([no resample support in para_audiod/para_filter])
1090 CPPFLAGS="$OLD_CPPFLAGS"
1091 LDFLAGS="$OLD_LDFLAGS"
1093 ######################################################################### server
1094 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
1095 -a "$have_osl" = "yes" ; then
1098 executables="$executables server"
1099 server_cmdline_objs="add_cmdline(server)"
1100 server_errlist_objs="$server_errlist_objs
1139 server_ldflags="$server_ldflags $osl_libs -losl"
1143 ############################################################# client
1144 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1146 executables="$executables client"
1147 client_cmdline_objs="add_cmdline(client)"
1148 client_errlist_objs="$client_errlist_objs
1167 ############################################################# audiod
1168 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1170 executables="$executables audiod"
1171 audiod_cmdline_objs="$audiod_cmdline_objs
1172 add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
1173 audiod_errlist_objs="$audiod_errlist_objs
1210 audiod_ldflags="$audiod_ldflags -lm"
1211 audiod_audio_formats="$audiod_audio_formats wma"
1215 ############################################################# error2.h
1216 AC_MSG_NOTICE(creating error2.h)
1218 # these are always built
1221 $filter_errlist_objs
1222 $audioc_errlist_objs
1228 # optional executables
1229 if test "$build_server" = "yes"; then
1230 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1232 if test "$build_gui" = "yes"; then
1233 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1235 if test "$build_fade" = "yes"; then
1236 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1238 if test "$build_client" = "yes"; then
1239 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1241 if test "$build_audiod" = "yes"; then
1242 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1245 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1247 for i in $executables; do
1249 eval echo \$${i}_errlist_objs
1250 done | ./error2.pl > error2.h
1251 for obj in $all_errlist_objs; do
1252 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1254 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1255 [enum {$SS NUM_SS}],
1256 [list of all objects that use the paraslash error facility]
1259 ################################################################## status items
1261 status_items="basename status num_played mtime bitrate frequency file_size
1262 status_flags format score techinfo afs_mode
1263 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1264 offset seconds_total stream_start current_time audiod_uptime image_id
1265 lyrics_id duration directory lyrics_name image_name path hash channels
1266 last_played num_chunks chunk_time amplification artist title year album
1270 for i in $status_items; do
1271 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1273 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1274 [enum of all status items])
1277 for i in $status_items; do
1278 result="$result \"$i\", "
1280 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1281 [char * array of all status items])
1283 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1284 [formats supported by para_server and para_afh])
1286 AC_SUBST(executables)
1288 recv_objs="$recv_cmdline_objs $recv_errlist_objs"
1289 filter_objs="$filter_cmdline_objs $filter_errlist_objs"
1290 audiod_objs="$audiod_cmdline_objs $audiod_errlist_objs"
1291 server_objs="$server_cmdline_objs $server_errlist_objs"
1292 write_objs="$write_cmdline_objs $write_errlist_objs"
1293 client_objs="$client_cmdline_objs $client_errlist_objs"
1294 audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
1295 afh_objs="$afh_cmdline_objs $afh_errlist_objs"
1296 play_objs="$play_cmdline_objs $play_errlist_objs"
1299 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1300 AC_SUBST(recv_ldflags, $recv_ldflags)
1301 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1302 errors used by para_recv)
1304 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1305 AC_SUBST(filter_ldflags, $filter_ldflags)
1306 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1307 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1309 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1310 AC_SUBST(audiod_ldflags, $audiod_ldflags)
1311 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1312 errors used by para_audiod)
1314 AC_SUBST(server_objs, add_dot_o($server_objs))
1315 AC_SUBST(server_ldflags, $server_ldflags)
1316 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
1317 objlist_to_errlist($server_errlist_objs), errors used by para_server)
1319 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1320 AC_SUBST(afh_ldflags, $afh_ldflags)
1321 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1322 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1324 AC_SUBST(write_objs, add_dot_o($write_objs))
1325 AC_SUBST(write_ldflags, $write_ldflags)
1326 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1327 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1329 AC_SUBST(client_objs, add_dot_o($client_objs))
1330 AC_SUBST(client_ldflags, $client_ldflags)
1331 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
1332 objlist_to_errlist($client_errlist_objs), errors used by para_client)
1334 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1335 AC_SUBST(audioc_ldflags, $audioc_ldflags)
1336 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1337 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1339 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1340 AC_SUBST(gui_ldflags, $gui_ldflags)
1341 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1342 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1344 AC_SUBST(play_objs, add_dot_o($play_objs))
1345 AC_SUBST(play_ldflags, $play_ldflags)
1346 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1347 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1349 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1350 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1351 enum of supported filters)
1352 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1353 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1354 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1355 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1357 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1358 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1359 enum of supported writers)
1360 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1361 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1362 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1363 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1364 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1365 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1366 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1368 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1369 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1370 enum of audio formats supported by audiod)
1371 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1372 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1376 paraslash configuration:
1377 ~~~~~~~~~~~~~~~~~~~~~~~~
1378 unix socket credentials: $have_ucred
1379 readline (interactive CLIs): $have_readline
1380 audio formats handlers: $audio_format_handlers
1381 id3 version2 support: $have_libid3tag
1386 para_server: $build_server
1387 para_gui: $build_gui
1388 para_fade: $build_fade
1389 para_client: $build_client
1390 para_audiod: $build_audiod