[FFmpeg-devel] [PATCH] configure: use pkg-config to check for libopenjpeg

Michael Niedermayer michaelni at gmx.at
Sat Dec 22 03:33:37 CET 2012


On Mon, Dec 17, 2012 at 03:20:48PM +0100, Johannes Nixdorf wrote:
> On Sun, Dec 16, 2012 at 10:41:38PM +0000, Carl Eugen Hoyos wrote:
> > Afair in the past two different locations were 
> > possible depending on the chosen build system.
> > (make and cmake installed the headers in different 
> > locations.)
> 
> I just tested all combinations of version 1.5.0 and 1.5.1 with cmake and
> autotools. They all install the header to
> /usr/include/openjpeg-${major}.${minor}. 1.5.0 with autotools apparently
> still creates a compatibility symlink. This behaviour is removed in
> version 1.5.1.
> 
> > Ok (I did not know that my symlinks were added 
> > by opensuse).
> 
> I only checked what openSUSE did with version 1.5.1 in factory.
> Apparently the link I mentioned was created by openjpeg for older
> versions. The other link (/usr/include/openjpeg) always comes from
> openSUSE.
> 
> > (The bug was that - in the past? - two locations for 
> > openjpeg.h were possible with the original source package.)
> 
> The bug seems to be fixed and they seem to have decided not to provide
> /usr/include/openjpeg.h
> 
> > $ ll /usr/include/openjpeg
> > /usr/include/openjpeg -> openjpeg-1.5
> 
> Apparently openSUSE provided this link for openjpeg 1.5.0 and stopped
> providing it for openjpeg 1.5.1, so I don't think anyone should rely on
> it.
> 
> > Then please check for /usr/include/openjpeg.h and 
> > /usr/include/openjpeg-1.5/openjpeg.h
> 
> I'm fine with that solution, but I'm not sure how I need to set the
> include path in configure if /usr/include/openjpeg-1.5/openjpeg.h is
> found so I don't break any obscure configurations. Is using
> add_cflags -I"$sysinclude"/openjpeg-1.5 enough or are there some obscure
> cases where other include directories are considered? In case it is
> enough the patch is included.
> 
> > I would expect that the pkg-config approach will brake some 
> > mingw installations that currently work with openjpeg.
> 
> They continue to work as the old location is still searched for
> compatibility with ancient openjpeg versions.
> 

>  configure |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 358651edf7467453925c74b39830b11cc0242a27  0001-configure-consider-using-usr-include-openjpeg-1.5-wh.patch
> From 03c3048ed598b6308a05032e4d7cf635ea3d171a Mon Sep 17 00:00:00 2001
> From: Johannes Nixdorf <mixi at exherbo.org>
> Date: Sun, 16 Dec 2012 16:02:08 +0100
> Subject: [PATCH] configure: consider using /usr/include/openjpeg-1.5 when
>  searching for openjpeg
> 
> Beginning with version 1.5.1 openjpeg defaults to install its headers to
> /usr/include/openjpeg-${major}.${minor} instead of /usr/include without
> providing a compatibility symlink making the old test fail.
> ---
>  configure | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index a50d073..f4da5bf 100755
> --- a/configure
> +++ b/configure
> @@ -3837,7 +3837,10 @@ enabled libnut     && require  libnut libnut.h nut_demuxer_init -lnut
>  enabled libopencore_amrnb  && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
>  enabled libopencore_amrwb  && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
>  enabled libopencv  && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
> -enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
> +enabled libopenjpeg && { { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg &&
> +                           add_cflags -I"$sysinclude"/openjpeg-1.5; } ||
> +                         check_lib openjpeg.h opj_version -lopenjpeg ||
> +                         die "ERROR: libopenjpeg not found"; }

I think a solution similar to what is done for ioctl_meteor.h
would be more robust unless i miss something

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121222/40dc6f79/attachment.asc>


More information about the ffmpeg-devel mailing list