X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=m4%2Fsxe-mm.m4;h=878c4da9f61e75053985e2b06ee65c08cc03f612;hb=refs%2Ftags%2Fv22.1.16;hp=b1842bd77b618ca2bebb5fe3d7b0c89b169d6f0f;hpb=0c3ccf5a2bc52569d4f808702ac1263dc5c460f0;p=sxemacs diff --git a/m4/sxe-mm.m4 b/m4/sxe-mm.m4 index b1842bd..878c4da 100644 --- a/m4/sxe-mm.m4 +++ b/m4/sxe-mm.m4 @@ -72,8 +72,8 @@ AC_DEFUN([SXE_MM_CHECK_XFACE], [ SXE_DUMP_LIBS SXE_LANG_WERROR([off]) - dnl SXE_PREPEND([-I$x_includes], [c_switch_site]) - dnl SXE_PREPEND([-L$x_libraries], [ld_switch_site]) + dnl SXE_PREPEND_UNDUP([-I$x_includes], [c_switch_site]) + dnl SXE_PREPEND_UNDUP([-L$x_libraries], [ld_switch_site]) CPPFLAGS="$CPPFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" @@ -118,8 +118,8 @@ AC_DEFUN([SXE_MM_CHECK_JPEG], [ SXE_DUMP_LIBS SXE_LANG_WERROR([off]) - dnl SXE_PREPEND([-I$x_includes], [c_switch_site]) - dnl SXE_PREPEND([-L$x_libraries], [ld_switch_site]) + dnl SXE_PREPEND_UNDUP([-I$x_includes], [c_switch_site]) + dnl SXE_PREPEND_UNDUP([-L$x_libraries], [ld_switch_site]) CPPFLAGS="$CPPFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" @@ -186,8 +186,9 @@ AC_DEFUN([_SXE_MM_CHECK_PNG_VERSION], [dnl SXE_MSG_CHECKING([for workable png version information]) SXE_DUMP_LIBS - LDFLAGS="$LDFLAGS $PNG_LDFLAGS" - LIBS="$LIBS $PNG_LIBS" + CPPFLAGS="$PNG_CPPFLAGS" + LDFLAGS="$PNG_LDFLAGS" + LIBS="$PNG_LIBS" AC_RUN_IFELSE([AC_LANG_SOURCE([[ #if defined HAVE_PNG_H # include @@ -266,8 +267,8 @@ AC_DEFUN([SXE_MM_CHECK_TIFF], [ SXE_DUMP_LIBS SXE_LANG_WERROR([off]) - dnl SXE_PREPEND([-I$x_includes], [c_switch_site]) - dnl SXE_PREPEND([-L$x_libraries], [ld_switch_site]) + dnl SXE_PREPEND_UNDUP([-I$x_includes], [c_switch_site]) + dnl SXE_PREPEND_UNDUP([-L$x_libraries], [ld_switch_site]) CPPFLAGS="$CPPFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" @@ -317,18 +318,12 @@ AC_DEFUN([SXE_MM_CHECK_FFMPEG], [ pushdef([ACTION_IF_NOT_FOUND], [$2]) sxe_cv_feat_ffmpeg= - ## we can't use that one since we have to check multiple headers -dnl _SXE_MM_CHECK_pkgconfig_based([ffmpeg], [libavformat], [49.0.0], [dnl -dnl av_open_input_file av_close_input_file av_find_stream_info dnl -dnl url_fopen av_probe_input_format avcodec_find_decoder dnl -dnl avcodec_open av_read_frame av_seek_frame av_register_all dnl -dnl avcodec_decode_audio avcodec_decode_audio2], [avformat.h], -dnl [sxe_cv_feat_ffmpeg=yes], [sxe_cv_feat_ffmpeg=no]) -dnl Dropped in favour of sxe-pkgconfig.m4 macros -dnl _SXE_CHECK_pkgconfig_based([ffmpeg], [libavformat], [49.0.0]) - - SXE_PC_CHECK_VERSION_ATLEAST([libavformat], [51.0.0]) + ## Minimum versions required matches FFmpeg stable v2.0.1 + ## released 2013-08-13 + SXE_PC_CHECK_VERSION_ATLEAST([libavformat], [55.12.100]) + SXE_PC_CHECK_VERSION_ATLEAST([libavcodec], [55.18.102]) + SXE_PC_CHECK_VERSION_ATLEAST([libavutil], [52.38.100]) SXE_CHECK_FFMPEG_HEADERS SXE_CHECK_FFMPEG_LIBS @@ -338,111 +333,71 @@ dnl _SXE_CHECK_pkgconfig_based([ffmpeg], [libavformat], [49.0.0]) "$ac_cv_header_ffmpeg_avformat_h" = "yes" -o \ "$ac_cv_header_libavformat_avformat_h" = "yes"; then sxe_cv_feat_ffmpeg_headers="yes" + else + sxe_cv_feat_ffmpeg_headers="no" fi - ## make sure either decode_audio or decode_audio2 is there - if test "$ac_cv_lib_avformat_avcodec_decode_audio2" = "yes" -o \ - "$ac_cv_lib_avformat_avcodec_decode_audio" = "yes"; then - sxe_cv_feat_ffmpeg_decoders="yes" + + if test "$sxe_cv_feat_ffmpeg_headers" = "yes"; then + if test "$ac_cv_header_avcodec_h" = "yes" -o \ + "$ac_cv_header_ffmpeg_avcodec_h" = "yes" -o \ + "$ac_cv_header_libavcodec_avcodec_h" = "yes"; then + sxe_cv_feat_ffmpeg_headers="yes" + else + sxe_cv_feat_ffmpeg_headers="no" + fi fi - ## make sure we can either use av_register_protocol() - ## or register_protocol() - if test "$ac_cv_lib_avformat_av_register_protocol" = "yes" -o \ - "$ac_cv_lib_avformat_register_protocol" = "yes"; then - sxe_cv_feat_ffmpeg_proto_reg="yes" + + if test "$sxe_cv_feat_ffmpeg_headers" = "yes"; then + if test "$ac_cv_header_ffmpeg_dict_h" = "yes" -o \ + "$ac_cv_header_libavutil_dict_h" = "yes"; then + sxe_cv_feat_ffmpeg_headers="yes" + else + sxe_cv_feat_ffmpeg_headers="no" + fi fi - ## make sure this bloody av context allocator is there - if test "$ac_cv_lib_avformat_avformat_alloc_context" = "yes" -o \ - "$ac_cv_lib_avformat_av_alloc_format_context" = "yes"; then - sxe_cv_feat_ffmpeg_avformat_alloc="yes" + + if test "$sxe_cv_feat_ffmpeg_headers" = "yes"; then + if test "$ac_cv_header_ffmpeg_time_h" = "yes" -o \ + "$ac_cv_header_libavutil_time_h" = "yes"; then + sxe_cv_feat_ffmpeg_headers="yes" + else + sxe_cv_feat_ffmpeg_headers="no" + fi fi + + ## make sure either decode_audio is there + if test "$ac_cv_lib_avcodec_avcodec_decode_audio" = "yes" -o \ + "$ac_cv_lib_avcodec_avcodec_decode_audio2" = "yes" -o \ + "$ac_cv_lib_avcodec_avcodec_decode_audio3" = "yes"; then + sxe_cv_feat_ffmpeg_decoders="yes" + fi + if test "$sxe_cv_feat_ffmpeg_headers" = "yes" -a \ "$sxe_cv_feat_ffmpeg_decoders" = "yes" -a \ - "$sxe_cv_feat_ffmpeg_proto_reg" = "yes" -a \ - "$sxe_cv_feat_ffmpeg_avformat_alloc" = "yes" -a \ - "$ac_cv_lib_avformat_av_close_input_file" = "yes" -a \ - "$ac_cv_lib_avformat_av_find_stream_info" = "yes" -a \ - "$ac_cv_lib_avformat_av_open_input_file" = "yes" -a \ + "$ac_cv_lib_avformat_avformat_alloc_context" = "yes" -a \ + "$ac_cv_lib_avformat_avformat_free_context" = "yes" -a \ + "$ac_cv_lib_avformat_avio_alloc_context" = "yes" -a \ + "$ac_cv_lib_avformat_avio_size" = "yes" -a \ + "$ac_cv_lib_avformat_avio_feof" = "yes" -a \ + "$ac_cv_lib_avformat_avformat_open_input" = "yes" -a \ + "$ac_cv_lib_avformat_avformat_close_input" = "yes" -a \ + "$ac_cv_lib_avformat_avformat_find_stream_info" = "yes" -a \ "$ac_cv_lib_avformat_av_probe_input_format" = "yes" -a \ + "$ac_cv_lib_avformat_av_iformat_next" = "yes" -a \ "$ac_cv_lib_avformat_av_read_frame" = "yes" -a \ - "$ac_cv_lib_avformat_av_register_all" = "yes" -a \ "$ac_cv_lib_avformat_av_seek_frame" = "yes" -a \ - "$ac_cv_lib_avformat_avcodec_find_decoder" = "yes" -a \ - "$ac_cv_lib_avformat_avcodec_open" = "yes" -a \ - "$ac_cv_lib_avformat_url_fopen" = "yes"; then + "$ac_cv_lib_avformat_av_register_all" = "yes" -a \ + "$ac_cv_lib_avformat_av_dump_format" = "yes" -a \ + "$ac_cv_lib_avformat_av_get_sample_fmt_string" = "yes" -a \ + "$ac_cv_lib_avformat_av_get_bytes_per_sample" = "yes" -a \ + "$ac_cv_lib_avcodec_avcodec_find_decoder" = "yes" -a \ + "$ac_cv_lib_avcodec_avcodec_open2" = "yes" -a \ + "$ac_cv_lib_avutil_av_dict_get" = "yes"; then sxe_cv_feat_ffmpeg="yes" else sxe_cv_feat_ffmpeg="no" fi - ## newer ffmpegs want a bioctx** in url_fopen, check that - AC_MSG_CHECKING([what url_fopen() needs]) - sxe_cv_tmp_ffmpeg_url_fopen="uncertain" - - SXE_DUMP_LIBS - CPPFLAGS="$CPPFLAGS ${FFMPEG_CPPFLAGS}" - SXE_LANG_WERROR([off]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#if defined HAVE_ERRNO_H -# include -#endif -#if defined HAVE_LIBAVFORMAT_AVFORMAT_H -# include -#elif defined HAVE_FFMPEG_AVFORMAT_H -# include -#elif defined HAVE_AVFORMAT_H -# include -#endif - -extern int foobar(void); -int foobar(void) -{ - ByteIOContext *bioctx = 0; - - url_fopen(&bioctx, "/foobar", URL_RDONLY); - return 0; -} - ]])], [sxe_cv_tmp_ffmpeg_url_fopen="ByteIOContext**"], [:]) - SXE_RESTORE_LIBS - - SXE_DUMP_LIBS - CPPFLAGS="$CPPFLAGS ${FFMPEG_CPPFLAGS}" - SXE_LANG_WERROR([on]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#if defined HAVE_ERRNO_H -# include -#endif -#if defined HAVE_LIBAVFORMAT_AVFORMAT_H -# include -#elif defined HAVE_FFMPEG_AVFORMAT_H -# include -#elif defined HAVE_AVFORMAT_H -# include -#endif - -extern int foobar(void); -int foobar(void) -{ - ByteIOContext *bioctx = 0; - - url_fopen(bioctx, "/foobar", URL_RDONLY); - return 0; -} - ]])], [sxe_cv_tmp_ffmpeg_url_fopen="ByteIOContext*"], [:]) - SXE_RESTORE_LIBS - - ## post the result - AC_MSG_RESULT([$sxe_cv_tmp_ffmpeg_url_fopen]) - - if test "$sxe_cv_tmp_ffmpeg_url_fopen" = "ByteIOContext**"; then - AC_DEFINE([FFMPEG_URL_FOPEN_BIOCTX_STAR_STAR], [1], - [Whether url_fopen want a ByteIOContext**]) - elif test "$sxe_cv_tmp_ffmpeg_url_fopen" = "ByteIOContext*"; then - AC_DEFINE([FFMPEG_URL_FOPEN_BIOCTX_STAR], [1], - [Whether url_fopen want a ByteIOContext*]) - else - sxe_cv_feat_ffmpeg="no" - fi - if test "$sxe_cv_feat_ffmpeg" = "yes"; then : ACTION_IF_FOUND @@ -456,64 +411,71 @@ int foobar(void) ])dnl SXE_MM_CHECK_FFMPEG AC_DEFUN([SXE_CHECK_FFMPEG_HEADERS], [dnl - FFMPEG_CPPFLAGS="$(${PKG_CONFIG} --cflags libavformat)" + FFMPEG_CPPFLAGS="$(${PKG_CONFIG} --cflags libavformat libavcodec libavutil)" ## backup current configuration SXE_DUMP_LIBS CPPFLAGS="${CPPFLAGS} ${FFMPEG_CPPFLAGS}" - AC_CHECK_HEADERS([avformat.h ffmpeg/avformat.h libavformat/avformat.h]) + AC_CHECK_HEADERS([avformat.h avcodec.h]) + AC_CHECK_HEADERS([ffmpeg/avformat.h ffmpeg/avcodec.h]) + AC_CHECK_HEADERS([ffmpeg/dict.h ffmpeg/time.h]) + AC_CHECK_HEADERS([libavformat/avformat.h libavcodec/avcodec.h]) + AC_CHECK_HEADERS([libavutil/dict.h libavutil/time.h]) + ## restore configuration SXE_RESTORE_LIBS ])dnl SXE_CHECK_FFMPEG_HEADERS AC_DEFUN([SXE_CHECK_FFMPEG_LIBS], [dnl - FFMPEG_LDFLAGS="$(${PKG_CONFIG} --libs-only-other libavformat) \ - $(${PKG_CONFIG} --libs-only-L libavformat)" - FFMPEG_LIBS="$(${PKG_CONFIG} --libs-only-l libavformat)" + FFMPEG_LDFLAGS="$(${PKG_CONFIG} --libs-only-other libavformat libavcodec libavutil) \ + $(${PKG_CONFIG} --libs-only-L libavformat libavcodec libavutil)" + FFMPEG_LIBS="$(${PKG_CONFIG} --libs-only-l libavformat libavcodec libavutil)" ## backup current configuration SXE_DUMP_LIBS LDFLAGS="${LDFLAGS} ${FFMPEG_LDFLAGS}" - AC_CHECK_LIB([avformat], [av_open_input_file], [:], [:], [${FFMPEG_LIBS}]) - AC_CHECK_LIB([avformat], [av_close_input_file], [:], [:], [${FFMPEG_LIBS}]) - AC_CHECK_LIB([avformat], [av_find_stream_info], [:], [:], [${FFMPEG_LIBS}]) - AC_CHECK_LIB([avformat], [url_fopen], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avcodec], [avcodec_find_decoder], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avcodec], [avcodec_open2], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avcodec], [avcodec_decode_audio], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avcodec], [avcodec_decode_audio2], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avcodec], [avcodec_decode_audio3], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avcodec], [avcodec_decode_audio4], [:], [:], [${FFMPEG_LIBS}]) + + AC_CHECK_LIB([avformat], [avformat_open_input], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avformat], [avformat_close_input], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avformat], [avformat_find_stream_info], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avformat], [av_iformat_next], [:], [:], [${FFMPEG_LIBS}]) AC_CHECK_LIB([avformat], [av_probe_input_format], [:], [:], [${FFMPEG_LIBS}]) - AC_CHECK_LIB([avformat], [avcodec_find_decoder], [:], [:], [${FFMPEG_LIBS}]) - AC_CHECK_LIB([avformat], [avcodec_open], [:], [:], [${FFMPEG_LIBS}]) AC_CHECK_LIB([avformat], [av_read_frame], [:], [:], [${FFMPEG_LIBS}]) AC_CHECK_LIB([avformat], [av_seek_frame], [:], [:], [${FFMPEG_LIBS}]) AC_CHECK_LIB([avformat], [av_register_all], [:], [:], [${FFMPEG_LIBS}]) - AC_CHECK_LIB([avformat], [avcodec_decode_audio], [:], [:], [${FFMPEG_LIBS}]) - AC_CHECK_LIB([avformat], [avcodec_decode_audio2], [:], [:], [${FFMPEG_LIBS}]) - - AC_CHECK_LIB([avformat], [av_alloc_format_context], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avformat], [av_dump_format], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avformat], [av_get_bytes_per_sample], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avformat], [av_get_sample_fmt_string], [:], [:], [${FFMPEG_LIBS}]) AC_CHECK_LIB([avformat], [avformat_alloc_context], [:], [:], [${FFMPEG_LIBS}]) - AC_CHECK_LIB([avformat], [register_protocol], [:], [:], [${FFMPEG_LIBS}]) - AC_CHECK_LIB([avformat], [av_register_protocol], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avformat], [avformat_free_context], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avformat], [avio_alloc_context], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avformat], [avio_size], [:], [:], [${FFMPEG_LIBS}]) + AC_CHECK_LIB([avformat], [avio_feof], [:], [:], [${FFMPEG_LIBS}]) - if test "$ac_cv_lib_avformat_av_alloc_format_context" = "yes"; then - AC_DEFINE([HAVE_AV_ALLOC_FORMAT_CONTEXT], [1], [Description here!]) - fi - if test "$ac_cv_lib_avformat_avformat_alloc_context" = "yes"; then - AC_DEFINE([HAVE_AVFORMAT_ALLOC_CONTEXT], [1], [Description here!]) - fi + AC_CHECK_LIB([avutil], [av_dict_get], [:], [:], [${FFMPEG_LIBS}]) - if test "$ac_cv_lib_avformat___avcodec_decode_audio2" = "yes" -o \ - "$ac_cv_lib_avformat_avcodec_decode_audio2" = "yes"; then - AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO2], [1], [Description here!]) + if test "$ac_cv_lib_avcodec_avcodec_decode_audio" = "yes"; then + AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO], [1], + [Define to 1 if avcodec_decode_audio is usable.]) fi - if test "$ac_cv_lib_avformat___avcodec_decode_audio" = "yes" -o \ - "$ac_cv_lib_avformat_avcodec_decode_audio" = "yes"; then - AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO], [1], [Description here!]) + if test "$ac_cv_lib_avcodec_avcodec_decode_audio2" = "yes"; then + AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO2], [1], + [Define to 1 if avcodec_decode_audio2 is usable.]) fi - - if test "$ac_cv_lib_avformat_av_register_protocol" = "yes"; then - AC_DEFINE([HAVE_AV_REGISTER_PROTOCOL], [1], [Description here!]) + if test "$ac_cv_lib_avcodec_avcodec_decode_audio3" = "yes"; then + AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO3], [1], + [Define to 1 if avcodec_decode_audio is usable.]) fi - if test "$ac_cv_lib_avformat_register_protocol" = "yes"; then - AC_DEFINE([HAVE_REGISTER_PROTOCOL], [1], [Description here!]) + if test "$ac_cv_lib_avcodec_avcodec_decode_audio4" = "yes"; then + AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO4], [1], + [Define to 1 if avcodec_decode_audio is usable.]) fi ## restore configuration @@ -533,12 +495,7 @@ AC_DEFUN([SXE_MM_CHECK_SOX], [dnl AC_CACHE_CHECK([for SoX support], [sxe_cv_feat_sox], [_SXE_CHECK_SOX]) - if test "$sox_too_old" = "yes"; then - AS_MESSAGE([*** Detected SoX, but it is too old.]) - AS_MESSAGE([*** Consider upgrading, see http://sox.sourceforge.net]) - ACTION_IF_NOT_FOUND - : - elif test "$sxe_cv_feat_sox" = "yes"; then + if test "$sxe_cv_feat_sox" = "yes"; then ACTION_IF_FOUND : else @@ -551,59 +508,38 @@ AC_DEFUN([SXE_MM_CHECK_SOX], [dnl ])dnl SXE_MM_CHECK_SOX AC_DEFUN([_SXE_CHECK_SOX], [dnl - AC_REQUIRE([SXE_CHECK_SOX_LOCATOR]) + AC_REQUIRE([SXE_CHECK_SOX_LOCATIONS]) - if test "$have_libst_config" = "no" -o -z "$LIBST_CONFIG"; then - AS_MESSAGE([*** libst-config not found.]) - AS_MESSAGE([*** Cannot check for SoX.]) - have_libst_config=no - LIBST_CONFIG= + if test "$have_smelly_sox" = "yes"; then + sxe_cv_feat_sox="no" else - AC_REQUIRE([SXE_CHECK_SOX_LOCATIONS]) - AC_REQUIRE([SXE_CHECK_SOX_HEADERS]) - AC_REQUIRE([SXE_CHECK_SOX_LIBS]) - AC_REQUIRE([SXE_CHECK_SOX_STRUCTS]) + SXE_CHECK_SOX_HEADERS + SXE_CHECK_SOX_LIBS + SXE_CHECK_SOX_STRUCTS + + if test "$ac_cv_lib_sox_sox_open_read" = "yes" -a \ + "$ac_cv_lib_sox_sox_close" = "yes" -a \ + "$ac_cv_lib_sox_sox_seek" = "yes" -a \ + "$ac_cv_header_sox_h" = "yes" -a \ + "$ac_cv_type_sox_format_t" = "yes" -a \ + "$ac_cv_type_struct_sox_format_t" = "yes" -a \ + "$sxe_cv_mm_sox_open_read_fooked" != "yes"; then + sxe_cv_feat_sox="yes" + else + sxe_cv_feat_sox="no" + fi : fi - - if test "$ac_cv_lib_sox_sox_open_read" = "yes" -a \ - "$ac_cv_lib_sox_sox_close" = "yes" -a \ - "$ac_cv_lib_sox_sox_seek" = "yes" -a \ - "$ac_cv_header_sox_h" = "yes" -a \ - "$ac_cv_type_sox_format_t" = "yes" -a \ - "$ac_cv_type_struct_sox_format" = "yes" -a \ - "$sxe_cv_mm_sox_open_read_fooked" != "yes"; then - sox_libs="-lsox $sox_libs" - sxe_cv_feat_sox="yes" - elif test "$ac_cv_lib_st_st_close" = "yes" -a \ - "$ac_cv_lib_st_st_read" = "yes" -a \ - "$ac_cv_lib_st_st_seek" = "yes" -a \ - "$ac_cv_header_st_h" = "yes" -a \ - "$ac_cv_type_ft_t" = "yes" -a \ - "$ac_cv_type_struct_st_soundstream" = "yes" -a \ - "$sxe_cv_mm_sox_open_read_fooked" != "yes"; then - sox_libs="-lst $sox_libs" - sxe_cv_feat_sox="yes" - else - sxe_cv_feat_sox="no" - fi ])dnl _SXE_CHECK_SOX -AC_DEFUN([SXE_CHECK_SOX_LOCATOR], [dnl - SXE_SEARCH_CONFIG_PROG([libst-config]) -])dnl SXE_CHECK_SOX_LOCATOR - AC_DEFUN([SXE_CHECK_SOX_LOCATIONS], [dnl - AC_REQUIRE([SXE_CHECK_SOX_LOCATOR]) - if test "$have_libst_config" = "no" -o -z "$LIBST_CONFIG"; then - sox_cppflags= + PKG_CHECK_MODULES([SOX], [sox >= 14.1.0], [dnl + have_smelly_sox="no" + sox_cppflags="$SOX_CFLAGS" sox_ldflags= - sox_libs= - else - sox_cppflags="$($LIBST_CONFIG --cflags)" - sox_ldflags="-L$($LIBST_CONFIG --libdir)" - sox_libs="$($LIBST_CONFIG --libs)" - fi + sox_libs="$SOX_LIBS"], [dnl + have_smelly_sox="yes" + AC_MSG_WARN([Your SoX is too old or non-existant. You need >= 14.1.0])]) ])dnl SXE_CHECK_SOX_PLACES AC_DEFUN([SXE_PUMP_SOX_LOCATIONS], [dnl @@ -620,7 +556,6 @@ AC_DEFUN([SXE_DUMP_SOX_LOCATIONS], [dnl AC_DEFUN([SXE_CHECK_SOX_HEADERS], [dnl AC_REQUIRE([SXE_CHECK_SOX_LOCATIONS]) SXE_PUMP_SOX_LOCATIONS - AC_CHECK_HEADERS([st.h]) AC_CHECK_HEADERS([sox.h]) SXE_DUMP_SOX_LOCATIONS ])dnl SXE_CHECK_SOX_HEADERS @@ -632,13 +567,6 @@ AC_DEFUN([SXE_CHECK_SOX_LIBS], [dnl $CC -c -o cleanup.o cleanup.c SXE_PUMP_SOX_LOCATIONS - ## we need 12.17.9 with st_open_read - AC_CHECK_LIB([st], [st_open_read], [:], [:], - [cleanup.o $sox_ldflags $sox_libs]) - AC_CHECK_LIB([st], [st_close], [:], [:], [cleanup.o $sox_ldflags $sox_libs]) - AC_CHECK_LIB([st], [st_read], [:], [:], [cleanup.o $sox_ldflags $sox_libs]) - AC_CHECK_LIB([st], [st_seek], [:], [:], [cleanup.o $sox_ldflags $sox_libs]) - ## checks for the spankin' new sox AC_CHECK_LIB([sox], [sox_open_read], [:], [:], [cleanup.o $sox_ldflags $sox_libs]) @@ -705,53 +633,6 @@ I better disable SoX on your behalf. ])dnl SXE_CHECK_SOX_LIBS AC_DEFUN([SXE_CHECK_SOX_STRUCTS], [dnl - ## the old structs - AC_CHECK_TYPES([ft_t], [:], [:], [ -#if defined HAVE_ST_H -# include -#endif - ]) - AC_CHECK_TYPES([st_signalinfo_t], [:], [:], [ -#if defined HAVE_ST_H -# include -#endif - ]) - AC_CHECK_TYPES([st_ssize_t], [:], [:], [ -#ifdef HAVE_ST_H -# include -#endif - ]) - AC_CHECK_TYPES([st_sample_t], [:], [:], [ -#ifdef HAVE_ST_H -# include -#endif - ]) - AC_CHECK_TYPES([struct st_soundstream], [:], [:], [ -#if defined HAVE_ST_H -# include -#endif - ]) - AC_CHECK_MEMBERS([struct st_soundstream.info], [:], [:], [ -#if defined HAVE_ST_H -# include -#endif - ]) - AC_CHECK_MEMBERS([struct st_soundstream.signal], [:], [:], [ -#if defined HAVE_ST_H -# include -#endif - ]) - - ## evaluating the results - if test "$ac_cv_member_struct_st_soundstream_info" = "yes"; then - AC_DEFINE([MEMBER_STRUCT_ST_SOUNDSTREAM_INFO], [1], - [Whether we have the `info' slot]) - fi - if test "$ac_cv_member_struct_st_soundstream_signal" = "yes"; then - AC_DEFINE([MEMBER_STRUCT_ST_SOUNDSTREAM_SIGNAL], [1], - [Whether we have the `signal' slot]) - fi - ## the new structs AC_CHECK_TYPES([sox_format_t], [:], [:], [ #ifdef HAVE_SOX_H @@ -773,12 +654,12 @@ AC_DEFUN([SXE_CHECK_SOX_STRUCTS], [dnl # include #endif ]) - AC_CHECK_TYPES([struct sox_format], [:], [:], [ + AC_CHECK_TYPES([struct sox_format_t], [:], [:], [ #ifdef HAVE_SOX_H # include #endif ]) - AC_CHECK_MEMBERS([struct sox_format.signal], [:], [:], [ + AC_CHECK_MEMBERS([struct sox_format_t.signal], [:], [:], [ #ifdef HAVE_SOX_H # include #endif @@ -848,7 +729,7 @@ AC_DEFUN([SXE_MM_CHECK_OSS], [ SXE_DUMP_LIBS MM_FAIL SXE_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h linux/soundcard.h soundcard.h]) - if test "$ac_cv_header_linux_soundcard_h"="yes" -o \ + if test "$ac_cv_header_linux_soundcard_h"="yes" -o \ "$ac_cv_header_machine_soundcard_h"="yes" -o \ "$ac_cv_header_soundcard_h"="yes" -o \ "$ac_cv_header_sys_soundcard_h"="yes" @@ -863,11 +744,11 @@ AC_DEFUN([SXE_MM_CHECK_OSS], [ #else #include #endif -]], +]], [[ ioctl(0, SNDCTL_DSP_RESET, 0); ]])], - [oss_ioctl_linked=yes], - [oss_ioctl_linked=no]) - if test "${oss_ioctl_linked}" = "no" + [oss_ioctl_linked=yes], + [oss_ioctl_linked=no]) + if test "${oss_ioctl_linked}" = "no" then if test "${opsys}" = "netbsd" then @@ -894,22 +775,7 @@ AC_DEFUN([SXE_MM_CHECK_PULSE], [ ## arg #1: action on success ## arg #2: action on failure - PULSE_REQUIRED_VERSION=0.9.3 - _SXE_MM_CHECK_pkgconfig_based(dnl - [pulse], [libpulse], [$PULSE_REQUIRED_VERSION], [dnl - pa_mainloop_new pa_threaded_mainloop_new pa_mainloop_iterate dnl - pa_threaded_mainloop_lock pa_threaded_mainloop_unlock dnl - pa_mainloop_get_api pa_threaded_mainloop_get_api dnl - pa_mainloop_free pa_threaded_mainloop_free dnl - pa_threaded_mainloop_stop dnl - pa_context_new pa_context_get_state pa_context_is_pending dnl - pa_context_disconnect dnl - pa_operation_unref dnl - pa_stream_new pa_stream_get_state pa_stream_write dnl - pa_stream_set_state_callback pa_stream_set_write_callback dnl - pa_stream_unref pa_stream_connect_playback pa_stream_disconnect dnl - pa_stream_cork], - [pulse/pulseaudio.h], [$1], [$2]) + PKG_CHECK_MODULES([PULSE], [libpulse >= 2.0.0], [$1], [$2]) ])dnl SXE_MM_CHECK_PULSE AC_DEFUN([SXE_MM_CHECK_JACK], [ @@ -934,58 +800,6 @@ AC_DEFUN([SXE_MM_CHECK_AO], [ ao_open_live ao_close ao_shutdown ao_play], [ao/ao.h], [$1], [$2]) ])dnl SXE_MM_CHECK_AO -AC_DEFUN([SXE_MM_CHECK_ARTS], [ - ## arg #1: action on success - ## arg #2: action on failure - pushdef([MM_SUCC], [$1]) - pushdef([MM_FAIL], [$2]) - - SXE_SEARCH_CONFIG_PROG([artsc-config]) - - AC_MSG_CHECKING([for aRts support]) - AC_MSG_RESULT([]) - - if test "$have_artsc_config" = "no" -o -z "$ARTSC_CONFIG"; then - AS_MESSAGE([*** artsc-config not found.]) - AS_MESSAGE([*** Cannot check for aRts.]) - have_artsc_config=no - ARTSC_CONFIG= - MM_FAIL - fi - - if test "$have_artsc_config" = "yes"; then - ARTS_VERSION=`$ARTSC_CONFIG --arts-version` - ARTS_MAJOR_VERSION=`echo $ARTS_VERSION | awk -F. '{print $1}'` - ARTS_MINOR_VERSION=`echo $ARTS_VERSION | awk -F. '{print $2}'` - - dnl since we are not using most of the arts features, it suffices - dnl to have a version 1.x (x >= 0) - dnl if test "$ARTS_MAJOR_VERSION" -eq 1 -a \ - dnl "$ARTS_MINOR_VERSION" -ge 0; then - - SXE_DUMP_LIBS - ARTS_CPPFLAGS="`$ARTSC_CONFIG --cflags`" - ARTS_LDFLAGS="-L`$ARTSC_CONFIG --libs`" - CPPFLAGS="$CPPFLAGS $ARTS_CPPFLAGS" - LDFLAGS="$CPPFLAGS $ARTS_LDFLAGS" - - MM_SUCC - SXE_CHECK_HEADERS([artsc.h], [:], [MM_FAIL]) - AC_CHECK_LIB([artsc], [arts_init], [:], [MM_FAIL], [$arts_libs]) - AC_CHECK_LIB([artsc], [arts_free], [:], [MM_FAIL], [$arts_libs]) - AC_CHECK_LIB([artsc], [arts_write], [:], [MM_FAIL], [$arts_libs]) - AC_CHECK_LIB([artsc], [arts_play_stream], [:], [MM_FAIL], [$arts_libs]) - AC_CHECK_LIB([artsc], [arts_stream_set], [:], [MM_FAIL], [$arts_libs]) - AC_CHECK_LIB([artsc], [arts_close_stream], [:], [MM_FAIL], [$arts_libs]) - - ## restore anything - SXE_RESTORE_LIBS - fi - - popdef([MM_SUCC]) - popdef([MM_FAIL]) -])dnl SXE_MM_CHECK_ARTS - AC_DEFUN([SXE_MM_CHECK_ESD], [ ## arg #1: action on success ## arg #2: action on failure @@ -1009,7 +823,7 @@ AC_DEFUN([SXE_MM_CHECK_ESD], [ SXE_DUMP_LIBS ESD_CPPFLAGS="`$ESD_CONFIG --cflags`" ESD_LDFLAGS="-L`$ESD_CONFIG --libs`" - dnl SXE_APPEND([$esd_c_switch], [c_switch_site]) + dnl SXE_APPEND_UNDUP([$esd_c_switch], [c_switch_site]) dnl SXE_PREPEND([$esd_libs], [LIBS]) CPPFLAGS="$CPPFLAGS $ESD_CPPFLAGS" LDFLAGS="$LDFLAGS $ESD_LDFLAGS" @@ -1156,7 +970,7 @@ AC_DEFUN([SXE_CHECK_ALSA_VERSION], [dnl # include #endif -int main(int c, char *v[]) +int main(int c, char *v[]) { fprintf(stdout, SND_LIB_VERSION_STR); return 0; @@ -1170,7 +984,7 @@ int main(int c, char *v[]) AC_MSG_WARN([Your ALSA version is _KNOWN_ to fail! Do not say we have not warned you!]) sxe_mm_alsa_version_supported_p="no" ;; - 1.0.2 | 1.0.4* | 1.0.5* | 1.0.6* | 1.0.7* | 1.0.8* ) + 1.0.2 | 1.0.4* | 1.0.5* | 1.0.6* | 1.0.7* | 1.0.8* ) AC_MSG_RESULT([${sxe_mm_alsa_version} (suspicious to break)]) AC_MSG_WARN([Your ALSA version has not been tested. Do not be surprised if it fails!]) sxe_mm_alsa_version_supported_p="no"