[MPlayer-dev-eng] [PATCH] cross-compile: directfb version detection
Aurelien Jacobs
aurel at gnuage.org
Sat Oct 15 18:57:00 CEST 2005
On Thu, 13 Oct 2005 19:02:35 +0200
Diego Biurrun <diego at biurrun.de> wrote:
> On Wed, Oct 12, 2005 at 07:59:25PM +0200, Aurelien Jacobs wrote:
> > 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:
> > >
> > > > @@ -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.
>
> Yes, you should modify that test. Can't you just merge both tests into
> one?
Indeed you're right. I hadn't noticed the previous DirectFB check
few lines before. The only problem IMO is the this test didn't
contained any directfb symbol. It only used one typedef. So it
didn't really checked linking against directfb. I slightly improved the
test, and then I replaced the version check test by my own
pre-processor only check.
So here is the new patch which should adress your concern.
Is it ok ?
Aurel
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cross-dfb.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20051015/b5a563fe/attachment.txt>
More information about the MPlayer-dev-eng
mailing list