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