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