rework score formula
[paraslash.git] / configure.ac
1 AC_PREREQ([2.61])
2
3 AC_INIT([paraslash], [m4_esyscmd_s(./GIT-VERSION-GEN)],
4 [maan@tuebingen.mpg.de], [], [http://people.tuebingen.mpg.de/maan/paraslash/])
5 AC_CONFIG_HEADERS([config.h])
6
7 AC_CONFIG_FILES([Makefile])
8 AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
9 AC_DEFUN([LIB_ARG_WITH], [
10 AC_ARG_WITH($1-headers, [AS_HELP_STRING(--with-$1-headers=dir,
11 [look for $1 headers in dir])])
12 AC_ARG_WITH($1-libs, [AS_HELP_STRING(--with-$1-libs=dir,
13 [look for $1 libraries in dir])])
14 if test -n "$with_$1_headers"; then
15 $1_cppflags="-I$with_$1_headers"
16 CPPFLAGS="$CPPFLAGS $$1_cppflags"
17 fi
18 if test -n "$with_$1_libs"; then
19 $1_ldflags="-L$with_$1_libs $2"
20 else
21 $1_ldflags="$2"
22 fi
23 LDFLAGS="$LDFLAGS $$1_ldflags"
24 ])
25
26 AC_DEFUN([STASH_FLAGS], [
27 OLD_CPPFLAGS="$CPPFLAGS"
28 OLD_LDFLAGS="$LDFLAGS"
29 OLD_LIBS="$LIBS"
30 ])
31
32 AC_DEFUN([UNSTASH_FLAGS], [
33 CPPFLAGS="$OLD_CPPFLAGS"
34 LDFLAGS="$OLD_LDFLAGS"
35 LIBS="$OLD_LIBS"
36 ])
37 AC_DEFUN([LIB_SUBST_FLAGS], [
38 if test "$HAVE_[]m4_toupper([$1])" = 'yes'; then
39 AC_DEFINE(HAVE_[]m4_toupper([$1]), 1,
40 define to 1 to turn on $1 support)
41 else
42 $1_cppflags=
43 $1_ldflags=
44 fi
45 AC_SUBST(HAVE_[]m4_toupper([$1]))
46 AC_SUBST($1_cppflags)
47 AC_SUBST($1_ldflags)
48 ])
49 AC_DEFUN([REQUIRE_EXECUTABLE], [
50 AC_PATH_PROG(m4_toupper([$1]), [$1])
51 test -z "$m4_toupper([$1])" && AC_MSG_ERROR(
52 [$1 is required to build this package])
53 ])
54
55 AC_USE_SYSTEM_EXTENSIONS
56 AC_C_BIGENDIAN()
57 AC_PROG_CC
58 AC_PROG_CPP
59
60 REQUIRE_EXECUTABLE([bison])
61 REQUIRE_EXECUTABLE([flex])
62 REQUIRE_EXECUTABLE([m4])
63
64 executables="recv filter audioc write afh play"
65 ########################################################################### osl
66 STASH_FLAGS
67 LIB_ARG_WITH([osl], [-losl])
68 HAVE_OSL=yes
69 AC_CHECK_HEADER(osl.h, [], [HAVE_OSL=no])
70 AC_CHECK_LIB([osl], [osl_open_table], [], [HAVE_OSL=no])
71 LIB_SUBST_FLAGS(osl)
72 UNSTASH_FLAGS
73 ######################################################################## lopsub
74 HAVE_LOPSUB=yes
75 AC_PATH_PROG([LOPSUBGEN], [lopsubgen])
76 test -z "$LOPSUBGEN" && HAVE_LOPSUB=no
77 STASH_FLAGS
78 LIB_ARG_WITH([lopsub], [-llopsub])
79 AC_CHECK_HEADER(lopsub.h, [], [HAVE_LOPSUB=no])
80 AC_CHECK_LIB([lopsub], [lls_merge], [], [HAVE_LOPSUB=no])
81 if test $HAVE_LOPSUB = no; then AC_MSG_ERROR([
82 The lopsub library is required to build this software, but
83 the above checks indicate it is not installed on your system.
84 Run the following command to download a copy.
85 git clone git://git.tuebingen.mpg.de/lopsub.git
86 Install the library, then run this configure script again.
87 ])
88 fi
89 LIB_SUBST_FLAGS([lopsub])
90 UNSTASH_FLAGS
91 ######################################################################## openssl
92 STASH_FLAGS
93 HAVE_OPENSSL=yes
94 LIB_ARG_WITH([openssl], [-lssl -lcrypto])
95 AC_CHECK_HEADER(openssl/ssl.h, [], [HAVE_OPENSSL=no])
96 AC_CHECK_LIB([crypto], [RAND_bytes], [], [HAVE_OPENSSL=no])
97 LIB_SUBST_FLAGS(openssl)
98 if test $HAVE_OPENSSL = yes; then
99 HAVE_RSA_SET0_KEY=yes
100 AC_CHECK_DECL([RSA_set0_key], [], [], [#include <openssl/rsa.h>])
101 AC_CHECK_LIB([crypto], [RSA_set0_key], [], [])
102 if test "$ac_cv_have_decl_RSA_set0_key" != "$ac_cv_lib_crypto_RSA_set0_key"; then
103 AC_MSG_ERROR([openssl header/library mismatch])
104 fi
105 test "$ac_cv_have_decl_RSA_set0_key" = yes &&
106 AC_DEFINE([HAVE_RSA_SET0_KEY], [1], [openssl >= 1.1])
107
108 HAVE_CRYPTO_CLEANUP_ALL_EX_DATA=yes
109 AC_CHECK_DECL([CRYPTO_cleanup_all_ex_data], [],
110 [HAVE_CRYPTO_CLEANUP_ALL_EX_DATA=no],
111 [#include <openssl/rsa.h>])
112 AC_CHECK_LIB([crypto], [CRYPTO_cleanup_all_ex_data], [],
113 [HAVE_CRYPTO_CLEANUP_ALL_EX_DATA=no])
114 test $HAVE_CRYPTO_CLEANUP_ALL_EX_DATA = yes &&
115 AC_DEFINE([HAVE_CRYPTO_CLEANUP_ALL_EX_DATA], [1],
116 [not available on FreeBSD 12])
117 HAVE_OPENSSL_THREAD_STOP=yes
118 AC_CHECK_DECL([OPENSSL_thread_stop], [],
119 [HAVE_OPENSSL_THREAD_STOP=no],
120 [#include <openssl/crypto.h>])
121 AC_CHECK_LIB([crypto], [OPENSSL_thread_stop], [],
122 [HAVE_OPENSSL_THREAD_STOP=no])
123 test $HAVE_OPENSSL_THREAD_STOP = yes &&
124 AC_DEFINE([HAVE_OPENSSL_THREAD_STOP], [1],
125 [not available on openssl-1.0])
126 fi
127 UNSTASH_FLAGS
128 ######################################################################### gcrypt
129 STASH_FLAGS
130 HAVE_GCRYPT=yes
131 LIB_ARG_WITH([gcrypt], [-lgcrypt])
132 AC_CHECK_HEADER(gcrypt.h, [], [HAVE_GCRYPT=no])
133 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [HAVE_GCRYPT=no])
134 LIB_SUBST_FLAGS(gcrypt)
135 UNSTASH_FLAGS
136 ######################################################################### crypto
137 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
138 Force using crypto library "lib". This package requires either
139 openssl or libgcrypt being installed. Possible values for "lib"
140 are thus "openssl" and "gcrypt". If this option is not given,
141 openssl is tried first. If openssl was not found, gcrypt is
142 tried next.])])
143
144 CRYPTOLIB="$enable_cryptolib"
145 case "$enable_cryptolib" in
146 "openssl")
147 test $HAVE_OPENSSL = no && AC_MSG_ERROR(openssl not found)
148 crypto_ldflags="$openssl_ldflags"
149 ;;
150 "gcrypt")
151 test $HAVE_GCRYPT = no && AC_MSG_ERROR(gcrypt not found)
152 crypto_ldflags="$gcrypt_ldflags"
153 ;;
154 "")
155 crypto_ldflags=
156 if test $HAVE_GCRYPT = yes; then
157 CRYPTOLIB=gcrypt
158 crypto_ldflags="$gcrypt_ldflags"
159 fi
160 if test $HAVE_OPENSSL = yes; then
161 CRYPTOLIB=openssl
162 crypto_ldflags="$openssl_ldflags"
163 fi
164 ;;
165 *)
166 AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib])
167 ;;
168 esac
169 AC_SUBST(crypto_ldflags)
170 ########################################################################## iconv
171 STASH_FLAGS
172 LIBS=
173 AC_SEARCH_LIBS([libiconv_open], [iconv],
174 [iconv_ldflags="$LIBS"],
175 []
176 )
177 AC_SUBST(iconv_ldflags)
178 AC_MSG_CHECKING([whether iconv needs const char ** cast])
179 AC_COMPILE_IFELSE([
180 AC_LANG_PROGRAM([
181 #include <iconv.h>
182 ],[
183 size_t iconv(iconv_t cd, const char **inbuf,
184 size_t *inbytesleft, char **outbuf,
185 size_t *outbytesleft);
186 ])
187 ],
188 [cast='(const char **)'; msg=yes],
189 [cast=; msg=no]
190 )
191 AC_DEFINE_UNQUOTED(ICONV_CAST, $cast, [cast for second arg to iconv()])
192 AC_MSG_RESULT($msg)
193 UNSTASH_FLAGS
194 ########################################################################### ucred
195 AC_CHECK_TYPE([struct ucred], [
196 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
197 ], [], [
198 #include <sys/types.h>
199 #include <sys/socket.h>
200 ])
201 ################################################################### FNM_EXTMATCH
202 AC_MSG_CHECKING(for extended wildcard pattern matching)
203 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
204 #include <fnmatch.h>
205 ]], [[
206 unsigned n = FNM_EXTMATCH;
207 ]])], [have_fnm_extmatch=yes], [have_fnm_extmatch=no])
208 AC_MSG_RESULT($have_fnm_extmatch)
209 if test $have_fnm_extmatch = yes; then
210 AC_DEFINE(HAVE_FNM_EXTMATCH, 1, define to 1 if FNM_EXTMATCH is defined)
211 fi
212 ########################################################################### curses
213 STASH_FLAGS
214 LIB_ARG_WITH([curses], [])
215 HAVE_CURSES=yes
216 AC_CHECK_HEADER(curses.h, [], [HAVE_CURSES=no])
217 AC_SEARCH_LIBS([initscr], [ncursesw curses], [], [HAVE_CURSES=no])
218 curses_ldflags="$curses_ldflags $LIBS"
219 LIB_SUBST_FLAGS(curses)
220 UNSTASH_FLAGS
221 ########################################################################### ip_mreqn
222 AC_CHECK_TYPE([struct ip_mreqn], [
223 AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 if you have struct ip_mreqn)
224 ], [], [
225 #include <netdb.h>
226 #include <net/if.h>
227 ])
228 ########################################################################### ogg
229 STASH_FLAGS
230 LIB_ARG_WITH([ogg], [-logg])
231 HAVE_OGG=yes
232 AC_CHECK_HEADERS([ogg/ogg.h], [], [HAVE_OGG=no])
233 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [HAVE_OGG=no])
234 AC_CHECK_LIB([ogg], [ogg_stream_flush_fill], [
235 AC_DEFINE(HAVE_OGG_STREAM_FLUSH_FILL, 1, [libogg >= 1.3.0])])
236 LIB_SUBST_FLAGS(ogg)
237 UNSTASH_FLAGS
238 ######################################################################### vorbis
239 STASH_FLAGS
240 LIB_ARG_WITH([vorbis], [-lvorbis -lvorbisfile])
241 HAVE_VORBIS=yes
242 AC_CHECK_HEADERS([vorbis/codec.h], [], [HAVE_VORBIS=no])
243 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [HAVE_VORBIS=no])
244 LIB_SUBST_FLAGS(vorbis)
245 UNSTASH_FLAGS
246 ######################################################################### speex
247 STASH_FLAGS
248 LIB_ARG_WITH([speex], [-lspeex])
249 HAVE_SPEEX=yes
250 AC_CHECK_HEADERS([speex/speex.h], [], [HAVE_SPEEX=no])
251 AC_CHECK_LIB([speex], [speex_decoder_init], [], [HAVE_SPEEX=no])
252 LIB_SUBST_FLAGS(speex)
253 UNSTASH_FLAGS
254 ######################################################################### opus
255 STASH_FLAGS
256 LIB_ARG_WITH([opus], [-lopus])
257 HAVE_OPUS=yes
258 AC_CHECK_HEADERS([opus/opus.h], [], [HAVE_OPUS=no])
259 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [HAVE_OPUS=no])
260 LIB_SUBST_FLAGS(opus)
261 UNSTASH_FLAGS
262 ########################################################################### flac
263 STASH_FLAGS
264 LIB_ARG_WITH([flac], [-lFLAC -lm])
265 HAVE_FLAC=yes
266 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], HAVE_FLAC=no)
267 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], HAVE_FLAC=no)
268 LIB_SUBST_FLAGS(flac)
269 UNSTASH_FLAGS
270
271 # some helper functions for codecs which use the ogg container format
272 AC_DEFUN([NEED_OGG_OBJECTS], [{
273 test "$HAVE_OGG" = 'yes' -a \( \
274 "$HAVE_VORBIS" = 'yes' \
275 -o "$HAVE_SPEEX" = 'yes' \
276 -o "$HAVE_OPUS" = 'yes' \
277 -o "$HAVE_FLAC" = 'yes' \
278 \)
279 }])
280 AC_DEFUN([NEED_VORBIS_OBJECTS], [{
281 test "$HAVE_OGG" = 'yes' -a "$HAVE_VORBIS" = 'yes'
282 }])
283 AC_DEFUN([NEED_SPEEX_OBJECTS], [{
284 test "$HAVE_OGG" = 'yes' -a "$HAVE_SPEEX" = 'yes'
285 }])
286 AC_DEFUN([NEED_OPUS_OBJECTS], [{
287 test "$HAVE_OGG" = 'yes' -a "$HAVE_OPUS" = 'yes'
288 }])
289 AC_DEFUN([NEED_FLAC_OBJECTS], [{
290 test "$HAVE_OGG" = 'yes' -a "$HAVE_FLAC" = 'yes'
291 }])
292 ########################################################################### faad
293 STASH_FLAGS
294 LIB_ARG_WITH([faad], [-lfaad -lmp4ff])
295 HAVE_FAAD=yes
296 AC_CHECK_HEADER(neaacdec.h, [], HAVE_FAAD=no)
297 AC_CHECK_HEADER(mp4ff.h, [], HAVE_FAAD=no)
298 AC_CHECK_LIB([faad], [NeAACDecOpen], [], HAVE_FAAD=no)
299 AC_CHECK_LIB([mp4ff], [mp4ff_meta_get_artist], [], HAVE_FAAD=no)
300 LIB_SUBST_FLAGS(faad)
301 UNSTASH_FLAGS
302 ########################################################################### mad
303 STASH_FLAGS
304 LIB_ARG_WITH([mad], [-lmad])
305 HAVE_MAD=yes
306 AC_CHECK_HEADER(mad.h, [], HAVE_MAD=no)
307 AC_CHECK_LIB([mad], [mad_stream_init], [], HAVE_MAD=no)
308 LIB_SUBST_FLAGS(mad)
309 UNSTASH_FLAGS
310 ###################################################################### libid3tag
311 STASH_FLAGS
312 LIB_ARG_WITH([id3tag], [-lid3tag -lz])
313 HAVE_ID3TAG=yes
314 AC_CHECK_HEADER(id3tag.h, [], HAVE_ID3TAG=no)
315 AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
316 LIB_SUBST_FLAGS(id3tag)
317 UNSTASH_FLAGS
318 ########################################################################### oss
319 STASH_FLAGS
320 LIB_ARG_WITH([oss], [])
321 AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=yes], [HAVE_OSS=no])
322 AC_CHECK_LIB(ossaudio, _oss_ioctl, [oss_ldflags="$oss_ldflags -lossaudio"], [])
323 LIB_SUBST_FLAGS(oss)
324 UNSTASH_FLAGS
325 ########################################################################### alsa
326 STASH_FLAGS
327 LIB_ARG_WITH([alsa], [-lasound])
328 HAVE_ALSA=yes
329 AC_CHECK_HEADER(alsa/asoundlib.h, [], HAVE_ALSA=no)
330 AC_CHECK_LIB([asound], [snd_pcm_open], [], HAVE_ALSA=no)
331 LIB_SUBST_FLAGS(alsa)
332 UNSTASH_FLAGS
333 ######################################################################### pthread
334 STASH_FLAGS
335 LIB_ARG_WITH([pthread], [-lpthread])
336 HAVE_PTHREAD=yes
337 AC_CHECK_HEADER(pthread.h, [], HAVE_PTHREAD=no)
338 AC_CHECK_LIB([pthread], [pthread_create], [], HAVE_PTHREAD=no)
339 LIB_SUBST_FLAGS(pthread)
340 UNSTASH_FLAGS
341 ########################################################################### libao
342 STASH_FLAGS
343 LIB_ARG_WITH([ao], [-lao])
344 HAVE_AO=yes
345 AC_CHECK_HEADER(ao/ao.h, [], HAVE_AO=no)
346 AC_CHECK_LIB([ao], [ao_initialize], [], HAVE_AO=no)
347 LIB_SUBST_FLAGS(ao)
348 UNSTASH_FLAGS
349 AC_DEFUN([NEED_AO_OBJECTS], [{ test $HAVE_AO = yes -a $HAVE_PTHREAD = yes; }])
350 ######################################################################## readline
351 STASH_FLAGS
352 AC_SEARCH_LIBS([tgetent], [tinfo curses terminfo termcap])
353 LIB_ARG_WITH([readline], [-lreadline $LIBS])
354 HAVE_READLINE=yes
355 AC_CHECK_HEADER([readline/readline.h], [], [HAVE_READLINE=no])
356 AC_CHECK_LIB([readline], [rl_free_keymap], [], HAVE_READLINE=no)
357 AC_CHECK_DECL(
358 [rl_free_keymap],
359 [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
360 [],
361 [
362 #include <stdio.h>
363 #include <readline/readline.h>
364 ]
365 )
366 LIB_SUBST_FLAGS(readline)
367 UNSTASH_FLAGS
368 ############################################################# libsamplerate
369 STASH_FLAGS
370 LIB_ARG_WITH([samplerate], [-lsamplerate])
371 HAVE_SAMPLERATE=yes
372 AC_CHECK_HEADER(samplerate.h, [], HAVE_SAMPLERATE=no)
373 AC_CHECK_LIB([samplerate], [src_process], [], HAVE_SAMPLERATE=no)
374 LIB_SUBST_FLAGS(samplerate)
375 UNSTASH_FLAGS
376 ######################################################################### server
377 if test -n "$CRYPTOLIB" && test $HAVE_OSL = yes && test -n "$BISON" && \
378 test -n "$FLEX"; then
379 build_server="yes"
380 executables="$executables server"
381 server_errlist_objs="
382 server
383 afh_common
384 mp3_afh
385 vss
386 command
387 net
388 string
389 signal
390 time
391 daemon
392 http_send
393 close_on_fork
394 mm
395 crypt_common
396 base64
397 ipc
398 dccp_send
399 fd
400 user_list
401 chunk_queue
402 afs
403 aft
404 mood
405 mp
406 score
407 attribute
408 blob
409 playlist
410 sched
411 acl
412 send_common
413 udp_send
414 color
415 fec
416 wma_afh
417 wma_common
418 sideband
419 version
420 lsu
421 "
422 if test "$CRYPTOLIB" = openssl; then
423 server_errlist_objs="$server_errlist_objs openssl"
424 else
425 server_errlist_objs="$server_errlist_objs gcrypt"
426 fi
427 NEED_OGG_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh_common"
428 NEED_VORBIS_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh"
429 NEED_SPEEX_OBJECTS() && server_errlist_objs="$server_errlist_objs spx_afh spx_common"
430 NEED_OPUS_OBJECTS() && server_errlist_objs="$server_errlist_objs opus_afh opus_common"
431 NEED_FLAC_OBJECTS && server_errlist_objs="$server_errlist_objs flac_afh"
432 if test $HAVE_FAAD = yes; then
433 server_errlist_objs="$server_errlist_objs aac_afh"
434 fi
435 server_objs="$server_errlist_objs"
436 AC_SUBST(server_objs, add_dot_o($server_objs))
437 else
438 build_server="no"
439 fi
440 ############################################################# client
441 if test -n "$CRYPTOLIB"; then
442 build_client="yes"
443 executables="$executables client"
444 client_errlist_objs="
445 client
446 net
447 string
448 fd
449 lsu
450 sched
451 stdin
452 stdout
453 time
454 sideband
455 client_common
456 buffer_tree
457 crypt_common
458 base64
459 version
460 "
461 if test "$CRYPTOLIB" = openssl; then
462 client_errlist_objs="$client_errlist_objs openssl"
463 else
464 client_errlist_objs="$client_errlist_objs gcrypt"
465 fi
466 if test $HAVE_READLINE = yes; then
467 client_errlist_objs="$client_errlist_objs interactive"
468 fi
469 client_objs="$client_errlist_objs"
470 AC_SUBST(client_objs, add_dot_o($client_errlist_objs))
471 else
472 build_client="no"
473 fi
474 ############################################################# audiod
475 if test -n "$CRYPTOLIB"; then
476 build_audiod="yes"
477 executables="$executables audiod"
478 audiod_audio_formats="wma"
479 audiod_errlist_objs="$audiod_errlist_objs
480 audiod
481 signal
482 string
483 daemon
484 stat
485 net
486 crypt_common
487 base64
488 sideband
489 time
490 grab_client
491 filter_common
492 wav_filter
493 compress_filter
494 amp_filter
495 http_recv
496 dccp_recv
497 recv_common
498 fd
499 sched
500 write_common
501 file_write
502 audiod_command
503 fecdec_filter
504 client_common
505 udp_recv
506 color
507 fec
508 prebuffer_filter
509 version
510 bitstream
511 imdct
512 wma_common
513 wmadec_filter
514 buffer_tree
515 sync_filter
516 lsu
517 "
518 if test "$CRYPTOLIB" = openssl; then
519 audiod_errlist_objs="$audiod_errlist_objs openssl"
520 else
521 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
522 fi
523 NEED_VORBIS_OBJECTS && {
524 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
525 audiod_audio_formats="$audiod_audio_formats ogg"
526 }
527 NEED_SPEEX_OBJECTS && {
528 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
529 audiod_audio_formats="$audiod_audio_formats spx"
530 }
531 NEED_OPUS_OBJECTS && {
532 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
533 audiod_audio_formats="$audiod_audio_formats opus"
534 }
535 NEED_FLAC_OBJECTS && {
536 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
537 audiod_audio_formats="$audiod_audio_formats flac"
538 }
539 if test $HAVE_FAAD = yes; then
540 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter"
541 audiod_audio_formats="$audiod_audio_formats aac"
542 fi
543 if test $HAVE_MAD = yes; then
544 audiod_audio_formats="$audiod_audio_formats mp3"
545 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
546 fi
547 if test $HAVE_OSS = yes; then
548 audiod_errlist_objs="$audiod_errlist_objs oss_write"
549 fi
550 if test $HAVE_ALSA = yes; then
551 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
552 fi
553 NEED_AO_OBJECTS && {
554 audiod_errlist_objs="$audiod_errlist_objs ao_write"
555 }
556 if test $HAVE_SAMPLERATE = yes; then
557 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
558 fi
559 audiod_objs="$audiod_errlist_objs"
560 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
561
562 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
563 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
564 enum of audio formats supported by audiod)
565 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
566 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
567 else
568 build_audiod="no"
569 fi
570 ########################################################################### mixer
571 if test $HAVE_OSS = yes -o $HAVE_ALSA = yes; then
572 build_mixer="yes"
573 executables="$executables mixer"
574 mixer_errlist_objs="mixer exec string fd lsu version"
575 if test $HAVE_OSS = yes; then
576 mixer_errlist_objs="$mixer_errlist_objs oss_mix"
577 fi
578 if test $HAVE_ALSA = yes; then
579 mixer_errlist_objs="$mixer_errlist_objs alsa_mix"
580 fi
581 mixer_objs="$mixer_errlist_objs"
582 AC_SUBST(mixer_objs, add_dot_o($mixer_objs))
583 else
584 build_mixer="no"
585 AC_MSG_WARN([no mixer support])
586 fi
587 ########################################################################### gui
588 if test $HAVE_CURSES = yes; then
589 build_gui="yes"
590 executables="$executables gui"
591 gui_errlist_objs="
592 exec
593 signal
594 string
595 stat
596 ringbuffer
597 fd
598 gui
599 gui_theme
600 lsu
601 time
602 sched
603 version
604 "
605 gui_objs="$gui_errlist_objs"
606 AC_SUBST(gui_objs, add_dot_o($gui_objs))
607 else
608 build_gui="no"
609 AC_MSG_WARN([no curses lib, cannot build para_gui])
610 fi
611 ######################################################################## filter
612 filter_errlist_objs="
613 filter_common
614 wav_filter
615 compress_filter
616 filter
617 string
618 stdin
619 stdout
620 sched
621 fd
622 amp_filter
623 fecdec_filter
624 fec
625 lsu
626 version
627 prebuffer_filter
628 time
629 bitstream
630 imdct
631 wma_common
632 wmadec_filter
633 buffer_tree
634 net
635 sync_filter
636 "
637 NEED_VORBIS_OBJECTS && filter_errlist_objs="$filter_errlist_objs oggdec_filter"
638 NEED_SPEEX_OBJECTS && filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
639 NEED_OPUS_OBJECTS && filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
640 NEED_FLAC_OBJECTS && filter_errlist_objs="$filter_errlist_objs flacdec_filter"
641 if test $HAVE_FAAD = yes; then
642 filter_errlist_objs="$filter_errlist_objs aacdec_filter"
643 fi
644 if test $HAVE_MAD = yes; then
645 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
646 fi
647 if test $HAVE_SAMPLERATE = yes; then
648 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
649 fi
650 filter_objs="$filter_errlist_objs"
651
652 AC_SUBST(filter_objs, add_dot_o($filter_objs))
653 ########################################################################## recv
654 recv_errlist_objs="
655 http_recv
656 recv_common
657 recv
658 time
659 string
660 net
661 dccp_recv
662 fd
663 sched
664 stdout
665 udp_recv
666 buffer_tree
667 afh_recv
668 afh_common
669 wma_afh
670 wma_common
671 mp3_afh
672 version
673 "
674 NEED_OGG_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
675 NEED_VORBIS_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh"
676 NEED_SPEEX_OBJECTS && recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
677 NEED_OPUS_OBJECTS && recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
678 NEED_FLAC_OBJECTS && recv_errlist_objs="$recv_errlist_objs flac_afh"
679
680 if test $HAVE_FAAD = yes; then
681 recv_errlist_objs="$recv_errlist_objs aac_afh"
682 fi
683 recv_objs="$recv_errlist_objs"
684 AC_SUBST(recv_objs, add_dot_o($recv_objs))
685 ########################################################################### afh
686 audio_format_handlers="mp3 wma"
687 afh_errlist_objs="
688 afh
689 string
690 fd
691 mp3_afh
692 afh_common
693 time
694 wma_afh
695 wma_common
696 version
697 "
698 NEED_OGG_OBJECTS && afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
699 NEED_VORBIS_OBJECTS && {
700 afh_errlist_objs="$afh_errlist_objs ogg_afh"
701 audio_format_handlers="$audio_format_handlers ogg"
702 }
703 NEED_SPEEX_OBJECTS && {
704 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
705 audio_format_handlers="$audio_format_handlers spx"
706 }
707 NEED_OPUS_OBJECTS && {
708 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
709 audio_format_handlers="$audio_format_handlers opus"
710 }
711 NEED_FLAC_OBJECTS && {
712 afh_errlist_objs="$afh_errlist_objs flac_afh"
713 audio_format_handlers="$audio_format_handlers flac"
714 }
715 if test $HAVE_FAAD = yes; then
716 afh_errlist_objs="$afh_errlist_objs aac_afh"
717 audio_format_handlers="$audio_format_handlers aac"
718 fi
719
720 afh_objs="$afh_errlist_objs"
721
722 AC_SUBST(afh_objs, add_dot_o($afh_objs))
723 ########################################################################## play
724 play_errlist_objs="
725 play
726 fd
727 sched
728 buffer_tree
729 time
730 string
731 net
732 afh_recv
733 afh_common
734 wma_afh
735 wma_common
736 mp3_afh
737 recv_common
738 udp_recv
739 http_recv
740 dccp_recv
741 filter_common
742 fec
743 bitstream
744 imdct
745 wav_filter
746 compress_filter
747 amp_filter
748 prebuffer_filter
749 fecdec_filter
750 wmadec_filter
751 write_common
752 file_write
753 version
754 sync_filter
755 lsu
756 "
757 NEED_OGG_OBJECTS && play_errlist_objs="$play_errlist_objs ogg_afh_common"
758 NEED_VORBIS_OBJECTS && {
759 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
760 }
761 NEED_SPEEX_OBJECTS && {
762 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
763 }
764 NEED_OPUS_OBJECTS &&
765 play_errlist_objs="$play_errlist_objs
766 opusdec_filter
767 opus_afh
768 opus_common
769 "
770 NEED_FLAC_OBJECTS && {
771 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
772 }
773 if test $HAVE_FAAD = yes; then
774 play_errlist_objs="$play_errlist_objs aac_afh aacdec_filter"
775 fi
776 if test $HAVE_MAD = yes; then
777 play_errlist_objs="$play_errlist_objs mp3dec_filter"
778 fi
779 if test $HAVE_OSS = yes; then
780 play_errlist_objs="$play_errlist_objs oss_write"
781 fi
782 if test $HAVE_ALSA = yes; then
783 play_errlist_objs="$play_errlist_objs alsa_write"
784 fi
785 NEED_AO_OBJECTS && {
786 play_errlist_objs="$play_errlist_objs ao_write"
787 }
788 if test $HAVE_READLINE = yes; then
789 play_errlist_objs="$play_errlist_objs interactive"
790 fi
791 if test $HAVE_SAMPLERATE = yes; then
792 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
793 fi
794
795 play_objs="$play_errlist_objs"
796 AC_SUBST(play_objs, add_dot_o($play_objs))
797 ######################################################################### write
798 write_errlist_objs="
799 write
800 write_common
801 file_write
802 time
803 fd
804 string
805 sched
806 stdin
807 buffer_tree
808 check_wav
809 version
810 "
811
812 NEED_AO_OBJECTS && {
813 write_errlist_objs="$write_errlist_objs ao_write"
814 }
815 if test $HAVE_OSS = yes; then
816 write_errlist_objs="$write_errlist_objs oss_write"
817 fi
818 if test $HAVE_ALSA = yes; then
819 write_errlist_objs="$write_errlist_objs alsa_write"
820 fi
821 write_objs="$write_errlist_objs"
822 AC_SUBST(write_objs, add_dot_o($write_objs))
823 ######################################################################## audioc
824 audioc_errlist_objs="
825 audioc
826 string
827 lsu
828 net
829 fd
830 version
831 "
832 if test $HAVE_READLINE = yes; then
833 audioc_errlist_objs="$audioc_errlist_objs
834 buffer_tree
835 interactive
836 sched
837 time
838 "
839 fi
840 audioc_objs="$audioc_errlist_objs"
841 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
842
843 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
844 [formats supported by para_server and para_afh])
845 AC_SUBST(executables)
846
847 AC_OUTPUT
848 AC_MSG_NOTICE([
849 paraslash configuration:
850 ~~~~~~~~~~~~~~~~~~~~~~~~
851 crypto lib: ${CRYPTOLIB:-[none]}
852 unix socket credentials: $have_ucred
853 readline (interactive CLIs): $HAVE_READLINE
854 id3 version 2 support: $HAVE_ID3TAG
855 faad: $HAVE_FAAD
856 audio format handlers: $audio_format_handlers
857
858 para_server: $build_server
859 para_gui: $build_gui
860 para_mixer: $build_mixer
861 para_client: $build_client
862 para_audiod: $build_audiod
863 ])