2 # Process this file with autoconf to produce a configure script.
6 AC_INIT([paraslash],[git],[maan@systemlinux.org])
7 AC_CONFIG_HEADER([config.h])
9 AC_CONFIG_FILES([Makefile])
10 AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
11 AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
12 AC_DEFUN([objlist_to_errlist],[$(for i in $@; do printf "DEFINE_ERRLIST($(echo $i| tr 'a-z' 'A-Z'));"; done) [const char **para_errlist[[]]] = {$(for i in $@; do printf "PARA_ERRLIST($(echo $i | tr 'a-z' 'A-Z')), "; done) }])
13 AC_PATH_PROG(UNAMEPATH, uname, no)
14 if test "$UNAMEPATH" = "no"; then
15 AC_MSG_ERROR(unable to determine system type)
17 AC_MSG_CHECKING(os type)
18 OSTYPE="`$UNAMEPATH -s`"
19 AC_MSG_RESULT("$OSTYPE")
21 if test "$OSTYPE" = "SunOS"; then
22 # needed on SunOS for socket magic
23 arch_cppflags="-D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
24 AC_SUBST(arch_cppflags)
29 AC_PATH_PROG([gengetopt], [gengetopt])
30 test -z "$gengetopt" && AC_MSG_ERROR(
31 [gengetopt is required to build this package])
33 AC_PATH_PROG([help2man], [help2man])
34 test -z "$help2man" && AC_MSG_ERROR(
35 [help2man is required to build this package])
37 AC_PATH_PROG([install], [install])
38 test -z "$install" && AC_MSG_ERROR(
39 [The install program is required to build this package])
48 AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h \
49 stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h sys/un.h \
50 sys/ipc.h unistd.h utime.h stddef.h],
51 [], [AC_MSG_ERROR([$ac_header not found])])
53 # Checks for typedefs, structures, and compiler characteristics.
73 # Checks for library functions.
75 AC_PROG_GCC_TRADITIONAL
79 AC_FUNC_SELECT_ARGTYPES
86 AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \
87 regcomp select strchr strdup strerror strstr strtol uname \
88 fchdir gettimeofday localtime_r munmap strcasecmp strcspn \
89 strncasecmp strrchr strspn alarm mkdir inet_ntoa socket], [],
90 [AC_MSG_ERROR([function not found, cannot live without it])])
92 executables="recv filter audioc write afh play"
93 audio_format_handlers="mp3 wma"
95 ################################################################## clock_gettime
97 AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
98 AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
100 if test -n "$clock_gettime_lib"; then
101 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
102 define to 1 if clock_gettime() is supported])
104 if test "$clock_gettime_lib" = "rt"; then
105 AC_SUBST(clock_gettime_ldflags, -lrt)
107 ########################################################################### osl
109 OLD_CPPFLAGS="$CPPFLAGS"
110 OLD_LDFLAGS="$LDFLAGS"
112 AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
113 [look for osl.h also in dir])])
114 if test -n "$with_osl_headers"; then
115 osl_cppflags="-I$with_osl_headers"
116 CPPFLAGS="$CPPFLAGS $osl_cppflags"
118 AC_ARG_WITH(osl_libs, [AS_HELP_STRING(--with-osl-libs=dir,
119 [look for libosl also in dir])])
120 if test -n "$with_osl_libs"; then
121 osl_libs="-L$with_osl_libs"
122 LDFLAGS="$LDFLAGS $osl_libs"
125 AC_CHECK_HEADER(osl.h, [], have_osl=no)
126 AC_CHECK_LIB([osl], [osl_open_table], [], have_osl=no)
127 if test "$have_osl" = "yes"; then
128 AC_SUBST(osl_cppflags)
129 osl_ldflags="$osl_libs -losl"
130 AC_SUBST(osl_ldflags)
132 AC_MSG_WARN([libosl not found, can not build para_server.
134 http://systemlinux.org/~maan/osl
136 git clone git://git.tuebingen.mpg.de/osl
139 CPPFLAGS="$OLD_CPPFLAGS"
140 LDFLAGS="$OLD_LDFLAGS"
142 ########################################################################### crypto
143 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
144 Force using crypto library "lib". This package requires either
145 openssl or libgcrypt being installed. Possible values for "lib"
146 are thus "openssl" and "gcrypt". If this option is not given,
147 openssl is tried first. If openssl was not found, gcrypt is
150 case "$enable_cryptolib" in
151 "openssl") check_openssl="yes"; check_gcrypt="no";;
152 "gcrypt") check_openssl="no"; check_gcrypt="yes";;
153 "") check_openssl="yes"; check_gcrypt="yes";;
154 *) AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib]);;
156 ###################################################################### openssl
157 if test "$check_openssl" = "yes"; then
158 OLD_CPPFLAGS="$CPPFLAGS"
159 OLD_LDFLAGS="$LDFLAGS"
162 AC_ARG_WITH(openssl_headers, [AS_HELP_STRING(--with-openssl-headers=dir,
163 [look for openssl headers also in dir])])
164 if test -n "$with_openssl_headers"; then
165 openssl_cppflags="-I$with_openssl_headers"
166 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
168 AC_ARG_WITH(openssl_libs, [AS_HELP_STRING(--with-openssl-libs=dir,
169 [look for openssl libraries also in dir])])
170 if test -n "$with_openssl_libs"; then
171 openssl_libs="-L$with_openssl_libs"
172 LDFLAGS="$LDFLAGS $openssl_libs"
174 AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
175 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
176 if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
177 # try harder: openssl is sometimes installed in /usr/local/ssl
178 openssl_cppflags="-I/usr/local/ssl/include"
179 CPPFLAGS="$CPPFLAGS $openssl_cppflags"
180 openssl_libs="-L/usr/local/ssl/lib"
181 LDFLAGS="$LDFLAGS $openssl_libs"
183 unset ac_cv_header_openssl_ssl_h 2> /dev/null
184 unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
185 AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
186 if test "$have_openssl" = "yes"; then
187 AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
190 if test "$have_openssl" = "yes"; then
191 AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
192 AC_SUBST(openssl_cppflags)
193 openssl_ldflags="$openssl_libs -lssl -lcrypto"
194 AC_SUBST(openssl_ldflags)
196 server_errlist_objs="$server_errlist_objs crypt"
197 client_errlist_objs="$client_errlist_objs crypt"
198 audiod_errlist_objs="$audiod_errlist_objs crypt"
202 AC_MSG_WARN([openssl libraries not found])
204 CPPFLAGS="$OLD_CPPFLAGS"
205 LDFLAGS="$OLD_LDFLAGS"
210 ########################################################################### gcrypt
211 if test "$check_gcrypt" = "yes"; then
212 OLD_CPPFLAGS="$CPPFLAGS"
213 OLD_LDFLAGS="$LDFLAGS"
216 AC_ARG_WITH(gcrypt_headers, [AS_HELP_STRING(--with-gcrypt-headers=dir,
217 [look for gcrypt headers also in dir])])
218 if test -n "$with_gcrypt_headers"; then
219 gcrypt_cppflags="-I$with_gcrypt_headers"
220 CPPFLAGS="$CPPFLAGS $gcrypt_cppflags"
222 AC_ARG_WITH(gcrypt_libs, [AS_HELP_STRING(--with-gcrypt-libs=dir,
223 [look for libgcrypt also in dir])])
224 if test -n "$with_gcrypt_libs"; then
225 gcrypt_libs="-L$with_gcrypt_libs"
226 LDFLAGS="$LDFLAGS $gcrypt_libs"
228 AC_CHECK_HEADER(gcrypt.h, [], [have_gcrypt="no"])
229 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [have_gcrypt="no"])
230 if test "$have_gcrypt" = "yes"; then
231 AC_DEFINE(HAVE_GCRYPT, 1, [define to 1 to turn on gcrypt support])
232 AC_SUBST(gcrypt_cppflags)
233 gcrypt_ldflags="$gcrypt_libs -lgcrypt"
234 AC_SUBST(gcrypt_ldflags)
236 server_errlist_objs="$server_errlist_objs gcrypt"
237 client_errlist_objs="$client_errlist_objs gcrypt"
238 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
240 AC_MSG_WARN([gcrypt library not found])
242 CPPFLAGS="$OLD_CPPFLAGS"
243 LDFLAGS="$OLD_LDFLAGS"
248 ########################################################################### libsocket
249 AC_CHECK_LIB([c], [socket],
251 [socket_ldflags="-lsocket"]
253 AC_SUBST(socket_ldflags)
254 ########################################################################### libnsl
255 AC_CHECK_LIB([c], [gethostbyname],
257 [nsl_ldflags="-lnsl"]
259 AC_SUBST(nsl_ldflags)
260 ########################################################################### ucred
261 AC_MSG_CHECKING(for struct ucred)
262 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
264 #include <sys/types.h>
265 #include <sys/socket.h>
267 struct ucred sucred; sucred.pid=0;
268 ]])],[have_ucred=yes],[have_ucred=no])
269 AC_MSG_RESULT($have_ucred)
270 if test ${have_ucred} = yes; then
271 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
273 ########################################################################### gengetopt
274 echo 'option "z" z "" flag off' | $gengetopt --file-name conftest-ggo &&
276 [gengetopt_args_info_description],
277 [ggo_descriptions_declared=yes],
278 [ggo_descriptions_declared=no],
279 [#include "conftest-ggo.h"]
281 AC_SUBST(ggo_descriptions_declared)
282 ########################################################################### curses
284 OLD_CPPFLAGS="$CPPFLAGS"
285 OLD_LDFLAGS="$LDFLAGS"
287 AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
288 [look for curses.h also in dir])])
289 if test -n "$with_curses_headers"; then
290 curses_cppflags="-I$with_curses_headers"
291 CPPFLAGS="$CPPFLAGS $curses_cppflags"
293 AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
294 [look for libcurses also in dir])])
295 if test -n "$with_curses_libs"; then
296 curses_libs="-L$with_curses_libs"
297 LDFLAGS="$LDFLAGS $curses_libs"
299 AC_CHECK_HEADER(curses.h, [], [
302 curses_ldflags="$curses_libs"
303 AC_CHECK_LIB([ncursesw], [initscr],
304 [curses_ldflags="$curses_libs -lncursesw"], [
305 AC_CHECK_LIB([curses], [initscr],
306 [curses_ldflags="$curses_libs -lcurses"],
311 AC_SUBST(curses_cppflags)
312 AC_SUBST(curses_ldflags)
313 CPPFLAGS="$OLD_CPPFLAGS"
314 LDFLAGS="$OLD_LDFLAGS"
316 ########################################################################### ip_mreqn
317 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
318 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
324 ]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
325 AC_MSG_RESULT($have_ip_mreqn)
326 if test ${have_ip_mreqn} = yes; then
327 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
329 ########################################################################### osx
331 AC_MSG_CHECKING(for CoreAudio (MacOs))
332 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
333 #include <CoreAudio/CoreAudio.h>
336 ]])],[have_core_audio=yes],[have_core_audio=no])
337 AC_MSG_RESULT($have_core_audio)
338 if test ${have_core_audio} = yes; then
339 f1="-framework CoreAudio"
340 f2="-framework AudioToolbox"
341 f3="-framework AudioUnit"
342 f4="-framework CoreServices"
343 core_audio_ldflags="$f1 $f2 $f3 $f4"
344 AC_SUBST(core_audio_ldflags)
346 audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
347 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
349 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
351 ####################################################### ogg/vorbis/speex/opus
353 OLD_CPPFLAGS="$CPPFLAGS"
354 OLD_LDFLAGS="$LDFLAGS"
356 AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
357 [look for ogg headers also in dir])])
358 AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
359 [look for ogg libs also in dir])])
360 AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
361 [look for vorbis headers also in dir])])
362 AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
363 [look for vorbis libs also in dir])])
364 AC_ARG_WITH(speex_headers, [AS_HELP_STRING(--with-speex-headers=dir,
365 [look for speex headers also in dir])])
366 AC_ARG_WITH(speex_libs, [AS_HELP_STRING(--with-speex-libs=dir,
367 [look for speex libs also in dir])])
368 AC_ARG_WITH(opus_headers, [AS_HELP_STRING(--with-opus-headers=dir,
369 [look for opus headers also in dir])])
370 AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
371 [look for opus libs also in dir])])
373 if test -n "$with_ogg_headers"; then
374 ogg_cppflags="-I$with_ogg_headers"
375 CPPFLAGS="$CPPFLAGS $ogg_cppflags"
377 if test -n "$with_ogg_libs"; then
378 ogg_libs="-L$with_ogg_libs"
379 LDFLAGS="$LDFLAGS $ogg_libs"
381 AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
382 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
387 if test "$have_ogg" = "yes"; then
389 if test -n "$with_vorbis_headers"; then
390 vorbis_cppflags="-I$with_vorbis_headers"
391 CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
393 if test -n "$with_vorbis_libs"; then
394 vorbis_libs="-L$with_vorbis_libs"
395 LDFLAGS="$LDFLAGS $vorbis_libs"
397 AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
398 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
401 if test -n "$with_speex_headers"; then
402 speex_cppflags="-I$with_speex_headers"
403 CPPFLAGS="$CPPFLAGS $speex_cppflags"
405 if test -n "$with_speex_libs"; then
406 speex_libs="-L$with_speex_libs"
407 LDFLAGS="$LDFLAGS $speex_libs"
409 AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
410 AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
413 if test -n "$with_opus_headers"; then
414 opus_cppflags="-I$with_opus_headers"
415 CPPFLAGS="$CPPFLAGS $opus_cppflags"
417 if test -n "$with_opus_libs"; then
418 opus_libs="-L$with_opus_libs"
419 LDFLAGS="$LDFLAGS $opus_libs"
421 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [ have_opus="no" ])
422 AC_CHECK_HEADERS([opus/opus.h], [], [ have_opus="no" ])
424 AC_MSG_WARN([vorbis/speex/opus depend on libogg, which was not detected])
430 msg="support in para_server/para_filter/para_afh"
431 if test "$have_vorbis" = "yes" || \
432 test "$have_speex" = "yes" || \
433 test "$have_opus" = "yes"; then
434 AC_SUBST(ogg_cppflags)
435 ogg_ldflags="$ogg_libs -logg"
436 if test "$OSTYPE" = "Darwin"; then
437 ogg_ldflags="-Wl,-bind_at_load $ogg_ldflags"
439 AC_SUBST(ogg_ldflags)
440 server_errlist_objs="$server_errlist_objs ogg_afh_common"
442 if test "$have_vorbis" = "yes"; then
443 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
444 vorbis_ldflags="$vorbis_libs -lvorbis -lvorbisfile"
445 AC_SUBST(vorbis_ldflags)
447 server_errlist_objs="$server_errlist_objs ogg_afh"
448 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
450 audiod_audio_formats="$audiod_audio_formats ogg"
451 audio_format_handlers="$audio_format_handlers ogg"
453 if test "$have_speex" = "yes"; then
454 AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
455 AC_SUBST(speex_cppflags)
456 speex_ldflags="$speex_libs -lspeex"
457 AC_SUBST(speex_ldflags)
460 server_errlist_objs="$server_errlist_objs spx_afh spx_common"
461 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
463 audiod_audio_formats="$audiod_audio_formats spx"
464 audio_format_handlers="$audio_format_handlers spx"
466 AC_MSG_WARN([no ogg/speex $msg])
468 if test "$have_opus" = "yes"; then
469 AC_DEFINE(HAVE_OPUS, 1, define to 1 to turn on ogg/opus support)
470 AC_SUBST(opus_cppflags)
471 opus_ldflags="$opus_libs -lopus"
472 AC_SUBST(opus_ldflags)
475 server_errlist_objs="$server_errlist_objs opus_afh opus_common"
476 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
478 audiod_audio_formats="$audiod_audio_formats opus"
479 audio_format_handlers="$audio_format_handlers opus"
481 AC_MSG_WARN([no ogg/opus $msg])
483 CPPFLAGS="$OLD_CPPFLAGS"
484 LDFLAGS="$OLD_LDFLAGS"
486 ########################################################################### faad
488 OLD_CPPFLAGS="$CPPFLAGS"
489 OLD_LDFLAGS="$LDFLAGS"
491 AC_ARG_WITH(faad_headers, [AS_HELP_STRING(--with-faad-headers=dir,
492 [look for neaacdec.h also in dir])])
493 if test -n "$with_faad_headers"; then
494 faad_cppflags="-I$with_faad_headers"
495 CPPFLAGS="$CPPFLAGS $faad_cppflags"
497 AC_ARG_WITH(faad_libs, [AS_HELP_STRING(--with-faad-libs=dir,
498 [look for libfaad also in dir])])
499 if test -n "$with_faad_libs"; then
500 faad_libs="-L$with_faad_libs"
501 LDFLAGS="$LDFLAGS $faad_libs"
503 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
504 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
505 if test "$have_faad" = "yes"; then
506 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
507 AC_SUBST(faad_cppflags)
508 faad_ldflags="$faad_libs -lfaad"
509 AC_SUBST(faad_ldflags)
511 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common"
512 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
514 audiod_audio_formats="$audiod_audio_formats aac"
515 audio_format_handlers="$audio_format_handlers aac"
517 CPPFLAGS="$OLD_CPPFLAGS"
518 LDFLAGS="$OLD_LDFLAGS"
520 ########################################################################### mad
522 OLD_CPPFLAGS="$CPPFLAGS"
523 OLD_LDFLAGS="$LDFLAGS"
526 AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir,
527 [look for mad.h also in dir])])
528 if test -n "$with_mad_headers"; then
529 mad_cppflags="-I$with_mad_headers"
530 CPPFLAGS="$CPPFLAGS $mad_cppflags"
532 AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir,
533 [look for libmad also in dir])])
534 if test -n "$with_mad_libs"; then
535 mad_libs="-L$with_mad_libs"
536 LDFLAGS="$LDFLAGS $mad_libs"
538 AC_CHECK_HEADERS([mad.h], [], [
541 AC_CHECK_LIB([mad], [mad_stream_init], [], [
544 if test "$have_mad" = "yes"; then
545 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
546 AC_SUBST(mad_cppflags)
547 mad_ldflags="$mad_libs -lmad"
548 AC_SUBST(mad_ldflags)
549 audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
550 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
551 audiod_audio_formats="$audiod_audio_formats mp3"
553 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
555 CPPFLAGS="$OLD_CPPFLAGS"
556 LDFLAGS="$OLD_LDFLAGS"
558 ###################################################################### libid3tag
559 OLD_CPPFLAGS="$CPPFLAGS"
560 OLD_LDFLAGS="$LDFLAGS"
564 AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
565 [look for id3tag header files also in dir])])
566 if test -n "$with_id3tag_headers"; then
567 id3tag_cppflags="-I$with_id3tag_headers"
568 CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
570 AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
571 [look for id3tag libs also in dir])])
572 if test -n "$with_id3tag_libs"; then
573 id3tag_libs="-L$with_id3tag_libs"
574 LDFLAGS="$LDFLAGS $id3tag_libs"
577 AC_MSG_CHECKING(for libid3tag)
578 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
581 struct id3_tag t = {.flags = 0};
582 ]])],[],[have_libid3tag=no])
583 AC_MSG_RESULT($have_libid3tag)
585 if test ${have_libid3tag} = yes; then
586 AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
587 AC_SUBST(id3tag_cppflags)
588 AC_SUBST(id3tag_ldflags, "$id3tag_libs -lid3tag -lz")
590 CPPFLAGS="$OLD_CPPFLAGS"
591 LDFLAGS="$OLD_LDFLAGS"
593 ########################################################################### flac
594 OLD_CPPFLAGS="$CPPFLAGS"
595 OLD_LDFLAGS="$LDFLAGS"
599 AC_ARG_WITH(flac_headers, [AS_HELP_STRING(--with-flac-headers=dir,
600 [look for flac headers also in dir])])
601 if test -n "$with_flac_headers"; then
602 flac_cppflags="-I$with_flac_headers"
603 CPPFLAGS="$CPPFLAGS $flac_cppflags"
605 AC_ARG_WITH(flac_libs, [AS_HELP_STRING(--with-flac-libs=dir,
606 [look for flac libs also in dir])])
607 if test -n "$with_flac_libs"; then
608 flac_libs="-L$with_flac_libs"
609 LDFLAGS="$LDFLAGS $flac_libs"
611 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
612 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
613 if test "$have_flac" = "yes"; then
614 AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
615 AC_SUBST(flac_cppflags)
616 flac_ldflags="$flac_libs -lFLAC"
617 AC_SUBST(flac_ldflags)
619 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
620 server_errlist_objs="$server_errlist_objs flac_afh"
621 audio_format_handlers="$audio_format_handlers flac"
622 audiod_audio_formats="$audiod_audio_formats flac"
624 AC_MSG_WARN([no flac support in para_audiod/para_filter/para_afh/para_server])
626 CPPFLAGS="$OLD_CPPFLAGS"
627 LDFLAGS="$OLD_LDFLAGS"
629 ########################################################################### oss
630 OLD_CPPFLAGS="$CPPFLAGS"
631 OLD_LDFLAGS="$LDFLAGS"
635 msg="=> will not build oss writer"
637 AC_CHECK_HEADER(sys/soundcard.h, [
638 audiod_errlist_objs="$audiod_errlist_objs oss_write"
639 audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
641 fade_errlist_objs="$fade_errlist_objs oss_mix"
643 mixers="${mixers}oss "
644 default_mixer="OSS_MIX"
646 AC_CHECK_LIB(ossaudio, _oss_ioctl, [
647 oss_ldflags="-lossaudio"
648 AC_SUBST(oss_ldflags)
654 AC_MSG_WARN([no sys/soundcard.h $msg])
657 CPPFLAGS="$OLD_CPPFLAGS"
658 LDFLAGS="$OLD_LDFLAGS"
661 ########################################################################### alsa
662 OLD_CPPFLAGS="$CPPFLAGS"
663 OLD_LDFLAGS="$LDFLAGS"
666 msg="=> no alsa support for para_audiod/para_write"
667 if test "$OSTYPE" != "Linux"; then
672 if test "$have_alsa" = "yes"; then
673 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
675 AC_MSG_WARN([no alsa/asoundlib $msg])
679 if test "$have_alsa" = "yes"; then
680 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
682 AC_MSG_WARN([no libasound $msg])
686 if test "$have_alsa" = "yes"; then
687 alsa_ldflags="-lasound"
688 AC_SUBST(alsa_ldflags)
689 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
690 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
692 fade_errlist_objs="$fade_errlist_objs alsa_mix"
694 mixers="${mixers}alsa "
695 default_mixer="ALSA_MIX"
698 CPPFLAGS="$OLD_CPPFLAGS"
699 LDFLAGS="$OLD_LDFLAGS"
701 ########################################################################### libao
702 OLD_CPPFLAGS="$CPPFLAGS"
703 OLD_LDFLAGS="$LDFLAGS"
707 AC_ARG_WITH(ao_headers, [AS_HELP_STRING(--with-ao-headers=dir,
708 [look for ao/ao.h also in dir])])
709 if test -n "$with_ao_headers"; then
710 ao_cppflags="-I$with_ao_headers"
711 CPPFLAGS="$CPPFLAGS $ao_cppflags"
713 AC_ARG_WITH(ao_libs, [AS_HELP_STRING(--with-ao-libs=dir,
714 [look for libao also in dir])])
715 if test -n "$with_ao_libs"; then
716 ao_libs="-L$with_ao_libs"
717 LDFLAGS="$LDFLAGS $ao_libs"
719 msg="no libao support for para_audiod/para_write"
720 AC_CHECK_HEADERS([ao/ao.h], [
723 AC_MSG_WARN([ao.h not found, $msg])
725 if test "$have_ao" = "yes"; then
726 AC_CHECK_LIB([ao], [ao_initialize], [], [
728 AC_MSG_WARN([ao lib not found or not working, $msg])
731 if test "$have_ao" = "yes"; then
732 AC_CHECK_HEADERS([pthread.h], [
735 AC_MSG_WARN([pthread.h not found, $msg])
738 if test "$have_ao" = "yes"; then
739 AC_CHECK_LIB([pthread], [pthread_create], [], [
741 AC_MSG_WARN([pthread lib not found or not working, $msg])
744 if test "$have_ao" = "yes"; then
745 AC_SUBST(ao_cppflags)
746 ao_ldflags="$ao_libs -lao -lpthread"
749 audiod_errlist_objs="$audiod_errlist_objs ao_write"
750 audiod_cmdline_objs="$audiod_cmdline_objs ao_write"
754 CPPFLAGS="$OLD_CPPFLAGS"
755 LDFLAGS="$OLD_LDFLAGS"
757 ############################################################# readline
758 OLD_CPPFLAGS="$CPPFLAGS"
759 OLD_LDFLAGS="$LDFLAGS"
763 AC_ARG_WITH(readline_headers, [AS_HELP_STRING(--with-readline-headers=dir,
764 [look for libreadline header files also in dir])])
765 if test -n "$with_readline_headers"; then
766 readline_cppflags="-I$with_readline_headers"
767 CPPFLAGS="$CPPFLAGS $readline_cppflags"
770 AC_ARG_WITH(readline_libs, [AS_HELP_STRING(--with-readline-libs=dir,
771 [look for readline library also in dir])])
772 if test -n "$with_readline_libs"; then
773 readline_libs="-L$with_readline_libs"
774 LDFLAGS="$LDFLAGS $readline_libs"
776 msg="no interactive cli support"
777 AC_CHECK_HEADERS([readline/readline.h], [
780 AC_MSG_WARN([readline/readline.h not found, $msg])
783 if test "$have_curses" != "yes"; then
785 AC_MSG_WARN([interactive cli support depends on curses,])
786 AC_MSG_WARN([but no curses lib was detected, $msg])
789 if test "$have_readline" = "yes"; then
790 readline_ldflags="$readline_libs -lreadline"
791 AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
792 if test "$have_readline" = "no"; then # try with -lcurses
794 AC_MSG_NOTICE([trying again with -lcurses])
795 unset ac_cv_search_rl_free_keymap 2> /dev/null
796 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
798 readline_ldflags="$readline_ldflags -lcurses"
801 if test "$have_readline" = "no"; then # try with -ltermcap
803 AC_MSG_NOTICE([trying again with -ltermcap])
804 unset ac_cv_search_rl_free_keymap 2> /dev/null
805 AC_SEARCH_LIBS([rl_free_keymap], [readline], [
807 readline_ldflags="$readline_ldflags -ltermcap"
812 if test "$have_readline" = "yes"; then
813 AC_SUBST(readline_cppflags)
814 AC_SUBST(readline_ldflags)
815 client_errlist_objs="$client_errlist_objs interactive"
816 AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
818 AC_MSG_WARN([libreadline not found or unusable])
820 CPPFLAGS="$OLD_CPPFLAGS"
821 LDFLAGS="$OLD_LDFLAGS"
823 ############################################################# libsamplerate
824 OLD_CPPFLAGS="$CPPFLAGS"
825 OLD_LDFLAGS="$LDFLAGS"
828 have_samplerate="yes"
829 AC_ARG_WITH(samplerate_headers, [AS_HELP_STRING(--with-samplerate-headers=dir,
830 [look for samplerate headers also in dir])])
831 if test -n "$with_samplerate_headers"; then
832 samplerate_cppflags="-I$with_samplerate_headers"
833 CPPFLAGS="$CPPFLAGS $samplerate_cppflags"
835 AC_ARG_WITH(samplerate_libs, [AS_HELP_STRING(--with-samplerate-libs=dir,
836 [look for samplerate libs also in dir])])
837 if test -n "$with_samplerate_libs"; then
838 samplerate_libs="-L$with_samplerate_libs"
839 LDFLAGS="$LDFLAGS $samplerate_libs"
842 AC_CHECK_HEADER(samplerate.h, [], have_samplerate=no)
843 AC_CHECK_LIB([samplerate], [src_process], [], have_samplerate=no, [])
845 if test "$have_samplerate" = "yes"; then
846 AC_SUBST(samplerate_cppflags)
847 samplerate_ldflags="$samplerate_libs -lsamplerate"
848 AC_SUBST(samplerate_ldflags)
850 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
851 audiod_cmdline_objs="$audiod_cmdline_objs resample_filter"
853 AC_MSG_WARN([no resample support in para_audiod/para_filter])
855 CPPFLAGS="$OLD_CPPFLAGS"
856 LDFLAGS="$OLD_LDFLAGS"
858 ######################################################################### server
859 if test \( "$have_openssl" = "yes" -o "$have_gcrypt" = "yes" \) \
860 -a "$have_osl" = "yes" ; then
863 executables="$executables server"
864 server_cmdline_objs="server"
865 server_errlist_objs="$server_errlist_objs
907 ############################################################# client
908 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
910 executables="$executables client"
911 client_cmdline_objs="client"
912 client_errlist_objs="$client_errlist_objs
931 ############################################################# audiod
932 if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
934 executables="$executables audiod"
935 audiod_cmdline_objs="$audiod_cmdline_objs
946 audiod_errlist_objs="$audiod_errlist_objs
983 audiod_ldflags="$audiod_ldflags -lm"
984 audiod_audio_formats="$audiod_audio_formats wma"
988 ########################################################################### fade
989 if test -n "$mixers"; then
991 executables="$executables fade"
992 fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
993 fade_cmdline_objs="fade"
994 fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
995 AC_SUBST(fade_objs, add_dot_o($fade_objs))
996 AC_SUBST(fade_ldflags, $fade_ldflags)
997 AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
998 objlist_to_errlist($fade_errlist_objs),
999 errors used by para_fade)
1001 for i in $mixers; do
1002 printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
1005 AC_DEFINE_UNQUOTED(MIXER_ENUM, $enum NUM_SUPPORTED_MIXERS,
1006 enum of supported mixers)
1007 AC_DEFINE_UNQUOTED(DEFAULT_MIXER, $default_mixer,
1008 use this mixer if none was specified)
1009 names="$(for i in $mixers; do printf \"$i\",' ' ; done)"
1010 AC_DEFINE_UNQUOTED(MIXER_NAMES, $names, supported mixer names)
1012 for i in $mixers; do
1013 printf 'extern void '$i'_mix_init(struct mixer *); '
1016 AC_DEFINE_UNQUOTED(DECLARE_MIXER_INITS, $inits,
1017 init functions of the supported mixers)
1018 array="$(for i in $mixers; do printf '{.init = '$i'_mix_init},'; done)"
1019 AC_DEFINE_UNQUOTED(MIXER_ARRAY, $array, array of supported mixers)
1020 mixer_summary="supported mixers:: $mixers, default: $default_mixer"
1023 AC_MSG_WARN([no mixer support])
1024 mixer_summary="para_fade: no"
1026 ########################################################################### gui
1027 if test "$have_curses" = "yes"; then
1029 executables="$executables gui"
1030 gui_cmdline_objs="gui"
1044 gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
1047 AC_MSG_WARN([no curses lib, cannot build para_gui])
1049 ######################################################################## filter
1058 filter_errlist_objs="
1082 filter_cmdline_objs="
1089 if test "$have_vorbis" = "yes"; then
1090 filters="$filters oggdec"
1091 filter_errlist_objs="$filter_errlist_objs oggdec_filter"
1093 if test "$have_speex" = "yes"; then
1094 filters="$filters spxdec"
1095 filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
1097 if test "$have_opus" = "yes"; then
1098 filters="$filters opusdec"
1099 filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
1101 if test "$have_faad" = "yes"; then
1102 filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common"
1103 filters="$filters aacdec"
1105 if test "$have_mad" = "yes"; then
1106 filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter"
1107 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
1108 filters="$filters mp3dec"
1110 if test "$have_flac" = "yes"; then
1111 filter_errlist_objs="$filter_errlist_objs flacdec_filter"
1112 filters="$filters flacdec"
1114 if test "$have_samplerate" = "yes"; then
1115 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
1116 filter_cmdline_objs="$filter_cmdline_objs resample_filter"
1117 filters="$filters resample"
1119 ########################################################################## recv
1149 if test "$have_vorbis" = "yes" || \
1150 test "$have_speex" = "yes" || \
1151 test "$have_opus" = "yes"; then
1152 recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
1154 if test "$have_vorbis" = "yes"; then
1155 recv_errlist_objs="$recv_errlist_objs ogg_afh"
1157 if test "$have_speex" = "yes"; then
1158 recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
1160 if test "$have_opus" = "yes"; then
1161 recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
1163 if test "$have_faad" = "yes"; then
1164 recv_errlist_objs="$recv_errlist_objs aac_afh aac_common"
1166 if test "$have_flac" = "yes"; then
1167 recv_errlist_objs="$recv_errlist_objs flac_afh"
1169 recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
1170 AC_SUBST(recv_objs, add_dot_o($recv_objs))
1171 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
1172 errors used by para_recv)
1173 ########################################################################### afh
1174 afh_cmdline_objs="afh"
1187 if test "$have_vorbis" = "yes" || \
1188 test "$have_speex" = "yes" || \
1189 test "$have_opus" = "yes"; then
1190 afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
1192 if test "$have_vorbis" = "yes"; then
1193 afh_errlist_objs="$afh_errlist_objs ogg_afh"
1195 if test "$have_speex" = "yes"; then
1196 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
1198 if test "$have_opus" = "yes"; then
1199 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
1201 if test "$have_faad" = "yes"; then
1202 afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
1204 if test "$have_flac" = "yes"; then
1205 afh_errlist_objs="$afh_errlist_objs flac_afh"
1208 afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
1210 AC_SUBST(afh_objs, add_dot_o($afh_objs))
1211 AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
1212 objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
1213 ########################################################################## play
1257 if test "$have_core_audio" = "yes"; then
1258 play_errlist_objs="$play_errlist_objs osx_write ipc"
1259 play_cmdline_objs="$play_cmdline_objs osx_write.cmdline"
1261 if test "$have_vorbis" = "yes" || \
1262 test "$have_speex" = "yes" || \
1263 test "$have_opus" = "yes"; then
1264 play_errlist_objs="$play_errlist_objs ogg_afh_common"
1266 if test "$have_vorbis" = "yes"; then
1267 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
1269 if test "$have_speex" = "yes"; then
1270 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
1272 if test "$have_opus" = "yes"; then
1273 play_errlist_objs="$play_errlist_objs opusdec_filter opus_afh opus_common"
1275 if test "$have_faad" = "yes"; then
1276 play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common"
1278 if test "$have_mad" = "yes"; then
1279 play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
1280 play_errlist_objs="$play_errlist_objs mp3dec_filter"
1282 if test "$have_flac" = "yes"; then
1283 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
1285 if test "$have_oss" = "yes"; then
1286 play_errlist_objs="$play_errlist_objs oss_write"
1287 play_cmdline_objs="$play_cmdline_objs oss_write"
1289 if test "$have_alsa" = "yes"; then
1290 play_errlist_objs="$play_errlist_objs alsa_write"
1291 play_cmdline_objs="$play_cmdline_objs alsa_write"
1293 if test "$have_ao" = "yes"; then
1294 play_errlist_objs="$play_errlist_objs ao_write"
1295 play_cmdline_objs="$play_cmdline_objs ao_write"
1297 if test "$have_readline" = "yes"; then
1298 play_errlist_objs="$play_errlist_objs interactive"
1300 if test "$have_samplerate" = "yes"; then
1301 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
1302 play_cmdline_objs="$play_cmdline_objs resample_filter"
1305 play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
1306 AC_SUBST(play_objs, add_dot_o($play_objs))
1307 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
1308 objlist_to_errlist($play_errlist_objs), errors used by para_play)
1309 ######################################################################### write
1310 write_cmdline_objs="
1314 write_errlist_objs="
1329 default_writer="FILE_WRITE"
1331 if test "$have_core_audio" = "yes"; then
1332 write_errlist_objs="$write_errlist_objs osx_write ipc"
1333 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
1334 writers="$writers osx"
1335 default_writer="OSX_WRITE"
1337 if test "$have_ao" = "yes"; then
1338 write_errlist_objs="$write_errlist_objs ao_write"
1339 write_cmdline_objs="$write_cmdline_objs ao_write"
1340 writers="$writers ao"
1341 default_writer="AO_WRITE"
1343 if test "$have_oss" = "yes"; then
1344 write_errlist_objs="$write_errlist_objs oss_write"
1345 write_cmdline_objs="$write_cmdline_objs oss_write"
1346 writers="$writers oss"
1347 default_writer="OSS_WRITE"
1349 if test "$have_alsa" = "yes"; then
1350 write_errlist_objs="$write_errlist_objs alsa_write"
1351 write_cmdline_objs="$write_cmdline_objs alsa_write"
1352 writers="$writers alsa"
1353 default_writer="ALSA_WRITE"
1355 write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
1356 AC_SUBST(write_objs, add_dot_o($write_objs))
1357 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
1358 objlist_to_errlist($write_errlist_objs), errors used by para_write)
1359 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
1360 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
1361 enum of supported writers)
1362 AC_DEFINE_UNQUOTED(DEFAULT_WRITER, $default_writer, use this writer if none was specified)
1363 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
1364 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
1365 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
1366 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
1367 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
1368 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
1369 ######################################################################## audioc
1370 audioc_cmdline_objs="audioc"
1371 audioc_errlist_objs="
1379 if test "$have_readline" = "yes"; then
1380 audioc_errlist_objs="$audioc_errlist_objs
1387 audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
1388 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
1389 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
1390 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
1391 ############################################################# error2.h
1392 # these are always built
1395 $filter_errlist_objs
1396 $audioc_errlist_objs
1402 # optional executables
1403 if test "$build_server" = "yes"; then
1404 all_errlist_objs="$all_errlist_objs $server_errlist_objs"
1406 if test "$build_gui" = "yes"; then
1407 all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
1409 if test "$build_fade" = "yes"; then
1410 all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
1412 if test "$build_client" = "yes"; then
1413 all_errlist_objs="$all_errlist_objs $client_errlist_objs"
1415 if test "$build_audiod" = "yes"; then
1416 all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
1419 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
1421 object_executable_matrix=
1422 for i in $executables; do
1423 eval objs=\$${i}_errlist_objs
1424 object_executable_matrix="$object_executable_matrix $i: $objs"
1426 # use echo to replace newlines by space
1427 AC_SUBST(object_executable_matrix, $(echo $object_executable_matrix))
1429 for obj in $all_errlist_objs; do
1430 SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
1432 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
1433 [enum {$SS NUM_SS}],
1434 [list of all objects that use the paraslash error facility]
1436 ################################################################## status items
1438 status_items="basename status num_played mtime bitrate frequency file_size
1439 status_flags format score techinfo afs_mode
1440 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
1441 offset seconds_total stream_start current_time audiod_uptime image_id
1442 lyrics_id duration directory lyrics_name image_name path hash channels
1443 last_played num_chunks chunk_time amplification artist title year album
1447 for i in $status_items; do
1448 result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
1450 AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
1451 [enum of all status items])
1454 for i in $status_items; do
1455 result="$result \"$i\", "
1457 AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
1458 [char * array of all status items])
1460 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
1461 [formats supported by para_server and para_afh])
1463 AC_SUBST(executables)
1465 filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
1466 audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
1467 server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
1468 client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
1470 AC_SUBST(filter_objs, add_dot_o($filter_objs))
1471 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
1472 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
1474 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
1475 AC_SUBST(audiod_ldflags, $audiod_ldflags)
1476 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
1477 errors used by para_audiod)
1479 AC_SUBST(server_objs, add_dot_o($server_objs))
1480 AC_SUBST(server_ldflags, $server_ldflags)
1481 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
1482 objlist_to_errlist($server_errlist_objs), errors used by para_server)
1484 AC_SUBST(client_objs, add_dot_o($client_objs))
1485 AC_SUBST(client_ldflags, $client_ldflags)
1486 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
1487 objlist_to_errlist($client_errlist_objs), errors used by para_client)
1489 AC_SUBST(gui_objs, add_dot_o($gui_objs))
1490 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
1491 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
1493 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
1494 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
1495 enum of supported filters)
1496 inits="$(for i in $filters; do printf 'extern void '$i'_filter_init(struct filter *f); '; done)"
1497 AC_DEFINE_UNQUOTED(DECLARE_FILTER_INITS, $inits, init functions of the supported filters)
1498 array="$(for i in $filters; do printf '{.name = "'$i'", .init = '$i'_filter_init},'; done)"
1499 AC_DEFINE_UNQUOTED(FILTER_ARRAY, $array, array of supported filters)
1501 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
1502 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
1503 enum of audio formats supported by audiod)
1504 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
1505 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
1509 paraslash configuration:
1510 ~~~~~~~~~~~~~~~~~~~~~~~~
1511 unix socket credentials: $have_ucred
1512 readline (interactive CLIs): $have_readline
1513 audio formats handlers: $audio_format_handlers
1514 id3 version2 support: $have_libid3tag
1515 filters: $(echo $filters)
1519 para_server: $build_server
1520 para_gui: $build_gui
1521 para_fade: $build_fade
1522 para_client: $build_client
1523 para_audiod: $build_audiod