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