[MPlayer-dev-eng] [PATCH] directfb -> pkg-config
Enrico Weigelt
weigelt at metux.de
Mon Feb 13 05:04:01 CET 2006
Hi folks,
here's a little patch which lets us detect directfb via pkg-config.
It requires my previous one.
cu
--
"*Who am I*? I am Susan Ivanova, Commander, daughter of Andrei and Sophie
Ivanova. I am the right hand of vengeance, and the boot that is going
to kick your sorry ass all the way back to Earth... I am Death Incarnate,
and the last living thing that you are ever going to see. God sent me."
-- Cmdr. Ivanova
-------------- next part --------------
diff -ruN main.orig/configure main/configure
--- main.orig/configure Mon Feb 13 04:18:11 2006
+++ main/configure Mon Feb 13 04:23:16 2006
@@ -3551,82 +3551,39 @@
fi
echores "$_tga"
-echocheck "DirectFB headers presence"
-if test -z "$_inc_directfb" ; then
- for I in /usr/include /usr/local/include `echo $_inc_extra | sed s/-I//g`; do
- if test -d "$I/directfb" && test -f "$I/directfb/directfb.h" ; then
- _inc_directfb="-I$I/directfb"
- echores "yes (using $_inc_directfb)"
- break
- fi
- if test -d "$I" && test -f "$I/directfb.h" ; then
- _inc_directfb="-I$I"
- echores "yes (using $_inc_directfb)"
- break
- fi
- done
- if test -z "$_inc_directfb" ; then
- _directfb=no
- echores "not found"
- fi
-else
- echores "yes (using $_inc_directfb)"
-fi
-if test "$_inc_directfb" = "-I/usr/include" ; then
- _inc_directfb=""
-fi
-
+
+########################### IMPORT: DirectFB ###########################
echocheck "DirectFB"
-if test "$_directfb" = auto ; then
- _directfb=no
- cat > $TMPC <<EOF
-#include <directfb.h>
-int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
-EOF
- linux && test -c /dev/fb0 && cc_check $_inc_directfb -ldirectfb && _directfb=yes
-fi
-
-if test "$_directfb" = yes; then
- cat > $TMPC << EOF
-#include <directfb_version.h>
-int
-dfb_ver = DIRECTFB_MAJOR_VERSION DIRECTFB_MINOR_VERSION DIRECTFB_MICRO_VERSION
-;
-EOF
- if $_cc -E $TMPC $_inc_directfb > "$TMPO"; then
- _directfb_version=`sed -n 's/^dfb_ver[^1-9]*\(.*\)/\1/p' "$TMPO" | tr -d '() '`
- _def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
- if test "$_directfb_version" -ge 913; then
- _res_comment="$_directfb_version"
+if test -z "$_inc_directfb" ; then
+ if _directfbver=`$PKG_CONFIG --atleast-version=0.9.13 --modversion directfb` ; then
+ _directfb=yes
+ _inc_directfb=`$PKG_CONFIG directfb --cflags`
+ _ld_directfb=`$PKG_CONFIG directfb --libs`
+ _directfb_version=`echo "$_directfbver" | sed -e 's~\.~~g; s~^0*~~g;'`
+ _def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
+ echores "Version: $_directfbver"
+ echo "CFLAGS: $_inc_directfb"
+ echo "LDFLAGS: $_ld_directfb"
+ echo "DIRECTFBVERID=$_directfb_version"
+ _def_directfb='#define HAVE_DIRECTFB 1'
+ if test "$_directfb_version" -ge 913; then
+ _vosrc="$_vosrc vo_directfb2.c"
+ _vomodules="directfb $_vomodules"
+ fi
+ if test "$_directfb_version" -ge 915; then
+ _vosrc="$_vosrc vo_dfbmga.c"
+ _vomodules="dfbmga $_vomodules"
+ fi
else
- _def_directfb_version='#undef DIRECTFBVERSION'
- _directfb=no
- _res_comment="version >=0.9.13 required"
+ echores "not found"
+ _def_directfb_version='#undef DIRECTFBVERSION'
+ _directfb=no
+ _def_directfb='#undef HAVE_DIRECTFB'
+ _novomodules="directfb $_novomodules"
+ _inc_directfb=""
fi
- else
- _directfb=no
- _res_comment="failed to get version"
- fi
-fi
-echores "$_directfb"
-
-if test "$_directfb" = yes ; then
- _def_directfb='#define HAVE_DIRECTFB 1'
- if test "$_directfb_version" -ge 913; then
- _vosrc="$_vosrc vo_directfb2.c"
- _vomodules="directfb $_vomodules"
- _ld_directfb='-ldirectfb'
- fi
-
- if test "$_directfb_version" -ge 915; then
- _vosrc="$_vosrc vo_dfbmga.c"
- _vomodules="dfbmga $_vomodules"
- fi
-else
- _def_directfb='#undef HAVE_DIRECTFB'
- _novomodules="directfb $_novomodules"
- _inc_directfb=""
fi
+
echocheck "X11 headers presence"
More information about the MPlayer-dev-eng
mailing list