detect both gtk2 and 3 in autoconf
authorVladimir Nadvornik <nadvornik@suse.cz>
Fri, 10 Aug 2012 20:51:57 +0000 (22:51 +0200)
committerVladimir Nadvornik <nadvornik@suse.cz>
Mon, 13 Aug 2012 19:40:06 +0000 (21:40 +0200)
configure.in

index 21553d9..7d502f6 100644 (file)
@@ -190,7 +190,13 @@ else
 fi
 
 AM_PATH_GLIB_2_0(2.4.0,,AC_MSG_ERROR(GLIB >= 2.4.0 not installed.))
-AM_PATH_GTK_2_0(2.4.0,,AC_MSG_ERROR(GTK+ >= 2.4.0 not installed.))
+AC_ARG_ENABLE([gtk3], AC_HELP_STRING([--disable-gtk3], [use gtk2 instead of gtk3]),[gtk3="${enableval}"], [gtk3=m4_ifdef([AM_PATH_GTK_3_0], [yes], [no])])
+
+if test x$gtk3 == xyes; then
+    m4_ifdef([AM_PATH_GTK_3_0], [AM_PATH_GTK_3_0(3.0.0,,AC_MSG_ERROR(GTK+ >= 3.0.0 not installed.))])
+else
+    m4_ifdef([AM_PATH_GTK_2_0], [AM_PATH_GTK_2_0(2.12.0,,AC_MSG_ERROR(GTK+ >= 2.12.0 not installed.))])
+fi
 
 threads="auto"
 AC_ARG_ENABLE([threads],