]> git.tuebingen.mpg.de Git - paraslash.git/blob - configure.ac
build: Construct audiod and client object list in Makefile.
[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                 AC_SUBST(HAVE_[]m4_toupper([$1]))
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 AC_DEFUN([REQUIRE_EXECUTABLE], [
51         AC_PATH_PROG(m4_toupper([$1]), [$1])
52         test -z "$m4_toupper([$1])" && AC_MSG_ERROR(
53                 [$1 is required to build this package])
54 ])
55
56 AC_USE_SYSTEM_EXTENSIONS
57 AC_C_BIGENDIAN()
58 AC_PROG_CC
59 AC_PROG_CPP
60
61 REQUIRE_EXECUTABLE([bison])
62 REQUIRE_EXECUTABLE([flex])
63 REQUIRE_EXECUTABLE([m4])
64
65 executables="recv filter audioc write afh play"
66 ########################################################################### osl
67 STASH_FLAGS
68 LIB_ARG_WITH([osl], [-losl])
69 HAVE_OSL=yes
70 AC_CHECK_HEADER(osl.h, [], [HAVE_OSL=no])
71 AC_CHECK_LIB([osl], [osl_open_table], [], [HAVE_OSL=no])
72 LIB_SUBST_FLAGS(osl)
73 UNSTASH_FLAGS
74 ######################################################################## lopsub
75 HAVE_LOPSUB=yes
76 AC_PATH_PROG([LOPSUBGEN], [lopsubgen])
77 test -z "$LOPSUBGEN" && HAVE_LOPSUB=no
78 STASH_FLAGS
79 LIB_ARG_WITH([lopsub], [-llopsub])
80 AC_CHECK_HEADER(lopsub.h, [], [HAVE_LOPSUB=no])
81 AC_CHECK_LIB([lopsub], [lls_merge], [], [HAVE_LOPSUB=no])
82 if test $HAVE_LOPSUB = no; then AC_MSG_ERROR([
83         The lopsub library is required to build this software, but
84         the above checks indicate it is not installed on your system.
85         Run the following command to download a copy.
86                 git clone git://git.tuebingen.mpg.de/lopsub.git
87         Install the library, then run this configure script again.
88 ])
89 fi
90 LIB_SUBST_FLAGS([lopsub])
91 UNSTASH_FLAGS
92 ######################################################################## openssl
93 STASH_FLAGS
94 HAVE_OPENSSL=yes
95 LIB_ARG_WITH([openssl], [-lssl -lcrypto])
96 AC_CHECK_HEADER(openssl/ssl.h, [], [HAVE_OPENSSL=no])
97 AC_CHECK_LIB([crypto], [RAND_bytes], [], [HAVE_OPENSSL=no])
98 LIB_SUBST_FLAGS(openssl)
99 if test $HAVE_OPENSSL = yes; then
100         HAVE_RSA_SET0_KEY=yes
101         AC_CHECK_DECL([RSA_set0_key], [], [], [#include <openssl/rsa.h>])
102         AC_CHECK_LIB([crypto], [RSA_set0_key], [], [])
103         if test "$ac_cv_have_decl_RSA_set0_key" != "$ac_cv_lib_crypto_RSA_set0_key"; then
104                 AC_MSG_ERROR([openssl header/library mismatch])
105         fi
106         if test "$ac_cv_have_decl_RSA_set0_key" = yes; then
107                 AC_DEFINE([HAVE_RSA_SET0_KEY], [1], [openssl >= 1.1])
108         else
109                 AC_MSG_WARN([
110         Old openssl library detected. Support for openssl-1.0 and earlier
111         will be removed in the next major paraslash release. Please upgrade
112         your openssl installation.])
113         fi
114         HAVE_CRYPTO_CLEANUP_ALL_EX_DATA=yes
115         AC_CHECK_DECL([CRYPTO_cleanup_all_ex_data], [],
116                 [HAVE_CRYPTO_CLEANUP_ALL_EX_DATA=no],
117                 [#include <openssl/rsa.h>])
118         AC_CHECK_LIB([crypto], [CRYPTO_cleanup_all_ex_data], [],
119                 [HAVE_CRYPTO_CLEANUP_ALL_EX_DATA=no])
120         test $HAVE_CRYPTO_CLEANUP_ALL_EX_DATA = yes &&
121                 AC_DEFINE([HAVE_CRYPTO_CLEANUP_ALL_EX_DATA], [1],
122                         [not available on FreeBSD 12])
123         HAVE_OPENSSL_THREAD_STOP=yes
124         AC_CHECK_DECL([OPENSSL_thread_stop], [],
125                 [HAVE_OPENSSL_THREAD_STOP=no],
126                 [#include <openssl/crypto.h>])
127         AC_CHECK_LIB([crypto], [OPENSSL_thread_stop], [],
128                 [HAVE_OPENSSL_THREAD_STOP=no])
129         test $HAVE_OPENSSL_THREAD_STOP = yes &&
130                 AC_DEFINE([HAVE_OPENSSL_THREAD_STOP], [1],
131                         [not available on openssl-1.0])
132 fi
133 UNSTASH_FLAGS
134 ######################################################################### gcrypt
135 STASH_FLAGS
136 HAVE_GCRYPT=yes
137 LIB_ARG_WITH([gcrypt], [-lgcrypt])
138 AC_CHECK_HEADER(gcrypt.h, [], [HAVE_GCRYPT=no])
139 AC_CHECK_LIB([gcrypt], [gcry_randomize], [], [HAVE_GCRYPT=no])
140 LIB_SUBST_FLAGS(gcrypt)
141 UNSTASH_FLAGS
142 ######################################################################### crypto
143 AC_ARG_ENABLE(cryptolib, [AS_HELP_STRING(--enable-cryptolib=lib, [
144         Force using crypto library "lib". This package requires either
145         openssl or libgcrypt being installed. Possible values for "lib"
146         are thus "openssl" and "gcrypt". If this option is not given,
147         openssl is tried first. If openssl was not found, gcrypt is
148         tried next.])])
149
150 CRYPTOLIB="$enable_cryptolib"
151 case "$enable_cryptolib" in
152 "openssl")
153         test $HAVE_OPENSSL = no && AC_MSG_ERROR(openssl not found)
154         crypto_ldflags="$openssl_ldflags"
155         ;;
156 "gcrypt")
157         test $HAVE_GCRYPT = no && AC_MSG_ERROR(gcrypt not found)
158         crypto_ldflags="$gcrypt_ldflags"
159         ;;
160 "")
161         crypto_ldflags=
162         if test $HAVE_GCRYPT = yes; then
163                 CRYPTOLIB=gcrypt
164                 crypto_ldflags="$gcrypt_ldflags"
165         fi
166         if test $HAVE_OPENSSL = yes; then
167                 CRYPTOLIB=openssl
168                 crypto_ldflags="$openssl_ldflags"
169         fi
170         ;;
171 *)
172         AC_MSG_ERROR([invalid value "$enable_cryptolib" for --enable-cryptolib])
173         ;;
174 esac
175 AC_SUBST(crypto_ldflags)
176 AC_SUBST(CRYPTOLIB)
177 ########################################################################## iconv
178 STASH_FLAGS
179 LIBS=
180 AC_SEARCH_LIBS([libiconv_open], [iconv],
181         [iconv_ldflags="$LIBS"],
182         []
183 )
184 AC_SUBST(iconv_ldflags)
185 AC_MSG_CHECKING([whether iconv needs const char ** cast])
186 AC_COMPILE_IFELSE([
187         AC_LANG_PROGRAM([
188                 #include <iconv.h>
189         ],[
190                 size_t iconv(iconv_t cd, const char **inbuf,
191                         size_t *inbytesleft, char **outbuf,
192                         size_t *outbytesleft);
193         ])
194 ],
195         [cast='(const char **)'; msg=yes],
196         [cast=; msg=no]
197 )
198 AC_DEFINE_UNQUOTED(ICONV_CAST, $cast, [cast for second arg to iconv()])
199 AC_MSG_RESULT($msg)
200 UNSTASH_FLAGS
201 ########################################################################### ucred
202 AC_CHECK_TYPE([struct ucred], [
203         AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
204 ], [], [
205         #include <sys/types.h>
206         #include <sys/socket.h>
207 ])
208 ################################################################### FNM_EXTMATCH
209 AC_MSG_CHECKING(for extended wildcard pattern matching)
210 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
211         #include <fnmatch.h>
212 ]], [[
213         unsigned n = FNM_EXTMATCH;
214 ]])], [have_fnm_extmatch=yes], [have_fnm_extmatch=no])
215 AC_MSG_RESULT($have_fnm_extmatch)
216 if test $have_fnm_extmatch = yes; then
217         AC_DEFINE(HAVE_FNM_EXTMATCH, 1, define to 1 if FNM_EXTMATCH is defined)
218 fi
219 ########################################################################### curses
220 STASH_FLAGS
221 LIB_ARG_WITH([curses], [])
222 HAVE_CURSES=yes
223 AC_CHECK_HEADER(curses.h, [], [HAVE_CURSES=no])
224 AC_SEARCH_LIBS([initscr], [ncursesw curses], [], [HAVE_CURSES=no])
225 curses_ldflags="$curses_ldflags $LIBS"
226 LIB_SUBST_FLAGS(curses)
227 UNSTASH_FLAGS
228 ########################################################################### ip_mreqn
229 AC_CHECK_TYPE([struct ip_mreqn], [
230         AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 if you have struct ip_mreqn)
231 ], [], [
232         #include <netdb.h>
233         #include <net/if.h>
234 ])
235 ########################################################################### ogg
236 STASH_FLAGS
237 LIB_ARG_WITH([ogg], [-logg])
238 HAVE_OGG=yes
239 AC_CHECK_HEADERS([ogg/ogg.h], [], [HAVE_OGG=no])
240 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [HAVE_OGG=no])
241 AC_CHECK_LIB([ogg], [ogg_stream_flush_fill], [
242         AC_DEFINE(HAVE_OGG_STREAM_FLUSH_FILL, 1, [libogg >= 1.3.0])])
243 LIB_SUBST_FLAGS(ogg)
244 UNSTASH_FLAGS
245 ######################################################################### vorbis
246 STASH_FLAGS
247 LIB_ARG_WITH([vorbis], [-lvorbis -lvorbisfile])
248 HAVE_VORBIS=yes
249 AC_CHECK_HEADERS([vorbis/codec.h], [], [HAVE_VORBIS=no])
250 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [HAVE_VORBIS=no])
251 LIB_SUBST_FLAGS(vorbis)
252 UNSTASH_FLAGS
253 ######################################################################### speex
254 STASH_FLAGS
255 LIB_ARG_WITH([speex], [-lspeex])
256 HAVE_SPEEX=yes
257 AC_CHECK_HEADERS([speex/speex.h], [], [HAVE_SPEEX=no])
258 AC_CHECK_LIB([speex], [speex_decoder_init], [], [HAVE_SPEEX=no])
259 LIB_SUBST_FLAGS(speex)
260 UNSTASH_FLAGS
261 ######################################################################### opus
262 STASH_FLAGS
263 LIB_ARG_WITH([opus], [-lopus])
264 HAVE_OPUS=yes
265 AC_CHECK_HEADERS([opus/opus.h], [], [HAVE_OPUS=no])
266 AC_CHECK_LIB([opus], [opus_multistream_decode], [], [HAVE_OPUS=no])
267 LIB_SUBST_FLAGS(opus)
268 UNSTASH_FLAGS
269 ########################################################################### flac
270 STASH_FLAGS
271 LIB_ARG_WITH([flac], [-lFLAC -lm])
272 HAVE_FLAC=yes
273 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], HAVE_FLAC=no)
274 AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], HAVE_FLAC=no)
275 LIB_SUBST_FLAGS(flac)
276 UNSTASH_FLAGS
277
278 # some helpers for the ogg container format
279 AS_IF([test "$HAVE_OGG" = 'yes' -a \( \
280                  "$HAVE_VORBIS" = 'yes' \
281                 -o "$HAVE_SPEEX" = 'yes' \
282                 -o "$HAVE_OPUS" = 'yes' \
283                 -o "$HAVE_FLAC" = 'yes' \
284 \)], [NEED_OGG_OBJECTS=yes], [NEED_OGG_OBJECTS=no])
285 AC_SUBST([NEED_OGG_OBJECTS])
286 AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_VORBIS" = 'yes'],
287         [NEED_VORBIS_OBJECTS=yes], [NEED_VORBIS_OBJECTS=no])
288 AC_SUBST([NEED_VORBIS_OBJECTS])
289 AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_SPEEX" = 'yes'],
290         [NEED_SPEEX_OBJECTS=yes], [NEED_SPEEX_OBJECTS=no])
291 AC_SUBST([NEED_SPEEX_OBJECTS])
292 AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_OPUS" = 'yes'],
293         [NEED_OPUS_OBJECTS=yes], [NEED_OPUS_OBJECTS=no])
294 AC_SUBST([NEED_OPUS_OBJECTS])
295 AS_IF([test "$HAVE_OGG" = 'yes' -a "$HAVE_FLAC" = 'yes'],
296         [NEED_FLAC_OBJECTS=yes], [NEED_FLAC_OBJECTS=no])
297 AC_SUBST([NEED_FLAC_OBJECTS])
298 ########################################################################### faad
299 STASH_FLAGS
300 LIB_ARG_WITH([faad], [-lfaad])
301 HAVE_FAAD=yes
302 AC_CHECK_HEADER(neaacdec.h, [], HAVE_FAAD=no)
303 AC_CHECK_LIB([faad], [NeAACDecOpen], [], HAVE_FAAD=no)
304 LIB_SUBST_FLAGS(faad)
305 UNSTASH_FLAGS
306 ########################################################################### mad
307 STASH_FLAGS
308 LIB_ARG_WITH([mad], [-lmad])
309 HAVE_MAD=yes
310 AC_CHECK_HEADER(mad.h, [], HAVE_MAD=no)
311 AC_CHECK_LIB([mad], [mad_stream_init], [], HAVE_MAD=no)
312 LIB_SUBST_FLAGS(mad)
313 UNSTASH_FLAGS
314 ###################################################################### libid3tag
315 STASH_FLAGS
316 LIB_ARG_WITH([id3tag], [-lid3tag -lz])
317 HAVE_ID3TAG=yes
318 AC_CHECK_HEADER(id3tag.h, [], HAVE_ID3TAG=no)
319 AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
320 LIB_SUBST_FLAGS(id3tag)
321 UNSTASH_FLAGS
322 ########################################################################### oss
323 STASH_FLAGS
324 LIB_ARG_WITH([oss], [])
325 AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=yes], [HAVE_OSS=no])
326 AC_CHECK_LIB(ossaudio, _oss_ioctl, [oss_ldflags="$oss_ldflags -lossaudio"], [])
327 LIB_SUBST_FLAGS(oss)
328 UNSTASH_FLAGS
329 ########################################################################### alsa
330 STASH_FLAGS
331 LIB_ARG_WITH([alsa], [-lasound])
332 HAVE_ALSA=yes
333 AC_CHECK_HEADER(alsa/asoundlib.h, [], HAVE_ALSA=no)
334 AC_CHECK_LIB([asound], [snd_pcm_open], [], HAVE_ALSA=no)
335 LIB_SUBST_FLAGS(alsa)
336 UNSTASH_FLAGS
337 ######################################################################### pthread
338 STASH_FLAGS
339 LIB_ARG_WITH([pthread], [-lpthread])
340 HAVE_PTHREAD=yes
341 AC_CHECK_HEADER(pthread.h, [], HAVE_PTHREAD=no)
342 AC_CHECK_LIB([pthread], [pthread_create], [], HAVE_PTHREAD=no)
343 LIB_SUBST_FLAGS(pthread)
344 UNSTASH_FLAGS
345 ########################################################################### libao
346 STASH_FLAGS
347 LIB_ARG_WITH([ao], [-lao])
348 HAVE_AO=yes
349 AC_CHECK_HEADER(ao/ao.h, [], HAVE_AO=no)
350 AC_CHECK_LIB([ao], [ao_initialize], [], HAVE_AO=no)
351 LIB_SUBST_FLAGS(ao)
352 UNSTASH_FLAGS
353 AS_IF([test $HAVE_AO = yes -a $HAVE_PTHREAD = yes],
354         [NEED_AO_OBJECTS]=yes, [NEED_AO_OBJECTS=no])
355 AC_SUBST([NEED_AO_OBJECTS])
356 ######################################################################## readline
357 STASH_FLAGS
358 AC_SEARCH_LIBS([tgetent], [tinfo curses terminfo termcap])
359 LIB_ARG_WITH([readline], [-lreadline $LIBS])
360 HAVE_READLINE=yes
361 AC_CHECK_HEADER([readline/readline.h], [], [HAVE_READLINE=no])
362 AC_CHECK_LIB([readline], [rl_free_keymap], [], HAVE_READLINE=no)
363 AC_CHECK_DECL(
364         [rl_free_keymap],
365         [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
366         [],
367         [
368                 #include <stdio.h>
369                 #include <readline/readline.h>
370         ]
371 )
372 LIB_SUBST_FLAGS(readline)
373 UNSTASH_FLAGS
374 ############################################################# libsamplerate
375 STASH_FLAGS
376 LIB_ARG_WITH([samplerate], [-lsamplerate])
377 HAVE_SAMPLERATE=yes
378 AC_CHECK_HEADER(samplerate.h, [], HAVE_SAMPLERATE=no)
379 AC_CHECK_LIB([samplerate], [src_process], [], HAVE_SAMPLERATE=no)
380 LIB_SUBST_FLAGS(samplerate)
381 UNSTASH_FLAGS
382 ######################################################################### ubsan
383 AC_ARG_ENABLE([ubsan], [AS_HELP_STRING(--enable-ubsan,
384         [Detect and report undefined behaviour.])],
385         [ENABLE_UBSAN=yes], [ENABLE_UBSAN=no])
386 AC_SUBST(ENABLE_UBSAN)
387 ######################################################### server and upgrade_db
388 if test -n "$CRYPTOLIB" && test $HAVE_OSL = yes; then
389         build_server="yes"
390         executables="$executables server upgrade_db"
391 else
392         build_server="no"
393 fi
394 ############################################################# client
395 if test -n "$CRYPTOLIB"; then
396         build_client="yes"
397         executables="$executables client"
398 else
399         build_client="no"
400 fi
401 ############################################################# audiod
402 if test -n "$CRYPTOLIB"; then
403         build_audiod="yes"
404         executables="$executables audiod"
405 else
406         build_audiod="no"
407 fi
408 ########################################################################### mixer
409 if test $HAVE_OSS = yes -o $HAVE_ALSA = yes; then
410         build_mixer="yes"
411         executables="$executables mixer"
412         mixer_objs="mixer exec string fd time lsu version"
413         if test $HAVE_OSS = yes; then
414                 mixer_objs="$mixer_objs oss_mix"
415         fi
416         if test $HAVE_ALSA = yes; then
417                 mixer_objs="$mixer_objs alsa_mix"
418         fi
419         AC_SUBST(mixer_objs, add_dot_o($mixer_objs))
420 else
421         build_mixer="no"
422         AC_MSG_WARN([no mixer support])
423 fi
424 ########################################################################### gui
425 if test $HAVE_CURSES = yes; then
426         build_gui="yes"
427         executables="$executables gui"
428         gui_objs="
429                 exec
430                 signal
431                 string
432                 stat
433                 ringbuffer
434                 fd
435                 gui
436                 gui_theme
437                 lsu
438                 time
439                 sched
440                 version
441         "
442         AC_SUBST(gui_objs, add_dot_o($gui_objs))
443 else
444         build_gui="no"
445         AC_MSG_WARN([no curses lib, cannot build para_gui])
446 fi
447 ######################################################################## filter
448 filter_objs="
449         filter_common
450         wav_filter
451         compress_filter
452         filter
453         string
454         stdin
455         stdout
456         sched
457         fd
458         amp_filter
459         fecdec_filter
460         fec
461         lsu
462         version
463         prebuffer_filter
464         time
465         bitstream
466         imdct
467         wma_common
468         wmadec_filter
469         buffer_tree
470         net
471         sync_filter
472 "
473 AS_IF([test $NEED_VORBIS_OBJECTS = yes],
474         [filter_objs="$filter_objs oggdec_filter"])
475 AS_IF([test $NEED_SPEEX_OBJECTS = yes],
476         [filter_objs="$filter_objs spxdec_filter spx_common"])
477 AS_IF([test $NEED_OPUS_OBJECTS = yes],
478         [filter_objs="$filter_objs opusdec_filter opus_common"])
479 AS_IF([test $NEED_FLAC_OBJECTS = yes],
480         [filter_objs="$filter_objs flacdec_filter"])
481 if test $HAVE_FAAD = yes; then
482         filter_objs="$filter_objs aacdec_filter"
483 fi
484 if test $HAVE_MAD = yes; then
485         filter_objs="$filter_objs mp3dec_filter"
486 fi
487 if test $HAVE_SAMPLERATE = yes; then
488         filter_objs="$filter_objs resample_filter check_wav"
489 fi
490 AC_SUBST(filter_objs, add_dot_o($filter_objs))
491 ########################################################################## recv
492 recv_objs="
493         http_recv
494         recv_common
495         recv
496         time
497         string
498         net
499         dccp_recv
500         fd
501         sched
502         stdout
503         udp_recv
504         buffer_tree
505         afh_recv
506         afh_common
507         wma_afh
508         wma_common
509         mp3_afh
510         version
511 "
512 AS_IF([test $NEED_OGG_OBJECTS = yes], [recv_objs="$recv_objs ogg_afh_common"])
513 AS_IF([test $NEED_VORBIS_OBJECTS = yes], [recv_objs="$recv_objs ogg_afh"])
514 AS_IF([test $NEED_SPEEX_OBJECTS = yes],
515         [recv_objs="$recv_objs spx_afh spx_common"])
516 AS_IF([test $NEED_OPUS_OBJECTS = yes],
517         [recv_objs="$recv_objs opus_afh opus_common"])
518 AS_IF([test $NEED_FLAC_OBJECTS = yes], [recv_objs="$recv_objs flac_afh"])
519
520 if test $HAVE_FAAD = yes; then
521         recv_objs="$recv_objs aac_afh mp4"
522 fi
523 AC_SUBST(recv_objs, add_dot_o($recv_objs))
524 ########################################################################### afh
525 audio_format_handlers="mp3 wma"
526 afh_objs="
527         afh
528         string
529         fd
530         mp3_afh
531         afh_common
532         time
533         wma_afh
534         wma_common
535         version
536 "
537 AS_IF([test $NEED_OGG_OBJECTS = yes], [afh_objs="$afh_objs ogg_afh_common"])
538 AS_IF([test $NEED_VORBIS_OBJECTS = yes], [
539         afh_objs="$afh_objs ogg_afh"
540         audio_format_handlers="$audio_format_handlers ogg"
541 ])
542 AS_IF([test $NEED_SPEEX_OBJECTS = yes], [
543         afh_objs="$afh_objs spx_afh spx_common"
544         audio_format_handlers="$audio_format_handlers spx"
545 ])
546 AS_IF([test $NEED_OPUS_OBJECTS = yes], [
547         afh_objs="$afh_objs opus_afh opus_common"
548         audio_format_handlers="$audio_format_handlers opus"
549 ])
550 AS_IF([test $NEED_FLAC_OBJECTS = yes], [
551         afh_objs="$afh_objs flac_afh"
552         audio_format_handlers="$audio_format_handlers flac"
553 ])
554 if test $HAVE_FAAD = yes; then
555         afh_objs="$afh_objs aac_afh mp4"
556         audio_format_handlers="$audio_format_handlers aac"
557 fi
558 AC_SUBST(afh_objs, add_dot_o($afh_objs))
559 ########################################################################## play
560 play_objs="
561         play
562         fd
563         sched
564         buffer_tree
565         time
566         string
567         net
568         afh_recv
569         afh_common
570         wma_afh
571         wma_common
572         mp3_afh
573         recv_common
574         udp_recv
575         http_recv
576         dccp_recv
577         filter_common
578         fec
579         bitstream
580         imdct
581         wav_filter
582         compress_filter
583         amp_filter
584         prebuffer_filter
585         fecdec_filter
586         wmadec_filter
587         write_common
588         file_write
589         version
590         sync_filter
591         lsu
592 "
593 AS_IF([test $NEED_OGG_OBJECTS = yes], [play_objs="$play_objs ogg_afh_common"])
594 AS_IF([test $NEED_VORBIS_OBJECTS = yes],
595         [play_objs="$play_objs oggdec_filter ogg_afh"])
596 AS_IF([test $NEED_SPEEX_OBJECTS = yes],
597         [play_objs="$play_objs spxdec_filter spx_afh spx_common"])
598 AS_IF([test $NEED_OPUS_OBJECTS = yes],
599         [play_objs="$play_objs opusdec_filter opus_afh opus_common"])
600 AS_IF([test $NEED_FLAC_OBJECTS = yes],
601         [play_objs="$play_objs flacdec_filter flac_afh"])
602 if test $HAVE_FAAD = yes; then
603         play_objs="$play_objs aac_afh aacdec_filter mp4"
604 fi
605 if test $HAVE_MAD = yes; then
606         play_objs="$play_objs mp3dec_filter"
607 fi
608 if test $HAVE_OSS = yes; then
609         play_objs="$play_objs oss_write"
610 fi
611 if test $HAVE_ALSA = yes; then
612         play_objs="$play_objs alsa_write"
613 fi
614 if test $NEED_AO_OBJECTS = yes; then
615         play_objs="$play_objs ao_write"
616 fi
617 if test $HAVE_READLINE = yes; then
618         play_objs="$play_objs interactive"
619 fi
620 if test $HAVE_SAMPLERATE = yes; then
621         play_objs="$play_objs resample_filter check_wav"
622 fi
623 AC_SUBST(play_objs, add_dot_o($play_objs))
624 ######################################################################### write
625 write_objs="
626         write
627         write_common
628         file_write
629         time
630         fd
631         string
632         sched
633         stdin
634         buffer_tree
635         check_wav
636         version
637 "
638
639 if test $NEED_AO_OBJECTS = yes; then
640         write_objs="$write_objs ao_write"
641 fi
642 if test $HAVE_OSS = yes; then
643         write_objs="$write_objs oss_write"
644 fi
645 if test $HAVE_ALSA = yes; then
646         write_objs="$write_objs alsa_write"
647 fi
648 AC_SUBST(write_objs, add_dot_o($write_objs))
649 ######################################################################## audioc
650 audioc_objs="
651         audioc
652         string
653         lsu
654         net
655         fd
656         time
657         version
658 "
659 if test $HAVE_READLINE = yes; then
660         audioc_objs="$audioc_objs
661                 buffer_tree
662                 interactive
663                 sched
664         "
665 fi
666 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
667
668 AC_DEFINE_UNQUOTED(AUDIO_FORMAT_HANDLERS, "$audio_format_handlers",
669         [formats supported by para_server and para_afh])
670 AC_SUBST(executables)
671
672 AC_OUTPUT
673 AC_MSG_NOTICE([
674 paraslash configuration:
675 ~~~~~~~~~~~~~~~~~~~~~~~~
676 crypto lib: ${CRYPTOLIB:-[none]}
677 readline (interactive CLIs): $HAVE_READLINE
678 id3 version 2 support: $HAVE_ID3TAG
679 faad: $HAVE_FAAD
680 audio format handlers: $audio_format_handlers
681
682 exe: $executables
683 para_server: $build_server
684 para_gui: $build_gui
685 para_mixer: $build_mixer
686 para_client: $build_client
687 para_audiod: $build_audiod
688 ])