1 dnl Copyright © 2010, 2014 Nick Bowler
3 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 dnl This is free software: you are free to do what the fuck you want to.
5 dnl There is NO WARRANTY, to the extent permitted by law.])
7 dnl _DX_LIBAVRESAMPLE_TEST_PROGRAM(major, minor, micro)
8 AC_DEFUN([_DX_LIBAVRESAMPLE_TEST_PROGRAM], [AC_LANG_PROGRAM([dnl
9 #include <libavresample/avresample.h>
10 ifelse([$1], [], [], [dnl
11 #if LIBAVRESAMPLE_VERSION_MAJOR < $1
12 # error libavresample version too low
14 ifelse([$2], [], [], [dnl
15 #elif LIBAVRESAMPLE_VERSION_MAJOR == $1
16 # if LIBAVRESAMPLE_VERSION_MINOR < $2
17 # error libavresample version too low
19 ifelse([$3], [], [], [dnl
20 # elif LIBAVRESAMPLE_VERSION_MINOR == $2
21 # if LIBAVRESAMPLE_VERSION_MICRO < $3
22 # error libavresample version too low
34 dnl DX_CHECK_LIBAVRESAMPLE([min-version], [action-if-ok], [action-if-fail])
35 AC_DEFUN([DX_CHECK_LIBAVRESAMPLE],
36 [DX_PKG_CONFIG([avresample], [libavresample], [libavresample])
38 DX_CHECK_LIB([avresample],
39 [for libavresample[]ifelse([$1], [], [], [ version at least $1])],
40 [m4_apply([_DX_LIBAVRESAMPLE_TEST_PROGRAM], m4_split([$1], [\.]))], [dnl
41 [[$AVRESAMPLE_CFLAGS], [$AVRESAMPLE_LIBS]],
42 [[$pkg_cv_avresample_cflags], [$pkg_cv_avresample_libs],
43 [test ! x"$pkg_failed" = x"yes"]],
47 if test x"$dx_cv_avresample_found" = x"yes"; then
48 ifelse([$2], [], [:], [$2])
50 ifelse([$3], [], [AC_MSG_FAILURE([dnl
51 libavresample[]ifelse([$1], [], [], [ version at least $1]) is required.
52 The latest version can be obtained from http://ffmpeg.org/download.html
54 If libavresample is installed but was not found by this configure script,
55 consider adjusting AVRESAMPLE_CFLAGS and/or AVRESAMPLE_LIBS as necessary.
57 If pkg-config is installed, it may help to adjust PKG_CONFIG_PATH
58 if libavresample is installed in a non-standard prefix.