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