2 # Process this file with autoconf to produce a configure script.
6 AC_INIT([paraslash],[git],[maan@systemlinux.org])
7 AC_CONFIG_HEADER([config.h])
9 AC_CONFIG_FILES([Makefile])
10 AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
11 AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
12 AC_DEFUN([objlist_to_errlist],[$(for i in $@; do printf "DEFINE_ERRLIST($(echo $i| tr 'a-z' 'A-Z'));"; done) [const char **para_errlist[[]]] = {$(for i in $@; do printf "PARA_ERRLIST($(echo $i | tr 'a-z' 'A-Z')), "; done) }])
13 AC_PATH_PROG(UNAMEPATH, uname, no)
14 if test "$UNAMEPATH" = "no"; then
15 AC_MSG_ERROR(unable to determine system type)
17 AC_MSG_CHECKING(os type)
18 OSTYPE="`$UNAMEPATH -s`"
19 AC_MSG_RESULT("$OSTYPE")
21 if test "$OSTYPE" = "SunOS"; then
22 # needed on SunOS for socket magic
23 arch_cppflags="-D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
24 AC_SUBST(arch_cppflags)
29 AC_PATH_PROG([gengetopt], [gengetopt])
30 test -z "$gengetopt" && AC_MSG_ERROR(
31 [gengetopt is required to build this package])
33 AC_PATH_PROG([help2man], [help2man])
34 test -z "$help2man" && AC_MSG_ERROR(
35 [help2man is required to build this package])
37 AC_PATH_PROG([install], [install])
38 test -z "$install" && AC_MSG_ERROR(
39 [The install program is required to build this package])
48 AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h \
49 stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h sys/un.h \
50 sys/ipc.h unistd.h utime.h stddef.h],
51 [], [AC_MSG_ERROR([$ac_header not found])])
53 # Checks for typedefs, structures, and compiler characteristics.
73 # Checks for library functions.
75 AC_PROG_GCC_TRADITIONAL
79 AC_FUNC_SELECT_ARGTYPES
86 AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \
87 regcomp select strchr strdup strerror strstr strtol uname \
88 fchdir gettimeofday localtime_r munmap strcasecmp strcspn \
89 strncasecmp strrchr strspn alarm mkdir inet_ntoa socket], [],
90 [AC_MSG_ERROR([function not found, cannot live without it])])
92 executables="recv filter audioc write afh play"
93 ################################################################## clock_gettime
95 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
96 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
98 if test -n "$clock_gettime_lib"; then
99 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
100 define to 1 if clock_gettime() is supported])
102 if test "$clock_gettime_lib" = "rt"; then
103 AC_SUBST(clock_gettime_ldflags, -lrt)
105 ########################################################################### osl
107 OLD_CPPFLAGS="$CPPFLAGS"
108 OLD_LDFLAGS="$LDFLAGS"
110 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
111 [look for osl.h also in dir])])
112 if test -n "$with_osl_headers"; then
113 osl_cppflags="-I$with_osl_headers"
114 CPPFLAGS="$CPPFLAGS $osl_cppflags"
116 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
117 [look for libosl also in dir])])
118 if test -n "$with_osl_libs"; then
119 osl_libs="-L$with_osl_libs"
120 LDFLAGS="$LDFLAGS $osl_libs"
123 AC_CHECK_HEADER(osl.h, [], have_osl=no)
124 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
125 if test "$have_osl" = "yes"; then
126 AC_SUBST(osl_cppflags)
127 osl_ldflags="$osl_libs -losl"
128 AC_SUBST(osl_ldflags)
130 AC_MSG_WARN([libosl not found, can not build para_server.
132 http://systemlinux.org/~maan/osl
134 git clone git://git.tuebingen.mpg.de/osl
137 CPPFLAGS="$OLD_CPPFLAGS"
138 LDFLAGS="$OLD_LDFLAGS"
140 ########################################################################### crypto
141 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
142 Force using crypto library "lib". This package requires either
143 openssl or libgcrypt being installed. Possible values for "lib"
144 are thus "openssl" and "gcrypt". If this option is not given,
145 openssl is tried first. If openssl was not found, gcrypt is
148 case "$enable_cryptolib" in
149 "openssl") check_openssl="yes"; check_gcrypt="no";;
150 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
151 "") check_openssl="yes"; check_gcrypt="yes";;
152 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
154 ###################################################################### openssl
155 if test "$check_openssl" = "yes"; then
156 OLD_CPPFLAGS="$CPPFLAGS"
157 OLD_LDFLAGS="$LDFLAGS"
160 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
161 [look for openssl headers also in dir])])
162 if test -n "$with_openssl_headers"; then
163 openssl_cppflags="-I$with_openssl_headers"
164 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
166 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
167 [look for openssl libraries also in dir])])
168 if test -n "$with_openssl_libs"; then
169 openssl_libs="-L$with_openssl_libs"
170 LDFLAGS="$LDFLAGS $openssl_libs"
172 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
173 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
174 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
175 # try harder: openssl is sometimes installed in /usr/local/ssl
176 openssl_cppflags="-I/usr/local/ssl/include"
177 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
178 openssl_libs="-L/usr/local/ssl/lib"
179 LDFLAGS="$LDFLAGS $openssl_libs"
181 unset ac_cv_header_openssl_ssl_h 2> /dev/null
182 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
183 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
184 if test "$have_openssl" = "yes"; then
185 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
188 if test "$have_openssl" = "yes"; then
189 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
190 AC_SUBST(openssl_cppflags)
191 openssl_ldflags="$openssl_libs -lssl -lcrypto"
192 AC_SUBST(openssl_ldflags)
196 AC_MSG_WARN([openssl libraries not found])
198 CPPFLAGS="$OLD_CPPFLAGS"
199 LDFLAGS="$OLD_LDFLAGS"
204 ########################################################################### gcrypt
205 if test "$check_gcrypt" = "yes"; then
206 OLD_CPPFLAGS="$CPPFLAGS"
207 OLD_LDFLAGS="$LDFLAGS"
210 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
211 [look for gcrypt headers also in dir])])
212 if test -n "$with_gcrypt_headers"; then
213 gcrypt_cppflags="-I$with_gcrypt_headers"
214 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
216 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
217 [look for libgcrypt also in dir])])
218 if test -n "$with_gcrypt_libs"; then
219 gcrypt_libs="-L$with_gcrypt_libs"
220 LDFLAGS="$LDFLAGS $gcrypt_libs"
222 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
223 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
224 if test "$have_gcrypt" = "yes"; then
225 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
226 AC_SUBST(gcrypt_cppflags)
227 gcrypt_ldflags="$gcrypt_libs -lgcrypt"
228 AC_SUBST(gcrypt_ldflags)
230 AC_MSG_WARN([gcrypt library not found])
232 CPPFLAGS="$OLD_CPPFLAGS"
233 LDFLAGS="$OLD_LDFLAGS"
238 ########################################################################### libsocket
239 AC_CHECK_LIB([c], [socket],
241 [socket_ldflags="-lsocket"]
243 AC_SUBST(socket_ldflags)
244 ########################################################################### libnsl
245 AC_CHECK_LIB([c], [gethostbyname],
247 [nsl_ldflags="-lnsl"]
249 AC_SUBST(nsl_ldflags)
250 ########################################################################### ucred
251 AC_MSG_CHECKING(for struct ucred)
252 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
254 #include <sys/types.h>
255 #include <sys/socket.h>
257 struct ucred sucred; sucred.pid=0;
258 ]])],[have_ucred=yes],[have_ucred=no])
259 AC_MSG_RESULT($have_ucred)
260 if test ${have_ucred} = yes; then
261 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
263 ########################################################################### gengetopt
264 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
266 [gengetopt_args_info_description],
267 [ggo_descriptions_declared=yes],
268 [ggo_descriptions_declared=no],
269 [#include "conftest-ggo.h"]
271 AC_SUBST(ggo_descriptions_declared)
272 ########################################################################### curses
274 OLD_CPPFLAGS="$CPPFLAGS"
275 OLD_LDFLAGS="$LDFLAGS"
277 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
278 [look for curses.h also in dir])])
279 if test -n "$with_curses_headers"; then
280 curses_cppflags="-I$with_curses_headers"
281 CPPFLAGS="$CPPFLAGS $curses_cppflags"
283 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
284 [look for libcurses also in dir])])
285 if test -n "$with_curses_libs"; then
286 curses_libs="-L$with_curses_libs"
287 LDFLAGS="$LDFLAGS $curses_libs"
289 AC_CHECK_HEADER(curses.h, [], [
292 curses_ldflags="$curses_libs"
293 AC_CHECK_LIB([ncursesw], [initscr],
294 [curses_ldflags="$curses_libs -lncursesw"], [
295 AC_CHECK_LIB([curses], [initscr],
296 [curses_ldflags="$curses_libs -lcurses"],
301 AC_SUBST(curses_cppflags)
302 AC_SUBST(curses_ldflags)
303 CPPFLAGS="$OLD_CPPFLAGS"
304 LDFLAGS="$OLD_LDFLAGS"
306 ########################################################################### ip_mreqn
307 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
308 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
314 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
315 AC_MSG_RESULT($have_ip_mreqn)
316 if test ${have_ip_mreqn} = yes; then
317 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
319 ########################################################################### osx
321 AC_MSG_CHECKING(for CoreAudio (MacOs))
322 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
323 #include <CoreAudio/CoreAudio.h>
326 ]])],[have_core_audio=yes],[have_core_audio=no])
327 AC_MSG_RESULT($have_core_audio)
328 if test ${have_core_audio} = yes; then
329 f1="-framework CoreAudio"
330 f2="-framework AudioToolbox"
331 f3="-framework AudioUnit"
332 f4="-framework CoreServices"
333 core_audio_ldflags="$f1 $f2 $f3 $f4"
334 AC_SUBST(core_audio_ldflags)
335 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
337 ####################################################### ogg/vorbis/speex/opus
339 OLD_CPPFLAGS="$CPPFLAGS"
340 OLD_LDFLAGS="$LDFLAGS"
342 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
343 [look for ogg headers also in dir])])
344 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
345 [look for ogg libs also in dir])])
346 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
347 [look for vorbis headers also in dir])])
348 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
349 [look for vorbis libs also in dir])])
350 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
351 [look for speex headers also in dir])])
352 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
353 [look for speex libs also in dir])])
354 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
355 [look for opus headers also in dir])])
356 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
357 [look for opus libs also in dir])])
359 if test -n "$with_ogg_headers"; then
360 ogg_cppflags="-I$with_ogg_headers"
361 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
363 if test -n "$with_ogg_libs"; then
364 ogg_libs="-L$with_ogg_libs"
365 LDFLAGS="$LDFLAGS $ogg_libs"
367 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
368 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
373 if test "$have_ogg" = "yes"; then
375 if test -n "$with_vorbis_headers"; then
376 vorbis_cppflags="-I$with_vorbis_headers"
377 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
379 if test -n "$with_vorbis_libs"; then
380 vorbis_libs="-L$with_vorbis_libs"
381 LDFLAGS="$LDFLAGS $vorbis_libs"
383 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
384 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
387 if test -n "$with_speex_headers"; then
388 speex_cppflags="-I$with_speex_headers"
389 CPPFLAGS="$CPPFLAGS $speex_cppflags"
391 if test -n "$with_speex_libs"; then
392 speex_libs="-L$with_speex_libs"
393 LDFLAGS="$LDFLAGS $speex_libs"
395 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
396 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
399 if test -n "$with_opus_headers"; then
400 opus_cppflags="-I$with_opus_headers"
401 CPPFLAGS="$CPPFLAGS $opus_cppflags"
403 if test -n "$with_opus_libs"; then
404 opus_libs="-L$with_opus_libs"
405 LDFLAGS="$LDFLAGS $opus_libs"
407 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
408 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
410 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
416 msg="support in para_server/para_filter/para_afh"
417 if test "$have_vorbis" = "yes" || \
418 test "$have_speex" = "yes" || \
419 test "$have_opus" = "yes"; then
420 AC_SUBST(ogg_cppflags)
421 ogg_ldflags="$ogg_libs -logg"
422 if test "$OSTYPE" = "Darwin"; then
423 ogg_ldflags="-Wl,-bind_at_load $ogg_ldflags"
425 AC_SUBST(ogg_ldflags)
427 if test "$have_vorbis" = "yes"; then
428 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
429 vorbis_ldflags="$vorbis_libs -lvorbis -lvorbisfile"
430 AC_SUBST(vorbis_ldflags)
432 if test "$have_speex" = "yes"; then
433 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
434 AC_SUBST(speex_cppflags)
435 speex_ldflags="$speex_libs -lspeex"
436 AC_SUBST(speex_ldflags)
438 AC_MSG_WARN([no ogg/speex $msg])
440 if test "$have_opus" = "yes"; then
441 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
442 AC_SUBST(opus_cppflags)
443 opus_ldflags="$opus_libs -lopus"
444 AC_SUBST(opus_ldflags)
445 audio_format_handlers="$audio_format_handlers opus"
447 AC_MSG_WARN([no ogg/opus $msg])
449 CPPFLAGS="$OLD_CPPFLAGS"
450 LDFLAGS="$OLD_LDFLAGS"
452 ########################################################################### faad
454 OLD_CPPFLAGS="$CPPFLAGS"
455 OLD_LDFLAGS="$LDFLAGS"
457 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
458 [look for neaacdec.h also in dir])])
459 if test -n "$with_faad_headers"; then
460 faad_cppflags="-I$with_faad_headers"
461 CPPFLAGS="$CPPFLAGS $faad_cppflags"
463 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
464 [look for libfaad also in dir])])
465 if test -n "$with_faad_libs"; then
466 faad_libs="-L$with_faad_libs"
467 LDFLAGS="$LDFLAGS $faad_libs"
469 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
470 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
471 if test "$have_faad" = "yes"; then
472 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
473 AC_SUBST(faad_cppflags)
474 faad_ldflags="$faad_libs -lfaad"
475 AC_SUBST(faad_ldflags)
477 CPPFLAGS="$OLD_CPPFLAGS"
478 LDFLAGS="$OLD_LDFLAGS"
480 ########################################################################### mad
482 OLD_CPPFLAGS="$CPPFLAGS"
483 OLD_LDFLAGS="$LDFLAGS"
486 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
487 [look for mad.h also in dir])])
488 if test -n "$with_mad_headers"; then
489 mad_cppflags="-I$with_mad_headers"
490 CPPFLAGS="$CPPFLAGS $mad_cppflags"
492 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
493 [look for libmad also in dir])])
494 if test -n "$with_mad_libs"; then
495 mad_libs="-L$with_mad_libs"
496 LDFLAGS="$LDFLAGS $mad_libs"
498 AC_CHECK_HEADERS([mad.h], [], [
501 AC_CHECK_LIB([mad], [mad_stream_init], [], [
504 if test "$have_mad" = "yes"; then
505 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
506 AC_SUBST(mad_cppflags)
507 mad_ldflags="$mad_libs -lmad"
508 AC_SUBST(mad_ldflags)
510 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
512 CPPFLAGS="$OLD_CPPFLAGS"
513 LDFLAGS="$OLD_LDFLAGS"
515 ###################################################################### libid3tag
516 OLD_CPPFLAGS="$CPPFLAGS"
517 OLD_LDFLAGS="$LDFLAGS"
521 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
522 [look for id3tag header files also in dir])])
523 if test -n "$with_id3tag_headers"; then
524 id3tag_cppflags="-I$with_id3tag_headers"
525 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
527 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
528 [look for id3tag libs also in dir])])
529 if test -n "$with_id3tag_libs"; then
530 id3tag_libs="-L$with_id3tag_libs"
531 LDFLAGS="$LDFLAGS $id3tag_libs"
534 AC_MSG_CHECKING(for libid3tag)
535 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
538 struct id3_tag t = {.flags = 0};
539 ]])],[],[have_libid3tag=no])
540 AC_MSG_RESULT($have_libid3tag)
542 if test ${have_libid3tag} = yes; then
543 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
544 AC_SUBST(id3tag_cppflags)
545 AC_SUBST(id3tag_ldflags, "$id3tag_libs -lid3tag -lz")
547 CPPFLAGS="$OLD_CPPFLAGS"
548 LDFLAGS="$OLD_LDFLAGS"
550 ########################################################################### flac
551 OLD_CPPFLAGS="$CPPFLAGS"
552 OLD_LDFLAGS="$LDFLAGS"
556 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
557 [look for flac headers also in dir])])
558 if test -n "$with_flac_headers"; then
559 flac_cppflags="-I$with_flac_headers"
560 CPPFLAGS="$CPPFLAGS $flac_cppflags"
562 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
563 [look for flac libs also in dir])])
564 if test -n "$with_flac_libs"; then
565 flac_libs="-L$with_flac_libs"
566 LDFLAGS="$LDFLAGS $flac_libs"
568 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
569 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
570 if test "$have_flac" = "yes"; then
571 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
572 AC_SUBST(flac_cppflags)
573 flac_ldflags="$flac_libs -lFLAC"
574 AC_SUBST(flac_ldflags)
576 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
578 CPPFLAGS="$OLD_CPPFLAGS"
579 LDFLAGS="$OLD_LDFLAGS"
581 ########################################################################### oss
582 OLD_CPPFLAGS="$CPPFLAGS"
583 OLD_LDFLAGS="$LDFLAGS"
587 msg="=> will not build oss writer"
589 AC_CHECK_HEADER(sys/soundcard.h, [
590 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
591 oss_ldflags="-lossaudio"
592 AC_SUBST(oss_ldflags)
598 AC_MSG_WARN([no sys/soundcard.h $msg])
601 CPPFLAGS="$OLD_CPPFLAGS"
602 LDFLAGS="$OLD_LDFLAGS"
605 ########################################################################### alsa
606 OLD_CPPFLAGS="$CPPFLAGS"
607 OLD_LDFLAGS="$LDFLAGS"
610 msg="=> no alsa support for para_audiod/para_write"
611 if test "$OSTYPE" != "Linux"; then
616 if test "$have_alsa" = "yes"; then
617 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
619 AC_MSG_WARN([no alsa/asoundlib $msg])
623 if test "$have_alsa" = "yes"; then
624 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
626 AC_MSG_WARN([no libasound $msg])
630 if test "$have_alsa" = "yes"; then
631 alsa_ldflags="-lasound"
632 AC_SUBST(alsa_ldflags)
635 CPPFLAGS="$OLD_CPPFLAGS"
636 LDFLAGS="$OLD_LDFLAGS"
638 ########################################################################### libao
639 OLD_CPPFLAGS="$CPPFLAGS"
640 OLD_LDFLAGS="$LDFLAGS"
644 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
645 [look for ao/ao.h also in dir])])
646 if test -n "$with_ao_headers"; then
647 ao_cppflags="-I$with_ao_headers"
648 CPPFLAGS="$CPPFLAGS $ao_cppflags"
650 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
651 [look for libao also in dir])])
652 if test -n "$with_ao_libs"; then
653 ao_libs="-L$with_ao_libs"
654 LDFLAGS="$LDFLAGS $ao_libs"
656 msg="no libao support for para_audiod/para_write"
657 AC_CHECK_HEADERS([ao/ao.h], [
660 AC_MSG_WARN([ao.h not found, $msg])
662 if test "$have_ao" = "yes"; then
663 AC_CHECK_LIB([ao], [ao_initialize], [], [
665 AC_MSG_WARN([ao lib not found or not working, $msg])
668 if test "$have_ao" = "yes"; then
669 AC_CHECK_HEADERS([pthread.h], [
672 AC_MSG_WARN([pthread.h not found, $msg])
675 if test "$have_ao" = "yes"; then
676 AC_CHECK_LIB([pthread], [pthread_create], [], [
678 AC_MSG_WARN([pthread lib not found or not working, $msg])
681 if test "$have_ao" = "yes"; then
682 AC_SUBST(ao_cppflags)
683 ao_ldflags="$ao_libs -lao -lpthread"
687 CPPFLAGS="$OLD_CPPFLAGS"
688 LDFLAGS="$OLD_LDFLAGS"
690 ############################################################# readline
691 OLD_CPPFLAGS="$CPPFLAGS"
692 OLD_LDFLAGS="$LDFLAGS"
696 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
697 [look for libreadline header files also in dir])])
698 if test -n "$with_readline_headers"; then
699 readline_cppflags="-I$with_readline_headers"
700 CPPFLAGS="$CPPFLAGS $readline_cppflags"
703 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
704 [look for readline library also in dir])])
705 if test -n "$with_readline_libs"; then
706 readline_libs="-L$with_readline_libs"
707 LDFLAGS="$LDFLAGS $readline_libs"
709 msg="no interactive cli support"
710 AC_CHECK_HEADERS([readline/readline.h], [
713 AC_MSG_WARN([readline/readline.h not found, $msg])
716 if test "$have_curses" != "yes"; then
718 AC_MSG_WARN([interactive cli support depends on curses,])
719 AC_MSG_WARN([but no curses lib was detected, $msg])
722 if test "$have_readline" = "yes"; then
723 readline_ldflags="$readline_libs -lreadline"
724 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
725 if test "$have_readline" = "no"; then # try with -lcurses
727 AC_MSG_NOTICE([trying again with -lcurses])
728 unset ac_cv_search_rl_free_keymap 2> /dev/null
729 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
731 readline_ldflags="$readline_ldflags -lcurses"
734 if test "$have_readline" = "no"; then # try with -ltermcap
736 AC_MSG_NOTICE([trying again with -ltermcap])
737 unset ac_cv_search_rl_free_keymap 2> /dev/null
738 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
740 readline_ldflags="$readline_ldflags -ltermcap"
745 if test "$have_readline" = "yes"; then
747 AC_SUBST(readline_cppflags)
748 AC_SUBST(readline_ldflags)
749 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
751 AC_MSG_WARN([libreadline not found or unusable])
753 CPPFLAGS="$OLD_CPPFLAGS"
754 LDFLAGS="$OLD_LDFLAGS"
756 ############################################################# libsamplerate
757 OLD_CPPFLAGS="$CPPFLAGS"
758 OLD_LDFLAGS="$LDFLAGS"
761 have_samplerate="yes"
762 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
763 [look for samplerate headers also in dir])])
764 if test -n "$with_samplerate_headers"; then
765 samplerate_cppflags="-I$with_samplerate_headers"
766 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
768 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
769 [look for samplerate libs also in dir])])
770 if test -n "$with_samplerate_libs"; then
771 samplerate_libs="-L$with_samplerate_libs"
772 LDFLAGS="$LDFLAGS $samplerate_libs"
775 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
776 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
778 if test "$have_samplerate" = "yes"; then
779 AC_SUBST(samplerate_cppflags)
780 samplerate_ldflags="$samplerate_libs -lsamplerate"
781 AC_SUBST(samplerate_ldflags)
783 AC_MSG_WARN([no resample support in para_audiod/para_filter])
785 CPPFLAGS="$OLD_CPPFLAGS"
786 LDFLAGS="$OLD_LDFLAGS"
788 ######################################################################### server
789 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
790 -a "$have_osl" = "yes" ; then
793 executables="$executables server"
794 server_cmdline_objs="server"
795 server_errlist_objs="
834 if test "$have_openssl" = "yes"; then
835 server_errlist_objs="$server_errlist_objs crypt"
837 if test "$have_gcrypt" = "yes"; then
838 server_errlist_objs="$server_errlist_objs gcrypt"
840 if test "$have_vorbis" = "yes" || \
841 test "$have_speex" = "yes" || \
842 test "$have_opus" = "yes"; then
843 server_errlist_objs="$server_errlist_objs ogg_afh_common"
845 if test "$have_vorbis" = "yes"; then
846 server_errlist_objs="$server_errlist_objs ogg_afh"
848 if test "$have_speex" = "yes"; then
849 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
851 if test "$have_opus" = "yes"; then
852 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
854 if test "$have_faad" = "yes"; then
855 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
857 if test "$have_flac" = "yes"; then
858 server_errlist_objs="$server_errlist_objs flac_afh"
860 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
861 AC_SUBST(server_objs, add_dot_o($server_objs))
862 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
863 objlist_to_errlist($server_errlist_objs), errors used by para_server)
867 ############################################################# client
868 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
870 executables="$executables client"
871 client_cmdline_objs="client"
872 client_errlist_objs="
888 if test "$have_openssl" = "yes"; then
889 client_errlist_objs="$client_errlist_objs crypt"
891 if test "$have_gcrypt" = "yes"; then
892 client_errlist_objs="$client_errlist_objs gcrypt"
894 if test "$have_readline" = "yes"; then
895 client_errlist_objs="$client_errlist_objs interactive"
897 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
898 AC_SUBST(client_objs, add_dot_o($client_objs))
899 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
900 objlist_to_errlist($client_errlist_objs), errors used by para_client)
904 ############################################################# audiod
905 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
907 executables="$executables audiod"
908 audiod_audio_formats="wma"
909 audiod_cmdline_objs="$audiod_cmdline_objs
920 audiod_errlist_objs="$audiod_errlist_objs
957 if test "$have_openssl" = "yes"; then
958 audiod_errlist_objs="$audiod_errlist_objs crypt"
960 if test "$have_gcrypt" = "yes"; then
961 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
963 if test "$have_core_audio" = "yes"; then
964 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
965 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
967 if test "$have_vorbis" = "yes"; then
968 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
969 audiod_audio_formats="$audiod_audio_formats ogg"
971 if test "$have_speex" = "yes"; then
972 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
973 audiod_audio_formats="$audiod_audio_formats spx"
975 if test "$have_opus" = "yes"; then
976 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
977 audiod_audio_formats="$audiod_audio_formats opus"
979 if test "$have_faad" = "yes"; then
980 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
981 audiod_audio_formats="$audiod_audio_formats aac"
983 if test "$have_mad" = "yes"; then
984 audiod_audio_formats="$audiod_audio_formats mp3"
985 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
986 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
988 if test "$have_flac" = "yes"; then
989 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
990 audiod_audio_formats="$audiod_audio_formats flac"
992 if test "$have_oss" = "yes"; then
993 audiod_errlist_objs="$audiod_errlist_objs oss_write"
994 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
996 if test "$have_alsa" = "yes"; then
997 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
998 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
1000 if test "$have_ao" = "yes"; then
1001 audiod_errlist_objs="$audiod_errlist_objs ao_write"
1002 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
1004 if test "$have_samplerate" = "yes"; then
1005 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
1006 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
1008 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
1009 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1010 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1011 errors used by para_audiod)
1013 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1014 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1015 enum of audio formats supported by audiod)
1016 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1017 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1021 ########################################################################### fade
1022 if test "$have_oss" = "yes" -o "$have_alsa" = "yes"; then
1024 executables="$executables fade"
1025 fade_cmdline_objs="fade"
1026 fade_errlist_objs="fade exec string fd version ggo"
1027 if test "$have_oss" = "yes"; then
1028 fade_errlist_objs="$fade_errlist_objs oss_mix"
1029 mixers="${mixers}oss "
1030 default_mixer="OSS_MIX"
1032 if test "$have_alsa" = "yes"; then
1033 fade_errlist_objs="$fade_errlist_objs alsa_mix"
1034 mixers="${mixers}alsa "
1035 default_mixer="ALSA_MIX"
1037 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
1038 AC_SUBST(fade_objs, add_dot_o($fade_objs))
1039 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
1040 objlist_to_errlist($fade_errlist_objs),
1041 errors used by para_fade)
1043 for i in $mixers; do
1044 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
1047 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
1048 enum of supported mixers)
1049 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
1050 use this mixer if none was specified)
1051 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
1052 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
1054 for i in $mixers; do
1055 printf 'extern void '$i'_mix_init(struct mixer *); '
1058 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
1059 init functions of the supported mixers)
1060 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
1061 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
1064 AC_MSG_WARN([no mixer support])
1066 ########################################################################### gui
1067 if test "$have_curses" = "yes"; then
1069 executables="$executables gui"
1070 gui_cmdline_objs="gui"
1084 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
1085 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1086 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1087 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1090 AC_MSG_WARN([no curses lib, cannot build para_gui])
1092 ######################################################################## filter
1101 filter_errlist_objs="
1125 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 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
1164 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1165 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1166 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1168 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1169 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1170 enum of supported filters)
1171 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1172 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1173 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1174 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1175 ########################################################################## recv
1205 if test "$have_vorbis" = "yes" || \
1206 test "$have_speex" = "yes" || \
1207 test "$have_opus" = "yes"; then
1208 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
1210 if test "$have_vorbis" = "yes"; then
1211 recv_errlist_objs="$recv_errlist_objs ogg_afh"
1213 if test "$have_speex" = "yes"; then
1214 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
1216 if test "$have_opus" = "yes"; then
1217 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
1219 if test "$have_faad" = "yes"; then
1220 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
1222 if test "$have_flac" = "yes"; then
1223 recv_errlist_objs="$recv_errlist_objs flac_afh"
1225 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
1226 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1227 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1228 errors used by para_recv)
1229 ########################################################################### afh
1230 audio_format_handlers="mp3 wma"
1231 afh_cmdline_objs="afh"
1244 if test "$have_vorbis" = "yes" || \
1245 test "$have_speex" = "yes" || \
1246 test "$have_opus" = "yes"; then
1247 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
1249 if test "$have_vorbis" = "yes"; then
1250 afh_errlist_objs="$afh_errlist_objs ogg_afh"
1251 audio_format_handlers="$audio_format_handlers ogg"
1253 if test "$have_speex" = "yes"; then
1254 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
1255 audio_format_handlers="$audio_format_handlers spx"
1257 if test "$have_opus" = "yes"; then
1258 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
1260 if test "$have_faad" = "yes"; then
1261 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
1262 audio_format_handlers="$audio_format_handlers aac"
1264 if test "$have_flac" = "yes"; then
1265 afh_errlist_objs="$afh_errlist_objs flac_afh"
1266 audio_format_handlers="$audio_format_handlers flac"
1269 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
1271 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1272 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1273 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1274 ########################################################################## play
1318 if test "$have_core_audio" = "yes"; then
1319 play_errlist_objs="$play_errlist_objs osx_write ipc"
1320 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
1322 if test "$have_vorbis" = "yes" || \
1323 test "$have_speex" = "yes" || \
1324 test "$have_opus" = "yes"; then
1325 play_errlist_objs="$play_errlist_objs ogg_afh_common"
1327 if test "$have_vorbis" = "yes"; then
1328 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
1330 if test "$have_speex" = "yes"; then
1331 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
1333 if test "$have_opus" = "yes"; then
1334 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
1336 if test "$have_faad" = "yes"; then
1337 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
1339 if test "$have_mad" = "yes"; then
1340 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
1341 play_errlist_objs="$play_errlist_objs mp3dec_filter"
1343 if test "$have_flac" = "yes"; then
1344 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
1346 if test "$have_oss" = "yes"; then
1347 play_errlist_objs="$play_errlist_objs oss_write"
1348 play_cmdline_objs="$play_cmdline_objs oss_write"
1350 if test "$have_alsa" = "yes"; then
1351 play_errlist_objs="$play_errlist_objs alsa_write"
1352 play_cmdline_objs="$play_cmdline_objs alsa_write"
1354 if test "$have_ao" = "yes"; then
1355 play_errlist_objs="$play_errlist_objs ao_write"
1356 play_cmdline_objs="$play_cmdline_objs ao_write"
1358 if test "$have_readline" = "yes"; then
1359 play_errlist_objs="$play_errlist_objs interactive"
1361 if test "$have_samplerate" = "yes"; then
1362 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1363 play_cmdline_objs="$play_cmdline_objs resample_filter"
1366 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
1367 AC_SUBST(play_objs, add_dot_o($play_objs))
1368 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1369 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1370 ######################################################################### write
1371 write_cmdline_objs="
1375 write_errlist_objs="
1390 default_writer="FILE_WRITE"
1392 if test "$have_core_audio" = "yes"; then
1393 write_errlist_objs="$write_errlist_objs osx_write ipc"
1394 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
1395 writers="$writers osx"
1396 default_writer="OSX_WRITE"
1398 if test "$have_ao" = "yes"; then
1399 write_errlist_objs="$write_errlist_objs ao_write"
1400 write_cmdline_objs="$write_cmdline_objs ao_write"
1401 writers="$writers ao"
1402 default_writer="AO_WRITE"
1404 if test "$have_oss" = "yes"; then
1405 write_errlist_objs="$write_errlist_objs oss_write"
1406 write_cmdline_objs="$write_cmdline_objs oss_write"
1407 writers="$writers oss"
1408 default_writer="OSS_WRITE"
1410 if test "$have_alsa" = "yes"; then
1411 write_errlist_objs="$write_errlist_objs alsa_write"
1412 write_cmdline_objs="$write_cmdline_objs alsa_write"
1413 writers="$writers alsa"
1414 default_writer="ALSA_WRITE"
1416 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
1417 AC_SUBST(write_objs, add_dot_o($write_objs))
1418 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1419 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1420 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1421 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1422 enum of supported writers)
1423 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1424 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1425 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1426 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1427 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1428 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1429 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1430 ######################################################################## audioc
1431 audioc_cmdline_objs="audioc"
1432 audioc_errlist_objs="
1440 if test "$have_readline" = "yes"; then
1441 audioc_errlist_objs="$audioc_errlist_objs
1448 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1449 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1450 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1451 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1452 ############################################################# error2.h
1453 # these are always built
1456 $filter_errlist_objs
1457 $audioc_errlist_objs
1463 # optional executables
1464 if test "$build_server" = "yes"; then
1465 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1467 if test "$build_gui" = "yes"; then
1468 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1470 if test "$build_fade" = "yes"; then
1471 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1473 if test "$build_client" = "yes"; then
1474 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1476 if test "$build_audiod" = "yes"; then
1477 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1480 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1482 object_executable_matrix=
1483 for i in $executables; do
1484 eval objs=\$${i}_errlist_objs
1485 object_executable_matrix="$object_executable_matrix $i: $objs"
1487 # use echo to replace newlines by space
1488 AC_SUBST(object_executable_matrix, $(echo $object_executable_matrix))
1490 for obj in $all_errlist_objs; do
1491 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1493 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1494 [enum {$SS NUM_SS}],
1495 [list of all objects that use the paraslash error facility]
1497 ################################################################## status items
1499 status_items="basename status num_played mtime bitrate frequency file_size
1500 status_flags format score techinfo afs_mode
1501 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1502 offset seconds_total stream_start current_time audiod_uptime image_id
1503 lyrics_id duration directory lyrics_name image_name path hash channels
1504 last_played num_chunks chunk_time amplification artist title year album
1508 for i in $status_items; do
1509 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1511 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1512 [enum of all status items])
1515 for i in $status_items; do
1516 result="$result \"$i\", "
1518 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1519 [char * array of all status items])
1521 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1522 [formats supported by para_server and para_afh])
1524 AC_SUBST(executables)
1528 paraslash configuration:
1529 ~~~~~~~~~~~~~~~~~~~~~~~~
1530 unix socket credentials: $have_ucred
1531 readline (interactive CLIs): $have_readline
1532 audio formats handlers: $audio_format_handlers
1533 id3 version2 support: $have_libid3tag
1534 filters: $(echo $filters)
1537 para_fade: $build_fade
1538 para_server: $build_server
1539 para_gui: $build_gui
1540 para_fade: $build_fade
1541 para_client: $build_client
1542 para_audiod: $build_audiod