1 dnl sxe-mm.m4 -- Multimedia goodness
6 AC_DEFUN([SXE_MM_CHECK_XPM], [
7 ## arg #1: action on success
8 ## arg #2: action on failure
9 pushdef([MM_SUCC], [$1])
10 pushdef([MM_FAIL], [$2])
12 AC_MSG_CHECKING([for xpm support])
16 if test "$window_system" = "none"; then
21 SXE_LANG_WERROR([off])
22 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
23 LDFLAGS="$LDFLAGS $X_PRE_LIBS $X_LIBS $libs_x"
24 LIBS="$LIBS -lXpm -lX11"
26 SXE_CHECK_HEADERS([X11/xpm.h], [:], [MM_FAIL])
28 AC_MSG_CHECKING([for Xpm (more recent than 3.4f)])
29 AC_RUN_IFELSE([AC_LANG_SOURCE([[
32 int main(int c, char **v)
35 XpmIncludeVersion != XpmLibraryVersion() ? 1 :
36 XpmIncludeVersion < 30406 ? 2 : 0 ;
37 }]])], [./conftest dummy_arg; xpm_status=$?;
38 if test "$xpm_status" = "0"; then
43 if test "$xpm_status" = "1"; then
45 Xpm library version and header file version don't match!
46 I have disabled xpm on your behalf.])
47 elif test "$xpm_status" = "2"; then
49 Xpm library version is too old!
50 I have disabled xpm on your behalf.])
53 Internal xpm detection logic error!])
62 ])dnl SXE_MM_CHECK_XPM
64 AC_DEFUN([SXE_MM_CHECK_XFACE], [
65 ## arg #1: action on success
66 ## arg #2: action on failure
67 pushdef([MM_SUCC], [$1])
68 pushdef([MM_FAIL], [$2])
70 AC_MSG_CHECKING([for xface support])
74 SXE_LANG_WERROR([off])
75 dnl SXE_PREPEND_UNDUP([-I$x_includes], [c_switch_site])
76 dnl SXE_PREPEND_UNDUP([-L$x_libraries], [ld_switch_site])
77 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
78 LDFLAGS="$LDFLAGS $X_LIBS"
81 if test "$window_system" = "none"; then
85 SXE_CHECK_HEADERS([compface.h], [:], [MM_FAIL])
86 AC_CHECK_LIB([compface], [UnGenFace], [:], [MM_FAIL])
89 ])dnl SXE_MM_CHECK_XFACE
91 AC_DEFUN([SXE_MM_CHECK_GIF], [
92 ## arg #1: action on success
93 ## arg #2: action on failure
94 pushdef([MM_SUCC], [$1])
95 pushdef([MM_FAIL], [$2])
97 AC_MSG_CHECKING([for gif support])
103 if test "$window_system" = "none"; then
108 ])dnl SXE_MM_CHECK_GIF
110 AC_DEFUN([SXE_MM_CHECK_JPEG], [
111 ## arg #1: action on success
112 ## arg #2: action on failure
113 pushdef([MM_SUCC], [$1])
114 pushdef([MM_FAIL], [$2])
116 AC_MSG_CHECKING([for jpeg support])
120 SXE_LANG_WERROR([off])
121 dnl SXE_PREPEND_UNDUP([-I$x_includes], [c_switch_site])
122 dnl SXE_PREPEND_UNDUP([-L$x_libraries], [ld_switch_site])
123 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
124 LDFLAGS="$LDFLAGS $X_LIBS"
127 if test "$window_system" = "none"; then
131 SXE_CHECK_HEADERS([jpeglib.h], [:], [MM_FAIL])
132 AC_CHECK_LIB([jpeg], [jpeg_destroy_decompress], [:], [MM_FAIL], [$INFLATE_LIB])
135 ])dnl SXE_MM_CHECK_JPEG
138 AC_DEFUN([_SXE_MM_CHECK_PNG_HEADERS], [dnl
139 ## defines sxe_cv_feat_png_headers
140 ## also defines and substs PNG_CPPFLAGS
143 SXE_LANG_WERROR([off])
144 PNG_CPPFLAGS="$CPPFLAGS $X_CFLAGS"
145 CPPFLAGS="$PNG_CPPFLAGS"
146 SXE_CHECK_HEADERS([png.h])
149 if test "${ac_cv_header_png_h}" = "yes"; then
150 sxe_cv_feat_png_headers="yes"
152 sxe_cv_feat_png_headers="no"
155 AC_SUBST([PNG_CPPFLAGS])
156 ])dnl _SXE_MM_CHECK_PNG_HEADERS
158 AC_DEFUN([_SXE_MM_CHECK_PNG_LIBS], [dnl
159 ## defines sxe_cv_feat_png_libs
160 ## also defines and substs PNG_LIBS and PNG_LDFLAGS
163 SXE_LANG_WERROR([off])
164 PNG_LDFLAGS="$LDFLAGS $X_LIBS"
165 LDFLAGS="$PNG_LDFLAGS"
166 AC_CHECK_LIB([png], [png_read_image], [], [], [$INFLATE_LIB])
169 if test "${ac_cv_lib_png_png_read_image}" = "yes"; then
170 sxe_cv_feat_png_libs="yes"
171 PNG_LIBS="$INFLATE_LIB -lpng"
173 sxe_cv_feat_png_libs="no"
178 AC_SUBST([PNG_LDFLAGS])
179 ])dnl _SXE_MM_CHECK_PNG_LIBS
181 AC_DEFUN([_SXE_MM_CHECK_PNG_VERSION], [dnl
182 ## defines sxe_cv_tmp_png_status to yes if version info seems okay
183 AC_REQUIRE([_SXE_MM_CHECK_PNG_HEADERS])
184 AC_REQUIRE([_SXE_MM_CHECK_PNG_LIBS])
186 SXE_MSG_CHECKING([for workable png version information])
189 CPPFLAGS="$PNG_CPPFLAGS"
190 LDFLAGS="$PNG_LDFLAGS"
192 AC_RUN_IFELSE([AC_LANG_SOURCE([[
193 #if defined HAVE_PNG_H
195 #endif /* HAVE_PNG_H */
197 int main(int c, char **v)
202 if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) {
205 return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;
206 }]])], [./conftest dummy_arg; png_status=$?;
207 if test "$png_status" = "0"; then
208 sxe_cv_tmp_png_status="yes"
210 elif test "$png_status" = "1"; then
211 sxe_cv_tmp_png_status="yes"
213 PNG library version and header file don't match!
214 This is odd but I think I give it a whirl.
215 If things work out badly I suggest to turn off your computer forever.])
217 elif test "$png_status" = "2"; then
218 sxe_cv_tmp_png_status="no"
220 PNG library version too old (pre 1.0.2)!
221 I have disabled PNG support on your behalf.])
224 sxe_cv_tmp_png_status="no"
226 Whatever happened just now, I'm completely fucked.])
227 fi], [sxe_cv_tmp_png_status="no"], [sxe_cv_tmp_png_status="no"])
228 SXE_MSG_RESULT([${sxe_cv_tmp_png_status}])
230 ])dnl _SXE_MM_CHECK_PNG_VERSION
232 AC_DEFUN([SXE_MM_CHECK_PNG], [
233 ## SXE_MM_CHECK_PNG(<action-if-found>, <action-if-not-found>)
234 ## defines HAVE_PNG in case png is usable
235 pushdef([MM_SUCC], [$1])
236 pushdef([MM_FAIL], [$2])
238 SXE_MSG_CHECKING([for PNG support])
241 _SXE_MM_CHECK_PNG_HEADERS
242 _SXE_MM_CHECK_PNG_LIBS
243 _SXE_MM_CHECK_PNG_VERSION
246 ## we want to see a header and png_read_image really
247 if test "${sxe_cv_feat_png_headers}" = "yes" -a \
248 "${sxe_cv_feat_png_libs}" = "yes" -a \
249 "${sxe_cv_tmp_png_status}" = "yes"; then
250 sxe_cv_feat_png="yes"
251 AC_DEFINE([HAVE_PNG], [1], [Define to 1 if png is usable.])
257 ])dnl SXE_MM_CHECK_PNG
259 AC_DEFUN([SXE_MM_CHECK_TIFF], [
260 ## arg #1: action on success
261 ## arg #2: action on failure
262 pushdef([MM_SUCC], [$1])
263 pushdef([MM_FAIL], [$2])
265 AC_MSG_CHECKING([for TIFF support])
269 SXE_LANG_WERROR([off])
270 dnl SXE_PREPEND_UNDUP([-I$x_includes], [c_switch_site])
271 dnl SXE_PREPEND_UNDUP([-L$x_libraries], [ld_switch_site])
272 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
273 LDFLAGS="$LDFLAGS $X_LIBS"
276 if test "$window_system" = "none"; then
280 SXE_CHECK_HEADERS([tiffio.h], [:], [MM_FAIL])
281 AC_CHECK_LIB([tiff], [TIFFClientOpen], [:], [MM_FAIL], [$INFLATE_LIB])
284 ])dnl SXE_MM_CHECK_TIFF
286 AC_DEFUN([SXE_MM_SEARCH_INFLATE], [
287 dnl Too many stupid linkers can't detect cascaded lib dependencies
288 dnl until runtime. So we always search for libz compression support.
289 AC_SEARCH_LIBS([inflate], [c z gz], [
290 if test "$ac_cv_lib_c_inflate" = "yes"; then
292 elif test "$ac_cv_lib_z_inflate" = "yes"; then
294 elif test "$ac_cv_lib_gz_inflate" = "yes"; then
297 if test -n "$INFLATE_LIB"; then
298 SXE_PREPEND([$INFLATE_LIB], [MM_LIBS])
300 ])dnl SXE_MM_SEARCH_INFLATE
302 AC_DEFUN([SXE_MM_CHECK_SNDFILE], [
303 ## assumes $PKG_CONFIG is defined
304 ## arg #1: action on success
305 ## arg #2: action on failure
307 _SXE_MM_CHECK_pkgconfig_based([sndfile], [sndfile], [1.0.12], [dnl
308 sf_open sf_close sf_readf_short sf_readf_int dnl
309 sf_readf_float sf_seek sf_open_virtual],
310 [sndfile.h], [$1], [$2])
311 ])dnl SXE_MM_CHECK_SNDFILE
313 AC_DEFUN([SXE_MM_CHECK_FFMPEG], [
314 ## assumes $PKG_CONFIG is defined
315 ## arg #1: action on success
316 ## arg #2: action on failure
317 pushdef([ACTION_IF_FOUND], [$1])
318 pushdef([ACTION_IF_NOT_FOUND], [$2])
321 ## we can't use that one since we have to check multiple headers
322 dnl _SXE_MM_CHECK_pkgconfig_based([ffmpeg], [libavformat], [49.0.0], [dnl
323 dnl av_open_input_file av_close_input_file av_find_stream_info dnl
324 dnl url_fopen av_probe_input_format avcodec_find_decoder dnl
325 dnl avcodec_open av_read_frame av_seek_frame av_register_all dnl
326 dnl avcodec_decode_audio avcodec_decode_audio2], [avformat.h],
327 dnl [sxe_cv_feat_ffmpeg=yes], [sxe_cv_feat_ffmpeg=no])
329 dnl Dropped in favour of sxe-pkgconfig.m4 macros
330 dnl _SXE_CHECK_pkgconfig_based([ffmpeg], [libavformat], [49.0.0])
332 SXE_PC_CHECK_VERSION_ATLEAST([libavformat], [51.0.0])
334 SXE_CHECK_FFMPEG_HEADERS
335 SXE_CHECK_FFMPEG_LIBS
337 ## make sure we have at least one of the headers
338 if test "$ac_cv_header_avformat_h" = "yes" -o \
339 "$ac_cv_header_ffmpeg_avformat_h" = "yes" -o \
340 "$ac_cv_header_libavformat_avformat_h" = "yes"; then
341 sxe_cv_feat_ffmpeg_headers="yes"
343 ## make sure either decode_audio or decode_audio2 is there
344 if test "$ac_cv_lib_avformat_avcodec_decode_audio2" = "yes" -o \
345 "$ac_cv_lib_avformat_avcodec_decode_audio" = "yes"; then
346 sxe_cv_feat_ffmpeg_decoders="yes"
348 ## make sure we can either use av_register_protocol()
349 ## or register_protocol()
350 if test "$ac_cv_lib_avformat_av_register_protocol" = "yes" -o \
351 "$ac_cv_lib_avformat_register_protocol" = "yes"; then
352 sxe_cv_feat_ffmpeg_proto_reg="yes"
354 ## make sure this bloody av context allocator is there
355 if test "$ac_cv_lib_avformat_avformat_alloc_context" = "yes" -o \
356 "$ac_cv_lib_avformat_av_alloc_format_context" = "yes"; then
357 sxe_cv_feat_ffmpeg_avformat_alloc="yes"
359 if test "$sxe_cv_feat_ffmpeg_headers" = "yes" -a \
360 "$sxe_cv_feat_ffmpeg_decoders" = "yes" -a \
361 "$sxe_cv_feat_ffmpeg_proto_reg" = "yes" -a \
362 "$sxe_cv_feat_ffmpeg_avformat_alloc" = "yes" -a \
363 "$ac_cv_lib_avformat_av_close_input_file" = "yes" -a \
364 "$ac_cv_lib_avformat_av_find_stream_info" = "yes" -a \
365 "$ac_cv_lib_avformat_av_open_input_file" = "yes" -a \
366 "$ac_cv_lib_avformat_av_probe_input_format" = "yes" -a \
367 "$ac_cv_lib_avformat_av_read_frame" = "yes" -a \
368 "$ac_cv_lib_avformat_av_register_all" = "yes" -a \
369 "$ac_cv_lib_avformat_av_seek_frame" = "yes" -a \
370 "$ac_cv_lib_avformat_avcodec_find_decoder" = "yes" -a \
371 "$ac_cv_lib_avformat_avcodec_open" = "yes" -a \
372 "$ac_cv_lib_avformat_url_fopen" = "yes"; then
373 sxe_cv_feat_ffmpeg="yes"
375 sxe_cv_feat_ffmpeg="no"
378 ## newer ffmpegs want a bioctx** in url_fopen, check that
379 AC_MSG_CHECKING([what url_fopen() needs])
380 sxe_cv_tmp_ffmpeg_url_fopen="uncertain"
383 CPPFLAGS="$CPPFLAGS ${FFMPEG_CPPFLAGS}"
384 SXE_LANG_WERROR([off])
385 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
386 #if defined HAVE_ERRNO_H
389 #if defined HAVE_LIBAVFORMAT_AVFORMAT_H
390 # include <libavformat/avformat.h>
391 #elif defined HAVE_FFMPEG_AVFORMAT_H
392 # include <ffmpeg/avformat.h>
393 #elif defined HAVE_AVFORMAT_H
394 # include <avformat.h>
397 extern int foobar(void);
400 ByteIOContext *bioctx = 0;
402 url_fopen(&bioctx, "/foobar", URL_RDONLY);
405 ]])], [sxe_cv_tmp_ffmpeg_url_fopen="ByteIOContext**"], [:])
409 CPPFLAGS="$CPPFLAGS ${FFMPEG_CPPFLAGS}"
410 SXE_LANG_WERROR([on])
411 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
412 #if defined HAVE_ERRNO_H
415 #if defined HAVE_LIBAVFORMAT_AVFORMAT_H
416 # include <libavformat/avformat.h>
417 #elif defined HAVE_FFMPEG_AVFORMAT_H
418 # include <ffmpeg/avformat.h>
419 #elif defined HAVE_AVFORMAT_H
420 # include <avformat.h>
423 extern int foobar(void);
426 ByteIOContext *bioctx = 0;
428 url_fopen(bioctx, "/foobar", URL_RDONLY);
431 ]])], [sxe_cv_tmp_ffmpeg_url_fopen="ByteIOContext*"], [:])
435 AC_MSG_RESULT([$sxe_cv_tmp_ffmpeg_url_fopen])
437 if test "$sxe_cv_tmp_ffmpeg_url_fopen" = "ByteIOContext**"; then
438 AC_DEFINE([FFMPEG_URL_FOPEN_BIOCTX_STAR_STAR], [1],
439 [Whether url_fopen want a ByteIOContext**])
440 elif test "$sxe_cv_tmp_ffmpeg_url_fopen" = "ByteIOContext*"; then
441 AC_DEFINE([FFMPEG_URL_FOPEN_BIOCTX_STAR], [1],
442 [Whether url_fopen want a ByteIOContext*])
444 sxe_cv_feat_ffmpeg="no"
447 if test "$sxe_cv_feat_ffmpeg" = "yes"; then
455 popdef([ACTION_IF_FOUND])
456 popdef([ACTION_IF_NOT_FOUND])
457 ])dnl SXE_MM_CHECK_FFMPEG
459 AC_DEFUN([SXE_CHECK_FFMPEG_HEADERS], [dnl
460 FFMPEG_CPPFLAGS="$(${PKG_CONFIG} --cflags libavformat)"
462 ## backup current configuration
464 CPPFLAGS="${CPPFLAGS} ${FFMPEG_CPPFLAGS}"
465 AC_CHECK_HEADERS([avformat.h ffmpeg/avformat.h libavformat/avformat.h])
466 ## restore configuration
468 ])dnl SXE_CHECK_FFMPEG_HEADERS
470 AC_DEFUN([SXE_CHECK_FFMPEG_LIBS], [dnl
471 FFMPEG_LDFLAGS="$(${PKG_CONFIG} --libs-only-other libavformat) \
472 $(${PKG_CONFIG} --libs-only-L libavformat)"
473 FFMPEG_LIBS="$(${PKG_CONFIG} --libs-only-l libavformat)"
475 ## backup current configuration
477 LDFLAGS="${LDFLAGS} ${FFMPEG_LDFLAGS}"
479 AC_CHECK_LIB([avformat], [av_open_input_file], [:], [:], [${FFMPEG_LIBS}])
480 AC_CHECK_LIB([avformat], [av_close_input_file], [:], [:], [${FFMPEG_LIBS}])
481 AC_CHECK_LIB([avformat], [av_find_stream_info], [:], [:], [${FFMPEG_LIBS}])
482 AC_CHECK_LIB([avformat], [url_fopen], [:], [:], [${FFMPEG_LIBS}])
483 AC_CHECK_LIB([avformat], [av_probe_input_format], [:], [:], [${FFMPEG_LIBS}])
484 AC_CHECK_LIB([avformat], [avcodec_find_decoder], [:], [:], [${FFMPEG_LIBS}])
485 AC_CHECK_LIB([avformat], [avcodec_open], [:], [:], [${FFMPEG_LIBS}])
486 AC_CHECK_LIB([avformat], [av_read_frame], [:], [:], [${FFMPEG_LIBS}])
487 AC_CHECK_LIB([avformat], [av_seek_frame], [:], [:], [${FFMPEG_LIBS}])
488 AC_CHECK_LIB([avformat], [av_register_all], [:], [:], [${FFMPEG_LIBS}])
489 AC_CHECK_LIB([avformat], [avcodec_decode_audio], [:], [:], [${FFMPEG_LIBS}])
490 AC_CHECK_LIB([avformat], [avcodec_decode_audio2], [:], [:], [${FFMPEG_LIBS}])
492 AC_CHECK_LIB([avformat], [av_alloc_format_context], [:], [:], [${FFMPEG_LIBS}])
493 AC_CHECK_LIB([avformat], [avformat_alloc_context], [:], [:], [${FFMPEG_LIBS}])
494 AC_CHECK_LIB([avformat], [register_protocol], [:], [:], [${FFMPEG_LIBS}])
495 AC_CHECK_LIB([avformat], [av_register_protocol], [:], [:], [${FFMPEG_LIBS}])
497 if test "$ac_cv_lib_avformat_av_alloc_format_context" = "yes"; then
498 AC_DEFINE([HAVE_AV_ALLOC_FORMAT_CONTEXT], [1], [Description here!])
500 if test "$ac_cv_lib_avformat_avformat_alloc_context" = "yes"; then
501 AC_DEFINE([HAVE_AVFORMAT_ALLOC_CONTEXT], [1], [Description here!])
504 if test "$ac_cv_lib_avformat___avcodec_decode_audio2" = "yes" -o \
505 "$ac_cv_lib_avformat_avcodec_decode_audio2" = "yes"; then
506 AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO2], [1], [Description here!])
508 if test "$ac_cv_lib_avformat___avcodec_decode_audio" = "yes" -o \
509 "$ac_cv_lib_avformat_avcodec_decode_audio" = "yes"; then
510 AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO], [1], [Description here!])
513 if test "$ac_cv_lib_avformat_av_register_protocol" = "yes"; then
514 AC_DEFINE([HAVE_AV_REGISTER_PROTOCOL], [1], [Description here!])
516 if test "$ac_cv_lib_avformat_register_protocol" = "yes"; then
517 AC_DEFINE([HAVE_REGISTER_PROTOCOL], [1], [Description here!])
520 ## restore configuration
522 ])dnl SXE_CHECK_FFMPEG_LIBS
528 AC_DEFUN([SXE_MM_CHECK_SOX], [dnl
529 ## call like this SXE_MM_CHECK_SOX([<if-found>], [<if-not-found>])
530 ## arg #1: action on success
531 ## arg #2: action on failure
532 pushdef([ACTION_IF_FOUND], [$1])
533 pushdef([ACTION_IF_NOT_FOUND], [$2])
535 AC_CACHE_CHECK([for SoX support], [sxe_cv_feat_sox], [_SXE_CHECK_SOX])
537 if test "$sox_too_old" = "yes"; then
538 AS_MESSAGE([*** Detected SoX, but it is too old.])
539 AS_MESSAGE([*** Consider upgrading, see http://sox.sourceforge.net])
542 elif test "$sxe_cv_feat_sox" = "yes"; then
550 popdef([ACTION_IF_FOUND])
551 popdef([ACTION_IF_NOT_FOUND])
552 ])dnl SXE_MM_CHECK_SOX
554 AC_DEFUN([_SXE_CHECK_SOX], [dnl
555 AC_REQUIRE([SXE_CHECK_SOX_LOCATOR])
557 if test "$have_libst_config" = "no" -o -z "$LIBST_CONFIG"; then
558 AS_MESSAGE([*** libst-config not found.])
559 AS_MESSAGE([*** Cannot check for SoX.])
563 AC_REQUIRE([SXE_CHECK_SOX_LOCATIONS])
564 AC_REQUIRE([SXE_CHECK_SOX_HEADERS])
565 AC_REQUIRE([SXE_CHECK_SOX_LIBS])
566 AC_REQUIRE([SXE_CHECK_SOX_STRUCTS])
570 if test "$ac_cv_lib_sox_sox_open_read" = "yes" -a \
571 "$ac_cv_lib_sox_sox_close" = "yes" -a \
572 "$ac_cv_lib_sox_sox_seek" = "yes" -a \
573 "$ac_cv_header_sox_h" = "yes" -a \
574 "$ac_cv_type_sox_format_t" = "yes" -a \
575 "$ac_cv_type_struct_sox_format" = "yes" -a \
576 "$sxe_cv_mm_sox_open_read_fooked" != "yes"; then
577 sox_libs="-lsox $sox_libs"
578 sxe_cv_feat_sox="yes"
579 elif test "$ac_cv_lib_st_st_close" = "yes" -a \
580 "$ac_cv_lib_st_st_read" = "yes" -a \
581 "$ac_cv_lib_st_st_seek" = "yes" -a \
582 "$ac_cv_header_st_h" = "yes" -a \
583 "$ac_cv_type_ft_t" = "yes" -a \
584 "$ac_cv_type_struct_st_soundstream" = "yes" -a \
585 "$sxe_cv_mm_sox_open_read_fooked" != "yes"; then
586 sox_libs="-lst $sox_libs"
587 sxe_cv_feat_sox="yes"
593 AC_DEFUN([SXE_CHECK_SOX_LOCATOR], [dnl
594 SXE_SEARCH_CONFIG_PROG([libst-config])
595 ])dnl SXE_CHECK_SOX_LOCATOR
597 AC_DEFUN([SXE_CHECK_SOX_LOCATIONS], [dnl
598 AC_REQUIRE([SXE_CHECK_SOX_LOCATOR])
599 if test "$have_libst_config" = "no" -o -z "$LIBST_CONFIG"; then
604 sox_cppflags="$($LIBST_CONFIG --cflags)"
605 sox_ldflags="-L$($LIBST_CONFIG --libdir)"
606 sox_libs="$($LIBST_CONFIG --libs)"
608 ])dnl SXE_CHECK_SOX_PLACES
610 AC_DEFUN([SXE_PUMP_SOX_LOCATIONS], [dnl
612 CPPFLAGS="$CPPFLAGS $sox_cppflags"
613 LDFLAGS="$LDFLAGS $sox_ldflags"
614 LIBS="$LIBS $sox_libs"
615 ])dnl SXE_PUMP_SOX_LOCATIONS
617 AC_DEFUN([SXE_DUMP_SOX_LOCATIONS], [dnl
619 ])dnl SXE_DUMP_SOX_LOCATIONS
621 AC_DEFUN([SXE_CHECK_SOX_HEADERS], [dnl
622 AC_REQUIRE([SXE_CHECK_SOX_LOCATIONS])
623 SXE_PUMP_SOX_LOCATIONS
624 AC_CHECK_HEADERS([st.h])
625 AC_CHECK_HEADERS([sox.h])
626 SXE_DUMP_SOX_LOCATIONS
627 ])dnl SXE_CHECK_SOX_HEADERS
629 AC_DEFUN([SXE_CHECK_SOX_LIBS], [dnl
630 AC_REQUIRE([SXE_CHECK_SOX_LOCATIONS])
632 echo "void cleanup(void) {}" > cleanup.c
633 $CC -c -o cleanup.o cleanup.c
635 SXE_PUMP_SOX_LOCATIONS
636 ## we need 12.17.9 with st_open_read
637 AC_CHECK_LIB([st], [st_open_read], [:], [:],
638 [cleanup.o $sox_ldflags $sox_libs])
639 AC_CHECK_LIB([st], [st_close], [:], [:], [cleanup.o $sox_ldflags $sox_libs])
640 AC_CHECK_LIB([st], [st_read], [:], [:], [cleanup.o $sox_ldflags $sox_libs])
641 AC_CHECK_LIB([st], [st_seek], [:], [:], [cleanup.o $sox_ldflags $sox_libs])
643 ## checks for the spankin' new sox
644 AC_CHECK_LIB([sox], [sox_open_read], [:], [:],
645 [cleanup.o $sox_ldflags $sox_libs])
646 AC_CHECK_LIB([sox], [sox_close], [:], [:], [cleanup.o $sox_ldflags $sox_libs])
647 AC_CHECK_LIB([sox], [sox_read], [:], [:], [cleanup.o $sox_ldflags $sox_libs])
648 AC_CHECK_LIB([sox], [sox_seek], [:], [:], [cleanup.o $sox_ldflags $sox_libs])
650 SXE_DUMP_SOX_LOCATIONS
653 CPPFLAGS="$CPPFLAGS ${SOX_CPPFLAGS}"
654 SXE_LANG_WERROR([on])
655 SXE_MSG_CHECKING([whether sox_open_read() takes 4 arguments])
656 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
657 #if defined HAVE_ERRNO_H
660 #if defined HAVE_SOX_H
664 sox_open_read("tmp", NULL, NULL, NULL);
666 [sxe_cv_mm_sox_open_read_4args="yes"],
667 [sxe_cv_mm_sox_open_read_4args="no"])
668 SXE_MSG_RESULT([$sxe_cv_mm_sox_open_read_4args])
670 SXE_MSG_CHECKING([whether sox_open_read() takes 3 arguments])
671 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
672 #if defined HAVE_ERRNO_H
675 #if defined HAVE_SOX_H
679 sox_open_read("tmp", NULL, NULL);
681 [sxe_cv_mm_sox_open_read_3args="yes"],
682 [sxe_cv_mm_sox_open_read_3args="no"])
683 SXE_MSG_RESULT([$sxe_cv_mm_sox_open_read_3args])
686 if test "$sxe_cv_mm_sox_open_read_3args" = "yes"; then
687 AC_DEFINE([HAVE_SOX_OPEN_READ_3ARGS], [1],
688 [Whether sox_open_read() takes 3 arguments.])
689 AC_DEFINE([HAVE_SOX_OPEN_READ_NARGS], [3],
690 [How many arguments sox_open_read() takes.])
691 elif test "$sxe_cv_mm_sox_open_read_4args" = "yes"; then
692 AC_DEFINE([HAVE_SOX_OPEN_READ_4ARGS], [1],
693 [Whether sox_open_read() takes 4 arguments.])
694 AC_DEFINE([HAVE_SOX_OPEN_READ_NARGS], [4],
695 [How many arguments sox_open_read() takes.])
698 Very weird SoX you've got there.
699 I better disable SoX on your behalf.
701 sxe_cv_mm_sox_open_read_fooked="yes"
704 ## clean up our cleanup snack
705 rm -f cleanup.c cleanup.o
706 ])dnl SXE_CHECK_SOX_LIBS
708 AC_DEFUN([SXE_CHECK_SOX_STRUCTS], [dnl
710 AC_CHECK_TYPES([ft_t], [:], [:], [
711 #if defined HAVE_ST_H
715 AC_CHECK_TYPES([st_signalinfo_t], [:], [:], [
716 #if defined HAVE_ST_H
720 AC_CHECK_TYPES([st_ssize_t], [:], [:], [
725 AC_CHECK_TYPES([st_sample_t], [:], [:], [
730 AC_CHECK_TYPES([struct st_soundstream], [:], [:], [
731 #if defined HAVE_ST_H
735 AC_CHECK_MEMBERS([struct st_soundstream.info], [:], [:], [
736 #if defined HAVE_ST_H
740 AC_CHECK_MEMBERS([struct st_soundstream.signal], [:], [:], [
741 #if defined HAVE_ST_H
746 ## evaluating the results
747 if test "$ac_cv_member_struct_st_soundstream_info" = "yes"; then
748 AC_DEFINE([MEMBER_STRUCT_ST_SOUNDSTREAM_INFO], [1],
749 [Whether we have the `info' slot])
751 if test "$ac_cv_member_struct_st_soundstream_signal" = "yes"; then
752 AC_DEFINE([MEMBER_STRUCT_ST_SOUNDSTREAM_SIGNAL], [1],
753 [Whether we have the `signal' slot])
757 AC_CHECK_TYPES([sox_format_t], [:], [:], [
762 AC_CHECK_TYPES([sox_ssize_t], [:], [:], [
767 AC_CHECK_TYPES([sox_sample_t], [:], [:], [
772 AC_CHECK_TYPES([sox_signalinfo_t], [:], [:], [
773 #if defined HAVE_SOX_H
777 AC_CHECK_TYPES([struct sox_format], [:], [:], [
782 AC_CHECK_MEMBERS([struct sox_format.signal], [:], [:], [
788 AC_CHECK_MEMBERS([sox_signalinfo_t.precision], [:], [:], [
793 ])dnl SXE_CHECK_SOX_STRUCTS
796 AC_DEFUN([SXE_MM_CHECK_MAD], [
797 ## arg #1: action on success
798 ## arg #2: action on failure
799 pushdef([MM_SUCC], [$1])
800 pushdef([MM_FAIL], [$2])
802 AC_MSG_CHECKING([for mad support])
806 SXE_CHECK_HEADERS([mad.h], [:], [MM_FAIL])
807 AC_CHECK_LIB([mad], [mad_synth_init], [:], [MM_FAIL])
808 AC_CHECK_LIB([mad], [mad_stream_init], [:], [MM_FAIL])
809 AC_CHECK_LIB([mad], [mad_frame_init], [:], [MM_FAIL])
810 AC_CHECK_LIB([mad], [mad_synth_frame], [:], [MM_FAIL])
811 AC_CHECK_LIB([mad], [mad_stream_buffer], [:], [MM_FAIL])
812 AC_CHECK_LIB([mad], [mad_frame_decode], [:], [MM_FAIL])
816 ])dnl SXE_MM_CHECK_MAD
818 AC_DEFUN([SXE_MM_CHECK_MAGIC], [
819 ## assumes $PKG_CONFIG is defined
820 ## arg #1: action on success
821 ## arg #2: action on failure
822 pushdef([MM_SUCC], [$1])
823 pushdef([MM_FAIL], [$2])
825 AC_MSG_CHECKING([for libmagic/file support])
830 AC_CHECK_LIB([magic], [magic_open], [:], [MM_FAIL])
831 SXE_CHECK_HEADERS([magic.h], [:], [MM_FAIL])
832 SXE_CHECK_HEADERS([file.h])
837 ])dnl SXE_MM_CHECK_MAGIC
840 AC_DEFUN([SXE_MM_CHECK_OSS], [
841 ## arg #1: action on success
842 ## arg #2: action on failure
843 pushdef([MM_SUCC], [$1])
844 pushdef([MM_FAIL], [$2])
846 AC_MSG_CHECKING([for OSS support])
851 SXE_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h linux/soundcard.h soundcard.h])
852 if test "$ac_cv_header_linux_soundcard_h"="yes" -o \
853 "$ac_cv_header_machine_soundcard_h"="yes" -o \
854 "$ac_cv_header_soundcard_h"="yes" -o \
855 "$ac_cv_header_sys_soundcard_h"="yes"
857 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
858 #if defined HAVE_MACHINE_SOUNDCARD_H && HAVE_MACHINE_SOUNDCARD_H
859 #include <machine/soundcard.h>
860 #elif defined HAVE_SYS_SOUNDCARD_H && HAVE_SYS_SOUNDCARD_H
861 #include <sys/soundcard.h>
862 #elif defined HAVE_LINUX_SOUNDCARD_H && HAVE_LINUX_SOUNDCARD_H
863 #include <linux/soundcard.h>
865 #include <soundcard.h>
868 [[ ioctl(0, SNDCTL_DSP_RESET, 0); ]])],
869 [oss_ioctl_linked=yes],
870 [oss_ioctl_linked=no])
871 if test "${oss_ioctl_linked}" = "no"
873 if test "${opsys}" = "netbsd"
875 AC_CHECK_LIB([ossaudio],[_oss_ioctl],
877 # netbsd needs this Linux OSS emulator library, just a ioctl
880 SXE_PREPEND([-lossaudio], [MM_LIBS])
891 ])dnl SXE_MM_CHECK_OSS
893 AC_DEFUN([SXE_MM_CHECK_PULSE], [
894 ## assumes $PKG_CONFIG is defined
895 ## arg #1: action on success
896 ## arg #2: action on failure
898 PULSE_REQUIRED_VERSION=0.9.3
899 _SXE_MM_CHECK_pkgconfig_based(dnl
900 [pulse], [libpulse], [$PULSE_REQUIRED_VERSION], [dnl
901 pa_mainloop_new pa_threaded_mainloop_new pa_mainloop_iterate dnl
902 pa_threaded_mainloop_lock pa_threaded_mainloop_unlock dnl
903 pa_mainloop_get_api pa_threaded_mainloop_get_api dnl
904 pa_mainloop_free pa_threaded_mainloop_free dnl
905 pa_threaded_mainloop_stop dnl
906 pa_context_new pa_context_get_state pa_context_is_pending dnl
907 pa_context_disconnect dnl
908 pa_operation_unref dnl
909 pa_stream_new pa_stream_get_state pa_stream_write dnl
910 pa_stream_set_state_callback pa_stream_set_write_callback dnl
911 pa_stream_unref pa_stream_connect_playback pa_stream_disconnect dnl
913 [pulse/pulseaudio.h], [$1], [$2])
914 ])dnl SXE_MM_CHECK_PULSE
916 AC_DEFUN([SXE_MM_CHECK_JACK], [
917 ## assumes $PKG_CONFIG is defined
918 ## arg #1: action on success
919 ## arg #2: action on failure
921 _SXE_MM_CHECK_pkgconfig_based([jack], [jack], [0.98.0], [dnl
922 jack_client_open jack_get_ports jack_port_register dnl
923 jack_set_process_callback jack_set_error_function dnl
924 jack_on_shutdown jack_activate jack_connect jack_disconnect dnl
925 jack_client_close jack_port_get_buffer], [jack/jack.h], [$1], [$2])
926 ])dnl SXE_MM_CHECK_JACK
928 AC_DEFUN([SXE_MM_CHECK_AO], [
929 ## assumes $PKG_CONFIG is defined
930 ## arg #1: action on success
931 ## arg #2: action on failure
933 _SXE_MM_CHECK_pkgconfig_based([ao], [ao], [0.6], [dnl
934 ao_initialize ao_driver_id ao_default_driver_id dnl
935 ao_open_live ao_close ao_shutdown ao_play], [ao/ao.h], [$1], [$2])
936 ])dnl SXE_MM_CHECK_AO
938 AC_DEFUN([SXE_MM_CHECK_ARTS], [
939 ## arg #1: action on success
940 ## arg #2: action on failure
941 pushdef([MM_SUCC], [$1])
942 pushdef([MM_FAIL], [$2])
944 SXE_SEARCH_CONFIG_PROG([artsc-config])
946 AC_MSG_CHECKING([for aRts support])
949 if test "$have_artsc_config" = "no" -o -z "$ARTSC_CONFIG"; then
950 AS_MESSAGE([*** artsc-config not found.])
951 AS_MESSAGE([*** Cannot check for aRts.])
957 if test "$have_artsc_config" = "yes"; then
958 ARTS_VERSION=`$ARTSC_CONFIG --arts-version`
959 ARTS_MAJOR_VERSION=`echo $ARTS_VERSION | awk -F. '{print $1}'`
960 ARTS_MINOR_VERSION=`echo $ARTS_VERSION | awk -F. '{print $2}'`
962 dnl since we are not using most of the arts features, it suffices
963 dnl to have a version 1.x (x >= 0)
964 dnl if test "$ARTS_MAJOR_VERSION" -eq 1 -a \
965 dnl "$ARTS_MINOR_VERSION" -ge 0; then
968 ARTS_CPPFLAGS="`$ARTSC_CONFIG --cflags`"
969 ARTS_LDFLAGS="-L`$ARTSC_CONFIG --libs`"
970 CPPFLAGS="$CPPFLAGS $ARTS_CPPFLAGS"
971 LDFLAGS="$CPPFLAGS $ARTS_LDFLAGS"
974 SXE_CHECK_HEADERS([artsc.h], [:], [MM_FAIL])
975 AC_CHECK_LIB([artsc], [arts_init], [:], [MM_FAIL], [$arts_libs])
976 AC_CHECK_LIB([artsc], [arts_free], [:], [MM_FAIL], [$arts_libs])
977 AC_CHECK_LIB([artsc], [arts_write], [:], [MM_FAIL], [$arts_libs])
978 AC_CHECK_LIB([artsc], [arts_play_stream], [:], [MM_FAIL], [$arts_libs])
979 AC_CHECK_LIB([artsc], [arts_stream_set], [:], [MM_FAIL], [$arts_libs])
980 AC_CHECK_LIB([artsc], [arts_close_stream], [:], [MM_FAIL], [$arts_libs])
988 ])dnl SXE_MM_CHECK_ARTS
990 AC_DEFUN([SXE_MM_CHECK_ESD], [
991 ## arg #1: action on success
992 ## arg #2: action on failure
993 SXE_SEARCH_CONFIG_PROG([esd-config])
995 pushdef([MM_SUCC], [$1])
996 pushdef([MM_FAIL], [$2])
998 AC_MSG_CHECKING([for ESD support])
1001 if test "$have_esd_config" = "no" -o -z "$ESD_CONFIG"; then
1002 AS_MESSAGE([*** esd-config not found.])
1003 AS_MESSAGE([*** Cannot check for ESD.])
1009 if test "$have_esd_config" = "yes"; then
1011 ESD_CPPFLAGS="`$ESD_CONFIG --cflags`"
1012 ESD_LDFLAGS="-L`$ESD_CONFIG --libs`"
1013 dnl SXE_APPEND_UNDUP([$esd_c_switch], [c_switch_site])
1014 dnl SXE_PREPEND([$esd_libs], [LIBS])
1015 CPPFLAGS="$CPPFLAGS $ESD_CPPFLAGS"
1016 LDFLAGS="$LDFLAGS $ESD_LDFLAGS"
1019 SXE_CHECK_HEADERS([esd.h], [:], [MM_FAIL])
1020 AC_CHECK_LIB([esd], [esd_play_stream], [:], [MM_FAIL], [$esd_libs])
1028 ])dnl SXE_MM_CHECK_ESD
1030 AC_DEFUN([SXE_MM_CHECK_ALSA], [
1031 ## call like this SXE_MM_CHECK_ALSA([<if-found>], [<if-not-found>])
1032 ## defines HAVE_ALSA, HAVE_ALSA_SOUND
1033 ## and sxe_cv_feat_alsa
1034 pushdef([ACTION_IF_FOUND], [$1])
1035 pushdef([ACTION_IF_NOT_FOUND], [$2])
1037 AC_CACHE_CHECK([for ALSA support],
1038 [sxe_cv_feat_alsa], [_SXE_MM_CHECK_ALSA])
1040 if test "$sxe_cv_feat_alsa" = "yes"; then
1041 AC_DEFINE([HAVE_ALSA], [1],
1042 [Whether ALSA can be used as sound device])
1043 AC_DEFINE([HAVE_ALSA_SOUND], [1],
1044 [Whether ALSA can be used as sound device])
1051 popdef([ACTION_IF_FOUND])
1052 popdef([ACTION_IF_NOT_FOUND])
1053 ])dnl SXE_MM_CHECK_ALSA
1055 AC_DEFUN([_SXE_MM_CHECK_ALSA], [dnl
1057 AC_REQUIRE([SXE_CHECK_ALSA_HEADERS])
1058 AC_REQUIRE([SXE_CHECK_ALSA_VERSION])
1059 AC_REQUIRE([SXE_CHECK_ALSA_LIBS])
1061 if test "$ac_cv_header_alsa_input_h" = "yes" -a \
1062 "$ac_cv_header_alsa_output_h" = "yes" -a \
1063 "$ac_cv_header_alsa_global_h" = "yes" -a \
1064 "$ac_cv_header_alsa_conf_h" = "yes" -a \
1065 "$ac_cv_header_alsa_pcm_h" = "yes" -a \
1066 "$ac_cv_header_alsa_error_h" = "yes" -a \
1068 "$sxe_mm_alsa_version_supported_p" = "yes" -a \
1070 "$ac_cv_lib_asound_snd_pcm_close" = "yes" -a \
1071 "$ac_cv_lib_asound_snd_pcm_hw_free" = "yes" -a \
1072 "$ac_cv_lib_asound_snd_pcm_hw_params_any" = "yes" -a \
1073 "$ac_cv_lib_asound_snd_pcm_hw_params_free" = "yes" -a \
1074 "$ac_cv_lib_asound_snd_pcm_hw_params_set_access" = "yes" -a \
1075 "$ac_cv_lib_asound_snd_pcm_hw_params_set_channels" = "yes" -a \
1076 "$ac_cv_lib_asound_snd_pcm_hw_params_set_format" = "yes" -a \
1077 "$ac_cv_lib_asound_snd_pcm_hw_params_set_rate_near" = "yes" -a \
1078 "$ac_cv_lib_asound_snd_pcm_hw_params_test_channels" = "yes" -a \
1079 "$ac_cv_lib_asound_snd_pcm_hw_params_test_format" = "yes" -a \
1080 "$ac_cv_lib_asound_snd_pcm_open" = "yes" -a \
1081 "$ac_cv_lib_asound_snd_pcm_prepare" = "yes" -a \
1082 "$ac_cv_lib_asound_snd_pcm_writei" = "yes"; then
1083 sxe_cv_feat_alsa="yes"
1085 sxe_cv_feat_alsa="no"
1087 ])dnl _SXE_MM_CHECK_ALSA
1089 AC_DEFUN([SXE_CHECK_ALSA_HEADERS], [dnl
1090 ## dump the current configuration
1092 SXE_LANG_WERROR([off])
1093 SXE_CHECK_HEADERS([alsa/input.h alsa/output.h alsa/global.h])
1094 SXE_CHECK_HEADERS([alsa/conf.h], [:], [:], [[
1097 #if defined HAVE_ALSA_INPUT_H
1098 # include <alsa/input.h>
1100 #if defined HAVE_ALSA_OUTPUT_H
1101 # include <alsa/output.h>
1103 #if defined HAVE_ALSA_GLOBAL_H
1104 # include <alsa/global.h>
1107 SXE_CHECK_HEADERS([alsa/pcm.h alsa/error.h alsa/version.h], [:], [:], [[
1110 #if defined HAVE_ALSA_INPUT_H
1111 # include <alsa/input.h>
1113 #if defined HAVE_ALSA_OUTPUT_H
1114 # include <alsa/output.h>
1116 #if defined HAVE_ALSA_GLOBAL_H
1117 # include <alsa/global.h>
1119 #if defined HAVE_ALSA_CONF_H
1120 # include <alsa/conf.h>
1123 ## restor everything
1125 ])dnl SXE_CHECK_ALSA_HEADERS
1127 AC_DEFUN([SXE_CHECK_ALSA_VERSION], [dnl
1128 AC_REQUIRE([SXE_CHECK_ALSA_HEADERS])
1130 ## dump the configuration
1132 SXE_LANG_WERROR([off])
1133 AC_MSG_CHECKING([for alsa version])
1135 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1138 #if defined HAVE_ALSA_INPUT_H
1139 # include <alsa/input.h>
1141 #if defined HAVE_ALSA_OUTPUT_H
1142 # include <alsa/output.h>
1144 #if defined HAVE_ALSA_GLOBAL_H
1145 # include <alsa/global.h>
1147 #if defined HAVE_ALSA_CONF_H
1148 # include <alsa/conf.h>
1150 #if defined HAVE_ALSA_PCM_H
1151 # include <alsa/pcm.h>
1153 #if defined HAVE_ALSA_ERROR_H
1154 # include <alsa/error.h>
1156 #if defined HAVE_ALSA_CONF_H
1157 # include <alsa/version.h>
1160 int main(int c, char *v[])
1162 fprintf(stdout, SND_LIB_VERSION_STR);
1164 }]])], dnl [./conftest; alsa_subminor=$?],[alsa_subminor=$?],[alsa_subminor=0]
1165 [sxe_mm_alsa_version=$(./conftest)],
1166 [:], [sxe_mm_alsa_version="undeterminable"])
1168 case "${sxe_mm_alsa_version}" in
1169 0.*.* | 1.0.3* | 1.0.9* )
1170 AC_MSG_RESULT([${sxe_mm_alsa_version} (known to break)])
1171 AC_MSG_WARN([Your ALSA version is _KNOWN_ to fail! Do not say we have not warned you!])
1172 sxe_mm_alsa_version_supported_p="no"
1174 1.0.2 | 1.0.4* | 1.0.5* | 1.0.6* | 1.0.7* | 1.0.8* )
1175 AC_MSG_RESULT([${sxe_mm_alsa_version} (suspicious to break)])
1176 AC_MSG_WARN([Your ALSA version has not been tested. Do not be surprised if it fails!])
1177 sxe_mm_alsa_version_supported_p="no"
1179 1.0.10* | 1.0.11* | 1.0.12* | 1.0.13* | 1.0.14* | 1.0.15* | 1.0.16* )
1180 AC_MSG_RESULT([${sxe_mm_alsa_version} (sane)])
1181 sxe_mm_alsa_version_supported_p="yes"
1184 AC_MSG_RESULT([${sxe_mm_alsa_version} (unknown)])
1185 AC_MSG_NOTICE([Your ALSA version is unknown, however we are confident that it works.])
1186 AC_MSG_NOTICE([However, if we screwed up something, please report back!])
1187 sxe_mm_alsa_version_supported_p="yes"
1190 AC_MSG_RESULT([${sxe_mm_alsa_version} (unknown)])
1191 AC_MSG_WARN([Your ALSA version is unknown hence not supported!])
1192 sxe_mm_alsa_version_supported_p="no"
1196 ## restore everything
1198 ])dnl SXE_CHECK_ALSA_VERSION
1200 AC_DEFUN([SXE_CHECK_ALSA_LIBS], [dnl
1201 ## dump the current configuration
1204 AC_CHECK_LIB([asound], [snd_pcm_open], [:], [:])
1205 AC_CHECK_LIB([asound], [snd_pcm_close], [:], [:])
1206 AC_CHECK_LIB([asound], [snd_pcm_hw_free], [:], [:])
1207 AC_CHECK_LIB([asound], [snd_pcm_hw_params_any], [:], [:])
1208 AC_CHECK_LIB([asound], [snd_pcm_hw_params_set_access], [:], [:])
1209 AC_CHECK_LIB([asound], [snd_pcm_hw_params_free], [:], [:])
1210 AC_CHECK_LIB([asound], [snd_pcm_hw_params_test_channels], [:], [:])
1211 AC_CHECK_LIB([asound], [snd_pcm_hw_params_test_format], [:], [:])
1212 AC_CHECK_LIB([asound], [snd_pcm_hw_params_set_channels], [:], [:])
1213 AC_CHECK_LIB([asound], [snd_pcm_hw_params_set_format], [:], [:])
1214 AC_CHECK_LIB([asound], [snd_pcm_hw_params_set_rate_near], [:], [:])
1215 AC_CHECK_LIB([asound], [snd_pcm_prepare], [:], [:])
1216 AC_CHECK_LIB([asound], [snd_pcm_writei], [:], [:])
1218 ## restore everything
1220 ])dnl SXE_CHECK_ALSA_LIBS
1224 AC_DEFUN([SXE_MM_CHECK_NAS], [
1225 ## arg #1: action on success
1226 ## arg #2: action on failure
1227 pushdef([MM_SUCC], [$1])
1228 pushdef([MM_FAIL], [$2])
1230 AC_MSG_CHECKING([for NAS support])
1236 ## NAS is often stored inside the X hierarchy, so ...
1237 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1238 LDFLAGS="$LDFLAGS $X_LIBS"
1239 SXE_CHECK_HEADERS([audio/audiolib.h], [:], [MM_FAIL])
1240 AC_CHECK_LIB([audio], [AuOpenServer], [:], [MM_FAIL])
1241 AC_CHECK_LIB([audio], [AuCloseServer], [:], [MM_FAIL])
1242 AC_CHECK_LIB([audio], [AuCreateFlow], [:], [MM_FAIL])
1243 AC_CHECK_LIB([audio], [AuStartFlow], [:], [MM_FAIL])
1244 AC_CHECK_LIB([audio], [AuStopFlow], [:], [MM_FAIL])
1245 AC_CHECK_LIB([audio], [AuScanForTypedEvent], [:], [MM_FAIL])
1246 AC_CHECK_LIB([audio], [AuDispatchEvent], [:], [MM_FAIL])
1247 AC_CHECK_LIB([audio], [AuSetErrorHandler], [:], [MM_FAIL])
1248 AC_CHECK_LIB([audio], [AuSetIOErrorHandler], [:], [MM_FAIL])
1249 AC_CHECK_LIB([audio], [AuWriteElement], [:], [MM_FAIL])
1250 AC_CHECK_LIB([audio], [AuSetElements], [:], [MM_FAIL])
1251 AC_CHECK_LIB([audio], [AuRegisterEventHandler], [:], [MM_FAIL])
1252 AC_CHECK_LIB([audio], [AuSetElementParameters], [:], [MM_FAIL])
1254 dnl If the nas library does not contain the error jump point,
1255 dnl then we force safer behavior.
1256 AC_EGREP_HEADER([AuXtErrorJump], [audio/Xtutil.h], [], [old_nas=yes])
1257 if test "$old_nas" = "yes"; then
1258 AC_DEFINE([NAS_NO_ERROR_JUMP], [1], [Description here!])
1266 ])dnl SXE_MM_CHECK_NAS
1268 dnl sxe-mm.m4 ends here