changeset 16801:55b28be7a0e6

modify DirectFB version detection so that it only requires pre-processing
author aurel
date Tue, 18 Oct 2005 21:37:28 +0000
parents 3e8a61c10b47
children a356a606bd66
files configure
diffstat 1 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Tue Oct 18 21:34:54 2005 +0000
+++ b/configure	Tue Oct 18 21:37:28 2005 +0000
@@ -3454,21 +3454,20 @@
   _directfb=no
   cat > $TMPC <<EOF
 #include <directfb.h>
-int main(void) { IDirectFB *foo; return 0; }
+int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
 EOF
   linux && test -c /dev/fb0 && cc_check $_inc_directfb -ldirectfb && _directfb=yes
 fi
 
 if test "$_directfb" = yes; then
-cat > $TMPC <<EOF
-#include <directfb.h>
-int main(void) { 
-  printf ("%i",(directfb_major_version*100+directfb_minor_version)*100+directfb_micro_version);
-  return 0; 
-}
-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"