diff options
author | Clemens Lang <cal@macports.org> | 2017-08-13 21:17:18 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-08-14 10:25:07 +0300 |
commit | 15f24fef53a955c7c76fc966302cb0453732e657 (patch) | |
tree | 1b667af79b39412d37f4783638602581d6ed0e1f /ext | |
parent | 0b8f1f9e5454d545cabfd40bbf8220386eb122d2 (diff) | |
download | gstreamer-plugins-bad-15f24fef53a955c7c76fc966302cb0453732e657.tar.gz |
openjpeg: Fix build against openjpeg 2.2
OpenJPEG 2.2 has some API changes and thus ships its headers in a new
include path. Add a configure check (to both meson and autoconf) to
detect the newer version of OpenJPEG and add conditional includes.
Fix the autoconf test for OpenJPEG 2.1, which checked for HAVE_OPENJPEG,
which was always set even for 2.0.
https://bugzilla.gnome.org/show_bug.cgi?id=786250
Diffstat (limited to 'ext')
-rw-r--r-- | ext/openjpeg/gstopenjpeg.h | 4 | ||||
-rw-r--r-- | ext/openjpeg/meson.build | 21 |
2 files changed, 16 insertions, 9 deletions
diff --git a/ext/openjpeg/gstopenjpeg.h b/ext/openjpeg/gstopenjpeg.h index 03ce52e47..52410a4f7 100644 --- a/ext/openjpeg/gstopenjpeg.h +++ b/ext/openjpeg/gstopenjpeg.h @@ -38,7 +38,9 @@ #define OPJ_CPRL CPRL #else #include <stdio.h> -# ifdef HAVE_OPENJPEG_2_1 +# if defined(HAVE_OPENJPEG_2_2) +# include <openjpeg-2.2/openjpeg.h> +# elif defined(HAVE_OPENJPEG_2_1) # include <openjpeg-2.1/openjpeg.h> # else # include <openjpeg-2.0/openjpeg.h> diff --git a/ext/openjpeg/meson.build b/ext/openjpeg/meson.build index d60974ce7..e9c416c96 100644 --- a/ext/openjpeg/meson.build +++ b/ext/openjpeg/meson.build @@ -6,16 +6,21 @@ openjpeg_sources = [ openjpeg_cargs = [] -# Check for 2.1, then 2.0 -openjpeg_dep = dependency('libopenjp2', version : '>=2.1', required : false) +# Check for 2.2, 2.1, then 2.0 +openjpeg_dep = dependency('libopenjp2', version : '>=2.2', required : false) if openjpeg_dep.found() - openjpeg_cargs += ['-DHAVE_OPENJPEG_2_1'] + openjpeg_cargs += ['-DHAVE_OPENJPEG_2_2'] else - openjpeg_dep = dependency('libopenjp2', required : false) - # Fallback to 1.5 - if not openjpeg_dep.found() - openjpeg_dep = dependency('libopenjpeg1', required : false) - openjpeg_cargs += ['-DHAVE_OPENJPEG_1'] + openjpeg_dep = dependency('libopenjp2', version : '>=2.1', required : false) + if openjpeg_dep.found() + openjpeg_cargs += ['-DHAVE_OPENJPEG_2_1'] + else + openjpeg_dep = dependency('libopenjp2', required : false) + # Fallback to 1.5 + if not openjpeg_dep.found() + openjpeg_dep = dependency('libopenjpeg1', required : false) + openjpeg_cargs += ['-DHAVE_OPENJPEG_1'] + endif endif endif |