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