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