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