aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2010-10-06 10:58:49 -0400
committerMichael Terry <mike@mterry.name>2010-10-06 10:58:49 -0400
commitecc6acd2a576fcc11d51ded532f570fb29ab475e (patch)
tree8e754c760d81b0717b36a47942373762e1843ad5 /configure.ac
parent923a1d5b25bbc33513984d413acdad9a5d446ab9 (diff)
downloadlibayatana-indicator-ecc6acd2a576fcc11d51ded532f570fb29ab475e.tar.gz
libayatana-indicator-ecc6acd2a576fcc11d51ded532f570fb29ab475e.tar.bz2
libayatana-indicator-ecc6acd2a576fcc11d51ded532f570fb29ab475e.zip
instead of always building gtk2 and gtk3, add a --with-gtk= flag to configure to specify which to build with
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac38
1 files changed, 24 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index 7c706e9..5f4d3c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,23 +29,32 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
##############################
GTK_REQUIRED_VERSION=2.18
-GTK3_REQUIRED_VERSION=2.90
+GTK3_REQUIRED_VERSION=2.91
DBUS_REQUIRED_VERSION=0.76
GIO_UNIX_REQUIRED_VERSION=2.22
-PKG_CHECK_MODULES(LIBINDICATOR, gtk+-2.0 >= $GTK_REQUIRED_VERSION
- gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
- dbus-glib-1 >= $DBUS_REQUIRED_VERSION)
-
-AC_SUBST(LIBINDICATOR_CFLAGS)
-AC_SUBST(LIBINDICATOR_LIBS)
-
-PKG_CHECK_MODULES(LIBINDICATOR3, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
- gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
- dbus-glib-1 >= $DBUS_REQUIRED_VERSION)
-
-AC_SUBST(LIBINDICATOR3_CFLAGS)
-AC_SUBST(LIBINDICATOR3_LIBS)
+AC_ARG_WITH([gtk],
+ [AS_HELP_STRING([--with-gtk],
+ [Which version of gtk to use @<:@default=2@:>@])],
+ [],
+ [with_gtk=2])
+AS_IF([test "x$with_gtk" = x3],
+ [PKG_CHECK_MODULES(LIBINDICATOR, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
+ gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
+ dbus-glib-1 >= $DBUS_REQUIRED_VERSION)
+ AC_SUBST(LIBINDICATOR_CFLAGS)
+ AC_SUBST(LIBINDICATOR_LIBS)
+ ],
+ [test "x$with_gtk" = x2],
+ [PKG_CHECK_MODULES(LIBINDICATOR, gtk+-2.0 >= $GTK_REQUIRED_VERSION
+ gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
+ dbus-glib-1 >= $DBUS_REQUIRED_VERSION)
+ AC_SUBST(LIBINDICATOR_CFLAGS)
+ AC_SUBST(LIBINDICATOR_LIBS)
+ ],
+ [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])]
+)
+AM_CONDITIONAL(USE_GTK3, [test "x$with_gtk" = x3])
##############################
# Custom Junk
@@ -114,4 +123,5 @@ AC_MSG_NOTICE([
Libindicator Configuration:
Prefix: $prefix
+ GTK+ Version: $with_gtk
])