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