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([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
12 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) }])
13 AC_PATH_PROG(UNAMEPATH, uname, no)
14 if test "$UNAMEPATH" = "no"; then
15 AC_MSG_ERROR(unable to determine system type)
17 AC_MSG_CHECKING(os type)
18 OSTYPE="`$UNAMEPATH -s`"
19 AC_MSG_RESULT("$OSTYPE")
21 if test "$OSTYPE" = "SunOS"; then
22 # needed on SunOS for socket magic
23 arch_cppflags="-D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
24 AC_SUBST(arch_cppflags)
29 AC_PATH_PROG([gengetopt], [gengetopt])
30 test -z "$gengetopt" && AC_MSG_ERROR(
31 [gengetopt is required to build this package])
33 AC_PATH_PROG([help2man], [help2man])
34 test -z "$help2man" && AC_MSG_ERROR(
35 [help2man is required to build this package])
37 AC_PATH_PROG([install], [install])
38 test -z "$install" && AC_MSG_ERROR(
39 [The install program is required to build this package])
48 AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h \
49 stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h sys/un.h \
50 sys/ipc.h unistd.h utime.h stddef.h],
51 [], [AC_MSG_ERROR([$ac_header not found])])
53 # Checks for typedefs, structures, and compiler characteristics.
73 # Checks for library functions.
75 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 executables="recv filter audioc write afh play"
93 audio_format_handlers="mp3 wma"
104 http_recv recv_common recv time string net dccp_recv fd
105 sched stdout ggo udp_recv buffer_tree afh_recv afh_common
106 wma_afh wma_common mp3_afh version
111 filter_cmdline_objs="
117 filter_errlist_objs="filter_common wav_filter compress_filter filter string
118 stdin stdout sched fd amp_filter ggo fecdec_filter fec version
119 prebuffer_filter time bitstream imdct wma_common wmadec_filter buffer_tree"
121 filters=" compress wav amp fecdec wmadec prebuffer"
123 audioc_cmdline_objs="audioc"
124 audioc_errlist_objs="
134 afh_cmdline_objs="afh"
135 afh_errlist_objs="afh string fd mp3_afh afh_common time wma_afh wma_common
139 write_cmdline_objs="write file_write"
140 write_errlist_objs="write write_common file_write time fd string sched stdin
141 buffer_tree ggo check_wav version"
144 default_writer="FILE_WRITE"
146 play_errlist_objs="play fd sched ggo buffer_tree time string net
148 wma_afh wma_common mp3_afh
149 recv_common udp_recv http_recv dccp_recv
150 filter_common fec bitstream imdct
151 wav_filter compress_filter amp_filter prebuffer_filter fecdec_filter
153 write_common file_write
168 ################################################################## clock_gettime
170 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
171 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
173 if test -n "$clock_gettime_lib"; then
174 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
175 define to 1 if clock_gettime() is supported])
177 if test "$clock_gettime_lib" = "rt"; then
178 AC_SUBST(clock_gettime_ldflags, -lrt)
180 ########################################################################### osl
182 OLD_CPPFLAGS="$CPPFLAGS"
183 OLD_LDFLAGS="$LDFLAGS"
185 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
186 [look for osl.h also in dir])])
187 if test -n "$with_osl_headers"; then
188 osl_cppflags="-I$with_osl_headers"
189 CPPFLAGS="$CPPFLAGS $osl_cppflags"
191 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
192 [look for libosl also in dir])])
193 if test -n "$with_osl_libs"; then
194 osl_libs="-L$with_osl_libs"
195 LDFLAGS="$LDFLAGS $osl_libs"
198 AC_CHECK_HEADER(osl.h, [], have_osl=no)
199 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
200 if test "$have_osl" = "no"; then
201 AC_MSG_WARN([libosl not found, can not build para_server.
203 http://systemlinux.org/~maan/osl
205 git clone git://git.tuebingen.mpg.de/osl
208 AC_SUBST(osl_cppflags)
209 CPPFLAGS="$OLD_CPPFLAGS"
210 LDFLAGS="$OLD_LDFLAGS"
212 ########################################################################### crypto
213 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
214 Force using crypto library "lib". This package requires either
215 openssl or libgcrypt being installed. Possible values for "lib"
216 are thus "openssl" and "gcrypt". If this option is not given,
217 openssl is tried first. If openssl was not found, gcrypt is
220 case "$enable_cryptolib" in
221 "openssl") check_openssl="yes"; check_gcrypt="no";;
222 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
223 "") check_openssl="yes"; check_gcrypt="yes";;
224 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
226 ###################################################################### openssl
227 if test "$check_openssl" = "yes"; then
228 OLD_CPPFLAGS="$CPPFLAGS"
229 OLD_LDFLAGS="$LDFLAGS"
232 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
233 [look for openssl headers also in dir])])
234 if test -n "$with_openssl_headers"; then
235 openssl_cppflags="-I$with_openssl_headers"
236 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
238 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
239 [look for openssl libraries also in dir])])
240 if test -n "$with_openssl_libs"; then
241 openssl_libs="-L$with_openssl_libs"
242 LDFLAGS="$LDFLAGS $openssl_libs"
244 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
245 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
246 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
247 # try harder: openssl is sometimes installed in /usr/local/ssl
248 openssl_cppflags="-I/usr/local/ssl/include"
249 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
250 openssl_libs="-L/usr/local/ssl/lib"
251 LDFLAGS="$LDFLAGS $openssl_libs"
253 unset ac_cv_header_openssl_ssl_h 2> /dev/null
254 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
255 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
256 if test "$have_openssl" = "yes"; then
257 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
260 if test "$have_openssl" = "yes"; then
261 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
262 AC_SUBST(openssl_cppflags)
263 openssl_libs="$openssl_libs -lssl -lcrypto"
264 server_ldflags="$server_ldflags $openssl_libs"
265 client_ldflags="$client_ldflags $openssl_libs"
266 audiod_ldflags="$audiod_ldflags $openssl_libs"
268 server_errlist_objs="$server_errlist_objs crypt"
269 client_errlist_objs="$client_errlist_objs crypt"
270 audiod_errlist_objs="$audiod_errlist_objs crypt"
274 AC_MSG_WARN([openssl libraries not found])
276 CPPFLAGS="$OLD_CPPFLAGS"
277 LDFLAGS="$OLD_LDFLAGS"
282 ########################################################################### gcrypt
283 if test "$check_gcrypt" = "yes"; then
284 OLD_CPPFLAGS="$CPPFLAGS"
285 OLD_LDFLAGS="$LDFLAGS"
288 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
289 [look for gcrypt headers also in dir])])
290 if test -n "$with_gcrypt_headers"; then
291 gcrypt_cppflags="-I$with_gcrypt_headers"
292 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
294 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
295 [look for libgcrypt also in dir])])
296 if test -n "$with_gcrypt_libs"; then
297 gcrypt_libs="-L$with_gcrypt_libs"
298 LDFLAGS="$LDFLAGS $gcrypt_libs"
300 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
301 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
302 if test "$have_gcrypt" = "yes"; then
303 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
304 AC_SUBST(gcrypt_cppflags)
305 gcrypt_libs="$gcrypt_libs -lgcrypt"
306 server_ldflags="$server_ldflags $gcrypt_libs"
307 client_ldflags="$client_ldflags $gcrypt_libs"
308 audiod_ldflags="$audiod_ldflags $gcrypt_libs"
310 server_errlist_objs="$server_errlist_objs gcrypt"
311 client_errlist_objs="$client_errlist_objs gcrypt"
312 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
314 AC_MSG_WARN([gcrypt library not found])
316 CPPFLAGS="$OLD_CPPFLAGS"
317 LDFLAGS="$OLD_LDFLAGS"
322 ########################################################################### libsocket
323 AC_CHECK_LIB([c], [socket],
325 [socket_lib="-lsocket"]
327 server_ldflags="$server_ldflags $socket_lib"
328 client_ldflags="$client_ldflags $socket_lib"
329 audioc_ldflags="$audioc_ldflags $socket_lib"
330 audiod_ldflags="$audiod_ldflags $socket_lib"
331 recv_ldflags="$recv_ldflags $socket_lib"
332 AC_SEARCH_LIBS([connect],[socket],[],[
333 AC_MSG_ERROR([Fatal: Did not find connect().])
335 ########################################################################### libnsl
336 AC_CHECK_LIB([c], [gethostbyname],
340 server_ldflags="$server_ldflags $nsl_lib"
341 client_ldflags="$client_ldflags $nsl_lib"
342 audioc_ldflags="$audioc_ldflags $nsl_lib"
343 recv_ldflags="$recv_ldflags $nsl_lib"
344 AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[
345 AC_MSG_ERROR([Fatal: Did not find inet_ntoa().])
347 ########################################################################### ucred
348 AC_MSG_CHECKING(for struct ucred)
349 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
351 #include <sys/types.h>
352 #include <sys/socket.h>
354 struct ucred sucred; sucred.pid=0;
355 ]])],[have_ucred=yes],[have_ucred=no])
356 AC_MSG_RESULT($have_ucred)
357 if test ${have_ucred} = yes; then
358 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
360 ########################################################################### gengetopt
361 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
363 [gengetopt_args_info_description],
364 [ggo_descriptions_declared=yes],
365 [ggo_descriptions_declared=no],
366 [#include "conftest-ggo.h"]
368 AC_SUBST(ggo_descriptions_declared)
369 ########################################################################### curses
371 OLD_CPPFLAGS="$CPPFLAGS"
372 OLD_LDFLAGS="$LDFLAGS"
374 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
375 [look for curses.h also in dir])])
376 if test -n "$with_curses_headers"; then
377 curses_cppflags="-I$with_curses_headers"
378 CPPFLAGS="$CPPFLAGS $curses_cppflags"
380 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
381 [look for libcurses also in dir])])
382 if test -n "$with_curses_libs"; then
383 curses_libs="-L$with_curses_libs"
384 LDFLAGS="$LDFLAGS $curses_libs"
386 AC_CHECK_HEADER(curses.h, [], [
389 curses_ldflags="$curses_libs"
390 AC_CHECK_LIB([ncursesw], [initscr],
391 [curses_ldflags="$curses_libs -lncursesw"], [
392 AC_CHECK_LIB([curses], [initscr],
393 [curses_ldflags="$curses_libs -lcurses"],
398 AC_SUBST(curses_cppflags)
399 AC_SUBST(curses_ldflags)
400 CPPFLAGS="$OLD_CPPFLAGS"
401 LDFLAGS="$OLD_LDFLAGS"
403 ########################################################################### ip_mreqn
404 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
405 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
411 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
412 AC_MSG_RESULT($have_ip_mreqn)
413 if test ${have_ip_mreqn} = yes; then
414 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
416 ########################################################################### osx
418 AC_MSG_CHECKING(for CoreAudio (MacOs))
419 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
420 #include <CoreAudio/CoreAudio.h>
423 ]])],[have_core_audio=yes],[have_core_audio=no])
424 AC_MSG_RESULT($have_core_audio)
425 if test ${have_core_audio} = yes; then
426 f1="-framework CoreAudio"
427 f2="-framework AudioToolbox"
428 f3="-framework AudioUnit"
429 f4="-framework CoreServices"
432 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
433 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
434 audiod_ldflags="$audiod_ldflags $f"
436 play_errlist_objs="$play_errlist_objs osx_write ipc"
437 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
438 play_ldflags="$play_ldflags $f"
440 write_errlist_objs="$write_errlist_objs osx_write ipc"
441 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
442 write_ldflags="$write_ldflags $f"
443 writers="$writers osx"
444 default_writer="OSX_WRITE"
445 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
447 ####################################################### ogg/vorbis/speex/opus
449 OLD_CPPFLAGS="$CPPFLAGS"
450 OLD_LDFLAGS="$LDFLAGS"
452 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
453 [look for ogg headers also in dir])])
454 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
455 [look for ogg libs also in dir])])
456 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
457 [look for vorbis headers also in dir])])
458 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
459 [look for vorbis libs also in dir])])
460 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
461 [look for speex headers also in dir])])
462 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
463 [look for speex libs also in dir])])
464 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
465 [look for opus headers also in dir])])
466 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
467 [look for opus libs also in dir])])
469 if test -n "$with_ogg_headers"; then
470 ogg_cppflags="-I$with_ogg_headers"
471 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
473 if test -n "$with_ogg_libs"; then
474 ogg_libs="-L$with_ogg_libs"
475 LDFLAGS="$LDFLAGS $ogg_libs"
477 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
478 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
483 if test "$have_ogg" = "yes"; then
485 if test -n "$with_vorbis_headers"; then
486 vorbis_cppflags="-I$with_vorbis_headers"
487 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
489 if test -n "$with_vorbis_libs"; then
490 vorbis_libs="-L$with_vorbis_libs"
491 LDFLAGS="$LDFLAGS $vorbis_libs"
493 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
494 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
497 if test -n "$with_speex_headers"; then
498 speex_cppflags="-I$with_speex_headers"
499 CPPFLAGS="$CPPFLAGS $speex_cppflags"
501 if test -n "$with_speex_libs"; then
502 speex_libs="-L$with_speex_libs"
503 LDFLAGS="$LDFLAGS $speex_libs"
505 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
506 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
509 if test -n "$with_opus_headers"; then
510 opus_cppflags="-I$with_opus_headers"
511 CPPFLAGS="$CPPFLAGS $opus_cppflags"
513 if test -n "$with_opus_libs"; then
514 opus_libs="-L$with_opus_libs"
515 LDFLAGS="$LDFLAGS $opus_libs"
517 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
518 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
520 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
526 msg="support in para_server/para_filter/para_afh"
527 if test "$have_vorbis" = "yes" || \
528 test "$have_speex" = "yes" || \
529 test "$have_opus" = "yes"; then
530 AC_SUBST(ogg_cppflags)
531 ogg_libs="$ogg_libs -logg"
532 if test "$OSTYPE" = "Darwin"; then
533 ogg_libs="-Wl,-bind_at_load $ogg_libs"
535 server_ldflags="$server_ldflags $ogg_libs"
536 filter_ldflags="$filter_ldflags $ogg_libs"
537 audiod_ldflags="$audiod_ldflags $ogg_libs"
538 play_ldflags="$play_ldflags $ogg_libs"
539 afh_ldflags="$afh_ldflags $ogg_libs"
540 recv_ldflags="$recv_ldflags $ogg_libs"
541 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
542 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
543 server_errlist_objs="$server_errlist_objs ogg_afh_common"
544 play_errlist_objs="$play_errlist_objs ogg_afh_common"
546 if test "$have_vorbis" = "yes"; then
547 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
548 filters="$filters oggdec"
549 vorbis_libs="-lvorbis -lvorbisfile"
550 server_ldflags="$server_ldflags $vorbis_libs"
551 filter_ldflags="$filter_ldflags $vorbis_libs"
552 audiod_ldflags="$audiod_ldflags $vorbis_libs"
553 play_ldflags="$play_ldflags $vorbis_libs"
554 afh_ldflags="$afh_ldflags $vorbis_libs"
555 recv_ldflags="$recv_ldflags $vorbis_libs"
557 server_errlist_objs="$server_errlist_objs ogg_afh"
558 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
559 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
560 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
561 afh_errlist_objs="$afh_errlist_objs ogg_afh"
562 recv_errlist_objs="$recv_errlist_objs ogg_afh"
564 audiod_audio_formats="$audiod_audio_formats ogg"
565 audio_format_handlers="$audio_format_handlers ogg"
567 AC_MSG_WARN([no ogg/vorbis $msg])
569 if test "$have_speex" = "yes"; then
570 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
571 filters="$filters spxdec"
573 server_ldflags="$server_ldflags $speex_libs"
574 filter_ldflags="$filter_ldflags $speex_libs"
575 audiod_ldflags="$audiod_ldflags $speex_libs"
576 play_ldflags="$play_ldflags $speex_libs"
577 afh_ldflags="$afh_ldflags $speex_libs"
578 recv_ldflags="$recv_ldflags $speex_libs"
580 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
581 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
582 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
583 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
584 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
585 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
587 audiod_audio_formats="$audiod_audio_formats spx"
588 audio_format_handlers="$audio_format_handlers spx"
590 AC_MSG_WARN([no ogg/speex $msg])
592 if test "$have_opus" = "yes"; then
593 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
594 filters="$filters opusdec"
596 server_ldflags="$server_ldflags $opus_libs"
597 filter_ldflags="$filter_ldflags $opus_libs"
598 audiod_ldflags="$audiod_ldflags $opus_libs"
599 afh_ldflags="$afh_ldflags $opus_libs"
600 play_ldflags="$play_ldflags $opus_libs"
601 recv_ldflags="$recv_ldflags $opus_libs"
603 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
604 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
605 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
606 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
607 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
608 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
610 audiod_audio_formats="$audiod_audio_formats opus"
611 audio_format_handlers="$audio_format_handlers opus"
613 AC_MSG_WARN([no ogg/opus $msg])
615 CPPFLAGS="$OLD_CPPFLAGS"
616 LDFLAGS="$OLD_LDFLAGS"
618 ########################################################################### faad
620 OLD_CPPFLAGS="$CPPFLAGS"
621 OLD_LDFLAGS="$LDFLAGS"
623 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
624 [look for neaacdec.h also in dir])])
625 if test -n "$with_faad_headers"; then
626 faad_cppflags="-I$with_faad_headers"
627 CPPFLAGS="$CPPFLAGS $faad_cppflags"
629 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
630 [look for libfaad also in dir])])
631 if test -n "$with_faad_libs"; then
632 faad_libs="-L$with_faad_libs"
633 LDFLAGS="$LDFLAGS $faad_libs"
635 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
636 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
637 if test "$have_faad" = "yes"; then
638 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
639 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
640 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
641 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
642 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
643 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
644 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
646 server_ldflags="$server_ldflags $faad_libs -lfaad"
647 filter_ldflags="$filter_ldflags $faad_libs -lfaad"
648 audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
649 play_ldflags="$play_ldflags $faad_libs -lfaad"
650 afh_ldflags="$afh_ldflags $faad_libs -lfaad"
651 recv_ldflags="$afh_ldflags $faad_libs -lfaad"
653 audiod_audio_formats="$audiod_audio_formats aac"
654 audio_format_handlers="$audio_format_handlers aac"
655 filters="$filters aacdec"
656 AC_SUBST(faad_cppflags)
658 AC_MSG_WARN([no aac support in para_audiod/para_filter])
660 CPPFLAGS="$OLD_CPPFLAGS"
661 LDFLAGS="$OLD_LDFLAGS"
663 ########################################################################### mad
665 OLD_CPPFLAGS="$CPPFLAGS"
666 OLD_LDFLAGS="$LDFLAGS"
669 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
670 [look for mad.h also in dir])])
671 if test -n "$with_mad_headers"; then
672 mad_cppflags="-I$with_mad_headers"
673 CPPFLAGS="$CPPFLAGS $mad_cppflags"
675 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
676 [look for libmad also in dir])])
677 if test -n "$with_mad_libs"; then
678 mad_libs="-L$with_mad_libs"
679 LDFLAGS="$LDFLAGS $mad_libs"
681 AC_CHECK_HEADERS([mad.h], [], [
684 AC_CHECK_LIB([mad], [mad_stream_init], [], [
687 if test "$have_mad" = "yes"; then
688 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
689 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
690 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
691 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
692 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
693 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
694 play_errlist_objs="$play_errlist_objs mp3dec_filter"
695 filter_ldflags="$filter_ldflags $mad_libs -lmad"
696 audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
697 play_ldflags="$play_ldflags $mad_libs -lmad"
698 audiod_audio_formats="$audiod_audio_formats mp3"
699 filters="$filters mp3dec"
700 AC_SUBST(mad_cppflags)
702 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
704 CPPFLAGS="$OLD_CPPFLAGS"
705 LDFLAGS="$OLD_LDFLAGS"
707 ###################################################################### libid3tag
708 OLD_CPPFLAGS="$CPPFLAGS"
709 OLD_LDFLAGS="$LDFLAGS"
713 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
714 [look for id3tag header files also in dir])])
715 if test -n "$with_id3tag_headers"; then
716 id3tag_cppflags="-I$with_id3tag_headers"
717 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
719 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
720 [look for id3tag libs also in dir])])
721 if test -n "$with_id3tag_libs"; then
722 id3tag_libs="-L$with_id3tag_libs"
723 LDFLAGS="$LDFLAGS $id3tag_libs"
726 AC_MSG_CHECKING(for libid3tag)
727 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
730 struct id3_tag t = {.flags = 0};
731 ]])],[],[have_libid3tag=no])
732 AC_MSG_RESULT($have_libid3tag)
734 if test ${have_libid3tag} = yes; then
735 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
736 server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
737 afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
738 play_ldflags="$play_ldflags -lz"
739 recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
740 play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
741 AC_SUBST(id3tag_cppflags)
743 AC_MSG_WARN([no support for id3v2 tags])
745 CPPFLAGS="$OLD_CPPFLAGS"
746 LDFLAGS="$OLD_LDFLAGS"
748 ########################################################################### flac
749 OLD_CPPFLAGS="$CPPFLAGS"
750 OLD_LDFLAGS="$LDFLAGS"
754 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
755 [look for flac headers also in dir])])
756 if test -n "$with_flac_headers"; then
757 flac_cppflags="-I$with_flac_headers"
758 CPPFLAGS="$CPPFLAGS $flac_cppflags"
760 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
761 [look for flac libs also in dir])])
762 if test -n "$with_flac_libs"; then
763 flac_libs="-L$with_flac_libs"
764 LDFLAGS="$LDFLAGS $flac_libs"
766 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
767 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
768 if test "$have_flac" = "yes"; then
769 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
770 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
771 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
772 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
773 afh_errlist_objs="$afh_errlist_objs flac_afh"
774 server_errlist_objs="$server_errlist_objs flac_afh"
775 recv_errlist_objs="$recv_errlist_objs flac_afh"
776 filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
777 audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
778 play_ldflags="$play_ldflags $flac_libs -lFLAC"
779 server_ldflags="$server_ldflags $flac_libs -lFLAC"
780 afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
781 recv_ldflags="$recv_ldflags $flac_libs -lFLAC"
782 filters="$filters flacdec"
783 audio_format_handlers="$audio_format_handlers flac"
784 audiod_audio_formats="$audiod_audio_formats flac"
785 AC_SUBST(flac_cppflags)
787 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
789 CPPFLAGS="$OLD_CPPFLAGS"
790 LDFLAGS="$OLD_LDFLAGS"
792 ########################################################################### oss
793 OLD_CPPFLAGS="$CPPFLAGS"
794 OLD_LDFLAGS="$LDFLAGS"
798 msg="=> will not build oss writer"
800 AC_CHECK_HEADER(sys/soundcard.h, [
801 audiod_errlist_objs="$audiod_errlist_objs oss_write"
802 play_errlist_objs="$play_errlist_objs oss_write"
803 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
804 play_cmdline_objs="$play_cmdline_objs oss_write"
806 write_errlist_objs="$write_errlist_objs oss_write"
807 write_cmdline_objs="$write_cmdline_objs oss_write"
808 fade_errlist_objs="$fade_errlist_objs oss_mix"
810 writers="$writers oss"
811 default_writer="OSS_WRITE"
812 mixers="${mixers}oss "
813 default_mixer="OSS_MIX"
815 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
816 audiod_ldflags="$audiod_ldflags -lossaudio"
817 play_ldflags="$play_ldflags -lossaudio"
818 write_ldflags="$write_ldflags -lossaudio"
819 fade_ldflags="$fade_ldflags -lossaudio"
825 AC_MSG_WARN([no sys/soundcard.h $msg])
828 CPPFLAGS="$OLD_CPPFLAGS"
829 LDFLAGS="$OLD_LDFLAGS"
832 ########################################################################### alsa
833 OLD_CPPFLAGS="$CPPFLAGS"
834 OLD_LDFLAGS="$LDFLAGS"
837 msg="=> no alsa support for para_audiod/para_write"
838 if test "$OSTYPE" != "Linux"; then
843 if test "$have_alsa" = "yes"; then
844 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
846 AC_MSG_WARN([no alsa/asoundlib $msg])
850 if test "$have_alsa" = "yes"; then
851 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
853 AC_MSG_WARN([no libasound $msg])
857 if test "$have_alsa" = "yes"; then
858 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
859 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
860 audiod_ldflags="$audiod_ldflags -lasound"
861 play_errlist_objs="$play_errlist_objs alsa_write"
862 play_cmdline_objs="$play_cmdline_objs alsa_write"
863 play_ldflags="$play_ldflags -lasound"
865 write_errlist_objs="$write_errlist_objs alsa_write"
866 write_cmdline_objs="$write_cmdline_objs alsa_write"
867 write_ldflags="$write_ldflags -lasound"
868 fade_errlist_objs="$fade_errlist_objs alsa_mix"
869 fade_ldflags="$fade_ldflags -lasound"
871 writers="$writers alsa"
872 default_writer="ALSA_WRITE"
873 mixers="${mixers}alsa "
874 default_mixer="ALSA_MIX"
877 CPPFLAGS="$OLD_CPPFLAGS"
878 LDFLAGS="$OLD_LDFLAGS"
880 ########################################################################### libao
881 OLD_CPPFLAGS="$CPPFLAGS"
882 OLD_LDFLAGS="$LDFLAGS"
886 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
887 [look for ao/ao.h also in dir])])
888 if test -n "$with_ao_headers"; then
889 ao_cppflags="-I$with_ao_headers"
890 CPPFLAGS="$CPPFLAGS $ao_cppflags"
892 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
893 [look for libao also in dir])])
894 if test -n "$with_ao_libs"; then
895 ao_libs="-L$with_ao_libs"
896 LDFLAGS="$LDFLAGS $ao_libs"
898 msg="no libao support for para_audiod/para_write"
899 AC_CHECK_HEADERS([ao/ao.h], [
902 AC_MSG_WARN([ao.h not found, $msg])
904 if test "$have_ao" = "yes"; then
905 AC_CHECK_LIB([ao], [ao_initialize], [], [
907 AC_MSG_WARN([ao lib not found or not working, $msg])
910 if test "$have_ao" = "yes"; then
911 AC_CHECK_HEADERS([pthread.h], [
914 AC_MSG_WARN([pthread.h not found, $msg])
917 if test "$have_ao" = "yes"; then
918 AC_CHECK_LIB([pthread], [pthread_create], [], [
920 AC_MSG_WARN([pthread lib not found or not working, $msg])
923 if test "$have_ao" = "yes"; then
924 audiod_errlist_objs="$audiod_errlist_objs ao_write"
925 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
926 audiod_ldflags="$audiod_ldflags -lao -lpthread"
928 play_errlist_objs="$play_errlist_objs ao_write"
929 play_cmdline_objs="$play_cmdline_objs ao_write"
930 play_ldflags="$play_ldflags -lao -lpthread"
932 write_errlist_objs="$write_errlist_objs ao_write"
933 write_cmdline_objs="$write_cmdline_objs ao_write"
934 write_ldflags="$write_ldflags $ao_libs -lao -lpthread"
935 writers="$writers ao"
936 AC_SUBST(ao_cppflags)
939 CPPFLAGS="$OLD_CPPFLAGS"
940 LDFLAGS="$OLD_LDFLAGS"
942 ############################################################# readline
943 OLD_CPPFLAGS="$CPPFLAGS"
944 OLD_LDFLAGS="$LDFLAGS"
948 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
949 [look for libreadline header files also in dir])])
950 if test -n "$with_readline_headers"; then
951 readline_cppflags="-I$with_readline_headers"
952 CPPFLAGS="$CPPFLAGS $readline_cppflags"
955 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
956 [look for readline library also in dir])])
957 if test -n "$with_readline_libs"; then
958 readline_libs="-L$with_readline_libs"
959 LDFLAGS="$LDFLAGS $readline_libs"
961 msg="no interactive cli support"
962 AC_CHECK_HEADERS([readline/readline.h], [
965 AC_MSG_WARN([readline/readline.h not found, $msg])
968 if test "$have_curses" != "yes"; then
970 AC_MSG_WARN([interactive cli support depends on curses,])
971 AC_MSG_WARN([but no curses lib was detected, $msg])
974 if test "$have_readline" = "yes"; then
975 readline_libs="$readline_libs -lreadline"
976 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
977 if test "$have_readline" = "no"; then # try with -lcurses
979 AC_MSG_NOTICE([trying again with -lcurses])
980 unset ac_cv_search_rl_free_keymap 2> /dev/null
981 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
983 readline_libs="$readline_libs -lcurses"
986 if test "$have_readline" = "no"; then # try with -ltermcap
988 AC_MSG_NOTICE([trying again with -ltermcap])
989 unset ac_cv_search_rl_free_keymap 2> /dev/null
990 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
992 readline_libs="$readline_libs -ltermcap"
997 if test "$have_readline" = "yes"; then
998 client_errlist_objs="$client_errlist_objs interactive"
999 client_ldflags="$client_ldflags $readline_libs"
1000 audioc_errlist_objs="$audioc_errlist_objs buffer_tree interactive sched time"
1001 audioc_ldflags="$audioc_ldflags $readline_libs"
1002 play_errlist_objs="$play_errlist_objs interactive"
1003 play_ldflags="$play_ldflags $readline_libs"
1004 AC_SUBST(readline_cppflags)
1005 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
1007 AC_MSG_WARN([libreadline not found or unusable])
1009 CPPFLAGS="$OLD_CPPFLAGS"
1010 LDFLAGS="$OLD_LDFLAGS"
1012 ############################################################# libsamplerate
1013 OLD_CPPFLAGS="$CPPFLAGS"
1014 OLD_LDFLAGS="$LDFLAGS"
1017 have_samplerate="yes"
1018 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
1019 [look for samplerate headers also in dir])])
1020 if test -n "$with_samplerate_headers"; then
1021 samplerate_cppflags="-I$with_samplerate_headers"
1022 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
1024 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
1025 [look for samplerate libs also in dir])])
1026 if test -n "$with_samplerate_libs"; then
1027 samplerate_libs="-L$with_samplerate_libs"
1028 LDFLAGS="$LDFLAGS $samplerate_libs"
1031 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
1032 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
1034 if test "$have_samplerate" = "yes"; then
1035 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1036 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
1037 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1038 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
1039 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1040 play_cmdline_objs="$play_cmdline_objs resample_filter"
1041 filter_ldflags="$filter_ldflags $samplerate_libs -lsamplerate"
1042 audiod_ldflags="$audiod_ldflags $samplerate_libs -lsamplerate"
1043 play_ldflags="$play_ldflags $samplerate_libs -lsamplerate"
1044 filters="$filters resample"
1045 AC_SUBST(samplerate_cppflags)
1047 AC_MSG_WARN([no resample support in para_audiod/para_filter])
1049 CPPFLAGS="$OLD_CPPFLAGS"
1050 LDFLAGS="$OLD_LDFLAGS"
1052 ######################################################################### server
1053 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
1054 -a "$have_osl" = "yes" ; then
1057 executables="$executables server"
1058 server_cmdline_objs="server"
1059 server_errlist_objs="$server_errlist_objs
1098 server_ldflags="$server_ldflags $osl_libs -losl"
1102 ############################################################# client
1103 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1105 executables="$executables client"
1106 client_cmdline_objs="client"
1107 client_errlist_objs="$client_errlist_objs
1126 ############################################################# audiod
1127 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
1129 executables="$executables audiod"
1130 audiod_cmdline_objs="$audiod_cmdline_objs
1141 audiod_errlist_objs="$audiod_errlist_objs
1178 audiod_ldflags="$audiod_ldflags -lm"
1179 audiod_audio_formats="$audiod_audio_formats wma"
1183 ########################################################################### fade
1184 if test -n "$mixers"; then
1186 executables="$executables fade"
1187 fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
1188 fade_cmdline_objs="fade"
1189 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
1190 AC_SUBST(fade_objs, add_dot_o($fade_objs))
1191 AC_SUBST(fade_ldflags, $fade_ldflags)
1192 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
1193 objlist_to_errlist($fade_errlist_objs),
1194 errors used by para_fade)
1196 for i in $mixers; do
1197 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
1200 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
1201 enum of supported mixers)
1202 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
1203 use this mixer if none was specified)
1204 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
1205 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
1207 for i in $mixers; do
1208 printf 'extern void '$i'_mix_init(struct mixer *); '
1211 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
1212 init functions of the supported mixers)
1213 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
1214 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
1215 mixer_summary="supported mixers:: $mixers, default: $default_mixer"
1218 AC_MSG_WARN([no mixer support])
1219 mixer_summary="para_fade: no"
1221 ########################################################################### gui
1222 if test "$have_curses" = "yes"; then
1224 executables="$executables gui"
1225 gui_cmdline_objs="gui"
1239 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
1242 AC_MSG_WARN([no curses lib, cannot build para_gui])
1244 ############################################################# error2.h
1245 AC_MSG_NOTICE(creating error2.h)
1247 # these are always built
1250 $filter_errlist_objs
1251 $audioc_errlist_objs
1257 # optional executables
1258 if test "$build_server" = "yes"; then
1259 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1261 if test "$build_gui" = "yes"; then
1262 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1264 if test "$build_fade" = "yes"; then
1265 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1267 if test "$build_client" = "yes"; then
1268 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1270 if test "$build_audiod" = "yes"; then
1271 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1274 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1276 for i in $executables; do
1278 eval echo \$${i}_errlist_objs
1279 done | ./error2.pl > error2.h
1280 for obj in $all_errlist_objs; do
1281 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1283 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1284 [enum {$SS NUM_SS}],
1285 [list of all objects that use the paraslash error facility]
1288 ################################################################## status items
1290 status_items="basename status num_played mtime bitrate frequency file_size
1291 status_flags format score techinfo afs_mode
1292 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1293 offset seconds_total stream_start current_time audiod_uptime image_id
1294 lyrics_id duration directory lyrics_name image_name path hash channels
1295 last_played num_chunks chunk_time amplification artist title year album
1299 for i in $status_items; do
1300 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1302 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1303 [enum of all status items])
1306 for i in $status_items; do
1307 result="$result \"$i\", "
1309 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1310 [char * array of all status items])
1312 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1313 [formats supported by para_server and para_afh])
1315 AC_SUBST(executables)
1317 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
1318 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
1319 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
1320 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
1321 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
1322 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
1323 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1324 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
1325 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
1326 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
1328 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1329 AC_SUBST(recv_ldflags, $recv_ldflags)
1330 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1331 errors used by para_recv)
1333 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1334 AC_SUBST(filter_ldflags, $filter_ldflags)
1335 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1336 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1338 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1339 AC_SUBST(audiod_ldflags, $audiod_ldflags)
1340 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1341 errors used by para_audiod)
1343 AC_SUBST(server_objs, add_dot_o($server_objs))
1344 AC_SUBST(server_ldflags, $server_ldflags)
1345 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
1346 objlist_to_errlist($server_errlist_objs), errors used by para_server)
1348 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1349 AC_SUBST(afh_ldflags, $afh_ldflags)
1350 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1351 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1353 AC_SUBST(write_objs, add_dot_o($write_objs))
1354 AC_SUBST(write_ldflags, $write_ldflags)
1355 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1356 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1358 AC_SUBST(client_objs, add_dot_o($client_objs))
1359 AC_SUBST(client_ldflags, $client_ldflags)
1360 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
1361 objlist_to_errlist($client_errlist_objs), errors used by para_client)
1363 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1364 AC_SUBST(audioc_ldflags, $audioc_ldflags)
1365 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1366 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1368 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1369 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1370 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1372 AC_SUBST(play_objs, add_dot_o($play_objs))
1373 AC_SUBST(play_ldflags, $play_ldflags)
1374 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1375 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1377 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1378 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1379 enum of supported filters)
1380 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1381 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1382 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1383 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1385 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1386 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1387 enum of supported writers)
1388 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1389 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1390 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1391 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1392 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1393 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1394 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1396 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1397 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1398 enum of audio formats supported by audiod)
1399 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1400 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1404 paraslash configuration:
1405 ~~~~~~~~~~~~~~~~~~~~~~~~
1406 unix socket credentials: $have_ucred
1407 readline (interactive CLIs): $have_readline
1408 audio formats handlers: $audio_format_handlers
1409 id3 version2 support: $have_libid3tag
1414 para_server: $build_server
1415 para_gui: $build_gui
1416 para_fade: $build_fade
1417 para_client: $build_client
1418 para_audiod: $build_audiod