comparison configure @ 20112:5deee6e61057

Fix DirectFB version check. The old code simply concatenated the digits, so 1.0.0 was considered older than 0.9.XY.
author syrjala
date Sun, 08 Oct 2006 22:16:38 +0000
parents 8833560dba2f
children a3959dc972eb
comparison
equal deleted inserted replaced
20111:b6042b4c91ce 20112:5deee6e61057
3757 _inc_extra="$_inc_extra $_inc_tmp" && break 3757 _inc_extra="$_inc_extra $_inc_tmp" && break
3758 done 3758 done
3759 fi 3759 fi
3760 fi 3760 fi
3761 3761
3762 dfb_version() {
3763 expr $1 \* 65536 + $2 \* 256 + $3
3764 }
3765
3762 if test "$_directfb" = yes; then 3766 if test "$_directfb" = yes; then
3763 cat > $TMPC << EOF 3767 cat > $TMPC << EOF
3764 #include <directfb_version.h> 3768 #include <directfb_version.h>
3765 int 3769 int
3766 dfb_ver = DIRECTFB_MAJOR_VERSION DIRECTFB_MINOR_VERSION DIRECTFB_MICRO_VERSION 3770 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3767 ; 3771 ;
3768 EOF 3772 EOF
3769 if $_cc -E $TMPC $_inc_extra > "$TMPO"; then 3773 if $_cc -E $TMPC $_inc_extra > "$TMPO"; then
3770 _directfb_version=`sed -n 's/^dfb_ver[^1-9]*\(.*\)/\1/p' "$TMPO" | tr -d '() '` 3774 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPO" | tr -d '()'`
3771 _def_directfb_version="#define DIRECTFBVERSION $_directfb_version" 3775 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3772 if test "$_directfb_version" -ge 913; then 3776 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3777 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3778 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
3779 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
3780 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3773 _res_comment="$_directfb_version" 3781 _res_comment="$_directfb_version"
3774 else 3782 else
3775 _def_directfb_version='#undef DIRECTFBVERSION' 3783 _def_directfb_version='#undef DIRECTFBVERSION'
3776 _directfb=no 3784 _directfb=no
3777 _res_comment="version >=0.9.13 required" 3785 _res_comment="version >=0.9.13 required"
3783 fi 3791 fi
3784 echores "$_directfb" 3792 echores "$_directfb"
3785 3793
3786 if test "$_directfb" = yes ; then 3794 if test "$_directfb" = yes ; then
3787 _def_directfb='#define HAVE_DIRECTFB 1' 3795 _def_directfb='#define HAVE_DIRECTFB 1'
3788 if test "$_directfb_version" -ge 913; then 3796 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
3789 _vosrc="$_vosrc vo_directfb2.c" 3797 _vosrc="$_vosrc vo_directfb2.c"
3790 _vomodules="directfb $_vomodules" 3798 _vomodules="directfb $_vomodules"
3791 _ld_directfb='-ldirectfb' 3799 _ld_directfb='-ldirectfb'
3792 fi 3800 fi
3793 3801
3794 if test "$_directfb_version" -ge 915; then 3802 if test "$_dfb_version" -ge $(dfb_version 0 9 15); then
3795 _vosrc="$_vosrc vo_dfbmga.c" 3803 _vosrc="$_vosrc vo_dfbmga.c"
3796 _vomodules="dfbmga $_vomodules" 3804 _vomodules="dfbmga $_vomodules"
3797 fi 3805 fi
3798 else 3806 else
3799 _def_directfb='#undef HAVE_DIRECTFB' 3807 _def_directfb='#undef HAVE_DIRECTFB'