]> git.draconx.ca Git - pcm-dplii.git/blob - m4/libavresample.m4
Initial commit
[pcm-dplii.git] / m4 / libavresample.m4
1 dnl Copyright © 2010, 2014 Nick Bowler
2 dnl
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.])
6
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
13 int fail[-1];
14 ifelse([$2], [], [], [dnl
15 #elif LIBAVRESAMPLE_VERSION_MAJOR == $1
16 #  if LIBAVRESAMPLE_VERSION_MINOR < $2
17 #    error libavresample version too low
18 int fail[-1];
19 ifelse([$3], [], [], [dnl
20 #  elif LIBAVRESAMPLE_VERSION_MINOR == $2
21 #    if LIBAVRESAMPLE_VERSION_MICRO < $3
22 #      error libavresample version too low
23 int x[-1];
24 #    endif
25 ])dnl
26 #  endif
27 ])dnl
28 #endif
29 ])dnl
30 ], [dnl
31 avresample_license();
32 ])])
33
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])
37
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"]],
44                 [[], [-lavresample]],
45                 ])
46
47 if test x"$dx_cv_avresample_found" = x"yes"; then
48         ifelse([$2], [], [:], [$2])
49 else
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
53
54 If libavresample is installed but was not found by this configure script,
55 consider adjusting AVRESAMPLE_CFLAGS and/or AVRESAMPLE_LIBS as necessary.
56
57 If pkg-config is installed, it may help to adjust PKG_CONFIG_PATH
58 if libavresample is installed in a non-standard prefix.
59 ])], [$3])
60 fi
61 ])