summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2012-03-30 07:20:18 +0000
committerPatrick Ohly <patrick.ohly@intel.com>2012-03-30 07:31:58 +0000
commiteb6e8bf55e126650ba18dd0f92290348f507f605 (patch)
tree6154274430495301a55492289fb22146db1f71be /configure.ac
parent978854fcb02c69977ce6acd69d7ab038ff3e5d92 (diff)
autotools: pick GTK3 by default only if available
"make distcheck" on a system without GTK3 failed even if the main configure was called with --enable-gtk=2. Better fall back to GTK2 automatically.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index faac7fbc..1231b09e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -404,7 +404,7 @@ AC_ARG_ENABLE(gtk,
AS_HELP_STRING([--enable-gtk=major version],
[Selects the gtk+ version ("2" or "3") to use for the UI.
If this option is used, --enable-gui should be used as well.
- "3" is the default option.]),
+ "3" is the default option if available, otherwise "2".]),
[ if test "$enableval" = "3" ; then
gtk_version=gtk+-3.0
elif test "$enableval" = "2" ; then
@@ -413,7 +413,10 @@ AC_ARG_ENABLE(gtk,
AC_MSG_ERROR([Unknown gtk version: '$enableval'])
fi
],
- [ gtk_version=gtk+-3.0 ])
+ [ PKG_CHECK_EXISTS([gtk+-3.0],
+ [gtk_version=gtk+-3.0],
+ [gtk_version=gtk+-2.0]) ])
+
AM_CONDITIONAL([COND_GTK2], [test "$gtk_version" = "gtk+-2.0"])