summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
Diffstat (limited to 'wscript')
-rw-r--r--wscript91
1 files changed, 52 insertions, 39 deletions
diff --git a/wscript b/wscript
index 0986f8dc40..81a048df5d 100644
--- a/wscript
+++ b/wscript
@@ -386,55 +386,68 @@ iconv support use --disable-iconv.",
}
]
-# Libav 12:
-# libavutil 55.20.0
-# libavcodec 57.25.0
-# libavformat 57.7.2
-# libswscale 4.0.0
-# libavfilter 6.7.0
-# libavresample 3.0.0
-# FFmpeg 3.2.2:
-# libavutil 55.34.100
-# libavcodec 57.64.101
-# libavformat 57.56.100
-# libswscale 4.2.100
-# libavfilter 6.65.100
-# libswresample 2.3.100
-
+ffmpeg_version = "3.2.2"
+ffmpeg_pkg_config_checks = [
+ 'libavutil', '>= 55.34.100',
+ 'libavcodec', '>= 57.64.100',
+ 'libavformat', '>= 57.56.100',
+ 'libswscale', '>= 4.2.100',
+ 'libavfilter', '>= 6.65.100',
+ 'libswresample', '>= 2.3.100',
+]
+libav_version = "12"
libav_pkg_config_checks = [
- 'libavutil', '>= 55.20.0',
- 'libavcodec', '>= 57.25.0',
- 'libavformat', '>= 57.07.0',
- 'libswscale', '>= 4.0.0',
- 'libavfilter', '>= 6.7.0',
+ 'libavutil', '>= 55.20.0',
+ 'libavcodec', '>= 57.25.0',
+ 'libavformat', '>= 57.7.0',
+ 'libswscale', '>= 4.0.0',
+ 'libavfilter', '>= 6.7.0',
+ 'libavresample', '>= 3.0.0',
]
-libav_versions_string = "FFmpeg 3.2.2 or Libav 12"
+
+libav_versions_string = "FFmpeg %s or Libav %s" % (ffmpeg_version, libav_version)
+
+def check_ffmpeg_or_libav_versions():
+ def fn(ctx, dependency_identifier, **kw):
+ versions = ffmpeg_pkg_config_checks
+ if ctx.dependency_satisfied('is_libav'):
+ versions = libav_pkg_config_checks
+ return check_pkg_config(*versions)(ctx, dependency_identifier, **kw)
+ return fn
libav_dependencies = [
{
+ 'name': 'libavcodec',
+ 'desc': 'FFmpeg/Libav present',
+ 'func': check_pkg_config('libavcodec'),
+ 'req': True,
+ 'fmsg': "FFmpeg/Libav development files not found.",
+ }, {
+ 'name': 'is_ffmpeg',
+ 'desc': 'libav* is FFmpeg',
+ # FFmpeg <=> LIBAVUTIL_VERSION_MICRO>=100
+ 'func': check_statement('libavcodec/version.h',
+ 'int x[LIBAVCODEC_VERSION_MICRO >= 100 ? 1 : -1]',
+ use='libavcodec')
+ }, {
+ # This check should always result in the opposite of is_ffmpeg.
+ # Run it to make sure is_ffmpeg didn't fail for some other reason than
+ # the actual version check.
+ 'name': 'is_libav',
+ 'desc': 'libav* is Libav',
+ # FFmpeg <=> LIBAVUTIL_VERSION_MICRO>=100
+ 'func': check_statement('libavcodec/version.h',
+ 'int x[LIBAVCODEC_VERSION_MICRO >= 100 ? -1 : 1]',
+ use='libavcodec')
+ }, {
'name': 'libav',
- 'desc': 'libav/ffmpeg',
- 'func': check_pkg_config(*libav_pkg_config_checks),
+ 'desc': 'Libav/FFmpeg library versions',
+ 'deps_any': [ 'is_ffmpeg', 'is_libav' ],
+ 'func': check_ffmpeg_or_libav_versions(),
'req': True,
'fmsg': "Unable to find development files for some of the required \
FFmpeg/Libav libraries. You need at least {0}. Aborting.".format(libav_versions_string)
}, {
- 'name': '--libswresample',
- 'desc': 'libswresample',
- 'func': check_pkg_config('libswresample', '>= 2.3.100'),
- }, {
- 'name': '--libavresample',
- 'desc': 'libavresample',
- 'func': check_pkg_config('libavresample', '>= 3.0.0'),
- 'deps_neg': ['libswresample'],
- }, {
- 'name': 'resampler',
- 'desc': 'usable resampler found',
- 'deps_any': [ 'libavresample', 'libswresample' ],
- 'func': check_true,
- 'req': True,
- 'fmsg': 'No resampler found. Install libavresample or libswresample (FFmpeg).'
- }, {
'name': '--libavdevice',
'desc': 'libavdevice',
'func': check_pkg_config('libavdevice', '>= 57.0.0'),