From 1b45e30404d2f19d973014a4a96958cf188790b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADctor=20Paesa?= <wzrlpy@arsystel.com>
Date: Mon, 5 Feb 2007 17:03:03 +0000
Subject: [PATCH] =?UTF-8?q?Remove=20hardcoded=20dependency=20of=20imlib2?=
 =?UTF-8?q?=20on=20Xlib.=20patch=20by=20V=C3=ADctor=20Paesa,=20wzrlpy=20ar?=
 =?UTF-8?q?systel=20com?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Originally committed as revision 7829 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 configure      | 6 ++++--
 vhook/Makefile | 3 ++-
 vhook/imlib2.c | 1 -
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 9234fc00097..b03601602f4 100755
--- a/configure
+++ b/configure
@@ -1668,13 +1668,15 @@ fi
 ##########################################
 # imlib check
 
-temp_extralibs -lImlib2
+if (imlib2-config --version) >/dev/null 2>&1 ; then
+    temp_cflags `imlib2-config --cflags`
+    temp_extralibs `imlib2-config --libs`
 check_ld <<EOF && imlib2=yes || imlib2=no
-#include <X11/Xlib.h>
 #include <Imlib2.h>
 int main( void ) { return (int) imlib_load_font("foo"); }
 EOF
 restore_flags
+fi
 
 ##########################################
 # FreeType check
diff --git a/vhook/Makefile b/vhook/Makefile
index 06b48935e01..e7a103bb661 100644
--- a/vhook/Makefile
+++ b/vhook/Makefile
@@ -11,7 +11,8 @@ ALLHOOKS=$(HOOKS) imlib2$(SLIBSUF) drawtext$(SLIBSUF)
 
 ifeq ($(HAVE_IMLIB2),yes)
     HOOKS += imlib2$(SLIBSUF)
-    LIBS_imlib2$(SLIBSUF) = -lImlib2
+    CFLAGS += `imlib2-config --cflags`
+    LIBS_imlib2$(SLIBSUF) = `imlib2-config --libs`
 endif
 
 ifeq ($(HAVE_FREETYPE2),yes)
diff --git a/vhook/imlib2.c b/vhook/imlib2.c
index 87c54cf0bf6..1c137724f5b 100644
--- a/vhook/imlib2.c
+++ b/vhook/imlib2.c
@@ -103,7 +103,6 @@
 #undef time
 #include <sys/time.h>
 #include <time.h>
-#include <X11/Xlib.h>
 #include <Imlib2.h>
 #include "eval.h"
 
-- 
GitLab