[MPlayer-dev-eng] [PATCH] cross-compile: directfb version detection

Aurelien Jacobs aurel at gnuage.org
Wed Oct 12 19:59:25 CEST 2005


On Wed, 12 Oct 2005 11:39:43 +0200
Diego Biurrun <diego at biurrun.de> wrote:

> On Mon, Oct 10, 2005 at 12:01:53AM +0200, Aurelien Jacobs wrote:
> > This is the third cross-compilation patch.
> > It changes the way the directfb version is detected so that it don't
> > need to run the generated binary.
> 
> This one looks wrong.
> 
> > @@ -3459,7 +3459,14 @@
> >  }
> >  EOF
> >    if cc_check $_inc_directfb -ldirectfb && "$TMPO" >> "$TMPLOG" ;
> >    then
> > -    _directfb_version=`"$TMPO"`
> > +   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"
> 
> There is a test for this very thing above, what about it?

The test above allows to verify if we can compile and link against
directfb, but we can't rely on it to detect the version, since we
can't assume we will be able to run the binary (remember we are
talking about cross-compiling ;-)
That's why I added a second test which use pre-processor only to
get version.
In fact, the first test could be modified as it don't need to
report the version anymore. But I think it is still a good test
to verify if directfb is available, so we can keep it as is.

> > @@ -3468,9 +3475,13 @@
> >  	_directfb=no
> >  	_res_comment="version >=0.9.13 required"
> >      fi
> > -  else
> > +   else
> 
> cosmetics

It sounds like. But it's not really...
In fact it's just a diff misbehavior. I did not removed the first "else",
I just introduced the second "else" before the first one. diff simply
considered that I removed the first "else" and that I reintroduced it
below :

> -  else
> [...]
> +  else

A hand written diff of what I really made would look like this :

@@ -3468,9 +3475,13 @@
 	_directfb=no
 	_res_comment="version >=0.9.13 required"
     fi
+   else
+    _directfb=no
+    _res_comment="failed to get version"
+   fi
   else
     _directfb=no
-    _res_comment="failed to get version"
+    _res_comment="failed to link with libdirectfb"
   fi
 fi
 echores "$_directfb"

Do you still want me to do some modifications on this patch ?

Aurel




More information about the MPlayer-dev-eng mailing list