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