configure.in
branchSDL-1.2-olpc
changeset 4404 b8de86ee2ad6
parent 3935 00959c391aa6
--- a/configure.in	Thu Apr 19 07:10:05 2007 +0000
+++ b/configure.in	Thu Apr 19 07:12:30 2007 +0000
@@ -1347,6 +1347,35 @@
     fi
 }
 
+dnl Find the GTK+ includes
+CheckGTK()
+{
+    AC_ARG_ENABLE(video-gtk,
+AC_HELP_STRING([--enable-video-gtk], [use GTK+ video driver [[default=no]]]),
+                  , enable_video_gtk=no)
+    if test x$enable_video = xyes -a x$enable_video_gtk = xyes; then
+        AC_PATH_PROG(HAVEPKGCONFIG, pkg-config, $PATH)
+        if test -z "$HAVEPKGCONFIG"; then
+            AC_MSG_ERROR([*** pkg-config not found. Cannot probe for gtk+-2.0.])
+        else
+            AC_MSG_CHECKING(for GTK+ support)
+            video_gtk=no
+            $HAVEPKGCONFIG --exists gtk+-2.0
+            if test $? -eq 0 ; then
+                video_gtk=yes
+                have_video=yes
+                AC_DEFINE(SDL_VIDEO_DRIVER_GTK)
+                SOURCES="$SOURCES $srcdir/src/video/gtk/*.c"
+                GTK2_CFLAGS=`$HAVEPKGCONFIG --cflags libglade-2.0 gtk+-2.0`
+                GTK2_LIBS=`$HAVEPKGCONFIG --libs libglade-2.0 gtk+-2.0`
+                EXTRA_CFLAGS="$EXTRA_CFLAGS $GTK2_CFLAGS"
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $GTK2_LIBS"
+            fi
+            AC_MSG_RESULT($video_gtk)
+        fi
+    fi
+}
+
 dnl Set up the QTopia video driver if enabled
 CheckQtopia()
 {
@@ -2161,6 +2190,7 @@
         CheckVGL
         CheckWscons
         CheckAAlib
+        CheckGTK
         CheckQtopia
         CheckPicoGUI
         CheckOpenGLX11