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([make_errlist_defines], \
14 printf "DEFINE_ERRLIST($(echo $i | tr 'a-z' 'A-Z'));"; \
17 AC_DEFUN([make_para_errlists], \
19 printf "PARA_ERRLIST($(echo $i | tr 'a-z' 'A-Z')), "; \
22 AC_DEFUN([objlist_to_errlist],[ \
23 make_errlist_defines($@) \
24 [const char **para_errlist[[]]] = {make_para_errlists($@)} \
27 AC_PATH_PROG(UNAMEPATH, uname, no)
28 if test "$UNAMEPATH" = "no"; then
29 AC_MSG_ERROR(unable to determine system type)
31 AC_MSG_CHECKING(os type)
32 OSTYPE="`$UNAMEPATH -s`"
33 AC_MSG_RESULT("$OSTYPE")
35 if test "$OSTYPE" = "SunOS"; then
36 # needed on SunOS for socket magic
37 arch_cppflags="-D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
38 AC_SUBST(arch_cppflags)
43 AC_PATH_PROG([gengetopt], [gengetopt])
44 test -z "$gengetopt" && AC_MSG_ERROR(
45 [gengetopt is required to build this package])
47 AC_PATH_PROG([help2man], [help2man])
48 test -z "$help2man" && AC_MSG_ERROR(
49 [help2man is required to build this package])
51 AC_PATH_PROG([install], [install])
52 test -z "$install" && AC_MSG_ERROR(
53 [The install program is required to build this package])
62 AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h \
63 stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h sys/un.h \
64 sys/ipc.h unistd.h utime.h stddef.h],
65 [], [AC_MSG_ERROR([$ac_header not found])])
67 # Checks for typedefs, structures, and compiler characteristics.
87 # Checks for library functions.
89 AC_PROG_GCC_TRADITIONAL
93 AC_FUNC_SELECT_ARGTYPES
100 AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \
101 regcomp select strchr strdup strerror strstr strtol uname \
102 fchdir gettimeofday localtime_r munmap strcasecmp strcspn \
103 strncasecmp strrchr strspn alarm mkdir inet_ntoa socket], [],
104 [AC_MSG_ERROR([function not found, cannot live without it])])
106 executables="recv filter audioc write afh play"
107 ################################################################## clock_gettime
109 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
110 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
112 if test -n "$clock_gettime_lib"; then
113 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
114 define to 1 if clock_gettime() is supported])
116 if test "$clock_gettime_lib" = "rt"; then
117 AC_SUBST(clock_gettime_ldflags, -lrt)
119 ########################################################################### osl
121 OLD_CPPFLAGS="$CPPFLAGS"
122 OLD_LDFLAGS="$LDFLAGS"
124 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
125 [look for osl.h also in dir])])
126 if test -n "$with_osl_headers"; then
127 osl_cppflags="-I$with_osl_headers"
128 CPPFLAGS="$CPPFLAGS $osl_cppflags"
130 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
131 [look for libosl also in dir])])
132 if test -n "$with_osl_libs"; then
133 osl_libs="-L$with_osl_libs"
134 LDFLAGS="$LDFLAGS $osl_libs"
137 AC_CHECK_HEADER(osl.h, [], have_osl=no)
138 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
139 if test "$have_osl" = "yes"; then
140 AC_SUBST(osl_cppflags)
141 osl_ldflags="$osl_libs -losl"
142 AC_SUBST(osl_ldflags)
144 AC_MSG_WARN([libosl not found, can not build para_server.
146 http://systemlinux.org/~maan/osl
148 git clone git://git.tuebingen.mpg.de/osl
151 CPPFLAGS="$OLD_CPPFLAGS"
152 LDFLAGS="$OLD_LDFLAGS"
154 ########################################################################### crypto
155 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
156 Force using crypto library "lib". This package requires either
157 openssl or libgcrypt being installed. Possible values for "lib"
158 are thus "openssl" and "gcrypt". If this option is not given,
159 openssl is tried first. If openssl was not found, gcrypt is
162 case "$enable_cryptolib" in
163 "openssl") check_openssl="yes"; check_gcrypt="no";;
164 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
165 "") check_openssl="yes"; check_gcrypt="yes";;
166 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
168 ###################################################################### openssl
169 if test "$check_openssl" = "yes"; then
170 OLD_CPPFLAGS="$CPPFLAGS"
171 OLD_LDFLAGS="$LDFLAGS"
174 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
175 [look for openssl headers also in dir])])
176 if test -n "$with_openssl_headers"; then
177 openssl_cppflags="-I$with_openssl_headers"
178 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
180 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
181 [look for openssl libraries also in dir])])
182 if test -n "$with_openssl_libs"; then
183 openssl_libs="-L$with_openssl_libs"
184 LDFLAGS="$LDFLAGS $openssl_libs"
186 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
187 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
188 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
189 # try harder: openssl is sometimes installed in /usr/local/ssl
190 openssl_cppflags="-I/usr/local/ssl/include"
191 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
192 openssl_libs="-L/usr/local/ssl/lib"
193 LDFLAGS="$LDFLAGS $openssl_libs"
195 unset ac_cv_header_openssl_ssl_h 2> /dev/null
196 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
197 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
198 if test "$have_openssl" = "yes"; then
199 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
202 if test "$have_openssl" = "yes"; then
203 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
204 AC_SUBST(openssl_cppflags)
205 openssl_ldflags="$openssl_libs -lssl -lcrypto"
206 AC_SUBST(openssl_ldflags)
210 AC_MSG_WARN([openssl libraries not found])
212 CPPFLAGS="$OLD_CPPFLAGS"
213 LDFLAGS="$OLD_LDFLAGS"
218 ########################################################################### gcrypt
219 if test "$check_gcrypt" = "yes"; then
220 OLD_CPPFLAGS="$CPPFLAGS"
221 OLD_LDFLAGS="$LDFLAGS"
224 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
225 [look for gcrypt headers also in dir])])
226 if test -n "$with_gcrypt_headers"; then
227 gcrypt_cppflags="-I$with_gcrypt_headers"
228 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
230 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
231 [look for libgcrypt also in dir])])
232 if test -n "$with_gcrypt_libs"; then
233 gcrypt_libs="-L$with_gcrypt_libs"
234 LDFLAGS="$LDFLAGS $gcrypt_libs"
236 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
237 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
238 if test "$have_gcrypt" = "yes"; then
239 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
240 AC_SUBST(gcrypt_cppflags)
241 gcrypt_ldflags="$gcrypt_libs -lgcrypt"
242 AC_SUBST(gcrypt_ldflags)
244 AC_MSG_WARN([gcrypt library not found])
246 CPPFLAGS="$OLD_CPPFLAGS"
247 LDFLAGS="$OLD_LDFLAGS"
252 ########################################################################### libsocket
253 AC_CHECK_LIB([c], [socket],
255 [socket_ldflags="-lsocket"]
257 AC_SUBST(socket_ldflags)
258 ########################################################################### libnsl
259 AC_CHECK_LIB([c], [gethostbyname],
261 [nsl_ldflags="-lnsl"]
263 AC_SUBST(nsl_ldflags)
264 ########################################################################### ucred
265 AC_MSG_CHECKING(for struct ucred)
266 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
268 #include <sys/types.h>
269 #include <sys/socket.h>
271 struct ucred sucred; sucred.pid=0;
272 ]])],[have_ucred=yes],[have_ucred=no])
273 AC_MSG_RESULT($have_ucred)
274 if test ${have_ucred} = yes; then
275 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
277 ########################################################################### gengetopt
278 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
280 [gengetopt_args_info_description],
281 [ggo_descriptions_declared=yes],
282 [ggo_descriptions_declared=no],
283 [#include "conftest-ggo.h"]
285 AC_SUBST(ggo_descriptions_declared)
286 ########################################################################### curses
288 OLD_CPPFLAGS="$CPPFLAGS"
289 OLD_LDFLAGS="$LDFLAGS"
291 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
292 [look for curses.h also in dir])])
293 if test -n "$with_curses_headers"; then
294 curses_cppflags="-I$with_curses_headers"
295 CPPFLAGS="$CPPFLAGS $curses_cppflags"
297 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
298 [look for libcurses also in dir])])
299 if test -n "$with_curses_libs"; then
300 curses_libs="-L$with_curses_libs"
301 LDFLAGS="$LDFLAGS $curses_libs"
303 AC_CHECK_HEADER(curses.h, [], [
306 curses_ldflags="$curses_libs"
307 AC_CHECK_LIB([ncursesw], [initscr],
308 [curses_ldflags="$curses_libs -lncursesw"], [
309 AC_CHECK_LIB([curses], [initscr],
310 [curses_ldflags="$curses_libs -lcurses"],
315 AC_SUBST(curses_cppflags)
316 AC_SUBST(curses_ldflags)
317 CPPFLAGS="$OLD_CPPFLAGS"
318 LDFLAGS="$OLD_LDFLAGS"
320 ########################################################################### ip_mreqn
321 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
322 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
328 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
329 AC_MSG_RESULT($have_ip_mreqn)
330 if test ${have_ip_mreqn} = yes; then
331 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
333 ########################################################################### osx
335 AC_MSG_CHECKING(for CoreAudio (MacOs))
336 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
337 #include <CoreAudio/CoreAudio.h>
340 ]])],[have_core_audio=yes],[have_core_audio=no])
341 AC_MSG_RESULT($have_core_audio)
342 if test ${have_core_audio} = yes; then
343 f1="-framework CoreAudio"
344 f2="-framework AudioToolbox"
345 f3="-framework AudioUnit"
346 f4="-framework CoreServices"
347 core_audio_ldflags="$f1 $f2 $f3 $f4"
348 AC_SUBST(core_audio_ldflags)
349 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
351 ####################################################### ogg/vorbis/speex/opus
353 OLD_CPPFLAGS="$CPPFLAGS"
354 OLD_LDFLAGS="$LDFLAGS"
356 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
357 [look for ogg headers also in dir])])
358 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
359 [look for ogg libs also in dir])])
360 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
361 [look for vorbis headers also in dir])])
362 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
363 [look for vorbis libs also in dir])])
364 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
365 [look for speex headers also in dir])])
366 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
367 [look for speex libs also in dir])])
368 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
369 [look for opus headers also in dir])])
370 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
371 [look for opus libs also in dir])])
373 if test -n "$with_ogg_headers"; then
374 ogg_cppflags="-I$with_ogg_headers"
375 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
377 if test -n "$with_ogg_libs"; then
378 ogg_libs="-L$with_ogg_libs"
379 LDFLAGS="$LDFLAGS $ogg_libs"
381 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
382 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
387 if test "$have_ogg" = "yes"; then
389 if test -n "$with_vorbis_headers"; then
390 vorbis_cppflags="-I$with_vorbis_headers"
391 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
393 if test -n "$with_vorbis_libs"; then
394 vorbis_libs="-L$with_vorbis_libs"
395 LDFLAGS="$LDFLAGS $vorbis_libs"
397 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
398 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
401 if test -n "$with_speex_headers"; then
402 speex_cppflags="-I$with_speex_headers"
403 CPPFLAGS="$CPPFLAGS $speex_cppflags"
405 if test -n "$with_speex_libs"; then
406 speex_libs="-L$with_speex_libs"
407 LDFLAGS="$LDFLAGS $speex_libs"
409 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
410 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
413 if test -n "$with_opus_headers"; then
414 opus_cppflags="-I$with_opus_headers"
415 CPPFLAGS="$CPPFLAGS $opus_cppflags"
417 if test -n "$with_opus_libs"; then
418 opus_libs="-L$with_opus_libs"
419 LDFLAGS="$LDFLAGS $opus_libs"
421 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
422 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
424 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
430 msg="support in para_server/para_filter/para_afh"
431 if test "$have_vorbis" = "yes" || \
432 test "$have_speex" = "yes" || \
433 test "$have_opus" = "yes"; then
434 AC_SUBST(ogg_cppflags)
435 ogg_ldflags="$ogg_libs -logg"
436 if test "$OSTYPE" = "Darwin"; then
437 ogg_ldflags="-Wl,-bind_at_load $ogg_ldflags"
439 AC_SUBST(ogg_ldflags)
441 if test "$have_vorbis" = "yes"; then
442 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
443 vorbis_ldflags="$vorbis_libs -lvorbis -lvorbisfile"
444 AC_SUBST(vorbis_ldflags)
446 if test "$have_speex" = "yes"; then
447 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
448 AC_SUBST(speex_cppflags)
449 speex_ldflags="$speex_libs -lspeex"
450 AC_SUBST(speex_ldflags)
452 AC_MSG_WARN([no ogg/speex $msg])
454 if test "$have_opus" = "yes"; then
455 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
456 AC_SUBST(opus_cppflags)
457 opus_ldflags="$opus_libs -lopus"
458 AC_SUBST(opus_ldflags)
459 audio_format_handlers="$audio_format_handlers opus"
461 AC_MSG_WARN([no ogg/opus $msg])
463 CPPFLAGS="$OLD_CPPFLAGS"
464 LDFLAGS="$OLD_LDFLAGS"
466 ########################################################################### faad
468 OLD_CPPFLAGS="$CPPFLAGS"
469 OLD_LDFLAGS="$LDFLAGS"
471 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
472 [look for neaacdec.h also in dir])])
473 if test -n "$with_faad_headers"; then
474 faad_cppflags="-I$with_faad_headers"
475 CPPFLAGS="$CPPFLAGS $faad_cppflags"
477 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
478 [look for libfaad also in dir])])
479 if test -n "$with_faad_libs"; then
480 faad_libs="-L$with_faad_libs"
481 LDFLAGS="$LDFLAGS $faad_libs"
483 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
484 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
485 if test "$have_faad" = "yes"; then
486 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
487 AC_SUBST(faad_cppflags)
488 faad_ldflags="$faad_libs -lfaad"
489 AC_SUBST(faad_ldflags)
491 CPPFLAGS="$OLD_CPPFLAGS"
492 LDFLAGS="$OLD_LDFLAGS"
494 ########################################################################### mad
496 OLD_CPPFLAGS="$CPPFLAGS"
497 OLD_LDFLAGS="$LDFLAGS"
500 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
501 [look for mad.h also in dir])])
502 if test -n "$with_mad_headers"; then
503 mad_cppflags="-I$with_mad_headers"
504 CPPFLAGS="$CPPFLAGS $mad_cppflags"
506 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
507 [look for libmad also in dir])])
508 if test -n "$with_mad_libs"; then
509 mad_libs="-L$with_mad_libs"
510 LDFLAGS="$LDFLAGS $mad_libs"
512 AC_CHECK_HEADERS([mad.h], [], [
515 AC_CHECK_LIB([mad], [mad_stream_init], [], [
518 if test "$have_mad" = "yes"; then
519 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
520 AC_SUBST(mad_cppflags)
521 mad_ldflags="$mad_libs -lmad"
522 AC_SUBST(mad_ldflags)
524 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
526 CPPFLAGS="$OLD_CPPFLAGS"
527 LDFLAGS="$OLD_LDFLAGS"
529 ###################################################################### libid3tag
530 OLD_CPPFLAGS="$CPPFLAGS"
531 OLD_LDFLAGS="$LDFLAGS"
535 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
536 [look for id3tag header files also in dir])])
537 if test -n "$with_id3tag_headers"; then
538 id3tag_cppflags="-I$with_id3tag_headers"
539 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
541 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
542 [look for id3tag libs also in dir])])
543 if test -n "$with_id3tag_libs"; then
544 id3tag_libs="-L$with_id3tag_libs"
545 LDFLAGS="$LDFLAGS $id3tag_libs"
548 AC_MSG_CHECKING(for libid3tag)
549 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
552 struct id3_tag t = {.flags = 0};
553 ]])],[],[have_libid3tag=no])
554 AC_MSG_RESULT($have_libid3tag)
556 if test ${have_libid3tag} = yes; then
557 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
558 AC_SUBST(id3tag_cppflags)
559 AC_SUBST(id3tag_ldflags, "$id3tag_libs -lid3tag -lz")
561 CPPFLAGS="$OLD_CPPFLAGS"
562 LDFLAGS="$OLD_LDFLAGS"
564 ########################################################################### flac
565 OLD_CPPFLAGS="$CPPFLAGS"
566 OLD_LDFLAGS="$LDFLAGS"
570 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
571 [look for flac headers also in dir])])
572 if test -n "$with_flac_headers"; then
573 flac_cppflags="-I$with_flac_headers"
574 CPPFLAGS="$CPPFLAGS $flac_cppflags"
576 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
577 [look for flac libs also in dir])])
578 if test -n "$with_flac_libs"; then
579 flac_libs="-L$with_flac_libs"
580 LDFLAGS="$LDFLAGS $flac_libs"
582 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
583 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], [
584 # nope, try again with -logg
585 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [],
586 have_flac=no, -lm -logg)
588 if test "$have_flac" = "yes"; then
589 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
590 AC_SUBST(flac_cppflags)
591 flac_ldflags="$flac_libs -lFLAC"
592 AC_SUBST(flac_ldflags)
594 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
596 CPPFLAGS="$OLD_CPPFLAGS"
597 LDFLAGS="$OLD_LDFLAGS"
599 ########################################################################### oss
600 OLD_CPPFLAGS="$CPPFLAGS"
601 OLD_LDFLAGS="$LDFLAGS"
605 msg="=> will not build oss writer"
607 AC_CHECK_HEADER(sys/soundcard.h, [
608 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
609 oss_ldflags="-lossaudio"
610 AC_SUBST(oss_ldflags)
616 AC_MSG_WARN([no sys/soundcard.h $msg])
619 CPPFLAGS="$OLD_CPPFLAGS"
620 LDFLAGS="$OLD_LDFLAGS"
623 ########################################################################### alsa
624 OLD_CPPFLAGS="$CPPFLAGS"
625 OLD_LDFLAGS="$LDFLAGS"
628 msg="=> no alsa support for para_audiod/para_write"
629 if test "$OSTYPE" != "Linux"; then
634 if test "$have_alsa" = "yes"; then
635 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
637 AC_MSG_WARN([no alsa/asoundlib $msg])
641 if test "$have_alsa" = "yes"; then
642 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
644 AC_MSG_WARN([no libasound $msg])
648 if test "$have_alsa" = "yes"; then
649 alsa_ldflags="-lasound"
650 AC_SUBST(alsa_ldflags)
653 CPPFLAGS="$OLD_CPPFLAGS"
654 LDFLAGS="$OLD_LDFLAGS"
656 ########################################################################### libao
657 OLD_CPPFLAGS="$CPPFLAGS"
658 OLD_LDFLAGS="$LDFLAGS"
662 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
663 [look for ao/ao.h also in dir])])
664 if test -n "$with_ao_headers"; then
665 ao_cppflags="-I$with_ao_headers"
666 CPPFLAGS="$CPPFLAGS $ao_cppflags"
668 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
669 [look for libao also in dir])])
670 if test -n "$with_ao_libs"; then
671 ao_libs="-L$with_ao_libs"
672 LDFLAGS="$LDFLAGS $ao_libs"
674 msg="no libao support for para_audiod/para_write"
675 AC_CHECK_HEADERS([ao/ao.h], [
678 AC_MSG_WARN([ao.h not found, $msg])
680 if test "$have_ao" = "yes"; then
681 AC_CHECK_LIB([ao], [ao_initialize], [], [
683 AC_MSG_WARN([ao lib not found or not working, $msg])
686 if test "$have_ao" = "yes"; then
687 AC_CHECK_HEADERS([pthread.h], [
690 AC_MSG_WARN([pthread.h not found, $msg])
693 if test "$have_ao" = "yes"; then
694 AC_CHECK_LIB([pthread], [pthread_create], [], [
696 AC_MSG_WARN([pthread lib not found or not working, $msg])
699 if test "$have_ao" = "yes"; then
700 AC_SUBST(ao_cppflags)
701 ao_ldflags="$ao_libs -lao -lpthread"
705 CPPFLAGS="$OLD_CPPFLAGS"
706 LDFLAGS="$OLD_LDFLAGS"
708 ############################################################# readline
709 OLD_CPPFLAGS="$CPPFLAGS"
710 OLD_LDFLAGS="$LDFLAGS"
714 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
715 [look for libreadline header files also in dir])])
716 if test -n "$with_readline_headers"; then
717 readline_cppflags="-I$with_readline_headers"
718 CPPFLAGS="$CPPFLAGS $readline_cppflags"
721 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
722 [look for readline library also in dir])])
723 if test -n "$with_readline_libs"; then
724 readline_libs="-L$with_readline_libs"
725 LDFLAGS="$LDFLAGS $readline_libs"
727 msg="no interactive cli support"
728 AC_CHECK_HEADERS([readline/readline.h], [
731 AC_MSG_WARN([readline/readline.h not found, $msg])
734 if test "$have_readline" = "yes"; then
735 readline_ldflags="$readline_libs -lreadline"
736 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
737 if test "$have_readline" = "no"; then # try with -lcurses
739 AC_MSG_NOTICE([trying again with -lcurses])
740 unset ac_cv_search_rl_free_keymap 2> /dev/null
741 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
743 readline_ldflags="$readline_ldflags -lcurses"
746 if test "$have_readline" = "no"; then # try with -ltermcap
748 AC_MSG_NOTICE([trying again with -ltermcap])
749 unset ac_cv_search_rl_free_keymap 2> /dev/null
750 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
752 readline_ldflags="$readline_ldflags -ltermcap"
757 if test "$have_readline" = "yes"; then
759 AC_SUBST(readline_cppflags)
760 AC_SUBST(readline_ldflags)
761 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
763 AC_MSG_WARN([libreadline not found or unusable])
765 CPPFLAGS="$OLD_CPPFLAGS"
766 LDFLAGS="$OLD_LDFLAGS"
768 ############################################################# libsamplerate
769 OLD_CPPFLAGS="$CPPFLAGS"
770 OLD_LDFLAGS="$LDFLAGS"
773 have_samplerate="yes"
774 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
775 [look for samplerate headers also in dir])])
776 if test -n "$with_samplerate_headers"; then
777 samplerate_cppflags="-I$with_samplerate_headers"
778 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
780 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
781 [look for samplerate libs also in dir])])
782 if test -n "$with_samplerate_libs"; then
783 samplerate_libs="-L$with_samplerate_libs"
784 LDFLAGS="$LDFLAGS $samplerate_libs"
787 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
788 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
790 if test "$have_samplerate" = "yes"; then
791 AC_SUBST(samplerate_cppflags)
792 samplerate_ldflags="$samplerate_libs -lsamplerate"
793 AC_SUBST(samplerate_ldflags)
795 AC_MSG_WARN([no resample support in para_audiod/para_filter])
797 CPPFLAGS="$OLD_CPPFLAGS"
798 LDFLAGS="$OLD_LDFLAGS"
800 ######################################################################### server
801 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
802 -a "$have_osl" = "yes" ; then
805 executables="$executables server"
806 server_cmdline_objs="server"
807 server_errlist_objs="
846 if test "$have_openssl" = "yes"; then
847 server_errlist_objs="$server_errlist_objs crypt"
849 if test "$have_gcrypt" = "yes"; then
850 server_errlist_objs="$server_errlist_objs gcrypt"
852 if test "$have_vorbis" = "yes" || \
853 test "$have_speex" = "yes" || \
854 test "$have_opus" = "yes"; then
855 server_errlist_objs="$server_errlist_objs ogg_afh_common"
857 if test "$have_vorbis" = "yes"; then
858 server_errlist_objs="$server_errlist_objs ogg_afh"
860 if test "$have_speex" = "yes"; then
861 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
863 if test "$have_opus" = "yes"; then
864 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
866 if test "$have_faad" = "yes"; then
867 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
869 if test "$have_flac" = "yes"; then
870 server_errlist_objs="$server_errlist_objs flac_afh"
872 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
873 AC_SUBST(server_objs, add_dot_o($server_objs))
874 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
875 objlist_to_errlist($server_errlist_objs), errors used by para_server)
879 ############################################################# client
880 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
882 executables="$executables client"
883 client_cmdline_objs="client"
884 client_errlist_objs="
900 if test "$have_openssl" = "yes"; then
901 client_errlist_objs="$client_errlist_objs crypt"
903 if test "$have_gcrypt" = "yes"; then
904 client_errlist_objs="$client_errlist_objs gcrypt"
906 if test "$have_readline" = "yes"; then
907 client_errlist_objs="$client_errlist_objs interactive"
909 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
910 AC_SUBST(client_objs, add_dot_o($client_objs))
911 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
912 objlist_to_errlist($client_errlist_objs), errors used by para_client)
916 ############################################################# audiod
917 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
919 executables="$executables audiod"
920 audiod_audio_formats="wma"
921 audiod_cmdline_objs="$audiod_cmdline_objs
932 audiod_errlist_objs="$audiod_errlist_objs
969 if test "$have_openssl" = "yes"; then
970 audiod_errlist_objs="$audiod_errlist_objs crypt"
972 if test "$have_gcrypt" = "yes"; then
973 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
975 if test "$have_core_audio" = "yes"; then
976 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
977 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
979 if test "$have_vorbis" = "yes"; then
980 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
981 audiod_audio_formats="$audiod_audio_formats ogg"
983 if test "$have_speex" = "yes"; then
984 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
985 audiod_audio_formats="$audiod_audio_formats spx"
987 if test "$have_opus" = "yes"; then
988 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
989 audiod_audio_formats="$audiod_audio_formats opus"
991 if test "$have_faad" = "yes"; then
992 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
993 audiod_audio_formats="$audiod_audio_formats aac"
995 if test "$have_mad" = "yes"; then
996 audiod_audio_formats="$audiod_audio_formats mp3"
997 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
998 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
1000 if test "$have_flac" = "yes"; then
1001 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
1002 audiod_audio_formats="$audiod_audio_formats flac"
1004 if test "$have_oss" = "yes"; then
1005 audiod_errlist_objs="$audiod_errlist_objs oss_write"
1006 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
1008 if test "$have_alsa" = "yes"; then
1009 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
1010 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
1012 if test "$have_ao" = "yes"; then
1013 audiod_errlist_objs="$audiod_errlist_objs ao_write"
1014 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
1016 if test "$have_samplerate" = "yes"; then
1017 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1018 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
1020 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
1021 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1022 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1023 errors used by para_audiod)
1025 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1026 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1027 enum of audio formats supported by audiod)
1028 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1029 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1033 ########################################################################### fade
1034 if test "$have_oss" = "yes" -o "$have_alsa" = "yes"; then
1036 executables="$executables fade"
1037 fade_cmdline_objs="fade"
1038 fade_errlist_objs="fade exec string fd version ggo"
1039 if test "$have_oss" = "yes"; then
1040 fade_errlist_objs="$fade_errlist_objs oss_mix"
1041 mixers="${mixers}oss "
1042 default_mixer="OSS_MIX"
1044 if test "$have_alsa" = "yes"; then
1045 fade_errlist_objs="$fade_errlist_objs alsa_mix"
1046 mixers="${mixers}alsa "
1047 default_mixer="ALSA_MIX"
1049 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
1050 AC_SUBST(fade_objs, add_dot_o($fade_objs))
1051 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
1052 objlist_to_errlist($fade_errlist_objs),
1053 errors used by para_fade)
1055 for i in $mixers; do
1056 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
1059 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
1060 enum of supported mixers)
1061 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
1062 use this mixer if none was specified)
1063 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
1064 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
1066 for i in $mixers; do
1067 printf 'extern void '$i'_mix_init(struct mixer *); '
1070 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
1071 init functions of the supported mixers)
1072 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
1073 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
1076 AC_MSG_WARN([no mixer support])
1078 ########################################################################### gui
1079 if test "$have_curses" = "yes"; then
1081 executables="$executables gui"
1082 gui_cmdline_objs="gui"
1096 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
1097 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1098 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1099 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1102 AC_MSG_WARN([no curses lib, cannot build para_gui])
1104 ######################################################################## filter
1113 filter_errlist_objs="
1137 filter_cmdline_objs="
1144 if test "$have_vorbis" = "yes"; then
1145 filters="$filters oggdec"
1146 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
1148 if test "$have_speex" = "yes"; then
1149 filters="$filters spxdec"
1150 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
1152 if test "$have_opus" = "yes"; then
1153 filters="$filters opusdec"
1154 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
1156 if test "$have_faad" = "yes"; then
1157 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
1158 filters="$filters aacdec"
1160 if test "$have_mad" = "yes"; then
1161 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
1162 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
1163 filters="$filters mp3dec"
1165 if test "$have_flac" = "yes"; then
1166 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
1167 filters="$filters flacdec"
1169 if test "$have_samplerate" = "yes"; then
1170 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1171 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
1172 filters="$filters resample"
1174 filters="$(echo $filters)"
1176 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
1178 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1179 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1180 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1182 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1183 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1184 enum of supported filters)
1185 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1186 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1187 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1188 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1189 ########################################################################## recv
1219 if test "$have_vorbis" = "yes" || \
1220 test "$have_speex" = "yes" || \
1221 test "$have_opus" = "yes"; then
1222 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
1224 if test "$have_vorbis" = "yes"; then
1225 recv_errlist_objs="$recv_errlist_objs ogg_afh"
1227 if test "$have_speex" = "yes"; then
1228 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
1230 if test "$have_opus" = "yes"; then
1231 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
1233 if test "$have_faad" = "yes"; then
1234 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
1236 if test "$have_flac" = "yes"; then
1237 recv_errlist_objs="$recv_errlist_objs flac_afh"
1239 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
1240 AC_SUBST(receivers, "http dccp udp afh")
1241 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1242 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1243 errors used by para_recv)
1244 ########################################################################### afh
1245 audio_format_handlers="mp3 wma"
1246 afh_cmdline_objs="afh"
1259 if test "$have_vorbis" = "yes" || \
1260 test "$have_speex" = "yes" || \
1261 test "$have_opus" = "yes"; then
1262 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
1264 if test "$have_vorbis" = "yes"; then
1265 afh_errlist_objs="$afh_errlist_objs ogg_afh"
1266 audio_format_handlers="$audio_format_handlers ogg"
1268 if test "$have_speex" = "yes"; then
1269 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
1270 audio_format_handlers="$audio_format_handlers spx"
1272 if test "$have_opus" = "yes"; then
1273 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
1274 audio_format_handlers="$audio_format_handlers opus"
1276 if test "$have_faad" = "yes"; then
1277 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
1278 audio_format_handlers="$audio_format_handlers aac"
1280 if test "$have_flac" = "yes"; then
1281 afh_errlist_objs="$afh_errlist_objs flac_afh"
1282 audio_format_handlers="$audio_format_handlers flac"
1285 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
1287 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1288 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1289 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1290 ########################################################################## play
1334 if test "$have_core_audio" = "yes"; then
1335 play_errlist_objs="$play_errlist_objs osx_write ipc"
1336 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
1338 if test "$have_vorbis" = "yes" || \
1339 test "$have_speex" = "yes" || \
1340 test "$have_opus" = "yes"; then
1341 play_errlist_objs="$play_errlist_objs ogg_afh_common"
1343 if test "$have_vorbis" = "yes"; then
1344 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
1346 if test "$have_speex" = "yes"; then
1347 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
1349 if test "$have_opus" = "yes"; then
1350 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
1352 if test "$have_faad" = "yes"; then
1353 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
1355 if test "$have_mad" = "yes"; then
1356 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
1357 play_errlist_objs="$play_errlist_objs mp3dec_filter"
1359 if test "$have_flac" = "yes"; then
1360 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
1362 if test "$have_oss" = "yes"; then
1363 play_errlist_objs="$play_errlist_objs oss_write"
1364 play_cmdline_objs="$play_cmdline_objs oss_write"
1366 if test "$have_alsa" = "yes"; then
1367 play_errlist_objs="$play_errlist_objs alsa_write"
1368 play_cmdline_objs="$play_cmdline_objs alsa_write"
1370 if test "$have_ao" = "yes"; then
1371 play_errlist_objs="$play_errlist_objs ao_write"
1372 play_cmdline_objs="$play_cmdline_objs ao_write"
1374 if test "$have_readline" = "yes"; then
1375 play_errlist_objs="$play_errlist_objs interactive"
1377 if test "$have_samplerate" = "yes"; then
1378 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1379 play_cmdline_objs="$play_cmdline_objs resample_filter"
1382 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
1383 AC_SUBST(play_objs, add_dot_o($play_objs))
1384 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1385 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1386 ######################################################################### write
1387 write_cmdline_objs="
1391 write_errlist_objs="
1406 default_writer="FILE_WRITE"
1408 if test "$have_core_audio" = "yes"; then
1409 write_errlist_objs="$write_errlist_objs osx_write ipc"
1410 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
1411 writers="$writers osx"
1412 default_writer="OSX_WRITE"
1414 if test "$have_ao" = "yes"; then
1415 write_errlist_objs="$write_errlist_objs ao_write"
1416 write_cmdline_objs="$write_cmdline_objs ao_write"
1417 writers="$writers ao"
1418 default_writer="AO_WRITE"
1420 if test "$have_oss" = "yes"; then
1421 write_errlist_objs="$write_errlist_objs oss_write"
1422 write_cmdline_objs="$write_cmdline_objs oss_write"
1423 writers="$writers oss"
1424 default_writer="OSS_WRITE"
1426 if test "$have_alsa" = "yes"; then
1427 write_errlist_objs="$write_errlist_objs alsa_write"
1428 write_cmdline_objs="$write_cmdline_objs alsa_write"
1429 writers="$writers alsa"
1430 default_writer="ALSA_WRITE"
1433 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
1434 AC_SUBST(write_objs, add_dot_o($write_objs))
1435 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1436 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1437 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1438 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1439 enum of supported writers)
1440 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1441 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1442 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1443 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1444 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1445 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1446 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1447 ######################################################################## audioc
1448 audioc_cmdline_objs="audioc"
1449 audioc_errlist_objs="
1457 if test "$have_readline" = "yes"; then
1458 audioc_errlist_objs="$audioc_errlist_objs
1465 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1466 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1467 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1468 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1469 ############################################################# error2.h
1470 # these are always built
1473 $filter_errlist_objs
1474 $audioc_errlist_objs
1480 # optional executables
1481 if test "$build_server" = "yes"; then
1482 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1484 if test "$build_gui" = "yes"; then
1485 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1487 if test "$build_fade" = "yes"; then
1488 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1490 if test "$build_client" = "yes"; then
1491 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1493 if test "$build_audiod" = "yes"; then
1494 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1497 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1499 object_executable_matrix=
1500 for i in $executables; do
1501 eval objs=\$${i}_errlist_objs
1502 object_executable_matrix="$object_executable_matrix $i: $objs"
1504 # use echo to replace newlines by space
1505 AC_SUBST(object_executable_matrix, $(echo $object_executable_matrix))
1507 for obj in $all_errlist_objs; do
1508 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1510 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1511 [enum {$SS NUM_SS}],
1512 [list of all objects that use the paraslash error facility]
1514 ################################################################## status items
1516 status_items="basename status num_played mtime bitrate frequency file_size
1517 status_flags format score techinfo afs_mode
1518 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1519 offset seconds_total stream_start current_time audiod_uptime image_id
1520 lyrics_id duration directory lyrics_name image_name path hash channels
1521 last_played num_chunks chunk_time amplification artist title year album
1525 for i in $status_items; do
1526 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1528 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1529 [enum of all status items])
1532 for i in $status_items; do
1533 result="$result \"$i\", "
1535 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1536 [char * array of all status items])
1538 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1539 [formats supported by para_server and para_afh])
1541 AC_SUBST(executables)
1545 paraslash configuration:
1546 ~~~~~~~~~~~~~~~~~~~~~~~~
1547 unix socket credentials: $have_ucred
1548 readline (interactive CLIs): $have_readline
1549 audio formats handlers: $audio_format_handlers
1550 id3 version2 support: $have_libid3tag
1554 para_fade: $build_fade
1555 para_server: $build_server
1556 para_gui: $build_gui
1557 para_fade: $build_fade
1558 para_client: $build_client
1559 para_audiod: $build_audiod