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