[FFmpeg-devel] [PATCH] configure: try to use pkg-config to find libopenjpeg

Johannes Nixdorf mixi at shadowice.org
Sun Dec 16 19:55:15 CET 2012

With this patch configure actually fails if openjpeg isn't found.
-------------- next part --------------
>From 9f06ff99490aea3111829c30ca088786dfe74530 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: try to use pkg-config to find libopenjpeg

Beginning with version 1.5.1 openjpeg defaults to install its headers to
/usr/include/openjpeg-${major}.${minor} instead of /usr/include making
the old test fail.
Instead of guessing the openjpeg major and minor versions we use
pkg-config for newer openjpeg versions.
For older versions (<1.4.0) we continue to use the old test as the .pc
file was added in version 1.4.0 and ffmpeg still works for these versions.
 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index a50d073..e1e24f6 100755
--- a/configure
+++ b/configure
@@ -3837,7 +3837,11 @@ 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_pkg_config libopenjpeg openjpeg.h opj_version &&
+                           add_cflags $libopenjpeg_cflags &&
+                           add_extralibs $libopenjpeg_libs; } ||
+                         check_lib libopenjpeg openjpeg.h opj_version -lopenjpeg ||
+                         die "ERROR: libopenjpeg not found"; }
 enabled libopus    && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
 enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
 enabled librtmp    && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket

More information about the ffmpeg-devel mailing list