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