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