[FFmpeg-cvslog] configure: add LIBDRM to extralibs_avutil

Giulio Benetti git at videolan.org
Wed Sep 12 00:34:07 EEST 2018

ffmpeg | branch: release/3.4 | Giulio Benetti <giulio.benetti at micronovasrl.com> | Tue Sep 11 22:29:32 2018 +0200| [c50dc77ac708e98d02da7c422a6b9cbf9f565aa5] | committer: James Almer

configure: add LIBDRM to extralibs_avutil

When static linking programs using ffmpeg libraries, if linking against
libavutil, -ldrm is listed before -lavutil. This leads to linking failure
due to undefined reference of drmGetVersion() and drmFreeVersion().
This is why when pkg-config create libavutil.pc doesn't append -ldrm
after -lavutil.

Create LIBDRM=-ldrm in case libdrm is enabled and add $LIBDRM to

Signed-off-by: Giulio Benetti <giulio.benetti at micronovasrl.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c50dc77ac708e98d02da7c422a6b9cbf9f565aa5

 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 7377046d0a..9fe7760822 100755
--- a/configure
+++ b/configure
@@ -5919,7 +5919,7 @@ enabled libcelt           && require libcelt celt/celt.h celt_decode -lcelt0 &&
                                die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
 enabled libcaca           && require_pkg_config libcaca caca caca.h caca_create_canvas
 enabled libdc1394         && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
-enabled libdrm            && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
+enabled libdrm            && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion && LIBDRM="-ldrm"
 enabled libfdk_aac        && { use_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
                                { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
                                  warn "using libfdk without pkg-config"; } }
@@ -7096,7 +7096,7 @@ source_path=${source_path}
-extralibs_avutil="$LIBRT $LIBM"
+extralibs_avutil="$LIBRT $LIBDRM $LIBM"

More information about the ffmpeg-cvslog mailing list