[MPlayer-cvslog] r32252 - in trunk: configure libvo/vo_dfbmga.c libvo/vo_directfb2.c

diego subversion at mplayerhq.hu
Wed Sep 15 19:22:04 CEST 2010


Author: diego
Date: Wed Sep 15 19:22:04 2010
New Revision: 32252

Log:
Simplify DirectFB check.

Modified:
   trunk/configure
   trunk/libvo/vo_dfbmga.c
   trunk/libvo/vo_directfb2.c

Modified: trunk/configure
==============================================================================
--- trunk/configure	Wed Sep 15 17:58:48 2010	(r32251)
+++ trunk/configure	Wed Sep 15 19:22:04 2010	(r32252)
@@ -4258,44 +4258,19 @@ echores "$_bl"
 echocheck "DirectFB"
 if test "$_directfb" = auto ; then
   _directfb=no
-  for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
-    function_check directfb.h 'DirectFBInit(0, 0)' $_inc_tmp -ldirectfb &&
-      _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
-  done
-fi
-
-dfb_version() {
-  expr $1 \* 65536 + $2 \* 256 + $3
-}
-
-if test "$_directfb" = yes; then
   cat > $TMPC << EOF
+#include <directfb.h>
 #include <directfb_version.h>
-int
-dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
-;
+#if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 15)
+#error "DirectFB version too old."
+#endif
+int main(void) { DirectFBInit(0, 0); return 0; }
 EOF
-  if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
-    _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
-    _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
-    _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
-    _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
-    _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
-    if test "$_dfb_version" -ge $(dfb_version 0 9 15); then
-      def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
-      res_comment="$_directfb_version"
-    else
-      def_directfb_version='#undef DIRECTFBVERSION'
-      _directfb=no
-      res_comment="version >=0.9.15 required"
-    fi
-  else
-    _directfb=no
-    res_comment="failed to get version"
-  fi
+  for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
+    cc_check $_inc_tmp -ldirectfb &&
+      _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
+  done
 fi
-echores "$_directfb"
-
 if test "$_directfb" = yes ; then
   def_directfb='#define CONFIG_DIRECTFB 1'
   vomodules="directfb dfbmga $vomodules"
@@ -4304,6 +4279,7 @@ else
   def_directfb='#undef CONFIG_DIRECTFB'
   novomodules="directfb dfbmga $novomodules"
 fi
+echores "$_directfb"
 
 
 echocheck "X11 headers presence"
@@ -8810,7 +8786,6 @@ $def_dga1
 $def_dga2
 $def_direct3d
 $def_directfb
-$def_directfb_version
 $def_directx
 $def_dvb
 $def_dvbin

Modified: trunk/libvo/vo_dfbmga.c
==============================================================================
--- trunk/libvo/vo_dfbmga.c	Wed Sep 15 17:58:48 2010	(r32251)
+++ trunk/libvo/vo_dfbmga.c	Wed Sep 15 19:22:04 2010	(r32252)
@@ -23,8 +23,10 @@
 
 /* directfb includes */
 #include <directfb.h>
+#include <directfb_version.h>
 
 #define DFB_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c))
+#define DIRECTFBVERSION DFB_VERSION(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
 
 /* other things */
 #include <stdio.h>

Modified: trunk/libvo/vo_directfb2.c
==============================================================================
--- trunk/libvo/vo_directfb2.c	Wed Sep 15 17:58:48 2010	(r32251)
+++ trunk/libvo/vo_directfb2.c	Wed Sep 15 19:22:04 2010	(r32252)
@@ -25,8 +25,10 @@
 // directfb includes
 
 #include <directfb.h>
+#include <directfb_version.h>
 
 #define DFB_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c))
+#define DIRECTFBVERSION DFB_VERSION(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
 
 // other things
 


More information about the MPlayer-cvslog mailing list