2 # Process this file with autoconf to produce a configure script.
6 AC_INIT([paraslash], [m4_esyscmd_s(./GIT-VERSION-GEN)],
7 [maan@tuebingen.mpg.de], [], [http://people.tuebingen.mpg.de/maan/paraslash/])
8 AC_CONFIG_HEADERS([config.h])
10 AC_CONFIG_FILES([Makefile])
11 AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
12 AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
13 AC_DEFUN([make_errlist_defines], \
15 printf "DEFINE_ERRLIST($(echo $i | tr 'a-z' 'A-Z'));"; \
18 AC_DEFUN([make_para_errlists], \
20 printf "PARA_ERRLIST($(echo $i | tr 'a-z' 'A-Z')), "; \
23 AC_DEFUN([objlist_to_errlist],[ \
24 make_errlist_defines($@) \
25 [const char **para_errlist[[]]] = {make_para_errlists($@)} \
28 AC_PATH_PROG(UNAMEPATH, uname, no)
29 if test "$UNAMEPATH" = "no"; then
30 AC_MSG_ERROR(unable to determine system type)
32 AC_MSG_CHECKING(os type)
33 OSTYPE="`$UNAMEPATH -s`"
34 AC_MSG_RESULT("$OSTYPE")
36 if test "$OSTYPE" = "SunOS"; then
37 # needed on SunOS for socket magic
38 arch_cppflags="-D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
39 AC_SUBST(arch_cppflags)
44 AC_PATH_PROG([gengetopt], [gengetopt])
45 test -z "$gengetopt" && AC_MSG_ERROR(
46 [gengetopt is required to build this package])
48 AC_PATH_PROG([help2man], [help2man])
49 test -z "$help2man" && AC_MSG_ERROR(
50 [help2man is required to build this package])
52 AC_PATH_PROG([install], [install])
53 test -z "$install" && AC_MSG_ERROR(
54 [The install program is required to build this package])
59 executables="recv filter audioc write afh play"
60 ################################################################## clock_gettime
62 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
63 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
65 if test -n "$clock_gettime_lib"; then
66 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
67 define to 1 if clock_gettime() is supported])
69 if test "$clock_gettime_lib" = "rt"; then
70 AC_SUBST(clock_gettime_ldflags, -lrt)
72 ########################################################################### osl
74 OLD_CPPFLAGS="$CPPFLAGS"
75 OLD_LDFLAGS="$LDFLAGS"
77 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
78 [look for osl.h also in dir])])
79 if test -n "$with_osl_headers"; then
80 osl_cppflags="-I$with_osl_headers"
81 CPPFLAGS="$CPPFLAGS $osl_cppflags"
83 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
84 [look for libosl also in dir])])
85 if test -n "$with_osl_libs"; then
86 osl_libs="-L$with_osl_libs"
87 LDFLAGS="$LDFLAGS $osl_libs"
90 AC_CHECK_HEADER(osl.h, [], have_osl=no)
91 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
92 if test "$have_osl" = "yes"; then
93 AC_SUBST(osl_cppflags)
94 osl_ldflags="$osl_libs -losl"
97 AC_MSG_WARN([libosl not found, can not build para_server.
99 http://people.tuebingen.mpg.de/maan/osl/
101 git clone git://git.tuebingen.mpg.de/osl
104 CPPFLAGS="$OLD_CPPFLAGS"
105 LDFLAGS="$OLD_LDFLAGS"
107 ########################################################################### crypto
108 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
109 Force using crypto library "lib". This package requires either
110 openssl or libgcrypt being installed. Possible values for "lib"
111 are thus "openssl" and "gcrypt". If this option is not given,
112 openssl is tried first. If openssl was not found, gcrypt is
115 case "$enable_cryptolib" in
116 "openssl") check_openssl="yes"; check_gcrypt="no";;
117 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
118 "") check_openssl="yes"; check_gcrypt="yes";;
119 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
121 ###################################################################### openssl
122 if test "$check_openssl" = "yes"; then
123 OLD_CPPFLAGS="$CPPFLAGS"
124 OLD_LDFLAGS="$LDFLAGS"
127 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
128 [look for openssl headers also in dir])])
129 if test -n "$with_openssl_headers"; then
130 openssl_cppflags="-I$with_openssl_headers"
131 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
133 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
134 [look for openssl libraries also in dir])])
135 if test -n "$with_openssl_libs"; then
136 openssl_libs="-L$with_openssl_libs"
137 LDFLAGS="$LDFLAGS $openssl_libs"
139 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
140 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
141 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
142 # try harder: openssl is sometimes installed in /usr/local/ssl
143 openssl_cppflags="-I/usr/local/ssl/include"
144 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
145 openssl_libs="-L/usr/local/ssl/lib"
146 LDFLAGS="$LDFLAGS $openssl_libs"
148 unset ac_cv_header_openssl_ssl_h 2> /dev/null
149 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
150 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
151 if test "$have_openssl" = "yes"; then
152 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
155 if test "$have_openssl" = "yes"; then
156 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
157 AC_SUBST(openssl_cppflags)
158 openssl_ldflags="$openssl_libs -lssl -lcrypto"
159 AC_SUBST(openssl_ldflags)
163 AC_MSG_WARN([openssl libraries not found])
165 CPPFLAGS="$OLD_CPPFLAGS"
166 LDFLAGS="$OLD_LDFLAGS"
171 ########################################################################### gcrypt
172 if test "$check_gcrypt" = "yes"; then
173 OLD_CPPFLAGS="$CPPFLAGS"
174 OLD_LDFLAGS="$LDFLAGS"
177 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
178 [look for gcrypt headers also in dir])])
179 if test -n "$with_gcrypt_headers"; then
180 gcrypt_cppflags="-I$with_gcrypt_headers"
181 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
183 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
184 [look for libgcrypt also in dir])])
185 if test -n "$with_gcrypt_libs"; then
186 gcrypt_libs="-L$with_gcrypt_libs"
187 LDFLAGS="$LDFLAGS $gcrypt_libs"
189 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
190 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
191 if test "$have_gcrypt" = "yes"; then
192 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
193 AC_SUBST(gcrypt_cppflags)
194 gcrypt_ldflags="$gcrypt_libs -lgcrypt"
195 AC_SUBST(gcrypt_ldflags)
197 AC_MSG_WARN([gcrypt library not found])
199 CPPFLAGS="$OLD_CPPFLAGS"
200 LDFLAGS="$OLD_LDFLAGS"
205 ########################################################################### libsocket
206 AC_CHECK_LIB([c], [socket],
208 [socket_ldflags="-lsocket"]
210 AC_SUBST(socket_ldflags)
211 ########################################################################### libnsl
212 AC_CHECK_LIB([c], [gethostbyname],
214 [nsl_ldflags="-lnsl"]
216 AC_SUBST(nsl_ldflags)
217 ########################################################################### ucred
218 AC_MSG_CHECKING(for struct ucred)
219 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
221 #include <sys/types.h>
222 #include <sys/socket.h>
224 struct ucred sucred; sucred.pid=0;
225 ]])],[have_ucred=yes],[have_ucred=no])
226 AC_MSG_RESULT($have_ucred)
227 if test ${have_ucred} = yes; then
228 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
230 ########################################################################### gengetopt
231 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
233 [gengetopt_args_info_description],
234 [ggo_descriptions_declared=yes],
235 [ggo_descriptions_declared=no],
236 [#include "conftest-ggo.h"]
238 AC_SUBST(ggo_descriptions_declared)
239 ########################################################################### curses
241 OLD_CPPFLAGS="$CPPFLAGS"
242 OLD_LDFLAGS="$LDFLAGS"
244 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
245 [look for curses.h also in dir])])
246 if test -n "$with_curses_headers"; then
247 curses_cppflags="-I$with_curses_headers"
248 CPPFLAGS="$CPPFLAGS $curses_cppflags"
250 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
251 [look for libcurses also in dir])])
252 if test -n "$with_curses_libs"; then
253 curses_libs="-L$with_curses_libs"
254 LDFLAGS="$LDFLAGS $curses_libs"
256 AC_CHECK_HEADER(curses.h, [], [
259 curses_ldflags="$curses_libs"
260 AC_CHECK_LIB([ncursesw], [initscr],
261 [curses_ldflags="$curses_libs -lncursesw"], [
262 AC_CHECK_LIB([curses], [initscr],
263 [curses_ldflags="$curses_libs -lcurses"],
268 AC_SUBST(curses_cppflags)
269 AC_SUBST(curses_ldflags)
270 CPPFLAGS="$OLD_CPPFLAGS"
271 LDFLAGS="$OLD_LDFLAGS"
273 ########################################################################### ip_mreqn
274 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
275 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
281 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
282 AC_MSG_RESULT($have_ip_mreqn)
283 if test ${have_ip_mreqn} = yes; then
284 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
286 ########################################################################### osx
288 AC_MSG_CHECKING(for CoreAudio (MacOs))
289 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
290 #include <CoreAudio/CoreAudio.h>
293 ]])],[have_core_audio=yes],[have_core_audio=no])
294 AC_MSG_RESULT($have_core_audio)
295 if test ${have_core_audio} = yes; then
296 f1="-framework CoreAudio"
297 f2="-framework AudioToolbox"
298 f3="-framework AudioUnit"
299 f4="-framework CoreServices"
300 core_audio_ldflags="$f1 $f2 $f3 $f4"
301 AC_SUBST(core_audio_ldflags)
302 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
304 ####################################################### ogg/vorbis/speex/opus
306 OLD_CPPFLAGS="$CPPFLAGS"
307 OLD_LDFLAGS="$LDFLAGS"
309 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
310 [look for ogg headers also in dir])])
311 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
312 [look for ogg libs also in dir])])
313 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
314 [look for vorbis headers also in dir])])
315 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
316 [look for vorbis libs also in dir])])
317 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
318 [look for speex headers also in dir])])
319 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
320 [look for speex libs also in dir])])
321 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
322 [look for opus headers also in dir])])
323 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
324 [look for opus libs also in dir])])
326 if test -n "$with_ogg_headers"; then
327 ogg_cppflags="-I$with_ogg_headers"
328 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
330 if test -n "$with_ogg_libs"; then
331 ogg_libs="-L$with_ogg_libs"
332 LDFLAGS="$LDFLAGS $ogg_libs"
334 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
335 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
336 CPPFLAGS="$OLD_CPPFLAGS"
337 LDFLAGS="$OLD_LDFLAGS"
343 if test "$have_ogg" = "yes"; then
344 OLD_CPPFLAGS="$CPPFLAGS"
345 OLD_LDFLAGS="$LDFLAGS"
348 if test -n "$with_vorbis_headers"; then
349 vorbis_cppflags="-I$with_vorbis_headers"
350 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
352 if test -n "$with_vorbis_libs"; then
353 vorbis_libs="-L$with_vorbis_libs"
354 LDFLAGS="$LDFLAGS $vorbis_libs"
356 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
357 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
358 CPPFLAGS="$OLD_CPPFLAGS"
359 LDFLAGS="$OLD_LDFLAGS"
363 OLD_CPPFLAGS="$CPPFLAGS"
364 OLD_LDFLAGS="$LDFLAGS"
366 if test -n "$with_speex_headers"; then
367 speex_cppflags="-I$with_speex_headers"
368 CPPFLAGS="$CPPFLAGS $speex_cppflags"
370 if test -n "$with_speex_libs"; then
371 speex_libs="-L$with_speex_libs"
372 LDFLAGS="$LDFLAGS $speex_libs"
374 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
375 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
376 CPPFLAGS="$OLD_CPPFLAGS"
377 LDFLAGS="$OLD_LDFLAGS"
381 OLD_CPPFLAGS="$CPPFLAGS"
382 OLD_LDFLAGS="$LDFLAGS"
384 if test -n "$with_opus_headers"; then
385 opus_cppflags="-I$with_opus_headers"
386 CPPFLAGS="$CPPFLAGS $opus_cppflags"
388 if test -n "$with_opus_libs"; then
389 opus_libs="-L$with_opus_libs"
390 LDFLAGS="$LDFLAGS $opus_libs"
392 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
393 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
394 CPPFLAGS="$OLD_CPPFLAGS"
395 LDFLAGS="$OLD_LDFLAGS"
398 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
404 msg="support in para_server/para_filter/para_afh"
405 if test "$have_vorbis" = "yes" || \
406 test "$have_speex" = "yes" || \
407 test "$have_opus" = "yes"; then
408 AC_SUBST(ogg_cppflags)
409 ogg_ldflags="$ogg_libs -logg"
410 if test "$OSTYPE" = "Darwin"; then
411 ogg_ldflags="-Wl,-bind_at_load $ogg_ldflags"
413 AC_SUBST(ogg_ldflags)
415 if test "$have_vorbis" = "yes"; then
416 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
417 AC_SUBST(vorbis_cppflags)
418 vorbis_ldflags="$vorbis_libs -lvorbis -lvorbisfile"
419 AC_SUBST(vorbis_ldflags)
421 if test "$have_speex" = "yes"; then
422 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
423 AC_SUBST(speex_cppflags)
424 speex_ldflags="$speex_libs -lspeex"
425 AC_SUBST(speex_ldflags)
427 AC_MSG_WARN([no ogg/speex $msg])
429 if test "$have_opus" = "yes"; then
430 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
431 AC_SUBST(opus_cppflags)
432 opus_ldflags="$opus_libs -lopus"
433 AC_SUBST(opus_ldflags)
434 audio_format_handlers="$audio_format_handlers opus"
436 AC_MSG_WARN([no ogg/opus $msg])
438 ########################################################################### faad
440 OLD_CPPFLAGS="$CPPFLAGS"
441 OLD_LDFLAGS="$LDFLAGS"
443 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
444 [look for neaacdec.h also in dir])])
445 if test -n "$with_faad_headers"; then
446 faad_cppflags="-I$with_faad_headers"
447 CPPFLAGS="$CPPFLAGS $faad_cppflags"
449 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
450 [look for libfaad also in dir])])
451 if test -n "$with_faad_libs"; then
452 faad_libs="-L$with_faad_libs"
453 LDFLAGS="$LDFLAGS $faad_libs"
455 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
456 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
457 if test "$have_faad" = "yes"; then
458 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
459 AC_SUBST(faad_cppflags)
460 faad_ldflags="$faad_libs -lfaad"
461 AC_SUBST(faad_ldflags)
463 CPPFLAGS="$OLD_CPPFLAGS"
464 LDFLAGS="$OLD_LDFLAGS"
466 ########################################################################### mad
468 OLD_CPPFLAGS="$CPPFLAGS"
469 OLD_LDFLAGS="$LDFLAGS"
472 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
473 [look for mad.h also in dir])])
474 if test -n "$with_mad_headers"; then
475 mad_cppflags="-I$with_mad_headers"
476 CPPFLAGS="$CPPFLAGS $mad_cppflags"
478 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
479 [look for libmad also in dir])])
480 if test -n "$with_mad_libs"; then
481 mad_libs="-L$with_mad_libs"
482 LDFLAGS="$LDFLAGS $mad_libs"
484 AC_CHECK_HEADERS([mad.h], [], [
487 AC_CHECK_LIB([mad], [mad_stream_init], [], [
490 if test "$have_mad" = "yes"; then
491 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
492 AC_SUBST(mad_cppflags)
493 mad_ldflags="$mad_libs -lmad"
494 AC_SUBST(mad_ldflags)
496 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
498 CPPFLAGS="$OLD_CPPFLAGS"
499 LDFLAGS="$OLD_LDFLAGS"
501 ###################################################################### libid3tag
502 OLD_CPPFLAGS="$CPPFLAGS"
503 OLD_LDFLAGS="$LDFLAGS"
507 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
508 [look for id3tag header files also in dir])])
509 if test -n "$with_id3tag_headers"; then
510 id3tag_cppflags="-I$with_id3tag_headers"
511 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
513 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
514 [look for id3tag libs also in dir])])
515 if test -n "$with_id3tag_libs"; then
516 id3tag_libs="-L$with_id3tag_libs"
517 LDFLAGS="$LDFLAGS $id3tag_libs"
520 AC_MSG_CHECKING(for libid3tag)
521 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
524 struct id3_tag t = {.flags = 0};
525 ]])],[],[have_libid3tag=no])
526 AC_MSG_RESULT($have_libid3tag)
528 if test ${have_libid3tag} = yes; then
529 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
530 AC_SUBST(id3tag_cppflags)
531 AC_SUBST(id3tag_ldflags, "$id3tag_libs -lid3tag -lz")
533 CPPFLAGS="$OLD_CPPFLAGS"
534 LDFLAGS="$OLD_LDFLAGS"
536 ########################################################################### flac
537 OLD_CPPFLAGS="$CPPFLAGS"
538 OLD_LDFLAGS="$LDFLAGS"
542 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
543 [look for flac headers also in dir])])
544 if test -n "$with_flac_headers"; then
545 flac_cppflags="-I$with_flac_headers"
546 CPPFLAGS="$CPPFLAGS $flac_cppflags"
548 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
549 [look for flac libs also in dir])])
550 if test -n "$with_flac_libs"; then
551 flac_libs="-L$with_flac_libs"
552 LDFLAGS="$LDFLAGS $flac_libs"
554 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
555 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], [
556 # nope, try again with -logg
557 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [],
558 have_flac=no, -lm -logg)
560 if test "$have_flac" = "yes"; then
561 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
562 AC_SUBST(flac_cppflags)
563 flac_ldflags="$flac_libs -lFLAC"
564 AC_SUBST(flac_ldflags)
566 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
568 CPPFLAGS="$OLD_CPPFLAGS"
569 LDFLAGS="$OLD_LDFLAGS"
571 ########################################################################### oss
572 OLD_CPPFLAGS="$CPPFLAGS"
573 OLD_LDFLAGS="$LDFLAGS"
577 msg="=> will not build oss writer"
579 AC_CHECK_HEADER(sys/soundcard.h, [
580 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
581 oss_ldflags="-lossaudio"
582 AC_SUBST(oss_ldflags)
588 AC_MSG_WARN([no sys/soundcard.h $msg])
591 CPPFLAGS="$OLD_CPPFLAGS"
592 LDFLAGS="$OLD_LDFLAGS"
595 ########################################################################### alsa
596 OLD_CPPFLAGS="$CPPFLAGS"
597 OLD_LDFLAGS="$LDFLAGS"
600 msg="=> no alsa support for para_audiod/para_write"
601 if test "$OSTYPE" != "Linux"; then
606 if test "$have_alsa" = "yes"; then
607 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
609 AC_MSG_WARN([no alsa/asoundlib $msg])
613 if test "$have_alsa" = "yes"; then
614 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
616 AC_MSG_WARN([no libasound $msg])
620 if test "$have_alsa" = "yes"; then
621 alsa_ldflags="-lasound"
622 AC_SUBST(alsa_ldflags)
625 CPPFLAGS="$OLD_CPPFLAGS"
626 LDFLAGS="$OLD_LDFLAGS"
628 ########################################################################### libao
629 OLD_CPPFLAGS="$CPPFLAGS"
630 OLD_LDFLAGS="$LDFLAGS"
634 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
635 [look for ao/ao.h also in dir])])
636 if test -n "$with_ao_headers"; then
637 ao_cppflags="-I$with_ao_headers"
638 CPPFLAGS="$CPPFLAGS $ao_cppflags"
640 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
641 [look for libao also in dir])])
642 if test -n "$with_ao_libs"; then
643 ao_libs="-L$with_ao_libs"
644 LDFLAGS="$LDFLAGS $ao_libs"
646 msg="no libao support for para_audiod/para_write"
647 AC_CHECK_HEADERS([ao/ao.h], [
650 AC_MSG_WARN([ao.h not found, $msg])
652 if test "$have_ao" = "yes"; then
653 AC_CHECK_LIB([ao], [ao_initialize], [], [
655 AC_MSG_WARN([ao lib not found or not working, $msg])
658 if test "$have_ao" = "yes"; then
659 AC_CHECK_HEADERS([pthread.h], [
662 AC_MSG_WARN([pthread.h not found, $msg])
665 if test "$have_ao" = "yes"; then
666 AC_CHECK_LIB([pthread], [pthread_create], [], [
668 AC_MSG_WARN([pthread lib not found or not working, $msg])
671 if test "$have_ao" = "yes"; then
672 AC_SUBST(ao_cppflags)
673 ao_ldflags="$ao_libs -lao -lpthread"
677 CPPFLAGS="$OLD_CPPFLAGS"
678 LDFLAGS="$OLD_LDFLAGS"
680 ############################################################# readline
681 OLD_CPPFLAGS="$CPPFLAGS"
682 OLD_LDFLAGS="$LDFLAGS"
686 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
687 [look for libreadline header files also in dir])])
688 if test -n "$with_readline_headers"; then
689 readline_cppflags="-I$with_readline_headers"
690 CPPFLAGS="$CPPFLAGS $readline_cppflags"
693 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
694 [look for readline library also in dir])])
695 if test -n "$with_readline_libs"; then
696 readline_libs="-L$with_readline_libs"
697 LDFLAGS="$LDFLAGS $readline_libs"
699 msg="no interactive cli support"
700 AC_CHECK_HEADERS([readline/readline.h], [
703 AC_MSG_WARN([readline/readline.h not found, $msg])
706 if test "$have_readline" = "yes"; then
707 readline_ldflags="$readline_libs"
708 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
709 readline_ldflags="$readline_ldflags -lreadline"
710 ], [have_readline="no"])
711 if test "$have_readline" = "no"; then # try with -lcurses
713 AC_MSG_NOTICE([trying again with -lcurses])
714 unset ac_cv_search_rl_free_keymap 2> /dev/null
715 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
717 readline_ldflags="$readline_ldflags -lreadline -lcurses"
720 if test "$have_readline" = "no"; then # try with -ltermcap
722 AC_MSG_NOTICE([trying again with -ltermcap])
723 unset ac_cv_search_rl_free_keymap 2> /dev/null
724 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
726 readline_ldflags="$readline_ldflags -lreadline -ltermcap"
731 if test "$have_readline" = "yes"; then
734 [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
738 #include <readline/readline.h>
741 AC_SUBST(readline_cppflags)
742 AC_SUBST(readline_ldflags)
743 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
745 AC_MSG_WARN([libreadline not found or unusable])
747 CPPFLAGS="$OLD_CPPFLAGS"
748 LDFLAGS="$OLD_LDFLAGS"
750 ############################################################# libsamplerate
751 OLD_CPPFLAGS="$CPPFLAGS"
752 OLD_LDFLAGS="$LDFLAGS"
755 have_samplerate="yes"
756 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
757 [look for samplerate headers also in dir])])
758 if test -n "$with_samplerate_headers"; then
759 samplerate_cppflags="-I$with_samplerate_headers"
760 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
762 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
763 [look for samplerate libs also in dir])])
764 if test -n "$with_samplerate_libs"; then
765 samplerate_libs="-L$with_samplerate_libs"
766 LDFLAGS="$LDFLAGS $samplerate_libs"
769 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
770 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
772 if test "$have_samplerate" = "yes"; then
773 AC_SUBST(samplerate_cppflags)
774 samplerate_ldflags="$samplerate_libs -lsamplerate"
775 AC_SUBST(samplerate_ldflags)
777 AC_MSG_WARN([no resample support in para_audiod/para_filter])
779 CPPFLAGS="$OLD_CPPFLAGS"
780 LDFLAGS="$OLD_LDFLAGS"
782 ######################################################################### server
783 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
784 -a "$have_osl" = "yes" ; then
787 executables="$executables server"
788 server_cmdline_objs="server"
789 server_errlist_objs="
828 if test "$have_openssl" = "yes"; then
829 server_errlist_objs="$server_errlist_objs crypt"
831 if test "$have_gcrypt" = "yes"; then
832 server_errlist_objs="$server_errlist_objs gcrypt"
834 if test "$have_vorbis" = "yes" || \
835 test "$have_speex" = "yes" || \
836 test "$have_opus" = "yes"; then
837 server_errlist_objs="$server_errlist_objs ogg_afh_common"
839 if test "$have_vorbis" = "yes"; then
840 server_errlist_objs="$server_errlist_objs ogg_afh"
842 if test "$have_speex" = "yes"; then
843 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
845 if test "$have_opus" = "yes"; then
846 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
848 if test "$have_faad" = "yes"; then
849 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
851 if test "$have_flac" = "yes"; then
852 server_errlist_objs="$server_errlist_objs flac_afh"
854 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
855 AC_SUBST(server_objs, add_dot_o($server_objs))
856 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
857 objlist_to_errlist($server_errlist_objs), errors used by para_server)
861 ############################################################# client
862 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
864 executables="$executables client"
865 client_cmdline_objs="client"
866 client_errlist_objs="
882 if test "$have_openssl" = "yes"; then
883 client_errlist_objs="$client_errlist_objs crypt"
885 if test "$have_gcrypt" = "yes"; then
886 client_errlist_objs="$client_errlist_objs gcrypt"
888 if test "$have_readline" = "yes"; then
889 client_errlist_objs="$client_errlist_objs interactive"
891 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
892 AC_SUBST(client_objs, add_dot_o($client_objs))
893 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
894 objlist_to_errlist($client_errlist_objs), errors used by para_client)
898 ############################################################# audiod
899 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
901 executables="$executables audiod"
902 audiod_audio_formats="wma"
903 audiod_cmdline_objs="$audiod_cmdline_objs
915 audiod_errlist_objs="$audiod_errlist_objs
953 if test "$have_openssl" = "yes"; then
954 audiod_errlist_objs="$audiod_errlist_objs crypt"
956 if test "$have_gcrypt" = "yes"; then
957 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
959 if test "$have_core_audio" = "yes"; then
960 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
961 audiod_cmdline_objs="$audiod_cmdline_objs osx_write"
963 if test "$have_vorbis" = "yes"; then
964 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
965 audiod_audio_formats="$audiod_audio_formats ogg"
967 if test "$have_speex" = "yes"; then
968 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
969 audiod_audio_formats="$audiod_audio_formats spx"
971 if test "$have_opus" = "yes"; then
972 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
973 audiod_audio_formats="$audiod_audio_formats opus"
975 if test "$have_faad" = "yes"; then
976 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
977 audiod_audio_formats="$audiod_audio_formats aac"
979 if test "$have_mad" = "yes"; then
980 audiod_audio_formats="$audiod_audio_formats mp3"
981 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
982 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
984 if test "$have_flac" = "yes"; then
985 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
986 audiod_audio_formats="$audiod_audio_formats flac"
988 if test "$have_oss" = "yes"; then
989 audiod_errlist_objs="$audiod_errlist_objs oss_write"
990 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
992 if test "$have_alsa" = "yes"; then
993 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
994 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
996 if test "$have_ao" = "yes"; then
997 audiod_errlist_objs="$audiod_errlist_objs ao_write"
998 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
1000 if test "$have_samplerate" = "yes"; then
1001 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1002 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
1004 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
1005 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1006 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1007 errors used by para_audiod)
1009 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1010 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1011 enum of audio formats supported by audiod)
1012 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1013 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1017 ########################################################################### fade
1018 if test "$have_oss" = "yes" -o "$have_alsa" = "yes"; then
1020 executables="$executables fade"
1021 fade_cmdline_objs="fade"
1022 fade_errlist_objs="fade exec string fd version ggo"
1023 if test "$have_oss" = "yes"; then
1024 fade_errlist_objs="$fade_errlist_objs oss_mix"
1025 mixers="${mixers}oss "
1026 default_mixer="OSS_MIX"
1028 if test "$have_alsa" = "yes"; then
1029 fade_errlist_objs="$fade_errlist_objs alsa_mix"
1030 mixers="${mixers}alsa "
1031 default_mixer="ALSA_MIX"
1033 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
1034 AC_SUBST(fade_objs, add_dot_o($fade_objs))
1035 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
1036 objlist_to_errlist($fade_errlist_objs),
1037 errors used by para_fade)
1039 for i in $mixers; do
1040 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
1043 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
1044 enum of supported mixers)
1045 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
1046 use this mixer if none was specified)
1047 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
1048 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
1050 for i in $mixers; do
1051 printf 'extern void '$i'_mix_init(struct mixer *); '
1054 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
1055 init functions of the supported mixers)
1056 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
1057 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
1060 AC_MSG_WARN([no mixer support])
1062 ########################################################################### gui
1063 if test "$have_curses" = "yes"; then
1065 executables="$executables gui"
1066 gui_cmdline_objs="gui"
1081 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
1082 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1083 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1084 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1087 AC_MSG_WARN([no curses lib, cannot build para_gui])
1089 ######################################################################## filter
1099 filter_errlist_objs="
1124 filter_cmdline_objs="
1132 if test "$have_vorbis" = "yes"; then
1133 filters="$filters oggdec"
1134 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
1136 if test "$have_speex" = "yes"; then
1137 filters="$filters spxdec"
1138 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
1140 if test "$have_opus" = "yes"; then
1141 filters="$filters opusdec"
1142 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
1144 if test "$have_faad" = "yes"; then
1145 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
1146 filters="$filters aacdec"
1148 if test "$have_mad" = "yes"; then
1149 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
1150 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
1151 filters="$filters mp3dec"
1153 if test "$have_flac" = "yes"; then
1154 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
1155 filters="$filters flacdec"
1157 if test "$have_samplerate" = "yes"; then
1158 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1159 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
1160 filters="$filters resample"
1162 filters="$(echo $filters)"
1164 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
1166 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1167 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1168 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1170 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1171 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1172 enum of supported filters)
1173 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1174 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1175 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1176 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1177 ########################################################################## recv
1207 if test "$have_vorbis" = "yes" || \
1208 test "$have_speex" = "yes" || \
1209 test "$have_opus" = "yes"; then
1210 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
1212 if test "$have_vorbis" = "yes"; then
1213 recv_errlist_objs="$recv_errlist_objs ogg_afh"
1215 if test "$have_speex" = "yes"; then
1216 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
1218 if test "$have_opus" = "yes"; then
1219 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
1221 if test "$have_faad" = "yes"; then
1222 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
1224 if test "$have_flac" = "yes"; then
1225 recv_errlist_objs="$recv_errlist_objs flac_afh"
1227 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
1228 AC_SUBST(receivers, "http dccp udp afh")
1229 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1230 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1231 errors used by para_recv)
1232 ########################################################################### afh
1233 audio_format_handlers="mp3 wma"
1234 afh_cmdline_objs="afh"
1247 if test "$have_vorbis" = "yes" || \
1248 test "$have_speex" = "yes" || \
1249 test "$have_opus" = "yes"; then
1250 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
1252 if test "$have_vorbis" = "yes"; then
1253 afh_errlist_objs="$afh_errlist_objs ogg_afh"
1254 audio_format_handlers="$audio_format_handlers ogg"
1256 if test "$have_speex" = "yes"; then
1257 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
1258 audio_format_handlers="$audio_format_handlers spx"
1260 if test "$have_opus" = "yes"; then
1261 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
1262 audio_format_handlers="$audio_format_handlers opus"
1264 if test "$have_faad" = "yes"; then
1265 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
1266 audio_format_handlers="$audio_format_handlers aac"
1268 if test "$have_flac" = "yes"; then
1269 afh_errlist_objs="$afh_errlist_objs flac_afh"
1270 audio_format_handlers="$audio_format_handlers flac"
1273 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
1275 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1276 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1277 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1278 ########################################################################## play
1324 if test "$have_core_audio" = "yes"; then
1325 play_errlist_objs="$play_errlist_objs osx_write ipc"
1326 play_cmdline_objs="$play_cmdline_objs osx_write"
1328 if test "$have_vorbis" = "yes" || \
1329 test "$have_speex" = "yes" || \
1330 test "$have_opus" = "yes"; then
1331 play_errlist_objs="$play_errlist_objs ogg_afh_common"
1333 if test "$have_vorbis" = "yes"; then
1334 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
1336 if test "$have_speex" = "yes"; then
1337 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
1339 if test "$have_opus" = "yes"; then
1340 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
1342 if test "$have_faad" = "yes"; then
1343 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
1345 if test "$have_mad" = "yes"; then
1346 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
1347 play_errlist_objs="$play_errlist_objs mp3dec_filter"
1349 if test "$have_flac" = "yes"; then
1350 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
1352 if test "$have_oss" = "yes"; then
1353 play_errlist_objs="$play_errlist_objs oss_write"
1354 play_cmdline_objs="$play_cmdline_objs oss_write"
1356 if test "$have_alsa" = "yes"; then
1357 play_errlist_objs="$play_errlist_objs alsa_write"
1358 play_cmdline_objs="$play_cmdline_objs alsa_write"
1360 if test "$have_ao" = "yes"; then
1361 play_errlist_objs="$play_errlist_objs ao_write"
1362 play_cmdline_objs="$play_cmdline_objs ao_write"
1364 if test "$have_readline" = "yes"; then
1365 play_errlist_objs="$play_errlist_objs interactive"
1367 if test "$have_samplerate" = "yes"; then
1368 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1369 play_cmdline_objs="$play_cmdline_objs resample_filter"
1372 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
1373 AC_SUBST(play_objs, add_dot_o($play_objs))
1374 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1375 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1376 ######################################################################### write
1377 write_cmdline_objs="
1381 write_errlist_objs="
1396 default_writer="FILE_WRITE"
1398 if test "$have_core_audio" = "yes"; then
1399 write_errlist_objs="$write_errlist_objs osx_write ipc"
1400 write_cmdline_objs="$write_cmdline_objs osx_write"
1401 writers="$writers osx"
1402 default_writer="OSX_WRITE"
1404 if test "$have_ao" = "yes"; then
1405 write_errlist_objs="$write_errlist_objs ao_write"
1406 write_cmdline_objs="$write_cmdline_objs ao_write"
1407 writers="$writers ao"
1408 default_writer="AO_WRITE"
1410 if test "$have_oss" = "yes"; then
1411 write_errlist_objs="$write_errlist_objs oss_write"
1412 write_cmdline_objs="$write_cmdline_objs oss_write"
1413 writers="$writers oss"
1414 default_writer="OSS_WRITE"
1416 if test "$have_alsa" = "yes"; then
1417 write_errlist_objs="$write_errlist_objs alsa_write"
1418 write_cmdline_objs="$write_cmdline_objs alsa_write"
1419 writers="$writers alsa"
1420 default_writer="ALSA_WRITE"
1423 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
1424 AC_SUBST(write_objs, add_dot_o($write_objs))
1425 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1426 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1427 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1428 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1429 enum of supported writers)
1430 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1431 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1432 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1433 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1434 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1435 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1436 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1437 ######################################################################## audioc
1438 audioc_cmdline_objs="audioc"
1439 audioc_errlist_objs="
1447 if test "$have_readline" = "yes"; then
1448 audioc_errlist_objs="$audioc_errlist_objs
1455 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1456 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1457 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1458 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1459 ############################################################# error2.h
1460 # these are always built
1463 $filter_errlist_objs
1464 $audioc_errlist_objs
1470 # optional executables
1471 if test "$build_server" = "yes"; then
1472 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1474 if test "$build_gui" = "yes"; then
1475 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1477 if test "$build_fade" = "yes"; then
1478 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1480 if test "$build_client" = "yes"; then
1481 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1483 if test "$build_audiod" = "yes"; then
1484 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1487 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1489 object_executable_matrix=
1490 for i in $executables; do
1491 eval objs=\$${i}_errlist_objs
1492 object_executable_matrix="$object_executable_matrix $i: $objs"
1494 # use echo to replace newlines by space
1495 AC_SUBST(object_executable_matrix, $(echo $object_executable_matrix))
1497 SS=$(for obj in $all_errlist_objs; do
1498 printf '%s' " SS_$obj,"; done | tr 'a-z' 'A-Z')
1499 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1500 [enum {$SS NUM_SS}],
1501 [list of all objects that use the paraslash error facility]
1503 ################################################################## status items
1505 status_items="basename status num_played mtime bitrate frequency file_size
1506 status_flags format score techinfo afs_mode
1507 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1508 offset seconds_total stream_start current_time audiod_uptime image_id
1509 lyrics_id duration directory lyrics_name image_name path hash channels
1510 last_played num_chunks chunk_time amplification artist title year album
1514 for i in $status_items; do
1515 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1517 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1518 [enum of all status items])
1521 for i in $status_items; do
1522 result="$result \"$i\", "
1524 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1525 [char * array of all status items])
1527 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1528 [formats supported by para_server and para_afh])
1530 AC_SUBST(executables)
1534 paraslash configuration:
1535 ~~~~~~~~~~~~~~~~~~~~~~~~
1536 unix socket credentials: $have_ucred
1537 readline (interactive CLIs): $have_readline
1538 audio formats handlers: $audio_format_handlers
1539 id3 version2 support: $have_libid3tag
1543 para_fade: $build_fade
1544 para_server: $build_server
1545 para_gui: $build_gui
1546 para_fade: $build_fade
1547 para_client: $build_client
1548 para_audiod: $build_audiod