Merge branch 'maint'
[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])
295 HAVE_FAAD=yes
296 AC_CHECK_HEADER(neaacdec.h, [], HAVE_FAAD=no)
297 AC_CHECK_LIB([faad], [NeAACDecOpen], [], HAVE_FAAD=no)
298 LIB_SUBST_FLAGS(faad)
299 UNSTASH_FLAGS
300 ########################################################################### mad
301 STASH_FLAGS
302 LIB_ARG_WITH([mad], [-lmad])
303 HAVE_MAD=yes
304 AC_CHECK_HEADER(mad.h, [], HAVE_MAD=no)
305 AC_CHECK_LIB([mad], [mad_stream_init], [], HAVE_MAD=no)
306 LIB_SUBST_FLAGS(mad)
307 UNSTASH_FLAGS
308 ###################################################################### libid3tag
309 STASH_FLAGS
310 LIB_ARG_WITH([id3tag], [-lid3tag -lz])
311 HAVE_ID3TAG=yes
312 AC_CHECK_HEADER(id3tag.h, [], HAVE_ID3TAG=no)
313 AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
314 LIB_SUBST_FLAGS(id3tag)
315 UNSTASH_FLAGS
316 ########################################################################### oss
317 STASH_FLAGS
318 LIB_ARG_WITH([oss], [])
319 AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=yes], [HAVE_OSS=no])
320 AC_CHECK_LIB(ossaudio, _oss_ioctl, [oss_ldflags="$oss_ldflags -lossaudio"], [])
321 LIB_SUBST_FLAGS(oss)
322 UNSTASH_FLAGS
323 ########################################################################### alsa
324 STASH_FLAGS
325 LIB_ARG_WITH([alsa], [-lasound])
326 HAVE_ALSA=yes
327 AC_CHECK_HEADER(alsa/asoundlib.h, [], HAVE_ALSA=no)
328 AC_CHECK_LIB([asound], [snd_pcm_open], [], HAVE_ALSA=no)
329 LIB_SUBST_FLAGS(alsa)
330 UNSTASH_FLAGS
331 ######################################################################### pthread
332 STASH_FLAGS
333 LIB_ARG_WITH([pthread], [-lpthread])
334 HAVE_PTHREAD=yes
335 AC_CHECK_HEADER(pthread.h, [], HAVE_PTHREAD=no)
336 AC_CHECK_LIB([pthread], [pthread_create], [], HAVE_PTHREAD=no)
337 LIB_SUBST_FLAGS(pthread)
338 UNSTASH_FLAGS
339 ########################################################################### libao
340 STASH_FLAGS
341 LIB_ARG_WITH([ao], [-lao])
342 HAVE_AO=yes
343 AC_CHECK_HEADER(ao/ao.h, [], HAVE_AO=no)
344 AC_CHECK_LIB([ao], [ao_initialize], [], HAVE_AO=no)
345 LIB_SUBST_FLAGS(ao)
346 UNSTASH_FLAGS
347 AC_DEFUN([NEED_AO_OBJECTS], [{ test $HAVE_AO = yes -a $HAVE_PTHREAD = yes; }])
348 ######################################################################## readline
349 STASH_FLAGS
350 AC_SEARCH_LIBS([tgetent], [tinfo curses terminfo termcap])
351 LIB_ARG_WITH([readline], [-lreadline $LIBS])
352 HAVE_READLINE=yes
353 AC_CHECK_HEADER([readline/readline.h], [], [HAVE_READLINE=no])
354 AC_CHECK_LIB([readline], [rl_free_keymap], [], HAVE_READLINE=no)
355 AC_CHECK_DECL(
356 [rl_free_keymap],
357 [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
358 [],
359 [
360 #include <stdio.h>
361 #include <readline/readline.h>
362 ]
363 )
364 LIB_SUBST_FLAGS(readline)
365 UNSTASH_FLAGS
366 ############################################################# libsamplerate
367 STASH_FLAGS
368 LIB_ARG_WITH([samplerate], [-lsamplerate])
369 HAVE_SAMPLERATE=yes
370 AC_CHECK_HEADER(samplerate.h, [], HAVE_SAMPLERATE=no)
371 AC_CHECK_LIB([samplerate], [src_process], [], HAVE_SAMPLERATE=no)
372 LIB_SUBST_FLAGS(samplerate)
373 UNSTASH_FLAGS
374 ######################################################################### ubsan
375 AC_ARG_ENABLE([ubsan], [AS_HELP_STRING(--enable-ubsan,
376 [Detect and report undefined behaviour.])],
377 [ENABLE_UBSAN=yes], [ENABLE_UBSAN=no])
378 AC_SUBST(ENABLE_UBSAN)
379 ######################################################################### server
380 if test -n "$CRYPTOLIB" && test $HAVE_OSL = yes && test -n "$BISON" && \
381 test -n "$FLEX"; then
382 build_server="yes"
383 executables="$executables server upgrade_db"
384 server_errlist_objs="
385 server
386 afh_common
387 mp3_afh
388 vss
389 command
390 net
391 string
392 signal
393 time
394 daemon
395 http_send
396 close_on_fork
397 crypt_common
398 base64
399 ipc
400 dccp_send
401 fd
402 user_list
403 chunk_queue
404 afs
405 aft
406 mood
407 mp
408 score
409 attribute
410 blob
411 playlist
412 sched
413 acl
414 send_common
415 udp_send
416 color
417 fec
418 wma_afh
419 wma_common
420 sideband
421 version
422 lsu
423 "
424 if test "$CRYPTOLIB" = openssl; then
425 server_errlist_objs="$server_errlist_objs openssl"
426 else
427 server_errlist_objs="$server_errlist_objs gcrypt"
428 fi
429 NEED_OGG_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh_common"
430 NEED_VORBIS_OBJECTS() && server_errlist_objs="$server_errlist_objs ogg_afh"
431 NEED_SPEEX_OBJECTS() && server_errlist_objs="$server_errlist_objs spx_afh spx_common"
432 NEED_OPUS_OBJECTS() && server_errlist_objs="$server_errlist_objs opus_afh opus_common"
433 NEED_FLAC_OBJECTS && server_errlist_objs="$server_errlist_objs flac_afh"
434 if test $HAVE_FAAD = yes; then
435 server_errlist_objs="$server_errlist_objs aac_afh mp4"
436 fi
437 server_objs="$server_errlist_objs"
438 AC_SUBST(server_objs, add_dot_o($server_objs))
439 else
440 build_server="no"
441 fi
442 ############################################################# upgrade_db
443 upgrade_db_objs='
444 crypt_common
445 exec
446 fd
447 string
448 upgrade_db
449 version
450 base64
451 '
452 AC_SUBST(upgrade_db_objs, add_dot_o($upgrade_db_objs))
453 ############################################################# client
454 if test -n "$CRYPTOLIB"; then
455 build_client="yes"
456 executables="$executables client"
457 client_errlist_objs="
458 client
459 net
460 string
461 fd
462 lsu
463 sched
464 stdin
465 stdout
466 time
467 sideband
468 client_common
469 buffer_tree
470 crypt_common
471 base64
472 version
473 "
474 if test "$CRYPTOLIB" = openssl; then
475 client_errlist_objs="$client_errlist_objs openssl"
476 else
477 client_errlist_objs="$client_errlist_objs gcrypt"
478 fi
479 if test $HAVE_READLINE = yes; then
480 client_errlist_objs="$client_errlist_objs interactive"
481 fi
482 client_objs="$client_errlist_objs"
483 AC_SUBST(client_objs, add_dot_o($client_errlist_objs))
484 else
485 build_client="no"
486 fi
487 ############################################################# audiod
488 if test -n "$CRYPTOLIB"; then
489 build_audiod="yes"
490 executables="$executables audiod"
491 audiod_audio_formats="wma"
492 audiod_errlist_objs="$audiod_errlist_objs
493 audiod
494 signal
495 string
496 daemon
497 stat
498 net
499 crypt_common
500 base64
501 sideband
502 time
503 grab_client
504 filter_common
505 wav_filter
506 compress_filter
507 amp_filter
508 http_recv
509 dccp_recv
510 recv_common
511 fd
512 sched
513 write_common
514 file_write
515 audiod_command
516 fecdec_filter
517 client_common
518 udp_recv
519 color
520 fec
521 prebuffer_filter
522 version
523 bitstream
524 imdct
525 wma_common
526 wmadec_filter
527 buffer_tree
528 sync_filter
529 lsu
530 "
531 if test "$CRYPTOLIB" = openssl; then
532 audiod_errlist_objs="$audiod_errlist_objs openssl"
533 else
534 audiod_errlist_objs="$audiod_errlist_objs gcrypt"
535 fi
536 NEED_VORBIS_OBJECTS && {
537 audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
538 audiod_audio_formats="$audiod_audio_formats ogg"
539 }
540 NEED_SPEEX_OBJECTS && {
541 audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
542 audiod_audio_formats="$audiod_audio_formats spx"
543 }
544 NEED_OPUS_OBJECTS && {
545 audiod_errlist_objs="$audiod_errlist_objs opusdec_filter opus_common"
546 audiod_audio_formats="$audiod_audio_formats opus"
547 }
548 NEED_FLAC_OBJECTS && {
549 audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
550 audiod_audio_formats="$audiod_audio_formats flac"
551 }
552 if test $HAVE_FAAD = yes; then
553 audiod_errlist_objs="$audiod_errlist_objs aacdec_filter"
554 audiod_audio_formats="$audiod_audio_formats aac"
555 fi
556 if test $HAVE_MAD = yes; then
557 audiod_audio_formats="$audiod_audio_formats mp3"
558 audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
559 fi
560 if test $HAVE_OSS = yes; then
561 audiod_errlist_objs="$audiod_errlist_objs oss_write"
562 fi
563 if test $HAVE_ALSA = yes; then
564 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
565 fi
566 NEED_AO_OBJECTS && {
567 audiod_errlist_objs="$audiod_errlist_objs ao_write"
568 }
569 if test $HAVE_SAMPLERATE = yes; then
570 audiod_errlist_objs="$audiod_errlist_objs resample_filter check_wav"
571 fi
572 audiod_objs="$audiod_errlist_objs"
573 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
574
575 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
576 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
577 enum of audio formats supported by audiod)
578 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
579 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
580 else
581 build_audiod="no"
582 fi
583 ########################################################################### mixer
584 if test $HAVE_OSS = yes -o $HAVE_ALSA = yes; then
585 build_mixer="yes"
586 executables="$executables mixer"
587 mixer_errlist_objs="mixer exec string fd time lsu version"
588 if test $HAVE_OSS = yes; then
589 mixer_errlist_objs="$mixer_errlist_objs oss_mix"
590 fi
591 if test $HAVE_ALSA = yes; then
592 mixer_errlist_objs="$mixer_errlist_objs alsa_mix"
593 fi
594 mixer_objs="$mixer_errlist_objs"
595 AC_SUBST(mixer_objs, add_dot_o($mixer_objs))
596 else
597 build_mixer="no"
598 AC_MSG_WARN([no mixer support])
599 fi
600 ########################################################################### gui
601 if test $HAVE_CURSES = yes; then
602 build_gui="yes"
603 executables="$executables gui"
604 gui_errlist_objs="
605 exec
606 signal
607 string
608 stat
609 ringbuffer
610 fd
611 gui
612 gui_theme
613 lsu
614 time
615 sched
616 version
617 "
618 gui_objs="$gui_errlist_objs"
619 AC_SUBST(gui_objs, add_dot_o($gui_objs))
620 else
621 build_gui="no"
622 AC_MSG_WARN([no curses lib, cannot build para_gui])
623 fi
624 ######################################################################## filter
625 filter_errlist_objs="
626 filter_common
627 wav_filter
628 compress_filter
629 filter
630 string
631 stdin
632 stdout
633 sched
634 fd
635 amp_filter
636 fecdec_filter
637 fec
638 lsu
639 version
640 prebuffer_filter
641 time
642 bitstream
643 imdct
644 wma_common
645 wmadec_filter
646 buffer_tree
647 net
648 sync_filter
649 "
650 NEED_VORBIS_OBJECTS && filter_errlist_objs="$filter_errlist_objs oggdec_filter"
651 NEED_SPEEX_OBJECTS && filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
652 NEED_OPUS_OBJECTS && filter_errlist_objs="$filter_errlist_objs opusdec_filter opus_common"
653 NEED_FLAC_OBJECTS && filter_errlist_objs="$filter_errlist_objs flacdec_filter"
654 if test $HAVE_FAAD = yes; then
655 filter_errlist_objs="$filter_errlist_objs aacdec_filter"
656 fi
657 if test $HAVE_MAD = yes; then
658 filter_errlist_objs="$filter_errlist_objs mp3dec_filter"
659 fi
660 if test $HAVE_SAMPLERATE = yes; then
661 filter_errlist_objs="$filter_errlist_objs resample_filter check_wav"
662 fi
663 filter_objs="$filter_errlist_objs"
664
665 AC_SUBST(filter_objs, add_dot_o($filter_objs))
666 ########################################################################## recv
667 recv_errlist_objs="
668 http_recv
669 recv_common
670 recv
671 time
672 string
673 net
674 dccp_recv
675 fd
676 sched
677 stdout
678 udp_recv
679 buffer_tree
680 afh_recv
681 afh_common
682 wma_afh
683 wma_common
684 mp3_afh
685 version
686 "
687 NEED_OGG_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh_common"
688 NEED_VORBIS_OBJECTS && recv_errlist_objs="$recv_errlist_objs ogg_afh"
689 NEED_SPEEX_OBJECTS && recv_errlist_objs="$recv_errlist_objs spx_afh spx_common"
690 NEED_OPUS_OBJECTS && recv_errlist_objs="$recv_errlist_objs opus_afh opus_common"
691 NEED_FLAC_OBJECTS && recv_errlist_objs="$recv_errlist_objs flac_afh"
692
693 if test $HAVE_FAAD = yes; then
694 recv_errlist_objs="$recv_errlist_objs aac_afh mp4"
695 fi
696 recv_objs="$recv_errlist_objs"
697 AC_SUBST(recv_objs, add_dot_o($recv_objs))
698 ########################################################################### afh
699 audio_format_handlers="mp3 wma"
700 afh_errlist_objs="
701 afh
702 string
703 fd
704 mp3_afh
705 afh_common
706 time
707 wma_afh
708 wma_common
709 version
710 "
711 NEED_OGG_OBJECTS && afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
712 NEED_VORBIS_OBJECTS && {
713 afh_errlist_objs="$afh_errlist_objs ogg_afh"
714 audio_format_handlers="$audio_format_handlers ogg"
715 }
716 NEED_SPEEX_OBJECTS && {
717 afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
718 audio_format_handlers="$audio_format_handlers spx"
719 }
720 NEED_OPUS_OBJECTS && {
721 afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
722 audio_format_handlers="$audio_format_handlers opus"
723 }
724 NEED_FLAC_OBJECTS && {
725 afh_errlist_objs="$afh_errlist_objs flac_afh"
726 audio_format_handlers="$audio_format_handlers flac"
727 }
728 if test $HAVE_FAAD = yes; then
729 afh_errlist_objs="$afh_errlist_objs aac_afh mp4"
730 audio_format_handlers="$audio_format_handlers aac"
731 fi
732
733 afh_objs="$afh_errlist_objs"
734
735 AC_SUBST(afh_objs, add_dot_o($afh_objs))
736 ########################################################################## play
737 play_errlist_objs="
738 play
739 fd
740 sched
741 buffer_tree
742 time
743 string
744 net
745 afh_recv
746 afh_common
747 wma_afh
748 wma_common
749 mp3_afh
750 recv_common
751 udp_recv
752 http_recv
753 dccp_recv
754 filter_common
755 fec
756 bitstream
757 imdct
758 wav_filter
759 compress_filter
760 amp_filter
761 prebuffer_filter
762 fecdec_filter
763 wmadec_filter
764 write_common
765 file_write
766 version
767 sync_filter
768 lsu
769 "
770 NEED_OGG_OBJECTS && play_errlist_objs="$play_errlist_objs ogg_afh_common"
771 NEED_VORBIS_OBJECTS && {
772 play_errlist_objs="$play_errlist_objs oggdec_filter ogg_afh"
773 }
774 NEED_SPEEX_OBJECTS && {
775 play_errlist_objs="$play_errlist_objs spxdec_filter spx_afh spx_common"
776 }
777 NEED_OPUS_OBJECTS &&
778 play_errlist_objs="$play_errlist_objs
779 opusdec_filter
780 opus_afh
781 opus_common
782 "
783 NEED_FLAC_OBJECTS && {
784 play_errlist_objs="$play_errlist_objs flacdec_filter flac_afh"
785 }
786 if test $HAVE_FAAD = yes; then
787 play_errlist_objs="$play_errlist_objs aac_afh aacdec_filter mp4"
788 fi
789 if test $HAVE_MAD = yes; then
790 play_errlist_objs="$play_errlist_objs mp3dec_filter"
791 fi
792 if test $HAVE_OSS = yes; then
793 play_errlist_objs="$play_errlist_objs oss_write"
794 fi
795 if test $HAVE_ALSA = yes; then
796 play_errlist_objs="$play_errlist_objs alsa_write"
797 fi
798 NEED_AO_OBJECTS && {
799 play_errlist_objs="$play_errlist_objs ao_write"
800 }
801 if test $HAVE_READLINE = yes; then
802 play_errlist_objs="$play_errlist_objs interactive"
803 fi
804 if test $HAVE_SAMPLERATE = yes; then
805 play_errlist_objs="$play_errlist_objs resample_filter check_wav"
806 fi
807
808 play_objs="$play_errlist_objs"
809 AC_SUBST(play_objs, add_dot_o($play_objs))
810 ######################################################################### write
811 write_errlist_objs="
812 write
813 write_common
814 file_write
815 time
816 fd
817 string
818 sched
819 stdin
820 buffer_tree
821 check_wav
822 version
823 "
824
825 NEED_AO_OBJECTS && {
826 write_errlist_objs="$write_errlist_objs ao_write"
827 }
828 if test $HAVE_OSS = yes; then
829 write_errlist_objs="$write_errlist_objs oss_write"
830 fi
831 if test $HAVE_ALSA = yes; then
832 write_errlist_objs="$write_errlist_objs alsa_write"
833 fi
834 write_objs="$write_errlist_objs"
835 AC_SUBST(write_objs, add_dot_o($write_objs))
836 ######################################################################## audioc
837 audioc_errlist_objs="
838 audioc
839 string
840 lsu
841 net
842 fd
843 time
844 version
845 "
846 if test $HAVE_READLINE = yes; then
847 audioc_errlist_objs="$audioc_errlist_objs
848 buffer_tree
849 interactive
850 sched
851 "
852 fi
853 audioc_objs="$audioc_errlist_objs"
854 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
855
856 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
857 [formats supported by para_server and para_afh])
858 AC_SUBST(executables)
859
860 AC_OUTPUT
861 AC_MSG_NOTICE([
862 paraslash configuration:
863 ~~~~~~~~~~~~~~~~~~~~~~~~
864 crypto lib: ${CRYPTOLIB:-[none]}
865 unix socket credentials: $have_ucred
866 readline (interactive CLIs): $HAVE_READLINE
867 id3 version 2 support: $HAVE_ID3TAG
868 faad: $HAVE_FAAD
869 audio format handlers: $audio_format_handlers
870
871 exe: $executables
872 para_server: $build_server
873 para_gui: $build_gui
874 para_mixer: $build_mixer
875 para_client: $build_client
876 para_audiod: $build_audiod
877 ])