make audiod use command_util.sh
[paraslash.git] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.60)
5
6
7 AC_INIT(paraslash, [git], maan@systemlinux.org)
8 AC_CONFIG_HEADER([config.h])
9
10 ########################################################################### generic
11 AC_PROG_CC
12 AC_PROG_CPP
13 AC_PROG_INSTALL
14
15 AC_HEADER_DIRENT
16 AC_HEADER_STDC
17 AC_HEADER_SYS_WAIT
18 AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h \
19 string.h sys/socket.h sys/time.h sys/timeb.h sys/un.h sys/ipc.h unistd.h utime.h], \
20 [], [AC_MSG_ERROR([$ac_header not found])])
21
22 AC_CHECK_HEADER(linux/soundcard.h, [extras="$extras para_fade"],
23 [AC_MSG_WARN([linux/soundcard.h not found, cannot build para_fade])])
24
25 # Checks for typedefs, structures, and compiler characteristics.
26 AC_C_CONST
27 AC_TYPE_OFF_T
28 AC_TYPE_PID_T
29 AC_TYPE_SIZE_T
30 AC_HEADER_TIME
31 AC_STRUCT_TM
32
33 # Checks for library functions.
34 AC_FUNC_FORK
35 AC_PROG_GCC_TRADITIONAL
36 AC_FUNC_MALLOC
37 AC_FUNC_MEMCMP
38 AC_FUNC_MKTIME
39 AC_FUNC_MMAP
40 AC_FUNC_REALLOC
41 AC_FUNC_SELECT_ARGTYPES
42 AC_TYPE_SIGNAL
43 AC_FUNC_STAT
44 AC_FUNC_STRFTIME
45 AC_FUNC_VPRINTF
46 AC_CHECK_FUNCS([atexit dup2 gethostbyname inet_ntoa memchr memmove memset \
47 regcomp select socket strchr strdup strerror strstr strtol uname], [],
48 [AC_MSG_ERROR([function not found, cannot live without it])])
49 ########################################################################### curses
50 AC_CHECK_LIB([ncurses], [initscr], [],
51 [AC_MSG_ERROR([libncurses not found])])
52
53 AC_CHECK_LIB([menu], [new_menu], [extras="$extras para_dbadm"],
54 [AC_MSG_WARN([libmenu not found, cannot build para_dbadm])])
55
56
57 recv_cmdline_objs="recv.cmdline http_recv.cmdline dccp_recv.cmdline"
58 recv_errlist_objs="http_recv recv_common recv time string net dccp_recv
59 dccp fd sched stdout"
60 recv_ldflags=""
61
62 receivers=" http dccp"
63 senders=" http dccp"
64 selectors=" random playlist"
65
66 filter_cmdline_objs="filter.cmdline compress_filter.cmdline"
67 filter_errlist_objs="filter_chain wav compress filter string stdin stdout sched fd"
68 filter_ldflags=""
69 filters=" compress wav"
70
71 audioc_cmdline_objs="audioc.cmdline"
72 audioc_errlist_objs="audioc string net fd"
73
74 audiod_cmdline_objs="audiod.cmdline grab_client.cmdline compress_filter.cmdline
75 http_recv.cmdline dccp_recv.cmdline file_write.cmdline client.cmdline
76 audiod_command_list"
77 audiod_errlist_objs="audiod signal string daemon stat net
78 time grab_client filter_chain wav compress http_recv dccp dccp_recv
79 recv_common fd sched write_common file_write audiod_command crypt
80 client_common"
81 audiod_ldflags=""
82 audiod_audio_formats=""
83
84 server_cmdline_objs="server.cmdline server_command_list random_selector_command_list
85 playlist_selector_command_list"
86 server_errlist_objs="server mp3_afh vss command net string signal random_selector
87 time daemon stat crypt http_send db close_on_fork playlist_selector
88 ipc dccp dccp_send fd user_list"
89 server_ldflags=""
90 server_audio_formats=" mp3"
91
92 write_cmdline_objs="write.cmdline file_write.cmdline"
93 write_errlist_objs="write write_common file_write time fd string sched stdin"
94 write_ldflags=""
95 writers=" file"
96
97 client_cmdline_objs="client.cmdline"
98 client_errlist_objs="client net string crypt fd sched stdin stdout client_common"
99 client_ldflags=""
100
101 ########################################################################### ssl
102 dnl @synopsis CHECK_SSL
103 dnl
104 dnl based on the follwing macro from the autoconf archive
105 dnl
106 dnl @category InstalledPackages
107 dnl @author Mark Ethan Trostler <trostler@juniper.net>
108 dnl @version 2003-01-28
109 dnl @license AllPermissive
110
111 AC_DEFUN([CHECK_SSL],
112 [
113 for ssldir in $1 /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do
114 AC_MSG_CHECKING(for openssl in $ssldir)
115 if test -f "$ssldir/include/openssl/ssl.h"; then
116 found_ssl="yes"
117 AC_MSG_RESULT(yes)
118 SSL_CFLAGS="-I$ssldir/include/openssl"
119 SSL_CPPFLAGS="-I$ssldir/include/openssl"
120 break
121 fi
122 if test -f "$ssldir/include/ssl.h"; then
123 found_ssl="yes";
124 AC_MSG_RESULT(yes)
125 SSL_CFLAGS="-I$ssldir/include/";
126 SSL_CPPFLAGS="-I$ssldir/include/";
127 break
128 fi
129 AC_MSG_RESULT(no)
130 done
131 if test x_$found_ssl != x_yes; then
132 AC_MSG_ERROR(Cannot find ssl libraries)
133 else
134 SSL_LIBS="-lssl -lcrypto";
135 SSL_LDFLAGS="-L$ssldir/lib";
136 fi
137 AC_SUBST(SSL_CPPFLAGS)
138 AC_SUBST(SSL_CFLAGS)
139 AC_SUBST(SSL_LIBS)
140 AC_SUBST(SSL_LDFLAGS)
141 ])dnl
142
143 AC_ARG_ENABLE(ssldir, [AS_HELP_STRING(--enable-ssldir=path,
144 [Search for openssl also in path.])])
145 if test "$enable_ssldir" = "yes"; then enable_ssldir=""; fi
146 CHECK_SSL($enable_ssldir)
147 server_ldflags="$srver_ldflags $SSL_LDFLAGS $SSL_LIBS"
148 client_ldflags="$client_ldflags $SSL_LDFLAGS $SSL_LIBS"
149 audiod_ldflags="$audiod_ldflags $SSL_LDFLAGS $SSL_LIBS"
150
151 ########################################################################### ucred
152 AC_MSG_CHECKING(for struct ucred)
153 AC_TRY_LINK([
154 #include <sys/types.h>
155 #include <sys/socket.h>
156 ],[
157 struct ucred sucred; sucred.pid=0;
158 ],[have_ucred=yes],[have_ucred=no])
159 AC_MSG_RESULT($have_ucred)
160 if test ${have_ucred} = yes; then
161 AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
162 fi
163
164 ########################################################################### osx
165
166 AC_MSG_CHECKING(for CoreAudio (MacOs))
167 AC_TRY_LINK([
168 #include <CoreAudio/CoreAudio.h>
169 ],[
170 AudioDeviceID id;
171 ],[have_core_audio=yes],[have_core_audio=no])
172 AC_MSG_RESULT($have_core_audio)
173 if test ${have_core_audio} = yes; then
174 f1="-framework CoreAudio"
175 f2="-framework AudioToolbox"
176 f3="-framework AudioUnit"
177 f4="-framework CoreServices"
178 f="$f1 $f2 $f3 $f4"
179 audiod_errlist_objs="$audiod_errlist_objs osx_write"
180 audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
181 audiod_ldflags="$audiod_ldflags $f"
182
183 write_errlist_objs="$write_errlist_objs osx_write"
184 write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
185 write_ldflags="$write_ldflags $f"
186 writers="$writers osx"
187 AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
188 fi
189 ########################################################################### gtk2
190 build_para_krell="yes"
191 OLD_CPPFLAGS="$CPPFLAGS"
192 OLD_LD_FLAGS="$LDFLAGS"
193 OLD_LIBS="$LIBS"
194 pkg_modules="gtk+-2.0 >= 2.0.0"
195 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.0.4], [], [build_para_krell="no"])
196 PKG_CHECK_MODULES(GTK, [$pkg_modules], [], [build_para_krell="no"])
197 CPPFLAGS="$GTK_CFLAGS $GLIB_CFLAGS"
198 LDFLAGS="$LDFLAGS $GTK_LIBS"
199 AC_CHECK_HEADER(gkrellm2/gkrellm.h, [], [build_para_krell="no"])
200 if test "$build_para_krell" = "yes"; then
201 AC_SUBST(GTK_CFLAGS)
202 AC_SUBST(GTK_LIBS)
203 extras="$extras para_krell.so"
204 else
205 AC_MSG_WARN([can not build para_krell])
206 fi
207 CPPFLAGS="$OLD_CPPFLAGS"
208 LDFLAGS="$OLD_LDFLAGS"
209 LIBS="$OLD_LIBS"
210 ########################################################################### sdl
211 # FIXME
212 AC_CHECK_LIB([SDL_image], [SDL_Init], [extras="$extras para_sdl_gui"], [
213 AC_MSG_WARN([libSDL_image not found, cannot build para_sdl_gui])
214 ])
215 AC_CHECK_HEADER(SDL/SDL.h, [],
216 [AC_MSG_WARN([SDL/SDL.h not found])])
217
218 ########################################################################### mysql
219 have_mysql="yes"
220 OLD_CPPFLAGS="$CPPFLAGS"
221 OLD_LD_FLAGS="$LDFLAGS"
222 OLD_LIBS="$LIBS"
223 AC_ARG_WITH(mysql_headers, [AC_HELP_STRING(--with-mysql-headers=dir,
224 [look for mysql.h also in dir])])
225 if test -n "$with_mysql_headers"; then
226 mysql_cppflags="-I$with_mysql_headers"
227 CPPFLAGS="$CPPFLAGS $mysql_cppflags"
228 fi
229 AC_ARG_WITH(mysql_libs, [AC_HELP_STRING(--with-mysql-libs=dir,
230 [look for libmysqlclient also in dir])])
231 if test -n "$with_mysql_libs"; then
232 mysql_libs="-L$with_mysql_libs"
233 LDFLAGS="$LDFLAGS $mysql_libs"
234 fi
235 AC_CHECK_HEADER(mysql/mysql.h, [], [
236 have_mysql="no"
237 ])
238 AC_CHECK_LIB([mysqlclient], [mysql_init], [], [
239 have_mysql="no"
240 ])
241 if test "$have_mysql" = "yes"; then
242 selectors="$selectors mysql"
243 server_ldflags="$server_ldflags $mysql_libs -lmysqlclient"
244 server_errlist_objs="$server_errlist_objs mysql_selector"
245 server_cmdline_objs="$server_cmdline_objs mysql_selector_command_list"
246 AC_SUBST(mysql_cppflags)
247 AC_SUBST(mysql_libs)
248 AC_DEFINE(HAVE_MYSQL, 1, [define to 1 to turn on mysql support])
249 else
250 AC_MSG_WARN([cannot build mysql-based audio file selector])
251 fi
252 CPPFLAGS="$OLD_CPPFLAGS"
253 LDFLAGS="$OLD_LDFLAGS"
254 LIBS="$OLD_LIBS"
255 ########################################################################### ogg
256 have_ogg="yes"
257 OLD_CPPFLAGS="$CPPFLAGS"
258 OLD_LD_FLAGS="$LDFLAGS"
259 OLD_LIBS="$LIBS"
260 AC_ARG_WITH(oggvorbis_headers, [AC_HELP_STRING(--with-oggvorbis-headers=dir,
261 [look for vorbis/codec.h also in dir])])
262 if test -n "$with_oggvorbis_headers"; then
263 oggvorbis_cppflags="-I$with_oggvorbis_headers"
264 CPPFLAGS="$CPPFLAGS $oggvorbis_cppflags"
265 fi
266 AC_ARG_WITH(oggvorbis_libs, [AC_HELP_STRING(--with-oggvorbis-libs=dir,
267 [look for oggvorbis libs also in dir])])
268 if test -n "$with_oggvorbis_libs"; then
269 oggvorbis_libs="-L$with_oggvorbis_libs"
270 LDFLAGS="$LDFLAGS $oggvorbis_libs"
271 fi
272
273 AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
274 AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_ogg="no" ])
275 AC_CHECK_HEADERS([ogg/ogg.h vorbis/codec.h], [], [ have_ogg="no" ])
276 if test "$have_ogg" = "yes"; then
277 AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg vorbis support)
278 filters="$filters oggdec"
279 server_ldflags="$server_ldflags $oggvorbis_libs -logg -lvorbis -lvorbisfile"
280 filter_ldflags="$filter_ldflags $oggvorbis_libs -lvorbis -lvorbisfile"
281 audiod_ldflags="$audiod_ldflags $oggvorbis_libs -lvorbis -lvorbisfile"
282
283 filter_cmdline_objs="$filter_cmdline_objs oggdec_filter.cmdline"
284 audiod_cmdline_objs="$audiod_cmdline_objs oggdec_filter.cmdline"
285
286 server_errlist_objs="$server_errlist_objs ogg_afh"
287 filter_errlist_objs="$filter_errlist_objs oggdec"
288 audiod_errlist_objs="$audiod_errlist_objs oggdec"
289
290 audiod_audio_formats="ogg"
291 server_audio_formats="$server_audio_formats ogg"
292 filter_filters="$filter_filters oggdec"
293 AC_SUBST(oggvorbis_cppflags)
294 AC_SUBST(oggvorbis_libs)
295 else
296 AC_MSG_WARN([no ogg vorbis support in para_server/para_filter])
297 fi
298 CPPFLAGS="$OLD_CPPFLAGS"
299 LDFLAGS="$OLD_LDFLAGS"
300 LIBS="$OLD_LIBS"
301 ########################################################################### faad
302 have_faad=yes
303 OLD_CPPFLAGS="$CPPFLAGS"
304 OLD_LD_FLAGS="$LDFLAGS"
305 OLD_LIBS="$LIBS"
306 AC_ARG_WITH(faad_headers, [AC_HELP_STRING(--with-faad-headers=dir,
307 [look for neaacdec.h also in dir])])
308 if test -n "$with_faad_headers"; then
309 faad_cppflags="-I$with_faad_headers"
310 CPPFLAGS="$CPPFLAGS $faad_cppflags"
311 fi
312 AC_ARG_WITH(faad_libs, [AC_HELP_STRING(--with-faad-libs=dir,
313 [look for libfaad also in dir])])
314 if test -n "$with_faad_libs"; then
315 faad_libs="-L$with_faad_libs"
316 LDFLAGS="$LDFLAGS $faad_libs"
317 fi
318 AC_CHECK_HEADER(neaacdec.h, [], have_faad=no)
319 AC_CHECK_LIB([faad], [NeAACDecOpen], [], have_faad=no)
320 if test "$have_faad" = "yes"; then
321 AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
322 filter_errlist_objs="$filter_errlist_objs aacdec aac_common"
323 filter_filters="$filter_filters aacdec"
324 audiod_errlist_objs="$audiod_errlist_objs aacdec aac_common"
325 server_errlist_objs="$server_errlist_objs aac_afh aac_common"
326 server_ldflags="$server_ldflags $faad_libs -lfaad"
327 filter_ldflags="$filter_ldflags $faad_libs -lfaad"
328 audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
329 audiod_audio_formats="$audiod_audio_formats aac"
330 server_audio_formats="$server_audio_formats aac"
331 filters="$filters aacdec"
332 AC_SUBST(faad_cppflags)
333 AC_SUBST(faad_libs)
334 else
335 AC_MSG_WARN([no aac support in para_audiod/para_filter])
336 fi
337 CPPFLAGS="$OLD_CPPFLAGS"
338 LDFLAGS="$OLD_LDFLAGS"
339 LIBS="$OLD_LIBS"
340 ########################################################################### mad
341 have_mad="yes"
342 OLD_CPPFLAGS="$CPPFLAGS"
343 OLD_LD_FLAGS="$LDFLAGS"
344 OLD_LIBS="$LIBS"
345
346 AC_ARG_WITH(mad_headers, [AC_HELP_STRING(--with-mad-headers=dir,
347 [look for mad.h also in dir])])
348 if test -n "$with_mad_headers"; then
349 mad_cppflags="-I$with_mad_headers"
350 CPPFLAGS="$CPPFLAGS $mad_cppflags"
351 fi
352 AC_ARG_WITH(mad_libs, [AC_HELP_STRING(--with-mad-libs=dir,
353 [look for libmad also in dir])])
354 if test -n "$with_mad_libs"; then
355 mad_libs="-L$with_mad_libs"
356 LDFLAGS="$LDFLAGS $mad_libs"
357 fi
358 AC_CHECK_HEADERS([mad.h], [], [
359 have_mad="no"
360 ])
361 AC_CHECK_LIB([mad], [mad_stream_init], [], [
362 have_mad="no"
363 ])
364 if test "$have_mad" = "yes"; then
365 AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter)
366 filter_errlist_objs="$filter_errlist_objs mp3dec"
367 audiod_errlist_objs="$audiod_errlist_objs mp3dec"
368 filter_ldflags="$filter_ldflags $mad_libs -lmad"
369 audiod_ldflags="$audiod_ldflags $mad_libs -lmad"
370 audiod_audio_formats="$audiod_audio_formats mp3"
371 filters="$filters mp3dec"
372 AC_SUBST(mad_cppflags)
373 AC_SUBST(mad_libs)
374 else
375 AC_MSG_WARN([no mp3dec support in para_audiod/para_filter])
376 fi
377 if test -n "$audiod_audio_formats"; then
378 extras="$extras para_audiod"
379 else
380 AC_MSG_WARN([can not build para_audiod (no supported audio formats)])
381 fi
382 CPPFLAGS="$OLD_CPPFLAGS"
383 LDFLAGS="$OLD_LDFLAGS"
384 LIBS="$OLD_LIBS"
385 ########################################################################### alsa
386 have_alsa="yes"
387 OLD_CPPFLAGS="$CPPFLAGS"
388 OLD_LD_FLAGS="$LDFLAGS"
389 OLD_LIBS="$LIBS"
390 msg="=> no alsa support for para_audiod/para_write"
391 AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
392 AC_MSG_WARN([no alsa/asoundlib $msg])
393 have_alsa="no"
394 ])
395 AC_CHECK_LIB([asound], [snd_pcm_open], [], [
396 AC_MSG_WARN([no libasound $msg])
397 have_alsa="no"
398 ])
399 if test "$have_alsa" = "yes"; then
400 audiod_errlist_objs="$audiod_errlist_objs alsa_write"
401 audiod_cmdline_objs="$audiod_cmdline_objs alsa_write.cmdline"
402 audiod_ldflags="$audiod_ldflags -lasound"
403
404 write_errlist_objs="$write_errlist_objs alsa_write"
405 write_cmdline_objs="$write_cmdline_objs alsa_write.cmdline"
406 write_ldflags="$write_ldflags -lasound"
407 writers="$writers alsa"
408 fi
409 CPPFLAGS="$OLD_CPPFLAGS"
410 LDFLAGS="$OLD_LDFLAGS"
411 LIBS="$OLD_LIBS"
412 ########################################################################### ortp
413 have_ortp="yes"
414 OLD_CPPFLAGS="$CPPFLAGS"
415 OLD_LD_FLAGS="$LDFLAGS"
416 OLD_LIBS="$LIBS"
417 AC_ARG_WITH(ortp_headers, [AC_HELP_STRING(--with-ortp-headers=dir,
418 [look for ortp/ortp.h also in dir])])
419 if test -n "$with_ortp_headers"; then
420 ortp_cppflags="-I$with_ortp_headers"
421 CPPFLAGS="$CPPFLAGS $ortp_cppflags"
422 fi
423 AC_ARG_WITH(ortp_libs, [AC_HELP_STRING(--with-ortp-libs=dir,
424 [look for libortp also in dir])])
425 if test -n "$with_ortp_libs"; then
426 ortp_libs="-L$with_ortp_libs"
427 LDFLAGS="$LDFLAGS $ortp_libs"
428 fi
429 AC_CHECK_HEADERS([ortp/ortp.h], [], [have_ortp="no"])
430 AC_CHECK_LIB([ortp], [ortp_init], [], [have_ortp="no"])
431 if test "$have_ortp" = "yes"; then
432 recv_cmdline_objs="$recv_cmdline_objs ortp_recv.cmdline"
433 recv_errlist_objs="$recv_errlist_objs ortp_recv"
434
435 audiod_cmdline_objs="$audiod_cmdline_objs ortp_recv.cmdline"
436 audiod_errlist_objs="$audiod_errlist_objs ortp_recv"
437
438 server_errlist_objs="$server_errlist_objs ortp_send"
439
440 recv_ldflags="$recv_ldflags $ortp_libs -lortp"
441 server_ldflags="$server_ldflags $ortp_libs -lortp"
442 audiod_ldflags="$audiod_ldflags $ortp_libs -lortp"
443
444 receivers="$receivers ortp"
445 senders="$senders ortp"
446 AC_DEFINE(HAVE_ORTP, 1, [define to 1 to turn on ortp support])
447 AC_SUBST(ortp_cppflags)
448 AC_SUBST(ortp_libs)
449 else
450 AC_MSG_NOTICE([deactivating ortp sender/receiver])
451 fi
452 CPPFLAGS="$OLD_CPPFLAGS"
453 LDFLAGS="$OLD_LDFLAGS"
454 LIBS="$OLD_LIBS"
455 ########################################################################### zmw
456 build_slider="yes"
457 OLD_CPPFLAGS="$CPPFLAGS"
458 OLD_LD_FLAGS="$LDFLAGS"
459 OLD_LIBS="$LIBS"
460 PKG_CHECK_MODULES(GTK, [$pkg_modules], [], [build_para_slider="no"])
461 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.0.4], [], [build_slider="no"])
462 CPPFLAGS="$GTK_CFLAGS $GLIB_CFLAGS"
463 LDFLAGS="$LDFLAGS $GTK_LIBS"
464 AC_CHECK_HEADERS([zmw/zmw.h], [], [build_slider="no"])
465 AC_CHECK_LIB([zmw], [zmw_init], [], [build_slider="no"])
466 if test "$build_slider" = "no"; then
467 AC_MSG_WARN([will not build para_slider])
468 else
469 extras="$extras para_slider"
470 fi
471 CPPFLAGS="$OLD_CPPFLAGS"
472 LDFLAGS="$OLD_LDFLAGS"
473 LIBS="$OLD_LIBS"
474
475
476
477
478
479 AC_SUBST(extra_binaries, [$extras])
480 AC_SUBST(extra_filter_objs, [$extra_filter_objs])
481 AC_SUBST(extra_filter_libs, [$extra_filter_libs])
482 AC_SUBST(install_sh, [$INSTALL])
483 AC_CONFIG_FILES([Makefile])
484
485
486
487 AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
488 AC_DEFUN([objlist_to_errlist],[$(for i in $@; do printf "DEFINE_ERRLIST($(echo $i| tr 'a-z' 'A-Z'));"; done) [const char **para_errlist[[]]] = {$(for i in $@; do printf "PARA_ERRLIST($(echo $i | tr 'a-z' 'A-Z')), "; done) }])
489
490 recv_objs="$recv_cmdline_objs $recv_errlist_objs"
491 filter_objs="$filter_cmdline_objs $filter_errlist_objs"
492 audiod_objs="$audiod_cmdline_objs $audiod_errlist_objs"
493 server_objs="$server_cmdline_objs $server_errlist_objs"
494 write_objs="$write_cmdline_objs $write_errlist_objs"
495 client_objs="$client_cmdline_objs $client_errlist_objs"
496 audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
497
498 AC_SUBST(recv_objs, add_dot_o($recv_objs))
499 AC_SUBST(recv_ldflags, $recv_ldflags)
500 AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
501 errors used by para_recv)
502
503 AC_SUBST(filter_objs, add_dot_o($filter_objs))
504 AC_SUBST(filter_ldflags, $filter_ldflags)
505 AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
506 objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
507
508 AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
509 AC_SUBST(audiod_ldflags, $audiod_ldflags)
510 AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
511 errors used by para_audiod)
512
513 AC_SUBST(server_objs, add_dot_o($server_objs))
514 AC_SUBST(server_ldflags, $server_ldflags)
515 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
516 objlist_to_errlist($server_errlist_objs), errors used by para_server)
517
518 AC_SUBST(write_objs, add_dot_o($write_objs))
519 AC_SUBST(write_ldflags, $write_ldflags)
520 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
521 objlist_to_errlist($write_errlist_objs), errors used by para_write)
522
523 AC_SUBST(client_objs, add_dot_o($client_objs))
524 AC_SUBST(client_ldflags, $client_ldflags)
525 AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
526 objlist_to_errlist($client_errlist_objs), errors used by para_client)
527
528 AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
529 AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
530 objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
531
532 enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
533 AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
534 enum of supported writers)
535 names="$(for i in $writers; do printf \"$i\",' ' ; done)"
536 AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names)
537 inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)"
538 AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers)
539 array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)"
540 AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers)
541 enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
542 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
543 enum of audio formats supported by audiod)
544 names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)"
545 AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array of audio formats supported by audiod)
546
547 gui_cmdline_objs="gui.cmdline"
548 gui_errlist_objs="exec close_on_fork signal string stat ringbuffer fd"
549 gui_other_objs="gui gui_common gui_theme"
550 gui_objs="$gui_cmdline_objs $gui_errlist_objs $gui_other_objs"
551 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
552 objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
553 AC_SUBST(gui_objs, add_dot_o($gui_objs))
554
555 AC_OUTPUT
556 AC_MSG_NOTICE([creating Makefile.deps])
557 gcc -MM -MG $mysql_cppflags $faad_cppflags $mad_cppflags $ortp_cppflags $oggvorbis_cppflags *.c > Makefile.deps
558 AC_MSG_NOTICE([
559 paraslash configuration:
560 ~~~~~~~~~~~~~~~~~~~~~~~~
561 unix socket credentials: $have_ucred
562 audio file selectors supported by para_server: $selectors
563 audio formats supported by para_server: $server_audio_formats
564 senders supported by para_server/para_send: $senders
565 receivers supported by para_audiod/para_recv: $receivers
566 filters supported by para_audiod/para_filter: $filters
567 writers supported by para_audiod/para_write: $writers
568 optional executables: $extras
569 ])