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