configure: check for gtk version using pkg-config
authorHelmut Grohne <helmut@subdivi.de>
Mon, 27 May 2019 19:32:57 +0000 (21:32 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 27 May 2019 20:50:57 +0000 (14:50 -0600)
The previous way of running a program was incompatible with cross
compilation. The program is still being compiled as a sanity check, but
no longer run.

Signed-off-by: Helmut Grohne <helmut@subdivi.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
configure

index 82bd432..383175a 100755 (executable)
--- a/configure
+++ b/configure
@@ -1356,19 +1356,18 @@ if test "$?" != "0" ; then
   echo "configure: gtk and gthread not found"
   exit 1
 fi
-if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
-  $TMPE
-  if test "$?" = "0" ; then
+if ! ${cross_prefix}pkg-config --atleast-version 2.18.0 gtk+-2.0; then
+  echo "GTK found, but need version 2.18 or higher"
+  gfio="no"
+else
+  if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
     gfio="yes"
     GFIO_LIBS="$LIBS $GTK_LIBS"
     CFLAGS="$CFLAGS $GTK_CFLAGS"
   else
-    echo "GTK found, but need version 2.18 or higher"
+    echo "Please install gtk and gdk libraries"
     gfio="no"
   fi
-else
-  echo "Please install gtk and gdk libraries"
-  gfio="no"
 fi
 LDFLAGS=$ORG_LDFLAGS
 fi