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