Index: configure =================================================================== --- configure (revision 21704) +++ configure (working copy) @@ -429,6 +429,7 @@ --with-extralibdir=DIR extra linker search paths in DIR (*) --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA) + --with-directfb-config=PATH path to directfb-config --with-freetype-config=PATH path to freetype-config --with-fribidi-config=PATH path to fribidi-config --with-glib-config=PATH path to glib*-config @@ -1738,6 +1739,7 @@ _macosx_finder_support=no _macosx_bundle=auto _sortsub=yes +_directfbconfig='directfb-config' _freetypeconfig='freetype-config' _fribidi=auto _fribidiconfig='fribidi-config' @@ -2173,6 +2175,9 @@ --with-sdl-config=*) _sdlconfig=`echo $ac_option | cut -d '=' -f 2` ;; + --with-directfb-config=*) + _directfbconfig=`echo $ac_option | cut -d '=' -f 2` + ;; --with-freetype-config=*) _freetypeconfig=`echo $ac_option | cut -d '=' -f 2` ;; @@ -3742,63 +3747,50 @@ echores "$_tga" +dfb_version() { + expr $1 \* 65536 + $2 \* 256 + $3 +} + echocheck "DirectFB" -if test "$_directfb" = auto ; then +if test "$_directfb" = auto || test "$_directfb" = yes ; then _directfb=no cat > $TMPC < int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; } EOF - for _inc_tmp in "" -I/usr/local/include/directfb \ - -I/usr/include/directfb -I/usr/local/include -I/usr/include; do - cc_check $_inc_tmp -ldirectfb && _directfb=yes && \ - _inc_extra="$_inc_extra $_inc_tmp" && break - done -fi - -dfb_version() { - expr $1 \* 65536 + $2 \* 256 + $3 -} - -if test "$_directfb" = yes; then - cat > $TMPC << EOF -#include -int -dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION -; -EOF - if $_cc -E $TMPC $_inc_extra > "$TMPO"; then - _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPO" | 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 13`; 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.13 required" - fi - else - _directfb=no - _res_comment="failed to get version" + if "$_directfbconfig" --version >>"$TMPLOG" 2>&1 ; then + if cc_check `$_directfbconfig --cflags` `$_directfbconfig --libs` >>"$TMPLOG" 2>&1 ; then + _directfbversion=`$_directfbconfig --version | sed 's/[^0-9]//g'` + if test "$_directfbversion" -gt 0913 ; then + _directfb=yes + _dfb_vers=`$_directfbconfig --version` + _dfb_major=`echo $_dfb_vers | cut -d . -f 1` + _dfb_minor=`echo $_dfb_vers | cut -d . -f 2` + _dfb_micro=`echo $_dfb_vers | cut -d . -f 3` + _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro` + _def_directfb_version="#define DIRECTFBVERSION $_dfb_version" + _res_comment="$_directfb_version" + else + _def_directfb_version='#undef DIRECTFBVERSION' + _res_comment="version >=0.9.13 required" + fi + fi fi fi echores "$_directfb" if test "$_directfb" = yes ; then _def_directfb='#define HAVE_DIRECTFB 1' - if test "$_dfb_version" -ge `dfb_version 0 9 13`; then + if test "$_directfbversion" -ge 0913; then _vosrc="$_vosrc vo_directfb2.c" _vomodules="directfb $_vomodules" - _libs_mplayer="$_libs_mplayer -ldirectfb" + _libs_mplayer="$_libs_mplayer `$_directfbconfig --libs`" + _inc_extra="$_inc_extra `$_directfbconfig --cflags | sed s/-D_GNU_SOURCE//`" else _novomodules="directfb $_novomodules" fi - if test "$_dfb_version" -ge `dfb_version 0 9 15`; then + if test "$_directfbversion" -ge 0915; then _vosrc="$_vosrc vo_dfbmga.c" _vomodules="dfbmga $_vomodules" _def_dfbmga='#define HAVE_DFBMGA 1'