2 # Process this file with autoconf to produce a configure script.
6 AC_INIT([paraslash],[git],[maan@tuebingen.mpg.de])
7 AC_CONFIG_HEADERS([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])
58 executables="recv filter audioc write afh play"
59 ################################################################## clock_gettime
61 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
62 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
64 if test -n "$clock_gettime_lib"; then
65 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
66 define to 1 if clock_gettime() is supported])
68 if test "$clock_gettime_lib" = "rt"; then
69 AC_SUBST(clock_gettime_ldflags, -lrt)
71 ########################################################################### osl
73 OLD_CPPFLAGS="$CPPFLAGS"
74 OLD_LDFLAGS="$LDFLAGS"
76 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
77 [look for osl.h also in dir])])
78 if test -n "$with_osl_headers"; then
79 osl_cppflags="-I$with_osl_headers"
80 CPPFLAGS="$CPPFLAGS $osl_cppflags"
82 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
83 [look for libosl also in dir])])
84 if test -n "$with_osl_libs"; then
85 osl_libs="-L$with_osl_libs"
86 LDFLAGS="$LDFLAGS $osl_libs"
89 AC_CHECK_HEADER(osl.h, [], have_osl=no)
90 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
91 if test "$have_osl" = "yes"; then
92 AC_SUBST(osl_cppflags)
93 osl_ldflags="$osl_libs -losl"
96 AC_MSG_WARN([libosl not found, can not build para_server.
98 http://people.tuebingen.mpg.de/maan/osl/
100 git clone git://git.tuebingen.mpg.de/osl
103 CPPFLAGS="$OLD_CPPFLAGS"
104 LDFLAGS="$OLD_LDFLAGS"
106 ########################################################################### crypto
107 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
108 Force using crypto library "lib". This package requires either
109 openssl or libgcrypt being installed. Possible values for "lib"
110 are thus "openssl" and "gcrypt". If this option is not given,
111 openssl is tried first. If openssl was not found, gcrypt is
114 case "$enable_cryptolib" in
115 "openssl") check_openssl="yes"; check_gcrypt="no";;
116 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
117 "") check_openssl="yes"; check_gcrypt="yes";;
118 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
120 ###################################################################### openssl
121 if test "$check_openssl" = "yes"; then
122 OLD_CPPFLAGS="$CPPFLAGS"
123 OLD_LDFLAGS="$LDFLAGS"
126 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
127 [look for openssl headers also in dir])])
128 if test -n "$with_openssl_headers"; then
129 openssl_cppflags="-I$with_openssl_headers"
130 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
132 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
133 [look for openssl libraries also in dir])])
134 if test -n "$with_openssl_libs"; then
135 openssl_libs="-L$with_openssl_libs"
136 LDFLAGS="$LDFLAGS $openssl_libs"
138 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
139 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
140 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
141 # try harder: openssl is sometimes installed in /usr/local/ssl
142 openssl_cppflags="-I/usr/local/ssl/include"
143 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
144 openssl_libs="-L/usr/local/ssl/lib"
145 LDFLAGS="$LDFLAGS $openssl_libs"
147 unset ac_cv_header_openssl_ssl_h 2> /dev/null
148 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
149 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
150 if test "$have_openssl" = "yes"; then
151 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
154 if test "$have_openssl" = "yes"; then
155 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
156 AC_SUBST(openssl_cppflags)
157 openssl_ldflags="$openssl_libs -lssl -lcrypto"
158 AC_SUBST(openssl_ldflags)
162 AC_MSG_WARN([openssl libraries not found])
164 CPPFLAGS="$OLD_CPPFLAGS"
165 LDFLAGS="$OLD_LDFLAGS"
170 ########################################################################### gcrypt
171 if test "$check_gcrypt" = "yes"; then
172 OLD_CPPFLAGS="$CPPFLAGS"
173 OLD_LDFLAGS="$LDFLAGS"
176 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
177 [look for gcrypt headers also in dir])])
178 if test -n "$with_gcrypt_headers"; then
179 gcrypt_cppflags="-I$with_gcrypt_headers"
180 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
182 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
183 [look for libgcrypt also in dir])])
184 if test -n "$with_gcrypt_libs"; then
185 gcrypt_libs="-L$with_gcrypt_libs"
186 LDFLAGS="$LDFLAGS $gcrypt_libs"
188 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
189 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
190 if test "$have_gcrypt" = "yes"; then
191 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
192 AC_SUBST(gcrypt_cppflags)
193 gcrypt_ldflags="$gcrypt_libs -lgcrypt"
194 AC_SUBST(gcrypt_ldflags)
196 AC_MSG_WARN([gcrypt library not found])
198 CPPFLAGS="$OLD_CPPFLAGS"
199 LDFLAGS="$OLD_LDFLAGS"
204 ########################################################################### libsocket
205 AC_CHECK_LIB([c], [socket],
207 [socket_ldflags="-lsocket"]
209 AC_SUBST(socket_ldflags)
210 ########################################################################### libnsl
211 AC_CHECK_LIB([c], [gethostbyname],
213 [nsl_ldflags="-lnsl"]
215 AC_SUBST(nsl_ldflags)
216 ########################################################################### ucred
217 AC_MSG_CHECKING(for struct ucred)
218 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
220 #include <sys/types.h>
221 #include <sys/socket.h>
223 struct ucred sucred; sucred.pid=0;
224 ]])],[have_ucred=yes],[have_ucred=no])
225 AC_MSG_RESULT($have_ucred)
226 if test ${have_ucred} = yes; then
227 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
229 ########################################################################### gengetopt
230 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
232 [gengetopt_args_info_description],
233 [ggo_descriptions_declared=yes],
234 [ggo_descriptions_declared=no],
235 [#include "conftest-ggo.h"]
237 AC_SUBST(ggo_descriptions_declared)
238 ########################################################################### curses
240 OLD_CPPFLAGS="$CPPFLAGS"
241 OLD_LDFLAGS="$LDFLAGS"
243 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
244 [look for curses.h also in dir])])
245 if test -n "$with_curses_headers"; then
246 curses_cppflags="-I$with_curses_headers"
247 CPPFLAGS="$CPPFLAGS $curses_cppflags"
249 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
250 [look for libcurses also in dir])])
251 if test -n "$with_curses_libs"; then
252 curses_libs="-L$with_curses_libs"
253 LDFLAGS="$LDFLAGS $curses_libs"
255 AC_CHECK_HEADER(curses.h, [], [
258 curses_ldflags="$curses_libs"
259 AC_CHECK_LIB([ncursesw], [initscr],
260 [curses_ldflags="$curses_libs -lncursesw"], [
261 AC_CHECK_LIB([curses], [initscr],
262 [curses_ldflags="$curses_libs -lcurses"],
267 AC_SUBST(curses_cppflags)
268 AC_SUBST(curses_ldflags)
269 CPPFLAGS="$OLD_CPPFLAGS"
270 LDFLAGS="$OLD_LDFLAGS"
272 ########################################################################### ip_mreqn
273 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
274 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
280 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
281 AC_MSG_RESULT($have_ip_mreqn)
282 if test ${have_ip_mreqn} = yes; then
283 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
285 ########################################################################### osx
287 AC_MSG_CHECKING(for CoreAudio (MacOs))
288 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
289 #include <CoreAudio/CoreAudio.h>
292 ]])],[have_core_audio=yes],[have_core_audio=no])
293 AC_MSG_RESULT($have_core_audio)
294 if test ${have_core_audio} = yes; then
295 f1="-framework CoreAudio"
296 f2="-framework AudioToolbox"
297 f3="-framework AudioUnit"
298 f4="-framework CoreServices"
299 core_audio_ldflags="$f1 $f2 $f3 $f4"
300 AC_SUBST(core_audio_ldflags)
301 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
303 ####################################################### ogg/vorbis/speex/opus
305 OLD_CPPFLAGS="$CPPFLAGS"
306 OLD_LDFLAGS="$LDFLAGS"
308 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
309 [look for ogg headers also in dir])])
310 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
311 [look for ogg libs also in dir])])
312 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
313 [look for vorbis headers also in dir])])
314 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
315 [look for vorbis libs also in dir])])
316 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
317 [look for speex headers also in dir])])
318 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
319 [look for speex libs also in dir])])
320 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
321 [look for opus headers also in dir])])
322 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
323 [look for opus libs also in dir])])
325 if test -n "$with_ogg_headers"; then
326 ogg_cppflags="-I$with_ogg_headers"
327 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
329 if test -n "$with_ogg_libs"; then
330 ogg_libs="-L$with_ogg_libs"
331 LDFLAGS="$LDFLAGS $ogg_libs"
333 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
334 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
335 CPPFLAGS="$OLD_CPPFLAGS"
336 LDFLAGS="$OLD_LDFLAGS"
342 if test "$have_ogg" = "yes"; then
343 OLD_CPPFLAGS="$CPPFLAGS"
344 OLD_LDFLAGS="$LDFLAGS"
347 if test -n "$with_vorbis_headers"; then
348 vorbis_cppflags="-I$with_vorbis_headers"
349 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
351 if test -n "$with_vorbis_libs"; then
352 vorbis_libs="-L$with_vorbis_libs"
353 LDFLAGS="$LDFLAGS $vorbis_libs"
355 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
356 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
357 CPPFLAGS="$OLD_CPPFLAGS"
358 LDFLAGS="$OLD_LDFLAGS"
362 OLD_CPPFLAGS="$CPPFLAGS"
363 OLD_LDFLAGS="$LDFLAGS"
365 if test -n "$with_speex_headers"; then
366 speex_cppflags="-I$with_speex_headers"
367 CPPFLAGS="$CPPFLAGS $speex_cppflags"
369 if test -n "$with_speex_libs"; then
370 speex_libs="-L$with_speex_libs"
371 LDFLAGS="$LDFLAGS $speex_libs"
373 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
374 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
375 CPPFLAGS="$OLD_CPPFLAGS"
376 LDFLAGS="$OLD_LDFLAGS"
380 OLD_CPPFLAGS="$CPPFLAGS"
381 OLD_LDFLAGS="$LDFLAGS"
383 if test -n "$with_opus_headers"; then
384 opus_cppflags="-I$with_opus_headers"
385 CPPFLAGS="$CPPFLAGS $opus_cppflags"
387 if test -n "$with_opus_libs"; then
388 opus_libs="-L$with_opus_libs"
389 LDFLAGS="$LDFLAGS $opus_libs"
391 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
392 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
393 CPPFLAGS="$OLD_CPPFLAGS"
394 LDFLAGS="$OLD_LDFLAGS"
397 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
403 msg="support in para_server/para_filter/para_afh"
404 if test "$have_vorbis" = "yes" || \
405 test "$have_speex" = "yes" || \
406 test "$have_opus" = "yes"; then
407 AC_SUBST(ogg_cppflags)
408 ogg_ldflags="$ogg_libs -logg"
409 if test "$OSTYPE" = "Darwin"; then
410 ogg_ldflags="-Wl,-bind_at_load $ogg_ldflags"
412 AC_SUBST(ogg_ldflags)
414 if test "$have_vorbis" = "yes"; then
415 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
416 AC_SUBST(vorbis_cppflags)
417 vorbis_ldflags="$vorbis_libs -lvorbis -lvorbisfile"
418 AC_SUBST(vorbis_ldflags)
420 if test "$have_speex" = "yes"; then
421 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
422 AC_SUBST(speex_cppflags)
423 speex_ldflags="$speex_libs -lspeex"
424 AC_SUBST(speex_ldflags)
426 AC_MSG_WARN([no ogg/speex $msg])
428 if test "$have_opus" = "yes"; then
429 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
430 AC_SUBST(opus_cppflags)
431 opus_ldflags="$opus_libs -lopus"
432 AC_SUBST(opus_ldflags)
433 audio_format_handlers="$audio_format_handlers opus"
435 AC_MSG_WARN([no ogg/opus $msg])
437 ########################################################################### faad
439 OLD_CPPFLAGS="$CPPFLAGS"
440 OLD_LDFLAGS="$LDFLAGS"
442 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
443 [look for neaacdec.h also in dir])])
444 if test -n "$with_faad_headers"; then
445 faad_cppflags="-I$with_faad_headers"
446 CPPFLAGS="$CPPFLAGS $faad_cppflags"
448 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
449 [look for libfaad also in dir])])
450 if test -n "$with_faad_libs"; then
451 faad_libs="-L$with_faad_libs"
452 LDFLAGS="$LDFLAGS $faad_libs"
454 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
455 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
456 if test "$have_faad" = "yes"; then
457 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
458 AC_SUBST(faad_cppflags)
459 faad_ldflags="$faad_libs -lfaad"
460 AC_SUBST(faad_ldflags)
462 CPPFLAGS="$OLD_CPPFLAGS"
463 LDFLAGS="$OLD_LDFLAGS"
465 ########################################################################### mad
467 OLD_CPPFLAGS="$CPPFLAGS"
468 OLD_LDFLAGS="$LDFLAGS"
471 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
472 [look for mad.h also in dir])])
473 if test -n "$with_mad_headers"; then
474 mad_cppflags="-I$with_mad_headers"
475 CPPFLAGS="$CPPFLAGS $mad_cppflags"
477 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
478 [look for libmad also in dir])])
479 if test -n "$with_mad_libs"; then
480 mad_libs="-L$with_mad_libs"
481 LDFLAGS="$LDFLAGS $mad_libs"
483 AC_CHECK_HEADERS([mad.h], [], [
486 AC_CHECK_LIB([mad], [mad_stream_init], [], [
489 if test "$have_mad" = "yes"; then
490 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
491 AC_SUBST(mad_cppflags)
492 mad_ldflags="$mad_libs -lmad"
493 AC_SUBST(mad_ldflags)
495 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
497 CPPFLAGS="$OLD_CPPFLAGS"
498 LDFLAGS="$OLD_LDFLAGS"
500 ###################################################################### libid3tag
501 OLD_CPPFLAGS="$CPPFLAGS"
502 OLD_LDFLAGS="$LDFLAGS"
506 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
507 [look for id3tag header files also in dir])])
508 if test -n "$with_id3tag_headers"; then
509 id3tag_cppflags="-I$with_id3tag_headers"
510 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
512 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
513 [look for id3tag libs also in dir])])
514 if test -n "$with_id3tag_libs"; then
515 id3tag_libs="-L$with_id3tag_libs"
516 LDFLAGS="$LDFLAGS $id3tag_libs"
519 AC_MSG_CHECKING(for libid3tag)
520 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
523 struct id3_tag t = {.flags = 0};
524 ]])],[],[have_libid3tag=no])
525 AC_MSG_RESULT($have_libid3tag)
527 if test ${have_libid3tag} = yes; then
528 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
529 AC_SUBST(id3tag_cppflags)
530 AC_SUBST(id3tag_ldflags, "$id3tag_libs -lid3tag -lz")
532 CPPFLAGS="$OLD_CPPFLAGS"
533 LDFLAGS="$OLD_LDFLAGS"
535 ########################################################################### flac
536 OLD_CPPFLAGS="$CPPFLAGS"
537 OLD_LDFLAGS="$LDFLAGS"
541 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
542 [look for flac headers also in dir])])
543 if test -n "$with_flac_headers"; then
544 flac_cppflags="-I$with_flac_headers"
545 CPPFLAGS="$CPPFLAGS $flac_cppflags"
547 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
548 [look for flac libs also in dir])])
549 if test -n "$with_flac_libs"; then
550 flac_libs="-L$with_flac_libs"
551 LDFLAGS="$LDFLAGS $flac_libs"
553 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
554 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], [
555 # nope, try again with -logg
556 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [],
557 have_flac=no, -lm -logg)
559 if test "$have_flac" = "yes"; then
560 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
561 AC_SUBST(flac_cppflags)
562 flac_ldflags="$flac_libs -lFLAC"
563 AC_SUBST(flac_ldflags)
565 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
567 CPPFLAGS="$OLD_CPPFLAGS"
568 LDFLAGS="$OLD_LDFLAGS"
570 ########################################################################### oss
571 OLD_CPPFLAGS="$CPPFLAGS"
572 OLD_LDFLAGS="$LDFLAGS"
576 msg="=> will not build oss writer"
578 AC_CHECK_HEADER(sys/soundcard.h, [
579 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
580 oss_ldflags="-lossaudio"
581 AC_SUBST(oss_ldflags)
587 AC_MSG_WARN([no sys/soundcard.h $msg])
590 CPPFLAGS="$OLD_CPPFLAGS"
591 LDFLAGS="$OLD_LDFLAGS"
594 ########################################################################### alsa
595 OLD_CPPFLAGS="$CPPFLAGS"
596 OLD_LDFLAGS="$LDFLAGS"
599 msg="=> no alsa support for para_audiod/para_write"
600 if test "$OSTYPE" != "Linux"; then
605 if test "$have_alsa" = "yes"; then
606 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
608 AC_MSG_WARN([no alsa/asoundlib $msg])
612 if test "$have_alsa" = "yes"; then
613 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
615 AC_MSG_WARN([no libasound $msg])
619 if test "$have_alsa" = "yes"; then
620 alsa_ldflags="-lasound"
621 AC_SUBST(alsa_ldflags)
624 CPPFLAGS="$OLD_CPPFLAGS"
625 LDFLAGS="$OLD_LDFLAGS"
627 ########################################################################### libao
628 OLD_CPPFLAGS="$CPPFLAGS"
629 OLD_LDFLAGS="$LDFLAGS"
633 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
634 [look for ao/ao.h also in dir])])
635 if test -n "$with_ao_headers"; then
636 ao_cppflags="-I$with_ao_headers"
637 CPPFLAGS="$CPPFLAGS $ao_cppflags"
639 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
640 [look for libao also in dir])])
641 if test -n "$with_ao_libs"; then
642 ao_libs="-L$with_ao_libs"
643 LDFLAGS="$LDFLAGS $ao_libs"
645 msg="no libao support for para_audiod/para_write"
646 AC_CHECK_HEADERS([ao/ao.h], [
649 AC_MSG_WARN([ao.h not found, $msg])
651 if test "$have_ao" = "yes"; then
652 AC_CHECK_LIB([ao], [ao_initialize], [], [
654 AC_MSG_WARN([ao lib not found or not working, $msg])
657 if test "$have_ao" = "yes"; then
658 AC_CHECK_HEADERS([pthread.h], [
661 AC_MSG_WARN([pthread.h not found, $msg])
664 if test "$have_ao" = "yes"; then
665 AC_CHECK_LIB([pthread], [pthread_create], [], [
667 AC_MSG_WARN([pthread lib not found or not working, $msg])
670 if test "$have_ao" = "yes"; then
671 AC_SUBST(ao_cppflags)
672 ao_ldflags="$ao_libs -lao -lpthread"
676 CPPFLAGS="$OLD_CPPFLAGS"
677 LDFLAGS="$OLD_LDFLAGS"
679 ############################################################# readline
680 OLD_CPPFLAGS="$CPPFLAGS"
681 OLD_LDFLAGS="$LDFLAGS"
685 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
686 [look for libreadline header files also in dir])])
687 if test -n "$with_readline_headers"; then
688 readline_cppflags="-I$with_readline_headers"
689 CPPFLAGS="$CPPFLAGS $readline_cppflags"
692 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
693 [look for readline library also in dir])])
694 if test -n "$with_readline_libs"; then
695 readline_libs="-L$with_readline_libs"
696 LDFLAGS="$LDFLAGS $readline_libs"
698 msg="no interactive cli support"
699 AC_CHECK_HEADERS([readline/readline.h], [
702 AC_MSG_WARN([readline/readline.h not found, $msg])
705 if test "$have_readline" = "yes"; then
706 readline_ldflags="$readline_libs"
707 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
708 readline_ldflags="$readline_ldflags -lreadline"
709 ], [have_readline="no"])
710 if test "$have_readline" = "no"; then # try with -lcurses
712 AC_MSG_NOTICE([trying again with -lcurses])
713 unset ac_cv_search_rl_free_keymap 2> /dev/null
714 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
716 readline_ldflags="$readline_ldflags -lreadline -lcurses"
719 if test "$have_readline" = "no"; then # try with -ltermcap
721 AC_MSG_NOTICE([trying again with -ltermcap])
722 unset ac_cv_search_rl_free_keymap 2> /dev/null
723 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
725 readline_ldflags="$readline_ldflags -lreadline -ltermcap"
730 if test "$have_readline" = "yes"; then
733 [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
737 #include <readline/readline.h>
740 AC_SUBST(readline_cppflags)
741 AC_SUBST(readline_ldflags)
742 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
744 AC_MSG_WARN([libreadline not found or unusable])
746 CPPFLAGS="$OLD_CPPFLAGS"
747 LDFLAGS="$OLD_LDFLAGS"
749 ############################################################# libsamplerate
750 OLD_CPPFLAGS="$CPPFLAGS"
751 OLD_LDFLAGS="$LDFLAGS"
754 have_samplerate="yes"
755 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
756 [look for samplerate headers also in dir])])
757 if test -n "$with_samplerate_headers"; then
758 samplerate_cppflags="-I$with_samplerate_headers"
759 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
761 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
762 [look for samplerate libs also in dir])])
763 if test -n "$with_samplerate_libs"; then
764 samplerate_libs="-L$with_samplerate_libs"
765 LDFLAGS="$LDFLAGS $samplerate_libs"
768 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
769 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
771 if test "$have_samplerate" = "yes"; then
772 AC_SUBST(samplerate_cppflags)
773 samplerate_ldflags="$samplerate_libs -lsamplerate"
774 AC_SUBST(samplerate_ldflags)
776 AC_MSG_WARN([no resample support in para_audiod/para_filter])
778 CPPFLAGS="$OLD_CPPFLAGS"
779 LDFLAGS="$OLD_LDFLAGS"
781 ######################################################################### server
782 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
783 -a "$have_osl" = "yes" ; then
786 executables="$executables server"
787 server_cmdline_objs="server"
788 server_errlist_objs="
827 if test "$have_openssl" = "yes"; then
828 server_errlist_objs="$server_errlist_objs crypt"
830 if test "$have_gcrypt" = "yes"; then
831 server_errlist_objs="$server_errlist_objs gcrypt"
833 if test "$have_vorbis" = "yes" || \
834 test "$have_speex" = "yes" || \
835 test "$have_opus" = "yes"; then
836 server_errlist_objs="$server_errlist_objs ogg_afh_common"
838 if test "$have_vorbis" = "yes"; then
839 server_errlist_objs="$server_errlist_objs ogg_afh"
841 if test "$have_speex" = "yes"; then
842 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
844 if test "$have_opus" = "yes"; then
845 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
847 if test "$have_faad" = "yes"; then
848 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
850 if test "$have_flac" = "yes"; then
851 server_errlist_objs="$server_errlist_objs flac_afh"
853 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
854 AC_SUBST(server_objs, add_dot_o($server_objs))
855 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
856 objlist_to_errlist($server_errlist_objs), errors used by para_server)
860 ############################################################# client
861 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
863 executables="$executables client"
864 client_cmdline_objs="client"
865 client_errlist_objs="
881 if test "$have_openssl" = "yes"; then
882 client_errlist_objs="$client_errlist_objs crypt"
884 if test "$have_gcrypt" = "yes"; then
885 client_errlist_objs="$client_errlist_objs gcrypt"
887 if test "$have_readline" = "yes"; then
888 client_errlist_objs="$client_errlist_objs interactive"
890 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
891 AC_SUBST(client_objs, add_dot_o($client_objs))
892 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
893 objlist_to_errlist($client_errlist_objs), errors used by para_client)
897 ############################################################# audiod
898 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
900 executables="$executables audiod"
901 audiod_audio_formats="wma"
902 audiod_cmdline_objs="$audiod_cmdline_objs
914 audiod_errlist_objs="$audiod_errlist_objs
952 if test "$have_openssl" = "yes"; then
953 audiod_errlist_objs="$audiod_errlist_objs crypt"
955 if test "$have_gcrypt" = "yes"; then
956 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
958 if test "$have_core_audio" = "yes"; then
959 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
960 audiod_cmdline_objs="$audiod_cmdline_objs osx_write"
962 if test "$have_vorbis" = "yes"; then
963 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
964 audiod_audio_formats="$audiod_audio_formats ogg"
966 if test "$have_speex" = "yes"; then
967 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
968 audiod_audio_formats="$audiod_audio_formats spx"
970 if test "$have_opus" = "yes"; then
971 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
972 audiod_audio_formats="$audiod_audio_formats opus"
974 if test "$have_faad" = "yes"; then
975 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
976 audiod_audio_formats="$audiod_audio_formats aac"
978 if test "$have_mad" = "yes"; then
979 audiod_audio_formats="$audiod_audio_formats mp3"
980 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
981 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
983 if test "$have_flac" = "yes"; then
984 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
985 audiod_audio_formats="$audiod_audio_formats flac"
987 if test "$have_oss" = "yes"; then
988 audiod_errlist_objs="$audiod_errlist_objs oss_write"
989 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
991 if test "$have_alsa" = "yes"; then
992 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
993 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
995 if test "$have_ao" = "yes"; then
996 audiod_errlist_objs="$audiod_errlist_objs ao_write"
997 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
999 if test "$have_samplerate" = "yes"; then
1000 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1001 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
1003 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
1004 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1005 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1006 errors used by para_audiod)
1008 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1009 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1010 enum of audio formats supported by audiod)
1011 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1012 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1016 ########################################################################### fade
1017 if test "$have_oss" = "yes" -o "$have_alsa" = "yes"; then
1019 executables="$executables fade"
1020 fade_cmdline_objs="fade"
1021 fade_errlist_objs="fade exec string fd version ggo"
1022 if test "$have_oss" = "yes"; then
1023 fade_errlist_objs="$fade_errlist_objs oss_mix"
1024 mixers="${mixers}oss "
1025 default_mixer="OSS_MIX"
1027 if test "$have_alsa" = "yes"; then
1028 fade_errlist_objs="$fade_errlist_objs alsa_mix"
1029 mixers="${mixers}alsa "
1030 default_mixer="ALSA_MIX"
1032 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
1033 AC_SUBST(fade_objs, add_dot_o($fade_objs))
1034 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
1035 objlist_to_errlist($fade_errlist_objs),
1036 errors used by para_fade)
1038 for i in $mixers; do
1039 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
1042 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
1043 enum of supported mixers)
1044 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
1045 use this mixer if none was specified)
1046 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
1047 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
1049 for i in $mixers; do
1050 printf 'extern void '$i'_mix_init(struct mixer *); '
1053 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
1054 init functions of the supported mixers)
1055 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
1056 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
1059 AC_MSG_WARN([no mixer support])
1061 ########################################################################### gui
1062 if test "$have_curses" = "yes"; then
1064 executables="$executables gui"
1065 gui_cmdline_objs="gui"
1080 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
1081 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1082 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1083 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1086 AC_MSG_WARN([no curses lib, cannot build para_gui])
1088 ######################################################################## filter
1098 filter_errlist_objs="
1123 filter_cmdline_objs="
1131 if test "$have_vorbis" = "yes"; then
1132 filters="$filters oggdec"
1133 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
1135 if test "$have_speex" = "yes"; then
1136 filters="$filters spxdec"
1137 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
1139 if test "$have_opus" = "yes"; then
1140 filters="$filters opusdec"
1141 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
1143 if test "$have_faad" = "yes"; then
1144 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
1145 filters="$filters aacdec"
1147 if test "$have_mad" = "yes"; then
1148 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
1149 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
1150 filters="$filters mp3dec"
1152 if test "$have_flac" = "yes"; then
1153 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
1154 filters="$filters flacdec"
1156 if test "$have_samplerate" = "yes"; then
1157 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1158 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
1159 filters="$filters resample"
1161 filters="$(echo $filters)"
1163 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
1165 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1166 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1167 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1169 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1170 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1171 enum of supported filters)
1172 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1173 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1174 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1175 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1176 ########################################################################## recv
1206 if test "$have_vorbis" = "yes" || \
1207 test "$have_speex" = "yes" || \
1208 test "$have_opus" = "yes"; then
1209 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
1211 if test "$have_vorbis" = "yes"; then
1212 recv_errlist_objs="$recv_errlist_objs ogg_afh"
1214 if test "$have_speex" = "yes"; then
1215 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
1217 if test "$have_opus" = "yes"; then
1218 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
1220 if test "$have_faad" = "yes"; then
1221 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
1223 if test "$have_flac" = "yes"; then
1224 recv_errlist_objs="$recv_errlist_objs flac_afh"
1226 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
1227 AC_SUBST(receivers, "http dccp udp afh")
1228 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1229 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1230 errors used by para_recv)
1231 ########################################################################### afh
1232 audio_format_handlers="mp3 wma"
1233 afh_cmdline_objs="afh"
1246 if test "$have_vorbis" = "yes" || \
1247 test "$have_speex" = "yes" || \
1248 test "$have_opus" = "yes"; then
1249 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
1251 if test "$have_vorbis" = "yes"; then
1252 afh_errlist_objs="$afh_errlist_objs ogg_afh"
1253 audio_format_handlers="$audio_format_handlers ogg"
1255 if test "$have_speex" = "yes"; then
1256 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
1257 audio_format_handlers="$audio_format_handlers spx"
1259 if test "$have_opus" = "yes"; then
1260 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
1261 audio_format_handlers="$audio_format_handlers opus"
1263 if test "$have_faad" = "yes"; then
1264 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
1265 audio_format_handlers="$audio_format_handlers aac"
1267 if test "$have_flac" = "yes"; then
1268 afh_errlist_objs="$afh_errlist_objs flac_afh"
1269 audio_format_handlers="$audio_format_handlers flac"
1272 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
1274 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1275 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1276 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1277 ########################################################################## play
1323 if test "$have_core_audio" = "yes"; then
1324 play_errlist_objs="$play_errlist_objs osx_write ipc"
1325 play_cmdline_objs="$play_cmdline_objs osx_write"
1327 if test "$have_vorbis" = "yes" || \
1328 test "$have_speex" = "yes" || \
1329 test "$have_opus" = "yes"; then
1330 play_errlist_objs="$play_errlist_objs ogg_afh_common"
1332 if test "$have_vorbis" = "yes"; then
1333 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
1335 if test "$have_speex" = "yes"; then
1336 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
1338 if test "$have_opus" = "yes"; then
1339 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
1341 if test "$have_faad" = "yes"; then
1342 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
1344 if test "$have_mad" = "yes"; then
1345 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
1346 play_errlist_objs="$play_errlist_objs mp3dec_filter"
1348 if test "$have_flac" = "yes"; then
1349 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
1351 if test "$have_oss" = "yes"; then
1352 play_errlist_objs="$play_errlist_objs oss_write"
1353 play_cmdline_objs="$play_cmdline_objs oss_write"
1355 if test "$have_alsa" = "yes"; then
1356 play_errlist_objs="$play_errlist_objs alsa_write"
1357 play_cmdline_objs="$play_cmdline_objs alsa_write"
1359 if test "$have_ao" = "yes"; then
1360 play_errlist_objs="$play_errlist_objs ao_write"
1361 play_cmdline_objs="$play_cmdline_objs ao_write"
1363 if test "$have_readline" = "yes"; then
1364 play_errlist_objs="$play_errlist_objs interactive"
1366 if test "$have_samplerate" = "yes"; then
1367 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1368 play_cmdline_objs="$play_cmdline_objs resample_filter"
1371 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
1372 AC_SUBST(play_objs, add_dot_o($play_objs))
1373 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1374 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1375 ######################################################################### write
1376 write_cmdline_objs="
1380 write_errlist_objs="
1395 default_writer="FILE_WRITE"
1397 if test "$have_core_audio" = "yes"; then
1398 write_errlist_objs="$write_errlist_objs osx_write ipc"
1399 write_cmdline_objs="$write_cmdline_objs osx_write"
1400 writers="$writers osx"
1401 default_writer="OSX_WRITE"
1403 if test "$have_ao" = "yes"; then
1404 write_errlist_objs="$write_errlist_objs ao_write"
1405 write_cmdline_objs="$write_cmdline_objs ao_write"
1406 writers="$writers ao"
1407 default_writer="AO_WRITE"
1409 if test "$have_oss" = "yes"; then
1410 write_errlist_objs="$write_errlist_objs oss_write"
1411 write_cmdline_objs="$write_cmdline_objs oss_write"
1412 writers="$writers oss"
1413 default_writer="OSS_WRITE"
1415 if test "$have_alsa" = "yes"; then
1416 write_errlist_objs="$write_errlist_objs alsa_write"
1417 write_cmdline_objs="$write_cmdline_objs alsa_write"
1418 writers="$writers alsa"
1419 default_writer="ALSA_WRITE"
1422 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
1423 AC_SUBST(write_objs, add_dot_o($write_objs))
1424 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1425 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1426 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1427 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1428 enum of supported writers)
1429 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1430 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1431 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1432 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1433 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1434 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1435 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1436 ######################################################################## audioc
1437 audioc_cmdline_objs="audioc"
1438 audioc_errlist_objs="
1446 if test "$have_readline" = "yes"; then
1447 audioc_errlist_objs="$audioc_errlist_objs
1454 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1455 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1456 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1457 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1458 ############################################################# error2.h
1459 # these are always built
1462 $filter_errlist_objs
1463 $audioc_errlist_objs
1469 # optional executables
1470 if test "$build_server" = "yes"; then
1471 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1473 if test "$build_gui" = "yes"; then
1474 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1476 if test "$build_fade" = "yes"; then
1477 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1479 if test "$build_client" = "yes"; then
1480 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1482 if test "$build_audiod" = "yes"; then
1483 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1486 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1488 object_executable_matrix=
1489 for i in $executables; do
1490 eval objs=\$${i}_errlist_objs
1491 object_executable_matrix="$object_executable_matrix $i: $objs"
1493 # use echo to replace newlines by space
1494 AC_SUBST(object_executable_matrix, $(echo $object_executable_matrix))
1496 SS=$(for obj in $all_errlist_objs; do
1497 printf '%s' " SS_$obj,"; done | tr 'a-z' 'A-Z')
1498 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1499 [enum {$SS NUM_SS}],
1500 [list of all objects that use the paraslash error facility]
1502 ################################################################## status items
1504 status_items="basename status num_played mtime bitrate frequency file_size
1505 status_flags format score techinfo afs_mode
1506 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1507 offset seconds_total stream_start current_time audiod_uptime image_id
1508 lyrics_id duration directory lyrics_name image_name path hash channels
1509 last_played num_chunks chunk_time amplification artist title year album
1513 for i in $status_items; do
1514 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1516 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1517 [enum of all status items])
1520 for i in $status_items; do
1521 result="$result \"$i\", "
1523 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1524 [char * array of all status items])
1526 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1527 [formats supported by para_server and para_afh])
1529 AC_SUBST(executables)
1533 paraslash configuration:
1534 ~~~~~~~~~~~~~~~~~~~~~~~~
1535 unix socket credentials: $have_ucred
1536 readline (interactive CLIs): $have_readline
1537 audio formats handlers: $audio_format_handlers
1538 id3 version2 support: $have_libid3tag
1542 para_fade: $build_fade
1543 para_server: $build_server
1544 para_gui: $build_gui
1545 para_fade: $build_fade
1546 para_client: $build_client
1547 para_audiod: $build_audiod